diff --git a/CHANGELOG.md b/CHANGELOG.md index 8887ed37f8..d56c312bf7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ - Remove deprecated -bs-super-errors option. https://github.com/rescript-lang/rescript-compiler/pull/6814 - Some global names and old keywords are no longer prefixed. https://github.com/rescript-lang/rescript-compiler/pull/6831 - Remove ml parsing tests and conversion from `.ml` to `.res` via format. https://github.com/rescript-lang/rescript-compiler/pull/6848 +- Remove support for compiling `.ml` files, and general cleanup. https://github.com/rescript-lang/rescript-compiler/pull/6852 #### :bug: Bug Fix diff --git a/jscomp/bsb/bsb_db_util.ml b/jscomp/bsb/bsb_db_util.ml index 8b2d0d90e2..542b1456c5 100644 --- a/jscomp/bsb/bsb_db_util.ml +++ b/jscomp/bsb/bsb_db_util.ml @@ -39,13 +39,12 @@ let sanity_check (map : t) = (* invariant check: ml and mli should have the same case, same path *) -let check (x : module_info) name_sans_extension case syntax_kind +let check (x : module_info) name_sans_extension case (module_info : Bsb_db.info) = let x_ml_info = x.info in if x.name_sans_extension <> name_sans_extension || x.case <> case - || x.syntax_kind <> syntax_kind || x_ml_info = module_info || x_ml_info = Impl_intf then Bsb_exception.invalid_spec @@ -75,19 +74,14 @@ let add_basename ~(dir : string) (map : t) ?error_on_invalid_suffix basename : t if is_editor_temporary_files basename then map else let info = ref Bsb_db.Impl in - let syntax_kind = ref Bsb_db.Ml in let invalid_suffix = ref false in let file_suffix = Ext_filename.get_extension_maybe basename in (match () with - | _ when file_suffix = Literals.suffix_ml -> () - | _ when file_suffix = Literals.suffix_res -> syntax_kind := Res - | _ when file_suffix = Literals.suffix_mli -> info := Intf + | _ when file_suffix = Literals.suffix_res -> () | _ when file_suffix = Literals.suffix_resi -> - info := Intf; - syntax_kind := Res + info := Intf | _ -> invalid_suffix := true); let info = !info in - let syntax_kind = !syntax_kind in let invalid_suffix = !invalid_suffix in if invalid_suffix then match error_on_invalid_suffix with @@ -105,5 +99,5 @@ let add_basename ~(dir : string) (map : t) ?error_on_invalid_suffix basename : t let dir = Filename.dirname name_sans_extension in Map_string.adjust map module_name (fun opt_module_info -> match opt_module_info with - | None -> { dir; name_sans_extension; info; syntax_kind; case } - | Some x -> check x name_sans_extension case syntax_kind info) + | None -> { dir; name_sans_extension; info; case } + | Some x -> check x name_sans_extension case info) diff --git a/jscomp/bsb/bsb_ninja_file_groups.ml b/jscomp/bsb/bsb_ninja_file_groups.ml index e490cdf890..32c3f2f55e 100644 --- a/jscomp/bsb/bsb_ninja_file_groups.ml +++ b/jscomp/bsb/bsb_ninja_file_groups.ml @@ -40,20 +40,13 @@ let handle_generators oc (group : Bsb_file_groups.file_group) custom_rules = type suffixes = { impl : string; intf : string } -let ml_suffixes = { impl = Literals.suffix_ml; intf = Literals.suffix_mli } - let res_suffixes = { impl = Literals.suffix_res; intf = Literals.suffix_resi } let emit_module_build (rules : Bsb_ninja_rule.builtin) (package_specs : Bsb_package_specs.t) (is_dev : bool) oc namespace (module_info : Bsb_db.module_info) : unit = let has_intf_file = module_info.info = Impl_intf in - let config, ast_rule = - match module_info.syntax_kind with - | Ml -> (ml_suffixes, rules.build_ast) - | Res -> (res_suffixes, rules.build_ast_from_re) - (* FIXME: better names *) - in + let config, ast_rule = (res_suffixes, rules.build_ast_from_re) in let filename_sans_extension = module_info.name_sans_extension in let input_impl = Bsb_config.proj_rel (filename_sans_extension ^ config.impl) diff --git a/jscomp/bsb/bsb_ninja_gen.ml b/jscomp/bsb/bsb_ninja_gen.ml index 6c80ffebd4..a505fb991e 100644 --- a/jscomp/bsb/bsb_ninja_gen.ml +++ b/jscomp/bsb/bsb_ninja_gen.ml @@ -94,7 +94,7 @@ let output_installation_file cwd_lib_bs namespace files_to_install = let essentials = Ext_buffer.create 1_000 in files_to_install |> Queue.iter - (fun ({ name_sans_extension; syntax_kind; info } : Bsb_db.module_info) -> + (fun ({ name_sans_extension; info } : Bsb_db.module_info) -> let base = Filename.basename name_sans_extension in let dest = Ext_namespace_encode.make ?ns:namespace base in let ns_origin = @@ -110,22 +110,14 @@ let output_installation_file cwd_lib_bs namespace files_to_install = Ext_buffer.add_string essentials dest; Ext_buffer.add_string_char essentials Literals.suffix_cmj ' '; - let suffix = - match syntax_kind with - | Ml -> Literals.suffix_ml - | Res -> Literals.suffix_res - in - oo suffix ~dest:base ~src:(sb // name_sans_extension); + let suffix_impl = Literals.suffix_res in + oo suffix_impl ~dest:base ~src:(sb // name_sans_extension); match info with | Intf -> assert false | Impl -> () | Impl_intf -> - let suffix_b = - match syntax_kind with - | Ml -> Literals.suffix_mli - | Res -> Literals.suffix_resi - in - oo suffix_b ~dest:base ~src:(sb // name_sans_extension); + let suffix_intf = Literals.suffix_resi in + oo suffix_intf ~dest:base ~src:(sb // name_sans_extension); oo Literals.suffix_cmti ~dest ~src); (match namespace with | None -> () diff --git a/jscomp/bsb/bsb_ninja_rule.ml b/jscomp/bsb/bsb_ninja_rule.ml index 8904ee0db6..ecc96789e2 100644 --- a/jscomp/bsb/bsb_ninja_rule.ml +++ b/jscomp/bsb/bsb_ninja_rule.ml @@ -67,7 +67,6 @@ let define ~command ?dyndep ?restat rule_name : t = type command = string type builtin = { - build_ast : t; (** TODO: Implement it on top of pp_flags *) build_ast_from_re : t; (* build_ast_from_rei : t ; *) (* platform dependent, on Win32, @@ -179,7 +178,6 @@ let make_custom_rules ~(gentype_config : Bsb_config_types.gentype_config) Ext_buffer.add_string buf " -absname -bs-ast -o $out $i"; Ext_buffer.contents buf in - let build_ast = define ~command:mk_ast "ast" in let build_ast_from_re = define ~command:mk_ast "astj" in let copy_resources = @@ -223,7 +221,6 @@ let make_custom_rules ~(gentype_config : Bsb_config_types.gentype_config) ~restat:() "build_package" in { - build_ast; build_ast_from_re; (* platform dependent, on Win32, invoking cmd.exe diff --git a/jscomp/bsb/bsb_ninja_rule.mli b/jscomp/bsb/bsb_ninja_rule.mli index e5ede24173..1f77aad84a 100644 --- a/jscomp/bsb/bsb_ninja_rule.mli +++ b/jscomp/bsb/bsb_ninja_rule.mli @@ -32,7 +32,6 @@ val get_name : t -> out_channel -> string (***********************************************************) type builtin = { - build_ast : t; build_ast_from_re : t; (* platform dependent, on Win32, invoking cmd.exe diff --git a/jscomp/bsb_exe/rescript_main.ml b/jscomp/bsb_exe/rescript_main.ml index 3e29b33c6e..7498116934 100644 --- a/jscomp/bsb_exe/rescript_main.ml +++ b/jscomp/bsb_exe/rescript_main.ml @@ -197,14 +197,12 @@ let info_subcommand ~start argv = | Some { file_groups = { files } } -> Ext_list.iter files (fun { sources } -> Map_string.iter sources - (fun _ { info; syntax_kind; name_sans_extension } -> + (fun _ { info; name_sans_extension } -> let extensions = - match (syntax_kind, info) with - | _, Intf -> assert false - | Ml, Impl -> [ ".ml" ] - | Ml, Impl_intf -> [ ".ml"; ".mli" ] - | Res, Impl -> [ ".res" ] - | Res, Impl_intf -> [ ".res"; ".resi" ] + match info with + | Intf -> assert false + | Impl -> [ ".res" ] + | Impl_intf -> [ ".res"; ".resi" ] in Ext_list.iter extensions (fun x -> print_endline (name_sans_extension ^ x))))) diff --git a/jscomp/bsc/rescript_compiler_main.ml b/jscomp/bsc/rescript_compiler_main.ml index 6ff19ca230..e0da2d6364 100644 --- a/jscomp/bsc/rescript_compiler_main.ml +++ b/jscomp/bsc/rescript_compiler_main.ml @@ -18,18 +18,8 @@ let set_abs_input_name sourcefile = else sourcefile in Location.set_input_name sourcefile; sourcefile - -type syntax_kind = [`ml | `rescript] -let setup_compiler_printer (syntax_kind : [ syntax_kind | `default])= - (match syntax_kind with - | `default -> () - | #syntax_kind as k -> Config.syntax_kind := k); - let syntax_kind = !Config.syntax_kind in - if syntax_kind = `rescript then begin - Lazy.force Res_outcome_printer.setup - end - - +let setup_outcome_printer () = + Lazy.force Res_outcome_printer.setup let setup_runtime_path path = let u0 = Filename.dirname path in @@ -51,53 +41,37 @@ let process_file sourcefile ?(kind ) ppf = properly *) let uncurried = !Config.uncurried in + setup_outcome_printer (); let kind = match kind with | None -> Ext_file_extensions.classify_input (Ext_filename.get_extension_maybe sourcefile) | Some kind -> kind in let res = match kind with - | Ml -> - let sourcefile = set_abs_input_name sourcefile in - setup_compiler_printer `ml; - Js_implementation.implementation - ~parser:Pparse_driver.parse_implementation - ppf sourcefile - | Mli -> - let sourcefile = set_abs_input_name sourcefile in - setup_compiler_printer `ml; - Js_implementation.interface - ~parser:Pparse_driver.parse_interface - ppf sourcefile | Res -> let sourcefile = set_abs_input_name sourcefile in - setup_compiler_printer `rescript; Js_implementation.implementation ~parser:(Res_driver.parse_implementation ~ignore_parse_errors:!Clflags.ignore_parse_errors) ppf sourcefile | Resi -> let sourcefile = set_abs_input_name sourcefile in - setup_compiler_printer `rescript; Js_implementation.interface ~parser:(Res_driver.parse_interface ~ignore_parse_errors:!Clflags.ignore_parse_errors) ppf sourcefile | Intf_ast -> Js_implementation.interface_mliast ppf sourcefile - setup_compiler_printer (* The printer setup is done in the runtime depends on the content of ast *) | Impl_ast -> - Js_implementation.implementation_mlast ppf sourcefile - setup_compiler_printer + Js_implementation.implementation_mlast ppf sourcefile | Mlmap -> Location.set_input_name sourcefile; Js_implementation.implementation_map ppf sourcefile | Cmi -> - setup_compiler_printer `default; let cmi_sign = (Cmi_format.read_cmi sourcefile).cmi_sign in Printtyp.signature Format.std_formatter cmi_sign ; Format.pp_print_newline Format.std_formatter () @@ -182,22 +156,12 @@ let anonymous ~(rev_args : string list) = Bsc_args.bad_arg "can not handle multiple files" end -(** used by -impl -intf *) -let impl filename = - Js_config.js_stdout := false; - process_file filename ~kind:Ml ppf ;; -let intf filename = - Js_config.js_stdout := false ; - process_file filename ~kind:Mli ppf;; - - let format_file input = let ext = Ext_file_extensions.classify_input (Ext_filename.get_extension_maybe input) in - let syntax = - match ext with - | Res | Resi -> `res - | _ -> Bsc_args.bad_arg ("don't know what to do with " ^ input) in - let formatted = Res_multi_printer.print ~ignore_parse_errors:!Clflags.ignore_parse_errors syntax ~input in + ( match ext with + | Res | Resi -> () + | _ -> Bsc_args.bad_arg ("don't know what to do with " ^ input) ); + let formatted = Res_multi_printer.print ~ignore_parse_errors:!Clflags.ignore_parse_errors input in match !Clflags.output_name with | None -> output_string stdout formatted @@ -342,9 +306,6 @@ let buckle_script_flags : (string * Bsc_args.spec * string) array = "-unboxed-types", set Clflags.unboxed_types, "*internal* Unannotated unboxable types will be unboxed"; - "-bs-ml-out", unit_call (fun _ -> Config.syntax_kind := `ml), - "*internal* Print compiler output in ML syntax"; - "-bs-D", string_call define_variable, "Define conditional variable e.g, -D DEBUG=true"; @@ -407,12 +368,6 @@ let buckle_script_flags : (string * Bsc_args.spec * string) array = "-bs-loc", set Clflags.dump_location, "*internal* dont display location with -dtypedtree, -dparsetree"; - "-impl", string_call impl, - "*internal* Compile as a .ml file"; - - "-intf", string_call intf, - "*internal* Compile as a .mli file"; - "-dtypedtree", set Clflags.dump_typedtree, "*internal* debug typedtree"; diff --git a/jscomp/core/bs_conditional_initial.ml b/jscomp/core/bs_conditional_initial.ml index 51230157e3..9fa5e8d2c3 100644 --- a/jscomp/core/bs_conditional_initial.ml +++ b/jscomp/core/bs_conditional_initial.ml @@ -32,7 +32,6 @@ let setup_env () = Matching.call_switcher_variant_constr := Polyvar_pattern_match.call_switcher_variant_constr; Ctype.variant_is_subtype := Matching_polyfill.variant_is_subtype; Clflags.dump_location := false; - Config.syntax_kind := `rescript; Parmatch.print_res_pat := Pattern_printer.print_pattern; (* default true otherwise [bsc -I sc src/hello.ml ] will include current directory to search path diff --git a/jscomp/core/js_implementation.ml b/jscomp/core/js_implementation.ml index e26a6abe3f..9bf84c8264 100644 --- a/jscomp/core/js_implementation.ml +++ b/jscomp/core/js_implementation.ml @@ -96,9 +96,9 @@ let interface ~parser ppf ?outputprefix fname = |> print_if_pipe ppf Clflags.dump_source Pprintast.signature |> after_parsing_sig ppf outputprefix -let interface_mliast ppf fname setup = +let interface_mliast ppf fname = Res_compmisc.init_path (); - Binary_ast.read_ast_exn ~fname Mli setup + Binary_ast.read_ast_exn ~fname Mli |> print_if_pipe ppf Clflags.dump_parsetree Printast.interface |> print_if_pipe ppf Clflags.dump_source Pprintast.signature |> after_parsing_sig ppf (Config_util.output_prefix fname) @@ -187,9 +187,9 @@ let implementation ~parser ppf ?outputprefix fname = |> print_if_pipe ppf Clflags.dump_source Pprintast.structure |> after_parsing_impl ppf outputprefix -let implementation_mlast ppf fname setup = +let implementation_mlast ppf fname = Res_compmisc.init_path (); - Binary_ast.read_ast_exn ~fname Ml setup + Binary_ast.read_ast_exn ~fname Ml |> print_if_pipe ppf Clflags.dump_parsetree Printast.implementation |> print_if_pipe ppf Clflags.dump_source Pprintast.structure |> after_parsing_impl ppf (Config_util.output_prefix fname) diff --git a/jscomp/core/js_implementation.mli b/jscomp/core/js_implementation.mli index 7a6f3a9751..c86fe4c688 100644 --- a/jscomp/core/js_implementation.mli +++ b/jscomp/core/js_implementation.mli @@ -36,7 +36,7 @@ val interface : *) val interface_mliast : - Format.formatter -> string -> ([ `ml | `rescript | `default ] -> unit) -> unit + Format.formatter -> string -> unit (* val after_parsing_impl : Format.formatter -> @@ -57,6 +57,6 @@ val implementation : (** [implementation ppf sourcefile outprefix] compiles to JS directly *) val implementation_mlast : - Format.formatter -> string -> ([ `ml | `rescript | `default ] -> unit) -> unit + Format.formatter -> string -> unit val implementation_map : Format.formatter -> string -> unit diff --git a/jscomp/core/pparse_driver.ml b/jscomp/core/pparse_driver.ml deleted file mode 100644 index 601a4fe585..0000000000 --- a/jscomp/core/pparse_driver.ml +++ /dev/null @@ -1,72 +0,0 @@ -(* Optionally preprocess a source file *) - -let call_external_preprocessor sourcefile pp = - let tmpfile = Filename.temp_file "ocamlpp" "" in - let comm = - Printf.sprintf "%s %s > %s" pp (Filename.quote sourcefile) tmpfile - in - if Ccomp.command comm <> 0 then ( - Misc.remove_file tmpfile; - Cmd_ast_exception.cannot_run comm); - tmpfile - -let preprocess sourcefile = - match !Clflags.preprocessor with - | None -> sourcefile - | Some pp -> call_external_preprocessor sourcefile pp - -let remove_preprocessed inputfile = - if !Clflags.preprocessor <> None then Misc.remove_file inputfile - -(* Parse a file or get a dumped syntax tree from it *) - -let parse (type a) (kind : a Ml_binary.kind) : _ -> a = - match kind with - | Ml_binary.Ml -> Parse.implementation - | Ml_binary.Mli -> Parse.interface - -let file_aux inputfile (type a) (parse_fun : _ -> a) (kind : a Ml_binary.kind) : - a = - let ast_magic = Ml_binary.magic_of_kind kind in - let ic = open_in_bin inputfile in - let is_ast_file = - match really_input_string ic (String.length ast_magic) with - | exception _ -> false - | buffer -> - if buffer = ast_magic then true - else if Ext_string.starts_with buffer "Caml1999" then - Cmd_ast_exception.wrong_magic buffer - else false - in - let ast = - try - if is_ast_file then ( - Location.set_input_name (input_value ic : string); - (input_value ic : a)) - else ( - seek_in ic 0; - let lexbuf = Lexing.from_channel ic in - Location.init lexbuf inputfile; - parse_fun lexbuf) - with x -> - close_in ic; - raise x - in - close_in ic; - ast - -let parse_file (type a) (kind : a Ml_binary.kind) (sourcefile : string) : a = - Location.set_input_name sourcefile; - let inputfile = preprocess sourcefile in - let ast = - try file_aux inputfile (parse kind) kind - with exn -> - remove_preprocessed inputfile; - raise exn - in - remove_preprocessed inputfile; - ast - -let parse_implementation sourcefile = parse_file Ml sourcefile - -let parse_interface sourcefile = parse_file Mli sourcefile diff --git a/jscomp/core/pparse_driver.mli b/jscomp/core/pparse_driver.mli deleted file mode 100644 index b87dcd0f79..0000000000 --- a/jscomp/core/pparse_driver.mli +++ /dev/null @@ -1,3 +0,0 @@ -val parse_implementation : string -> Parsetree.structure - -val parse_interface : string -> Parsetree.signature diff --git a/jscomp/depends/binary_ast.ml b/jscomp/depends/binary_ast.ml index 645b6395d9..73a9a0c7f9 100644 --- a/jscomp/depends/binary_ast.ml +++ b/jscomp/depends/binary_ast.ml @@ -29,7 +29,7 @@ type 'a kind = 'a Ml_binary.kind = | Ml : Parsetree.structure kind | Mli : Parsetree.signature kind -let read_ast_exn (type t) ~fname (_ : t kind) setup : t = +let read_ast_exn (type t) ~fname (_ : t kind) : t = let ic = open_in_bin fname in let dep_size = input_binary_int ic in seek_in ic (pos_in ic + dep_size); @@ -37,12 +37,6 @@ let read_ast_exn (type t) ~fname (_ : t kind) setup : t = Location.set_input_name sourcefile; let ast = input_value ic in close_in ic; - (match - Ext_file_extensions.classify_input - (Ext_filename.get_extension_maybe sourcefile) - with - | Res | Resi -> setup `rescript - | _ -> ()); ast let magic_sep_char = '\n' diff --git a/jscomp/depends/binary_ast.mli b/jscomp/depends/binary_ast.mli index 48c58fc955..c349be4536 100644 --- a/jscomp/depends/binary_ast.mli +++ b/jscomp/depends/binary_ast.mli @@ -25,7 +25,7 @@ type _ kind = Ml : Parsetree.structure kind | Mli : Parsetree.signature kind val read_ast_exn : - fname:string -> 'a kind -> ([ `ml | `rescript | `default ] -> unit) -> 'a + fname:string -> 'a kind -> 'a val magic_sep_char : char diff --git a/jscomp/ext/bsb_db.ml b/jscomp/ext/bsb_db.ml index 001824a5fc..6ce515499c 100644 --- a/jscomp/ext/bsb_db.ml +++ b/jscomp/ext/bsb_db.ml @@ -31,12 +31,10 @@ type info = | Impl | Impl_intf -type syntax_kind = Ml | Res type module_info = { mutable info : info; dir : string; - syntax_kind : syntax_kind; case : bool; name_sans_extension : string; } diff --git a/jscomp/ext/bsb_db.mli b/jscomp/ext/bsb_db.mli index 31df8b6855..d4a8cfe43a 100644 --- a/jscomp/ext/bsb_db.mli +++ b/jscomp/ext/bsb_db.mli @@ -37,16 +37,10 @@ type info = | Impl | Impl_intf -type syntax_kind = Ml | Res type module_info = { mutable info : info; dir : string; - syntax_kind : syntax_kind; - (* This is actually not stored in bsbuild meta info - since creating .d file only emit .cmj/.cmi dependencies, so it does not - need know which syntax it is written - *) case : bool; name_sans_extension : string; } diff --git a/jscomp/ext/config.ml b/jscomp/ext/config.ml index 6806968410..dd5ec9aea0 100644 --- a/jscomp/ext/config.ml +++ b/jscomp/ext/config.ml @@ -7,8 +7,6 @@ let standard_library = let standard_library_default = standard_library -let syntax_kind = ref `ml - let bs_only = ref true let unsafe_empty_array = ref false diff --git a/jscomp/ext/config.mli b/jscomp/ext/config.mli index 34c0ce584a..677e750206 100644 --- a/jscomp/ext/config.mli +++ b/jscomp/ext/config.mli @@ -21,8 +21,6 @@ val version : string val standard_library : string (* The directory containing the standard libraries *) -val syntax_kind : [ `ml | `rescript ] ref - val bs_only : bool ref val unsafe_empty_array : bool ref diff --git a/jscomp/ext/ext_file_extensions.ml b/jscomp/ext/ext_file_extensions.ml index 2cce993a5f..8cd52c5691 100644 --- a/jscomp/ext/ext_file_extensions.ml +++ b/jscomp/ext/ext_file_extensions.ml @@ -1,6 +1,4 @@ type valid_input = - | Ml - | Mli | Res | Resi | Intf_ast @@ -16,8 +14,6 @@ type valid_input = let classify_input ext = match () with - | _ when ext = Literals.suffix_ml -> Ml - | _ when ext = Literals.suffix_mli -> Mli | _ when ext = Literals.suffix_ast -> Impl_ast | _ when ext = Literals.suffix_iast -> Intf_ast | _ when ext = Literals.suffix_mlmap -> Mlmap diff --git a/jscomp/ext/literals.ml b/jscomp/ext/literals.ml index ad38631930..34163c0c6d 100644 --- a/jscomp/ext/literals.ml +++ b/jscomp/ext/literals.ml @@ -99,10 +99,6 @@ let suffix_cmxa = ".cmxa" let suffix_mll = ".mll" -let suffix_ml = ".ml" - -let suffix_mli = ".mli" - let suffix_res = ".res" let suffix_resi = ".resi" diff --git a/jscomp/ext/warnings.ml b/jscomp/ext/warnings.ml index f9f063d3fe..ed53ecd69a 100644 --- a/jscomp/ext/warnings.ml +++ b/jscomp/ext/warnings.ml @@ -367,13 +367,8 @@ let message = function "this statement never returns (or has an unsound type.)" | Preprocessor s -> s | Useless_record_with -> ( - match !Config.syntax_kind with - | `ml -> - "all the fields are explicitly listed in this record:\n\ - the 'with' clause is useless." - | `rescript -> - "All the fields are already explicitly listed in this record. You \ - can remove the `...` spread.") + "All the fields are already explicitly listed in this record. You \ + can remove the `...` spread.") | Bad_module_name modname -> "This file's name is potentially invalid. The build systems \ conventionally turn a file name into a module name by upper-casing the \ diff --git a/jscomp/frontend/bs_ast_invariant.ml b/jscomp/frontend/bs_ast_invariant.ml index 6b2e292dc8..1b562e33d8 100644 --- a/jscomp/frontend/bs_ast_invariant.ml +++ b/jscomp/frontend/bs_ast_invariant.ml @@ -84,8 +84,7 @@ let emit_external_warnings : iterator = match str_item.pstr_desc with | Pstr_type ( Nonrecursive, - [{ptype_kind = Ptype_variant ({pcd_res = Some _} :: _)}] ) - when !Config.syntax_kind = `rescript -> + [{ptype_kind = Ptype_variant ({pcd_res = Some _} :: _)}] ) -> Location.raise_errorf ~loc:str_item.pstr_loc "GADT has to be recursive types, please try `type rec'" | Pstr_class _ -> diff --git a/jscomp/jsoo/jsoo_playground_main.ml b/jscomp/jsoo/jsoo_playground_main.ml index 4b0399c959..bbd4cafe84 100644 --- a/jscomp/jsoo/jsoo_playground_main.ml +++ b/jscomp/jsoo/jsoo_playground_main.ml @@ -51,7 +51,7 @@ * v4: Added `config.open_modules` to the BundleConfig to enable implicitly opened * modules in the playground. * *) -let api_version = "4" +let api_version = "5" module Js = Js_of_ocaml.Js @@ -60,15 +60,13 @@ let export (field : string) v = ;; module Lang = struct - type t = OCaml | Res + type t = Res let from_string t = match t with - | "ocaml" | "ml" -> Some OCaml | "res" -> Some Res | _ -> None let to_string t = match t with - | OCaml -> "ml" | Res -> "res" end @@ -221,15 +219,6 @@ let get_filename ~(lang: Lang.t) opt = | Some fname -> fname | None -> BundleConfig.default_filename lang -let lexbuf_from_string ~filename str = - let lexbuf = Lexing.from_string str in - lexbuf.lex_start_p <- { lexbuf.lex_start_p with pos_fname = filename }; - lexbuf.lex_curr_p <- { lexbuf.lex_curr_p with pos_fname = filename }; - lexbuf - -let ocaml_parse ~filename str = - lexbuf_from_string ~filename str |> Parse.implementation - module ResDriver = struct (* For now we are basically overriding functionality from Res_driver *) open Res_driver @@ -367,8 +356,6 @@ module Compile = struct | Typetexp.Error _ | Typecore.Error _ | Typemod.Error _ -> "type_error" - | Lexer.Error _ - | Syntaxerr.Error _ -> "syntax_error" | _ -> "other_error" in let full_msg = @@ -473,10 +460,7 @@ module Compile = struct Warnings.parse_options false warn_flags; let filename = get_filename ~lang config.filename in let modulename = "Playground" in - let impl = match lang with - | Lang.OCaml -> ocaml_parse ~filename - | Res -> rescript_parse ~filename - in + let impl = rescript_parse ~filename in Clflags.open_modules := open_modules; (* let env = !Toploop.toplevel_env in *) (* Res_compmisc.init_path (); *) @@ -529,19 +513,6 @@ module Compile = struct let filename = get_filename ~lang:from filename in try let code = match (from, to_) with - | (OCaml, Res) -> - let structure = - src - |> lexbuf_from_string ~filename - |> Parse.implementation - in - Res_printer.print_implementation ~width:80 structure ~comments:[] - | (Res, OCaml) -> - let (structure, _) = - ResDriver.parse_implementation ~for_printer:false ~sourcefile:filename ~src - in - Pprintast.structure Format.str_formatter structure; - Format.flush_str_formatter () | (Res, Res) -> (* Essentially pretty printing. * IMPORTANT: we need forPrinter:true when parsing code here, @@ -550,7 +521,6 @@ module Compile = struct ResDriver.parse_implementation ~for_printer:true ~sourcefile:filename ~src in Res_printer.print_implementation ~width:80 structure ~comments - | (OCaml, OCaml) -> src in Js.Unsafe.(obj [| "code", inject @@ Js.string code; @@ -571,7 +541,6 @@ let () = module Export = struct let make_compiler ~config ~lang = - let open Lang in let open Js.Unsafe in let base_attrs = [|"compile", @@ -581,24 +550,16 @@ module Export = struct (Compile.implementation ~config ~lang (Js.to_string code))); "version", inject @@ - Js.string - (match lang with - | Res -> Bs_version.version - | OCaml -> Sys.ocaml_version); + Js.string Bs_version.version; |] in let attrs = - if lang != OCaml then - Array.append base_attrs [| - ("format", - inject @@ - Js.wrap_meth_callback - (fun _ code -> - (match lang with - | OCaml -> ErrorRet.make_unexpected_error ("OCaml pretty printing not supported") - | _ -> Compile.syntax_format ?filename:config.filename ~from:lang ~to_:lang (Js.to_string code)))) - |] - else - base_attrs + Array.append base_attrs [| + ("format", + inject @@ + Js.wrap_meth_callback + (fun _ code -> + (Compile.syntax_format ?filename:config.filename ~from:lang ~to_:lang (Js.to_string code)))) + |] in obj attrs @@ -639,8 +600,6 @@ module Export = struct Js.Unsafe.(obj [| "version", inject @@ Js.string Bs_version.version; - "ocaml", - inject @@ make_compiler ~config ~lang:OCaml; "rescript", inject @@ make_compiler ~config ~lang:Res; "convertSyntax", diff --git a/jscomp/ml/cmt_format.ml b/jscomp/ml/cmt_format.ml index b3a6b66838..ff83baa422 100644 --- a/jscomp/ml/cmt_format.ml +++ b/jscomp/ml/cmt_format.ml @@ -188,7 +188,7 @@ let save_cmt filename modname binary_annots sourcefile initial_env cmi = cmt_modname = modname; cmt_annots = clear_env binary_annots; cmt_value_dependencies = !value_deps; - cmt_comments = Lexer.comments (); + cmt_comments = []; cmt_args = Sys.argv; cmt_sourcefile = sourcefile; cmt_builddir = Sys.getcwd (); diff --git a/jscomp/ml/dune b/jscomp/ml/dune index c7b015ae77..c260df229a 100644 --- a/jscomp/ml/dune +++ b/jscomp/ml/dune @@ -7,5 +7,3 @@ (flags (:standard -w +a-4-42-40-41-44-45-9-48-67-70)) (libraries ext js_parser)) - -(ocamllex lexer) diff --git a/jscomp/ml/lexer.mli b/jscomp/ml/lexer.mli deleted file mode 100644 index 2388b9b312..0000000000 --- a/jscomp/ml/lexer.mli +++ /dev/null @@ -1,65 +0,0 @@ -(**************************************************************************) -(* *) -(* OCaml *) -(* *) -(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *) -(* *) -(* Copyright 1996 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. *) -(* *) -(**************************************************************************) - -(* The lexical analyzer *) - -val init : unit -> unit -val token: Lexing.lexbuf -> Parser.token -val skip_hash_bang: Lexing.lexbuf -> unit - - -type 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 - | Invalid_literal of string - | Invalid_directive of string * string option - -;; - -exception Error of error * Location.t - - - -val in_comment : unit -> bool;; -val in_string : unit -> bool;; - - -val print_warnings : bool ref -val handle_docstrings: bool ref -val comments : unit -> (string * Location.t) list -val token_with_comments : Lexing.lexbuf -> Parser.token - -(* - [set_preprocessor init preprocessor] registers [init] as the function -to call to initialize the preprocessor when the lexer is initialized, -and [preprocessor] a function that is called when a new token is needed -by the parser, as [preprocessor lexer lexbuf] where [lexer] is the -lexing function. - -When a preprocessor is configured by calling [set_preprocessor], the lexer -changes its behavior to accept backslash-newline as a token-separating blank. -*) - -val set_preprocessor : - (unit -> unit) -> - ((Lexing.lexbuf -> Parser.token) -> Lexing.lexbuf -> Parser.token) -> - unit - - - diff --git a/jscomp/ml/lexer.mll b/jscomp/ml/lexer.mll deleted file mode 100644 index 3663fd3d33..0000000000 --- a/jscomp/ml/lexer.mll +++ /dev/null @@ -1,792 +0,0 @@ -(**************************************************************************) -(* *) -(* OCaml *) -(* *) -(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *) -(* *) -(* Copyright 1996 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. *) -(* *) -(**************************************************************************) - -(* The lexer definition *) - -{ -open Lexing -open Misc -open Parser - -type 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 - | Invalid_literal of string - | Invalid_directive of string * string option -;; - -exception Error of error * Location.t;; - -(* The table of keywords *) - -let keyword_table = - 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; - "function", FUNCTION; - "functor", FUNCTOR; - "if", IF; - "in", IN; - "include", INCLUDE; - "inherit", INHERIT; - "initializer", INITIALIZER; - "lazy", LAZY; - "let", LET; - "match", MATCH; - "method", METHOD; - "module", MODULE; - "mutable", MUTABLE; - "new", NEW; - "nonrec", NONREC; - "object", OBJECT; - "of", OF; - "open", OPEN; - "or", OR; -(* "parser", PARSER; *) - "private", PRIVATE; - "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; - - "lor", INFIXOP3("lor"); (* Should be INFIXOP2 *) - "lxor", INFIXOP3("lxor"); (* Should be INFIXOP2 *) - "mod", INFIXOP3("mod"); - "land", INFIXOP3("land"); - "lsl", INFIXOP4("lsl"); - "lsr", INFIXOP4("lsr"); - "asr", INFIXOP4("asr") -] - -(* To buffer string literals *) - -let string_buffer = Buffer.create 256 -let reset_string_buffer () = Buffer.reset string_buffer -let get_stored_string () = Buffer.contents string_buffer - -let store_string_char c = Buffer.add_char string_buffer c -let store_string_utf_8_uchar u = Buffer.add_utf_8_uchar string_buffer u -let store_string s = Buffer.add_string string_buffer s -let store_lexeme lexbuf = store_string (Lexing.lexeme lexbuf) - -(* To store the position of the beginning of a string and comment *) -let string_start_loc = ref Location.none;; -let comment_start_loc = ref [];; -let in_comment () = !comment_start_loc <> [];; -let is_in_string = ref false -let in_string () = !is_in_string -let print_warnings = ref true - -(* Escaped chars are interpreted in strings unless they are in comments. *) -let store_escaped_char lexbuf c = - if in_comment () then store_lexeme lexbuf else store_string_char c - -let store_escaped_uchar lexbuf u = - if in_comment () then store_lexeme lexbuf else store_string_utf_8_uchar u - -let with_comment_buffer comment lexbuf = - let start_loc = Location.curr lexbuf in - comment_start_loc := [start_loc]; - reset_string_buffer (); - let end_loc = comment lexbuf in - let s = get_stored_string () in - reset_string_buffer (); - let loc = { start_loc with Location.loc_end = end_loc.Location.loc_end } in - s, loc - -(* To translate escape sequences *) - -let hex_digit_value d = (* assert (d in '0'..'9' 'a'..'f' 'A'..'F') *) - let d = Char.code d in - if d >= 97 then d - 87 else - if d >= 65 then d - 55 else - d - 48 - -let hex_num_value lexbuf ~first ~last = - let rec loop acc i = match i > last with - | true -> acc - | false -> - let value = hex_digit_value (Lexing.lexeme_char lexbuf i) in - loop (16 * acc + value) (i + 1) - in - loop 0 first - -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 not (Uchar.is_valid c ) then - if in_comment () - then 'x' - else raise (Error(Illegal_escape (Lexing.lexeme lexbuf), - Location.curr lexbuf)) - else (Obj.magic (c : int) : char) - -let char_for_octal_code lexbuf i = - let c = 64 * (Char.code(Lexing.lexeme_char lexbuf i) - 48) + - 8 * (Char.code(Lexing.lexeme_char lexbuf (i+1)) - 48) + - (Char.code(Lexing.lexeme_char lexbuf (i+2)) - 48) in - Char.chr c - -let char_for_hexadecimal_code lexbuf i = - let byte = hex_num_value lexbuf ~first:i ~last:(i+1) in - Char.chr byte - -let uchar_for_uchar_escape lexbuf = - let err e = - raise - (Error (Illegal_escape (Lexing.lexeme lexbuf ^ e), Location.curr lexbuf)) - in - let len = Lexing.lexeme_end lexbuf - Lexing.lexeme_start lexbuf in - let first = 3 (* skip opening \u{ *) in - let last = len - 2 (* skip closing } *) in - let digit_count = last - first + 1 in - match digit_count > 6 with - | true -> err ", too many digits, expected 1 to 6 hexadecimal digits" - | false -> - let cp = hex_num_value lexbuf ~first ~last in - if Uchar.is_valid cp then Uchar.unsafe_of_int cp else - err (", " ^ Printf.sprintf "%X" cp ^ " is not a Unicode scalar value") - -(* recover the name from a LABEL or OPTLABEL token *) - -let get_label_name lexbuf = - let s = Lexing.lexeme lexbuf in - let name = String.sub s 1 (String.length s - 2) in - if Hashtbl.mem keyword_table name then - raise (Error(Keyword_as_label name, Location.curr lexbuf)); - name -;; - -(* 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; - } -;; - -let preprocessor = ref None - -let escaped_newlines = ref false - - -let handle_docstrings = ref true -let comment_list = ref [] - -let add_comment com = - comment_list := com :: !comment_list - -let add_docstring_comment ds = - let com = - ("*" ^ Docstrings.docstring_body ds, Docstrings.docstring_loc ds) - in - add_comment com - -let comments () = List.rev !comment_list - -(* Error report *) - -open Format - -let report_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" - (Location.print_error "") loc - | Keyword_as_label kwd -> - fprintf ppf "`%s' is a keyword, it cannot be used as label name" kwd - | Invalid_literal s -> - fprintf ppf "Invalid literal %s" s - | Invalid_directive (dir, explanation) -> - fprintf ppf "Invalid lexer directive %S" dir; - begin match explanation with - | None -> () - | Some expl -> fprintf ppf ": %s" expl - end - -let () = - Location.register_error_of_exn - (function - | Error (err, loc) -> - Some (Location.error_of_printer loc report_error err) - | _ -> - None - ) - -} - -let newline = ('\013'* '\010') -let blank = [' ' '\009' '\012'] -let lowercase = ['a'-'z' '_'] -let uppercase = ['A'-'Z'] -let identchar = ['A'-'Z' 'a'-'z' '_' '\'' '0'-'9'] -let symbolchar = - ['!' '$' '%' '&' '*' '+' '-' '.' '/' ':' '<' '=' '>' '?' '@' '^' '|' '~'] -let dotsymbolchar = - ['!' '$' '%' '&' '*' '+' '-' '/' ':' '=' '>' '?' '@' '^' '|' '~'] -let decimal_literal = - ['0'-'9'] ['0'-'9' '_']* -let hex_digit = - ['0'-'9' 'A'-'F' 'a'-'f'] -let hex_literal = - '0' ['x' 'X'] ['0'-'9' 'A'-'F' 'a'-'f']['0'-'9' 'A'-'F' 'a'-'f' '_']* -let oct_literal = - '0' ['o' 'O'] ['0'-'7'] ['0'-'7' '_']* -let bin_literal = - '0' ['b' 'B'] ['0'-'1'] ['0'-'1' '_']* -let int_literal = - decimal_literal | hex_literal | oct_literal | bin_literal -let float_literal = - ['0'-'9'] ['0'-'9' '_']* - ('.' ['0'-'9' '_']* )? - (['e' 'E'] ['+' '-']? ['0'-'9'] ['0'-'9' '_']* )? -let hex_float_literal = - '0' ['x' 'X'] - ['0'-'9' 'A'-'F' 'a'-'f'] ['0'-'9' 'A'-'F' 'a'-'f' '_']* - ('.' ['0'-'9' 'A'-'F' 'a'-'f' '_']* )? - (['p' 'P'] ['+' '-']? ['0'-'9'] ['0'-'9' '_']* )? -let literal_modifier = ['G'-'Z' 'g'-'z'] - -rule token = parse - | "\\" newline { - if not !escaped_newlines then - raise (Error(Illegal_character (Lexing.lexeme_char lexbuf 0), - Location.curr lexbuf)); - update_loc lexbuf None 1 false 0; - token lexbuf } - | newline - { update_loc lexbuf None 1 false 0; - EOL } - | blank + - { token lexbuf } - | "_" - { UNDERSCORE } - | "~" - { TILDE } - | "~" lowercase identchar * ':' - { LABEL (get_label_name lexbuf) } - | "?" - { QUESTION } - | "?" lowercase identchar * ':' - { OPTLABEL (get_label_name lexbuf) } - | lowercase identchar * - { let s = Lexing.lexeme lexbuf in - try Hashtbl.find keyword_table s - with Not_found -> LIDENT s } - | uppercase identchar * - { UIDENT(Lexing.lexeme lexbuf) } (* No capitalized keywords *) - | int_literal { INT (Lexing.lexeme lexbuf, None) } - | (int_literal as lit) (literal_modifier as modif) - { INT (lit, Some modif) } - | float_literal | hex_float_literal - { FLOAT (Lexing.lexeme lexbuf, None) } - | ((float_literal | hex_float_literal) as lit) (literal_modifier as modif) - { FLOAT (lit, Some modif) } - | (float_literal | hex_float_literal | int_literal) identchar+ - { raise (Error(Invalid_literal (Lexing.lexeme lexbuf), - Location.curr lexbuf)) } - | "\"" - { reset_string_buffer(); - is_in_string := true; - let string_start = lexbuf.lex_start_p in - string_start_loc := Location.curr lexbuf; - string lexbuf; - is_in_string := false; - lexbuf.lex_start_p <- string_start; - STRING (get_stored_string(), None) } - | "{" lowercase* "|" - { reset_string_buffer(); - let delim = Lexing.lexeme lexbuf in - let delim = String.sub delim 1 (String.length delim - 2) in - is_in_string := true; - let string_start = lexbuf.lex_start_p in - string_start_loc := Location.curr lexbuf; - quoted_string delim lexbuf; - is_in_string := false; - lexbuf.lex_start_p <- string_start; - STRING (get_stored_string(), Some delim) } - | "\'" newline "\'" - { update_loc lexbuf None 1 false 1; - CHAR (Lexing.lexeme_char lexbuf 1) } - | "\'" [^ '\\' '\'' '\010' '\013'] "\'" - { CHAR(Lexing.lexeme_char lexbuf 1) } - | "\'\\" ['\\' '\'' '\"' 'n' 't' 'b' 'r' ' '] "\'" - { CHAR(char_for_backslash (Lexing.lexeme_char lexbuf 2)) } - | "\'\\" ['0'-'9'] ['0'-'9'] ['0'-'9'] "\'" - { CHAR(char_for_decimal_code lexbuf 2) } - | "\'\\" 'o' ['0'-'3'] ['0'-'7'] ['0'-'7'] "\'" - { CHAR(char_for_octal_code lexbuf 3) } - | "\'\\" 'x' ['0'-'9' 'a'-'f' 'A'-'F'] ['0'-'9' 'a'-'f' 'A'-'F'] "\'" - { CHAR(char_for_hexadecimal_code lexbuf 3) } - | "\'\\" _ - { let l = Lexing.lexeme lexbuf in - let esc = String.sub l 1 (String.length l - 1) in - raise (Error(Illegal_escape esc, Location.curr lexbuf)) - } - | "(*" - { let s, loc = with_comment_buffer comment lexbuf in - COMMENT (s, loc) } - | "(**" - { let s, loc = with_comment_buffer comment lexbuf in - if !handle_docstrings then - DOCSTRING (Docstrings.docstring s loc) - else - COMMENT ("*" ^ s, loc) - } - | "(**" (('*'+) as stars) - { let s, loc = - with_comment_buffer - (fun lexbuf -> - store_string ("*" ^ stars); - comment lexbuf) - lexbuf - in - COMMENT (s, loc) } - | "(*)" - { if !print_warnings then - Location.prerr_warning (Location.curr lexbuf) Warnings.Comment_start; - let s, loc = with_comment_buffer comment lexbuf in - COMMENT (s, loc) } - | "(*" (('*'*) as stars) "*)" - { if !handle_docstrings && stars="" then - (* (**) is an empty docstring *) - DOCSTRING(Docstrings.docstring "" (Location.curr lexbuf)) - else - COMMENT (stars, Location.curr lexbuf) } - | "*)" - { let loc = Location.curr lexbuf in - Location.prerr_warning loc Warnings.Comment_not_end; - lexbuf.Lexing.lex_curr_pos <- lexbuf.Lexing.lex_curr_pos - 1; - let curpos = lexbuf.lex_curr_p in - lexbuf.lex_curr_p <- { curpos with pos_cnum = curpos.pos_cnum - 1 }; - STAR - } - | ("#" [' ' '\t']* (['0'-'9']+ as num) [' ' '\t']* - ("\"" ([^ '\010' '\013' '\"' ] * as name) "\"")?) as directive - [^ '\010' '\013'] * newline - { - match int_of_string num with - | exception _ -> - (* PR#7165 *) - let loc = Location.curr lexbuf in - let explanation = "line number out of range" in - let error = Invalid_directive (directive, Some explanation) in - raise (Error (error, loc)) - | line_num -> - (* Documentation says that the line number should be - positive, but we have never guarded against this and it - might have useful hackish uses. *) - update_loc lexbuf name line_num true 0; - token lexbuf - } - | "#" { HASH } - | "&" { AMPERSAND } - | "&&" { AMPERAMPER } - | "`" { BACKQUOTE } - | "\'" { QUOTE } - | "(" { LPAREN } - | ")" { RPAREN } - | "*" { STAR } - | "," { COMMA } - | "->" { MINUSGREATER } - | "." { DOT } - | ".." { DOTDOT } - | "." (dotsymbolchar symbolchar* as s) { DOTOP s } - | ":" { COLON } - | "::" { COLONCOLON } - | ":=" { COLONEQUAL } - | ":>" { COLONGREATER } - | ";" { SEMI } - | ";;" { SEMISEMI } - | "<" { LESS } - | "<-" { LESSMINUS } - | "=" { EQUAL } - | "[" { LBRACKET } - | "[|" { LBRACKETBAR } - | "[<" { LBRACKETLESS } - | "[>" { LBRACKETGREATER } - | "]" { RBRACKET } - | "{" { LBRACE } - | "{<" { LBRACELESS } - | "|" { BAR } - | "||" { BARBAR } - | "|]" { BARRBRACKET } - | ">" { GREATER } - | ">]" { GREATERRBRACKET } - | "}" { RBRACE } - | ">}" { GREATERRBRACE } - | "[@" { LBRACKETAT } - | "[@@" { LBRACKETATAT } - | "[@@@" { LBRACKETATATAT } - | "[%" { LBRACKETPERCENT } - | "[%%" { LBRACKETPERCENTPERCENT } - | "!" { BANG } - | "!=" { INFIXOP0 "!=" } - | "+" { PLUS } - | "+." { PLUSDOT } - | "+=" { PLUSEQ } - | "-" { MINUS } - | "-." { MINUSDOT } - - | "!" symbolchar + - { PREFIXOP(Lexing.lexeme lexbuf) } - | ['~' '?'] symbolchar + - { PREFIXOP(Lexing.lexeme lexbuf) } - | ['=' '<' '>' '|' '&' '$'] symbolchar * - { INFIXOP0(Lexing.lexeme lexbuf) } - | ['@' '^'] symbolchar * - { INFIXOP1(Lexing.lexeme lexbuf) } - | ['+' '-'] symbolchar * - { INFIXOP2(Lexing.lexeme lexbuf) } - | "**" symbolchar * - { INFIXOP4(Lexing.lexeme lexbuf) } - | '%' { PERCENT } - | ['*' '/' '%'] symbolchar * - { INFIXOP3(Lexing.lexeme lexbuf) } - | '#' (symbolchar | '#') + - { HASHOP(Lexing.lexeme lexbuf) } - | eof { Rescript_cpp.eof_check lexbuf; EOF} - | _ - { raise (Error(Illegal_character (Lexing.lexeme_char lexbuf 0), - Location.curr lexbuf)) - } - -and comment = parse - "(*" - { comment_start_loc := (Location.curr lexbuf) :: !comment_start_loc; - store_lexeme lexbuf; - comment lexbuf - } - | "*)" - { match !comment_start_loc with - | [] -> assert false - | [_] -> comment_start_loc := []; Location.curr lexbuf - | _ :: l -> comment_start_loc := l; - store_lexeme lexbuf; - comment lexbuf - } - | "\"" - { - string_start_loc := Location.curr lexbuf; - store_string_char '\"'; - is_in_string := true; - begin try string lexbuf - with Error (Unterminated_string, str_start) -> - match !comment_start_loc with - | [] -> assert false - | loc :: _ -> - let start = List.hd (List.rev !comment_start_loc) in - comment_start_loc := []; - raise (Error (Unterminated_string_in_comment (start, str_start), - loc)) - end; - is_in_string := false; - store_string_char '\"'; - comment lexbuf } - | "{" lowercase* "|" - { - let delim = Lexing.lexeme lexbuf in - let delim = String.sub delim 1 (String.length delim - 2) in - string_start_loc := Location.curr lexbuf; - store_lexeme lexbuf; - is_in_string := true; - begin try quoted_string delim lexbuf - with Error (Unterminated_string, str_start) -> - match !comment_start_loc with - | [] -> assert false - | loc :: _ -> - let start = List.hd (List.rev !comment_start_loc) in - comment_start_loc := []; - raise (Error (Unterminated_string_in_comment (start, str_start), - loc)) - end; - is_in_string := false; - store_string_char '|'; - store_string delim; - store_string_char '}'; - comment lexbuf } - - | "\'\'" - { store_lexeme lexbuf; comment lexbuf } - | "\'" newline "\'" - { update_loc lexbuf None 1 false 1; - store_lexeme lexbuf; - comment lexbuf - } - | "\'" [^ '\\' '\'' '\010' '\013' ] "\'" - { store_lexeme lexbuf; comment lexbuf } - | "\'\\" ['\\' '\"' '\'' 'n' 't' 'b' 'r' ' '] "\'" - { store_lexeme lexbuf; comment lexbuf } - | "\'\\" ['0'-'9'] ['0'-'9'] ['0'-'9'] "\'" - { store_lexeme lexbuf; comment lexbuf } - | "\'\\" 'x' ['0'-'9' 'a'-'f' 'A'-'F'] ['0'-'9' 'a'-'f' 'A'-'F'] "\'" - { store_lexeme lexbuf; comment lexbuf } - | eof - { match !comment_start_loc with - | [] -> assert false - | loc :: _ -> - let start = List.hd (List.rev !comment_start_loc) in - comment_start_loc := []; - raise (Error (Unterminated_comment start, loc)) - } - | newline - { update_loc lexbuf None 1 false 0; - store_lexeme lexbuf; - comment lexbuf - } - | _ - { store_lexeme lexbuf; comment lexbuf } - -and string = parse - '\"' - { () } - | '\\' newline ([' ' '\t'] * as space) - { update_loc lexbuf None 1 false (String.length space); - if in_comment () then store_lexeme lexbuf; - string lexbuf - } - | '\\' ['\\' '\'' '\"' 'n' 't' 'b' 'r' ' '] - { store_escaped_char lexbuf - (char_for_backslash(Lexing.lexeme_char lexbuf 1)); - string lexbuf } - | '\\' ['0'-'9'] ['0'-'9'] ['0'-'9'] - { store_escaped_char lexbuf (char_for_decimal_code lexbuf 1); - string lexbuf } - | '\\' 'o' ['0'-'3'] ['0'-'7'] ['0'-'7'] - { store_escaped_char lexbuf (char_for_octal_code lexbuf 2); - string lexbuf } - | '\\' 'x' ['0'-'9' 'a'-'f' 'A'-'F'] ['0'-'9' 'a'-'f' 'A'-'F'] - { store_escaped_char lexbuf (char_for_hexadecimal_code lexbuf 2); - string lexbuf } - | '\\' 'u' '{' hex_digit+ '}' - { store_escaped_uchar lexbuf (uchar_for_uchar_escape lexbuf); - string lexbuf } - | '\\' _ - { if not (in_comment ()) then begin -(* Should be an error, but we are very lax. - raise (Error (Illegal_escape (Lexing.lexeme lexbuf), - Location.curr lexbuf)) -*) - let loc = Location.curr lexbuf in - Location.prerr_warning loc Warnings.Illegal_backslash; - end; - store_lexeme lexbuf; - string lexbuf - } - | newline - { if not (in_comment ()) then - Location.prerr_warning (Location.curr lexbuf) Warnings.Eol_in_string; - update_loc lexbuf None 1 false 0; - store_lexeme lexbuf; - string lexbuf - } - | eof - { is_in_string := false; - raise (Error (Unterminated_string, !string_start_loc)) } - | _ - { store_string_char(Lexing.lexeme_char lexbuf 0); - string lexbuf } - -and quoted_string delim = parse - | newline - { update_loc lexbuf None 1 false 0; - store_lexeme lexbuf; - quoted_string delim lexbuf - } - | eof - { is_in_string := false; - raise (Error (Unterminated_string, !string_start_loc)) } - | "|" lowercase* "}" - { - let edelim = Lexing.lexeme lexbuf in - let edelim = String.sub edelim 1 (String.length edelim - 2) in - if delim = edelim then () - else (store_lexeme lexbuf; quoted_string delim lexbuf) - } - | _ - { store_string_char(Lexing.lexeme_char lexbuf 0); - quoted_string delim lexbuf } - -and skip_hash_bang = parse - | "#!" [^ '\n']* '\n' [^ '\n']* "\n!#\n" - { update_loc lexbuf None 3 false 0 } - | "#!" [^ '\n']* '\n' - { update_loc lexbuf None 1 false 0 } - | "" { () } - -{ - let token_with_comments lexbuf = - match !preprocessor with - | None -> token lexbuf - | Some (_init, preprocess) -> preprocess token lexbuf - - type newline_state = - | NoLine (* There have been no blank lines yet. *) - | NewLine - (* There have been no blank lines, and the previous - token was a newline. *) - | BlankLine (* There have been blank lines. *) - - type doc_state = - | Initial (* There have been no docstrings yet *) - | After of docstring list - (* There have been docstrings, none of which were - preceded by a blank line *) - | Before of docstring list * docstring list * docstring list - (* There have been docstrings, some of which were - preceded by a blank line *) - - and docstring = Docstrings.docstring - - let token lexbuf = - let post_pos = lexeme_end_p lexbuf in - let attach lines docs pre_pos = - let open Docstrings in - match docs, lines with - | Initial, _ -> () - | After a, (NoLine | NewLine) -> - set_post_docstrings post_pos (List.rev a); - set_pre_docstrings pre_pos a; - | After a, BlankLine -> - set_post_docstrings post_pos (List.rev a); - set_pre_extra_docstrings pre_pos (List.rev a) - | Before(a, f, b), (NoLine | NewLine) -> - set_post_docstrings post_pos (List.rev a); - set_post_extra_docstrings post_pos - (List.rev_append f (List.rev b)); - set_floating_docstrings pre_pos (List.rev f); - set_pre_extra_docstrings pre_pos (List.rev a); - set_pre_docstrings pre_pos b - | Before(a, f, b), BlankLine -> - set_post_docstrings post_pos (List.rev a); - set_post_extra_docstrings post_pos - (List.rev_append f (List.rev b)); - set_floating_docstrings pre_pos - (List.rev_append f (List.rev b)); - set_pre_extra_docstrings pre_pos (List.rev a) - in - let rec loop lines docs lexbuf = - match token_with_comments lexbuf with - | COMMENT (s, loc) -> - add_comment (s, loc); - let lines' = - match lines with - | NoLine -> NoLine - | NewLine -> NoLine - | BlankLine -> BlankLine - in - loop lines' docs lexbuf - | EOL -> - let lines' = - match lines with - | NoLine -> NewLine - | NewLine -> BlankLine - | BlankLine -> BlankLine - in - loop lines' docs lexbuf - | HASH when Rescript_cpp.at_bol lexbuf -> - Rescript_cpp.interpret_directive lexbuf - ~cont:(fun lexbuf -> loop lines docs lexbuf) - ~token_with_comments - | DOCSTRING doc -> - Docstrings.register doc; - add_docstring_comment doc; - let docs' = - if Docstrings.docstring_body doc = "/*" then - match docs with - | Initial -> Before([], [doc], []) - | After a -> Before (a, [doc], []) - | Before(a, f, b) -> Before(a, doc :: b @ f, []) - else - match docs, lines with - | Initial, (NoLine | NewLine) -> After [doc] - | Initial, BlankLine -> Before([], [], [doc]) - | After a, (NoLine | NewLine) -> After (doc :: a) - | After a, BlankLine -> Before (a, [], [doc]) - | Before(a, f, b), (NoLine | NewLine) -> Before(a, f, doc :: b) - | Before(a, f, b), BlankLine -> Before(a, b @ f, [doc]) - in - loop NoLine docs' lexbuf - | tok -> - attach lines docs (lexeme_start_p lexbuf); - tok - in - Rescript_cpp.check_sharp_look_ahead (fun _ -> loop NoLine Initial lexbuf) - - let init () = - Rescript_cpp.init (); - is_in_string := false; - comment_start_loc := []; - comment_list := []; - match !preprocessor with - | None -> () - | Some (init, _preprocess) -> init () - - - let set_preprocessor init preprocess = - escaped_newlines := true; - preprocessor := Some (init, preprocess) - -} diff --git a/jscomp/ml/parse.ml b/jscomp/ml/parse.ml deleted file mode 100644 index 7de593c2a2..0000000000 --- a/jscomp/ml/parse.ml +++ /dev/null @@ -1,36 +0,0 @@ -(**************************************************************************) -(* *) -(* OCaml *) -(* *) -(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *) -(* *) -(* Copyright 1996 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. *) -(* *) -(**************************************************************************) - -(* Entry points in the parser *) - - -let wrap parsing_fun lexbuf = - try - Docstrings.init (); - Lexer.init (); - let ast = parsing_fun Lexer.token lexbuf in - Parsing.clear_parser(); - Docstrings.warn_bad_docstrings (); - ast - with - | Parsing.Parse_error | Syntaxerr.Escape_error -> - let loc = Location.curr lexbuf in - raise(Syntaxerr.Error(Syntaxerr.Other loc)) - -let implementation = wrap Parser.implementation -and interface = wrap Parser.interface -and core_type = wrap Parser.parse_core_type -and expression = wrap Parser.parse_expression -and pattern = wrap Parser.parse_pattern diff --git a/jscomp/ml/parse.mli b/jscomp/ml/parse.mli deleted file mode 100644 index a35feb8a7a..0000000000 --- a/jscomp/ml/parse.mli +++ /dev/null @@ -1,22 +0,0 @@ -(**************************************************************************) -(* *) -(* OCaml *) -(* *) -(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *) -(* *) -(* Copyright 1996 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. *) -(* *) -(**************************************************************************) - -(** Entry points in the parser *) - -val implementation : Lexing.lexbuf -> Parsetree.structure -val interface : Lexing.lexbuf -> Parsetree.signature -val core_type : Lexing.lexbuf -> Parsetree.core_type -val expression : Lexing.lexbuf -> Parsetree.expression -val pattern : Lexing.lexbuf -> Parsetree.pattern diff --git a/jscomp/ml/parser.ml b/jscomp/ml/parser.ml deleted file mode 100644 index c0b5334852..0000000000 --- a/jscomp/ml/parser.ml +++ /dev/null @@ -1,12161 +0,0 @@ -type token = - | AMPERAMPER - | AMPERSAND - | AND - | AS - | ASSERT - | BACKQUOTE - | BANG - | BAR - | BARBAR - | BARRBRACKET - | BEGIN - | CHAR of (char) - | CLASS - | COLON - | COLONCOLON - | COLONEQUAL - | COLONGREATER - | COMMA - | CONSTRAINT - | DO - | DONE - | DOT - | DOTDOT - | DOWNTO - | ELSE - | END - | EOF - | EQUAL - | EXCEPTION - | EXTERNAL - | FALSE - | FLOAT of (string * char option) - | FOR - | FUN - | FUNCTION - | FUNCTOR - | GREATER - | GREATERRBRACE - | GREATERRBRACKET - | IF - | IN - | INCLUDE - | INFIXOP0 of (string) - | INFIXOP1 of (string) - | INFIXOP2 of (string) - | INFIXOP3 of (string) - | INFIXOP4 of (string) - | DOTOP of (string) - | INHERIT - | INITIALIZER - | INT of (string * char option) - | LABEL of (string) - | LAZY - | LBRACE - | LBRACELESS - | LBRACKET - | LBRACKETBAR - | LBRACKETLESS - | LBRACKETGREATER - | LBRACKETPERCENT - | LBRACKETPERCENTPERCENT - | LESS - | LESSMINUS - | LET - | LIDENT of (string) - | LPAREN - | LBRACKETAT - | LBRACKETATAT - | LBRACKETATATAT - | MATCH - | METHOD - | MINUS - | MINUSDOT - | MINUSGREATER - | MODULE - | MUTABLE - | NEW - | NONREC - | OBJECT - | OF - | OPEN - | OPTLABEL of (string) - | OR - | PERCENT - | PLUS - | PLUSDOT - | PLUSEQ - | PREFIXOP of (string) - | PRIVATE - | QUESTION - | QUOTE - | RBRACE - | RBRACKET - | REC - | RPAREN - | SEMI - | SEMISEMI - | HASH - | HASHOP of (string) - | SIG - | STAR - | STRING of (string * string option) - | STRUCT - | THEN - | TILDE - | TO - | TRUE - | TRY - | TYPE - | UIDENT of (string) - | UNDERSCORE - | VAL - | VIRTUAL - | WHEN - | WHILE - | WITH - | COMMENT of (string * Location.t) - | DOCSTRING of (Docstrings.docstring) - | EOL - -open Parsing;; -let _ = parse_error;; -# 19 "ml/parser.mly" -open Location -open Asttypes -open Longident -open Parsetree -open Ast_helper -open Docstrings - -let mktyp d = Typ.mk ~loc:(symbol_rloc()) d -let mkpat d = Pat.mk ~loc:(symbol_rloc()) d -let mkexp d = Exp.mk ~loc:(symbol_rloc()) d -let mkmty ?attrs d = Mty.mk ~loc:(symbol_rloc()) ?attrs d -let mksig d = Sig.mk ~loc:(symbol_rloc()) d -let mkmod ?attrs d = Mod.mk ~loc:(symbol_rloc()) ?attrs d -let mkstr d = Str.mk ~loc:(symbol_rloc()) d -let mkcty ?attrs _d = let _ = attrs in assert false -let mkctf ?attrs ?docs _d = let _ = (attrs, docs) in assert false -let mkcf ?attrs ?docs _d = let _ = (attrs, docs) in assert false - -let mkrhs rhs pos = mkloc rhs (rhs_loc pos) - -let reloc_pat x = { x with ppat_loc = symbol_rloc () };; -let reloc_exp x = { x with pexp_loc = symbol_rloc () };; - -let mkoperator name pos = - let loc = rhs_loc pos in - Exp.mk ~loc (Pexp_ident(mkloc (Lident name) loc)) - -let mkpatvar name pos = - Pat.mk ~loc:(rhs_loc pos) (Ppat_var (mkrhs name pos)) - -(* - 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. -*) -let ghexp d = Exp.mk ~loc:(symbol_gloc ()) d -let ghpat d = Pat.mk ~loc:(symbol_gloc ()) d -let ghtyp d = Typ.mk ~loc:(symbol_gloc ()) d -let ghloc d = { txt = d; loc = symbol_gloc () } -let ghstr d = Str.mk ~loc:(symbol_gloc()) d -let ghsig d = Sig.mk ~loc:(symbol_gloc()) d - -let mkinfix arg1 name arg2 = - mkexp(Pexp_apply(mkoperator name 2, [Nolabel, arg1; Nolabel, 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, 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))) - | _ -> - mkexp(Pexp_apply(mkoperator ("~" ^ name) 1, [Nolabel, arg])) - -let mkuplus name arg = - let desc = arg.pexp_desc in - match name, desc with - | "+", Pexp_constant(Pconst_integer _) - | ("+" | "+."), Pexp_constant(Pconst_float _) -> mkexp desc - | _ -> - mkexp(Pexp_apply(mkoperator ("~" ^ name) 1, [Nolabel, arg])) - -let mkexp_cons consloc args loc = - Exp.mk ~loc (Pexp_construct(mkloc (Lident "::") consloc, Some args)) - -let mkpat_cons consloc args loc = - Pat.mk ~loc (Ppat_construct(mkloc (Lident "::") consloc, Some args)) - -let rec mktailexp nilloc = function - [] -> - let loc = { nilloc with loc_ghost = true } in - let nil = { txt = Lident "[]"; loc = loc } in - Exp.mk ~loc (Pexp_construct (nil, None)) - | e1 :: el -> - let exp_el = mktailexp nilloc el in - let loc = {loc_start = e1.pexp_loc.loc_start; - loc_end = exp_el.pexp_loc.loc_end; - loc_ghost = true} - in - let arg = Exp.mk ~loc (Pexp_tuple [e1; exp_el]) in - mkexp_cons {loc with loc_ghost = true} arg loc - -let rec mktailpat nilloc = function - [] -> - let loc = { nilloc with loc_ghost = true } in - let nil = { txt = Lident "[]"; loc = loc } in - Pat.mk ~loc (Ppat_construct (nil, None)) - | p1 :: pl -> - let pat_pl = mktailpat nilloc pl in - let loc = {loc_start = p1.ppat_loc.loc_start; - loc_end = pat_pl.ppat_loc.loc_end; - loc_ghost = true} - in - let arg = Pat.mk ~loc (Ppat_tuple [p1; pat_pl]) in - mkpat_cons {loc with loc_ghost = true} arg loc - -let mkstrexp e attrs = - { pstr_desc = Pstr_eval (e, attrs); pstr_loc = e.pexp_loc } - -let mkexp_constraint e (t1, t2) = - match t1, t2 with - | Some t, None -> ghexp(Pexp_constraint(e, t)) - | _, Some t -> ghexp(Pexp_coerce(e, (), t)) - | None, None -> assert false - -let mkexp_opt_constraint e = function - | None -> e - | Some constraint_ -> mkexp_constraint e constraint_ - -let mkpat_opt_constraint p = function - | None -> p - | Some typ -> mkpat (Ppat_constraint(p, typ)) - -let array_function str name = - ghloc (Ldot(Lident str, (if !Clflags.fast then "unsafe_" ^ name else name))) - -let syntax_error () = - raise Syntaxerr.Escape_error - -let unclosed opening_name opening_num closing_name closing_num = - raise(Syntaxerr.Error(Syntaxerr.Unclosed(rhs_loc opening_num, opening_name, - rhs_loc closing_num, closing_name))) - -let expecting pos nonterm = - raise Syntaxerr.(Error(Expecting(rhs_loc pos, nonterm))) - -let not_expecting pos nonterm = - raise Syntaxerr.(Error(Not_expecting(rhs_loc pos, nonterm))) - - -let lapply p1 p2 = - if !Clflags.applicative_functors - then Lapply(p1, p2) - else raise (Syntaxerr.Error(Syntaxerr.Applicative_path (symbol_rloc()))) - -let exp_of_label lbl pos = - mkexp (Pexp_ident(mkrhs (Lident(Longident.last lbl)) pos)) - -let pat_of_label lbl pos = - mkpat (Ppat_var (mkrhs (Longident.last lbl) pos)) - -let mk_newtypes newtypes exp = - List.fold_right (fun newtype exp -> mkexp (Pexp_newtype (newtype, exp))) - newtypes exp - -let wrap_type_annotation newtypes core_type body = - let exp = mkexp(Pexp_constraint(body,core_type)) in - let exp = mk_newtypes newtypes exp in - (exp, ghtyp(Ptyp_poly(newtypes, Typ.varify_constructors newtypes core_type))) - -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 -> ghexp(Pexp_extension (id, PStr [mkstrexp body []])) - -let mkexp_attrs d attrs = - wrap_exp_attrs (mkexp d) attrs - -let wrap_typ_attrs typ (ext, attrs) = - (* todo: keep exact location for the entire attribute *) - let typ = {typ with ptyp_attributes = attrs @ typ.ptyp_attributes} in - match ext with - | None -> typ - | Some id -> ghtyp(Ptyp_extension (id, PTyp typ)) - -let mktyp_attrs d attrs = - wrap_typ_attrs (mktyp d) attrs - -let wrap_pat_attrs pat (ext, attrs) = - (* todo: keep exact location for the entire attribute *) - let pat = {pat with ppat_attributes = attrs @ pat.ppat_attributes} in - match ext with - | None -> pat - | Some id -> ghpat(Ppat_extension (id, PPat (pat, None))) - -let mkpat_attrs d attrs = - wrap_pat_attrs (mkpat d) attrs - -let wrap_class_type_attrs _body _attrs = assert false -let wrap_mod_attrs body attrs = - {body with pmod_attributes = attrs @ body.pmod_attributes} -let wrap_mty_attrs body attrs = - {body with pmty_attributes = attrs @ body.pmty_attributes} - -let wrap_str_ext body ext = - match ext with - | None -> body - | Some id -> ghstr(Pstr_extension ((id, PStr [body]), [])) - -let mkstr_ext d ext = - wrap_str_ext (mkstr d) ext - -let wrap_sig_ext body ext = - match ext with - | None -> body - | Some id -> ghsig(Psig_extension ((id, PSig [body]), [])) - -let mksig_ext d ext = - wrap_sig_ext (mksig d) ext - -let text_str pos = Str.text (rhs_text pos) -let text_sig pos = Sig.text (rhs_text pos) -let text_cstr _pos = assert false -let text_csig _pos = assert false - - -let extra_text text pos items = - let pre_extras = rhs_pre_extra_text pos in - let post_extras = rhs_post_extra_text pos in - text pre_extras @ items @ text post_extras - -let extra_str pos items = extra_text Str.text pos items -let extra_sig pos items = extra_text Sig.text pos items - -let extra_rhs_core_type ct ~pos = - let docs = rhs_info pos in - { ct with ptyp_attributes = add_info_attrs docs ct.ptyp_attributes } - -type let_binding = - { lb_pattern: pattern; - lb_expression: expression; - lb_attributes: attributes; - lb_docs: docs Lazy.t; - lb_text: text Lazy.t; - lb_loc: Location.t; } - -type [@warning "-69"] let_bindings = - { lbs_bindings: let_binding list; - lbs_rec: rec_flag; - lbs_extension: string Asttypes.loc option; - lbs_loc: Location.t } - -let mklb first (p, e) attrs = - { lb_pattern = p; - lb_expression = e; - lb_attributes = attrs; - lb_docs = symbol_docs_lazy (); - lb_text = if first then empty_text_lazy - else symbol_text_lazy (); - lb_loc = symbol_rloc (); } - -let mklbs ext rf lb = - { lbs_bindings = [lb]; - lbs_rec = rf; - lbs_extension = ext ; - lbs_loc = symbol_rloc (); } - -let addlb lbs lb = - { lbs with lbs_bindings = lb :: lbs.lbs_bindings } - -let val_of_let_bindings lbs = - let bindings = - List.map - (fun lb -> - Vb.mk ~loc:lb.lb_loc ~attrs:lb.lb_attributes - ~docs:(Lazy.force lb.lb_docs) - ~text:(Lazy.force lb.lb_text) - lb.lb_pattern lb.lb_expression) - lbs.lbs_bindings - in - let str = mkstr(Pstr_value(lbs.lbs_rec, List.rev bindings)) in - match lbs.lbs_extension with - | None -> str - | Some id -> ghstr (Pstr_extension((id, PStr [str]), [])) - -let expr_of_let_bindings lbs body = - let bindings = - List.map - (fun lb -> - Vb.mk ~loc:lb.lb_loc ~attrs:lb.lb_attributes - lb.lb_pattern lb.lb_expression) - lbs.lbs_bindings - in - mkexp_attrs (Pexp_let(lbs.lbs_rec, List.rev bindings, body)) - (lbs.lbs_extension, []) - - - -(* Alternatively, we could keep the generic module type in the Parsetree - and extract the package type during type-checking. In that case, - the assertions below should be turned into explicit checks. *) -let package_type_of_module_type pmty = - let err loc s = - raise (Syntaxerr.Error (Syntaxerr.Invalid_package_type (loc, s))) - in - let map_cstr = function - | Pwith_type (lid, ptyp) -> - let loc = ptyp.ptype_loc in - if ptyp.ptype_params <> [] then - err loc "parametrized types are not supported"; - if ptyp.ptype_cstrs <> [] then - err loc "constrained types are not supported"; - if ptyp.ptype_private <> Public then - err 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) - | _ -> - err pmty.pmty_loc "only 'with type t =' constraints are supported" - in - match pmty with - | {pmty_desc = Pmty_ident lid} -> (lid, []) - | {pmty_desc = Pmty_with({pmty_desc = Pmty_ident lid}, cstrs)} -> - (lid, List.map map_cstr cstrs) - | _ -> - err pmty.pmty_loc - "only module type identifier and 'with type' constraints are supported" - - -# 466 "ml/parser.ml" -let yytransl_const = [| - 257 (* AMPERAMPER *); - 258 (* AMPERSAND *); - 259 (* AND *); - 260 (* AS *); - 261 (* ASSERT *); - 262 (* BACKQUOTE *); - 263 (* BANG *); - 264 (* BAR *); - 265 (* BARBAR *); - 266 (* BARRBRACKET *); - 267 (* BEGIN *); - 269 (* CLASS *); - 270 (* COLON *); - 271 (* COLONCOLON *); - 272 (* COLONEQUAL *); - 273 (* COLONGREATER *); - 274 (* COMMA *); - 275 (* CONSTRAINT *); - 276 (* DO *); - 277 (* DONE *); - 278 (* DOT *); - 279 (* DOTDOT *); - 280 (* DOWNTO *); - 281 (* ELSE *); - 282 (* END *); - 0 (* EOF *); - 283 (* EQUAL *); - 284 (* EXCEPTION *); - 285 (* EXTERNAL *); - 286 (* FALSE *); - 288 (* FOR *); - 289 (* FUN *); - 290 (* FUNCTION *); - 291 (* FUNCTOR *); - 292 (* GREATER *); - 293 (* GREATERRBRACE *); - 294 (* GREATERRBRACKET *); - 295 (* IF *); - 296 (* IN *); - 297 (* INCLUDE *); - 304 (* INHERIT *); - 305 (* INITIALIZER *); - 308 (* LAZY *); - 309 (* LBRACE *); - 310 (* LBRACELESS *); - 311 (* LBRACKET *); - 312 (* LBRACKETBAR *); - 313 (* LBRACKETLESS *); - 314 (* LBRACKETGREATER *); - 315 (* LBRACKETPERCENT *); - 316 (* LBRACKETPERCENTPERCENT *); - 317 (* LESS *); - 318 (* LESSMINUS *); - 319 (* LET *); - 321 (* LPAREN *); - 322 (* LBRACKETAT *); - 323 (* LBRACKETATAT *); - 324 (* LBRACKETATATAT *); - 325 (* MATCH *); - 326 (* METHOD *); - 327 (* MINUS *); - 328 (* MINUSDOT *); - 329 (* MINUSGREATER *); - 330 (* MODULE *); - 331 (* MUTABLE *); - 332 (* NEW *); - 333 (* NONREC *); - 334 (* OBJECT *); - 335 (* OF *); - 336 (* OPEN *); - 338 (* OR *); - 339 (* PERCENT *); - 340 (* PLUS *); - 341 (* PLUSDOT *); - 342 (* PLUSEQ *); - 344 (* PRIVATE *); - 345 (* QUESTION *); - 346 (* QUOTE *); - 347 (* RBRACE *); - 348 (* RBRACKET *); - 349 (* REC *); - 350 (* RPAREN *); - 351 (* SEMI *); - 352 (* SEMISEMI *); - 353 (* HASH *); - 355 (* SIG *); - 356 (* STAR *); - 358 (* STRUCT *); - 359 (* THEN *); - 360 (* TILDE *); - 361 (* TO *); - 362 (* TRUE *); - 363 (* TRY *); - 364 (* TYPE *); - 366 (* UNDERSCORE *); - 367 (* VAL *); - 368 (* VIRTUAL *); - 369 (* WHEN *); - 370 (* WHILE *); - 371 (* WITH *); - 374 (* EOL *); - 0|] - -let yytransl_block = [| - 268 (* CHAR *); - 287 (* FLOAT *); - 298 (* INFIXOP0 *); - 299 (* INFIXOP1 *); - 300 (* INFIXOP2 *); - 301 (* INFIXOP3 *); - 302 (* INFIXOP4 *); - 303 (* DOTOP *); - 306 (* INT *); - 307 (* LABEL *); - 320 (* LIDENT *); - 337 (* OPTLABEL *); - 343 (* PREFIXOP *); - 354 (* HASHOP *); - 357 (* STRING *); - 365 (* UIDENT *); - 372 (* COMMENT *); - 373 (* DOCSTRING *); - 0|] - -let yylhs = "\255\255\ -\001\000\002\000\003\000\004\000\005\000\011\000\011\000\012\000\ -\012\000\014\000\014\000\015\000\015\000\015\000\015\000\015\000\ -\015\000\015\000\015\000\015\000\018\000\018\000\018\000\018\000\ -\018\000\018\000\018\000\018\000\018\000\018\000\018\000\006\000\ -\006\000\024\000\024\000\024\000\025\000\025\000\025\000\025\000\ -\025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\ -\025\000\025\000\037\000\041\000\041\000\041\000\032\000\033\000\ -\033\000\042\000\043\000\013\000\013\000\013\000\013\000\013\000\ -\013\000\013\000\013\000\013\000\013\000\013\000\007\000\007\000\ -\007\000\046\000\046\000\046\000\046\000\046\000\046\000\046\000\ -\046\000\046\000\046\000\046\000\046\000\046\000\046\000\035\000\ -\052\000\054\000\054\000\054\000\049\000\050\000\051\000\051\000\ -\055\000\056\000\057\000\057\000\034\000\059\000\059\000\061\000\ -\062\000\062\000\062\000\063\000\063\000\064\000\064\000\064\000\ -\064\000\064\000\064\000\065\000\065\000\065\000\065\000\066\000\ -\066\000\066\000\066\000\066\000\075\000\075\000\075\000\075\000\ -\075\000\075\000\075\000\078\000\079\000\079\000\080\000\080\000\ -\081\000\081\000\081\000\081\000\081\000\081\000\082\000\082\000\ -\082\000\085\000\067\000\036\000\036\000\086\000\087\000\009\000\ -\009\000\009\000\009\000\089\000\089\000\089\000\089\000\089\000\ -\089\000\089\000\089\000\094\000\094\000\091\000\091\000\090\000\ -\090\000\092\000\093\000\093\000\021\000\021\000\021\000\021\000\ -\021\000\021\000\021\000\021\000\021\000\021\000\021\000\021\000\ -\021\000\021\000\021\000\021\000\021\000\021\000\021\000\021\000\ -\021\000\021\000\021\000\021\000\021\000\021\000\021\000\021\000\ -\021\000\021\000\021\000\021\000\021\000\021\000\021\000\021\000\ -\021\000\021\000\021\000\021\000\021\000\021\000\021\000\021\000\ -\021\000\021\000\021\000\021\000\021\000\021\000\021\000\021\000\ -\021\000\021\000\021\000\021\000\021\000\021\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\ -\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\096\000\096\000\096\000\096\000\096\000\096\000\ -\096\000\096\000\096\000\096\000\097\000\097\000\115\000\115\000\ -\116\000\116\000\116\000\116\000\117\000\074\000\074\000\118\000\ -\118\000\118\000\118\000\118\000\118\000\026\000\026\000\123\000\ -\124\000\126\000\126\000\073\000\073\000\073\000\100\000\100\000\ -\127\000\127\000\127\000\101\000\101\000\101\000\101\000\102\000\ -\102\000\111\000\111\000\129\000\129\000\129\000\130\000\130\000\ -\114\000\114\000\132\000\132\000\112\000\112\000\070\000\070\000\ -\070\000\070\000\070\000\131\000\131\000\010\000\010\000\010\000\ -\010\000\010\000\010\000\010\000\010\000\010\000\010\000\121\000\ -\121\000\121\000\121\000\121\000\121\000\121\000\121\000\121\000\ -\134\000\134\000\134\000\134\000\095\000\095\000\122\000\122\000\ -\122\000\122\000\122\000\122\000\122\000\122\000\122\000\122\000\ -\122\000\122\000\122\000\122\000\122\000\122\000\122\000\122\000\ -\122\000\122\000\122\000\122\000\138\000\138\000\138\000\138\000\ -\138\000\138\000\138\000\133\000\133\000\133\000\135\000\135\000\ -\135\000\140\000\140\000\139\000\139\000\139\000\139\000\141\000\ -\141\000\142\000\142\000\028\000\143\000\143\000\027\000\029\000\ -\029\000\144\000\145\000\149\000\149\000\148\000\148\000\148\000\ -\148\000\148\000\148\000\148\000\148\000\148\000\148\000\148\000\ -\147\000\147\000\147\000\152\000\153\000\153\000\155\000\155\000\ -\156\000\154\000\154\000\154\000\157\000\060\000\060\000\150\000\ -\150\000\150\000\158\000\159\000\031\000\031\000\048\000\098\000\ -\161\000\161\000\161\000\161\000\162\000\162\000\151\000\151\000\ -\151\000\164\000\165\000\030\000\047\000\167\000\167\000\167\000\ -\167\000\167\000\167\000\168\000\168\000\168\000\169\000\170\000\ -\171\000\172\000\045\000\045\000\173\000\173\000\173\000\173\000\ -\174\000\174\000\120\000\120\000\071\000\071\000\166\000\166\000\ -\008\000\008\000\175\000\175\000\177\000\177\000\177\000\177\000\ -\177\000\128\000\128\000\179\000\179\000\179\000\179\000\179\000\ -\179\000\179\000\179\000\179\000\179\000\179\000\179\000\179\000\ -\179\000\179\000\179\000\179\000\179\000\179\000\022\000\183\000\ -\183\000\184\000\184\000\182\000\182\000\186\000\186\000\187\000\ -\187\000\185\000\185\000\178\000\178\000\076\000\076\000\163\000\ -\163\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\ -\190\000\188\000\189\000\068\000\110\000\110\000\110\000\110\000\ -\136\000\136\000\136\000\136\000\136\000\058\000\058\000\119\000\ -\119\000\119\000\119\000\119\000\191\000\191\000\191\000\191\000\ -\191\000\191\000\191\000\191\000\191\000\191\000\191\000\191\000\ -\191\000\191\000\191\000\191\000\191\000\191\000\191\000\191\000\ -\191\000\191\000\191\000\191\000\191\000\191\000\191\000\191\000\ -\191\000\160\000\160\000\160\000\160\000\160\000\160\000\109\000\ -\109\000\103\000\103\000\103\000\103\000\103\000\103\000\103\000\ -\108\000\108\000\137\000\137\000\016\000\016\000\176\000\176\000\ -\176\000\044\000\044\000\077\000\077\000\181\000\181\000\104\000\ -\125\000\125\000\146\000\146\000\105\000\105\000\072\000\072\000\ -\069\000\069\000\084\000\084\000\083\000\083\000\083\000\083\000\ -\083\000\053\000\053\000\099\000\099\000\113\000\113\000\106\000\ -\106\000\107\000\107\000\192\000\192\000\192\000\192\000\192\000\ -\192\000\192\000\192\000\192\000\192\000\192\000\192\000\192\000\ -\192\000\192\000\192\000\192\000\192\000\192\000\192\000\192\000\ -\192\000\192\000\192\000\192\000\192\000\192\000\192\000\192\000\ -\192\000\192\000\192\000\192\000\192\000\192\000\192\000\192\000\ -\192\000\192\000\192\000\192\000\192\000\192\000\192\000\192\000\ -\192\000\192\000\192\000\192\000\192\000\192\000\088\000\088\000\ -\019\000\194\000\039\000\023\000\023\000\017\000\017\000\040\000\ -\040\000\040\000\020\000\038\000\193\000\193\000\193\000\193\000\ -\193\000\000\000\000\000\000\000\000\000\000\000" - -let yylen = "\002\000\ -\002\000\002\000\002\000\002\000\002\000\002\000\005\000\001\000\ -\001\000\002\000\001\000\001\000\004\000\004\000\005\000\002\000\ -\003\000\001\000\002\000\001\000\005\000\005\000\003\000\003\000\ -\005\000\007\000\009\000\007\000\006\000\006\000\005\000\003\000\ -\001\000\000\000\002\000\002\000\001\000\001\000\001\000\001\000\ -\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\ -\002\000\001\000\004\000\002\000\004\000\002\000\005\000\001\000\ -\002\000\006\000\005\000\001\000\004\000\004\000\005\000\003\000\ -\003\000\005\000\003\000\003\000\001\000\002\000\000\000\002\000\ -\002\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\ -\001\000\001\000\001\000\001\000\001\000\002\000\001\000\005\000\ -\004\000\002\000\006\000\003\000\005\000\006\000\001\000\002\000\ -\007\000\006\000\000\000\002\000\006\000\000\000\003\000\002\000\ -\003\000\005\000\000\000\000\000\002\000\003\000\003\000\004\000\ -\004\000\002\000\001\000\007\000\007\000\006\000\007\000\007\000\ -\007\000\005\000\008\000\011\000\004\000\001\000\004\000\004\000\ -\002\000\001\000\007\000\002\000\003\000\000\000\000\000\002\000\ -\004\000\004\000\007\000\004\000\002\000\001\000\005\000\005\000\ -\003\000\003\000\003\000\001\000\002\000\009\000\008\000\001\000\ -\002\000\003\000\005\000\005\000\002\000\005\000\002\000\004\000\ -\002\000\002\000\001\000\001\000\001\000\000\000\002\000\001\000\ -\003\000\001\000\001\000\003\000\001\000\002\000\003\000\007\000\ -\006\000\007\000\004\000\004\000\007\000\006\000\006\000\005\000\ -\001\000\002\000\002\000\007\000\005\000\006\000\010\000\003\000\ -\003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ -\003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\ -\003\000\003\000\003\000\003\000\002\000\002\000\005\000\007\000\ -\007\000\007\000\007\000\007\000\009\000\009\000\009\000\003\000\ -\003\000\003\000\004\000\004\000\002\000\001\000\001\000\001\000\ -\001\000\001\000\003\000\003\000\004\000\003\000\004\000\004\000\ -\003\000\005\000\004\000\005\000\005\000\005\000\005\000\005\000\ -\005\000\005\000\005\000\005\000\005\000\005\000\007\000\007\000\ -\007\000\007\000\007\000\007\000\005\000\003\000\003\000\005\000\ -\005\000\004\000\004\000\002\000\006\000\004\000\006\000\004\000\ -\004\000\006\000\004\000\006\000\002\000\002\000\003\000\003\000\ -\002\000\005\000\004\000\005\000\003\000\003\000\005\000\007\000\ -\006\000\009\000\008\000\001\000\001\000\002\000\001\000\001\000\ -\002\000\002\000\002\000\002\000\001\000\001\000\002\000\002\000\ -\004\000\007\000\008\000\003\000\005\000\001\000\002\000\005\000\ -\004\000\001\000\003\000\002\000\002\000\005\000\001\000\003\000\ -\003\000\005\000\003\000\002\000\004\000\002\000\005\000\003\000\ -\003\000\003\000\001\000\001\000\003\000\002\000\004\000\002\000\ -\002\000\003\000\003\000\001\000\001\000\003\000\002\000\004\000\ -\002\000\002\000\002\000\001\000\000\000\003\000\003\000\001\000\ -\003\000\003\000\003\000\003\000\003\000\002\000\001\000\003\000\ -\003\000\001\000\003\000\003\000\003\000\003\000\002\000\001\000\ -\001\000\002\000\002\000\003\000\001\000\001\000\001\000\001\000\ -\003\000\001\000\001\000\002\000\001\000\003\000\004\000\004\000\ -\005\000\005\000\004\000\003\000\003\000\005\000\005\000\004\000\ -\005\000\007\000\007\000\001\000\003\000\003\000\004\000\004\000\ -\004\000\002\000\004\000\003\000\003\000\003\000\003\000\003\000\ -\003\000\001\000\003\000\001\000\002\000\004\000\003\000\004\000\ -\002\000\002\000\000\000\006\000\001\000\002\000\008\000\001\000\ -\002\000\008\000\007\000\003\000\000\000\000\000\002\000\003\000\ -\002\000\003\000\002\000\003\000\005\000\005\000\005\000\007\000\ -\000\000\001\000\003\000\002\000\001\000\003\000\002\000\001\000\ -\002\000\000\000\001\000\001\000\002\000\001\000\003\000\001\000\ -\001\000\002\000\003\000\004\000\001\000\007\000\006\000\003\000\ -\000\000\002\000\004\000\002\000\001\000\003\000\001\000\001\000\ -\002\000\005\000\007\000\009\000\009\000\001\000\001\000\001\000\ -\001\000\002\000\002\000\001\000\001\000\002\000\003\000\004\000\ -\004\000\005\000\001\000\003\000\006\000\005\000\004\000\004\000\ -\001\000\002\000\002\000\003\000\001\000\003\000\001\000\003\000\ -\001\000\002\000\001\000\004\000\001\000\006\000\004\000\005\000\ -\003\000\001\000\003\000\002\000\001\000\001\000\002\000\004\000\ -\003\000\002\000\002\000\003\000\005\000\003\000\004\000\005\000\ -\004\000\002\000\004\000\006\000\005\000\001\000\001\000\001\000\ -\003\000\001\000\001\000\005\000\002\000\001\000\000\000\001\000\ -\003\000\001\000\002\000\001\000\003\000\001\000\003\000\001\000\ -\003\000\002\000\002\000\001\000\001\000\001\000\001\000\001\000\ -\004\000\006\000\002\000\001\000\001\000\001\000\001\000\001\000\ -\001\000\002\000\002\000\002\000\002\000\001\000\001\000\001\000\ -\003\000\003\000\002\000\003\000\001\000\001\000\001\000\001\000\ -\001\000\001\000\003\000\004\000\003\000\004\000\003\000\004\000\ -\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\ -\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\ -\001\000\001\000\002\000\002\000\003\000\001\000\001\000\001\000\ -\003\000\001\000\005\000\002\000\002\000\003\000\001\000\001\000\ -\001\000\003\000\001\000\003\000\001\000\003\000\001\000\003\000\ -\004\000\001\000\003\000\001\000\003\000\001\000\003\000\002\000\ -\000\000\001\000\000\000\001\000\001\000\001\000\000\000\001\000\ -\000\000\001\000\000\000\001\000\000\000\001\000\001\000\002\000\ -\002\000\000\000\001\000\000\000\001\000\000\000\001\000\001\000\ -\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\ -\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\ -\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\ -\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\ -\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\ -\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\ -\001\000\001\000\001\000\001\000\001\000\001\000\001\000\003\000\ -\004\000\004\000\004\000\000\000\002\000\000\000\002\000\000\000\ -\002\000\003\000\004\000\004\000\001\000\002\000\002\000\002\000\ -\004\000\002\000\002\000\002\000\002\000\002\000" - -let yydefred = "\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\054\002\000\000\000\000\000\000\111\002\056\002\ -\000\000\000\000\000\000\000\000\000\000\053\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\152\002\153\002\000\000\000\000\000\000\154\002\ -\155\002\000\000\000\000\055\002\112\002\000\000\000\000\117\002\ -\230\000\000\000\000\000\226\002\000\000\000\000\000\000\036\001\ -\000\000\033\000\000\000\000\000\038\000\039\000\000\000\041\000\ -\042\000\043\000\000\000\045\000\046\000\000\000\048\000\000\000\ -\050\000\056\000\205\001\000\000\148\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\231\000\232\000\104\002\054\001\168\001\ -\000\000\000\000\000\000\000\000\000\000\227\002\000\000\075\000\ -\074\000\000\000\082\000\083\000\000\000\000\000\087\000\000\000\ -\077\000\078\000\079\000\080\000\000\000\084\000\095\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\119\002\005\002\228\002\000\000\022\002\000\000\006\002\ -\249\001\000\000\000\000\253\001\000\000\229\002\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\064\002\000\000\000\000\ -\000\000\000\000\119\001\230\002\000\000\000\000\140\001\113\001\ -\000\000\000\000\057\002\117\001\118\001\000\000\103\001\000\000\ -\125\001\000\000\000\000\000\000\000\000\063\002\062\002\128\002\ -\022\001\233\000\234\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\075\001\000\000\025\001\052\002\000\000\000\000\ -\000\000\108\002\000\000\000\000\012\001\000\000\158\002\159\002\ -\160\002\161\002\162\002\163\002\164\002\165\002\166\002\167\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\156\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\196\002\197\002\198\002\ -\199\002\200\002\201\002\157\002\202\002\203\002\204\002\205\002\ -\206\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\067\002\094\002\093\002\000\000\092\002\000\000\095\002\088\002\ -\090\002\070\002\071\002\072\002\073\002\074\002\000\000\089\002\ -\000\000\000\000\000\000\091\002\097\002\000\000\000\000\096\002\ -\000\000\109\002\081\002\087\002\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\147\002\000\000\021\001\035\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\229\000\ -\000\000\036\000\000\000\000\000\000\000\055\001\000\000\169\001\ -\000\000\057\000\000\000\149\000\049\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\037\001\040\001\000\000\000\000\000\000\213\000\214\000\000\000\ -\000\000\000\000\072\000\000\000\002\000\086\000\073\000\000\000\ -\096\000\000\000\115\002\000\000\027\002\000\000\000\000\149\002\ -\000\000\018\002\000\000\048\002\010\002\000\000\000\000\000\000\ -\000\000\000\000\000\000\045\002\000\000\000\000\000\000\000\000\ -\000\000\000\000\004\002\126\002\000\000\011\002\003\000\250\001\ -\000\000\000\000\000\000\000\000\000\000\000\000\007\002\004\000\ -\000\000\000\000\113\002\000\000\000\000\000\000\000\000\000\000\ -\000\000\146\001\000\000\082\002\000\000\086\002\000\000\000\000\ -\084\002\069\002\000\000\059\002\058\002\061\002\060\002\124\001\ -\000\000\000\000\000\000\000\000\005\000\102\001\000\000\114\001\ -\115\001\000\000\000\000\000\000\000\000\217\002\000\000\000\000\ -\000\000\000\000\238\000\000\000\000\000\102\002\000\000\000\000\ -\103\002\098\002\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\163\000\122\001\123\001\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\018\000\020\000\ -\000\000\000\000\000\000\000\000\000\000\092\001\000\000\007\001\ -\006\001\000\000\000\000\024\001\023\001\000\000\081\001\000\000\ -\000\000\000\000\000\000\000\000\221\002\000\000\000\000\000\000\ -\000\000\000\000\000\000\130\002\000\000\110\002\000\000\000\000\ -\000\000\068\002\000\000\236\000\235\000\000\000\066\002\065\002\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\108\000\ -\000\000\000\000\132\002\000\000\000\000\000\000\000\000\032\000\ -\213\002\000\000\000\000\000\000\000\000\000\000\118\002\105\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\154\000\000\000\ -\000\000\175\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\045\001\043\001\029\001\000\000\042\001\038\001\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\069\000\060\000\ -\122\002\000\000\000\000\000\000\000\000\000\000\026\002\000\000\ -\024\002\000\000\029\002\014\002\000\000\000\000\000\000\000\000\ -\051\002\009\002\042\002\043\002\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\040\002\000\000\116\002\120\002\000\000\ -\000\000\000\000\012\002\101\001\116\001\000\000\000\000\000\000\ -\142\001\141\001\000\000\000\000\000\000\000\000\000\000\133\001\ -\000\000\132\001\095\001\094\001\100\001\000\000\098\001\000\000\ -\150\001\000\000\000\000\000\000\126\001\000\000\121\001\000\000\ -\218\002\215\002\000\000\000\000\000\000\241\000\000\000\000\000\ -\000\000\239\000\237\000\140\002\000\000\099\002\000\000\100\002\ -\000\000\000\000\000\000\000\000\085\002\000\000\083\002\000\000\ -\000\000\162\000\000\000\164\000\000\000\165\000\159\000\170\000\ -\000\000\157\000\000\000\161\000\000\000\000\000\000\000\000\000\ -\180\000\000\000\000\000\063\001\000\000\000\000\000\000\000\000\ -\000\000\000\000\016\000\019\000\051\000\000\000\000\000\074\001\ -\090\001\000\000\091\001\000\000\000\000\077\001\000\000\082\001\ -\000\000\017\001\016\001\011\001\010\001\222\002\000\000\000\000\ -\219\002\208\002\220\002\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\112\001\000\000\000\000\000\000\000\000\ -\000\000\240\000\211\002\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\228\000\227\000\000\000\000\000\ -\000\000\000\000\196\001\195\001\000\000\186\001\000\000\000\000\ -\000\000\000\000\000\000\027\001\000\000\019\001\000\000\014\001\ -\000\000\000\000\000\000\243\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\070\000\089\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\015\002\030\002\000\000\000\000\ -\000\000\019\002\017\002\000\000\000\000\000\000\247\001\000\000\ -\000\000\000\000\000\000\000\000\008\002\000\000\000\000\127\002\ -\000\000\000\000\121\002\252\001\114\002\000\000\000\000\000\000\ -\159\001\000\000\144\001\143\001\147\001\145\001\000\000\136\001\ -\000\000\127\001\131\001\128\001\000\000\209\002\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\101\002\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\210\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\068\001\070\001\000\000\000\000\ -\000\000\000\000\011\000\000\000\000\000\024\000\000\000\023\000\ -\000\000\017\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\056\001\000\000\000\000\000\000\000\000\048\001\000\000\ -\000\000\000\000\000\000\000\000\000\000\111\001\000\000\000\000\ -\080\002\078\002\076\002\000\000\031\001\000\000\000\000\000\000\ -\000\000\000\000\000\000\006\000\008\000\009\000\000\000\054\000\ -\055\000\000\000\105\000\000\000\000\000\000\000\000\000\000\000\ -\115\000\109\000\088\000\184\000\000\000\189\001\000\000\000\000\ -\000\000\000\000\192\001\188\001\000\000\000\000\210\002\009\001\ -\008\001\028\001\026\001\000\000\000\000\107\002\000\000\244\000\ -\242\000\155\000\057\001\000\000\000\000\000\000\005\001\248\000\ -\000\000\246\000\000\000\000\000\000\000\000\000\000\000\254\000\ -\000\000\250\000\000\000\252\000\000\000\000\000\068\000\067\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\235\001\000\000\ -\123\002\000\000\000\000\000\000\000\000\000\000\093\000\000\000\ -\000\000\025\002\032\002\000\000\016\002\034\002\000\000\000\000\ -\000\000\000\000\000\000\000\000\021\002\013\002\000\000\041\002\ -\000\000\151\002\158\001\000\000\137\001\135\001\134\001\130\001\ -\129\001\247\000\245\000\000\000\000\000\000\000\253\000\249\000\ -\251\000\000\000\000\000\198\001\000\000\138\002\000\000\000\000\ -\215\001\000\000\000\000\000\000\000\000\207\001\000\000\134\002\ -\133\002\000\000\047\001\000\000\000\000\000\000\000\000\000\000\ -\000\000\160\000\000\000\000\000\067\001\065\001\000\000\064\001\ -\000\000\000\000\010\000\000\000\000\000\014\000\013\000\000\000\ -\225\002\177\000\208\001\000\000\000\000\000\000\000\000\060\001\ -\000\000\000\000\000\000\058\001\061\001\105\001\104\001\110\001\ -\000\000\108\001\000\000\153\001\000\000\052\001\000\000\000\000\ -\033\001\000\000\000\000\000\000\101\000\058\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\114\000\ -\000\000\000\000\187\001\000\000\173\001\000\000\191\001\164\001\ -\190\000\020\001\018\001\015\001\013\001\000\000\173\001\059\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\062\000\061\000\000\000\000\000\000\000\ -\000\000\094\000\092\000\000\000\000\000\000\000\000\000\028\002\ -\020\002\035\002\248\001\244\001\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\103\000\000\000\193\001\000\000\000\000\ -\214\001\217\001\211\001\000\000\206\001\000\000\000\000\000\000\ -\181\000\000\000\167\000\158\000\156\000\000\000\069\001\000\000\ -\000\000\000\000\000\000\031\000\000\000\000\000\025\000\022\000\ -\021\000\176\000\178\000\000\000\000\000\000\000\049\001\000\000\ -\000\000\032\001\000\000\000\000\106\000\000\000\000\000\000\000\ -\000\000\111\000\000\000\110\000\190\001\000\000\179\001\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\200\001\201\001\ -\000\000\000\000\136\002\000\000\000\000\000\000\000\000\000\000\ -\000\000\004\001\000\000\000\001\000\000\002\001\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\236\001\ -\097\000\000\000\000\000\098\000\033\002\050\002\139\001\138\001\ -\003\001\255\000\001\001\199\001\197\001\000\000\000\000\124\002\ -\000\000\130\000\000\000\126\000\000\000\000\000\166\001\167\001\ -\000\000\071\001\066\001\029\000\000\000\030\000\000\000\000\000\ -\000\000\000\000\059\001\053\001\007\000\000\000\112\000\113\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\180\001\ -\000\000\000\000\000\000\000\000\202\001\000\000\000\000\170\001\ -\000\000\000\000\000\000\222\001\223\001\224\001\225\001\035\001\ -\000\000\171\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\228\001\ -\229\001\000\000\000\000\000\000\129\000\150\000\000\000\000\000\ -\000\000\000\000\026\000\028\000\000\000\000\000\062\001\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\203\001\000\000\172\001\000\000\000\000\000\000\220\001\ -\226\001\227\001\034\001\151\000\000\000\000\000\000\000\238\001\ -\242\001\173\001\091\000\000\000\221\001\230\001\000\000\000\000\ -\000\000\000\000\135\000\125\002\000\000\191\000\000\000\000\000\ -\050\001\000\000\000\000\000\000\122\000\000\000\000\000\000\000\ -\000\000\204\001\183\001\000\000\000\000\181\001\000\000\000\000\ -\000\000\000\000\231\001\000\000\125\000\000\000\000\000\128\000\ -\127\000\000\000\000\000\027\000\051\001\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\232\001\233\001\000\000\133\000\000\000\000\000\ -\000\000\000\000\000\000\142\000\136\000\219\001\120\000\121\000\ -\000\000\000\000\000\000\000\000\000\000\119\000\184\001\234\001\ -\000\000\000\000\000\000\000\000\000\000\141\000\000\000\123\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\140\000\137\000\144\002\145\002\ -\000\000\000\000\000\000\000\000\138\000\000\000\000\000\000\000\ -\000\000\000\000\124\000\000\000\000\000\000\000\139\000\000\000\ -\000\000" - -let yydgoto = "\006\000\ -\052\000\094\000\124\000\134\000\148\000\245\001\095\000\153\005\ -\054\000\171\001\250\002\175\003\065\003\132\003\200\002\055\000\ -\190\001\223\001\072\001\056\000\057\000\066\003\046\001\058\000\ -\059\000\136\000\061\000\062\000\063\000\064\000\065\000\066\000\ -\067\000\068\000\069\000\070\000\071\000\072\000\073\000\000\001\ -\251\002\074\000\082\001\088\002\238\003\104\000\105\000\075\000\ -\107\000\108\000\109\000\110\000\037\001\049\003\111\000\113\001\ -\168\003\089\002\102\003\026\004\015\002\016\002\255\002\186\003\ -\103\004\101\004\199\004\076\000\031\004\075\004\154\005\213\004\ -\076\004\117\003\003\005\136\001\004\005\114\005\115\005\146\005\ -\173\005\203\005\199\005\165\002\092\005\077\000\084\001\250\000\ -\192\002\120\003\047\004\121\003\119\003\183\002\152\000\078\000\ -\096\001\228\002\121\001\195\002\193\002\079\000\080\000\081\000\ -\042\004\082\000\083\000\185\000\084\000\085\000\186\000\196\000\ -\239\001\192\000\097\001\098\001\074\002\232\002\086\000\155\005\ -\234\002\157\000\087\000\078\001\253\001\077\004\196\002\127\000\ -\187\000\188\000\231\001\193\000\158\000\159\000\237\002\160\000\ -\128\000\161\000\158\001\161\001\159\001\128\002\167\004\088\000\ -\080\001\020\002\005\003\109\004\218\004\214\004\032\004\006\003\ -\191\003\007\003\196\003\028\004\158\004\215\004\216\004\217\004\ -\172\002\106\003\107\003\033\004\034\004\062\003\043\005\063\005\ -\044\005\045\005\046\005\047\005\239\003\059\005\129\000\130\000\ -\131\000\132\000\133\000\129\001\142\001\095\002\096\002\097\002\ -\255\003\055\003\252\003\130\001\131\001\132\001\030\001\251\000\ -\246\001\047\001" - -let yysindex = "\180\007\ -\119\061\200\008\016\047\124\064\160\067\000\000\076\004\241\002\ -\244\009\076\004\000\000\236\254\076\004\076\004\000\000\000\000\ -\076\004\076\004\076\004\076\004\076\004\000\000\076\004\044\067\ -\174\002\205\061\037\062\122\057\122\057\068\003\000\000\232\054\ -\122\057\076\004\000\000\000\000\036\004\076\004\106\000\000\000\ -\000\000\244\009\119\061\000\000\000\000\076\004\076\004\000\000\ -\000\000\076\004\076\004\000\000\254\000\102\000\157\000\000\000\ -\225\072\000\000\222\005\236\255\000\000\000\000\241\000\000\000\ -\000\000\000\000\017\001\000\000\000\000\024\002\000\000\102\000\ -\000\000\000\000\000\000\089\001\000\000\034\069\015\002\244\009\ -\244\009\124\064\124\064\000\000\000\000\000\000\000\000\000\000\ -\076\004\076\004\036\004\200\008\076\004\000\000\140\003\000\000\ -\000\000\241\000\000\000\000\000\024\002\102\000\000\000\200\008\ -\000\000\000\000\000\000\000\000\113\002\000\000\000\000\145\007\ -\220\002\050\255\122\009\044\003\165\016\016\047\054\003\241\002\ -\021\003\000\000\000\000\000\000\038\000\000\000\023\003\000\000\ -\000\000\115\001\232\000\000\000\061\002\000\000\216\004\236\255\ -\076\004\076\004\035\003\163\066\226\066\000\000\088\059\018\004\ -\129\004\086\003\000\000\000\000\067\000\251\003\000\000\000\000\ -\160\067\160\067\000\000\000\000\000\000\039\004\000\000\107\004\ -\000\000\122\057\122\057\033\004\244\009\000\000\000\000\000\000\ -\000\000\000\000\000\000\122\062\076\004\041\002\097\005\160\067\ -\040\066\220\002\124\064\019\002\244\009\000\000\188\004\113\001\ -\212\002\117\255\000\000\127\004\000\000\000\000\246\004\165\002\ -\224\004\000\000\073\073\248\004\000\000\248\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\032\061\080\005\032\061\076\004\076\004\106\000\022\005\ -\000\000\000\000\000\000\244\009\000\000\036\005\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\083\005\000\000\ -\000\000\000\000\165\000\000\000\000\000\000\000\000\000\000\000\ -\244\009\000\000\000\000\000\000\184\255\130\255\032\061\124\064\ -\076\004\160\255\070\005\000\000\076\004\000\000\000\000\124\064\ -\069\005\097\005\124\064\000\000\122\057\222\005\102\000\225\004\ -\124\064\124\064\124\064\124\064\124\064\124\064\124\064\124\064\ -\124\064\124\064\124\064\124\064\124\064\124\064\124\064\124\064\ -\124\064\124\064\124\064\124\064\124\064\207\062\124\064\000\000\ -\076\004\000\000\173\005\033\004\124\064\000\000\033\004\000\000\ -\033\004\000\000\033\004\000\000\000\000\124\064\104\003\099\005\ -\244\009\244\009\150\005\157\005\244\009\150\005\119\002\041\069\ -\000\000\000\000\124\064\119\002\119\002\000\000\000\000\041\002\ -\219\003\168\004\000\000\069\005\000\000\000\000\000\000\033\004\ -\000\000\174\004\000\000\017\255\000\000\138\005\235\005\000\000\ -\174\004\000\000\174\004\000\000\000\000\000\000\233\005\163\005\ -\231\005\043\017\043\017\000\000\016\047\076\004\033\004\183\000\ -\198\005\004\006\000\000\000\000\255\005\000\000\000\000\000\000\ -\090\008\094\003\170\005\194\005\016\047\021\003\000\000\000\000\ -\160\067\168\068\000\000\010\006\034\006\203\255\224\005\037\004\ -\236\005\000\000\236\005\000\000\018\004\000\000\165\000\129\004\ -\000\000\000\000\076\001\000\000\000\000\000\000\000\000\000\000\ -\053\002\152\013\239\059\044\060\000\000\000\000\144\003\000\000\ -\000\000\160\067\076\003\032\061\033\004\000\000\033\004\119\002\ -\189\004\102\005\000\000\205\001\227\005\000\000\251\005\158\000\ -\000\000\000\000\009\002\006\070\077\006\128\003\168\068\011\058\ -\104\002\136\005\205\005\188\065\000\000\000\000\000\000\160\067\ -\241\005\033\004\141\001\033\004\115\005\072\006\000\000\000\000\ -\119\002\143\005\035\003\070\006\214\007\000\000\078\006\000\000\ -\000\000\035\003\124\064\000\000\000\000\157\005\000\000\124\064\ -\118\255\051\003\200\073\160\067\000\000\020\006\122\057\023\006\ -\041\002\009\006\076\004\000\000\229\050\000\000\022\006\028\006\ -\029\006\000\000\019\002\000\000\000\000\038\006\000\000\000\000\ -\041\006\027\006\241\002\037\006\178\002\160\067\232\002\000\000\ -\043\006\032\006\000\000\029\005\122\006\123\006\032\061\000\000\ -\000\000\044\067\116\003\036\063\124\063\087\055\000\000\000\000\ -\166\073\166\073\134\073\247\007\073\073\134\073\239\009\239\009\ -\239\009\239\009\089\002\104\006\104\006\239\009\089\002\089\002\ -\134\073\104\006\089\002\089\002\089\002\122\057\000\000\104\006\ -\229\050\000\000\029\005\044\006\227\005\073\073\124\064\124\064\ -\124\064\170\004\092\006\124\064\124\064\124\064\119\002\119\002\ -\000\000\000\000\000\000\218\004\000\000\000\000\134\073\027\001\ -\033\004\219\003\048\006\033\004\000\000\211\002\000\000\000\000\ -\000\000\123\002\055\006\186\002\029\005\057\006\000\000\199\255\ -\000\000\155\006\000\000\000\000\174\004\091\001\211\255\062\048\ -\000\000\000\000\000\000\000\000\096\006\219\003\016\047\159\002\ -\016\047\016\047\119\003\000\000\071\006\000\000\000\000\021\001\ -\241\002\097\006\000\000\000\000\000\000\121\003\016\047\148\006\ -\000\000\000\000\053\003\160\067\029\000\108\005\067\006\000\000\ -\097\011\000\000\000\000\000\000\000\000\179\002\000\000\162\006\ -\000\000\173\000\031\067\178\059\000\000\173\000\000\000\094\006\ -\000\000\000\000\124\064\124\064\235\004\000\000\124\064\124\064\ -\124\064\000\000\000\000\000\000\132\006\000\000\095\006\000\000\ -\019\015\074\002\019\015\033\004\000\000\188\006\000\000\016\047\ -\124\064\000\000\126\006\000\000\160\067\000\000\000\000\000\000\ -\127\006\000\000\127\006\000\000\090\008\122\058\124\064\188\065\ -\000\000\108\000\184\006\000\000\124\064\130\006\033\004\073\001\ -\119\061\155\001\000\000\000\000\000\000\087\006\000\000\000\000\ -\000\000\161\000\000\000\033\004\124\064\000\000\073\073\000\000\ -\073\073\000\000\000\000\000\000\000\000\000\000\033\004\243\000\ -\000\000\000\000\000\000\157\006\027\001\178\002\043\006\102\000\ -\100\065\068\005\190\006\000\000\187\006\146\006\149\006\153\006\ -\021\002\000\000\000\000\220\002\191\006\178\002\219\003\019\002\ -\078\003\178\002\102\000\007\002\000\000\000\000\169\001\201\003\ -\091\005\103\004\000\000\000\000\176\003\000\000\244\254\016\047\ -\124\064\125\006\221\255\000\000\255\002\000\000\248\004\000\000\ -\248\004\128\006\165\000\000\000\165\255\124\064\102\000\156\006\ -\178\002\132\006\073\073\038\005\063\000\190\255\162\005\124\064\ -\085\070\117\070\195\070\130\006\094\255\145\006\200\008\219\003\ -\129\002\000\000\000\000\186\003\212\006\219\003\043\006\214\004\ -\102\000\176\003\214\006\174\004\000\000\000\000\016\047\057\000\ -\224\006\000\000\000\000\241\002\057\255\033\004\000\000\016\047\ -\180\001\137\006\033\004\021\003\000\000\097\006\159\006\000\000\ -\090\008\124\006\000\000\000\000\000\000\033\004\160\067\142\006\ -\000\000\037\004\000\000\000\000\000\000\000\000\149\000\000\000\ -\223\255\000\000\000\000\000\000\208\001\000\000\098\000\245\255\ -\181\005\227\070\049\071\081\071\103\004\174\006\000\000\164\006\ -\000\000\172\006\071\006\158\006\169\000\225\006\033\004\000\000\ -\102\000\144\000\182\255\126\006\154\006\125\005\226\006\226\006\ -\237\006\166\006\179\006\126\006\000\000\000\000\210\063\124\064\ -\160\067\041\073\000\000\044\005\124\064\000\000\219\003\000\000\ -\030\003\000\000\016\047\073\073\124\064\124\064\033\004\216\006\ -\060\255\000\000\028\009\124\064\233\058\234\006\000\000\161\065\ -\059\002\105\060\166\060\227\060\124\064\000\000\016\047\160\067\ -\000\000\000\000\000\000\015\000\000\000\160\067\219\003\102\000\ -\102\000\175\001\226\005\000\000\000\000\000\000\248\006\000\000\ -\000\000\016\047\000\000\033\004\033\004\106\000\106\000\102\000\ -\000\000\000\000\000\000\000\000\160\067\000\000\217\000\236\006\ -\180\006\241\002\000\000\000\000\234\005\244\006\000\000\000\000\ -\000\000\000\000\000\000\110\000\122\005\000\000\019\002\000\000\ -\000\000\000\000\000\000\236\006\102\000\203\006\000\000\000\000\ -\206\006\000\000\210\006\124\064\124\064\124\064\073\073\000\000\ -\211\006\000\000\217\006\000\000\223\006\199\005\000\000\000\000\ -\033\004\120\004\180\001\043\006\029\005\015\007\000\000\000\000\ -\000\000\219\003\180\001\201\003\061\001\008\007\000\000\200\006\ -\219\003\000\000\000\000\087\001\000\000\000\000\074\255\000\000\ -\016\047\241\002\193\006\097\006\000\000\000\000\016\047\000\000\ -\037\004\000\000\000\000\219\003\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\124\064\124\064\124\064\000\000\000\000\ -\000\000\228\255\201\006\000\000\007\007\000\000\157\005\208\006\ -\000\000\164\006\090\008\184\000\102\000\000\000\204\006\000\000\ -\000\000\124\064\000\000\188\065\016\047\124\064\209\006\215\006\ -\016\047\000\000\124\064\218\006\000\000\000\000\219\006\000\000\ -\124\064\019\002\000\000\174\069\097\255\000\000\000\000\033\004\ -\000\000\000\000\000\000\124\064\124\064\126\006\046\001\000\000\ -\126\006\124\064\019\007\000\000\000\000\000\000\000\000\000\000\ -\179\002\000\000\162\006\000\000\173\000\000\000\088\003\173\000\ -\000\000\227\006\184\006\180\001\000\000\000\000\019\002\219\003\ -\255\254\016\047\124\064\033\004\102\000\033\004\102\000\000\000\ -\184\006\103\004\000\000\162\011\000\000\229\006\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\108\002\000\000\000\000\ -\036\007\124\064\124\064\168\071\200\071\022\072\124\064\124\064\ -\124\064\219\003\019\002\000\000\000\000\202\005\035\003\129\002\ -\211\002\000\000\000\000\219\003\229\006\211\002\016\047\000\000\ -\000\000\000\000\000\000\000\000\033\004\097\006\001\000\054\072\ -\132\072\164\072\103\004\000\000\241\002\000\000\131\005\053\007\ -\000\000\000\000\000\000\055\007\000\000\204\006\102\000\048\007\ -\000\000\033\004\000\000\000\000\000\000\033\004\000\000\188\065\ -\124\064\073\073\226\005\000\000\094\000\082\001\000\000\000\000\ -\000\000\000\000\000\000\049\007\016\047\239\006\000\000\124\064\ -\124\064\000\000\226\005\161\003\000\000\125\003\102\000\102\000\ -\174\255\000\000\187\003\000\000\000\000\041\002\000\000\249\006\ -\222\069\229\045\000\000\222\003\021\007\070\007\000\000\000\000\ -\027\001\054\255\000\000\252\000\015\003\054\255\131\005\073\073\ -\073\073\000\000\018\007\000\000\022\007\000\000\024\007\073\073\ -\073\073\073\073\180\001\226\005\170\005\170\005\046\005\000\000\ -\000\000\105\004\048\001\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\016\047\001\007\000\000\ -\033\004\000\000\234\005\000\000\254\002\062\048\000\000\000\000\ -\124\064\000\000\000\000\000\000\202\000\000\000\250\006\016\047\ -\238\003\161\065\000\000\000\000\000\000\016\047\000\000\000\000\ -\233\006\229\006\157\005\235\006\164\006\157\005\027\001\000\000\ -\033\004\070\007\229\006\164\006\000\000\033\004\016\047\000\000\ -\041\002\030\002\193\001\000\000\000\000\000\000\000\000\000\000\ -\254\006\000\000\234\005\124\064\124\064\124\064\007\003\007\003\ -\016\047\005\007\016\047\061\001\041\002\027\001\008\002\000\000\ -\000\000\099\000\106\000\029\007\000\000\000\000\194\003\033\004\ -\079\007\219\003\000\000\000\000\065\004\124\064\000\000\033\004\ -\157\005\157\005\013\066\157\005\157\005\110\005\033\004\093\255\ -\010\007\000\000\090\004\000\000\106\002\074\002\033\004\000\000\ -\000\000\000\000\000\000\000\000\073\073\073\073\073\073\000\000\ -\000\000\000\000\000\000\027\001\000\000\000\000\213\003\033\004\ -\016\047\135\004\000\000\000\000\009\007\000\000\011\007\124\064\ -\000\000\092\007\093\007\060\017\000\000\094\007\097\007\124\064\ -\085\007\000\000\000\000\164\006\070\007\000\000\016\047\074\002\ -\033\004\033\004\000\000\096\007\000\000\043\006\083\001\000\000\ -\000\000\037\002\033\004\000\000\000\000\062\048\062\048\126\006\ -\033\004\086\007\075\001\016\047\016\047\000\000\124\064\025\007\ -\033\004\033\004\000\000\000\000\039\005\000\000\033\004\033\004\ -\033\004\033\004\102\000\000\000\000\000\000\000\000\000\000\000\ -\095\007\124\064\016\047\033\004\033\004\000\000\000\000\000\000\ -\131\005\016\047\131\005\139\001\009\003\000\000\016\047\000\000\ -\033\004\033\004\102\000\234\005\006\007\032\007\157\005\227\005\ -\164\006\107\007\102\000\091\004\000\000\000\000\000\000\000\000\ -\109\007\157\005\157\005\016\047\000\000\124\064\062\048\110\007\ -\111\007\033\004\000\000\102\000\016\047\016\047\000\000\033\004\ -\033\004" - -let yyrindex = "\000\000\ -\126\008\127\008\000\000\000\000\000\000\000\000\106\069\000\000\ -\000\000\039\064\000\000\000\000\214\002\242\005\000\000\000\000\ -\221\067\101\066\099\067\209\064\139\003\000\000\106\069\000\000\ -\000\000\000\000\000\000\000\000\000\000\248\067\193\017\000\000\ -\000\000\209\064\000\000\000\000\200\004\096\000\042\004\000\000\ -\000\000\000\000\060\000\000\000\000\000\209\064\225\007\000\000\ -\000\000\242\005\209\064\000\000\000\000\021\043\103\016\000\000\ -\136\044\000\000\060\000\120\043\000\000\000\000\067\044\000\000\ -\000\000\000\000\081\053\000\000\000\000\102\053\000\000\021\043\ -\000\000\000\000\000\000\000\000\000\000\035\025\221\027\058\024\ -\174\024\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\214\002\099\004\200\004\062\000\225\007\000\000\000\000\000\000\ -\000\000\218\012\000\000\000\000\111\053\146\053\000\000\062\000\ -\000\000\000\000\000\000\000\000\167\053\000\000\000\000\000\000\ -\113\005\113\005\000\000\188\012\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\240\016\000\000\ -\000\000\000\000\151\015\000\000\163\014\000\000\000\000\000\000\ -\221\067\229\068\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\014\049\000\000\000\000\ -\255\001\098\003\000\000\000\000\000\000\050\005\000\000\125\049\ -\000\000\000\000\000\000\117\054\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\221\001\000\000\000\000\000\000\ -\000\000\053\068\000\000\000\000\000\000\135\255\016\002\000\000\ -\214\255\000\000\000\000\076\000\000\000\000\000\069\255\000\000\ -\040\004\000\000\215\255\131\000\000\000\245\005\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\038\007\004\054\038\007\214\002\026\007\042\004\080\068\ -\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\ -\028\056\114\056\139\003\000\000\000\000\200\056\030\057\000\000\ -\014\000\000\000\000\000\000\000\000\000\000\000\038\007\000\000\ -\217\003\000\000\008\003\000\000\026\007\000\000\000\000\000\000\ -\084\006\000\000\000\000\000\000\000\000\060\000\132\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\000\000\000\000\000\057\034\000\000\000\000\ -\248\067\000\000\120\043\141\068\000\000\000\000\041\005\000\000\ -\031\007\000\000\055\002\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\221\022\151\025\ -\000\000\000\000\000\000\011\026\128\026\000\000\000\000\000\000\ -\000\000\000\000\000\000\084\006\000\000\000\000\000\000\031\007\ -\000\000\000\000\000\000\125\001\000\000\120\007\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\147\255\000\000\098\007\ -\000\000\102\007\116\007\000\000\000\000\099\004\180\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\045\000\000\000\194\000\090\000\ -\131\000\000\000\245\005\000\000\066\000\000\000\026\007\101\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\038\007\117\054\000\000\155\048\244\026\ -\000\000\000\000\000\000\000\000\164\005\000\000\000\000\000\000\ -\000\000\000\000\068\017\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\066\007\000\000\198\055\021\043\207\002\000\000\000\000\ -\104\027\000\000\000\000\000\000\000\000\000\000\085\255\000\000\ -\000\000\196\000\000\000\000\000\000\000\069\004\000\000\162\000\ -\000\000\000\000\041\007\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\026\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\001\003\000\000\000\000\038\007\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\096\037\205\037\053\038\174\034\208\039\157\038\034\035\150\035\ -\011\036\127\036\127\031\081\028\197\028\243\036\244\031\104\032\ -\005\039\058\029\220\032\081\033\197\033\000\000\000\000\174\029\ -\000\000\000\000\111\003\000\000\164\005\051\040\000\000\000\000\ -\000\000\000\000\082\018\000\000\000\000\000\000\081\023\198\023\ -\000\000\000\000\000\000\105\022\000\000\000\000\109\039\025\053\ -\066\007\000\000\000\000\005\004\030\006\146\053\000\000\000\000\ -\000\000\000\000\000\000\000\000\001\003\000\000\000\000\000\000\ -\000\000\193\049\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\246\044\ -\000\000\000\000\000\000\000\000\205\045\000\000\000\000\000\000\ -\000\000\048\046\000\000\000\000\000\000\000\000\000\000\102\255\ -\000\000\000\000\222\000\162\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\202\006\000\000\093\005\ -\000\000\225\003\000\000\000\000\000\000\165\005\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\090\007\000\000\000\000\000\000\ -\000\000\000\000\000\000\238\039\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\034\030\000\000\000\000\000\000\038\065\000\000\ -\169\004\000\000\000\000\000\000\000\000\000\000\025\001\000\000\ -\000\000\084\255\000\000\169\255\000\000\000\000\185\255\000\000\ -\097\000\000\000\000\000\000\000\000\000\000\000\064\007\065\007\ -\000\000\000\000\000\000\000\000\136\003\000\000\000\000\213\005\ -\182\004\000\000\074\006\000\000\191\002\105\000\139\000\143\000\ -\000\000\000\000\000\000\053\068\185\040\000\000\000\000\000\000\ -\000\000\000\000\021\043\000\000\000\000\000\000\234\004\021\043\ -\053\068\228\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\131\000\000\000\ -\245\005\000\000\139\003\000\000\000\000\000\000\213\005\000\000\ -\000\000\090\007\000\000\198\006\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\018\005\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\146\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\047\002\000\000\000\000\ -\087\255\000\000\210\000\000\000\000\000\147\046\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\197\000\000\000\229\000\ -\000\000\125\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\068\007\000\000\000\000\099\007\ -\012\050\000\000\074\050\000\000\000\000\040\011\238\039\000\000\ -\021\043\000\000\000\000\174\001\000\000\049\255\073\007\073\007\ -\068\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\089\045\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\136\255\000\000\000\000\122\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\021\043\ -\028\041\000\000\127\010\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\050\038\065\139\004\225\002\136\004\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\163\051\ -\000\000\000\000\000\000\000\000\021\043\000\000\000\000\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\052\028\041\000\000\000\000\000\000\ -\198\018\000\000\058\019\000\000\000\000\000\000\155\040\000\000\ -\175\019\000\000\035\020\000\000\151\020\000\000\000\000\000\000\ -\235\003\000\000\162\050\000\000\001\003\240\047\000\000\119\007\ -\000\000\000\000\191\047\146\053\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\125\001\000\000\000\000\000\000\190\057\ -\000\000\000\000\128\007\248\046\000\000\000\000\000\000\000\000\ -\186\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\048\004\000\000\000\000\021\043\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\220\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\ -\012\005\000\000\125\004\000\000\203\004\000\000\000\000\062\005\ -\000\000\000\000\151\030\231\041\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\120\003\136\004\058\003\136\004\000\000\ -\011\031\228\001\000\000\115\007\000\000\063\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\ -\069\007\000\000\000\000\000\000\063\001\069\007\000\000\000\000\ -\000\000\000\000\000\000\000\000\229\015\091\047\000\000\000\000\ -\000\000\000\000\068\007\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\074\042\021\043\000\000\ -\000\000\103\001\000\000\000\000\000\000\148\001\000\000\000\000\ -\000\000\254\040\175\008\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\026\012\000\000\000\000\000\000\136\004\136\004\ -\108\007\000\000\099\007\000\000\000\000\000\000\000\000\000\000\ -\000\000\118\007\199\049\069\052\000\000\122\052\000\000\000\000\ -\249\050\028\041\000\000\000\000\000\000\028\041\000\000\097\041\ -\201\041\000\000\012\021\000\000\128\021\000\000\244\021\044\042\ -\143\042\247\042\049\051\042\048\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\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\001\000\000\028\041\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\112\007\108\007\000\000\114\007\099\007\000\000\249\050\000\000\ -\178\052\208\052\056\006\099\007\000\000\219\051\000\000\000\000\ -\000\000\092\052\021\043\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\028\041\000\000\000\000\000\000\106\010\238\013\ -\000\000\156\050\000\000\000\000\000\000\028\015\146\053\000\000\ -\000\000\000\000\115\003\193\002\000\000\000\000\000\000\249\004\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\111\002\ -\000\000\000\000\000\000\000\000\000\000\000\000\219\051\000\000\ -\000\000\000\000\000\000\000\000\092\052\000\000\139\039\000\000\ -\000\000\000\000\000\000\000\000\090\043\189\043\037\044\000\000\ -\000\000\000\000\000\000\028\015\000\000\000\000\000\000\031\007\ -\000\000\000\000\000\000\000\000\082\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\099\007\008\053\000\000\000\000\000\000\ -\139\039\139\039\000\000\241\015\000\000\000\000\000\000\000\000\ -\000\000\019\005\161\004\000\000\000\000\000\000\000\000\000\000\ -\168\255\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\181\047\139\039\000\000\000\000\000\000\000\000\000\050\021\006\ -\120\003\058\003\243\004\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\032\002\071\003\000\000\000\000\000\000\ -\000\000\000\000\000\000\117\007\000\000\000\000\000\000\000\000\ -\182\002\105\051\243\004\243\004\125\007\126\007\000\000\130\007\ -\099\007\000\000\243\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\196\003\000\000\243\004\000\000\000\000\000\000\212\003\ -\237\004" - -let yygindex = "\000\000\ -\000\000\000\000\000\000\000\000\000\000\020\000\183\255\037\000\ -\168\000\184\005\119\253\000\000\166\254\147\005\096\255\145\008\ -\232\012\061\254\077\005\253\255\063\014\144\252\036\003\247\255\ -\000\000\046\000\016\000\021\000\027\000\000\000\000\000\000\000\ -\000\000\030\000\035\000\040\000\000\000\255\255\003\000\093\009\ -\084\002\000\000\000\000\000\000\000\000\000\000\000\000\041\000\ -\000\000\000\000\000\000\000\000\010\255\059\252\000\000\000\000\ -\000\000\004\000\148\005\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\010\003\056\000\112\251\081\255\136\253\214\251\ -\048\253\185\252\087\251\199\003\087\003\000\000\000\000\000\000\ -\000\000\000\000\000\000\211\253\000\000\000\000\000\000\042\000\ -\082\255\014\006\085\005\100\005\000\000\000\000\083\255\048\000\ -\000\000\000\000\170\255\035\002\103\253\160\006\187\010\173\011\ -\000\000\000\000\000\000\131\255\000\000\006\013\182\006\006\000\ -\104\255\048\003\121\007\000\000\124\007\165\006\244\010\176\253\ -\000\000\218\000\000\000\000\000\000\000\198\003\090\005\152\255\ -\254\004\000\000\000\000\000\000\000\000\227\000\000\000\034\007\ -\145\255\042\007\081\006\083\008\000\000\000\000\060\004\000\000\ -\000\000\129\007\233\253\016\005\193\251\101\251\000\252\028\253\ -\000\000\204\252\000\000\074\004\000\000\000\000\119\251\088\255\ -\101\253\062\006\091\007\000\000\000\000\232\003\000\000\000\000\ -\253\003\243\252\000\000\200\003\108\004\000\000\179\253\135\002\ -\155\255\000\000\000\000\192\005\147\254\157\255\199\254\151\255\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\055\255\000\000" - -let yytablesize = 19255 -let yytable = "\126\000\ -\102\000\151\000\212\001\213\001\103\000\203\001\119\001\117\001\ -\251\001\230\001\128\001\168\000\118\001\157\001\086\002\026\003\ -\137\001\096\000\107\001\221\001\053\000\151\001\097\000\061\003\ -\151\003\203\002\063\003\123\001\098\000\190\003\111\001\099\000\ -\198\000\162\004\176\001\024\003\100\000\143\001\126\003\125\000\ -\123\002\101\000\106\000\241\001\043\004\242\001\060\000\139\004\ -\027\004\074\001\248\001\090\004\052\004\051\005\034\005\222\004\ -\169\000\120\001\030\005\034\000\131\003\071\000\039\001\102\002\ -\162\000\103\002\181\001\220\004\084\001\050\003\252\000\184\000\ -\039\005\143\003\031\001\171\000\037\005\194\003\001\004\008\000\ -\191\000\206\002\162\000\087\001\080\001\009\002\023\002\173\000\ -\060\000\038\001\102\000\216\001\197\004\231\003\103\000\098\002\ -\184\004\195\003\243\004\069\004\206\004\161\001\102\000\023\002\ -\075\001\084\001\103\000\096\000\126\000\006\002\087\001\126\000\ -\097\000\126\000\126\000\131\005\232\001\218\002\098\000\096\000\ -\045\001\099\000\198\001\139\001\097\000\095\001\100\000\100\001\ -\101\001\007\002\098\000\101\000\106\000\099\000\113\002\079\001\ -\151\000\151\000\100\000\151\000\085\005\122\001\171\000\101\000\ -\106\000\132\005\002\004\199\001\113\002\151\000\151\000\113\002\ -\037\005\135\001\131\003\151\004\064\002\200\001\027\005\162\000\ -\052\002\113\002\162\000\084\001\208\003\145\004\040\003\245\001\ -\089\001\040\003\127\001\135\000\151\000\151\000\087\001\080\001\ -\224\001\087\001\087\001\080\001\023\002\064\002\115\002\004\002\ -\083\001\160\001\245\001\232\003\133\005\218\003\185\004\080\002\ -\161\001\245\001\245\001\089\001\161\001\228\001\201\001\029\001\ -\229\001\202\001\129\002\188\001\189\001\040\004\052\003\233\001\ -\041\003\219\002\115\002\041\003\192\001\093\001\085\001\245\001\ -\245\001\067\002\052\003\088\001\200\003\083\001\014\004\008\002\ -\085\001\113\002\079\001\245\001\225\001\113\002\079\001\064\002\ -\064\002\251\003\245\001\245\001\125\002\245\001\076\001\082\005\ -\093\001\115\002\152\002\115\002\218\003\155\004\088\001\037\003\ -\088\005\064\002\059\004\037\005\012\002\044\001\188\004\115\002\ -\247\004\190\004\209\003\089\001\203\002\025\005\089\001\089\001\ -\133\002\117\001\134\002\082\002\013\002\069\002\089\004\194\005\ -\117\001\196\005\117\001\077\001\160\001\005\002\245\001\083\001\ -\160\001\128\001\128\001\219\003\083\003\026\005\041\004\109\002\ -\162\000\178\002\053\003\089\005\024\002\130\002\213\001\060\000\ -\116\002\060\000\140\005\056\003\163\001\203\002\059\003\122\002\ -\093\001\081\002\085\001\169\000\093\001\085\001\088\001\201\003\ -\211\005\088\001\088\001\034\000\015\004\071\000\216\003\156\004\ -\052\003\085\002\071\004\158\002\013\005\015\005\177\001\163\001\ -\038\001\028\000\178\001\076\001\060\000\010\003\166\000\082\002\ -\229\002\179\001\019\004\196\001\180\001\034\000\023\002\071\000\ -\083\002\154\001\217\001\075\001\059\004\012\005\248\004\216\002\ -\086\001\216\003\241\002\154\001\083\002\087\002\027\004\162\000\ -\079\002\082\002\086\001\069\002\049\005\114\004\126\000\177\001\ -\036\001\084\002\216\002\178\001\111\002\126\000\107\005\126\000\ -\084\003\216\002\179\001\085\002\155\001\180\001\126\000\126\000\ -\081\002\126\000\150\002\160\005\162\000\205\004\155\001\163\001\ -\071\002\072\002\077\002\163\001\076\002\126\000\075\002\095\001\ -\216\002\126\000\169\004\075\002\253\003\151\000\151\000\034\000\ -\028\000\071\000\217\003\216\002\170\003\166\000\082\002\085\002\ -\216\002\151\002\012\004\216\002\002\002\216\002\076\001\083\002\ -\045\001\222\002\039\004\151\002\167\002\162\000\151\000\151\000\ -\151\000\139\003\048\001\147\004\127\003\154\001\151\000\006\001\ -\154\001\127\001\127\001\179\001\086\001\018\004\111\005\086\001\ -\084\002\156\001\083\002\078\001\162\001\038\002\079\002\010\002\ -\111\002\115\004\085\002\151\000\151\000\235\003\216\002\018\002\ -\151\000\162\000\022\002\243\003\151\000\135\004\006\004\224\001\ -\155\001\119\005\074\005\155\001\128\003\157\001\150\002\162\001\ -\126\000\126\000\162\000\039\002\150\002\065\005\162\000\203\002\ -\077\002\060\000\106\004\148\001\075\002\055\002\162\000\126\000\ -\151\000\102\000\013\004\079\001\058\002\103\000\177\001\163\000\ -\164\004\151\000\178\001\168\002\117\001\151\002\122\001\224\001\ -\069\003\179\001\096\000\041\005\180\001\157\001\026\001\097\000\ -\210\002\212\002\151\000\070\003\071\003\098\000\245\002\038\002\ -\099\000\038\002\213\001\081\001\112\002\100\000\010\005\223\002\ -\114\002\198\001\101\000\106\000\156\001\097\005\078\001\162\001\ -\226\002\015\003\017\003\162\001\031\002\191\000\114\002\075\005\ -\169\002\114\002\074\003\214\002\061\004\039\002\064\002\039\002\ -\149\001\110\005\199\001\114\002\162\000\151\000\107\004\061\005\ -\157\001\150\003\152\003\213\001\200\001\038\005\214\002\150\002\ -\105\003\245\004\116\002\189\004\060\000\214\002\135\002\064\002\ -\134\003\184\000\046\003\136\002\092\004\198\001\087\002\177\001\ -\177\005\014\005\191\000\178\001\123\003\147\001\135\003\171\003\ -\143\004\137\002\179\001\214\002\135\002\180\001\168\000\022\003\ -\179\005\126\000\052\003\141\003\126\000\201\001\199\001\214\002\ -\202\001\171\002\087\002\126\000\214\002\126\000\126\000\214\002\ -\200\001\214\002\075\003\114\002\081\002\135\002\204\003\114\002\ -\205\003\064\002\064\002\126\000\076\003\048\003\057\003\135\002\ -\151\000\172\000\125\005\087\005\214\002\126\000\193\001\002\004\ -\146\001\202\002\162\000\064\002\028\000\162\000\095\005\151\000\ -\151\000\166\000\082\002\067\003\162\000\193\003\086\001\137\004\ -\162\000\201\001\214\002\083\002\202\001\166\003\142\004\194\001\ -\214\002\168\000\095\005\078\003\002\004\126\000\136\003\126\000\ -\135\002\138\002\189\003\135\002\126\000\089\003\169\000\218\001\ -\166\005\151\000\203\002\147\001\084\002\061\003\058\003\011\004\ -\063\003\126\000\151\000\180\003\151\000\218\001\085\002\100\004\ -\102\004\137\005\248\003\046\001\172\000\021\003\224\001\028\000\ -\041\005\095\004\250\003\117\001\162\002\219\001\012\000\016\004\ -\137\005\092\001\093\001\177\001\114\003\028\000\235\002\178\001\ -\214\002\181\003\004\004\219\001\137\003\234\003\179\001\236\002\ -\008\004\180\001\197\005\227\001\029\000\151\000\163\002\029\003\ -\030\003\152\003\213\001\104\005\033\000\106\005\182\003\203\002\ -\162\000\169\000\220\001\087\002\224\001\162\000\060\000\040\003\ -\138\003\048\000\198\005\199\002\040\003\184\003\122\001\203\002\ -\220\001\185\003\122\001\045\001\126\000\196\004\122\001\048\000\ -\122\001\199\002\177\001\046\001\122\001\122\001\178\001\061\005\ -\122\001\162\000\235\002\216\002\178\003\179\001\169\002\183\003\ -\180\001\122\001\083\001\236\002\216\002\175\005\176\005\116\000\ -\099\001\041\003\164\003\170\002\087\002\102\000\041\003\235\004\ -\203\002\103\000\087\002\169\002\197\003\017\004\118\004\241\003\ -\126\000\242\004\116\000\126\000\139\002\218\001\096\000\167\005\ -\094\005\116\000\078\004\097\000\126\000\194\001\106\002\000\004\ -\122\001\098\000\095\003\096\003\099\000\126\000\198\001\122\001\ -\162\000\100\000\045\001\151\000\216\002\028\000\101\000\106\000\ -\116\000\194\001\214\002\219\001\168\005\202\002\162\000\171\002\ -\115\003\122\001\122\001\116\000\122\001\122\001\220\005\199\001\ -\029\000\123\001\116\000\116\000\179\003\116\000\125\003\015\000\ -\033\000\200\001\169\005\085\001\171\002\214\002\147\000\122\001\ -\106\002\106\002\165\003\112\001\142\000\204\001\214\002\169\002\ -\220\001\221\004\142\000\204\001\115\001\151\000\213\001\048\000\ -\108\003\147\000\106\002\087\002\136\005\060\001\061\001\126\000\ -\147\000\110\001\109\003\109\001\193\001\214\002\116\000\126\000\ -\044\003\151\000\201\001\170\005\151\000\202\001\151\000\151\000\ -\151\000\179\004\210\005\126\000\151\000\150\001\147\000\147\000\ -\087\002\150\004\151\000\087\002\236\001\194\001\214\002\180\002\ -\181\002\122\000\147\000\066\001\202\002\162\000\126\000\064\004\ -\198\003\147\000\147\000\045\000\147\000\246\001\048\000\210\002\ -\171\002\151\000\163\004\147\001\071\001\210\003\195\004\247\002\ -\134\000\179\001\106\001\087\004\180\001\111\004\106\001\046\003\ -\246\001\237\001\236\003\224\001\248\002\106\001\012\000\246\001\ -\246\001\012\000\189\000\134\000\047\003\182\002\097\004\092\001\ -\093\001\106\001\134\000\012\000\012\000\147\000\115\001\012\000\ -\149\001\228\001\236\004\120\001\229\001\246\001\246\001\253\002\ -\012\000\012\000\012\000\012\000\237\003\190\000\087\002\090\002\ -\134\000\246\001\249\002\216\002\162\000\087\002\012\000\012\000\ -\246\001\246\001\048\003\246\001\134\000\126\000\202\003\068\003\ -\106\001\254\002\213\001\126\000\134\000\148\004\134\000\107\000\ -\087\002\239\004\012\000\122\000\216\002\012\000\048\005\012\000\ -\012\000\012\000\012\000\071\005\162\000\045\001\216\002\012\000\ -\012\000\120\002\107\000\040\003\074\003\062\004\012\000\126\000\ -\146\002\107\000\146\002\203\003\246\001\031\005\054\004\055\004\ -\151\000\126\000\012\000\146\002\012\000\126\000\012\000\134\000\ -\166\000\081\002\220\002\042\005\065\004\066\004\224\001\063\004\ -\107\000\133\001\012\000\072\004\221\002\012\000\147\001\216\002\ -\185\001\012\000\216\002\107\000\086\004\041\003\117\000\147\001\ -\190\000\028\000\062\005\107\000\112\005\107\000\166\000\082\002\ -\146\002\170\004\025\002\200\005\140\001\174\004\160\004\011\000\ -\083\002\117\000\194\001\224\001\087\002\167\000\126\000\253\000\ -\117\000\123\001\155\001\152\003\213\001\123\001\119\001\117\001\ -\126\000\123\001\016\000\123\001\118\001\185\001\194\001\123\001\ -\123\001\084\002\193\004\123\001\155\001\138\001\107\000\117\000\ -\201\005\214\002\145\001\085\002\123\001\022\000\087\002\224\001\ -\093\005\048\000\117\000\177\001\214\002\162\000\198\004\178\001\ -\087\002\117\000\117\000\126\000\117\000\254\000\179\001\048\000\ -\212\004\180\001\144\000\255\000\108\005\115\001\163\000\022\005\ -\012\003\162\000\177\002\002\005\063\002\118\002\064\002\145\000\ -\253\004\048\000\080\003\123\001\152\003\213\001\129\005\155\001\ -\065\002\214\002\123\001\172\003\151\000\216\002\185\001\209\001\ -\044\000\087\002\087\002\190\000\146\002\117\000\072\003\214\002\ -\077\003\126\000\173\003\174\003\123\001\123\001\162\000\123\001\ -\123\001\162\000\122\000\145\000\139\000\216\002\147\002\141\000\ -\194\001\209\001\119\002\216\002\126\000\126\000\126\000\214\002\ -\148\002\168\004\123\001\144\000\048\000\171\004\145\000\152\001\ -\090\002\087\002\175\004\002\005\194\001\145\000\206\002\146\002\ -\149\001\017\005\162\000\031\002\149\001\031\002\144\000\214\002\ -\149\001\040\003\149\001\186\004\187\004\144\000\149\001\192\003\ -\216\002\191\004\149\001\145\000\090\002\135\001\033\005\216\002\ -\035\005\166\000\126\000\149\001\031\002\081\002\021\005\145\000\ -\205\002\116\005\126\000\144\000\214\002\028\005\145\000\145\000\ -\078\005\145\000\200\004\045\001\126\000\214\002\151\000\144\000\ -\183\001\214\002\126\000\041\003\000\005\028\000\144\000\144\000\ -\216\002\144\000\166\000\082\002\122\000\216\002\214\002\162\000\ -\214\002\214\002\135\001\126\000\083\002\214\002\240\003\150\002\ -\177\001\149\001\029\005\214\002\178\001\214\002\119\002\162\000\ -\172\001\096\001\145\000\179\001\077\005\126\000\180\001\126\000\ -\186\001\144\003\080\005\149\001\149\001\084\002\149\001\149\001\ -\214\002\122\000\144\000\173\001\151\002\216\002\087\002\085\002\ -\214\002\169\003\013\003\091\005\150\002\176\003\214\002\151\000\ -\214\002\149\001\083\005\164\000\214\002\086\005\164\000\214\002\ -\011\005\164\000\164\000\120\005\097\001\164\000\164\000\164\000\ -\164\000\164\000\162\000\164\000\214\002\162\000\162\000\019\005\ -\020\005\151\002\164\000\146\002\213\003\126\000\164\000\137\002\ -\214\002\164\000\164\000\214\002\135\005\214\005\163\000\132\004\ -\126\000\043\003\164\000\164\000\146\002\090\002\164\000\164\000\ -\107\001\187\001\162\000\126\000\107\001\216\002\144\005\212\002\ -\122\005\123\005\216\001\126\005\127\005\162\000\107\001\033\001\ -\171\005\133\004\126\000\126\000\172\005\143\005\146\002\107\001\ -\126\000\126\000\212\002\162\000\162\000\216\002\163\000\174\001\ -\145\005\212\002\216\002\216\002\148\001\164\000\164\000\164\000\ -\034\000\164\000\162\000\161\005\216\002\003\003\090\002\126\000\ -\073\005\040\003\175\001\008\000\090\002\002\005\126\000\002\005\ -\212\002\117\001\004\003\126\000\149\000\117\001\107\001\126\002\ -\180\005\181\005\034\000\212\002\117\001\216\002\060\005\117\001\ -\091\004\144\001\146\002\212\002\146\002\212\002\152\001\216\002\ -\126\000\226\001\152\001\126\000\212\002\164\000\164\000\193\005\ -\031\003\126\000\126\000\041\003\152\001\234\001\198\004\105\004\ -\214\002\182\001\146\002\204\005\112\000\152\001\113\000\114\000\ -\028\000\104\000\115\000\214\002\143\000\115\001\117\000\193\001\ -\191\001\063\002\212\002\155\002\202\005\121\005\212\002\117\001\ -\218\005\164\000\146\002\214\002\155\001\156\002\209\005\143\000\ -\126\002\224\005\225\005\104\000\091\002\212\002\143\000\120\000\ -\194\001\216\005\217\005\146\003\212\002\090\002\121\000\109\001\ -\235\001\071\000\132\000\109\001\092\002\026\002\027\002\028\002\ -\029\002\097\003\122\000\123\000\143\000\062\002\177\003\149\005\ -\142\000\030\002\212\002\187\003\216\002\215\003\109\001\158\005\ -\143\000\048\000\090\002\071\000\132\000\090\002\212\002\143\000\ -\143\000\096\001\143\000\245\003\216\002\096\001\212\002\099\001\ -\212\002\096\001\211\003\096\001\206\002\057\005\238\001\096\001\ -\096\001\151\001\246\003\160\001\160\001\151\001\182\005\153\003\ -\058\005\164\000\164\000\154\003\096\001\031\002\185\005\151\001\ -\184\001\185\001\155\003\214\002\247\003\156\003\240\001\214\002\ -\151\001\192\005\188\003\143\000\097\001\002\003\157\003\164\000\ -\097\001\212\002\120\001\003\003\097\001\247\001\097\001\206\001\ -\214\002\214\002\097\001\085\003\249\002\164\000\097\001\214\002\ -\004\003\164\000\252\001\096\001\058\004\086\003\148\002\097\001\ -\090\002\116\004\096\001\228\001\214\002\219\005\229\001\090\002\ -\177\001\254\001\214\002\117\004\178\001\162\000\014\002\255\001\ -\128\005\000\002\045\004\179\001\096\001\096\001\180\001\096\001\ -\096\001\019\002\090\002\001\002\038\004\164\000\214\002\068\002\ -\191\001\069\002\159\002\191\001\160\002\191\001\097\001\191\001\ -\142\000\204\001\096\001\070\002\148\001\097\001\161\002\148\002\ -\148\001\148\002\148\002\148\002\148\001\148\002\148\001\076\001\ -\148\002\148\002\148\001\202\002\162\000\045\001\148\001\097\001\ -\097\001\254\004\097\001\097\001\191\001\028\000\162\000\148\001\ -\191\001\255\004\000\005\026\002\027\002\028\002\029\002\184\002\ -\185\002\099\001\148\002\093\004\094\004\097\001\207\002\030\002\ -\001\005\148\002\164\000\144\001\212\002\073\002\220\003\212\002\ -\221\003\237\004\139\002\104\004\190\000\148\002\148\002\206\002\ -\208\002\212\002\222\003\139\002\238\004\100\002\090\002\214\002\ -\112\004\020\004\012\000\021\004\182\001\148\001\212\002\122\000\ -\212\002\212\002\101\002\164\000\150\002\022\004\104\002\182\001\ -\120\004\013\000\014\000\031\002\212\002\212\002\150\002\148\001\ -\148\001\105\002\148\001\148\001\182\001\182\001\021\000\249\002\ -\090\002\191\001\106\002\191\001\184\002\187\002\113\002\130\004\ -\212\002\114\002\090\002\212\002\115\002\148\001\122\000\138\004\ -\212\002\029\000\182\001\121\002\073\001\062\002\212\002\126\002\ -\062\002\033\000\202\002\162\000\212\002\005\005\191\001\037\000\ -\191\001\204\002\062\002\162\000\045\001\039\000\062\002\127\002\ -\212\002\216\002\216\002\119\002\212\002\186\002\188\002\062\002\ -\062\002\062\002\062\002\090\002\090\002\043\000\131\002\135\002\ -\212\002\107\002\108\002\212\002\212\002\209\002\062\002\164\000\ -\165\004\047\000\132\002\214\002\050\000\118\001\135\002\214\002\ -\124\002\118\001\164\002\214\002\214\002\135\002\166\002\197\002\ -\118\001\062\002\176\002\118\001\062\002\206\002\119\002\062\002\ -\062\002\062\002\214\002\090\002\118\001\005\005\062\002\062\002\ -\213\002\142\002\144\002\146\002\135\002\062\002\135\002\225\002\ -\238\002\150\002\227\002\055\005\056\005\230\002\062\002\239\002\ -\135\002\062\002\240\002\062\002\112\000\062\002\113\000\114\000\ -\028\000\214\002\115\000\242\002\243\002\116\000\117\000\008\003\ -\202\004\062\002\204\004\118\001\062\002\244\002\009\003\194\002\ -\062\002\246\002\001\003\131\002\131\002\061\001\118\000\048\000\ -\025\003\032\003\131\002\038\003\054\003\191\001\119\000\120\000\ -\191\001\135\002\042\003\045\003\135\002\051\003\121\000\131\002\ -\064\003\149\001\073\003\224\002\241\004\131\002\079\003\087\003\ -\179\001\244\004\122\000\123\000\001\000\002\000\003\000\004\000\ -\005\000\094\003\101\003\002\002\103\003\116\003\184\002\129\003\ -\131\002\131\002\249\002\031\002\142\003\252\002\185\000\185\000\ -\182\001\099\001\008\005\159\003\160\003\099\001\185\000\161\003\ -\090\002\099\001\162\003\099\001\185\000\185\000\163\003\099\001\ -\199\003\167\003\182\001\212\003\182\001\206\003\182\001\233\003\ -\185\000\242\003\182\001\249\003\099\001\008\000\005\004\007\004\ -\119\002\185\000\023\005\024\005\010\004\029\004\030\004\185\000\ -\185\000\185\000\185\000\185\000\035\004\005\005\036\004\044\004\ -\191\001\194\000\049\004\051\004\046\004\040\005\008\000\068\004\ -\114\001\050\005\185\000\050\004\074\004\096\004\108\004\185\000\ -\113\004\110\004\121\004\122\004\185\000\185\000\182\001\123\004\ -\127\004\136\004\099\001\191\001\204\002\140\004\128\004\185\000\ -\185\000\185\000\185\000\185\000\129\004\141\004\144\001\149\004\ -\144\001\159\004\157\004\177\004\099\001\099\001\070\005\099\001\ -\099\001\185\000\161\004\144\001\182\001\192\004\172\004\112\000\ -\166\004\113\000\114\000\028\000\173\004\115\000\158\003\176\004\ -\115\001\117\000\099\001\082\003\219\004\204\002\223\004\005\005\ -\194\004\005\005\006\005\009\005\212\002\018\003\016\005\212\002\ -\182\001\036\005\160\001\093\003\018\005\206\004\096\005\052\005\ -\067\005\212\002\120\000\053\005\166\002\054\005\100\005\076\005\ -\081\005\121\000\084\005\099\005\105\005\113\005\212\002\164\000\ -\212\002\212\002\109\005\118\005\134\005\122\000\123\000\147\005\ -\148\005\150\005\151\005\156\005\118\003\212\002\157\005\159\005\ -\178\005\042\003\039\005\183\005\191\005\207\005\062\002\208\005\ -\212\005\062\002\215\005\221\005\222\005\034\000\071\000\026\002\ -\212\002\034\000\214\002\062\002\071\000\047\002\216\002\062\002\ -\212\002\044\002\191\001\214\002\120\002\042\003\212\002\144\001\ -\062\002\062\002\062\002\062\002\212\002\150\000\008\000\046\002\ -\114\001\102\000\144\001\223\002\224\002\194\001\182\001\062\002\ -\212\002\214\002\137\002\049\002\212\002\144\001\166\000\135\002\ -\183\000\182\001\136\002\135\002\218\001\214\003\015\000\136\002\ -\212\002\138\002\062\002\212\002\141\002\062\002\230\003\120\002\ -\062\002\062\002\062\002\191\001\142\002\143\002\144\001\062\002\ -\062\002\139\002\182\001\195\005\066\005\141\005\062\002\112\000\ -\122\003\113\000\114\000\028\000\048\004\115\000\190\005\011\003\ -\115\001\117\000\062\002\081\003\062\002\211\002\062\002\079\005\ -\078\002\077\002\056\004\191\001\151\002\023\003\028\003\163\001\ -\149\002\007\005\062\002\119\004\252\004\062\002\205\005\206\005\ -\112\003\062\002\120\000\117\002\093\002\072\005\213\005\064\005\ -\000\000\121\000\098\005\240\004\000\000\000\000\042\003\204\002\ -\000\000\000\000\000\000\000\000\000\000\122\000\123\000\223\005\ -\191\001\191\001\000\000\000\000\000\000\052\001\009\004\000\000\ -\000\000\141\001\000\000\000\000\112\000\000\000\113\000\114\000\ -\028\000\144\001\115\000\000\000\000\000\116\000\117\000\000\000\ -\000\000\000\000\000\000\156\001\150\000\150\000\000\000\150\000\ -\216\002\216\002\059\001\060\001\061\001\000\000\118\000\216\002\ -\000\000\150\000\150\000\000\000\000\000\216\002\119\000\120\000\ -\000\000\000\000\000\000\000\000\216\002\191\001\121\000\042\003\ -\194\002\000\000\216\002\000\000\000\000\063\001\064\001\042\003\ -\150\000\150\000\122\000\123\000\222\001\000\000\000\000\000\000\ -\191\001\066\001\067\001\068\001\069\001\216\002\216\002\000\000\ -\000\000\081\004\083\004\085\004\000\000\182\001\000\000\088\004\ -\000\000\000\000\071\001\000\000\000\000\194\002\000\000\000\000\ -\000\000\000\000\000\000\165\000\000\000\000\000\172\000\000\000\ -\000\000\174\000\175\000\000\000\000\000\176\000\177\000\178\000\ -\179\000\180\000\000\000\181\000\194\002\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\032\001\000\000\ -\000\000\034\001\035\001\000\000\000\000\000\000\000\000\000\000\ -\000\000\042\003\040\001\041\001\144\001\000\000\042\001\043\001\ -\112\000\000\000\113\000\114\000\028\000\000\000\115\000\000\000\ -\000\000\115\001\117\000\000\000\000\000\182\001\000\000\182\001\ -\000\000\182\001\000\000\144\001\182\001\000\000\000\000\000\000\ -\042\003\000\000\000\000\000\000\000\000\144\001\015\000\000\000\ -\191\001\015\000\191\001\120\000\000\000\104\001\105\001\106\001\ -\000\000\108\001\121\000\015\000\015\000\000\000\000\000\015\000\ -\000\000\000\000\204\002\000\000\000\000\000\000\122\000\123\000\ -\015\000\015\000\015\000\015\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\012\000\042\003\015\000\015\000\ -\000\000\000\000\042\003\000\000\000\000\000\000\000\000\000\000\ -\000\000\191\001\000\000\089\000\014\000\153\001\154\001\066\002\ -\000\000\000\000\015\000\000\000\000\000\015\000\000\000\000\000\ -\090\000\015\000\015\000\000\000\000\000\000\000\144\001\015\000\ -\015\000\000\000\144\001\000\000\000\000\000\000\015\000\204\002\ -\000\000\000\000\000\000\029\000\000\000\000\000\000\000\000\000\ -\000\000\197\001\015\000\033\000\015\000\000\000\015\000\204\002\ -\042\003\091\000\144\001\000\000\000\000\000\000\000\000\039\000\ -\000\000\000\000\015\000\209\002\000\000\015\000\000\000\000\000\ -\144\001\015\000\000\000\000\000\000\000\000\000\141\001\092\000\ -\000\000\150\000\150\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\093\000\000\000\000\000\050\000\042\003\ -\204\002\000\000\000\000\000\000\000\000\000\000\042\003\000\000\ -\000\000\000\000\150\000\150\000\150\000\000\000\000\000\000\000\ -\000\000\000\000\150\000\000\000\000\000\191\001\000\000\069\005\ -\000\000\157\002\112\000\000\000\113\000\114\000\028\000\000\000\ -\115\000\249\001\250\001\116\000\117\000\144\001\000\000\150\000\ -\150\000\000\000\000\000\000\000\150\000\000\000\000\000\000\000\ -\150\000\240\001\000\000\222\001\118\000\144\001\000\000\003\002\ -\000\000\000\000\191\001\156\001\119\000\060\003\000\000\000\000\ -\000\000\000\000\156\001\000\000\121\000\011\002\052\000\069\005\ -\000\000\017\002\000\000\000\000\150\000\000\000\000\000\070\004\ -\122\000\123\000\000\000\000\000\000\000\150\000\000\000\000\000\ -\124\001\000\000\000\000\222\001\191\001\000\000\000\000\000\000\ -\000\000\144\001\000\000\000\000\144\001\125\001\150\000\000\000\ -\000\000\000\003\000\000\191\001\000\000\000\000\000\000\144\001\ -\000\000\000\000\183\000\191\001\000\000\000\000\000\000\000\000\ -\112\000\000\000\113\000\114\000\028\000\000\000\115\000\000\000\ -\000\000\126\001\117\000\000\000\191\001\000\000\000\000\153\000\ -\000\000\000\000\000\000\170\000\000\000\000\000\000\000\000\000\ -\000\000\150\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\170\000\120\000\000\000\191\001\191\001\000\000\ -\000\000\000\000\121\000\144\001\000\000\000\000\000\000\191\001\ -\000\000\000\000\110\002\000\000\170\000\144\001\122\000\123\000\ -\000\000\000\000\000\000\000\000\000\000\144\001\191\001\000\000\ -\000\000\000\000\000\000\191\001\191\001\191\001\191\001\000\000\ -\156\000\008\000\009\000\000\000\000\000\052\001\010\000\011\000\ -\144\001\144\001\000\000\135\002\000\000\000\000\000\000\000\000\ -\170\000\000\000\170\000\170\000\000\000\144\001\069\005\000\000\ -\069\005\015\000\016\000\156\001\150\000\000\000\000\000\000\000\ -\144\001\058\001\059\001\060\001\061\001\000\000\000\000\000\000\ -\000\000\000\000\000\000\150\000\150\000\022\000\144\001\106\002\ -\024\000\025\000\026\000\027\000\144\001\144\001\028\000\000\000\ -\162\000\000\000\000\000\142\000\032\000\063\001\064\001\000\000\ -\000\000\000\000\110\003\000\000\000\000\000\000\000\000\000\000\ -\000\000\066\001\067\001\068\001\069\001\150\000\153\000\153\000\ -\000\000\153\000\042\000\000\000\000\000\000\000\150\000\000\000\ -\150\000\000\000\071\001\153\000\153\000\000\000\000\000\231\002\ -\044\000\000\000\222\001\000\000\000\000\045\000\000\000\170\000\ -\048\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\240\001\153\000\214\001\240\001\000\000\000\000\170\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\240\001\145\003\ -\000\000\150\000\240\001\000\000\000\000\000\000\052\000\156\000\ -\156\000\052\000\156\000\240\001\240\001\240\001\240\001\000\000\ -\222\001\000\000\000\000\052\000\156\000\156\000\000\000\000\000\ -\000\000\000\000\240\001\000\000\000\000\000\000\000\000\000\000\ -\052\000\000\000\052\000\052\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\205\001\156\000\156\000\240\001\052\000\052\000\ -\240\001\000\000\000\000\240\001\240\001\240\001\000\000\000\000\ -\000\000\154\000\240\001\240\001\000\000\171\000\000\000\000\000\ -\000\000\240\001\052\000\000\000\000\000\052\000\170\000\244\003\ -\000\000\052\000\052\000\000\000\171\000\240\001\000\000\240\001\ -\052\000\240\001\000\000\000\000\000\000\000\000\052\000\000\000\ -\000\000\000\000\000\000\170\000\141\001\240\001\171\000\000\000\ -\240\001\000\000\052\000\000\000\240\001\000\000\052\000\150\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\052\000\000\000\000\000\052\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\171\000\000\000\171\000\171\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\150\000\000\000\170\000\170\000\000\000\000\000\170\000\ -\000\000\053\000\170\000\000\000\116\001\021\002\000\000\000\000\ -\000\000\000\000\000\000\032\002\000\000\150\000\000\000\106\002\ -\150\000\000\000\150\000\150\000\150\000\000\000\000\000\106\002\ -\150\000\000\000\000\000\000\000\106\002\000\000\150\000\000\000\ -\154\000\154\000\000\000\154\000\000\000\000\000\000\000\000\000\ -\000\000\106\002\000\000\106\002\106\002\154\000\154\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\150\000\000\000\000\000\ -\106\002\171\000\000\000\153\000\214\001\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\154\000\215\001\000\000\222\001\ -\088\003\171\000\000\000\106\002\000\000\000\000\106\002\000\000\ -\000\000\106\002\106\002\106\002\153\000\153\000\153\000\207\003\ -\000\000\106\002\000\000\000\000\153\000\000\000\000\000\106\002\ -\000\000\000\000\000\000\000\000\134\004\000\000\000\000\000\000\ -\000\000\000\000\000\000\106\002\000\000\000\000\000\000\106\002\ -\000\000\214\001\153\000\000\000\156\000\156\000\214\001\000\000\ -\000\000\000\000\153\000\106\002\000\000\000\000\106\002\112\000\ -\000\000\113\000\114\000\028\000\000\000\115\000\000\000\000\000\ -\116\000\117\000\000\000\000\000\140\002\156\000\156\000\156\000\ -\000\000\206\004\000\000\000\000\000\000\156\000\153\000\000\000\ -\171\000\118\000\000\000\000\000\000\000\000\000\000\000\153\000\ -\207\004\119\000\120\000\115\002\150\000\000\000\000\000\198\001\ -\000\000\121\000\156\000\156\000\000\000\171\000\000\000\156\000\ -\153\000\000\000\222\001\156\000\000\000\122\000\123\000\000\000\ -\000\000\000\000\000\000\000\000\170\000\032\002\000\000\000\000\ -\208\004\076\000\113\000\114\000\028\000\000\000\115\000\000\000\ -\000\000\116\000\209\004\000\000\000\000\000\000\000\000\156\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\222\001\ -\233\002\000\000\118\000\153\000\000\000\000\000\000\000\000\000\ -\000\000\210\004\119\000\120\000\000\000\000\000\000\000\000\000\ -\000\000\156\000\121\000\000\000\000\000\171\000\171\000\000\000\ -\000\000\171\000\155\000\201\001\171\000\000\000\211\004\123\000\ -\000\000\000\000\000\000\222\001\000\000\000\000\000\000\156\001\ -\000\000\053\000\000\000\000\000\053\000\000\000\116\001\000\000\ -\000\000\000\000\000\000\000\000\000\000\116\001\053\000\116\001\ -\000\000\000\000\000\000\000\000\233\002\000\000\000\000\000\000\ -\000\000\000\000\000\000\053\000\000\000\053\000\053\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\153\000\000\000\ -\150\000\053\000\053\000\000\000\000\000\154\000\215\001\000\000\ -\000\000\000\000\000\000\000\000\000\000\153\000\153\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\053\000\000\000\000\000\ -\053\000\000\000\000\000\000\000\053\000\053\000\154\000\154\000\ -\154\000\000\000\000\000\053\000\111\003\000\000\154\000\000\000\ -\000\000\053\000\000\000\000\000\000\000\000\000\000\000\153\000\ -\000\000\000\000\000\000\000\000\000\000\053\000\000\000\156\000\ -\153\000\053\000\214\001\215\001\154\000\000\000\000\000\000\000\ -\215\001\000\000\000\000\000\000\154\000\053\000\156\000\156\000\ -\053\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\155\000\155\000\000\000\155\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\155\000\155\000\ -\154\000\000\000\150\000\214\001\000\000\000\000\000\000\000\000\ -\156\000\154\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\156\000\000\000\156\000\000\000\155\000\155\000\000\000\ -\000\000\000\000\154\000\115\002\000\000\115\002\115\002\115\002\ -\000\000\000\000\000\000\115\002\000\000\000\000\171\000\000\000\ -\115\002\000\000\000\000\000\000\115\002\115\002\115\002\000\000\ -\000\000\000\000\000\000\000\000\000\000\115\002\115\002\115\002\ -\115\002\076\000\000\000\000\000\156\000\000\000\000\000\115\002\ -\000\000\000\000\000\000\150\000\115\002\154\000\076\000\000\000\ -\000\000\000\000\000\000\115\002\115\002\239\001\110\003\000\000\ -\000\000\000\000\000\000\076\000\000\000\076\000\076\000\115\002\ -\000\000\000\000\115\002\115\002\000\000\115\002\115\002\115\002\ -\000\000\115\002\076\000\000\000\115\002\115\002\000\000\000\000\ -\000\000\153\000\000\000\115\002\000\000\000\000\000\000\000\000\ -\000\000\116\001\000\000\000\000\000\000\076\000\115\002\115\002\ -\110\003\115\002\115\002\115\002\115\002\076\000\165\005\115\002\ -\000\000\000\000\000\000\076\000\000\000\000\000\000\000\115\002\ -\115\002\076\000\115\002\000\000\000\000\000\000\115\002\000\000\ -\154\000\000\000\000\000\057\002\000\000\076\000\059\002\000\000\ -\060\002\076\000\061\002\153\000\000\000\000\000\000\000\154\000\ -\154\000\000\000\156\000\000\000\000\000\076\000\000\000\000\000\ -\076\000\000\000\000\000\000\000\000\000\000\000\000\000\153\000\ -\000\000\000\000\214\001\000\000\153\000\153\000\153\000\094\002\ -\195\000\195\000\153\000\099\002\000\000\000\000\000\000\000\000\ -\153\000\154\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\154\000\000\000\215\001\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\156\000\000\000\000\000\153\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\156\000\000\000\000\000\156\000\079\004\156\000\156\000\156\000\ -\102\001\103\001\000\000\156\000\000\000\215\001\000\000\141\002\ -\000\000\156\000\000\000\000\000\000\000\008\000\155\000\155\000\ -\000\000\000\000\002\002\011\000\153\002\000\000\154\002\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\156\000\000\000\000\000\137\000\000\000\015\000\016\000\155\000\ -\155\000\155\000\000\000\000\000\000\000\000\000\000\000\155\000\ -\155\000\198\002\000\000\201\002\000\000\000\000\000\000\000\000\ -\000\000\022\000\000\000\138\000\139\000\000\000\140\000\141\000\ -\000\000\000\000\028\000\000\000\155\000\155\000\000\000\142\000\ -\143\000\155\000\000\000\000\000\000\000\155\000\144\000\000\000\ -\116\001\000\000\000\000\000\000\000\000\254\003\214\001\000\000\ -\000\000\000\000\000\000\145\000\000\000\239\001\000\000\000\000\ -\239\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\146\000\155\000\239\001\154\000\044\000\000\000\239\001\000\000\ -\000\000\045\000\155\000\000\000\048\000\147\000\000\000\239\001\ -\239\001\239\001\239\001\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\155\000\000\000\000\000\239\001\000\000\ -\000\000\000\000\000\000\209\001\000\000\000\000\000\000\156\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\239\001\000\000\000\000\239\001\154\000\000\000\239\001\ -\239\001\239\001\000\000\000\000\000\000\000\000\239\001\239\001\ -\036\003\000\000\000\000\039\003\000\000\239\001\155\000\000\000\ -\000\000\154\000\000\000\000\000\215\001\000\000\154\000\154\000\ -\154\000\239\001\000\000\239\001\154\000\239\001\000\000\000\000\ -\000\000\000\000\154\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\239\001\000\000\000\000\239\001\000\000\000\000\000\000\ -\239\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\154\000\214\001\000\000\000\000\000\000\000\000\033\002\ -\034\002\035\002\036\002\037\002\038\002\039\002\040\002\041\002\ -\042\002\043\002\044\002\045\002\046\002\047\002\048\002\049\002\ -\050\002\051\002\052\002\053\002\000\000\056\002\000\000\000\000\ -\000\000\155\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\113\003\062\002\000\000\251\001\000\000\ -\155\000\155\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\079\002\002\002\156\000\002\002\002\002\002\002\000\000\ -\000\000\000\000\002\002\146\004\000\000\000\000\133\003\002\002\ -\000\000\000\000\000\000\002\002\002\002\002\002\000\000\000\000\ -\000\000\000\000\155\000\000\000\002\002\002\002\002\002\002\002\ -\000\000\000\000\000\000\155\000\000\000\155\000\002\002\000\000\ -\000\000\000\000\002\002\002\002\214\001\000\000\000\000\000\000\ -\000\000\000\000\002\002\002\002\000\000\000\000\000\000\000\000\ -\215\001\000\000\000\000\000\000\000\000\000\000\002\002\000\000\ -\000\000\002\002\000\000\000\000\002\002\002\002\002\002\000\000\ -\002\002\000\000\000\000\002\002\002\002\000\000\155\000\000\000\ -\237\001\000\000\002\002\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\002\002\002\002\000\000\ -\002\002\002\002\002\002\000\000\000\000\156\000\002\002\000\000\ -\000\000\000\000\000\000\000\000\000\000\214\001\002\002\000\000\ -\000\000\002\002\000\000\000\000\000\000\002\002\000\000\000\000\ -\138\005\000\000\000\000\209\001\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\209\001\000\000\003\004\000\000\000\000\ -\209\001\215\002\000\000\000\000\000\000\000\000\217\002\000\000\ -\000\000\000\000\000\000\000\000\000\000\209\001\000\000\209\001\ -\209\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\162\005\000\000\209\001\000\000\156\000\104\003\ -\000\000\112\000\000\000\113\000\114\000\028\000\000\000\115\000\ -\000\000\000\000\115\001\117\000\155\000\000\000\037\004\209\001\ -\000\000\000\000\195\000\195\000\215\001\209\001\209\001\209\001\ -\000\000\000\000\000\000\000\000\000\000\209\001\106\002\000\000\ -\000\000\000\000\000\000\209\001\120\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\121\000\000\000\000\000\067\004\209\001\ -\000\000\000\000\000\000\209\001\116\001\027\003\000\000\122\000\ -\123\000\000\000\033\003\034\003\035\003\000\000\155\000\209\001\ -\000\000\000\000\209\001\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\251\001\000\000\ -\251\001\251\001\155\000\098\004\099\004\155\000\251\001\155\000\ -\155\000\155\000\000\000\251\001\000\000\155\000\000\000\251\001\ -\251\001\251\001\000\000\155\000\000\000\000\000\000\000\000\000\ -\251\001\251\001\251\001\251\001\000\000\000\000\000\000\000\000\ -\000\000\000\000\251\001\000\000\000\000\000\000\215\001\251\001\ -\000\000\000\000\155\000\000\000\000\000\000\000\251\001\251\001\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\131\004\000\000\251\001\000\000\000\000\251\001\000\000\000\000\ -\251\001\251\001\251\001\000\000\251\001\098\003\099\003\100\003\ -\251\001\000\000\000\000\144\004\000\000\000\000\251\001\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\036\002\ -\237\001\251\001\251\001\237\001\251\001\251\001\251\001\000\000\ -\000\000\000\000\000\000\214\002\000\000\237\001\000\000\215\001\ -\000\000\237\001\251\001\130\003\000\000\251\001\000\000\000\000\ -\214\002\251\001\237\001\237\001\237\001\237\001\000\000\000\000\ -\000\000\000\000\000\000\140\003\000\000\000\000\000\000\000\000\ -\000\000\237\001\000\000\214\002\000\000\214\002\214\002\214\002\ -\000\000\214\002\000\000\000\000\214\002\214\002\000\000\000\000\ -\000\000\000\000\000\000\000\000\237\001\000\000\000\000\237\001\ -\000\000\155\000\237\001\237\001\237\001\000\000\000\000\000\000\ -\000\000\237\001\237\001\000\000\000\000\000\000\214\002\000\000\ -\237\001\000\000\000\000\209\001\000\000\214\002\000\000\000\000\ -\000\000\000\000\000\000\201\004\237\001\203\004\237\001\000\000\ -\237\001\214\002\214\002\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\237\001\000\000\223\003\237\001\ -\000\000\000\000\000\000\237\001\000\000\000\000\106\002\106\002\ -\106\002\106\002\000\000\000\000\106\002\106\002\106\002\106\002\ -\106\002\106\002\106\002\106\002\106\002\106\002\106\002\106\002\ -\106\002\106\002\106\002\106\002\246\004\000\000\106\002\106\002\ -\106\002\106\002\106\002\106\002\106\002\106\002\000\000\000\000\ -\000\000\000\000\106\002\106\002\000\000\000\000\106\002\106\002\ -\106\002\106\002\106\002\106\002\106\002\106\002\000\000\106\002\ -\106\002\106\002\000\000\106\002\106\002\106\002\106\002\000\000\ -\000\000\106\002\106\002\106\002\000\000\106\002\106\002\106\002\ -\106\002\106\002\106\002\000\000\106\002\106\002\106\002\106\002\ -\106\002\000\000\000\000\000\000\000\000\155\000\106\002\106\002\ -\106\002\106\002\106\002\106\002\106\002\106\002\000\000\106\002\ -\064\002\106\002\106\002\060\004\106\002\106\002\106\002\106\002\ -\106\002\000\000\106\002\106\002\000\000\106\002\106\002\106\002\ -\106\002\000\000\106\002\106\002\000\000\106\002\000\000\000\000\ -\000\000\106\002\000\000\112\000\000\000\113\000\114\000\028\000\ -\000\000\115\000\000\000\000\000\116\000\117\000\000\000\000\000\ -\068\005\000\000\000\000\000\000\000\000\000\000\134\001\036\002\ -\000\000\036\002\036\002\036\002\000\000\118\000\000\000\036\002\ -\000\000\000\000\000\000\000\000\036\002\119\000\120\000\000\000\ -\036\002\036\002\036\002\000\000\000\000\121\000\000\000\000\000\ -\000\000\036\002\036\002\036\002\036\002\090\005\000\000\000\000\ -\000\000\122\000\123\000\036\002\000\000\000\000\000\000\155\000\ -\036\002\000\000\124\004\125\004\126\004\000\000\000\000\036\002\ -\036\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\036\002\000\000\000\000\036\002\117\005\ -\000\000\036\002\036\002\036\002\000\000\036\002\000\000\000\000\ -\036\002\036\002\000\000\000\000\000\000\000\000\130\005\036\002\ -\000\000\124\001\000\000\209\001\000\000\000\000\139\005\000\000\ -\000\000\000\000\036\002\036\002\000\000\036\002\036\002\036\002\ -\209\001\241\000\152\004\153\004\154\004\000\000\000\000\142\005\ -\155\000\000\000\000\000\036\002\000\000\209\001\036\002\209\001\ -\209\001\112\000\036\002\113\000\114\000\028\000\000\000\115\000\ -\000\000\000\000\126\001\117\000\209\001\000\000\000\000\000\000\ -\163\005\164\005\112\000\000\000\113\000\114\000\028\000\178\004\ -\115\000\000\000\174\005\116\000\117\000\000\000\000\000\209\001\ -\000\000\000\000\209\001\000\000\120\000\209\001\209\001\209\001\ -\000\000\184\005\000\000\121\000\118\000\209\001\186\005\187\005\ -\188\005\189\005\000\000\209\001\119\000\060\003\000\000\122\000\ -\123\000\000\000\000\000\000\000\121\000\000\000\000\000\209\001\ -\000\000\000\000\000\000\209\001\000\000\000\000\000\000\152\005\ -\122\000\123\000\000\000\000\000\000\000\000\000\000\000\209\001\ -\000\000\000\000\209\001\000\000\000\000\000\000\000\000\000\000\ -\224\004\225\004\000\000\000\000\000\000\232\004\233\004\234\004\ -\064\002\064\002\064\002\064\002\000\000\247\000\064\002\064\002\ -\064\002\064\002\064\002\064\002\064\002\064\002\064\002\064\002\ -\064\002\064\002\064\002\064\002\064\002\064\002\064\002\000\000\ -\064\002\064\002\064\002\064\002\064\002\064\002\064\002\064\002\ -\000\000\000\000\000\000\000\000\064\002\064\002\000\000\000\000\ -\064\002\064\002\064\002\064\002\064\002\064\002\064\002\064\002\ -\000\000\064\002\064\002\064\002\000\000\064\002\064\002\064\002\ -\064\002\000\000\000\000\064\002\064\002\064\002\052\002\064\002\ -\064\002\064\002\064\002\064\002\064\002\000\000\064\002\064\002\ -\064\002\064\002\064\002\000\000\000\000\000\000\000\000\000\000\ -\064\002\064\002\064\002\064\002\064\002\064\002\064\002\064\002\ -\000\000\064\002\000\000\064\002\064\002\000\000\064\002\064\002\ -\064\002\064\002\064\002\000\000\064\002\064\002\000\000\064\002\ -\064\002\064\002\064\002\000\000\064\002\064\002\000\000\064\002\ -\000\000\000\000\000\000\064\002\000\000\000\000\000\000\000\000\ -\000\000\245\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\241\000\241\000\241\000\241\000\000\000\000\000\241\000\ -\241\000\241\000\241\000\241\000\241\000\241\000\241\000\241\000\ -\241\000\241\000\241\000\241\000\241\000\241\000\241\000\241\000\ -\000\000\241\000\241\000\241\000\241\000\241\000\241\000\241\000\ -\241\000\000\000\101\005\102\005\103\005\241\000\241\000\000\000\ -\000\000\241\000\241\000\241\000\241\000\241\000\241\000\241\000\ -\241\000\000\000\241\000\241\000\241\000\000\000\241\000\241\000\ -\241\000\241\000\000\000\000\000\241\000\241\000\241\000\000\000\ -\241\000\241\000\241\000\241\000\241\000\241\000\000\000\241\000\ -\241\000\241\000\241\000\241\000\000\000\000\000\000\000\000\000\ -\000\000\241\000\241\000\241\000\241\000\241\000\241\000\241\000\ -\241\000\000\000\241\000\000\000\241\000\241\000\253\000\241\000\ -\241\000\241\000\241\000\241\000\000\000\241\000\241\000\000\000\ -\241\000\241\000\241\000\241\000\000\000\241\000\241\000\000\000\ -\241\000\000\000\000\000\000\000\241\000\247\000\247\000\247\000\ -\247\000\000\000\000\000\247\000\247\000\247\000\247\000\247\000\ -\247\000\247\000\247\000\247\000\247\000\247\000\247\000\247\000\ -\247\000\247\000\247\000\247\000\000\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\247\000\247\000\000\000\000\000\247\000\247\000\247\000\ -\247\000\247\000\247\000\247\000\247\000\000\000\247\000\247\000\ -\247\000\000\000\247\000\247\000\247\000\247\000\000\000\000\000\ -\247\000\247\000\247\000\000\000\247\000\247\000\247\000\247\000\ -\247\000\247\000\000\000\247\000\247\000\247\000\247\000\247\000\ -\000\000\000\000\000\000\000\000\000\000\247\000\247\000\247\000\ -\247\000\247\000\247\000\247\000\247\000\000\000\247\000\000\000\ -\247\000\247\000\249\000\247\000\247\000\247\000\247\000\247\000\ -\000\000\247\000\247\000\000\000\247\000\247\000\247\000\247\000\ -\000\000\247\000\247\000\000\000\247\000\000\000\000\000\000\000\ -\247\000\245\000\245\000\245\000\245\000\000\000\000\000\245\000\ -\245\000\245\000\245\000\245\000\245\000\245\000\245\000\245\000\ -\245\000\245\000\245\000\245\000\245\000\245\000\245\000\245\000\ -\000\000\245\000\245\000\245\000\245\000\245\000\245\000\245\000\ -\245\000\000\000\000\000\000\000\000\000\245\000\245\000\000\000\ -\000\000\245\000\245\000\245\000\245\000\245\000\245\000\245\000\ -\245\000\000\000\245\000\245\000\245\000\000\000\245\000\245\000\ -\245\000\245\000\000\000\000\000\245\000\245\000\245\000\000\000\ -\245\000\245\000\245\000\245\000\245\000\245\000\000\000\245\000\ -\245\000\245\000\245\000\245\000\000\000\000\000\000\000\000\000\ -\000\000\245\000\245\000\245\000\245\000\245\000\245\000\245\000\ -\245\000\000\000\245\000\000\000\245\000\245\000\251\000\245\000\ -\245\000\245\000\245\000\245\000\000\000\245\000\245\000\000\000\ -\245\000\245\000\245\000\245\000\000\000\245\000\245\000\000\000\ -\245\000\000\000\000\000\000\000\245\000\000\000\253\000\253\000\ -\253\000\253\000\000\000\000\000\253\000\253\000\253\000\253\000\ -\253\000\253\000\253\000\253\000\253\000\253\000\253\000\253\000\ -\253\000\253\000\253\000\253\000\253\000\000\000\253\000\253\000\ -\253\000\253\000\253\000\253\000\253\000\253\000\000\000\000\000\ -\000\000\000\000\253\000\253\000\000\000\000\000\253\000\253\000\ -\253\000\253\000\253\000\253\000\253\000\253\000\000\000\253\000\ -\253\000\253\000\000\000\253\000\253\000\253\000\253\000\000\000\ -\000\000\253\000\253\000\253\000\000\000\253\000\253\000\253\000\ -\253\000\253\000\253\000\000\000\253\000\253\000\253\000\253\000\ -\253\000\000\000\000\000\000\000\000\000\000\000\253\000\253\000\ -\253\000\253\000\253\000\253\000\253\000\253\000\000\000\253\000\ -\000\000\253\000\253\000\003\001\253\000\253\000\253\000\253\000\ -\253\000\000\000\253\000\253\000\000\000\253\000\253\000\253\000\ -\253\000\000\000\253\000\253\000\000\000\253\000\000\000\000\000\ -\000\000\253\000\249\000\249\000\249\000\249\000\000\000\000\000\ -\249\000\249\000\249\000\249\000\249\000\249\000\249\000\249\000\ -\249\000\249\000\249\000\249\000\249\000\249\000\249\000\249\000\ -\249\000\000\000\249\000\249\000\249\000\249\000\249\000\249\000\ -\249\000\249\000\000\000\000\000\000\000\000\000\249\000\249\000\ -\000\000\000\000\249\000\249\000\249\000\249\000\249\000\249\000\ -\249\000\249\000\000\000\249\000\249\000\249\000\000\000\249\000\ -\249\000\249\000\249\000\000\000\000\000\249\000\249\000\249\000\ -\000\000\249\000\249\000\249\000\249\000\249\000\249\000\000\000\ -\249\000\249\000\249\000\249\000\249\000\000\000\000\000\000\000\ -\000\000\000\000\249\000\249\000\249\000\249\000\249\000\249\000\ -\249\000\249\000\000\000\249\000\000\000\249\000\249\000\255\000\ -\249\000\249\000\249\000\249\000\249\000\000\000\249\000\249\000\ -\000\000\249\000\249\000\249\000\249\000\000\000\249\000\249\000\ -\000\000\249\000\000\000\000\000\000\000\249\000\251\000\251\000\ -\251\000\251\000\000\000\000\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\000\000\251\000\251\000\ -\251\000\251\000\251\000\251\000\251\000\251\000\000\000\000\000\ -\000\000\000\000\251\000\251\000\000\000\000\000\251\000\251\000\ -\251\000\251\000\251\000\251\000\251\000\251\000\000\000\251\000\ -\251\000\251\000\000\000\251\000\251\000\251\000\251\000\000\000\ -\000\000\251\000\251\000\251\000\000\000\251\000\251\000\251\000\ -\251\000\251\000\251\000\000\000\251\000\251\000\251\000\251\000\ -\251\000\000\000\000\000\000\000\000\000\000\000\251\000\251\000\ -\251\000\251\000\251\000\251\000\251\000\251\000\000\000\251\000\ -\000\000\251\000\251\000\001\001\251\000\251\000\251\000\251\000\ -\251\000\000\000\251\000\251\000\000\000\251\000\251\000\251\000\ -\251\000\000\000\251\000\251\000\000\000\251\000\000\000\000\000\ -\000\000\251\000\000\000\003\001\003\001\003\001\003\001\000\000\ -\000\000\003\001\003\001\003\001\003\001\003\001\003\001\003\001\ -\003\001\003\001\003\001\003\001\003\001\003\001\003\001\003\001\ -\003\001\003\001\000\000\003\001\003\001\003\001\003\001\003\001\ -\003\001\003\001\003\001\000\000\000\000\000\000\000\000\003\001\ -\003\001\000\000\000\000\003\001\003\001\003\001\003\001\003\001\ -\003\001\003\001\003\001\000\000\003\001\003\001\003\001\000\000\ -\003\001\003\001\003\001\003\001\000\000\000\000\003\001\003\001\ -\003\001\000\000\003\001\003\001\003\001\003\001\003\001\003\001\ -\000\000\003\001\003\001\003\001\003\001\003\001\000\000\000\000\ -\000\000\000\000\000\000\003\001\003\001\003\001\003\001\003\001\ -\003\001\003\001\003\001\000\000\003\001\000\000\003\001\003\001\ -\030\001\003\001\003\001\003\001\003\001\003\001\000\000\003\001\ -\003\001\000\000\003\001\003\001\003\001\003\001\000\000\003\001\ -\003\001\000\000\003\001\000\000\000\000\000\000\003\001\255\000\ -\255\000\255\000\255\000\000\000\000\000\255\000\255\000\255\000\ -\255\000\255\000\255\000\255\000\255\000\255\000\255\000\255\000\ -\255\000\255\000\255\000\255\000\255\000\255\000\000\000\255\000\ -\255\000\255\000\255\000\255\000\255\000\255\000\255\000\000\000\ -\000\000\000\000\000\000\255\000\255\000\000\000\000\000\255\000\ -\255\000\255\000\255\000\255\000\255\000\255\000\255\000\000\000\ -\255\000\255\000\255\000\000\000\255\000\255\000\255\000\255\000\ -\000\000\000\000\255\000\255\000\255\000\000\000\255\000\255\000\ -\255\000\255\000\255\000\255\000\000\000\255\000\255\000\255\000\ -\255\000\255\000\000\000\000\000\000\000\000\000\000\000\255\000\ -\255\000\255\000\255\000\255\000\255\000\255\000\255\000\000\000\ -\255\000\000\000\255\000\255\000\039\001\255\000\255\000\255\000\ -\255\000\255\000\000\000\255\000\255\000\000\000\255\000\255\000\ -\255\000\255\000\000\000\255\000\255\000\000\000\255\000\000\000\ -\000\000\000\000\255\000\001\001\001\001\001\001\001\001\000\000\ -\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\001\000\000\001\001\001\001\001\001\001\001\001\001\ -\001\001\001\001\001\001\000\000\000\000\000\000\000\000\001\001\ -\001\001\000\000\000\000\001\001\001\001\001\001\001\001\001\001\ -\001\001\001\001\001\001\000\000\001\001\001\001\001\001\000\000\ -\001\001\001\001\001\001\001\001\000\000\000\000\001\001\001\001\ -\001\001\000\000\001\001\001\001\001\001\001\001\001\001\001\001\ -\000\000\001\001\001\001\001\001\001\001\001\001\000\000\000\000\ -\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\ -\001\001\001\001\001\001\000\000\001\001\000\000\001\001\001\001\ -\041\001\001\001\001\001\001\001\001\001\001\001\000\000\001\001\ -\001\001\000\000\001\001\001\001\001\001\001\001\000\000\001\001\ -\001\001\000\000\001\001\000\000\000\000\000\000\001\001\000\000\ -\030\001\030\001\030\001\030\001\000\000\000\000\030\001\030\001\ -\030\001\030\001\030\001\030\001\030\001\030\001\030\001\030\001\ -\030\001\030\001\030\001\030\001\030\001\030\001\000\000\000\000\ -\030\001\030\001\030\001\030\001\030\001\030\001\030\001\030\001\ -\000\000\000\000\000\000\000\000\030\001\030\001\000\000\000\000\ -\030\001\030\001\030\001\030\001\030\001\030\001\030\001\000\000\ -\000\000\030\001\030\001\030\001\000\000\030\001\030\001\030\001\ -\030\001\000\000\000\000\030\001\030\001\030\001\000\000\030\001\ -\030\001\030\001\030\001\030\001\030\001\000\000\030\001\030\001\ -\030\001\030\001\030\001\000\000\000\000\000\000\000\000\000\000\ -\030\001\030\001\030\001\030\001\030\001\030\001\030\001\030\001\ -\000\000\030\001\000\000\030\001\030\001\044\001\030\001\030\001\ -\030\001\030\001\030\001\000\000\030\001\030\001\000\000\030\001\ -\030\001\030\001\030\001\000\000\030\001\030\001\000\000\030\001\ -\000\000\000\000\000\000\030\001\039\001\039\001\039\001\039\001\ -\000\000\000\000\039\001\039\001\039\001\039\001\039\001\039\001\ -\039\001\039\001\039\001\039\001\039\001\039\001\039\001\039\001\ -\039\001\039\001\000\000\000\000\039\001\039\001\039\001\039\001\ -\039\001\039\001\039\001\039\001\000\000\000\000\000\000\000\000\ -\039\001\039\001\000\000\000\000\039\001\039\001\039\001\039\001\ -\039\001\039\001\039\001\000\000\000\000\039\001\039\001\039\001\ -\000\000\039\001\039\001\039\001\039\001\000\000\000\000\039\001\ -\039\001\039\001\000\000\039\001\039\001\039\001\039\001\039\001\ -\039\001\000\000\039\001\039\001\039\001\039\001\039\001\000\000\ -\000\000\000\000\000\000\000\000\039\001\039\001\039\001\039\001\ -\039\001\039\001\039\001\039\001\000\000\039\001\000\000\039\001\ -\039\001\233\000\039\001\039\001\039\001\000\000\000\000\000\000\ -\039\001\039\001\000\000\039\001\039\001\039\001\039\001\000\000\ -\039\001\039\001\000\000\039\001\000\000\000\000\000\000\039\001\ -\041\001\041\001\041\001\041\001\000\000\000\000\041\001\041\001\ -\041\001\041\001\041\001\041\001\041\001\041\001\041\001\041\001\ -\041\001\041\001\041\001\041\001\041\001\041\001\000\000\000\000\ -\041\001\041\001\041\001\041\001\041\001\041\001\041\001\041\001\ -\000\000\000\000\000\000\000\000\041\001\041\001\000\000\000\000\ -\041\001\041\001\041\001\041\001\041\001\041\001\041\001\000\000\ -\000\000\041\001\041\001\041\001\000\000\041\001\041\001\041\001\ -\041\001\000\000\000\000\041\001\041\001\041\001\000\000\041\001\ -\041\001\041\001\041\001\041\001\041\001\000\000\041\001\041\001\ -\041\001\041\001\041\001\000\000\000\000\000\000\000\000\000\000\ -\041\001\041\001\041\001\041\001\041\001\041\001\041\001\041\001\ -\000\000\041\001\000\000\041\001\041\001\234\000\041\001\041\001\ -\041\001\000\000\000\000\000\000\041\001\041\001\000\000\041\001\ -\041\001\041\001\041\001\000\000\041\001\041\001\000\000\041\001\ -\000\000\000\000\000\000\041\001\000\000\044\001\044\001\044\001\ -\044\001\000\000\000\000\044\001\044\001\044\001\044\001\044\001\ -\044\001\044\001\044\001\044\001\044\001\044\001\044\001\044\001\ -\044\001\044\001\044\001\000\000\000\000\044\001\044\001\044\001\ -\044\001\044\001\044\001\044\001\044\001\000\000\000\000\000\000\ -\000\000\044\001\044\001\000\000\000\000\044\001\044\001\044\001\ -\044\001\044\001\044\001\044\001\000\000\000\000\044\001\044\001\ -\044\001\000\000\044\001\044\001\044\001\044\001\000\000\000\000\ -\044\001\044\001\044\001\000\000\044\001\044\001\044\001\044\001\ -\044\001\044\001\000\000\044\001\044\001\044\001\044\001\044\001\ -\000\000\000\000\000\000\000\000\000\000\044\001\044\001\044\001\ -\044\001\044\001\044\001\044\001\044\001\000\000\044\001\000\000\ -\044\001\044\001\173\000\044\001\044\001\044\001\000\000\000\000\ -\000\000\044\001\044\001\000\000\044\001\044\001\044\001\044\001\ -\000\000\044\001\044\001\000\000\044\001\000\000\000\000\000\000\ -\044\001\233\000\233\000\233\000\233\000\000\000\000\000\000\000\ -\000\000\233\000\233\000\233\000\000\000\000\000\233\000\233\000\ -\233\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\ -\000\000\233\000\233\000\233\000\233\000\233\000\233\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\233\000\233\000\000\000\ -\000\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\ -\233\000\000\000\233\000\000\000\233\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\233\000\233\000\000\000\ -\233\000\000\000\000\000\233\000\233\000\233\000\000\000\233\000\ -\233\000\233\000\233\000\233\000\000\000\000\000\000\000\000\000\ -\000\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\ -\000\000\000\000\233\000\000\000\233\000\233\000\174\000\233\000\ -\233\000\233\000\233\000\233\000\000\000\233\000\000\000\000\000\ -\233\000\233\000\233\000\000\000\000\000\233\000\000\000\000\000\ -\233\000\000\000\000\000\000\000\233\000\234\000\234\000\234\000\ -\234\000\000\000\000\000\000\000\000\000\234\000\234\000\234\000\ -\000\000\000\000\234\000\234\000\234\000\234\000\234\000\234\000\ -\234\000\234\000\234\000\234\000\000\000\234\000\234\000\234\000\ -\234\000\234\000\234\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\234\000\234\000\000\000\000\000\234\000\234\000\234\000\ -\234\000\234\000\234\000\234\000\234\000\000\000\234\000\000\000\ -\234\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\234\000\234\000\000\000\234\000\000\000\000\000\234\000\ -\234\000\234\000\000\000\234\000\234\000\234\000\234\000\234\000\ -\000\000\000\000\000\000\000\000\000\000\234\000\234\000\234\000\ -\234\000\234\000\234\000\234\000\000\000\000\000\234\000\000\000\ -\234\000\234\000\186\000\234\000\234\000\234\000\234\000\234\000\ -\000\000\234\000\000\000\000\000\234\000\234\000\234\000\000\000\ -\000\000\234\000\000\000\000\000\234\000\000\000\000\000\000\000\ -\234\000\000\000\173\000\173\000\173\000\173\000\000\000\000\000\ -\000\000\000\000\173\000\173\000\173\000\000\000\000\000\173\000\ -\173\000\173\000\173\000\173\000\173\000\173\000\173\000\173\000\ -\000\000\000\000\173\000\173\000\173\000\173\000\173\000\173\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\173\000\173\000\ -\000\000\000\000\173\000\173\000\173\000\173\000\173\000\173\000\ -\173\000\000\000\000\000\173\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\173\000\173\000\ -\000\000\173\000\000\000\000\000\173\000\173\000\173\000\000\000\ -\173\000\173\000\173\000\173\000\173\000\000\000\000\000\000\000\ -\000\000\000\000\173\000\000\000\173\000\173\000\173\000\173\000\ -\173\000\000\000\000\000\000\000\000\000\173\000\173\000\187\000\ -\173\000\173\000\173\000\000\000\000\000\000\000\173\000\000\000\ -\000\000\173\000\000\000\173\000\000\000\000\000\173\000\000\000\ -\000\000\173\000\000\000\000\000\000\000\173\000\174\000\174\000\ -\174\000\174\000\000\000\000\000\000\000\000\000\174\000\174\000\ -\174\000\000\000\000\000\174\000\174\000\174\000\174\000\174\000\ -\174\000\174\000\174\000\174\000\000\000\000\000\174\000\174\000\ -\174\000\174\000\174\000\174\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\174\000\174\000\000\000\000\000\174\000\174\000\ -\174\000\174\000\174\000\174\000\174\000\000\000\000\000\174\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\174\000\174\000\000\000\174\000\000\000\000\000\ -\174\000\174\000\174\000\000\000\174\000\174\000\174\000\174\000\ -\174\000\000\000\000\000\000\000\000\000\000\000\174\000\000\000\ -\174\000\174\000\174\000\174\000\174\000\000\000\000\000\000\000\ -\000\000\174\000\174\000\225\000\174\000\174\000\174\000\000\000\ -\000\000\000\000\174\000\000\000\000\000\174\000\000\000\174\000\ -\000\000\000\000\174\000\000\000\000\000\174\000\000\000\000\000\ -\000\000\174\000\186\000\186\000\186\000\186\000\000\000\000\000\ -\000\000\000\000\186\000\186\000\186\000\000\000\000\000\186\000\ -\186\000\186\000\186\000\186\000\186\000\186\000\186\000\186\000\ -\000\000\000\000\186\000\186\000\186\000\186\000\186\000\186\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\186\000\186\000\ -\000\000\000\000\186\000\186\000\186\000\186\000\186\000\186\000\ -\186\000\000\000\000\000\186\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\186\000\186\000\ -\000\000\186\000\000\000\000\000\186\000\186\000\186\000\000\000\ -\186\000\186\000\186\000\186\000\186\000\000\000\000\000\000\000\ -\000\000\000\000\186\000\000\000\186\000\186\000\186\000\186\000\ -\186\000\000\000\000\000\000\000\000\000\186\000\186\000\226\000\ -\186\000\186\000\186\000\000\000\000\000\000\000\186\000\000\000\ -\000\000\186\000\000\000\186\000\000\000\000\000\186\000\000\000\ -\000\000\186\000\000\000\000\000\000\000\186\000\000\000\187\000\ -\187\000\187\000\187\000\000\000\000\000\000\000\000\000\187\000\ -\187\000\187\000\000\000\000\000\187\000\187\000\187\000\187\000\ -\187\000\187\000\187\000\187\000\187\000\000\000\000\000\187\000\ -\187\000\187\000\187\000\187\000\187\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\187\000\187\000\000\000\000\000\187\000\ -\187\000\187\000\187\000\187\000\187\000\187\000\000\000\000\000\ -\187\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\187\000\187\000\000\000\187\000\000\000\ -\000\000\187\000\187\000\187\000\000\000\187\000\187\000\187\000\ -\187\000\187\000\000\000\000\000\000\000\000\000\000\000\187\000\ -\000\000\187\000\187\000\187\000\187\000\187\000\000\000\000\000\ -\000\000\000\000\187\000\187\000\185\000\187\000\187\000\187\000\ -\000\000\000\000\000\000\187\000\000\000\000\000\187\000\000\000\ -\187\000\000\000\000\000\187\000\000\000\000\000\187\000\000\000\ -\000\000\000\000\187\000\225\000\225\000\225\000\225\000\000\000\ -\000\000\000\000\000\000\225\000\225\000\225\000\000\000\000\000\ -\225\000\225\000\225\000\225\000\225\000\225\000\225\000\225\000\ -\225\000\000\000\000\000\225\000\225\000\225\000\225\000\225\000\ -\225\000\000\000\000\000\000\000\000\000\000\000\000\000\225\000\ -\225\000\000\000\000\000\225\000\225\000\225\000\225\000\225\000\ -\225\000\225\000\000\000\000\000\225\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\225\000\ -\225\000\000\000\225\000\000\000\000\000\225\000\225\000\225\000\ -\000\000\225\000\225\000\225\000\225\000\225\000\000\000\000\000\ -\000\000\000\000\000\000\225\000\000\000\225\000\225\000\225\000\ -\225\000\225\000\000\000\000\000\000\000\000\000\225\000\225\000\ -\196\000\225\000\225\000\225\000\000\000\000\000\000\000\225\000\ -\000\000\000\000\225\000\000\000\225\000\000\000\000\000\225\000\ -\000\000\000\000\225\000\000\000\000\000\000\000\225\000\226\000\ -\226\000\226\000\226\000\000\000\000\000\000\000\000\000\226\000\ -\226\000\226\000\000\000\000\000\226\000\226\000\226\000\226\000\ -\226\000\226\000\226\000\226\000\226\000\000\000\000\000\226\000\ -\226\000\226\000\226\000\226\000\226\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\226\000\226\000\000\000\000\000\226\000\ -\226\000\226\000\226\000\226\000\226\000\226\000\000\000\000\000\ -\226\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\226\000\226\000\000\000\226\000\000\000\ -\000\000\226\000\226\000\226\000\000\000\226\000\226\000\226\000\ -\226\000\226\000\000\000\000\000\000\000\000\000\000\000\226\000\ -\000\000\226\000\226\000\226\000\226\000\226\000\000\000\000\000\ -\000\000\000\000\226\000\226\000\197\000\226\000\226\000\226\000\ -\000\000\000\000\000\000\226\000\000\000\000\000\226\000\000\000\ -\226\000\000\000\000\000\226\000\000\000\000\000\226\000\000\000\ -\000\000\000\000\226\000\000\000\185\000\185\000\185\000\185\000\ -\000\000\000\000\000\000\000\000\185\000\185\000\185\000\000\000\ -\000\000\185\000\185\000\185\000\185\000\185\000\000\000\185\000\ -\185\000\185\000\000\000\000\000\185\000\185\000\185\000\185\000\ -\185\000\185\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\185\000\185\000\000\000\000\000\185\000\185\000\185\000\185\000\ -\185\000\185\000\185\000\000\000\000\000\185\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\185\000\185\000\000\000\185\000\000\000\000\000\185\000\185\000\ -\185\000\000\000\185\000\185\000\185\000\185\000\185\000\000\000\ -\000\000\000\000\000\000\000\000\185\000\000\000\185\000\185\000\ -\185\000\185\000\185\000\000\000\000\000\000\000\000\000\185\000\ -\185\000\204\000\185\000\185\000\185\000\000\000\000\000\000\000\ -\185\000\000\000\000\000\185\000\000\000\185\000\000\000\000\000\ -\185\000\000\000\000\000\185\000\000\000\000\000\000\000\185\000\ -\196\000\196\000\196\000\196\000\000\000\000\000\000\000\000\000\ -\196\000\196\000\196\000\000\000\000\000\196\000\196\000\196\000\ -\196\000\196\000\196\000\196\000\196\000\196\000\000\000\000\000\ -\196\000\196\000\196\000\196\000\196\000\196\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\196\000\196\000\000\000\000\000\ -\196\000\196\000\196\000\196\000\196\000\196\000\000\000\000\000\ -\000\000\196\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\196\000\196\000\000\000\196\000\ -\000\000\000\000\196\000\196\000\196\000\000\000\196\000\196\000\ -\196\000\196\000\196\000\000\000\000\000\000\000\000\000\000\000\ -\196\000\000\000\196\000\196\000\196\000\196\000\196\000\000\000\ -\000\000\000\000\000\000\196\000\196\000\203\000\196\000\196\000\ -\196\000\000\000\000\000\000\000\196\000\000\000\000\000\196\000\ -\000\000\196\000\000\000\000\000\196\000\000\000\000\000\196\000\ -\000\000\000\000\000\000\196\000\197\000\197\000\197\000\197\000\ -\000\000\000\000\000\000\000\000\197\000\197\000\197\000\000\000\ -\000\000\197\000\197\000\197\000\197\000\197\000\197\000\197\000\ -\197\000\197\000\000\000\000\000\197\000\197\000\197\000\197\000\ -\197\000\197\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\197\000\197\000\000\000\000\000\197\000\197\000\197\000\197\000\ -\197\000\197\000\000\000\000\000\000\000\197\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\197\000\197\000\000\000\197\000\000\000\000\000\197\000\197\000\ -\197\000\000\000\197\000\197\000\197\000\197\000\197\000\000\000\ -\000\000\000\000\000\000\000\000\197\000\000\000\197\000\197\000\ -\197\000\197\000\197\000\000\000\000\000\000\000\000\000\197\000\ -\197\000\179\000\197\000\197\000\197\000\000\000\000\000\000\000\ -\197\000\000\000\000\000\197\000\000\000\197\000\000\000\000\000\ -\197\000\000\000\000\000\197\000\000\000\000\000\000\000\197\000\ -\000\000\204\000\204\000\204\000\204\000\000\000\000\000\000\000\ -\000\000\204\000\204\000\204\000\000\000\000\000\204\000\204\000\ -\204\000\204\000\204\000\204\000\204\000\204\000\204\000\000\000\ -\000\000\204\000\204\000\204\000\204\000\204\000\204\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\204\000\204\000\000\000\ -\000\000\204\000\204\000\204\000\204\000\204\000\204\000\000\000\ -\000\000\000\000\204\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\204\000\204\000\000\000\ -\204\000\000\000\000\000\204\000\204\000\204\000\000\000\204\000\ -\204\000\204\000\204\000\204\000\000\000\000\000\000\000\000\000\ -\000\000\204\000\000\000\204\000\204\000\204\000\204\000\204\000\ -\000\000\000\000\000\000\000\000\204\000\204\000\182\000\204\000\ -\204\000\204\000\000\000\000\000\000\000\204\000\000\000\000\000\ -\204\000\000\000\204\000\000\000\000\000\204\000\000\000\000\000\ -\204\000\000\000\000\000\000\000\204\000\203\000\203\000\203\000\ -\203\000\000\000\000\000\000\000\000\000\203\000\203\000\203\000\ -\000\000\000\000\203\000\203\000\203\000\203\000\203\000\203\000\ -\203\000\203\000\203\000\000\000\000\000\203\000\203\000\203\000\ -\203\000\203\000\203\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\203\000\203\000\000\000\000\000\203\000\203\000\203\000\ -\203\000\203\000\203\000\000\000\000\000\000\000\203\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\203\000\203\000\000\000\203\000\000\000\000\000\203\000\ -\203\000\203\000\000\000\203\000\203\000\203\000\203\000\203\000\ -\000\000\000\000\000\000\000\000\000\000\203\000\000\000\203\000\ -\203\000\203\000\203\000\203\000\000\000\000\000\000\000\000\000\ -\203\000\203\000\183\000\203\000\203\000\203\000\000\000\000\000\ -\000\000\203\000\000\000\000\000\203\000\000\000\203\000\000\000\ -\000\000\203\000\000\000\000\000\203\000\000\000\000\000\000\000\ -\203\000\179\000\179\000\179\000\179\000\000\000\000\000\000\000\ -\000\000\000\000\179\000\179\000\000\000\000\000\179\000\179\000\ -\179\000\179\000\179\000\179\000\179\000\179\000\179\000\000\000\ -\000\000\179\000\179\000\179\000\179\000\179\000\179\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\179\000\179\000\000\000\ -\000\000\179\000\179\000\179\000\179\000\179\000\179\000\179\000\ -\000\000\000\000\179\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\179\000\179\000\000\000\ -\179\000\000\000\000\000\179\000\179\000\179\000\000\000\179\000\ -\179\000\179\000\179\000\179\000\000\000\000\000\000\000\000\000\ -\000\000\179\000\000\000\179\000\179\000\179\000\179\000\179\000\ -\000\000\000\000\000\000\000\000\179\000\179\000\195\000\179\000\ -\179\000\179\000\000\000\000\000\000\000\179\000\000\000\000\000\ -\179\000\000\000\179\000\000\000\000\000\179\000\000\000\000\000\ -\179\000\000\000\000\000\000\000\179\000\000\000\182\000\182\000\ -\182\000\182\000\000\000\000\000\000\000\000\000\000\000\182\000\ -\182\000\000\000\000\000\182\000\182\000\182\000\182\000\182\000\ -\182\000\182\000\182\000\182\000\000\000\000\000\182\000\182\000\ -\182\000\182\000\182\000\182\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\182\000\182\000\000\000\000\000\182\000\182\000\ -\182\000\182\000\182\000\182\000\182\000\000\000\000\000\182\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\182\000\182\000\000\000\182\000\000\000\000\000\ -\182\000\182\000\182\000\000\000\182\000\182\000\182\000\182\000\ -\182\000\000\000\000\000\000\000\000\000\000\000\182\000\000\000\ -\182\000\182\000\182\000\182\000\182\000\000\000\000\000\000\000\ -\000\000\182\000\182\000\201\000\182\000\182\000\182\000\000\000\ -\000\000\000\000\182\000\000\000\000\000\182\000\000\000\182\000\ -\000\000\000\000\182\000\000\000\000\000\182\000\000\000\000\000\ -\000\000\182\000\183\000\183\000\183\000\183\000\000\000\000\000\ -\000\000\000\000\000\000\183\000\183\000\000\000\000\000\183\000\ -\183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\ -\000\000\000\000\183\000\183\000\183\000\183\000\183\000\183\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\183\000\183\000\ -\000\000\000\000\183\000\183\000\183\000\183\000\183\000\183\000\ -\183\000\000\000\000\000\183\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\183\000\183\000\ -\000\000\183\000\000\000\000\000\183\000\183\000\183\000\000\000\ -\183\000\183\000\183\000\183\000\183\000\000\000\000\000\000\000\ -\000\000\000\000\183\000\000\000\183\000\183\000\183\000\183\000\ -\183\000\000\000\000\000\000\000\000\000\183\000\183\000\202\000\ -\183\000\183\000\183\000\000\000\000\000\000\000\183\000\000\000\ -\000\000\183\000\000\000\183\000\000\000\000\000\183\000\000\000\ -\000\000\183\000\000\000\000\000\000\000\183\000\195\000\195\000\ -\195\000\195\000\000\000\000\000\000\000\000\000\195\000\195\000\ -\195\000\000\000\000\000\195\000\195\000\195\000\195\000\195\000\ -\195\000\195\000\195\000\195\000\000\000\000\000\195\000\195\000\ -\195\000\195\000\195\000\195\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\195\000\195\000\000\000\000\000\195\000\195\000\ -\195\000\195\000\195\000\000\000\000\000\000\000\000\000\195\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\195\000\195\000\000\000\195\000\000\000\000\000\ -\195\000\195\000\195\000\000\000\195\000\195\000\195\000\195\000\ -\195\000\000\000\000\000\000\000\000\000\000\000\195\000\000\000\ -\195\000\000\000\195\000\195\000\195\000\000\000\000\000\000\000\ -\000\000\195\000\195\000\198\000\195\000\195\000\195\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\195\000\000\000\195\000\ -\000\000\000\000\195\000\000\000\000\000\195\000\000\000\000\000\ -\000\000\195\000\000\000\201\000\201\000\201\000\201\000\000\000\ -\000\000\000\000\000\000\201\000\201\000\201\000\000\000\000\000\ -\201\000\201\000\201\000\201\000\201\000\201\000\201\000\201\000\ -\201\000\000\000\000\000\201\000\201\000\201\000\201\000\201\000\ -\201\000\000\000\000\000\000\000\000\000\000\000\000\000\201\000\ -\201\000\000\000\000\000\201\000\201\000\201\000\201\000\201\000\ -\000\000\000\000\000\000\000\000\201\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\201\000\ -\201\000\000\000\201\000\000\000\000\000\201\000\201\000\201\000\ -\000\000\201\000\201\000\201\000\201\000\201\000\000\000\000\000\ -\000\000\000\000\000\000\201\000\000\000\201\000\000\000\201\000\ -\201\000\201\000\000\000\000\000\000\000\000\000\201\000\201\000\ -\199\000\201\000\201\000\201\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\201\000\000\000\201\000\000\000\000\000\201\000\ -\000\000\000\000\201\000\000\000\000\000\000\000\201\000\202\000\ -\202\000\202\000\202\000\000\000\000\000\000\000\000\000\202\000\ -\202\000\202\000\000\000\000\000\202\000\202\000\202\000\202\000\ -\202\000\202\000\202\000\202\000\202\000\000\000\000\000\202\000\ -\202\000\202\000\202\000\202\000\202\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\202\000\202\000\000\000\000\000\202\000\ -\202\000\202\000\202\000\202\000\000\000\000\000\000\000\000\000\ -\202\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\202\000\202\000\000\000\202\000\000\000\ -\000\000\202\000\202\000\202\000\000\000\202\000\202\000\202\000\ -\202\000\202\000\000\000\000\000\000\000\000\000\000\000\202\000\ -\000\000\202\000\000\000\202\000\202\000\202\000\000\000\000\000\ -\000\000\000\000\202\000\202\000\200\000\202\000\202\000\202\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\202\000\000\000\ -\202\000\000\000\000\000\202\000\000\000\000\000\202\000\000\000\ -\000\000\000\000\202\000\198\000\198\000\198\000\198\000\000\000\ -\000\000\000\000\000\000\198\000\198\000\198\000\000\000\000\000\ -\198\000\198\000\198\000\198\000\198\000\198\000\198\000\198\000\ -\198\000\000\000\000\000\198\000\198\000\198\000\198\000\198\000\ -\198\000\000\000\000\000\000\000\000\000\000\000\000\000\198\000\ -\198\000\000\000\000\000\198\000\198\000\198\000\198\000\198\000\ -\000\000\000\000\000\000\000\000\198\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\198\000\ -\198\000\000\000\198\000\000\000\000\000\198\000\198\000\198\000\ -\000\000\198\000\198\000\198\000\198\000\198\000\000\000\000\000\ -\000\000\000\000\000\000\198\000\000\000\198\000\000\000\198\000\ -\198\000\198\000\000\000\000\000\000\000\000\000\198\000\198\000\ -\153\000\198\000\198\000\198\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\198\000\000\000\198\000\000\000\000\000\198\000\ -\000\000\000\000\198\000\000\000\000\000\000\000\198\000\000\000\ -\199\000\199\000\199\000\199\000\000\000\000\000\000\000\000\000\ -\199\000\199\000\199\000\000\000\000\000\199\000\199\000\199\000\ -\199\000\199\000\199\000\199\000\199\000\199\000\000\000\000\000\ -\199\000\199\000\199\000\199\000\199\000\199\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\199\000\199\000\000\000\000\000\ -\199\000\199\000\199\000\199\000\199\000\000\000\000\000\000\000\ -\000\000\199\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\199\000\199\000\000\000\199\000\ -\000\000\000\000\199\000\199\000\199\000\000\000\199\000\199\000\ -\199\000\199\000\199\000\000\000\000\000\000\000\000\000\000\000\ -\199\000\000\000\199\000\000\000\199\000\199\000\199\000\000\000\ -\000\000\000\000\000\000\199\000\199\000\192\000\199\000\199\000\ -\199\000\000\000\000\000\000\000\000\000\000\000\000\000\199\000\ -\000\000\199\000\000\000\000\000\199\000\000\000\000\000\199\000\ -\000\000\000\000\000\000\199\000\200\000\200\000\200\000\200\000\ -\000\000\000\000\000\000\000\000\200\000\200\000\200\000\000\000\ -\000\000\200\000\200\000\200\000\200\000\200\000\200\000\200\000\ -\200\000\200\000\000\000\000\000\200\000\200\000\200\000\200\000\ -\200\000\200\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\200\000\200\000\000\000\000\000\200\000\200\000\200\000\200\000\ -\200\000\000\000\000\000\000\000\000\000\200\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\200\000\200\000\000\000\200\000\000\000\000\000\200\000\200\000\ -\200\000\000\000\200\000\200\000\200\000\200\000\200\000\000\000\ -\000\000\000\000\000\000\000\000\200\000\000\000\200\000\000\000\ -\200\000\200\000\200\000\000\000\000\000\000\000\000\000\200\000\ -\200\000\205\000\200\000\200\000\200\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\200\000\000\000\200\000\000\000\000\000\ -\200\000\000\000\000\000\200\000\000\000\000\000\000\000\200\000\ -\153\000\153\000\153\000\153\000\000\000\000\000\000\000\000\000\ -\153\000\153\000\153\000\000\000\000\000\153\000\153\000\153\000\ -\153\000\153\000\153\000\153\000\153\000\153\000\000\000\000\000\ -\153\000\153\000\153\000\153\000\153\000\153\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\153\000\153\000\000\000\000\000\ -\153\000\153\000\153\000\153\000\153\000\153\000\153\000\000\000\ -\000\000\153\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\153\000\153\000\000\000\000\000\ -\000\000\000\000\153\000\153\000\153\000\000\000\153\000\000\000\ -\000\000\153\000\153\000\000\000\000\000\000\000\000\000\000\000\ -\153\000\000\000\153\000\000\000\000\000\000\000\153\000\000\000\ -\000\000\000\000\000\000\153\000\153\000\207\000\153\000\153\000\ -\153\000\000\000\000\000\000\000\153\000\000\000\000\000\153\000\ -\000\000\153\000\000\000\000\000\153\000\000\000\000\000\153\000\ -\000\000\000\000\000\000\153\000\000\000\192\000\192\000\192\000\ -\192\000\000\000\000\000\000\000\000\000\192\000\192\000\192\000\ -\000\000\000\000\192\000\192\000\000\000\192\000\192\000\192\000\ -\192\000\192\000\192\000\000\000\000\000\192\000\192\000\192\000\ -\192\000\192\000\192\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\192\000\192\000\000\000\000\000\192\000\192\000\192\000\ -\192\000\000\000\000\000\000\000\000\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\192\000\192\000\000\000\192\000\000\000\000\000\192\000\ -\192\000\192\000\000\000\192\000\000\000\000\000\192\000\192\000\ -\000\000\000\000\000\000\000\000\000\000\192\000\000\000\192\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\192\000\192\000\193\000\192\000\192\000\192\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\192\000\000\000\192\000\000\000\ -\000\000\192\000\000\000\000\000\192\000\000\000\000\000\000\000\ -\192\000\205\000\205\000\205\000\205\000\000\000\000\000\000\000\ -\000\000\205\000\205\000\205\000\000\000\000\000\205\000\205\000\ -\000\000\205\000\205\000\205\000\205\000\205\000\205\000\000\000\ -\000\000\205\000\205\000\205\000\205\000\205\000\205\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\205\000\205\000\000\000\ -\000\000\205\000\205\000\205\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\205\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\205\000\205\000\000\000\ -\205\000\000\000\000\000\000\000\205\000\205\000\000\000\205\000\ -\000\000\000\000\205\000\205\000\000\000\000\000\000\000\000\000\ -\000\000\205\000\000\000\205\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\205\000\205\000\194\000\205\000\ -\205\000\205\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\205\000\000\000\205\000\000\000\000\000\205\000\000\000\000\000\ -\205\000\000\000\000\000\000\000\205\000\207\000\207\000\207\000\ -\207\000\000\000\000\000\000\000\000\000\207\000\207\000\207\000\ -\000\000\000\000\207\000\207\000\000\000\207\000\207\000\207\000\ -\207\000\207\000\207\000\000\000\000\000\207\000\207\000\207\000\ -\207\000\207\000\207\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\207\000\207\000\000\000\000\000\207\000\207\000\207\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\207\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\207\000\207\000\000\000\207\000\000\000\000\000\000\000\ -\207\000\207\000\000\000\207\000\000\000\000\000\207\000\207\000\ -\000\000\000\000\000\000\000\000\000\000\207\000\000\000\207\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\207\000\207\000\206\000\207\000\207\000\207\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\207\000\000\000\207\000\000\000\ -\000\000\207\000\000\000\000\000\207\000\000\000\000\000\000\000\ -\207\000\000\000\193\000\193\000\193\000\193\000\000\000\000\000\ -\000\000\000\000\193\000\193\000\193\000\000\000\000\000\193\000\ -\193\000\000\000\193\000\193\000\193\000\193\000\193\000\193\000\ -\000\000\000\000\193\000\193\000\193\000\193\000\193\000\193\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\193\000\193\000\ -\000\000\000\000\193\000\193\000\193\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\193\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\193\000\193\000\ -\000\000\193\000\000\000\000\000\000\000\193\000\193\000\000\000\ -\193\000\000\000\000\000\193\000\193\000\000\000\000\000\000\000\ -\000\000\000\000\193\000\000\000\193\000\000\000\000\000\211\000\ -\000\000\000\000\000\000\000\000\000\000\193\000\193\000\000\000\ -\193\000\193\000\193\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\193\000\000\000\193\000\000\000\000\000\193\000\000\000\ -\000\000\193\000\000\000\000\000\000\000\193\000\194\000\194\000\ -\194\000\194\000\000\000\000\000\000\000\000\000\194\000\194\000\ -\194\000\000\000\000\000\194\000\194\000\000\000\194\000\194\000\ -\194\000\194\000\194\000\194\000\000\000\000\000\194\000\194\000\ -\194\000\194\000\194\000\194\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\194\000\194\000\000\000\000\000\194\000\194\000\ -\194\000\000\000\000\000\000\000\000\000\000\000\000\000\194\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\194\000\194\000\000\000\194\000\000\000\000\000\ -\000\000\194\000\194\000\000\000\194\000\000\000\000\000\194\000\ -\194\000\000\000\000\000\000\000\210\000\000\000\194\000\000\000\ -\194\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\194\000\194\000\000\000\194\000\194\000\194\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\194\000\000\000\194\000\ -\000\000\000\000\194\000\000\000\000\000\194\000\000\000\000\000\ -\000\000\194\000\206\000\206\000\206\000\206\000\000\000\000\000\ -\000\000\000\000\206\000\206\000\206\000\000\000\000\000\206\000\ -\206\000\000\000\206\000\206\000\206\000\206\000\206\000\206\000\ -\000\000\000\000\206\000\206\000\206\000\206\000\206\000\206\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\206\000\206\000\ -\000\000\000\000\206\000\206\000\206\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\206\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\206\000\206\000\ -\000\000\206\000\000\000\000\000\209\000\206\000\206\000\000\000\ -\206\000\000\000\000\000\206\000\206\000\000\000\000\000\000\000\ -\000\000\000\000\206\000\000\000\206\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\206\000\206\000\000\000\ -\206\000\206\000\206\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\206\000\000\000\206\000\000\000\000\000\206\000\211\000\ -\000\000\206\000\211\000\000\000\000\000\206\000\000\000\211\000\ -\211\000\211\000\000\000\000\000\211\000\211\000\000\000\211\000\ -\211\000\211\000\211\000\211\000\211\000\000\000\000\000\211\000\ -\211\000\211\000\000\000\211\000\211\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\211\000\000\000\000\000\211\000\ -\211\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\211\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\211\000\073\001\000\000\211\000\000\000\ -\000\000\000\000\211\000\211\000\000\000\211\000\000\000\000\000\ -\211\000\211\000\000\000\000\000\000\000\000\000\000\000\211\000\ -\000\000\211\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\211\000\211\000\000\000\211\000\211\000\211\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\211\000\000\000\ -\211\000\000\000\000\000\211\000\210\000\000\000\211\000\210\000\ -\000\000\000\000\211\000\000\000\210\000\210\000\210\000\000\000\ -\000\000\210\000\210\000\000\000\210\000\210\000\210\000\210\000\ -\210\000\210\000\000\000\000\000\210\000\210\000\210\000\000\000\ -\210\000\210\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\210\000\000\000\000\000\210\000\210\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\210\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\208\000\000\000\000\000\000\000\ -\210\000\000\000\000\000\210\000\000\000\000\000\000\000\210\000\ -\210\000\000\000\210\000\000\000\000\000\210\000\210\000\000\000\ -\000\000\000\000\000\000\000\000\210\000\000\000\210\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\210\000\ -\210\000\000\000\210\000\210\000\210\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\210\000\209\000\210\000\000\000\209\000\ -\210\000\000\000\000\000\210\000\209\000\000\000\209\000\210\000\ -\000\000\209\000\209\000\000\000\209\000\209\000\209\000\209\000\ -\209\000\209\000\000\000\000\000\209\000\209\000\209\000\000\000\ -\209\000\209\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\209\000\000\000\000\000\209\000\209\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\072\001\000\000\000\000\000\000\ -\209\000\000\000\000\000\209\000\000\000\000\000\000\000\209\000\ -\209\000\000\000\209\000\000\000\000\000\209\000\209\000\000\000\ -\000\000\000\000\000\000\000\000\209\000\000\000\000\000\000\000\ -\000\000\000\000\214\002\000\000\000\000\000\000\000\000\209\000\ -\209\000\000\000\209\000\209\000\209\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\209\000\073\001\209\000\000\000\073\001\ -\209\000\000\000\000\000\209\000\073\001\000\000\073\001\209\000\ -\000\000\073\001\073\001\000\000\073\001\073\001\073\001\073\001\ -\073\001\073\001\000\000\000\000\073\001\073\001\073\001\000\000\ -\073\001\073\001\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\073\001\000\000\000\000\073\001\073\001\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\073\001\000\000\212\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\073\001\000\000\000\000\073\001\000\000\000\000\000\000\073\001\ -\073\001\000\000\073\001\000\000\000\000\073\001\073\001\000\000\ -\000\000\000\000\000\000\000\000\073\001\214\002\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\073\001\ -\073\001\000\000\073\001\073\001\073\001\000\000\000\000\000\000\ -\000\000\000\000\000\000\073\001\208\000\073\001\000\000\208\000\ -\073\001\000\000\000\000\073\001\208\000\000\000\208\000\073\001\ -\000\000\208\000\208\000\000\000\208\000\208\000\208\000\208\000\ -\208\000\208\000\000\000\000\000\208\000\208\000\208\000\000\000\ -\208\000\208\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\208\000\000\000\000\000\208\000\208\000\000\000\000\000\ -\000\000\000\000\224\000\000\000\000\000\208\000\000\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\208\000\000\000\000\000\000\000\208\000\ -\208\000\000\000\208\000\000\000\000\000\208\000\208\000\000\000\ -\000\000\000\000\000\000\000\000\208\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\208\000\ -\208\000\000\000\208\000\208\000\208\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\208\000\072\001\208\000\000\000\072\001\ -\208\000\000\000\000\000\208\000\072\001\000\000\072\001\208\000\ -\000\000\072\001\072\001\000\000\072\001\072\001\072\001\072\001\ -\072\001\072\001\000\000\000\000\072\001\072\001\072\001\000\000\ -\072\001\072\001\214\002\000\000\000\000\000\000\000\000\000\000\ -\000\000\072\001\214\002\000\000\072\001\072\001\000\000\214\002\ -\000\000\000\000\215\000\000\000\000\000\072\001\000\000\000\000\ -\000\000\000\000\000\000\000\000\214\002\000\000\214\002\214\002\ -\072\001\000\000\000\000\072\001\000\000\000\000\000\000\072\001\ -\072\001\000\000\072\001\214\002\000\000\072\001\072\001\000\000\ -\099\000\000\000\000\000\000\000\072\001\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\214\002\072\001\ -\072\001\214\002\072\001\072\001\072\001\214\002\214\002\212\000\ -\000\000\000\000\212\000\072\001\214\002\072\001\000\000\212\000\ -\072\001\212\000\214\002\072\001\212\000\212\000\000\000\072\001\ -\212\000\000\000\212\000\212\000\212\000\000\000\214\002\212\000\ -\212\000\212\000\214\002\212\000\212\000\214\002\000\000\000\000\ -\000\000\000\000\000\000\000\000\212\000\000\000\214\002\212\000\ -\212\000\214\002\214\002\000\000\000\000\188\000\000\000\000\000\ -\212\000\000\000\000\000\000\000\000\000\000\000\000\000\214\002\ -\000\000\214\002\214\002\212\000\000\000\000\000\212\000\000\000\ -\000\000\000\000\212\000\212\000\000\000\212\000\214\002\000\000\ -\212\000\212\000\000\000\212\002\000\000\000\000\000\000\212\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\214\002\212\000\212\000\214\002\212\000\212\000\212\000\ -\214\002\214\002\224\000\000\000\000\000\224\000\212\000\214\002\ -\212\000\000\000\224\000\212\000\224\000\214\002\212\000\224\000\ -\224\000\000\000\212\000\224\000\000\000\224\000\224\000\224\000\ -\000\000\214\002\224\000\224\000\224\000\214\002\224\000\224\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\224\000\ -\000\000\214\002\224\000\224\000\214\002\000\000\000\000\000\000\ -\217\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\224\000\000\000\ -\000\000\224\000\000\000\000\000\000\000\224\000\224\000\000\000\ -\224\000\000\000\000\000\224\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\224\000\224\000\000\000\ -\224\000\224\000\224\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\224\000\215\000\224\000\000\000\215\000\224\000\000\000\ -\000\000\224\000\215\000\000\000\215\000\224\000\000\000\215\000\ -\215\000\000\000\000\000\215\000\000\000\215\000\215\000\215\000\ -\000\000\000\000\215\000\215\000\215\000\000\000\215\000\215\000\ -\099\000\000\000\000\000\000\000\000\000\000\000\000\000\215\000\ -\000\000\000\000\215\000\215\000\000\000\099\000\000\000\000\000\ -\216\000\000\000\000\000\215\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\099\000\000\000\099\000\099\000\215\000\000\000\ -\000\000\215\000\000\000\000\000\000\000\215\000\215\000\000\000\ -\215\000\099\000\000\000\215\000\215\000\000\000\100\000\000\000\ -\000\000\000\000\215\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\099\000\215\000\215\000\099\000\ -\215\000\215\000\215\000\099\000\099\000\188\000\000\000\000\000\ -\188\000\215\000\099\000\215\000\000\000\188\000\215\000\188\000\ -\099\000\215\000\188\000\188\000\000\000\215\000\188\000\000\000\ -\188\000\188\000\188\000\000\000\099\000\188\000\188\000\188\000\ -\099\000\188\000\188\000\212\002\000\000\000\000\212\002\000\000\ -\000\000\000\000\188\000\000\000\099\000\188\000\188\000\099\000\ -\212\002\000\000\000\000\220\000\000\000\000\000\188\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\212\002\000\000\212\002\ -\212\002\188\000\000\000\000\000\188\000\000\000\000\000\000\000\ -\188\000\188\000\000\000\188\000\212\002\000\000\188\000\188\000\ -\000\000\165\001\000\000\000\000\000\000\188\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\212\002\ -\188\000\188\000\212\002\188\000\188\000\188\000\000\000\212\002\ -\217\000\000\000\000\000\217\000\188\000\212\002\188\000\000\000\ -\217\000\188\000\217\000\212\002\188\000\217\000\217\000\000\000\ -\188\000\217\000\000\000\217\000\217\000\217\000\000\000\212\002\ -\217\000\217\000\217\000\212\002\217\000\217\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\217\000\000\000\212\002\ -\217\000\217\000\212\002\000\000\000\000\000\000\218\000\000\000\ -\000\000\217\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\217\000\000\000\000\000\217\000\ -\000\000\000\000\000\000\217\000\217\000\000\000\217\000\000\000\ -\000\000\217\000\217\000\000\000\000\000\000\000\000\000\000\000\ -\217\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\217\000\217\000\000\000\217\000\217\000\ -\217\000\000\000\000\000\000\000\000\000\000\000\000\000\217\000\ -\216\000\217\000\000\000\216\000\217\000\000\000\000\000\217\000\ -\216\000\000\000\216\000\217\000\000\000\216\000\216\000\000\000\ -\000\000\216\000\000\000\216\000\216\000\216\000\000\000\000\000\ -\216\000\216\000\216\000\000\000\216\000\216\000\100\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\216\000\000\000\000\000\ -\216\000\216\000\000\000\100\000\000\000\000\000\219\000\000\000\ -\000\000\216\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\100\000\000\000\100\000\100\000\216\000\000\000\000\000\216\000\ -\000\000\000\000\000\000\216\000\216\000\000\000\216\000\100\000\ -\000\000\216\000\216\000\000\000\212\002\000\000\000\000\000\000\ -\216\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\100\000\216\000\216\000\100\000\216\000\216\000\ -\216\000\100\000\100\000\220\000\000\000\000\000\220\000\216\000\ -\100\000\216\000\000\000\220\000\216\000\220\000\100\000\216\000\ -\220\000\220\000\000\000\216\000\220\000\000\000\220\000\220\000\ -\220\000\000\000\100\000\220\000\220\000\220\000\100\000\220\000\ -\220\000\165\001\000\000\000\000\000\000\000\000\000\000\000\000\ -\220\000\000\000\100\000\220\000\220\000\100\000\165\001\000\000\ -\000\000\223\000\000\000\000\000\220\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\165\001\000\000\165\001\165\001\220\000\ -\000\000\000\000\220\000\000\000\000\000\000\000\220\000\220\000\ -\000\000\220\000\165\001\000\000\220\000\220\000\000\000\037\000\ -\000\000\000\000\000\000\220\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\165\001\220\000\220\000\ -\165\001\220\000\220\000\220\000\165\001\165\001\218\000\000\000\ -\000\000\218\000\220\000\165\001\220\000\000\000\218\000\220\000\ -\218\000\165\001\220\000\218\000\218\000\000\000\220\000\218\000\ -\000\000\218\000\218\000\218\000\000\000\165\001\218\000\218\000\ -\218\000\165\001\218\000\218\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\218\000\000\000\165\001\218\000\218\000\ -\165\001\000\000\000\000\000\000\221\000\000\000\000\000\218\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\218\000\000\000\000\000\218\000\000\000\000\000\ -\000\000\218\000\218\000\000\000\218\000\000\000\000\000\218\000\ -\218\000\000\000\000\000\000\000\000\000\000\000\218\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\218\000\218\000\000\000\218\000\218\000\218\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\218\000\219\000\218\000\ -\000\000\219\000\218\000\000\000\000\000\218\000\219\000\000\000\ -\219\000\218\000\000\000\219\000\219\000\000\000\000\000\219\000\ -\000\000\219\000\219\000\219\000\000\000\000\000\219\000\219\000\ -\219\000\000\000\219\000\219\000\212\002\000\000\000\000\000\000\ -\000\000\000\000\000\000\219\000\000\000\000\000\219\000\219\000\ -\000\000\212\002\000\000\000\000\222\000\000\000\000\000\219\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\212\002\000\000\ -\212\002\212\002\219\000\000\000\000\000\219\000\000\000\000\000\ -\000\000\219\000\219\000\000\000\219\000\212\002\000\000\219\000\ -\219\000\000\000\040\000\000\000\000\000\000\000\219\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\212\002\219\000\219\000\212\002\219\000\219\000\219\000\000\000\ -\212\002\223\000\000\000\000\000\223\000\219\000\212\002\219\000\ -\000\000\223\000\219\000\223\000\212\002\219\000\223\000\223\000\ -\000\000\219\000\223\000\000\000\223\000\223\000\223\000\000\000\ -\212\002\223\000\223\000\223\000\212\002\223\000\223\000\037\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\223\000\000\000\ -\212\002\223\000\223\000\212\002\037\000\000\000\000\000\152\000\ -\000\000\000\000\223\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\037\000\000\000\037\000\037\000\223\000\000\000\000\000\ -\223\000\000\000\000\000\000\000\223\000\223\000\000\000\223\000\ -\037\000\000\000\223\000\223\000\000\000\000\000\000\000\000\000\ -\000\000\223\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\037\000\223\000\223\000\037\000\223\000\ -\223\000\223\000\000\000\037\000\221\000\000\000\000\000\221\000\ -\223\000\037\000\223\000\000\000\221\000\223\000\221\000\037\000\ -\223\000\221\000\221\000\000\000\223\000\221\000\000\000\221\000\ -\221\000\221\000\000\000\037\000\221\000\221\000\221\000\037\000\ -\221\000\221\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\221\000\000\000\037\000\221\000\221\000\037\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\221\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\003\002\000\000\000\000\ -\221\000\000\000\000\000\221\000\000\000\000\000\000\000\221\000\ -\221\000\000\000\221\000\000\000\000\000\221\000\221\000\000\000\ -\000\000\000\000\000\000\000\000\221\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\221\000\ -\221\000\000\000\221\000\221\000\221\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\221\000\222\000\221\000\000\000\222\000\ -\221\000\000\000\000\000\221\000\222\000\000\000\222\000\221\000\ -\000\000\222\000\222\000\000\000\000\000\222\000\000\000\222\000\ -\222\000\222\000\000\000\000\000\222\000\222\000\222\000\000\000\ -\222\000\222\000\040\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\222\000\000\000\000\000\222\000\222\000\000\000\040\000\ -\000\000\000\000\000\000\000\000\000\000\222\000\000\000\000\000\ -\189\000\000\000\000\000\000\000\040\000\000\000\040\000\040\000\ -\222\000\000\000\000\000\222\000\000\000\000\000\000\000\222\000\ -\222\000\000\000\222\000\040\000\000\000\222\000\222\000\000\000\ -\000\000\000\000\000\000\000\000\222\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\040\000\222\000\ -\222\000\040\000\222\000\222\000\222\000\000\000\040\000\152\000\ -\000\000\000\000\152\000\222\000\040\000\222\000\000\000\152\000\ -\222\000\152\000\040\000\222\000\152\000\152\000\000\000\222\000\ -\152\000\000\000\152\000\152\000\152\000\000\000\040\000\152\000\ -\152\000\152\000\040\000\152\000\152\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\152\000\000\000\040\000\152\000\ -\152\000\040\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\152\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\152\000\000\000\ -\000\000\000\000\152\000\152\000\037\002\152\000\000\000\000\000\ -\152\000\152\000\000\000\000\000\000\000\000\000\000\000\152\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\152\000\152\000\000\000\152\000\000\000\152\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\152\000\000\000\ -\152\000\000\000\000\000\152\000\000\000\003\002\152\000\003\002\ -\003\002\003\002\152\000\000\000\000\000\003\002\000\000\000\000\ -\000\000\000\000\003\002\000\000\000\000\000\000\003\002\003\002\ -\003\002\000\000\000\000\000\000\000\000\000\000\000\000\003\002\ -\003\002\003\002\003\002\000\000\000\000\000\000\000\000\000\000\ -\000\000\003\002\000\000\000\000\000\000\003\002\003\002\000\000\ -\000\000\000\000\000\000\000\000\000\000\003\002\003\002\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\002\ -\000\000\003\002\000\000\000\000\003\002\000\000\000\000\003\002\ -\003\002\003\002\000\000\003\002\000\000\000\000\003\002\003\002\ -\000\000\000\000\000\000\000\000\000\000\003\002\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\003\002\003\002\000\000\003\002\003\002\003\002\000\000\000\000\ -\189\000\003\002\000\000\189\000\000\000\000\000\000\000\000\000\ -\189\000\003\002\189\000\000\000\003\002\189\000\189\000\000\000\ -\003\002\189\000\000\000\189\000\189\000\189\000\000\000\000\000\ -\189\000\000\000\189\000\000\000\189\000\189\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\189\000\000\000\000\000\ -\189\000\189\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\189\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\255\001\000\000\189\000\000\000\000\000\189\000\ -\000\000\000\000\000\000\189\000\189\000\000\000\189\000\000\000\ -\000\000\189\000\189\000\000\000\000\000\000\000\000\000\000\000\ -\189\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\189\000\189\000\000\000\189\000\189\000\ -\189\000\000\000\000\000\000\000\000\000\000\000\000\000\189\000\ -\000\000\189\000\000\000\000\000\189\000\000\000\000\000\189\000\ -\000\000\000\000\000\000\189\000\037\002\000\000\037\002\037\002\ -\037\002\000\000\000\000\000\000\037\002\000\000\000\000\000\000\ -\000\000\037\002\000\000\000\000\000\000\037\002\037\002\037\002\ -\000\000\000\000\000\000\000\000\000\000\000\000\037\002\037\002\ -\037\002\037\002\000\000\000\000\206\004\000\000\000\000\000\000\ -\037\002\000\000\000\000\000\000\000\000\037\002\000\000\000\002\ -\000\000\000\000\000\000\032\005\037\002\037\002\000\000\000\000\ -\000\000\000\000\198\001\000\000\000\000\000\000\000\000\000\000\ -\037\002\000\000\000\000\037\002\000\000\000\000\037\002\037\002\ -\037\002\000\000\037\002\000\000\000\000\037\002\037\002\000\000\ -\000\000\000\000\000\000\208\004\037\002\113\000\114\000\028\000\ -\000\000\115\000\000\000\000\000\116\000\209\004\000\000\037\002\ -\037\002\000\000\037\002\037\002\037\002\000\000\000\000\001\002\ -\000\000\001\002\001\002\001\002\000\000\118\000\000\000\001\002\ -\037\002\000\000\000\000\037\002\001\002\119\000\120\000\037\002\ -\001\002\001\002\001\002\000\000\000\000\121\000\000\000\000\000\ -\000\000\001\002\001\002\001\002\001\002\000\000\201\001\000\000\ -\000\000\211\004\123\000\001\002\000\000\000\000\000\000\000\000\ -\001\002\000\000\254\001\000\000\000\000\000\000\000\000\001\002\ -\001\002\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\001\002\000\000\ -\000\000\001\002\001\002\001\002\000\000\001\002\000\000\000\000\ -\000\000\001\002\000\000\000\000\000\000\000\000\000\000\001\002\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\001\002\001\002\000\000\001\002\001\002\001\002\ -\000\000\000\000\255\001\000\000\255\001\255\001\255\001\000\000\ -\000\000\000\000\255\001\001\002\000\000\000\000\001\002\255\001\ -\000\000\000\000\001\002\255\001\255\001\255\001\000\000\000\000\ -\000\000\000\000\000\000\000\000\255\001\255\001\255\001\255\001\ -\000\000\000\000\000\000\000\000\146\000\000\000\255\001\000\000\ -\000\000\000\000\000\000\255\001\000\000\000\000\090\000\000\000\ -\000\000\000\000\255\001\255\001\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\255\001\000\000\ -\000\000\255\001\000\000\000\000\255\001\255\001\255\001\000\000\ -\255\001\000\000\000\000\000\000\255\001\000\000\000\000\000\000\ -\000\000\000\000\255\001\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\255\001\255\001\065\000\ -\255\001\255\001\255\001\000\000\000\000\000\000\000\000\000\002\ -\000\000\000\002\000\002\000\002\000\000\000\000\255\001\000\002\ -\000\000\255\001\000\000\000\000\000\002\255\001\000\000\000\000\ -\000\002\000\002\000\002\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\002\000\002\000\002\000\002\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\ -\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\002\ -\000\002\066\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\002\000\002\000\002\000\000\000\002\000\000\000\000\ -\000\000\000\002\000\000\000\000\000\000\000\000\112\000\000\002\ -\113\000\114\000\028\000\000\000\115\000\000\000\000\000\116\000\ -\117\000\000\000\000\002\000\002\000\000\000\002\000\002\000\002\ -\000\000\000\000\254\001\000\000\254\001\254\001\254\001\000\000\ -\118\000\000\000\254\001\000\002\000\000\000\000\000\002\254\001\ -\119\000\120\000\000\002\254\001\254\001\254\001\000\000\000\000\ -\121\000\000\000\000\000\000\000\254\001\254\001\254\001\254\001\ -\000\000\000\000\000\000\000\000\122\000\123\000\254\001\000\000\ -\000\000\000\000\000\000\254\001\000\000\000\000\000\000\000\000\ -\000\000\000\000\254\001\254\001\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\254\001\000\000\ -\000\000\254\001\214\002\000\000\254\001\254\001\254\001\000\000\ -\254\001\000\000\000\000\000\000\254\001\000\000\000\000\000\000\ -\000\000\000\000\254\001\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\146\000\254\001\254\001\146\000\ -\254\001\254\001\254\001\000\000\000\000\000\000\090\000\000\000\ -\000\000\146\000\000\000\000\000\000\000\146\000\254\001\146\000\ -\000\000\254\001\000\000\090\000\000\000\254\001\146\000\146\000\ -\146\000\146\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\090\000\000\000\090\000\090\000\000\000\146\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\090\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\065\000\ -\146\000\000\000\000\000\146\000\000\000\000\000\000\000\146\000\ -\146\000\000\000\090\000\000\000\065\000\146\000\146\000\000\000\ -\065\000\090\000\090\000\000\000\146\000\000\000\000\000\000\000\ -\090\000\065\000\065\000\065\000\065\000\106\002\090\000\000\000\ -\146\000\000\000\146\000\000\000\146\000\000\000\000\000\000\000\ -\065\000\000\000\090\000\000\000\000\000\000\000\090\000\000\000\ -\146\000\000\000\000\000\146\000\000\000\000\000\000\000\146\000\ -\000\000\066\000\090\000\065\000\066\000\090\000\065\000\000\000\ -\000\000\065\000\065\000\065\000\000\000\000\000\066\000\000\000\ -\065\000\065\000\066\000\000\000\000\000\000\000\000\000\065\000\ -\000\000\000\000\000\000\066\000\066\000\066\000\066\000\000\000\ -\000\000\000\000\000\000\065\000\000\000\065\000\000\000\065\000\ -\000\000\000\000\066\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\065\000\000\000\000\000\065\000\000\000\ -\000\000\000\000\065\000\000\000\000\000\066\000\000\000\000\000\ -\066\000\000\000\000\000\000\000\066\000\066\000\000\000\000\000\ -\000\000\000\000\066\000\066\000\112\000\000\000\113\000\114\000\ -\028\000\066\000\115\000\000\000\120\001\116\000\117\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\066\000\000\000\066\000\ -\000\000\066\000\000\000\000\000\000\000\000\000\118\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\066\000\119\000\060\003\ -\066\000\000\000\214\002\000\000\066\000\214\002\121\000\214\002\ -\214\002\214\002\214\002\000\000\000\000\214\002\214\002\214\002\ -\000\000\000\000\122\000\123\000\000\000\214\002\000\000\000\000\ -\000\000\214\002\000\000\000\000\214\002\000\000\214\002\214\002\ -\214\002\214\002\214\002\214\002\214\002\214\002\214\002\000\000\ -\000\000\214\002\214\002\214\002\000\000\000\000\098\002\000\000\ -\000\000\000\000\214\002\214\002\214\002\214\002\214\002\214\002\ -\214\002\214\002\214\002\214\002\214\002\214\002\214\002\214\002\ -\000\000\214\002\214\002\214\002\000\000\214\002\214\002\214\002\ -\214\002\214\002\214\002\000\000\214\002\214\002\000\000\214\002\ -\214\002\000\000\214\002\214\002\000\000\000\000\214\002\214\002\ -\000\000\214\002\214\002\214\002\214\002\214\002\214\002\214\002\ -\000\000\214\002\214\002\214\002\000\000\214\002\000\000\214\002\ -\214\002\000\000\214\002\000\000\214\002\214\002\214\002\214\002\ -\214\002\214\002\214\002\212\001\214\002\106\002\000\000\000\000\ -\000\000\106\002\000\000\106\002\000\000\106\002\000\000\106\002\ -\000\000\106\002\000\000\106\002\106\002\000\000\106\002\106\002\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\106\002\106\002\000\000\106\002\106\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\106\002\ -\106\002\106\002\106\002\000\000\106\002\106\002\000\000\000\000\ -\106\002\213\001\000\000\000\000\000\000\106\002\106\002\106\002\ -\000\000\000\000\000\000\000\000\106\002\000\000\106\002\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\106\002\000\000\ -\000\000\106\002\000\000\000\000\000\000\000\000\106\002\000\000\ -\106\002\106\002\000\000\106\002\106\002\000\000\106\002\000\000\ -\000\000\000\000\106\002\000\000\000\000\106\002\000\000\106\002\ -\000\000\000\000\106\002\106\002\120\001\000\000\106\002\000\000\ -\120\001\000\000\120\001\212\002\120\001\000\000\120\001\000\000\ -\120\001\000\000\120\001\120\001\000\000\120\001\120\001\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\120\001\ -\000\000\000\000\120\001\120\001\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\120\001\120\001\ -\000\000\120\001\000\000\120\001\120\001\000\000\000\000\120\001\ -\000\000\000\000\000\000\000\000\120\001\120\001\120\001\000\000\ -\000\000\000\000\000\000\120\001\000\000\120\001\098\002\000\000\ -\000\000\098\002\000\000\000\000\000\000\120\001\098\002\000\000\ -\120\001\000\000\000\000\098\002\098\002\120\001\000\000\120\001\ -\120\001\098\002\120\001\120\001\119\002\120\001\000\000\000\000\ -\098\002\120\001\098\002\098\002\120\001\000\000\120\001\000\000\ -\000\000\120\001\120\001\000\000\000\000\120\001\000\000\098\002\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\031\002\ -\209\001\031\002\031\002\031\002\000\000\031\002\000\000\000\000\ -\031\002\031\002\098\002\000\000\000\000\098\002\000\000\119\002\ -\098\002\098\002\098\002\212\001\000\000\000\000\212\001\000\000\ -\098\002\031\002\000\000\212\001\000\000\098\002\098\002\000\000\ -\212\001\031\002\031\002\000\000\000\000\000\000\212\001\000\000\ -\000\000\031\002\098\002\000\000\000\000\212\001\098\002\212\001\ -\212\001\000\000\000\000\000\000\000\000\031\002\031\002\000\000\ -\063\000\000\000\098\002\212\001\212\001\098\002\214\002\000\000\ -\214\002\214\002\214\002\000\000\214\002\000\000\000\000\214\002\ -\214\002\000\000\000\000\000\000\000\000\000\000\000\000\212\001\ -\000\000\213\001\212\001\000\000\213\001\212\001\212\001\212\001\ -\214\002\213\001\000\000\000\000\040\002\212\001\213\001\000\000\ -\214\002\214\002\000\000\212\001\213\001\000\000\000\000\000\000\ -\214\002\000\000\000\000\213\001\000\000\213\001\213\001\212\001\ -\131\000\000\000\000\000\212\001\214\002\214\002\000\000\040\002\ -\000\000\213\001\213\001\000\000\000\000\000\000\000\000\212\001\ -\000\000\000\000\212\001\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\212\002\000\000\213\001\212\002\000\000\ -\213\001\000\000\000\000\213\001\213\001\213\001\000\000\000\000\ -\212\002\000\000\213\001\213\001\000\000\000\000\212\002\000\000\ -\000\000\213\001\000\000\000\000\000\000\212\002\000\000\212\002\ -\212\002\064\000\174\001\000\000\064\000\213\001\000\000\000\000\ -\000\000\213\001\000\000\212\002\212\002\000\000\064\000\000\000\ -\000\000\000\000\064\000\212\002\212\002\213\001\000\000\000\000\ -\213\001\000\000\000\000\064\000\064\000\064\000\064\000\212\002\ -\000\000\000\000\212\002\000\000\000\000\000\000\000\000\212\002\ -\000\000\212\002\064\000\000\000\000\000\212\002\000\000\000\000\ -\000\000\000\000\241\001\212\002\241\001\241\001\241\001\000\000\ -\241\001\000\000\214\002\241\001\241\001\064\000\000\000\212\002\ -\064\000\000\000\000\000\212\002\064\000\064\000\000\000\000\000\ -\000\000\000\000\008\000\064\000\241\001\000\000\000\000\212\002\ -\011\000\064\000\212\002\000\000\241\001\241\001\000\000\000\000\ -\209\001\000\000\000\000\209\001\241\001\064\000\000\000\064\000\ -\209\001\064\000\015\000\016\000\000\000\209\001\000\000\000\000\ -\241\001\241\001\000\000\209\001\000\000\064\000\000\000\174\001\ -\064\000\000\000\209\001\000\000\209\001\209\001\022\000\000\000\ -\138\000\139\000\000\000\140\000\141\000\000\000\000\000\028\000\ -\000\000\209\001\000\000\000\000\142\000\143\000\000\000\000\000\ -\000\000\000\000\000\000\144\000\000\000\000\000\000\000\000\000\ -\063\000\000\000\000\000\063\000\209\001\000\000\000\000\209\001\ -\145\000\000\000\209\001\209\001\209\001\063\000\000\000\000\000\ -\000\000\063\000\209\001\000\000\175\001\146\000\000\000\000\000\ -\209\001\044\000\063\000\063\000\063\000\063\000\045\000\000\000\ -\000\000\048\000\147\000\000\000\209\001\000\000\000\000\000\000\ -\209\001\063\000\000\000\209\001\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\209\001\000\000\000\000\209\001\ -\131\000\000\000\000\000\131\000\063\000\000\000\000\000\063\000\ -\000\000\000\000\000\000\063\000\063\000\131\000\000\000\000\000\ -\000\000\177\001\063\000\131\000\000\000\000\000\000\000\000\000\ -\063\000\000\000\131\000\000\000\131\000\131\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\063\000\000\000\063\000\000\000\ -\063\000\131\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\131\000\000\000\000\000\000\000\063\000\000\000\000\000\063\000\ -\000\000\000\000\174\001\000\000\131\000\174\001\000\000\131\000\ -\000\000\000\000\000\000\131\000\131\000\000\000\131\000\174\001\ -\000\000\176\001\131\000\000\000\000\000\174\001\000\000\000\000\ -\131\000\000\000\000\000\000\000\174\001\000\000\174\001\174\001\ -\000\000\000\000\000\000\000\000\131\000\000\000\000\000\000\000\ -\131\000\000\000\000\000\174\001\000\000\000\000\000\000\178\001\ -\000\000\000\000\000\000\000\000\131\000\000\000\000\000\131\000\ -\000\000\000\000\214\002\000\000\000\000\214\002\174\001\000\000\ -\000\000\174\001\214\002\000\000\000\000\174\001\174\001\214\002\ -\000\000\000\000\000\000\000\000\174\001\214\002\000\000\000\000\ -\000\000\000\000\174\001\000\000\214\002\000\000\214\002\214\002\ -\115\002\000\000\000\000\000\000\000\000\000\000\174\001\000\000\ -\000\000\000\000\174\001\214\002\000\000\000\000\000\000\182\001\ -\000\000\000\000\000\000\000\000\000\000\000\000\174\001\174\001\ -\000\000\174\001\174\001\000\000\000\000\000\000\214\002\000\000\ -\209\001\214\002\000\000\000\000\174\001\214\002\214\002\000\000\ -\000\000\000\000\174\001\000\000\214\002\000\000\000\000\000\000\ -\000\000\174\001\214\002\174\001\174\001\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\214\002\000\000\ -\174\001\000\000\214\002\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\175\001\000\000\214\002\175\001\ -\000\000\214\002\000\000\174\001\000\000\000\000\174\001\000\000\ -\044\000\175\001\174\001\174\001\000\000\000\000\000\000\175\001\ -\000\000\174\001\000\000\209\001\000\000\000\000\175\001\174\001\ -\175\001\175\001\000\000\209\001\000\000\047\000\000\000\000\000\ -\209\001\000\000\000\000\174\001\000\000\175\001\085\000\174\001\ -\000\000\000\000\000\000\000\000\000\000\209\001\000\000\209\001\ -\209\001\177\001\000\000\174\001\177\001\000\000\174\001\000\000\ -\175\001\000\000\000\000\175\001\209\001\000\000\177\001\175\001\ -\175\001\000\000\000\000\000\000\177\001\000\000\175\001\000\000\ -\000\000\212\002\000\000\177\001\175\001\177\001\177\001\209\001\ -\000\000\000\000\209\001\000\000\000\000\209\001\209\001\209\001\ -\175\001\000\000\177\001\000\000\175\001\209\001\081\000\000\000\ -\000\000\000\000\000\000\209\001\000\000\000\000\000\000\000\000\ -\175\001\176\001\000\000\175\001\176\001\177\001\000\000\209\001\ -\177\001\000\000\000\000\209\001\177\001\177\001\176\001\000\000\ -\000\000\000\000\000\000\177\001\176\001\000\000\000\000\209\001\ -\000\000\177\001\209\001\176\001\000\000\176\001\176\001\178\001\ -\000\000\000\000\178\001\000\000\000\000\177\001\000\000\000\000\ -\000\000\177\001\176\001\000\000\178\001\000\000\000\000\000\000\ -\000\000\000\000\178\001\000\000\000\000\177\001\000\000\000\000\ -\177\001\178\001\000\000\178\001\178\001\176\001\000\000\000\000\ -\176\001\000\000\000\000\000\000\176\001\176\001\000\000\000\000\ -\178\001\000\000\000\000\176\001\000\000\000\000\000\000\000\000\ -\000\000\176\001\000\000\000\000\000\000\000\000\000\000\182\001\ -\000\000\000\000\182\001\178\001\000\000\176\001\178\001\000\000\ -\000\000\176\001\178\001\178\001\182\001\000\000\000\000\000\000\ -\209\001\178\001\182\001\000\000\000\000\176\001\000\000\178\001\ -\176\001\182\001\000\000\182\001\182\001\209\001\000\000\000\000\ -\000\000\000\000\000\000\178\001\000\000\000\000\000\000\178\001\ -\182\001\000\000\209\001\000\000\209\001\209\001\000\000\000\000\ -\000\000\000\000\000\000\178\001\000\000\000\000\178\001\000\000\ -\000\000\209\001\000\000\182\001\000\000\000\000\182\001\000\000\ -\000\000\000\000\182\001\182\001\000\000\000\000\000\000\000\000\ -\044\000\182\001\000\000\000\000\209\001\000\000\000\000\182\001\ -\000\000\000\000\209\001\209\001\209\001\044\000\000\000\000\000\ -\000\000\000\000\209\001\182\001\000\000\047\000\000\000\182\001\ -\209\001\000\000\044\000\000\000\044\000\044\000\085\000\000\000\ -\000\000\000\000\047\000\182\001\209\001\000\000\182\001\000\000\ -\209\001\044\000\000\000\085\000\000\000\000\000\000\000\047\000\ -\000\000\047\000\047\000\000\000\209\001\000\000\000\000\209\001\ -\085\000\000\000\085\000\085\000\044\000\000\000\047\000\044\000\ -\000\000\212\002\000\000\000\000\044\000\000\000\000\000\085\000\ -\000\000\000\000\044\000\000\000\000\000\000\000\212\002\000\000\ -\044\000\047\000\000\000\000\000\047\000\000\000\081\000\000\000\ -\000\000\047\000\085\000\212\002\044\000\212\002\212\002\047\000\ -\044\000\000\000\085\000\081\000\000\000\047\000\000\000\000\000\ -\085\000\000\000\212\002\000\000\044\000\000\000\085\000\044\000\ -\081\000\047\000\081\000\081\000\000\000\047\000\000\000\000\000\ -\000\000\000\000\085\000\000\000\000\000\212\002\085\000\081\000\ -\000\000\047\000\000\000\000\000\047\000\212\002\000\000\000\000\ -\000\000\000\000\085\000\212\002\000\000\085\000\000\000\000\000\ -\000\000\212\002\081\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\081\000\000\000\000\000\212\002\000\000\000\000\ -\081\000\212\002\000\000\000\000\000\000\000\000\081\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\212\002\000\000\000\000\ -\212\002\000\000\081\000\207\002\000\000\000\000\081\000\000\000\ -\207\002\207\002\207\002\207\002\000\000\000\000\207\002\207\002\ -\207\002\207\002\081\000\000\000\000\000\081\000\207\002\000\000\ -\000\000\000\000\000\000\000\000\000\000\207\002\000\000\207\002\ -\207\002\207\002\207\002\207\002\207\002\207\002\207\002\000\000\ -\000\000\000\000\207\002\000\000\207\002\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\207\002\207\002\207\002\207\002\ -\207\002\207\002\207\002\207\002\000\000\000\000\207\002\207\002\ -\000\000\000\000\207\002\207\002\207\002\207\002\000\000\207\002\ -\207\002\207\002\207\002\207\002\000\000\207\002\000\000\000\000\ -\207\002\207\002\000\000\207\002\207\002\000\000\000\000\207\002\ -\207\002\000\000\207\002\000\000\207\002\207\002\000\000\207\002\ -\207\002\000\000\000\000\207\002\207\002\000\000\207\002\000\000\ -\207\002\207\002\000\000\207\002\000\000\207\002\207\002\207\002\ -\207\002\207\002\207\002\207\002\214\002\207\002\000\000\000\000\ -\000\000\214\002\214\002\214\002\214\002\000\000\000\000\214\002\ -\214\002\000\000\000\000\000\000\000\000\000\000\000\000\214\002\ -\000\000\000\000\000\000\000\000\000\000\000\000\214\002\000\000\ -\214\002\000\000\214\002\214\002\214\002\214\002\214\002\214\002\ -\000\000\000\000\000\000\214\002\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\214\002\214\002\214\002\ -\214\002\214\002\214\002\214\002\214\002\000\000\000\000\214\002\ -\214\002\000\000\000\000\214\002\214\002\214\002\000\000\000\000\ -\214\002\214\002\214\002\214\002\214\002\000\000\214\002\000\000\ -\000\000\214\002\214\002\000\000\000\000\214\002\000\000\000\000\ -\214\002\214\002\000\000\214\002\000\000\214\002\214\002\000\000\ -\000\000\214\002\000\000\000\000\000\000\214\002\000\000\214\002\ -\000\000\214\002\214\002\000\000\214\002\000\000\214\002\214\002\ -\000\000\214\002\214\002\214\002\214\002\000\000\214\002\001\001\ -\002\001\003\001\000\000\000\000\007\000\008\000\004\001\000\000\ -\005\001\000\000\010\000\011\000\000\000\000\000\006\001\007\001\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\008\001\000\000\000\000\015\000\016\000\017\000\ -\018\000\019\000\000\000\009\001\000\000\000\000\020\000\000\000\ -\000\000\010\001\011\001\012\001\013\001\014\001\015\001\000\000\ -\000\000\022\000\000\000\023\000\024\000\025\000\026\000\027\000\ -\000\000\000\000\028\000\000\000\016\001\000\000\030\000\031\000\ -\032\000\000\000\000\000\000\000\034\000\000\000\017\001\018\001\ -\000\000\019\001\000\000\000\000\000\000\038\000\000\000\000\000\ -\000\000\020\001\021\001\022\001\023\001\024\001\025\001\000\000\ -\000\000\000\000\000\000\000\000\000\000\026\001\000\000\000\000\ -\000\000\027\001\000\000\028\001\044\000\000\000\000\000\000\000\ -\000\000\045\000\046\000\000\000\048\000\049\000\001\001\002\001\ -\003\001\051\000\000\000\007\000\008\000\004\001\000\000\005\001\ -\000\000\010\000\011\000\000\000\000\000\018\003\007\001\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\008\001\000\000\000\000\015\000\016\000\017\000\018\000\ -\019\000\000\000\009\001\000\000\000\000\020\000\000\000\000\000\ -\010\001\011\001\012\001\013\001\014\001\015\001\000\000\000\000\ -\022\000\000\000\023\000\024\000\025\000\026\000\027\000\000\000\ -\000\000\028\000\000\000\016\001\000\000\030\000\031\000\032\000\ -\000\000\000\000\000\000\034\000\000\000\017\001\018\001\000\000\ -\019\003\000\000\000\000\000\000\038\000\000\000\000\000\000\000\ -\020\001\021\001\022\001\023\001\024\001\025\001\000\000\000\000\ -\000\000\000\000\000\000\000\000\020\003\000\000\000\000\000\000\ -\027\001\000\000\028\001\044\000\000\000\000\000\000\000\000\000\ -\045\000\046\000\000\000\048\000\049\000\214\002\000\000\000\000\ -\051\000\000\000\214\002\214\002\214\002\000\000\000\000\000\000\ -\214\002\214\002\214\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\214\002\ -\000\000\214\002\214\002\214\002\214\002\214\002\214\002\214\002\ -\000\000\000\000\000\000\000\000\214\002\000\000\214\002\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\214\002\ -\000\000\214\002\214\002\214\002\214\002\214\002\000\000\000\000\ -\214\002\214\002\000\000\000\000\214\002\214\002\214\002\000\000\ -\000\000\214\002\214\002\000\000\214\002\214\002\000\000\214\002\ -\000\000\000\000\000\000\214\002\000\000\214\002\000\000\000\000\ -\000\000\214\002\214\002\085\002\214\002\000\000\000\000\000\000\ -\152\002\152\002\152\002\000\000\000\000\214\002\152\002\152\002\ -\000\000\000\000\214\002\000\000\000\000\000\000\000\000\214\002\ -\214\002\214\002\214\002\214\002\214\002\000\000\000\000\214\002\ -\000\000\152\002\152\002\152\002\152\002\152\002\000\000\000\000\ -\000\000\000\000\152\002\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\152\002\000\000\152\002\ -\152\002\152\002\152\002\152\002\000\000\000\000\152\002\000\000\ -\000\000\000\000\152\002\152\002\152\002\000\000\000\000\000\000\ -\152\002\000\000\152\002\152\002\000\000\000\000\000\000\000\000\ -\000\000\152\002\000\000\000\000\000\000\000\000\000\000\152\002\ -\152\002\086\002\152\002\000\000\000\000\000\000\153\002\153\002\ -\153\002\085\002\000\000\000\000\153\002\153\002\000\000\000\000\ -\152\002\000\000\000\000\000\000\000\000\152\002\152\002\000\000\ -\152\002\152\002\000\000\000\000\000\000\152\002\000\000\153\002\ -\153\002\153\002\153\002\153\002\000\000\000\000\000\000\000\000\ -\153\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\153\002\000\000\153\002\153\002\153\002\ -\153\002\153\002\000\000\000\000\153\002\000\000\000\000\000\000\ -\153\002\153\002\153\002\000\000\000\000\000\000\153\002\000\000\ -\153\002\153\002\000\000\000\000\000\000\000\000\000\000\153\002\ -\000\000\000\000\000\000\000\000\000\000\153\002\153\002\083\002\ -\153\002\000\000\000\000\000\000\154\002\154\002\154\002\086\002\ -\000\000\000\000\154\002\154\002\000\000\000\000\153\002\000\000\ -\000\000\000\000\000\000\153\002\153\002\000\000\153\002\153\002\ -\000\000\000\000\000\000\153\002\000\000\154\002\154\002\154\002\ -\154\002\154\002\000\000\000\000\000\000\000\000\154\002\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\154\002\000\000\154\002\154\002\154\002\154\002\154\002\ -\000\000\000\000\154\002\000\000\000\000\000\000\154\002\154\002\ -\154\002\000\000\000\000\000\000\154\002\000\000\154\002\154\002\ -\000\000\000\000\000\000\000\000\000\000\154\002\000\000\000\000\ -\000\000\000\000\000\000\154\002\154\002\084\002\154\002\000\000\ -\000\000\000\000\155\002\155\002\155\002\083\002\000\000\000\000\ -\155\002\155\002\000\000\000\000\154\002\000\000\000\000\000\000\ -\000\000\154\002\154\002\000\000\154\002\154\002\000\000\000\000\ -\000\000\154\002\000\000\155\002\155\002\155\002\155\002\155\002\ -\000\000\000\000\000\000\000\000\155\002\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\155\002\ -\000\000\155\002\155\002\155\002\155\002\155\002\000\000\000\000\ -\155\002\000\000\000\000\000\000\155\002\155\002\155\002\000\000\ -\000\000\000\000\155\002\000\000\155\002\155\002\000\000\000\000\ -\000\000\000\000\000\000\155\002\000\000\000\000\000\000\000\000\ -\000\000\155\002\155\002\000\000\155\002\000\000\000\000\000\000\ -\000\000\000\000\000\000\084\002\199\000\200\000\201\000\000\000\ -\000\000\000\000\155\002\000\000\202\000\000\000\203\000\155\002\ -\155\002\000\000\155\002\155\002\204\000\205\000\206\000\155\002\ -\000\000\207\000\208\000\209\000\000\000\210\000\211\000\212\000\ -\000\000\213\000\214\000\215\000\216\000\000\000\000\000\000\000\ -\217\000\218\000\219\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\220\000\221\000\000\000\000\000\222\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\223\000\224\000\000\000\000\000\000\000\004\002\225\000\226\000\ -\000\000\004\002\000\000\227\000\228\000\229\000\230\000\231\000\ -\232\000\233\000\000\000\234\000\000\000\000\000\004\002\000\000\ -\004\002\235\000\000\000\243\001\000\000\000\000\236\000\004\002\ -\004\002\000\000\000\000\000\000\237\000\000\000\000\000\238\000\ -\239\000\004\002\240\000\241\000\242\000\243\000\244\000\000\000\ -\245\000\246\000\247\000\248\000\249\000\004\002\004\002\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\004\002\000\000\000\000\000\000\004\002\000\000\004\002\ -\004\002\004\002\000\000\004\002\000\000\000\000\004\002\000\000\ -\000\000\000\000\001\001\002\001\003\001\000\000\000\000\000\000\ -\008\000\164\001\000\000\005\001\000\000\000\000\011\000\243\001\ -\004\002\006\001\007\001\000\000\004\002\000\000\004\002\000\000\ -\000\000\004\002\000\000\000\000\000\000\008\001\137\000\000\000\ -\015\000\016\000\004\002\000\000\004\002\000\000\009\001\000\000\ -\000\000\000\000\000\000\000\000\010\001\011\001\012\001\013\001\ -\014\001\015\001\000\000\000\000\022\000\000\000\138\000\139\000\ -\000\000\140\000\141\000\000\000\000\000\028\000\000\000\016\001\ -\000\000\000\000\142\000\143\000\000\000\000\000\000\000\000\000\ -\000\000\165\001\166\001\000\000\167\001\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\020\001\021\001\168\001\169\001\ -\024\001\170\001\000\000\000\000\000\000\000\000\000\000\000\000\ -\026\001\000\000\000\000\146\000\027\001\000\000\028\001\044\000\ -\000\000\000\000\000\000\000\000\045\000\000\000\179\002\048\000\ -\147\000\001\001\002\001\003\001\000\000\000\000\000\000\008\000\ -\164\001\000\000\005\001\000\000\000\000\011\000\000\000\000\000\ -\006\001\007\001\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\008\001\137\000\000\000\015\000\ -\016\000\000\000\000\000\000\000\000\000\009\001\000\000\000\000\ -\000\000\000\000\000\000\010\001\011\001\012\001\013\001\014\001\ -\015\001\000\000\000\000\022\000\000\000\138\000\139\000\000\000\ -\140\000\141\000\000\000\000\000\028\000\000\000\016\001\000\000\ -\000\000\142\000\143\000\000\000\000\000\000\000\000\000\000\000\ -\165\001\166\001\000\000\167\001\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\020\001\021\001\168\001\169\001\024\001\ -\170\001\000\000\000\000\000\000\000\000\000\000\000\000\026\001\ -\000\000\000\000\146\000\027\001\000\000\028\001\044\000\000\000\ -\000\000\000\000\000\000\045\000\000\000\124\003\048\000\147\000\ -\001\001\002\001\003\001\000\000\000\000\000\000\008\000\164\001\ -\000\000\005\001\000\000\000\000\011\000\000\000\000\000\006\001\ -\007\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\008\001\137\000\000\000\015\000\016\000\ -\000\000\000\000\000\000\000\000\009\001\000\000\000\000\000\000\ -\000\000\000\000\010\001\011\001\012\001\013\001\014\001\015\001\ -\000\000\000\000\022\000\000\000\138\000\139\000\000\000\140\000\ -\141\000\000\000\000\000\028\000\000\000\016\001\000\000\000\000\ -\142\000\143\000\000\000\000\000\000\000\000\000\000\000\165\001\ -\166\001\000\000\167\001\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\020\001\021\001\168\001\169\001\024\001\170\001\ -\000\000\000\000\000\000\000\000\000\000\000\000\026\001\000\000\ -\000\000\146\000\027\001\000\000\028\001\044\000\000\000\000\000\ -\000\000\000\000\045\000\000\000\073\004\048\000\147\000\001\001\ -\002\001\003\001\000\000\000\000\000\000\008\000\164\001\000\000\ -\005\001\000\000\000\000\011\000\000\000\000\000\006\001\007\001\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\008\001\137\000\000\000\015\000\016\000\000\000\ -\000\000\000\000\000\000\009\001\000\000\000\000\000\000\000\000\ -\000\000\010\001\011\001\012\001\013\001\014\001\015\001\000\000\ -\000\000\022\000\000\000\138\000\139\000\000\000\140\000\141\000\ -\000\000\000\000\028\000\000\000\016\001\000\000\000\000\142\000\ -\143\000\000\000\000\000\000\000\000\000\000\000\165\001\166\001\ -\000\000\167\001\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\020\001\021\001\168\001\169\001\024\001\170\001\000\000\ -\000\000\091\003\000\000\000\000\000\000\026\001\000\000\008\000\ -\146\000\027\001\000\000\028\001\044\000\011\000\000\000\000\000\ -\018\003\045\000\000\000\000\000\048\000\147\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\137\000\000\000\015\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\022\000\000\000\138\000\139\000\000\000\ -\140\000\141\000\000\000\000\000\028\000\000\000\143\002\000\000\ -\000\000\142\000\143\000\000\000\008\000\000\000\000\000\000\000\ -\144\000\000\000\011\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\145\000\000\000\000\000\ -\000\000\000\000\137\000\000\000\015\000\016\000\000\000\092\003\ -\000\000\000\000\146\000\000\000\000\000\000\000\044\000\000\000\ -\000\000\000\000\000\000\045\000\000\000\000\000\048\000\147\000\ -\022\000\000\000\138\000\139\000\000\000\140\000\141\000\000\000\ -\000\000\028\000\000\000\145\002\000\000\000\000\142\000\143\000\ -\000\000\008\000\000\000\000\000\000\000\144\000\000\000\011\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\145\000\000\000\000\000\000\000\000\000\137\000\ -\000\000\015\000\016\000\000\000\000\000\000\000\000\000\146\000\ -\000\000\000\000\000\000\044\000\000\000\000\000\000\000\000\000\ -\045\000\000\000\000\000\048\000\147\000\022\000\000\000\138\000\ -\139\000\000\000\140\000\141\000\000\000\000\000\028\000\000\000\ -\080\004\000\000\000\000\142\000\143\000\000\000\008\000\000\000\ -\000\000\000\000\144\000\000\000\011\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\145\000\ -\000\000\000\000\000\000\000\000\137\000\000\000\015\000\016\000\ -\000\000\000\000\000\000\000\000\146\000\000\000\000\000\000\000\ -\044\000\000\000\000\000\000\000\000\000\045\000\000\000\000\000\ -\048\000\147\000\022\000\000\000\138\000\139\000\000\000\140\000\ -\141\000\000\000\000\000\028\000\000\000\082\004\000\000\000\000\ -\142\000\143\000\000\000\008\000\000\000\000\000\000\000\144\000\ -\000\000\011\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\145\000\000\000\000\000\000\000\ -\000\000\137\000\000\000\015\000\016\000\000\000\000\000\000\000\ -\000\000\146\000\000\000\000\000\000\000\044\000\000\000\000\000\ -\000\000\000\000\045\000\000\000\000\000\048\000\147\000\022\000\ -\000\000\138\000\139\000\000\000\140\000\141\000\000\000\000\000\ -\028\000\000\000\084\004\000\000\000\000\142\000\143\000\000\000\ -\008\000\000\000\000\000\000\000\144\000\000\000\011\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\145\000\000\000\000\000\000\000\000\000\137\000\000\000\ -\015\000\016\000\000\000\000\000\000\000\000\000\146\000\000\000\ -\000\000\000\000\044\000\000\000\000\000\000\000\000\000\045\000\ -\000\000\000\000\048\000\147\000\022\000\000\000\138\000\139\000\ -\000\000\140\000\141\000\000\000\000\000\028\000\000\000\000\000\ -\000\000\000\000\142\000\143\000\007\000\008\000\009\000\000\000\ -\000\000\144\000\010\000\011\000\012\000\243\001\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\145\000\000\000\ -\000\000\000\000\000\000\013\000\014\000\015\000\016\000\017\000\ -\018\000\019\000\000\000\146\000\000\000\000\000\020\000\044\000\ -\021\000\000\000\000\000\000\000\045\000\000\000\000\000\048\000\ -\147\000\022\000\000\000\023\000\024\000\025\000\026\000\027\000\ -\000\000\000\000\028\000\029\000\000\000\000\000\030\000\031\000\ -\032\000\000\000\000\000\033\000\034\000\000\000\035\000\036\000\ -\000\000\037\000\000\000\000\000\000\000\038\000\000\000\039\000\ -\000\000\000\000\000\000\040\000\041\000\000\000\042\000\000\000\ -\244\001\000\000\000\000\007\000\008\000\009\000\000\000\043\000\ -\000\000\010\000\011\000\012\000\044\000\000\000\000\000\000\000\ -\000\000\045\000\046\000\047\000\048\000\049\000\050\000\000\000\ -\000\000\051\000\013\000\014\000\015\000\016\000\017\000\018\000\ -\019\000\000\000\000\000\000\000\000\000\020\000\000\000\021\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\022\000\000\000\023\000\024\000\025\000\026\000\027\000\000\000\ -\000\000\028\000\029\000\000\000\000\000\030\000\031\000\032\000\ -\000\000\000\000\033\000\034\000\000\000\035\000\036\000\000\000\ -\037\000\000\000\000\000\000\000\038\000\000\000\039\000\000\000\ -\000\000\000\000\040\000\041\000\000\000\042\000\000\000\000\000\ -\000\000\007\000\008\000\009\000\000\000\000\000\043\000\010\000\ -\011\000\000\000\000\000\044\000\000\000\000\000\000\000\000\000\ -\045\000\046\000\047\000\048\000\049\000\050\000\000\000\000\000\ -\051\000\000\000\015\000\016\000\017\000\018\000\019\000\000\000\ -\000\000\000\000\000\000\020\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\022\000\000\000\ -\023\000\024\000\025\000\026\000\027\000\000\000\000\000\028\000\ -\000\000\000\000\000\000\030\000\031\000\032\000\000\000\000\000\ -\000\000\034\000\000\000\035\000\036\000\000\000\000\000\000\000\ -\000\000\000\000\038\000\000\000\000\000\000\000\000\000\000\000\ -\040\000\041\000\000\000\042\000\000\000\000\000\000\000\000\000\ -\194\000\007\000\008\000\009\000\000\000\000\000\197\000\010\000\ -\011\000\044\000\000\000\000\000\000\000\000\000\045\000\046\000\ -\000\000\048\000\049\000\000\000\000\000\000\000\051\000\000\000\ -\000\000\000\000\015\000\016\000\017\000\018\000\019\000\000\000\ -\000\000\000\000\000\000\020\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\022\000\000\000\ -\023\000\024\000\025\000\026\000\027\000\000\000\000\000\028\000\ -\000\000\000\000\000\000\030\000\031\000\032\000\000\000\000\000\ -\000\000\034\000\000\000\035\000\036\000\000\000\000\000\000\000\ -\000\000\000\000\038\000\000\000\000\000\000\000\000\000\000\000\ -\040\000\041\000\000\000\042\000\000\000\000\000\007\000\008\000\ -\009\000\000\000\000\000\000\000\010\000\011\000\000\000\000\000\ -\000\000\044\000\000\000\000\000\000\000\000\000\045\000\046\000\ -\000\000\048\000\049\000\195\001\000\000\000\000\051\000\015\000\ -\016\000\017\000\018\000\019\000\000\000\000\000\000\000\000\000\ -\020\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\022\000\000\000\023\000\024\000\025\000\ -\026\000\027\000\000\000\000\000\028\000\000\000\000\000\000\000\ -\030\000\031\000\032\000\000\000\000\000\000\000\034\000\000\000\ -\035\000\036\000\000\000\000\000\000\000\000\000\000\000\038\000\ -\000\000\000\000\000\000\000\000\000\000\040\000\041\000\000\000\ -\042\000\000\000\000\000\007\000\008\000\009\000\000\000\000\000\ -\000\000\010\000\011\000\000\000\000\000\000\000\044\000\000\000\ -\000\000\000\000\000\000\045\000\046\000\000\000\048\000\049\000\ -\000\000\000\000\000\000\051\000\015\000\016\000\017\000\018\000\ -\019\000\000\000\000\000\000\000\000\000\020\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\022\000\000\000\023\000\024\000\025\000\026\000\027\000\000\000\ -\000\000\028\000\000\000\000\000\000\000\030\000\031\000\032\000\ -\000\000\000\000\000\000\034\000\000\000\035\000\036\000\000\000\ -\000\000\000\000\000\000\000\000\038\000\000\000\000\000\000\000\ -\000\000\054\002\040\000\041\000\000\000\042\000\000\000\000\000\ -\007\000\008\000\009\000\000\000\000\000\000\000\010\000\011\000\ -\000\000\000\000\000\000\044\000\000\000\000\000\000\000\000\000\ -\045\000\046\000\000\000\048\000\049\000\000\000\000\000\000\000\ -\051\000\015\000\016\000\017\000\018\000\019\000\000\000\000\000\ -\000\000\000\000\020\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\022\000\000\000\023\000\ -\024\000\025\000\026\000\027\000\000\000\000\000\028\000\000\000\ -\000\000\000\000\030\000\031\000\032\000\000\000\000\000\000\000\ -\034\000\000\000\035\000\036\000\000\000\000\000\000\000\000\000\ -\000\000\038\000\000\000\000\000\000\000\000\000\000\000\040\000\ -\041\000\000\000\042\000\000\000\000\000\000\000\000\000\014\003\ -\007\000\008\000\009\000\000\000\000\000\016\003\010\000\011\000\ -\044\000\000\000\000\000\000\000\000\000\045\000\046\000\000\000\ -\048\000\049\000\000\000\000\000\000\000\051\000\000\000\000\000\ -\000\000\015\000\016\000\017\000\018\000\019\000\000\000\000\000\ -\000\000\000\000\020\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\022\000\000\000\023\000\ -\024\000\025\000\026\000\027\000\000\000\000\000\028\000\000\000\ -\000\000\000\000\030\000\031\000\032\000\000\000\000\000\000\000\ -\034\000\000\000\035\000\036\000\000\000\000\000\000\000\000\000\ -\000\000\038\000\000\000\000\000\000\000\000\000\000\000\040\000\ -\041\000\000\000\042\000\000\000\000\000\000\000\007\000\008\000\ -\009\000\000\000\000\000\000\000\010\000\011\000\000\000\000\000\ -\044\000\000\000\000\000\000\000\000\000\045\000\046\000\053\004\ -\048\000\049\000\000\000\000\000\000\000\051\000\000\000\015\000\ -\016\000\017\000\018\000\019\000\000\000\000\000\000\000\000\000\ -\020\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\022\000\000\000\023\000\024\000\025\000\ -\026\000\027\000\000\000\000\000\028\000\000\000\000\000\000\000\ -\030\000\031\000\032\000\000\000\000\000\000\000\034\000\000\000\ -\035\000\036\000\000\000\000\000\000\000\000\000\000\000\038\000\ -\000\000\000\000\000\000\000\000\000\000\040\000\041\000\000\000\ -\042\000\000\000\000\000\216\002\216\002\216\002\000\000\000\000\ -\000\000\216\002\216\002\000\000\000\000\000\000\044\000\000\000\ -\000\000\000\000\000\000\045\000\046\000\000\000\048\000\049\000\ -\216\002\000\000\000\000\051\000\216\002\216\002\216\002\216\002\ -\216\002\000\000\000\000\000\000\000\000\216\002\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\216\002\000\000\216\002\216\002\216\002\216\002\216\002\000\000\ -\000\000\216\002\000\000\000\000\000\000\216\002\216\002\216\002\ -\000\000\000\000\000\000\216\002\000\000\216\002\216\002\000\000\ -\000\000\000\000\000\000\000\000\216\002\000\000\000\000\000\000\ -\000\000\000\000\216\002\216\002\000\000\216\002\000\000\000\000\ -\007\000\008\000\009\000\000\000\000\000\000\000\010\000\011\000\ -\000\000\000\000\000\000\216\002\000\000\000\000\000\000\000\000\ -\216\002\216\002\000\000\216\002\216\002\000\000\000\000\000\000\ -\216\002\015\000\016\000\017\000\018\000\019\000\000\000\000\000\ -\000\000\000\000\020\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\022\000\000\000\023\000\ -\024\000\025\000\026\000\027\000\000\000\000\000\028\000\000\000\ -\000\000\000\000\030\000\031\000\032\000\000\000\000\000\000\000\ -\034\000\000\000\035\000\036\000\000\000\000\000\000\000\000\000\ -\000\000\038\000\000\000\000\000\000\000\000\000\000\000\040\000\ -\041\000\000\000\042\000\000\000\000\000\216\002\216\002\216\002\ -\000\000\000\000\000\000\216\002\216\002\000\000\000\000\000\000\ -\044\000\000\000\000\000\000\000\000\000\045\000\046\000\000\000\ -\048\000\049\000\000\000\000\000\000\000\051\000\216\002\216\002\ -\216\002\216\002\216\002\000\000\000\000\000\000\000\000\216\002\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\216\002\000\000\216\002\216\002\216\002\216\002\ -\216\002\000\000\000\000\216\002\000\000\000\000\000\000\216\002\ -\216\002\216\002\000\000\000\000\000\000\216\002\000\000\216\002\ -\216\002\000\000\000\000\000\000\000\000\000\000\216\002\000\000\ -\000\000\000\000\000\000\000\000\216\002\216\002\000\000\216\002\ -\000\000\000\000\214\002\214\002\214\002\000\000\000\000\000\000\ -\214\002\214\002\000\000\000\000\000\000\216\002\000\000\000\000\ -\000\000\000\000\216\002\216\002\000\000\216\002\216\002\000\000\ -\000\000\000\000\216\002\214\002\214\002\214\002\214\002\214\002\ -\000\000\000\000\000\000\000\000\214\002\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\214\002\ -\000\000\214\002\214\002\214\002\214\002\214\002\000\000\000\000\ -\214\002\000\000\000\000\000\000\214\002\214\002\214\002\000\000\ -\000\000\008\000\214\002\000\000\214\002\214\002\000\000\011\000\ -\000\000\147\003\000\000\214\002\229\001\000\000\000\000\000\000\ -\000\000\214\002\214\002\000\000\214\002\000\000\148\003\000\000\ -\000\000\015\000\016\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\214\002\000\000\000\000\000\000\000\000\214\002\ -\214\002\000\000\214\002\214\002\000\000\022\000\207\001\214\002\ -\139\000\000\000\140\000\141\000\000\000\000\000\028\000\000\000\ -\000\000\000\000\000\000\142\000\149\003\000\000\008\000\000\000\ -\000\000\000\000\144\000\000\000\011\000\000\000\228\001\000\000\ -\000\000\229\001\000\000\000\000\209\001\000\000\000\000\145\000\ -\000\000\000\000\000\000\148\003\210\001\000\000\015\000\016\000\ -\000\000\008\000\000\000\000\000\146\000\000\000\000\000\011\000\ -\044\000\189\002\000\000\211\001\000\000\045\000\000\000\000\000\ -\048\000\147\000\022\000\207\001\000\000\139\000\000\000\140\000\ -\141\000\015\000\016\000\028\000\000\000\000\000\000\000\000\000\ -\142\000\149\003\000\000\000\000\000\000\000\000\000\000\144\000\ -\000\000\000\000\000\000\000\000\000\000\022\000\207\001\000\000\ -\139\000\209\001\140\000\141\000\145\000\000\000\028\000\000\000\ -\000\000\210\001\000\000\142\000\190\002\000\000\000\000\000\000\ -\000\000\146\000\144\000\000\000\191\002\044\000\000\000\000\000\ -\211\001\000\000\045\000\000\000\209\001\048\000\147\000\145\000\ -\000\000\000\000\008\000\000\000\210\001\000\000\000\000\000\000\ -\011\000\000\000\124\005\000\000\146\000\000\000\000\000\000\000\ -\044\000\000\000\000\000\211\001\000\000\045\000\000\000\148\003\ -\048\000\147\000\015\000\016\000\000\000\008\000\000\000\000\000\ -\000\000\000\000\000\000\011\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\022\000\207\001\ -\000\000\139\000\000\000\140\000\141\000\015\000\016\000\028\000\ -\000\000\000\000\000\000\000\000\142\000\149\003\000\000\000\000\ -\000\000\000\000\000\000\144\000\000\000\000\000\000\000\000\000\ -\000\000\022\000\207\001\000\000\139\000\209\001\140\000\141\000\ -\145\000\000\000\028\000\000\000\000\000\210\001\000\000\142\000\ -\208\001\000\000\216\002\000\000\000\000\146\000\144\000\000\000\ -\216\002\044\000\000\000\000\000\211\001\000\000\045\000\000\000\ -\209\001\048\000\147\000\145\000\000\000\000\000\000\000\000\000\ -\210\001\000\000\216\002\216\002\000\000\000\000\000\000\000\000\ -\146\000\000\000\000\000\000\000\044\000\000\000\000\000\211\001\ -\000\000\045\000\000\000\000\000\048\000\147\000\216\002\216\002\ -\000\000\216\002\000\000\216\002\216\002\000\000\000\000\216\002\ -\000\000\000\000\000\000\000\000\216\002\216\002\000\000\000\000\ -\008\000\000\000\000\000\216\002\000\000\000\000\011\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\216\002\000\000\000\000\ -\216\002\000\000\000\000\000\000\000\000\216\002\137\000\000\000\ -\015\000\016\000\000\000\000\000\000\000\216\002\000\000\000\000\ -\000\000\216\002\000\000\000\000\216\002\000\000\216\002\000\000\ -\000\000\216\002\216\002\000\000\022\000\000\000\138\000\139\000\ -\000\000\140\000\141\000\000\000\000\000\028\000\000\000\000\000\ -\000\000\000\000\142\000\143\000\000\000\000\000\000\000\008\000\ -\000\000\144\000\000\000\162\001\000\000\011\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\145\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\137\000\194\000\015\000\ -\016\000\000\000\000\000\146\000\000\000\000\000\000\000\044\000\ -\000\000\000\000\000\000\000\000\045\000\000\000\000\000\048\000\ -\147\000\000\000\000\000\022\000\000\000\138\000\139\000\000\000\ -\140\000\141\000\000\000\000\000\028\000\000\000\000\000\000\000\ -\000\000\142\000\143\000\000\000\008\000\000\000\000\000\000\000\ -\144\000\000\000\011\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\008\000\009\000\000\000\000\000\145\000\010\000\011\000\ -\000\000\000\000\137\000\000\000\015\000\016\000\000\000\000\000\ -\000\000\000\000\146\000\000\000\000\000\000\000\044\000\000\000\ -\000\000\015\000\016\000\045\000\000\000\000\000\048\000\147\000\ -\022\000\000\000\138\000\139\000\000\000\140\000\141\000\000\000\ -\000\000\028\000\000\000\000\000\000\000\022\000\142\000\143\000\ -\024\000\025\000\026\000\027\000\000\000\144\000\028\000\000\000\ -\216\002\000\000\216\002\182\000\032\000\000\000\216\002\000\000\ -\000\000\000\000\145\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\090\003\000\000\000\000\000\000\216\002\146\000\ -\216\002\216\002\042\000\044\000\000\000\000\000\000\000\000\000\ -\045\000\000\000\000\000\048\000\147\000\000\000\000\000\000\000\ -\044\000\000\000\000\000\000\000\216\002\045\000\216\002\216\002\ -\048\000\216\002\216\002\000\000\000\000\216\002\000\000\000\000\ -\000\000\000\000\216\002\216\002\000\000\008\000\000\000\000\000\ -\000\000\216\002\000\000\011\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\216\002\000\000\ -\000\000\000\000\000\000\137\000\000\000\015\000\016\000\000\000\ -\000\000\000\000\000\000\216\002\000\000\000\000\000\000\216\002\ -\000\000\000\000\000\000\000\000\216\002\000\000\000\000\216\002\ -\216\002\022\000\000\000\138\000\139\000\000\000\140\000\141\000\ -\000\000\000\000\028\000\000\000\000\000\000\000\000\000\142\000\ -\143\000\000\000\216\002\000\000\000\000\000\000\144\000\000\000\ -\216\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\145\000\000\000\000\000\000\000\000\000\ -\216\002\000\000\216\002\216\002\000\000\216\002\000\000\000\000\ -\146\000\000\000\000\000\216\002\044\000\000\000\000\000\000\000\ -\000\000\045\000\000\000\000\000\048\000\147\000\216\002\000\000\ -\216\002\216\002\000\000\216\002\216\002\216\002\216\002\216\002\ -\000\000\000\000\000\000\000\000\216\002\216\002\000\000\000\000\ -\000\000\000\000\000\000\216\002\000\000\000\000\000\000\000\000\ -\000\000\216\002\000\000\216\002\216\002\000\000\216\002\216\002\ -\216\002\000\000\216\002\000\000\000\000\000\000\000\000\216\002\ -\216\002\000\000\148\002\000\000\000\000\216\002\216\002\000\000\ -\148\002\216\002\000\000\000\000\000\000\000\000\216\002\000\000\ -\000\000\216\002\216\002\216\002\000\000\000\000\000\000\000\000\ -\148\002\000\000\148\002\148\002\216\002\129\002\000\000\000\000\ -\216\002\000\000\000\000\129\002\216\002\000\000\000\000\000\000\ -\000\000\216\002\000\000\000\000\216\002\216\002\148\002\000\000\ -\148\002\148\002\000\000\148\002\148\002\129\002\129\002\148\002\ -\000\000\000\000\000\000\000\000\148\002\148\002\000\000\000\000\ -\000\000\000\000\000\000\148\002\000\000\000\000\000\000\000\000\ -\000\000\129\002\000\000\129\002\129\002\000\000\129\002\129\002\ -\148\002\000\000\129\002\000\000\000\000\000\000\000\000\129\002\ -\129\002\000\000\214\002\000\000\000\000\148\002\129\002\000\000\ -\214\002\148\002\000\000\000\000\000\000\000\000\148\002\000\000\ -\000\000\148\002\148\002\129\002\000\000\000\000\000\000\000\000\ -\000\000\000\000\214\002\214\002\000\000\008\000\000\000\000\000\ -\129\002\000\000\000\000\011\000\129\002\000\000\000\000\000\000\ -\000\000\129\002\000\000\000\000\129\002\129\002\214\002\000\000\ -\214\002\214\002\000\000\214\002\214\002\015\000\016\000\214\002\ -\000\000\000\000\000\000\000\000\214\002\214\002\000\000\000\000\ -\000\000\000\000\000\000\214\002\000\000\000\000\000\000\000\000\ -\000\000\022\000\000\000\000\000\139\000\000\000\140\000\141\000\ -\214\002\000\000\028\000\000\000\000\000\000\000\000\000\142\000\ -\143\000\000\000\216\002\000\000\000\000\214\002\144\000\000\000\ -\216\002\214\002\000\000\000\000\000\000\000\000\214\002\000\000\ -\000\000\214\002\214\002\145\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\216\002\216\002\000\000\000\000\000\000\000\000\ -\146\000\000\000\000\000\000\000\044\000\000\000\000\000\000\000\ -\000\000\045\000\000\000\000\000\048\000\147\000\216\002\000\000\ -\000\000\216\002\000\000\216\002\216\002\000\000\000\000\216\002\ -\000\000\000\000\000\000\000\000\216\002\216\002\000\000\008\000\ -\009\000\000\000\000\000\216\002\010\000\011\000\008\000\009\000\ -\000\000\000\000\000\000\010\000\011\000\000\000\000\000\087\001\ -\216\002\000\000\000\000\000\000\000\000\000\000\000\000\015\000\ -\016\000\000\000\000\000\000\000\000\000\216\002\015\000\016\000\ -\000\000\216\002\000\000\000\000\000\000\000\000\216\002\000\000\ -\088\001\216\002\216\002\022\000\089\001\000\000\024\000\025\000\ -\026\000\027\000\022\000\089\001\028\000\024\000\025\000\026\000\ -\027\000\142\000\032\000\028\000\000\000\000\000\000\000\000\000\ -\142\000\032\000\000\000\000\000\000\000\000\000\000\000\216\002\ -\216\002\000\000\090\001\000\000\216\002\216\002\000\000\000\000\ -\042\000\090\001\091\001\000\000\000\000\000\000\000\000\042\000\ -\000\000\091\001\092\001\093\001\000\000\000\000\044\000\216\002\ -\216\002\094\001\000\000\045\000\000\000\044\000\048\000\000\000\ -\094\001\000\000\045\000\000\000\000\000\048\000\000\000\000\000\ -\000\000\000\000\000\000\216\002\000\000\000\000\216\002\216\002\ -\216\002\216\002\000\000\000\000\216\002\000\000\000\000\000\000\ -\000\000\216\002\216\002\000\000\000\000\180\004\049\001\050\001\ -\000\000\000\000\000\000\000\000\000\000\000\000\051\001\000\000\ -\000\000\000\000\000\000\181\004\052\001\053\001\182\004\054\001\ -\216\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\055\001\000\000\000\000\000\000\000\000\000\000\216\002\000\000\ -\000\000\056\001\000\000\216\002\000\000\000\000\216\002\057\001\ -\058\001\059\001\060\001\061\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\062\001\000\000\167\002\000\000\000\000\162\000\ -\000\000\000\000\000\000\000\000\063\001\064\001\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\065\001\ -\066\001\067\001\068\001\069\001\000\000\001\001\002\001\003\001\ -\000\000\000\000\000\000\183\004\164\001\000\000\005\001\000\000\ -\000\000\071\001\000\000\000\000\112\000\007\001\113\000\114\000\ -\028\000\000\000\115\000\000\000\000\000\116\000\117\000\000\000\ -\008\001\000\000\000\000\000\000\000\000\000\000\000\000\134\001\ -\000\000\009\001\000\000\000\000\000\000\000\000\118\000\010\001\ -\011\001\012\001\013\001\014\001\015\001\000\000\119\000\120\000\ -\000\000\000\000\000\000\168\002\000\000\000\000\121\000\000\000\ -\000\000\000\000\016\001\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\122\000\123\000\173\002\166\001\000\000\174\002\ -\000\000\000\000\000\000\000\000\224\003\049\001\050\001\020\001\ -\021\001\175\002\169\001\024\001\170\001\051\001\000\000\000\000\ -\000\000\000\000\000\000\052\001\053\001\000\000\054\001\027\001\ -\000\000\028\001\000\000\000\000\000\000\000\000\000\000\055\001\ -\000\000\000\000\000\000\000\000\226\003\049\001\050\001\000\000\ -\056\001\000\000\000\000\000\000\000\000\051\001\057\001\058\001\ -\059\001\060\001\061\001\052\001\053\001\000\000\054\001\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\055\001\ -\000\000\062\001\000\000\000\000\000\000\000\000\162\000\000\000\ -\056\001\000\000\000\000\063\001\064\001\000\000\057\001\058\001\ -\059\001\060\001\061\001\000\000\000\000\000\000\065\001\066\001\ -\067\001\068\001\069\001\000\000\000\000\000\000\000\000\225\003\ -\000\000\062\001\000\000\000\000\000\000\000\000\162\000\000\000\ -\071\001\000\000\000\000\063\001\064\001\000\000\000\000\000\000\ -\000\000\000\000\228\003\049\001\050\001\000\000\065\001\066\001\ -\067\001\068\001\069\001\051\001\000\000\000\000\000\000\000\000\ -\227\003\052\001\053\001\000\000\054\001\000\000\000\000\000\000\ -\071\001\000\000\000\000\000\000\000\000\055\001\000\000\000\000\ -\000\000\000\000\224\003\049\001\050\001\000\000\056\001\000\000\ -\000\000\000\000\000\000\051\001\057\001\058\001\059\001\060\001\ -\061\001\052\001\053\001\000\000\054\001\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\055\001\000\000\062\001\ -\000\000\000\000\000\000\000\000\162\000\000\000\056\001\000\000\ -\000\000\063\001\064\001\000\000\057\001\058\001\059\001\060\001\ -\061\001\000\000\000\000\000\000\065\001\066\001\067\001\068\001\ -\069\001\000\000\000\000\000\000\000\000\000\000\000\000\062\001\ -\229\003\000\000\000\000\000\000\162\000\000\000\071\001\000\000\ -\000\000\063\001\064\001\000\000\000\000\000\000\000\000\000\000\ -\226\003\049\001\050\001\000\000\065\001\066\001\067\001\068\001\ -\069\001\051\001\000\000\000\000\000\000\023\004\000\000\052\001\ -\053\001\000\000\054\001\000\000\000\000\000\000\071\001\000\000\ -\000\000\000\000\000\000\055\001\000\000\000\000\000\000\000\000\ -\228\003\049\001\050\001\000\000\056\001\000\000\000\000\000\000\ -\000\000\051\001\057\001\058\001\059\001\060\001\061\001\052\001\ -\053\001\000\000\054\001\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\055\001\000\000\062\001\000\000\000\000\ -\000\000\000\000\162\000\000\000\056\001\000\000\000\000\063\001\ -\064\001\000\000\057\001\058\001\059\001\060\001\061\001\000\000\ -\000\000\000\000\065\001\066\001\067\001\068\001\069\001\000\000\ -\000\000\000\000\000\000\000\000\024\004\062\001\000\000\000\000\ -\000\000\000\000\162\000\000\000\071\001\000\000\000\000\063\001\ -\064\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\065\001\066\001\067\001\068\001\069\001\226\004\ -\049\001\050\001\000\000\000\000\000\000\000\000\025\004\000\000\ -\051\001\000\000\000\000\000\000\071\001\000\000\052\001\053\001\ -\000\000\054\001\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\055\001\000\000\000\000\000\000\000\000\228\004\ -\049\001\050\001\000\000\056\001\000\000\000\000\000\000\000\000\ -\051\001\057\001\058\001\059\001\060\001\061\001\052\001\053\001\ -\000\000\054\001\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\055\001\000\000\062\001\000\000\000\000\000\000\ -\000\000\162\000\000\000\056\001\000\000\000\000\063\001\064\001\ -\000\000\057\001\058\001\059\001\060\001\061\001\000\000\000\000\ -\000\000\065\001\066\001\067\001\068\001\069\001\000\000\000\000\ -\000\000\000\000\227\004\000\000\062\001\000\000\000\000\000\000\ -\000\000\162\000\000\000\071\001\000\000\000\000\063\001\064\001\ -\000\000\000\000\000\000\000\000\000\000\230\004\049\001\050\001\ -\000\000\065\001\066\001\067\001\068\001\069\001\051\001\000\000\ -\000\000\000\000\000\000\229\004\052\001\053\001\000\000\054\001\ -\000\000\000\000\000\000\071\001\000\000\000\000\000\000\000\000\ -\055\001\000\000\000\000\000\000\000\000\226\004\049\001\050\001\ -\000\000\056\001\000\000\000\000\000\000\000\000\051\001\057\001\ -\058\001\059\001\060\001\061\001\052\001\053\001\000\000\054\001\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\055\001\000\000\062\001\000\000\000\000\000\000\000\000\162\000\ -\000\000\056\001\000\000\000\000\063\001\064\001\000\000\057\001\ -\058\001\059\001\060\001\061\001\000\000\000\000\000\000\065\001\ -\066\001\067\001\068\001\069\001\000\000\000\000\000\000\000\000\ -\000\000\000\000\062\001\231\004\000\000\000\000\000\000\162\000\ -\000\000\071\001\000\000\000\000\063\001\064\001\000\000\000\000\ -\000\000\000\000\000\000\228\004\049\001\050\001\000\000\065\001\ -\066\001\067\001\068\001\069\001\051\001\000\000\000\000\000\000\ -\249\004\000\000\052\001\053\001\000\000\054\001\000\000\000\000\ -\000\000\071\001\000\000\000\000\000\000\000\000\055\001\000\000\ -\000\000\000\000\000\000\230\004\049\001\050\001\000\000\056\001\ -\000\000\000\000\000\000\000\000\051\001\057\001\058\001\059\001\ -\060\001\061\001\052\001\053\001\000\000\054\001\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\055\001\000\000\ -\062\001\000\000\000\000\000\000\000\000\162\000\000\000\056\001\ -\000\000\000\000\063\001\064\001\000\000\057\001\058\001\059\001\ -\060\001\061\001\000\000\000\000\000\000\065\001\066\001\067\001\ -\068\001\069\001\000\000\000\000\000\000\000\000\000\000\250\004\ -\062\001\049\001\050\001\000\000\000\000\162\000\000\000\071\001\ -\000\000\051\001\063\001\064\001\000\000\000\000\000\000\052\001\ -\053\001\000\000\054\001\000\000\000\000\065\001\066\001\067\001\ -\068\001\069\001\000\000\055\001\000\000\000\000\000\000\000\000\ -\000\000\251\004\000\000\000\000\056\001\000\000\000\000\071\001\ -\000\000\000\000\057\001\058\001\059\001\060\001\061\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\062\001\000\000\000\000\ -\000\000\000\000\162\000\000\000\000\000\000\000\000\000\063\001\ -\064\001\049\001\050\001\000\000\000\000\000\000\000\000\000\000\ -\000\000\051\001\065\001\066\001\067\001\068\001\069\001\052\001\ -\053\001\000\000\054\001\000\000\000\000\000\000\000\000\070\001\ -\000\000\057\004\000\000\055\001\071\001\000\000\000\000\000\000\ -\000\000\049\001\050\001\000\000\056\001\000\000\000\000\000\000\ -\000\000\051\001\057\001\058\001\059\001\060\001\061\001\052\001\ -\053\001\000\000\054\001\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\055\001\000\000\062\001\000\000\000\000\ -\000\000\000\000\162\000\000\000\056\001\000\000\000\000\063\001\ -\064\001\000\000\057\001\058\001\059\001\060\001\061\001\000\000\ -\000\000\000\000\065\001\066\001\067\001\068\001\069\001\000\000\ -\000\000\000\000\000\000\000\000\000\000\062\001\049\001\050\001\ -\000\000\000\000\162\000\000\000\071\001\000\000\051\001\063\001\ -\064\001\000\000\000\000\000\000\052\001\000\000\000\000\000\000\ -\000\000\000\000\065\001\066\001\067\001\068\001\069\001\000\000\ -\055\001\000\000\000\000\000\000\000\000\000\000\049\001\050\001\ -\000\000\056\001\000\000\000\000\071\001\000\000\000\000\057\001\ -\058\001\059\001\060\001\061\001\052\001\000\000\000\000\000\000\ -\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\055\001\000\000\062\001\000\000\000\000\000\000\000\000\162\000\ -\000\000\056\001\000\000\000\000\063\001\064\001\000\000\057\001\ -\058\001\059\001\060\001\061\001\012\000\000\000\000\000\065\001\ -\066\001\067\001\068\001\069\001\000\000\000\000\000\000\000\000\ -\000\000\000\000\062\001\089\000\014\000\000\000\000\000\162\000\ -\000\000\071\001\000\000\000\000\063\001\064\001\000\000\000\000\ -\090\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\066\001\067\001\068\001\069\001\000\000\000\000\112\000\000\000\ -\113\000\114\000\028\000\029\000\115\000\000\000\000\000\116\000\ -\117\000\071\001\000\000\033\000\000\000\000\000\000\000\000\000\ -\000\000\091\000\000\000\000\000\000\000\000\000\000\000\039\000\ -\118\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\119\000\120\000\000\000\000\000\000\000\000\000\000\000\092\000\ -\121\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ -\000\000\000\000\000\000\093\000\122\000\123\000\050\000" - -let yycheck = "\003\000\ -\002\000\005\000\177\000\177\000\002\000\174\000\112\000\112\000\ -\255\000\185\000\115\000\008\000\112\000\139\000\105\001\061\002\ -\118\000\002\000\092\000\180\000\001\000\133\000\002\000\104\002\ -\233\002\221\001\104\002\114\000\002\000\002\003\104\000\002\000\ -\027\000\034\004\146\000\059\002\002\000\000\000\192\002\003\000\ -\150\001\002\000\002\000\196\000\116\003\198\000\001\000\245\003\ -\101\003\059\000\252\000\164\003\124\003\223\004\210\004\119\004\ -\009\000\008\001\203\004\000\000\198\002\000\000\043\000\121\001\ -\066\001\123\001\000\000\110\004\000\001\093\002\029\000\024\000\ -\019\001\229\002\033\000\027\001\214\004\090\001\022\001\006\001\ -\025\000\022\001\066\001\000\001\000\001\031\001\000\001\108\001\ -\043\000\042\000\092\000\178\000\094\001\000\001\092\000\079\001\ -\000\001\110\001\141\004\040\001\008\001\000\001\104\000\017\001\ -\059\000\037\001\104\000\092\000\112\000\029\001\027\001\115\000\ -\092\000\117\000\118\000\023\001\000\001\000\001\092\000\104\000\ -\067\001\092\000\030\001\120\000\104\000\078\000\092\000\080\000\ -\081\000\000\001\104\000\092\000\092\000\104\000\000\001\000\001\ -\140\000\141\000\104\000\143\000\029\005\092\001\094\001\104\000\ -\104\000\053\001\090\001\055\001\014\001\153\000\154\000\017\001\ -\034\005\117\000\036\003\012\004\022\001\065\001\201\004\066\001\ -\014\001\027\001\066\001\095\001\000\001\092\001\073\001\000\001\ -\000\001\073\001\115\000\004\000\176\000\177\000\091\001\091\001\ -\180\000\094\001\095\001\095\001\094\001\047\001\036\001\000\001\ -\000\001\000\001\019\001\094\001\088\005\000\001\094\001\104\001\ -\091\001\026\001\027\001\027\001\095\001\014\001\106\001\032\000\ -\017\001\109\001\000\001\162\000\163\000\024\001\008\001\091\001\ -\115\001\092\001\064\001\115\001\165\000\000\001\000\001\048\001\ -\049\001\087\001\008\001\000\001\000\001\037\001\000\001\094\001\ -\010\001\091\001\091\001\060\001\181\000\095\001\095\001\097\001\ -\098\001\055\003\067\001\068\001\154\001\070\001\003\001\026\005\ -\027\001\095\001\188\001\097\001\000\001\018\001\027\001\082\002\ -\035\005\115\001\132\003\133\005\093\001\000\000\070\004\109\001\ -\000\001\073\004\094\001\091\001\200\002\088\001\094\001\095\001\ -\161\001\114\001\163\001\000\001\109\001\000\001\000\001\185\005\ -\121\001\187\005\123\001\040\001\091\001\094\001\111\001\095\001\ -\095\001\130\001\131\001\094\001\000\001\112\001\105\001\133\001\ -\066\001\207\001\092\001\036\005\046\001\091\001\212\001\250\000\ -\145\001\252\000\106\005\101\002\000\001\241\002\092\001\149\001\ -\091\001\035\001\092\001\004\001\095\001\095\001\091\001\091\001\ -\201\005\094\001\095\001\000\001\094\001\000\001\000\001\092\001\ -\008\001\000\001\147\003\193\001\181\004\182\004\004\001\027\001\ -\025\001\059\001\008\001\000\001\031\001\023\002\064\001\065\001\ -\249\001\015\001\094\001\172\000\018\001\026\001\045\001\026\001\ -\074\001\000\001\179\000\046\001\230\003\000\001\094\001\000\001\ -\000\001\000\001\003\002\010\001\000\001\105\001\155\004\066\001\ -\000\001\094\001\010\001\094\001\221\004\000\001\114\001\004\001\ -\007\001\099\001\019\001\008\001\018\001\121\001\060\005\123\001\ -\092\001\026\001\015\001\109\001\000\001\018\001\130\001\131\001\ -\035\001\133\001\000\001\132\005\066\001\106\004\010\001\091\001\ -\089\001\090\001\000\001\095\001\093\001\145\001\000\001\096\001\ -\049\001\149\001\044\004\092\001\092\001\153\001\154\001\092\001\ -\059\001\092\001\092\001\060\001\247\002\064\001\065\001\094\001\ -\065\001\000\001\014\001\068\001\000\001\070\001\091\001\074\001\ -\067\001\243\001\027\001\010\001\015\001\066\001\178\001\179\001\ -\180\001\017\001\022\001\001\004\073\001\092\001\186\001\015\001\ -\095\001\130\001\131\001\015\001\092\001\092\001\092\001\095\001\ -\099\001\000\001\094\001\000\001\000\001\018\001\094\001\032\001\ -\018\001\092\001\109\001\207\001\208\001\040\003\111\001\040\001\ -\212\001\066\001\043\001\046\003\216\001\237\003\068\003\219\001\ -\092\001\074\005\017\001\095\001\113\001\000\001\092\001\027\001\ -\228\001\229\001\066\001\018\001\000\001\243\004\066\001\171\003\ -\094\001\188\001\018\001\004\001\094\001\070\001\066\001\243\001\ -\244\001\243\001\094\001\003\001\077\001\243\001\004\001\083\001\ -\065\001\253\001\008\001\094\001\101\002\092\001\000\000\003\002\ -\112\002\015\001\243\001\008\001\018\001\131\002\094\001\243\001\ -\228\001\229\001\014\002\113\002\114\002\243\001\011\002\092\001\ -\243\001\094\001\192\002\003\001\094\001\243\001\176\004\243\001\ -\000\001\030\001\243\001\243\001\091\001\043\005\091\001\091\001\ -\247\001\028\002\029\002\095\001\109\001\238\001\014\001\094\001\ -\014\001\017\001\022\001\000\001\135\003\092\001\022\001\094\001\ -\073\001\063\005\055\001\027\001\066\001\057\002\094\001\008\001\ -\091\001\233\002\233\002\233\002\065\001\217\004\019\001\091\001\ -\169\002\143\004\171\002\022\001\023\002\026\001\008\001\047\001\ -\000\001\026\002\014\001\000\001\167\003\030\001\082\002\004\001\ -\152\005\000\001\027\002\008\001\189\002\065\001\014\001\248\002\ -\002\001\014\001\015\001\048\001\030\001\018\001\027\001\054\002\ -\022\001\101\002\008\001\113\001\104\002\106\001\055\001\060\001\ -\109\001\079\001\110\002\111\002\065\001\113\002\114\002\068\001\ -\065\001\070\001\094\001\091\001\035\001\055\001\015\003\095\001\ -\017\003\097\001\098\001\127\002\121\002\065\001\036\001\065\001\ -\132\002\027\001\083\005\031\005\008\001\137\002\022\001\090\001\ -\022\001\065\001\066\001\115\001\059\001\066\001\042\005\147\002\ -\148\002\064\001\065\001\111\002\066\001\005\003\062\001\242\003\ -\066\001\106\001\111\001\074\001\109\001\244\002\249\003\047\001\ -\036\001\094\001\062\005\127\002\090\001\169\002\094\001\171\002\ -\106\001\094\001\001\003\109\001\176\002\137\002\027\001\035\001\ -\094\001\181\002\118\004\065\001\099\001\006\005\092\001\080\003\ -\006\005\189\002\190\002\019\001\192\002\035\001\109\001\182\003\ -\183\003\093\005\050\003\022\001\094\001\030\002\202\002\059\001\ -\008\001\027\001\052\003\052\003\000\001\065\001\000\000\000\001\ -\108\005\097\001\098\001\004\001\176\002\059\001\253\001\008\001\ -\092\001\049\001\064\003\065\001\201\002\039\003\015\001\253\001\ -\073\003\018\001\088\001\115\001\060\001\233\002\026\001\064\002\ -\065\002\152\003\152\003\057\005\068\001\059\005\070\001\179\004\ -\066\001\094\001\102\001\247\002\248\002\066\001\201\002\073\001\ -\094\001\109\001\112\001\111\001\073\001\255\002\000\001\195\004\ -\102\001\255\002\004\001\067\001\008\003\096\004\008\001\109\001\ -\010\001\111\001\004\001\094\001\014\001\015\001\008\001\008\001\ -\018\001\066\001\057\002\055\001\014\001\015\001\014\001\111\001\ -\018\001\027\001\003\001\057\002\064\001\150\005\151\005\000\001\ -\018\001\115\001\014\001\027\001\040\003\039\003\115\001\130\004\ -\236\004\039\003\046\003\014\001\008\003\094\001\207\003\044\003\ -\052\003\140\004\019\001\055\003\000\001\035\001\039\003\019\001\ -\027\001\026\001\000\001\039\003\064\003\090\001\047\001\060\003\ -\066\001\039\003\155\002\156\002\039\003\073\003\030\001\073\001\ -\066\001\039\003\067\001\079\003\112\001\059\001\039\003\039\003\ -\049\001\110\001\036\001\065\001\048\001\065\001\066\001\079\001\ -\177\002\091\001\092\001\060\001\094\001\095\001\215\005\055\001\ -\060\001\000\000\067\001\068\001\094\001\070\001\191\002\030\001\ -\068\001\065\001\070\001\072\000\079\001\055\001\000\001\113\001\ -\097\001\098\001\094\001\003\001\064\001\065\001\064\001\014\001\ -\102\001\014\001\064\001\065\001\064\001\129\003\044\004\109\001\ -\055\001\019\001\115\001\135\003\027\001\045\001\046\001\139\003\ -\026\001\102\000\065\001\000\000\022\001\095\001\111\001\147\003\ -\022\001\149\003\106\001\111\001\152\003\109\001\154\003\155\003\ -\156\003\058\004\200\005\159\003\160\003\097\001\048\001\049\001\ -\164\003\007\004\166\003\167\003\000\001\047\001\112\001\064\001\ -\065\001\109\001\060\001\083\001\065\001\066\001\178\003\139\003\ -\009\003\067\001\068\001\106\001\070\001\000\001\109\001\147\003\ -\079\001\189\003\035\004\065\001\100\001\022\003\095\004\014\001\ -\000\001\015\001\004\001\159\003\018\001\194\003\008\001\014\001\ -\019\001\037\001\074\001\207\003\027\001\015\001\000\001\026\001\ -\027\001\003\001\037\001\019\001\027\001\110\001\178\003\097\001\ -\098\001\027\001\026\001\013\001\014\001\111\001\064\001\017\001\ -\000\000\014\001\131\004\008\001\017\001\048\001\049\001\000\001\ -\026\001\027\001\028\001\029\001\108\001\064\001\242\003\105\001\ -\048\001\060\001\065\001\030\001\066\001\249\003\040\001\041\001\ -\067\001\068\001\065\001\070\001\060\001\001\004\000\001\097\001\ -\066\001\026\001\176\004\007\004\068\001\002\004\070\001\000\001\ -\012\004\135\004\060\001\109\001\055\001\063\001\000\001\065\001\ -\066\001\067\001\068\001\022\001\066\001\067\001\065\001\073\001\ -\074\001\147\001\019\001\073\001\022\001\000\001\080\001\035\004\ -\064\001\026\001\066\001\037\001\111\001\206\004\127\003\128\003\ -\044\004\045\004\092\001\075\001\094\001\049\004\096\001\111\001\ -\064\001\035\001\000\001\220\004\141\003\142\003\058\004\026\001\ -\049\001\014\001\108\001\148\003\010\001\111\001\065\001\106\001\ -\064\001\115\001\109\001\060\001\157\003\115\001\000\001\065\001\ -\064\001\059\001\243\004\068\001\067\005\070\001\064\001\065\001\ -\112\001\045\004\047\001\075\001\064\001\049\004\031\004\012\001\ -\074\001\019\001\090\001\095\004\096\004\109\001\098\004\028\001\ -\026\001\000\001\064\001\018\005\018\005\004\001\208\004\208\004\ -\108\004\008\001\031\001\010\001\208\004\109\001\110\001\014\001\ -\015\001\099\001\027\001\018\001\064\001\064\001\111\001\049\001\ -\112\001\064\001\100\001\109\001\027\001\050\001\130\004\131\004\ -\041\005\109\001\060\001\004\001\075\001\066\001\098\004\008\001\ -\140\004\067\001\068\001\143\004\070\001\074\001\015\001\109\001\ -\108\004\018\001\071\001\080\001\061\005\064\001\083\001\027\001\ -\037\001\066\001\027\001\159\004\053\001\064\001\055\001\084\001\ -\157\004\109\001\110\001\066\001\083\005\083\005\086\005\064\001\ -\065\001\112\001\073\001\094\001\176\004\035\001\064\001\040\001\ -\101\001\181\004\182\004\064\001\066\001\111\001\064\001\064\001\ -\064\001\189\004\109\001\110\001\091\001\092\001\066\001\094\001\ -\095\001\066\001\109\001\000\001\053\001\059\001\055\001\056\001\ -\090\001\066\001\109\001\065\001\208\004\209\004\210\004\088\001\ -\065\001\042\004\113\001\000\001\109\001\046\004\019\001\000\000\ -\082\002\221\004\051\004\223\004\110\001\026\001\022\001\109\001\ -\000\001\189\004\066\001\109\001\004\001\109\001\019\001\112\001\ -\008\001\073\001\010\001\068\004\069\004\026\001\014\001\064\001\ -\102\001\074\004\018\001\048\001\110\002\209\004\210\004\109\001\ -\027\001\064\001\254\004\027\001\109\001\035\001\094\001\060\001\ -\221\001\064\001\006\005\048\001\000\001\075\001\067\001\068\001\ -\027\001\070\001\099\004\067\001\016\005\035\001\018\005\060\001\ -\022\001\013\001\022\005\115\001\064\001\059\001\067\001\068\001\ -\064\001\070\001\064\001\065\001\109\001\238\001\026\001\066\001\ -\028\001\029\001\254\004\039\005\074\001\059\001\109\001\000\001\ -\004\001\073\001\112\001\065\001\008\001\041\001\109\001\066\001\ -\031\001\000\000\111\001\015\001\016\005\057\005\018\001\059\005\ -\018\001\230\002\022\005\091\001\092\001\099\001\094\001\095\001\ -\060\001\109\001\111\001\050\001\000\001\109\001\074\005\109\001\ -\068\001\246\002\027\002\039\005\037\001\250\002\074\001\083\005\ -\102\001\113\001\027\005\007\000\080\001\030\005\010\000\109\001\ -\177\004\013\000\014\000\027\001\000\000\017\000\018\000\019\000\ -\020\000\021\000\066\001\023\000\096\001\066\001\066\001\192\004\ -\193\004\037\001\030\000\066\001\025\003\113\005\034\000\064\001\ -\108\001\037\000\038\000\111\001\027\001\027\001\083\001\000\001\ -\124\005\086\002\046\000\047\000\083\001\247\002\050\000\051\000\ -\004\001\023\001\066\001\135\005\008\001\035\001\000\001\000\001\ -\081\005\082\005\091\001\084\005\085\005\066\001\018\001\108\001\ -\146\005\026\001\150\005\151\005\146\005\113\005\109\001\027\001\ -\156\005\157\005\019\001\066\001\066\001\059\001\083\001\031\001\ -\026\001\026\001\064\001\065\001\000\000\089\000\090\000\091\000\ -\000\001\093\000\066\001\135\005\074\001\071\001\040\003\179\005\ -\009\005\073\001\050\001\006\001\046\003\185\005\186\005\187\005\ -\049\001\004\001\084\001\191\005\005\000\008\001\066\001\022\001\ -\156\005\157\005\026\001\060\001\015\001\099\001\094\001\018\001\ -\166\003\125\000\064\001\068\001\066\001\070\001\004\001\109\001\ -\212\005\022\001\008\001\215\005\000\000\137\000\138\000\179\005\ -\047\001\221\005\222\005\115\001\018\001\095\001\186\005\189\003\ -\064\001\149\000\088\001\191\005\055\001\027\001\057\001\058\001\ -\059\001\000\001\061\001\075\001\000\001\064\001\065\001\022\001\ -\164\000\053\001\000\001\055\001\189\005\078\005\111\001\066\001\ -\212\005\173\000\112\001\091\001\064\001\065\001\199\005\019\001\ -\022\001\221\005\222\005\026\001\093\001\019\001\026\001\090\001\ -\047\001\210\005\211\005\232\002\026\001\135\003\097\001\004\001\ -\027\001\000\001\000\001\008\001\109\001\053\001\054\001\055\001\ -\056\001\047\001\109\001\110\001\048\001\000\000\251\002\120\005\ -\064\001\065\001\048\001\000\003\093\001\000\001\027\001\128\005\ -\060\001\109\001\164\003\026\001\026\001\167\003\060\001\067\001\ -\068\001\000\001\070\001\094\001\109\001\004\001\068\001\018\001\ -\070\001\008\001\023\003\010\001\022\001\016\001\095\001\014\001\ -\015\001\004\001\109\001\140\000\141\000\008\001\159\005\004\001\ -\027\001\253\000\254\000\008\001\027\001\109\001\040\001\018\001\ -\153\000\154\000\015\001\091\001\049\003\018\001\095\001\095\001\ -\027\001\178\005\000\001\111\001\000\001\065\001\027\001\019\001\ -\004\001\111\001\008\001\071\001\008\001\022\001\010\001\176\000\ -\064\001\065\001\014\001\000\001\065\001\033\001\018\001\071\001\ -\084\001\037\001\093\001\066\001\073\001\010\001\006\001\027\001\ -\242\003\000\001\073\001\014\001\084\001\214\005\017\001\249\003\ -\004\001\094\001\090\001\010\001\008\001\066\001\065\001\053\001\ -\027\001\055\001\014\001\015\001\091\001\092\001\018\001\094\001\ -\095\001\077\001\012\004\065\001\113\003\073\001\110\001\053\001\ -\076\001\055\001\053\001\079\001\055\001\081\001\066\001\083\001\ -\064\001\065\001\113\001\065\001\000\001\073\001\065\001\055\001\ -\004\001\057\001\058\001\059\001\008\001\061\001\010\001\003\001\ -\064\001\065\001\014\001\065\001\066\001\067\001\018\001\091\001\ -\092\001\055\001\094\001\095\001\112\001\059\001\066\001\027\001\ -\116\001\063\001\064\001\053\001\054\001\055\001\056\001\064\001\ -\065\001\000\000\090\001\168\003\169\003\113\001\064\001\065\001\ -\078\001\097\001\134\001\135\001\000\001\064\001\053\001\003\001\ -\055\001\016\001\055\001\184\003\064\001\109\001\110\001\022\001\ -\227\001\013\001\065\001\064\001\027\001\092\001\096\004\234\001\ -\197\003\053\001\013\001\055\001\160\001\073\001\026\001\109\001\ -\028\001\029\001\008\001\167\001\000\001\065\001\014\001\171\001\ -\213\003\028\001\029\001\109\001\040\001\041\001\010\001\091\001\ -\092\001\095\001\094\001\095\001\184\001\185\001\041\001\065\001\ -\130\004\189\001\036\001\191\001\064\001\065\001\073\001\073\001\ -\060\001\014\001\140\004\063\001\022\001\113\001\109\001\244\003\ -\068\001\060\001\206\001\090\001\063\001\000\001\074\001\022\001\ -\003\001\068\001\065\001\066\001\080\001\159\004\218\001\074\001\ -\220\001\221\001\013\001\066\001\067\001\080\001\017\001\014\001\ -\092\001\064\001\065\001\022\001\096\001\210\001\211\001\026\001\ -\027\001\028\001\029\001\181\004\182\004\096\001\095\001\008\001\ -\108\001\130\001\131\001\111\001\000\000\000\001\041\001\251\001\ -\037\004\108\001\095\001\055\001\111\001\004\001\023\001\059\001\ -\153\001\008\001\112\001\063\001\064\001\030\001\092\001\103\001\ -\015\001\060\001\014\001\018\001\063\001\022\001\065\001\066\001\ -\067\001\068\001\078\001\221\004\027\001\223\004\073\001\074\001\ -\027\001\178\001\179\001\180\001\053\001\080\001\055\001\092\001\ -\091\001\186\001\092\001\237\004\238\004\109\001\000\000\092\001\ -\065\001\092\001\094\001\094\001\055\001\096\001\057\001\058\001\ -\059\001\109\001\061\001\094\001\092\001\064\001\065\001\014\001\ -\101\004\108\001\103\004\066\001\111\001\115\001\020\001\216\001\ -\115\001\109\001\115\001\064\001\065\001\046\001\081\001\109\001\ -\109\001\062\001\071\001\108\001\002\001\081\002\089\001\090\001\ -\084\002\106\001\086\002\109\001\109\001\109\001\097\001\084\001\ -\073\001\073\001\100\001\244\001\137\004\090\001\027\001\109\001\ -\015\001\142\004\109\001\110\001\001\000\002\000\003\000\004\000\ -\005\000\092\001\055\001\000\001\094\001\064\001\064\001\008\001\ -\109\001\110\001\065\001\109\001\040\001\014\002\001\001\002\001\ -\124\002\000\001\167\004\014\001\018\001\004\001\009\001\062\001\ -\074\005\008\001\062\001\010\001\015\001\016\001\062\001\014\001\ -\092\001\027\001\142\002\064\001\144\002\094\001\146\002\079\001\ -\027\001\014\001\150\002\014\001\027\001\006\001\094\001\073\001\ -\109\001\036\001\199\004\200\004\095\001\064\001\075\001\042\001\ -\043\001\044\001\045\001\046\001\073\001\111\005\022\001\094\001\ -\172\002\092\001\014\001\073\001\027\001\218\004\006\001\040\001\ -\008\001\222\004\061\001\094\001\027\001\014\001\027\001\066\001\ -\021\001\086\001\064\001\062\001\071\001\072\001\194\002\062\001\ -\062\001\003\001\073\001\199\002\200\002\014\001\062\001\082\001\ -\083\001\084\001\085\001\086\001\062\001\086\001\210\002\095\001\ -\212\002\027\001\090\001\073\001\091\001\092\001\003\005\094\001\ -\095\001\100\001\091\001\223\002\224\002\027\001\094\001\055\001\ -\101\001\057\001\058\001\059\001\094\001\061\001\234\002\094\001\ -\064\001\065\001\113\001\132\002\088\001\241\002\027\001\185\005\ -\094\001\187\005\014\001\020\001\000\001\015\001\022\001\003\001\ -\252\002\053\001\147\002\148\002\094\001\008\001\043\005\062\001\ -\080\001\013\001\090\001\062\001\092\001\062\001\051\005\094\001\ -\112\001\097\001\112\001\094\001\088\001\065\001\026\001\019\003\ -\028\001\029\001\063\005\021\001\091\001\109\001\110\001\095\001\ -\094\001\014\001\014\001\014\001\181\002\041\001\014\001\027\001\ -\027\001\037\003\019\001\091\001\022\001\112\001\000\001\088\001\ -\014\001\003\001\014\001\014\001\014\001\000\000\000\000\008\001\ -\060\001\092\001\065\001\013\001\092\001\036\001\109\001\017\001\ -\068\001\036\001\062\003\109\001\022\001\065\003\074\001\067\003\ -\026\001\027\001\028\001\029\001\080\001\005\000\006\001\036\001\ -\008\001\064\001\078\003\092\001\092\001\090\001\082\003\041\001\ -\092\001\040\001\064\001\036\001\096\001\089\003\094\001\053\001\ -\024\000\093\003\053\001\064\001\091\001\026\003\000\000\064\001\ -\108\001\064\001\060\001\111\001\064\001\063\001\036\003\065\001\ -\066\001\067\001\068\001\111\003\064\001\064\001\114\003\073\001\ -\074\001\064\001\118\003\186\005\254\004\111\005\080\001\055\001\ -\187\002\057\001\058\001\059\001\120\003\061\001\171\005\026\002\ -\064\001\065\001\092\001\131\002\094\001\000\001\096\001\018\005\ -\096\001\094\001\129\003\143\003\187\001\057\002\063\002\141\000\ -\183\001\166\004\108\001\212\003\155\004\111\001\195\005\196\005\ -\171\002\115\001\090\001\145\001\108\001\006\005\203\005\243\004\ -\255\255\097\001\043\005\136\004\255\255\255\255\170\003\171\003\ -\255\255\255\255\255\255\255\255\255\255\109\001\110\001\220\005\ -\180\003\181\003\255\255\255\255\255\255\015\001\079\003\255\255\ -\255\255\121\000\255\255\255\255\055\001\255\255\057\001\058\001\ -\059\001\197\003\061\001\255\255\255\255\064\001\065\001\255\255\ -\255\255\255\255\255\255\139\000\140\000\141\000\255\255\143\000\ -\064\001\065\001\044\001\045\001\046\001\255\255\081\001\071\001\ -\255\255\153\000\154\000\255\255\255\255\077\001\089\001\090\001\ -\255\255\255\255\255\255\255\255\084\001\233\003\097\001\235\003\ -\129\003\255\255\090\001\255\255\255\255\071\001\072\001\243\003\ -\176\000\177\000\109\001\110\001\180\000\255\255\255\255\255\255\ -\252\003\083\001\084\001\085\001\086\001\109\001\110\001\255\255\ -\255\255\154\003\155\003\156\003\255\255\009\004\255\255\160\003\ -\255\255\255\255\100\001\255\255\255\255\166\003\255\255\255\255\ -\255\255\255\255\255\255\007\000\255\255\255\255\010\000\255\255\ -\255\255\013\000\014\000\255\255\255\255\017\000\018\000\019\000\ -\020\000\021\000\255\255\023\000\189\003\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\034\000\255\255\ -\255\255\037\000\038\000\255\255\255\255\255\255\255\255\255\255\ -\255\255\061\004\046\000\047\000\064\004\255\255\050\000\051\000\ -\055\001\255\255\057\001\058\001\059\001\255\255\061\001\255\255\ -\255\255\064\001\065\001\255\255\255\255\081\004\255\255\083\004\ -\255\255\085\004\255\255\087\004\088\004\255\255\255\255\255\255\ -\092\004\255\255\255\255\255\255\255\255\097\004\000\001\255\255\ -\100\004\003\001\102\004\090\001\255\255\089\000\090\000\091\000\ -\255\255\093\000\097\001\013\001\014\001\255\255\255\255\017\001\ -\255\255\255\255\118\004\255\255\255\255\255\255\109\001\110\001\ -\026\001\027\001\028\001\029\001\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\013\001\137\004\040\001\041\001\ -\255\255\255\255\142\004\255\255\255\255\255\255\255\255\255\255\ -\255\255\149\004\255\255\028\001\029\001\137\000\138\000\087\001\ -\255\255\255\255\060\001\255\255\255\255\063\001\255\255\255\255\ -\041\001\067\001\068\001\255\255\255\255\255\255\170\004\073\001\ -\074\001\255\255\174\004\255\255\255\255\255\255\080\001\179\004\ -\255\255\255\255\255\255\060\001\255\255\255\255\255\255\255\255\ -\255\255\173\000\092\001\068\001\094\001\255\255\096\001\195\004\ -\196\004\074\001\198\004\255\255\255\255\255\255\255\255\080\001\ -\255\255\255\255\108\001\000\001\255\255\111\001\255\255\255\255\ -\212\004\115\001\255\255\255\255\255\255\255\255\150\001\096\001\ -\255\255\153\001\154\001\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\108\001\255\255\255\255\111\001\235\004\ -\236\004\255\255\255\255\255\255\255\255\255\255\242\004\255\255\ -\255\255\255\255\178\001\179\001\180\001\255\255\255\255\255\255\ -\255\255\255\255\186\001\255\255\255\255\001\005\255\255\003\005\ -\255\255\193\001\055\001\255\255\057\001\058\001\059\001\255\255\ -\061\001\253\000\254\000\064\001\065\001\017\005\255\255\207\001\ -\208\001\255\255\255\255\255\255\212\001\255\255\255\255\255\255\ -\216\001\000\000\255\255\219\001\081\001\033\005\255\255\019\001\ -\255\255\255\255\038\005\227\001\089\001\090\001\255\255\255\255\ -\255\255\255\255\234\001\255\255\097\001\033\001\000\000\051\005\ -\255\255\037\001\255\255\255\255\244\001\255\255\255\255\108\001\ -\109\001\110\001\255\255\255\255\255\255\253\001\255\255\255\255\ -\023\001\255\255\255\255\003\002\072\005\255\255\255\255\255\255\ -\255\255\077\005\255\255\255\255\080\005\036\001\014\002\255\255\ -\255\255\017\002\255\255\087\005\255\255\255\255\255\255\091\005\ -\255\255\255\255\026\002\095\005\255\255\255\255\255\255\255\255\ -\055\001\255\255\057\001\058\001\059\001\255\255\061\001\255\255\ -\255\255\064\001\065\001\255\255\112\005\255\255\255\255\005\000\ -\255\255\255\255\255\255\009\000\255\255\255\255\255\255\255\255\ -\255\255\057\002\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\024\000\090\001\255\255\137\005\138\005\255\255\ -\255\255\255\255\097\001\143\005\255\255\255\255\255\255\147\005\ -\255\255\255\255\134\001\255\255\042\000\153\005\109\001\110\001\ -\255\255\255\255\255\255\255\255\255\255\161\005\162\005\255\255\ -\255\255\255\255\255\255\167\005\168\005\169\005\170\005\255\255\ -\005\000\006\001\007\001\255\255\255\255\015\001\011\001\012\001\ -\180\005\181\005\255\255\167\001\255\255\255\255\255\255\255\255\ -\078\000\255\255\080\000\081\000\255\255\193\005\194\005\255\255\ -\196\005\030\001\031\001\131\002\132\002\255\255\255\255\255\255\ -\204\005\043\001\044\001\045\001\046\001\255\255\255\255\255\255\ -\255\255\255\255\255\255\147\002\148\002\050\001\218\005\000\000\ -\053\001\054\001\055\001\056\001\224\005\225\005\059\001\255\255\ -\066\001\255\255\255\255\064\001\065\001\071\001\072\001\255\255\ -\255\255\255\255\170\002\255\255\255\255\255\255\255\255\255\255\ -\255\255\083\001\084\001\085\001\086\001\181\002\140\000\141\000\ -\255\255\143\000\087\001\255\255\255\255\255\255\190\002\255\255\ -\192\002\255\255\100\001\153\000\154\000\255\255\255\255\251\001\ -\101\001\255\255\202\002\255\255\255\255\106\001\255\255\165\000\ -\109\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\000\001\176\000\177\000\003\001\255\255\255\255\181\000\ -\255\255\255\255\255\255\255\255\255\255\255\255\013\001\231\002\ -\255\255\233\002\017\001\255\255\255\255\255\255\000\001\140\000\ -\141\000\003\001\143\000\026\001\027\001\028\001\029\001\255\255\ -\248\002\255\255\255\255\013\001\153\000\154\000\255\255\255\255\ -\255\255\255\255\041\001\255\255\255\255\255\255\255\255\255\255\ -\026\001\255\255\028\001\029\001\255\255\255\255\255\255\255\255\ -\255\255\255\255\175\000\176\000\177\000\060\001\040\001\041\001\ -\063\001\255\255\255\255\066\001\067\001\068\001\255\255\255\255\ -\255\255\005\000\073\001\074\001\255\255\009\000\255\255\255\255\ -\255\255\080\001\060\001\255\255\255\255\063\001\004\001\047\003\ -\255\255\067\001\068\001\255\255\024\000\092\001\255\255\094\001\ -\074\001\096\001\255\255\255\255\255\255\255\255\080\001\255\255\ -\255\255\255\255\255\255\025\001\068\003\108\001\042\000\255\255\ -\111\001\255\255\092\001\255\255\115\001\255\255\096\001\079\003\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\108\001\255\255\255\255\111\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\078\000\255\255\080\000\081\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\129\003\255\255\089\001\090\001\255\255\255\255\093\001\ -\255\255\000\000\096\001\255\255\112\000\042\001\255\255\255\255\ -\255\255\255\255\255\255\048\001\255\255\149\003\255\255\000\001\ -\152\003\255\255\154\003\155\003\156\003\255\255\255\255\008\001\ -\160\003\255\255\255\255\255\255\013\001\255\255\166\003\255\255\ -\140\000\141\000\255\255\143\000\255\255\255\255\255\255\255\255\ -\255\255\026\001\255\255\028\001\029\001\153\000\154\000\255\255\ -\255\255\255\255\255\255\255\255\255\255\189\003\255\255\255\255\ -\041\001\165\000\255\255\153\001\154\001\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\176\000\177\000\255\255\207\003\ -\000\001\181\000\255\255\060\001\255\255\255\255\063\001\255\255\ -\255\255\066\001\067\001\068\001\178\001\179\001\180\001\019\003\ -\255\255\074\001\255\255\255\255\186\001\255\255\255\255\080\001\ -\255\255\255\255\255\255\255\255\236\003\255\255\255\255\255\255\ -\255\255\255\255\255\255\092\001\255\255\255\255\255\255\096\001\ -\255\255\207\001\208\001\255\255\153\001\154\001\212\001\255\255\ -\255\255\255\255\216\001\108\001\255\255\255\255\111\001\055\001\ -\255\255\057\001\058\001\059\001\255\255\061\001\255\255\255\255\ -\064\001\065\001\255\255\255\255\177\001\178\001\179\001\180\001\ -\255\255\008\001\255\255\255\255\255\255\186\001\244\001\255\255\ -\004\001\081\001\255\255\255\255\255\255\255\255\255\255\253\001\ -\023\001\089\001\090\001\000\000\044\004\255\255\255\255\030\001\ -\255\255\097\001\207\001\208\001\255\255\025\001\255\255\212\001\ -\014\002\255\255\058\004\216\001\255\255\109\001\110\001\255\255\ -\255\255\255\255\255\255\255\255\026\002\226\001\255\255\255\255\ -\055\001\000\000\057\001\058\001\059\001\255\255\061\001\255\255\ -\255\255\064\001\065\001\255\255\255\255\255\255\255\255\244\001\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\095\004\ -\253\001\255\255\081\001\057\002\255\255\255\255\255\255\255\255\ -\255\255\088\001\089\001\090\001\255\255\255\255\255\255\255\255\ -\255\255\014\002\097\001\255\255\255\255\089\001\090\001\255\255\ -\255\255\093\001\005\000\106\001\096\001\255\255\109\001\110\001\ -\255\255\255\255\255\255\131\004\255\255\255\255\255\255\135\004\ -\255\255\000\001\255\255\255\255\003\001\255\255\114\001\255\255\ -\255\255\255\255\255\255\255\255\255\255\121\001\013\001\123\001\ -\255\255\255\255\255\255\255\255\057\002\255\255\255\255\255\255\ -\255\255\255\255\255\255\026\001\255\255\028\001\029\001\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\132\002\255\255\ -\176\004\040\001\041\001\255\255\255\255\153\001\154\001\255\255\ -\255\255\255\255\255\255\255\255\255\255\147\002\148\002\255\255\ -\255\255\255\255\255\255\255\255\255\255\060\001\255\255\255\255\ -\063\001\255\255\255\255\255\255\067\001\068\001\178\001\179\001\ -\180\001\255\255\255\255\074\001\170\002\255\255\186\001\255\255\ -\255\255\080\001\255\255\255\255\255\255\255\255\255\255\181\002\ -\255\255\255\255\255\255\255\255\255\255\092\001\255\255\132\002\ -\190\002\096\001\192\002\207\001\208\001\255\255\255\255\255\255\ -\212\001\255\255\255\255\255\255\216\001\108\001\147\002\148\002\ -\111\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\140\000\141\000\255\255\143\000\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\153\000\154\000\ -\244\001\255\255\018\005\233\002\255\255\255\255\255\255\255\255\ -\181\002\253\001\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\190\002\255\255\192\002\255\255\176\000\177\000\255\255\ -\255\255\255\255\014\002\000\001\255\255\002\001\003\001\004\001\ -\255\255\255\255\255\255\008\001\255\255\255\255\026\002\255\255\ -\013\001\255\255\255\255\255\255\017\001\018\001\019\001\255\255\ -\255\255\255\255\255\255\255\255\255\255\026\001\027\001\028\001\ -\029\001\000\001\255\255\255\255\233\002\255\255\255\255\036\001\ -\255\255\255\255\255\255\083\005\041\001\057\002\013\001\255\255\ -\255\255\255\255\255\255\048\001\049\001\000\000\094\005\255\255\ -\255\255\255\255\255\255\026\001\255\255\028\001\029\001\060\001\ -\255\255\255\255\063\001\064\001\255\255\066\001\067\001\068\001\ -\255\255\070\001\041\001\255\255\073\001\074\001\255\255\255\255\ -\255\255\079\003\255\255\080\001\255\255\255\255\255\255\255\255\ -\255\255\101\002\255\255\255\255\255\255\060\001\091\001\092\001\ -\136\005\094\001\095\001\096\001\097\001\068\001\142\005\100\001\ -\255\255\255\255\255\255\074\001\255\255\255\255\255\255\108\001\ -\109\001\080\001\111\001\255\255\255\255\255\255\115\001\255\255\ -\132\002\255\255\255\255\076\001\255\255\092\001\079\001\255\255\ -\081\001\096\001\083\001\129\003\255\255\255\255\255\255\147\002\ -\148\002\255\255\079\003\255\255\255\255\108\001\255\255\255\255\ -\111\001\255\255\255\255\255\255\255\255\255\255\255\255\149\003\ -\255\255\255\255\152\003\255\255\154\003\155\003\156\003\112\001\ -\026\000\027\000\160\003\116\001\255\255\255\255\255\255\255\255\ -\166\003\181\002\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\190\002\255\255\192\002\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\129\003\255\255\255\255\189\003\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\149\003\255\255\255\255\152\003\153\003\154\003\155\003\156\003\ -\082\000\083\000\255\255\160\003\255\255\233\002\255\255\000\001\ -\255\255\166\003\255\255\255\255\255\255\006\001\153\001\154\001\ -\255\255\255\255\000\000\012\001\189\001\255\255\191\001\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\189\003\255\255\255\255\028\001\255\255\030\001\031\001\178\001\ -\179\001\180\001\255\255\255\255\255\255\255\255\255\255\186\001\ -\187\001\218\001\255\255\220\001\255\255\255\255\255\255\255\255\ -\255\255\050\001\255\255\052\001\053\001\255\255\055\001\056\001\ -\255\255\255\255\059\001\255\255\207\001\208\001\255\255\064\001\ -\065\001\212\001\255\255\255\255\255\255\216\001\071\001\255\255\ -\052\003\255\255\255\255\255\255\255\255\057\003\044\004\255\255\ -\255\255\255\255\255\255\084\001\255\255\000\001\255\255\255\255\ -\003\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\097\001\244\001\013\001\079\003\101\001\255\255\017\001\255\255\ -\255\255\106\001\253\001\255\255\109\001\110\001\255\255\026\001\ -\027\001\028\001\029\001\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\014\002\255\255\255\255\041\001\255\255\ -\255\255\255\255\255\255\000\000\255\255\255\255\255\255\044\004\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\060\001\255\255\255\255\063\001\129\003\255\255\066\001\ -\067\001\068\001\255\255\255\255\255\255\255\255\073\001\074\001\ -\081\002\255\255\255\255\084\002\255\255\080\001\057\002\255\255\ -\255\255\149\003\255\255\255\255\152\003\255\255\154\003\155\003\ -\156\003\092\001\255\255\094\001\160\003\096\001\255\255\255\255\ -\255\255\255\255\166\003\255\255\255\255\255\255\255\255\255\255\ -\255\255\108\001\255\255\255\255\111\001\255\255\255\255\255\255\ -\115\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\189\003\176\004\255\255\255\255\255\255\255\255\049\001\ -\050\001\051\001\052\001\053\001\054\001\055\001\056\001\057\001\ -\058\001\059\001\060\001\061\001\062\001\063\001\064\001\065\001\ -\066\001\067\001\068\001\069\001\255\255\071\001\255\255\255\255\ -\255\255\132\002\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\172\002\086\001\255\255\000\000\255\255\ -\147\002\148\002\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\099\001\000\001\176\004\002\001\003\001\004\001\255\255\ -\255\255\255\255\008\001\255\003\255\255\255\255\199\002\013\001\ -\255\255\255\255\255\255\017\001\018\001\019\001\255\255\255\255\ -\255\255\255\255\181\002\255\255\026\001\027\001\028\001\029\001\ -\255\255\255\255\255\255\190\002\255\255\192\002\036\001\255\255\ -\255\255\255\255\040\001\041\001\018\005\255\255\255\255\255\255\ -\255\255\255\255\048\001\049\001\255\255\255\255\255\255\255\255\ -\044\004\255\255\255\255\255\255\255\255\255\255\060\001\255\255\ -\255\255\063\001\255\255\255\255\066\001\067\001\068\001\255\255\ -\070\001\255\255\255\255\073\001\074\001\255\255\233\002\255\255\ -\000\000\255\255\080\001\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\091\001\092\001\255\255\ -\094\001\095\001\096\001\255\255\255\255\018\005\100\001\255\255\ -\255\255\255\255\255\255\255\255\255\255\083\005\108\001\255\255\ -\255\255\111\001\255\255\255\255\255\255\115\001\255\255\255\255\ -\094\005\255\255\255\255\000\001\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\008\001\255\255\062\003\255\255\255\255\ -\013\001\235\001\255\255\255\255\255\255\255\255\240\001\255\255\ -\255\255\255\255\255\255\255\255\255\255\026\001\255\255\028\001\ -\029\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\136\005\255\255\041\001\255\255\083\005\053\001\ -\255\255\055\001\255\255\057\001\058\001\059\001\255\255\061\001\ -\255\255\255\255\064\001\065\001\079\003\255\255\111\003\060\001\ -\255\255\255\255\028\002\029\002\176\004\066\001\067\001\068\001\ -\255\255\255\255\255\255\255\255\255\255\074\001\000\000\255\255\ -\255\255\255\255\255\255\080\001\090\001\255\255\255\255\255\255\ -\255\255\255\255\255\255\097\001\255\255\255\255\143\003\092\001\ -\255\255\255\255\255\255\096\001\208\004\063\002\255\255\109\001\ -\110\001\255\255\068\002\069\002\070\002\255\255\129\003\108\001\ -\255\255\255\255\111\001\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\000\001\255\255\ -\002\001\003\001\149\003\180\003\181\003\152\003\008\001\154\003\ -\155\003\156\003\255\255\013\001\255\255\160\003\255\255\017\001\ -\018\001\019\001\255\255\166\003\255\255\255\255\255\255\255\255\ -\026\001\027\001\028\001\029\001\255\255\255\255\255\255\255\255\ -\255\255\255\255\036\001\255\255\255\255\255\255\018\005\041\001\ -\255\255\255\255\189\003\255\255\255\255\255\255\048\001\049\001\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\233\003\255\255\060\001\255\255\255\255\063\001\255\255\255\255\ -\066\001\067\001\068\001\255\255\070\001\159\002\160\002\161\002\ -\074\001\255\255\255\255\252\003\255\255\255\255\080\001\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\000\000\ -\000\001\091\001\092\001\003\001\094\001\095\001\096\001\255\255\ -\255\255\255\255\255\255\023\001\255\255\013\001\255\255\083\005\ -\255\255\017\001\108\001\197\002\255\255\111\001\255\255\255\255\ -\036\001\115\001\026\001\027\001\028\001\029\001\255\255\255\255\ -\255\255\255\255\255\255\213\002\255\255\255\255\255\255\255\255\ -\255\255\041\001\255\255\055\001\255\255\057\001\058\001\059\001\ -\255\255\061\001\255\255\255\255\064\001\065\001\255\255\255\255\ -\255\255\255\255\255\255\255\255\060\001\255\255\255\255\063\001\ -\255\255\044\004\066\001\067\001\068\001\255\255\255\255\255\255\ -\255\255\073\001\074\001\255\255\255\255\255\255\090\001\255\255\ -\080\001\255\255\255\255\000\000\255\255\097\001\255\255\255\255\ -\255\255\255\255\255\255\100\004\092\001\102\004\094\001\255\255\ -\096\001\109\001\110\001\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\108\001\255\255\032\003\111\001\ -\255\255\255\255\255\255\115\001\255\255\255\255\000\001\001\001\ -\002\001\003\001\255\255\255\255\006\001\007\001\008\001\009\001\ -\010\001\011\001\012\001\013\001\014\001\015\001\016\001\017\001\ -\018\001\019\001\020\001\021\001\149\004\255\255\024\001\025\001\ -\026\001\027\001\028\001\029\001\030\001\031\001\255\255\255\255\ -\255\255\255\255\036\001\037\001\255\255\255\255\040\001\041\001\ -\042\001\043\001\044\001\045\001\046\001\047\001\255\255\049\001\ -\050\001\051\001\255\255\053\001\054\001\055\001\056\001\255\255\ -\255\255\059\001\060\001\061\001\255\255\063\001\064\001\065\001\ -\066\001\067\001\068\001\255\255\070\001\071\001\072\001\073\001\ -\074\001\255\255\255\255\255\255\255\255\176\004\080\001\081\001\ -\082\001\083\001\084\001\085\001\086\001\087\001\255\255\089\001\ -\000\000\091\001\092\001\133\003\094\001\095\001\096\001\097\001\ -\098\001\255\255\100\001\101\001\255\255\103\001\104\001\105\001\ -\106\001\255\255\108\001\109\001\255\255\111\001\255\255\255\255\ -\255\255\115\001\255\255\055\001\255\255\057\001\058\001\059\001\ -\255\255\061\001\255\255\255\255\064\001\065\001\255\255\255\255\ -\001\005\255\255\255\255\255\255\255\255\255\255\074\001\000\001\ -\255\255\002\001\003\001\004\001\255\255\081\001\255\255\008\001\ -\255\255\255\255\255\255\255\255\013\001\089\001\090\001\255\255\ -\017\001\018\001\019\001\255\255\255\255\097\001\255\255\255\255\ -\255\255\026\001\027\001\028\001\029\001\038\005\255\255\255\255\ -\255\255\109\001\110\001\036\001\255\255\255\255\255\255\018\005\ -\041\001\255\255\220\003\221\003\222\003\255\255\255\255\048\001\ -\049\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\060\001\255\255\255\255\063\001\072\005\ -\255\255\066\001\067\001\068\001\255\255\070\001\255\255\255\255\ -\073\001\074\001\255\255\255\255\255\255\255\255\087\005\080\001\ -\255\255\023\001\255\255\000\001\255\255\255\255\095\005\255\255\ -\255\255\255\255\091\001\092\001\255\255\094\001\095\001\096\001\ -\013\001\000\000\020\004\021\004\022\004\255\255\255\255\112\005\ -\083\005\255\255\255\255\108\001\255\255\026\001\111\001\028\001\ -\029\001\055\001\115\001\057\001\058\001\059\001\255\255\061\001\ -\255\255\255\255\064\001\065\001\041\001\255\255\255\255\255\255\ -\137\005\138\005\055\001\255\255\057\001\058\001\059\001\057\004\ -\061\001\255\255\147\005\064\001\065\001\255\255\255\255\060\001\ -\255\255\255\255\063\001\255\255\090\001\066\001\067\001\068\001\ -\255\255\162\005\255\255\097\001\081\001\074\001\167\005\168\005\ -\169\005\170\005\255\255\080\001\089\001\090\001\255\255\109\001\ -\110\001\255\255\255\255\255\255\097\001\255\255\255\255\092\001\ -\255\255\255\255\255\255\096\001\255\255\255\255\255\255\108\001\ -\109\001\110\001\255\255\255\255\255\255\255\255\255\255\108\001\ -\255\255\255\255\111\001\255\255\255\255\255\255\255\255\255\255\ -\122\004\123\004\255\255\255\255\255\255\127\004\128\004\129\004\ -\000\001\001\001\002\001\003\001\255\255\000\000\006\001\007\001\ -\008\001\009\001\010\001\011\001\012\001\013\001\014\001\015\001\ -\016\001\017\001\018\001\019\001\020\001\021\001\022\001\255\255\ -\024\001\025\001\026\001\027\001\028\001\029\001\030\001\031\001\ -\255\255\255\255\255\255\255\255\036\001\037\001\255\255\255\255\ -\040\001\041\001\042\001\043\001\044\001\045\001\046\001\047\001\ -\255\255\049\001\050\001\051\001\255\255\053\001\054\001\055\001\ -\056\001\255\255\255\255\059\001\060\001\061\001\062\001\063\001\ -\064\001\065\001\066\001\067\001\068\001\255\255\070\001\071\001\ -\072\001\073\001\074\001\255\255\255\255\255\255\255\255\255\255\ -\080\001\081\001\082\001\083\001\084\001\085\001\086\001\087\001\ -\255\255\089\001\255\255\091\001\092\001\255\255\094\001\095\001\ -\096\001\097\001\098\001\255\255\100\001\101\001\255\255\103\001\ -\104\001\105\001\106\001\255\255\108\001\109\001\255\255\111\001\ -\255\255\255\255\255\255\115\001\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\000\001\001\001\002\001\003\001\255\255\255\255\006\001\ -\007\001\008\001\009\001\010\001\011\001\012\001\013\001\014\001\ -\015\001\016\001\017\001\018\001\019\001\020\001\021\001\022\001\ -\255\255\024\001\025\001\026\001\027\001\028\001\029\001\030\001\ -\031\001\255\255\052\005\053\005\054\005\036\001\037\001\255\255\ -\255\255\040\001\041\001\042\001\043\001\044\001\045\001\046\001\ -\047\001\255\255\049\001\050\001\051\001\255\255\053\001\054\001\ -\055\001\056\001\255\255\255\255\059\001\060\001\061\001\255\255\ -\063\001\064\001\065\001\066\001\067\001\068\001\255\255\070\001\ -\071\001\072\001\073\001\074\001\255\255\255\255\255\255\255\255\ -\255\255\080\001\081\001\082\001\083\001\084\001\085\001\086\001\ -\087\001\255\255\089\001\255\255\091\001\092\001\000\000\094\001\ -\095\001\096\001\097\001\098\001\255\255\100\001\101\001\255\255\ -\103\001\104\001\105\001\106\001\255\255\108\001\109\001\255\255\ -\111\001\255\255\255\255\255\255\115\001\000\001\001\001\002\001\ -\003\001\255\255\255\255\006\001\007\001\008\001\009\001\010\001\ -\011\001\012\001\013\001\014\001\015\001\016\001\017\001\018\001\ -\019\001\020\001\021\001\022\001\255\255\024\001\025\001\026\001\ -\027\001\028\001\029\001\030\001\031\001\255\255\255\255\255\255\ -\255\255\036\001\037\001\255\255\255\255\040\001\041\001\042\001\ -\043\001\044\001\045\001\046\001\047\001\255\255\049\001\050\001\ -\051\001\255\255\053\001\054\001\055\001\056\001\255\255\255\255\ -\059\001\060\001\061\001\255\255\063\001\064\001\065\001\066\001\ -\067\001\068\001\255\255\070\001\071\001\072\001\073\001\074\001\ -\255\255\255\255\255\255\255\255\255\255\080\001\081\001\082\001\ -\083\001\084\001\085\001\086\001\087\001\255\255\089\001\255\255\ -\091\001\092\001\000\000\094\001\095\001\096\001\097\001\098\001\ -\255\255\100\001\101\001\255\255\103\001\104\001\105\001\106\001\ -\255\255\108\001\109\001\255\255\111\001\255\255\255\255\255\255\ -\115\001\000\001\001\001\002\001\003\001\255\255\255\255\006\001\ -\007\001\008\001\009\001\010\001\011\001\012\001\013\001\014\001\ -\015\001\016\001\017\001\018\001\019\001\020\001\021\001\022\001\ -\255\255\024\001\025\001\026\001\027\001\028\001\029\001\030\001\ -\031\001\255\255\255\255\255\255\255\255\036\001\037\001\255\255\ -\255\255\040\001\041\001\042\001\043\001\044\001\045\001\046\001\ -\047\001\255\255\049\001\050\001\051\001\255\255\053\001\054\001\ -\055\001\056\001\255\255\255\255\059\001\060\001\061\001\255\255\ -\063\001\064\001\065\001\066\001\067\001\068\001\255\255\070\001\ -\071\001\072\001\073\001\074\001\255\255\255\255\255\255\255\255\ -\255\255\080\001\081\001\082\001\083\001\084\001\085\001\086\001\ -\087\001\255\255\089\001\255\255\091\001\092\001\000\000\094\001\ -\095\001\096\001\097\001\098\001\255\255\100\001\101\001\255\255\ -\103\001\104\001\105\001\106\001\255\255\108\001\109\001\255\255\ -\111\001\255\255\255\255\255\255\115\001\255\255\000\001\001\001\ -\002\001\003\001\255\255\255\255\006\001\007\001\008\001\009\001\ -\010\001\011\001\012\001\013\001\014\001\015\001\016\001\017\001\ -\018\001\019\001\020\001\021\001\022\001\255\255\024\001\025\001\ -\026\001\027\001\028\001\029\001\030\001\031\001\255\255\255\255\ -\255\255\255\255\036\001\037\001\255\255\255\255\040\001\041\001\ -\042\001\043\001\044\001\045\001\046\001\047\001\255\255\049\001\ -\050\001\051\001\255\255\053\001\054\001\055\001\056\001\255\255\ -\255\255\059\001\060\001\061\001\255\255\063\001\064\001\065\001\ -\066\001\067\001\068\001\255\255\070\001\071\001\072\001\073\001\ -\074\001\255\255\255\255\255\255\255\255\255\255\080\001\081\001\ -\082\001\083\001\084\001\085\001\086\001\087\001\255\255\089\001\ -\255\255\091\001\092\001\000\000\094\001\095\001\096\001\097\001\ -\098\001\255\255\100\001\101\001\255\255\103\001\104\001\105\001\ -\106\001\255\255\108\001\109\001\255\255\111\001\255\255\255\255\ -\255\255\115\001\000\001\001\001\002\001\003\001\255\255\255\255\ -\006\001\007\001\008\001\009\001\010\001\011\001\012\001\013\001\ -\014\001\015\001\016\001\017\001\018\001\019\001\020\001\021\001\ -\022\001\255\255\024\001\025\001\026\001\027\001\028\001\029\001\ -\030\001\031\001\255\255\255\255\255\255\255\255\036\001\037\001\ -\255\255\255\255\040\001\041\001\042\001\043\001\044\001\045\001\ -\046\001\047\001\255\255\049\001\050\001\051\001\255\255\053\001\ -\054\001\055\001\056\001\255\255\255\255\059\001\060\001\061\001\ -\255\255\063\001\064\001\065\001\066\001\067\001\068\001\255\255\ -\070\001\071\001\072\001\073\001\074\001\255\255\255\255\255\255\ -\255\255\255\255\080\001\081\001\082\001\083\001\084\001\085\001\ -\086\001\087\001\255\255\089\001\255\255\091\001\092\001\000\000\ -\094\001\095\001\096\001\097\001\098\001\255\255\100\001\101\001\ -\255\255\103\001\104\001\105\001\106\001\255\255\108\001\109\001\ -\255\255\111\001\255\255\255\255\255\255\115\001\000\001\001\001\ -\002\001\003\001\255\255\255\255\006\001\007\001\008\001\009\001\ -\010\001\011\001\012\001\013\001\014\001\015\001\016\001\017\001\ -\018\001\019\001\020\001\021\001\022\001\255\255\024\001\025\001\ -\026\001\027\001\028\001\029\001\030\001\031\001\255\255\255\255\ -\255\255\255\255\036\001\037\001\255\255\255\255\040\001\041\001\ -\042\001\043\001\044\001\045\001\046\001\047\001\255\255\049\001\ -\050\001\051\001\255\255\053\001\054\001\055\001\056\001\255\255\ -\255\255\059\001\060\001\061\001\255\255\063\001\064\001\065\001\ -\066\001\067\001\068\001\255\255\070\001\071\001\072\001\073\001\ -\074\001\255\255\255\255\255\255\255\255\255\255\080\001\081\001\ -\082\001\083\001\084\001\085\001\086\001\087\001\255\255\089\001\ -\255\255\091\001\092\001\000\000\094\001\095\001\096\001\097\001\ -\098\001\255\255\100\001\101\001\255\255\103\001\104\001\105\001\ -\106\001\255\255\108\001\109\001\255\255\111\001\255\255\255\255\ -\255\255\115\001\255\255\000\001\001\001\002\001\003\001\255\255\ -\255\255\006\001\007\001\008\001\009\001\010\001\011\001\012\001\ -\013\001\014\001\015\001\016\001\017\001\018\001\019\001\020\001\ -\021\001\022\001\255\255\024\001\025\001\026\001\027\001\028\001\ -\029\001\030\001\031\001\255\255\255\255\255\255\255\255\036\001\ -\037\001\255\255\255\255\040\001\041\001\042\001\043\001\044\001\ -\045\001\046\001\047\001\255\255\049\001\050\001\051\001\255\255\ -\053\001\054\001\055\001\056\001\255\255\255\255\059\001\060\001\ -\061\001\255\255\063\001\064\001\065\001\066\001\067\001\068\001\ -\255\255\070\001\071\001\072\001\073\001\074\001\255\255\255\255\ -\255\255\255\255\255\255\080\001\081\001\082\001\083\001\084\001\ -\085\001\086\001\087\001\255\255\089\001\255\255\091\001\092\001\ -\000\000\094\001\095\001\096\001\097\001\098\001\255\255\100\001\ -\101\001\255\255\103\001\104\001\105\001\106\001\255\255\108\001\ -\109\001\255\255\111\001\255\255\255\255\255\255\115\001\000\001\ -\001\001\002\001\003\001\255\255\255\255\006\001\007\001\008\001\ -\009\001\010\001\011\001\012\001\013\001\014\001\015\001\016\001\ -\017\001\018\001\019\001\020\001\021\001\022\001\255\255\024\001\ -\025\001\026\001\027\001\028\001\029\001\030\001\031\001\255\255\ -\255\255\255\255\255\255\036\001\037\001\255\255\255\255\040\001\ -\041\001\042\001\043\001\044\001\045\001\046\001\047\001\255\255\ -\049\001\050\001\051\001\255\255\053\001\054\001\055\001\056\001\ -\255\255\255\255\059\001\060\001\061\001\255\255\063\001\064\001\ -\065\001\066\001\067\001\068\001\255\255\070\001\071\001\072\001\ -\073\001\074\001\255\255\255\255\255\255\255\255\255\255\080\001\ -\081\001\082\001\083\001\084\001\085\001\086\001\087\001\255\255\ -\089\001\255\255\091\001\092\001\000\000\094\001\095\001\096\001\ -\097\001\098\001\255\255\100\001\101\001\255\255\103\001\104\001\ -\105\001\106\001\255\255\108\001\109\001\255\255\111\001\255\255\ -\255\255\255\255\115\001\000\001\001\001\002\001\003\001\255\255\ -\255\255\006\001\007\001\008\001\009\001\010\001\011\001\012\001\ -\013\001\014\001\015\001\016\001\017\001\018\001\019\001\020\001\ -\021\001\022\001\255\255\024\001\025\001\026\001\027\001\028\001\ -\029\001\030\001\031\001\255\255\255\255\255\255\255\255\036\001\ -\037\001\255\255\255\255\040\001\041\001\042\001\043\001\044\001\ -\045\001\046\001\047\001\255\255\049\001\050\001\051\001\255\255\ -\053\001\054\001\055\001\056\001\255\255\255\255\059\001\060\001\ -\061\001\255\255\063\001\064\001\065\001\066\001\067\001\068\001\ -\255\255\070\001\071\001\072\001\073\001\074\001\255\255\255\255\ -\255\255\255\255\255\255\080\001\081\001\082\001\083\001\084\001\ -\085\001\086\001\087\001\255\255\089\001\255\255\091\001\092\001\ -\000\000\094\001\095\001\096\001\097\001\098\001\255\255\100\001\ -\101\001\255\255\103\001\104\001\105\001\106\001\255\255\108\001\ -\109\001\255\255\111\001\255\255\255\255\255\255\115\001\255\255\ -\000\001\001\001\002\001\003\001\255\255\255\255\006\001\007\001\ -\008\001\009\001\010\001\011\001\012\001\013\001\014\001\015\001\ -\016\001\017\001\018\001\019\001\020\001\021\001\255\255\255\255\ -\024\001\025\001\026\001\027\001\028\001\029\001\030\001\031\001\ -\255\255\255\255\255\255\255\255\036\001\037\001\255\255\255\255\ -\040\001\041\001\042\001\043\001\044\001\045\001\046\001\255\255\ -\255\255\049\001\050\001\051\001\255\255\053\001\054\001\055\001\ -\056\001\255\255\255\255\059\001\060\001\061\001\255\255\063\001\ -\064\001\065\001\066\001\067\001\068\001\255\255\070\001\071\001\ -\072\001\073\001\074\001\255\255\255\255\255\255\255\255\255\255\ -\080\001\081\001\082\001\083\001\084\001\085\001\086\001\087\001\ -\255\255\089\001\255\255\091\001\092\001\000\000\094\001\095\001\ -\096\001\097\001\098\001\255\255\100\001\101\001\255\255\103\001\ -\104\001\105\001\106\001\255\255\108\001\109\001\255\255\111\001\ -\255\255\255\255\255\255\115\001\000\001\001\001\002\001\003\001\ -\255\255\255\255\006\001\007\001\008\001\009\001\010\001\011\001\ -\012\001\013\001\014\001\015\001\016\001\017\001\018\001\019\001\ -\020\001\021\001\255\255\255\255\024\001\025\001\026\001\027\001\ -\028\001\029\001\030\001\031\001\255\255\255\255\255\255\255\255\ -\036\001\037\001\255\255\255\255\040\001\041\001\042\001\043\001\ -\044\001\045\001\046\001\255\255\255\255\049\001\050\001\051\001\ -\255\255\053\001\054\001\055\001\056\001\255\255\255\255\059\001\ -\060\001\061\001\255\255\063\001\064\001\065\001\066\001\067\001\ -\068\001\255\255\070\001\071\001\072\001\073\001\074\001\255\255\ -\255\255\255\255\255\255\255\255\080\001\081\001\082\001\083\001\ -\084\001\085\001\086\001\087\001\255\255\089\001\255\255\091\001\ -\092\001\000\000\094\001\095\001\096\001\255\255\255\255\255\255\ -\100\001\101\001\255\255\103\001\104\001\105\001\106\001\255\255\ -\108\001\109\001\255\255\111\001\255\255\255\255\255\255\115\001\ -\000\001\001\001\002\001\003\001\255\255\255\255\006\001\007\001\ -\008\001\009\001\010\001\011\001\012\001\013\001\014\001\015\001\ -\016\001\017\001\018\001\019\001\020\001\021\001\255\255\255\255\ -\024\001\025\001\026\001\027\001\028\001\029\001\030\001\031\001\ -\255\255\255\255\255\255\255\255\036\001\037\001\255\255\255\255\ -\040\001\041\001\042\001\043\001\044\001\045\001\046\001\255\255\ -\255\255\049\001\050\001\051\001\255\255\053\001\054\001\055\001\ -\056\001\255\255\255\255\059\001\060\001\061\001\255\255\063\001\ -\064\001\065\001\066\001\067\001\068\001\255\255\070\001\071\001\ -\072\001\073\001\074\001\255\255\255\255\255\255\255\255\255\255\ -\080\001\081\001\082\001\083\001\084\001\085\001\086\001\087\001\ -\255\255\089\001\255\255\091\001\092\001\000\000\094\001\095\001\ -\096\001\255\255\255\255\255\255\100\001\101\001\255\255\103\001\ -\104\001\105\001\106\001\255\255\108\001\109\001\255\255\111\001\ -\255\255\255\255\255\255\115\001\255\255\000\001\001\001\002\001\ -\003\001\255\255\255\255\006\001\007\001\008\001\009\001\010\001\ -\011\001\012\001\013\001\014\001\015\001\016\001\017\001\018\001\ -\019\001\020\001\021\001\255\255\255\255\024\001\025\001\026\001\ -\027\001\028\001\029\001\030\001\031\001\255\255\255\255\255\255\ -\255\255\036\001\037\001\255\255\255\255\040\001\041\001\042\001\ -\043\001\044\001\045\001\046\001\255\255\255\255\049\001\050\001\ -\051\001\255\255\053\001\054\001\055\001\056\001\255\255\255\255\ -\059\001\060\001\061\001\255\255\063\001\064\001\065\001\066\001\ -\067\001\068\001\255\255\070\001\071\001\072\001\073\001\074\001\ -\255\255\255\255\255\255\255\255\255\255\080\001\081\001\082\001\ -\083\001\084\001\085\001\086\001\087\001\255\255\089\001\255\255\ -\091\001\092\001\000\000\094\001\095\001\096\001\255\255\255\255\ -\255\255\100\001\101\001\255\255\103\001\104\001\105\001\106\001\ -\255\255\108\001\109\001\255\255\111\001\255\255\255\255\255\255\ -\115\001\000\001\001\001\002\001\003\001\255\255\255\255\255\255\ -\255\255\008\001\009\001\010\001\255\255\255\255\013\001\014\001\ -\015\001\016\001\017\001\018\001\019\001\020\001\021\001\022\001\ -\255\255\024\001\025\001\026\001\027\001\028\001\029\001\255\255\ -\255\255\255\255\255\255\255\255\255\255\036\001\037\001\255\255\ -\255\255\040\001\041\001\042\001\043\001\044\001\045\001\046\001\ -\047\001\255\255\049\001\255\255\051\001\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\060\001\061\001\255\255\ -\063\001\255\255\255\255\066\001\067\001\068\001\255\255\070\001\ -\071\001\072\001\073\001\074\001\255\255\255\255\255\255\255\255\ -\255\255\080\001\081\001\082\001\083\001\084\001\085\001\086\001\ -\255\255\255\255\089\001\255\255\091\001\092\001\000\000\094\001\ -\095\001\096\001\097\001\098\001\255\255\100\001\255\255\255\255\ -\103\001\104\001\105\001\255\255\255\255\108\001\255\255\255\255\ -\111\001\255\255\255\255\255\255\115\001\000\001\001\001\002\001\ -\003\001\255\255\255\255\255\255\255\255\008\001\009\001\010\001\ -\255\255\255\255\013\001\014\001\015\001\016\001\017\001\018\001\ -\019\001\020\001\021\001\022\001\255\255\024\001\025\001\026\001\ -\027\001\028\001\029\001\255\255\255\255\255\255\255\255\255\255\ -\255\255\036\001\037\001\255\255\255\255\040\001\041\001\042\001\ -\043\001\044\001\045\001\046\001\047\001\255\255\049\001\255\255\ -\051\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\060\001\061\001\255\255\063\001\255\255\255\255\066\001\ -\067\001\068\001\255\255\070\001\071\001\072\001\073\001\074\001\ -\255\255\255\255\255\255\255\255\255\255\080\001\081\001\082\001\ -\083\001\084\001\085\001\086\001\255\255\255\255\089\001\255\255\ -\091\001\092\001\000\000\094\001\095\001\096\001\097\001\098\001\ -\255\255\100\001\255\255\255\255\103\001\104\001\105\001\255\255\ -\255\255\108\001\255\255\255\255\111\001\255\255\255\255\255\255\ -\115\001\255\255\000\001\001\001\002\001\003\001\255\255\255\255\ -\255\255\255\255\008\001\009\001\010\001\255\255\255\255\013\001\ -\014\001\015\001\016\001\017\001\018\001\019\001\020\001\021\001\ -\255\255\255\255\024\001\025\001\026\001\027\001\028\001\029\001\ -\255\255\255\255\255\255\255\255\255\255\255\255\036\001\037\001\ -\255\255\255\255\040\001\041\001\042\001\043\001\044\001\045\001\ -\046\001\255\255\255\255\049\001\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\060\001\061\001\ -\255\255\063\001\255\255\255\255\066\001\067\001\068\001\255\255\ -\070\001\071\001\072\001\073\001\074\001\255\255\255\255\255\255\ -\255\255\255\255\080\001\255\255\082\001\083\001\084\001\085\001\ -\086\001\255\255\255\255\255\255\255\255\091\001\092\001\000\000\ -\094\001\095\001\096\001\255\255\255\255\255\255\100\001\255\255\ -\255\255\103\001\255\255\105\001\255\255\255\255\108\001\255\255\ -\255\255\111\001\255\255\255\255\255\255\115\001\000\001\001\001\ -\002\001\003\001\255\255\255\255\255\255\255\255\008\001\009\001\ -\010\001\255\255\255\255\013\001\014\001\015\001\016\001\017\001\ -\018\001\019\001\020\001\021\001\255\255\255\255\024\001\025\001\ -\026\001\027\001\028\001\029\001\255\255\255\255\255\255\255\255\ -\255\255\255\255\036\001\037\001\255\255\255\255\040\001\041\001\ -\042\001\043\001\044\001\045\001\046\001\255\255\255\255\049\001\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\060\001\061\001\255\255\063\001\255\255\255\255\ -\066\001\067\001\068\001\255\255\070\001\071\001\072\001\073\001\ -\074\001\255\255\255\255\255\255\255\255\255\255\080\001\255\255\ -\082\001\083\001\084\001\085\001\086\001\255\255\255\255\255\255\ -\255\255\091\001\092\001\000\000\094\001\095\001\096\001\255\255\ -\255\255\255\255\100\001\255\255\255\255\103\001\255\255\105\001\ -\255\255\255\255\108\001\255\255\255\255\111\001\255\255\255\255\ -\255\255\115\001\000\001\001\001\002\001\003\001\255\255\255\255\ -\255\255\255\255\008\001\009\001\010\001\255\255\255\255\013\001\ -\014\001\015\001\016\001\017\001\018\001\019\001\020\001\021\001\ -\255\255\255\255\024\001\025\001\026\001\027\001\028\001\029\001\ -\255\255\255\255\255\255\255\255\255\255\255\255\036\001\037\001\ -\255\255\255\255\040\001\041\001\042\001\043\001\044\001\045\001\ -\046\001\255\255\255\255\049\001\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\060\001\061\001\ -\255\255\063\001\255\255\255\255\066\001\067\001\068\001\255\255\ -\070\001\071\001\072\001\073\001\074\001\255\255\255\255\255\255\ -\255\255\255\255\080\001\255\255\082\001\083\001\084\001\085\001\ -\086\001\255\255\255\255\255\255\255\255\091\001\092\001\000\000\ -\094\001\095\001\096\001\255\255\255\255\255\255\100\001\255\255\ -\255\255\103\001\255\255\105\001\255\255\255\255\108\001\255\255\ -\255\255\111\001\255\255\255\255\255\255\115\001\255\255\000\001\ -\001\001\002\001\003\001\255\255\255\255\255\255\255\255\008\001\ -\009\001\010\001\255\255\255\255\013\001\014\001\015\001\016\001\ -\017\001\018\001\019\001\020\001\021\001\255\255\255\255\024\001\ -\025\001\026\001\027\001\028\001\029\001\255\255\255\255\255\255\ -\255\255\255\255\255\255\036\001\037\001\255\255\255\255\040\001\ -\041\001\042\001\043\001\044\001\045\001\046\001\255\255\255\255\ -\049\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\060\001\061\001\255\255\063\001\255\255\ -\255\255\066\001\067\001\068\001\255\255\070\001\071\001\072\001\ -\073\001\074\001\255\255\255\255\255\255\255\255\255\255\080\001\ -\255\255\082\001\083\001\084\001\085\001\086\001\255\255\255\255\ -\255\255\255\255\091\001\092\001\000\000\094\001\095\001\096\001\ -\255\255\255\255\255\255\100\001\255\255\255\255\103\001\255\255\ -\105\001\255\255\255\255\108\001\255\255\255\255\111\001\255\255\ -\255\255\255\255\115\001\000\001\001\001\002\001\003\001\255\255\ -\255\255\255\255\255\255\008\001\009\001\010\001\255\255\255\255\ -\013\001\014\001\015\001\016\001\017\001\018\001\019\001\020\001\ -\021\001\255\255\255\255\024\001\025\001\026\001\027\001\028\001\ -\029\001\255\255\255\255\255\255\255\255\255\255\255\255\036\001\ -\037\001\255\255\255\255\040\001\041\001\042\001\043\001\044\001\ -\045\001\046\001\255\255\255\255\049\001\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\060\001\ -\061\001\255\255\063\001\255\255\255\255\066\001\067\001\068\001\ -\255\255\070\001\071\001\072\001\073\001\074\001\255\255\255\255\ -\255\255\255\255\255\255\080\001\255\255\082\001\083\001\084\001\ -\085\001\086\001\255\255\255\255\255\255\255\255\091\001\092\001\ -\000\000\094\001\095\001\096\001\255\255\255\255\255\255\100\001\ -\255\255\255\255\103\001\255\255\105\001\255\255\255\255\108\001\ -\255\255\255\255\111\001\255\255\255\255\255\255\115\001\000\001\ -\001\001\002\001\003\001\255\255\255\255\255\255\255\255\008\001\ -\009\001\010\001\255\255\255\255\013\001\014\001\015\001\016\001\ -\017\001\018\001\019\001\020\001\021\001\255\255\255\255\024\001\ -\025\001\026\001\027\001\028\001\029\001\255\255\255\255\255\255\ -\255\255\255\255\255\255\036\001\037\001\255\255\255\255\040\001\ -\041\001\042\001\043\001\044\001\045\001\046\001\255\255\255\255\ -\049\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\060\001\061\001\255\255\063\001\255\255\ -\255\255\066\001\067\001\068\001\255\255\070\001\071\001\072\001\ -\073\001\074\001\255\255\255\255\255\255\255\255\255\255\080\001\ -\255\255\082\001\083\001\084\001\085\001\086\001\255\255\255\255\ -\255\255\255\255\091\001\092\001\000\000\094\001\095\001\096\001\ -\255\255\255\255\255\255\100\001\255\255\255\255\103\001\255\255\ -\105\001\255\255\255\255\108\001\255\255\255\255\111\001\255\255\ -\255\255\255\255\115\001\255\255\000\001\001\001\002\001\003\001\ -\255\255\255\255\255\255\255\255\008\001\009\001\010\001\255\255\ -\255\255\013\001\014\001\015\001\016\001\017\001\255\255\019\001\ -\020\001\021\001\255\255\255\255\024\001\025\001\026\001\027\001\ -\028\001\029\001\255\255\255\255\255\255\255\255\255\255\255\255\ -\036\001\037\001\255\255\255\255\040\001\041\001\042\001\043\001\ -\044\001\045\001\046\001\255\255\255\255\049\001\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\060\001\061\001\255\255\063\001\255\255\255\255\066\001\067\001\ -\068\001\255\255\070\001\071\001\072\001\073\001\074\001\255\255\ -\255\255\255\255\255\255\255\255\080\001\255\255\082\001\083\001\ -\084\001\085\001\086\001\255\255\255\255\255\255\255\255\091\001\ -\092\001\000\000\094\001\095\001\096\001\255\255\255\255\255\255\ -\100\001\255\255\255\255\103\001\255\255\105\001\255\255\255\255\ -\108\001\255\255\255\255\111\001\255\255\255\255\255\255\115\001\ -\000\001\001\001\002\001\003\001\255\255\255\255\255\255\255\255\ -\008\001\009\001\010\001\255\255\255\255\013\001\014\001\015\001\ -\016\001\017\001\018\001\019\001\020\001\021\001\255\255\255\255\ -\024\001\025\001\026\001\027\001\028\001\029\001\255\255\255\255\ -\255\255\255\255\255\255\255\255\036\001\037\001\255\255\255\255\ -\040\001\041\001\042\001\043\001\044\001\045\001\255\255\255\255\ -\255\255\049\001\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\060\001\061\001\255\255\063\001\ -\255\255\255\255\066\001\067\001\068\001\255\255\070\001\071\001\ -\072\001\073\001\074\001\255\255\255\255\255\255\255\255\255\255\ -\080\001\255\255\082\001\083\001\084\001\085\001\086\001\255\255\ -\255\255\255\255\255\255\091\001\092\001\000\000\094\001\095\001\ -\096\001\255\255\255\255\255\255\100\001\255\255\255\255\103\001\ -\255\255\105\001\255\255\255\255\108\001\255\255\255\255\111\001\ -\255\255\255\255\255\255\115\001\000\001\001\001\002\001\003\001\ -\255\255\255\255\255\255\255\255\008\001\009\001\010\001\255\255\ -\255\255\013\001\014\001\015\001\016\001\017\001\018\001\019\001\ -\020\001\021\001\255\255\255\255\024\001\025\001\026\001\027\001\ -\028\001\029\001\255\255\255\255\255\255\255\255\255\255\255\255\ -\036\001\037\001\255\255\255\255\040\001\041\001\042\001\043\001\ -\044\001\045\001\255\255\255\255\255\255\049\001\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\060\001\061\001\255\255\063\001\255\255\255\255\066\001\067\001\ -\068\001\255\255\070\001\071\001\072\001\073\001\074\001\255\255\ -\255\255\255\255\255\255\255\255\080\001\255\255\082\001\083\001\ -\084\001\085\001\086\001\255\255\255\255\255\255\255\255\091\001\ -\092\001\000\000\094\001\095\001\096\001\255\255\255\255\255\255\ -\100\001\255\255\255\255\103\001\255\255\105\001\255\255\255\255\ -\108\001\255\255\255\255\111\001\255\255\255\255\255\255\115\001\ -\255\255\000\001\001\001\002\001\003\001\255\255\255\255\255\255\ -\255\255\008\001\009\001\010\001\255\255\255\255\013\001\014\001\ -\015\001\016\001\017\001\018\001\019\001\020\001\021\001\255\255\ -\255\255\024\001\025\001\026\001\027\001\028\001\029\001\255\255\ -\255\255\255\255\255\255\255\255\255\255\036\001\037\001\255\255\ -\255\255\040\001\041\001\042\001\043\001\044\001\045\001\255\255\ -\255\255\255\255\049\001\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\060\001\061\001\255\255\ -\063\001\255\255\255\255\066\001\067\001\068\001\255\255\070\001\ -\071\001\072\001\073\001\074\001\255\255\255\255\255\255\255\255\ -\255\255\080\001\255\255\082\001\083\001\084\001\085\001\086\001\ -\255\255\255\255\255\255\255\255\091\001\092\001\000\000\094\001\ -\095\001\096\001\255\255\255\255\255\255\100\001\255\255\255\255\ -\103\001\255\255\105\001\255\255\255\255\108\001\255\255\255\255\ -\111\001\255\255\255\255\255\255\115\001\000\001\001\001\002\001\ -\003\001\255\255\255\255\255\255\255\255\008\001\009\001\010\001\ -\255\255\255\255\013\001\014\001\015\001\016\001\017\001\018\001\ -\019\001\020\001\021\001\255\255\255\255\024\001\025\001\026\001\ -\027\001\028\001\029\001\255\255\255\255\255\255\255\255\255\255\ -\255\255\036\001\037\001\255\255\255\255\040\001\041\001\042\001\ -\043\001\044\001\045\001\255\255\255\255\255\255\049\001\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\060\001\061\001\255\255\063\001\255\255\255\255\066\001\ -\067\001\068\001\255\255\070\001\071\001\072\001\073\001\074\001\ -\255\255\255\255\255\255\255\255\255\255\080\001\255\255\082\001\ -\083\001\084\001\085\001\086\001\255\255\255\255\255\255\255\255\ -\091\001\092\001\000\000\094\001\095\001\096\001\255\255\255\255\ -\255\255\100\001\255\255\255\255\103\001\255\255\105\001\255\255\ -\255\255\108\001\255\255\255\255\111\001\255\255\255\255\255\255\ -\115\001\000\001\001\001\002\001\003\001\255\255\255\255\255\255\ -\255\255\255\255\009\001\010\001\255\255\255\255\013\001\014\001\ -\015\001\016\001\017\001\018\001\019\001\020\001\021\001\255\255\ -\255\255\024\001\025\001\026\001\027\001\028\001\029\001\255\255\ -\255\255\255\255\255\255\255\255\255\255\036\001\037\001\255\255\ -\255\255\040\001\041\001\042\001\043\001\044\001\045\001\046\001\ -\255\255\255\255\049\001\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\060\001\061\001\255\255\ -\063\001\255\255\255\255\066\001\067\001\068\001\255\255\070\001\ -\071\001\072\001\073\001\074\001\255\255\255\255\255\255\255\255\ -\255\255\080\001\255\255\082\001\083\001\084\001\085\001\086\001\ -\255\255\255\255\255\255\255\255\091\001\092\001\000\000\094\001\ -\095\001\096\001\255\255\255\255\255\255\100\001\255\255\255\255\ -\103\001\255\255\105\001\255\255\255\255\108\001\255\255\255\255\ -\111\001\255\255\255\255\255\255\115\001\255\255\000\001\001\001\ -\002\001\003\001\255\255\255\255\255\255\255\255\255\255\009\001\ -\010\001\255\255\255\255\013\001\014\001\015\001\016\001\017\001\ -\018\001\019\001\020\001\021\001\255\255\255\255\024\001\025\001\ -\026\001\027\001\028\001\029\001\255\255\255\255\255\255\255\255\ -\255\255\255\255\036\001\037\001\255\255\255\255\040\001\041\001\ -\042\001\043\001\044\001\045\001\046\001\255\255\255\255\049\001\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\060\001\061\001\255\255\063\001\255\255\255\255\ -\066\001\067\001\068\001\255\255\070\001\071\001\072\001\073\001\ -\074\001\255\255\255\255\255\255\255\255\255\255\080\001\255\255\ -\082\001\083\001\084\001\085\001\086\001\255\255\255\255\255\255\ -\255\255\091\001\092\001\000\000\094\001\095\001\096\001\255\255\ -\255\255\255\255\100\001\255\255\255\255\103\001\255\255\105\001\ -\255\255\255\255\108\001\255\255\255\255\111\001\255\255\255\255\ -\255\255\115\001\000\001\001\001\002\001\003\001\255\255\255\255\ -\255\255\255\255\255\255\009\001\010\001\255\255\255\255\013\001\ -\014\001\015\001\016\001\017\001\018\001\019\001\020\001\021\001\ -\255\255\255\255\024\001\025\001\026\001\027\001\028\001\029\001\ -\255\255\255\255\255\255\255\255\255\255\255\255\036\001\037\001\ -\255\255\255\255\040\001\041\001\042\001\043\001\044\001\045\001\ -\046\001\255\255\255\255\049\001\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\060\001\061\001\ -\255\255\063\001\255\255\255\255\066\001\067\001\068\001\255\255\ -\070\001\071\001\072\001\073\001\074\001\255\255\255\255\255\255\ -\255\255\255\255\080\001\255\255\082\001\083\001\084\001\085\001\ -\086\001\255\255\255\255\255\255\255\255\091\001\092\001\000\000\ -\094\001\095\001\096\001\255\255\255\255\255\255\100\001\255\255\ -\255\255\103\001\255\255\105\001\255\255\255\255\108\001\255\255\ -\255\255\111\001\255\255\255\255\255\255\115\001\000\001\001\001\ -\002\001\003\001\255\255\255\255\255\255\255\255\008\001\009\001\ -\010\001\255\255\255\255\013\001\014\001\015\001\016\001\017\001\ -\018\001\019\001\020\001\021\001\255\255\255\255\024\001\025\001\ -\026\001\027\001\028\001\029\001\255\255\255\255\255\255\255\255\ -\255\255\255\255\036\001\037\001\255\255\255\255\040\001\041\001\ -\042\001\043\001\044\001\255\255\255\255\255\255\255\255\049\001\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\060\001\061\001\255\255\063\001\255\255\255\255\ -\066\001\067\001\068\001\255\255\070\001\071\001\072\001\073\001\ -\074\001\255\255\255\255\255\255\255\255\255\255\080\001\255\255\ -\082\001\255\255\084\001\085\001\086\001\255\255\255\255\255\255\ -\255\255\091\001\092\001\000\000\094\001\095\001\096\001\255\255\ -\255\255\255\255\255\255\255\255\255\255\103\001\255\255\105\001\ -\255\255\255\255\108\001\255\255\255\255\111\001\255\255\255\255\ -\255\255\115\001\255\255\000\001\001\001\002\001\003\001\255\255\ -\255\255\255\255\255\255\008\001\009\001\010\001\255\255\255\255\ -\013\001\014\001\015\001\016\001\017\001\018\001\019\001\020\001\ -\021\001\255\255\255\255\024\001\025\001\026\001\027\001\028\001\ -\029\001\255\255\255\255\255\255\255\255\255\255\255\255\036\001\ -\037\001\255\255\255\255\040\001\041\001\042\001\043\001\044\001\ -\255\255\255\255\255\255\255\255\049\001\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\060\001\ -\061\001\255\255\063\001\255\255\255\255\066\001\067\001\068\001\ -\255\255\070\001\071\001\072\001\073\001\074\001\255\255\255\255\ -\255\255\255\255\255\255\080\001\255\255\082\001\255\255\084\001\ -\085\001\086\001\255\255\255\255\255\255\255\255\091\001\092\001\ -\000\000\094\001\095\001\096\001\255\255\255\255\255\255\255\255\ -\255\255\255\255\103\001\255\255\105\001\255\255\255\255\108\001\ -\255\255\255\255\111\001\255\255\255\255\255\255\115\001\000\001\ -\001\001\002\001\003\001\255\255\255\255\255\255\255\255\008\001\ -\009\001\010\001\255\255\255\255\013\001\014\001\015\001\016\001\ -\017\001\018\001\019\001\020\001\021\001\255\255\255\255\024\001\ -\025\001\026\001\027\001\028\001\029\001\255\255\255\255\255\255\ -\255\255\255\255\255\255\036\001\037\001\255\255\255\255\040\001\ -\041\001\042\001\043\001\044\001\255\255\255\255\255\255\255\255\ -\049\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\060\001\061\001\255\255\063\001\255\255\ -\255\255\066\001\067\001\068\001\255\255\070\001\071\001\072\001\ -\073\001\074\001\255\255\255\255\255\255\255\255\255\255\080\001\ -\255\255\082\001\255\255\084\001\085\001\086\001\255\255\255\255\ -\255\255\255\255\091\001\092\001\000\000\094\001\095\001\096\001\ -\255\255\255\255\255\255\255\255\255\255\255\255\103\001\255\255\ -\105\001\255\255\255\255\108\001\255\255\255\255\111\001\255\255\ -\255\255\255\255\115\001\000\001\001\001\002\001\003\001\255\255\ -\255\255\255\255\255\255\008\001\009\001\010\001\255\255\255\255\ -\013\001\014\001\015\001\016\001\017\001\018\001\019\001\020\001\ -\021\001\255\255\255\255\024\001\025\001\026\001\027\001\028\001\ -\029\001\255\255\255\255\255\255\255\255\255\255\255\255\036\001\ -\037\001\255\255\255\255\040\001\041\001\042\001\043\001\044\001\ -\255\255\255\255\255\255\255\255\049\001\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\060\001\ -\061\001\255\255\063\001\255\255\255\255\066\001\067\001\068\001\ -\255\255\070\001\071\001\072\001\073\001\074\001\255\255\255\255\ -\255\255\255\255\255\255\080\001\255\255\082\001\255\255\084\001\ -\085\001\086\001\255\255\255\255\255\255\255\255\091\001\092\001\ -\000\000\094\001\095\001\096\001\255\255\255\255\255\255\255\255\ -\255\255\255\255\103\001\255\255\105\001\255\255\255\255\108\001\ -\255\255\255\255\111\001\255\255\255\255\255\255\115\001\255\255\ -\000\001\001\001\002\001\003\001\255\255\255\255\255\255\255\255\ -\008\001\009\001\010\001\255\255\255\255\013\001\014\001\015\001\ -\016\001\017\001\018\001\019\001\020\001\021\001\255\255\255\255\ -\024\001\025\001\026\001\027\001\028\001\029\001\255\255\255\255\ -\255\255\255\255\255\255\255\255\036\001\037\001\255\255\255\255\ -\040\001\041\001\042\001\043\001\044\001\255\255\255\255\255\255\ -\255\255\049\001\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\060\001\061\001\255\255\063\001\ -\255\255\255\255\066\001\067\001\068\001\255\255\070\001\071\001\ -\072\001\073\001\074\001\255\255\255\255\255\255\255\255\255\255\ -\080\001\255\255\082\001\255\255\084\001\085\001\086\001\255\255\ -\255\255\255\255\255\255\091\001\092\001\000\000\094\001\095\001\ -\096\001\255\255\255\255\255\255\255\255\255\255\255\255\103\001\ -\255\255\105\001\255\255\255\255\108\001\255\255\255\255\111\001\ -\255\255\255\255\255\255\115\001\000\001\001\001\002\001\003\001\ -\255\255\255\255\255\255\255\255\008\001\009\001\010\001\255\255\ -\255\255\013\001\014\001\015\001\016\001\017\001\018\001\019\001\ -\020\001\021\001\255\255\255\255\024\001\025\001\026\001\027\001\ -\028\001\029\001\255\255\255\255\255\255\255\255\255\255\255\255\ -\036\001\037\001\255\255\255\255\040\001\041\001\042\001\043\001\ -\044\001\255\255\255\255\255\255\255\255\049\001\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\060\001\061\001\255\255\063\001\255\255\255\255\066\001\067\001\ -\068\001\255\255\070\001\071\001\072\001\073\001\074\001\255\255\ -\255\255\255\255\255\255\255\255\080\001\255\255\082\001\255\255\ -\084\001\085\001\086\001\255\255\255\255\255\255\255\255\091\001\ -\092\001\000\000\094\001\095\001\096\001\255\255\255\255\255\255\ -\255\255\255\255\255\255\103\001\255\255\105\001\255\255\255\255\ -\108\001\255\255\255\255\111\001\255\255\255\255\255\255\115\001\ -\000\001\001\001\002\001\003\001\255\255\255\255\255\255\255\255\ -\008\001\009\001\010\001\255\255\255\255\013\001\014\001\015\001\ -\016\001\017\001\018\001\019\001\020\001\021\001\255\255\255\255\ -\024\001\025\001\026\001\027\001\028\001\029\001\255\255\255\255\ -\255\255\255\255\255\255\255\255\036\001\037\001\255\255\255\255\ -\040\001\041\001\042\001\043\001\044\001\045\001\046\001\255\255\ -\255\255\049\001\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\060\001\061\001\255\255\255\255\ -\255\255\255\255\066\001\067\001\068\001\255\255\070\001\255\255\ -\255\255\073\001\074\001\255\255\255\255\255\255\255\255\255\255\ -\080\001\255\255\082\001\255\255\255\255\255\255\086\001\255\255\ -\255\255\255\255\255\255\091\001\092\001\000\000\094\001\095\001\ -\096\001\255\255\255\255\255\255\100\001\255\255\255\255\103\001\ -\255\255\105\001\255\255\255\255\108\001\255\255\255\255\111\001\ -\255\255\255\255\255\255\115\001\255\255\000\001\001\001\002\001\ -\003\001\255\255\255\255\255\255\255\255\008\001\009\001\010\001\ -\255\255\255\255\013\001\014\001\255\255\016\001\017\001\018\001\ -\019\001\020\001\021\001\255\255\255\255\024\001\025\001\026\001\ -\027\001\028\001\029\001\255\255\255\255\255\255\255\255\255\255\ -\255\255\036\001\037\001\255\255\255\255\040\001\041\001\042\001\ -\043\001\255\255\255\255\255\255\255\255\255\255\049\001\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\060\001\061\001\255\255\063\001\255\255\255\255\066\001\ -\067\001\068\001\255\255\070\001\255\255\255\255\073\001\074\001\ -\255\255\255\255\255\255\255\255\255\255\080\001\255\255\082\001\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\091\001\092\001\000\000\094\001\095\001\096\001\255\255\255\255\ -\255\255\255\255\255\255\255\255\103\001\255\255\105\001\255\255\ -\255\255\108\001\255\255\255\255\111\001\255\255\255\255\255\255\ -\115\001\000\001\001\001\002\001\003\001\255\255\255\255\255\255\ -\255\255\008\001\009\001\010\001\255\255\255\255\013\001\014\001\ -\255\255\016\001\017\001\018\001\019\001\020\001\021\001\255\255\ -\255\255\024\001\025\001\026\001\027\001\028\001\029\001\255\255\ -\255\255\255\255\255\255\255\255\255\255\036\001\037\001\255\255\ -\255\255\040\001\041\001\042\001\255\255\255\255\255\255\255\255\ -\255\255\255\255\049\001\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\060\001\061\001\255\255\ -\063\001\255\255\255\255\255\255\067\001\068\001\255\255\070\001\ -\255\255\255\255\073\001\074\001\255\255\255\255\255\255\255\255\ -\255\255\080\001\255\255\082\001\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\091\001\092\001\000\000\094\001\ -\095\001\096\001\255\255\255\255\255\255\255\255\255\255\255\255\ -\103\001\255\255\105\001\255\255\255\255\108\001\255\255\255\255\ -\111\001\255\255\255\255\255\255\115\001\000\001\001\001\002\001\ -\003\001\255\255\255\255\255\255\255\255\008\001\009\001\010\001\ -\255\255\255\255\013\001\014\001\255\255\016\001\017\001\018\001\ -\019\001\020\001\021\001\255\255\255\255\024\001\025\001\026\001\ -\027\001\028\001\029\001\255\255\255\255\255\255\255\255\255\255\ -\255\255\036\001\037\001\255\255\255\255\040\001\041\001\042\001\ -\255\255\255\255\255\255\255\255\255\255\255\255\049\001\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\060\001\061\001\255\255\063\001\255\255\255\255\255\255\ -\067\001\068\001\255\255\070\001\255\255\255\255\073\001\074\001\ -\255\255\255\255\255\255\255\255\255\255\080\001\255\255\082\001\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\091\001\092\001\000\000\094\001\095\001\096\001\255\255\255\255\ -\255\255\255\255\255\255\255\255\103\001\255\255\105\001\255\255\ -\255\255\108\001\255\255\255\255\111\001\255\255\255\255\255\255\ -\115\001\255\255\000\001\001\001\002\001\003\001\255\255\255\255\ -\255\255\255\255\008\001\009\001\010\001\255\255\255\255\013\001\ -\014\001\255\255\016\001\017\001\018\001\019\001\020\001\021\001\ -\255\255\255\255\024\001\025\001\026\001\027\001\028\001\029\001\ -\255\255\255\255\255\255\255\255\255\255\255\255\036\001\037\001\ -\255\255\255\255\040\001\041\001\042\001\255\255\255\255\255\255\ -\255\255\255\255\255\255\049\001\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\060\001\061\001\ -\255\255\063\001\255\255\255\255\255\255\067\001\068\001\255\255\ -\070\001\255\255\255\255\073\001\074\001\255\255\255\255\255\255\ -\255\255\255\255\080\001\255\255\082\001\255\255\255\255\000\000\ -\255\255\255\255\255\255\255\255\255\255\091\001\092\001\255\255\ -\094\001\095\001\096\001\255\255\255\255\255\255\255\255\255\255\ -\255\255\103\001\255\255\105\001\255\255\255\255\108\001\255\255\ -\255\255\111\001\255\255\255\255\255\255\115\001\000\001\001\001\ -\002\001\003\001\255\255\255\255\255\255\255\255\008\001\009\001\ -\010\001\255\255\255\255\013\001\014\001\255\255\016\001\017\001\ -\018\001\019\001\020\001\021\001\255\255\255\255\024\001\025\001\ -\026\001\027\001\028\001\029\001\255\255\255\255\255\255\255\255\ -\255\255\255\255\036\001\037\001\255\255\255\255\040\001\041\001\ -\042\001\255\255\255\255\255\255\255\255\255\255\255\255\049\001\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\060\001\061\001\255\255\063\001\255\255\255\255\ -\255\255\067\001\068\001\255\255\070\001\255\255\255\255\073\001\ -\074\001\255\255\255\255\255\255\000\000\255\255\080\001\255\255\ -\082\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\091\001\092\001\255\255\094\001\095\001\096\001\255\255\ -\255\255\255\255\255\255\255\255\255\255\103\001\255\255\105\001\ -\255\255\255\255\108\001\255\255\255\255\111\001\255\255\255\255\ -\255\255\115\001\000\001\001\001\002\001\003\001\255\255\255\255\ -\255\255\255\255\008\001\009\001\010\001\255\255\255\255\013\001\ -\014\001\255\255\016\001\017\001\018\001\019\001\020\001\021\001\ -\255\255\255\255\024\001\025\001\026\001\027\001\028\001\029\001\ -\255\255\255\255\255\255\255\255\255\255\255\255\036\001\037\001\ -\255\255\255\255\040\001\041\001\042\001\255\255\255\255\255\255\ -\255\255\255\255\255\255\049\001\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\060\001\061\001\ -\255\255\063\001\255\255\255\255\000\000\067\001\068\001\255\255\ -\070\001\255\255\255\255\073\001\074\001\255\255\255\255\255\255\ -\255\255\255\255\080\001\255\255\082\001\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\091\001\092\001\255\255\ -\094\001\095\001\096\001\255\255\255\255\255\255\255\255\255\255\ -\255\255\103\001\255\255\105\001\255\255\255\255\108\001\000\001\ -\255\255\111\001\003\001\255\255\255\255\115\001\255\255\008\001\ -\009\001\010\001\255\255\255\255\013\001\014\001\255\255\016\001\ -\017\001\018\001\019\001\020\001\021\001\255\255\255\255\024\001\ -\025\001\026\001\255\255\028\001\029\001\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\037\001\255\255\255\255\040\001\ -\041\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\049\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\060\001\000\000\255\255\063\001\255\255\ -\255\255\255\255\067\001\068\001\255\255\070\001\255\255\255\255\ -\073\001\074\001\255\255\255\255\255\255\255\255\255\255\080\001\ -\255\255\082\001\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\091\001\092\001\255\255\094\001\095\001\096\001\ -\255\255\255\255\255\255\255\255\255\255\255\255\103\001\255\255\ -\105\001\255\255\255\255\108\001\000\001\255\255\111\001\003\001\ -\255\255\255\255\115\001\255\255\008\001\009\001\010\001\255\255\ -\255\255\013\001\014\001\255\255\016\001\017\001\018\001\019\001\ -\020\001\021\001\255\255\255\255\024\001\025\001\026\001\255\255\ -\028\001\029\001\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\037\001\255\255\255\255\040\001\041\001\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\049\001\255\255\255\255\ -\255\255\255\255\255\255\255\255\000\000\255\255\255\255\255\255\ -\060\001\255\255\255\255\063\001\255\255\255\255\255\255\067\001\ -\068\001\255\255\070\001\255\255\255\255\073\001\074\001\255\255\ -\255\255\255\255\255\255\255\255\080\001\255\255\082\001\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\091\001\ -\092\001\255\255\094\001\095\001\096\001\255\255\255\255\255\255\ -\255\255\255\255\255\255\103\001\000\001\105\001\255\255\003\001\ -\108\001\255\255\255\255\111\001\008\001\255\255\010\001\115\001\ -\255\255\013\001\014\001\255\255\016\001\017\001\018\001\019\001\ -\020\001\021\001\255\255\255\255\024\001\025\001\026\001\255\255\ -\028\001\029\001\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\037\001\255\255\255\255\040\001\041\001\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\049\001\255\255\255\255\ -\255\255\255\255\255\255\255\255\000\000\255\255\255\255\255\255\ -\060\001\255\255\255\255\063\001\255\255\255\255\255\255\067\001\ -\068\001\255\255\070\001\255\255\255\255\073\001\074\001\255\255\ -\255\255\255\255\255\255\255\255\080\001\255\255\255\255\255\255\ -\255\255\255\255\000\000\255\255\255\255\255\255\255\255\091\001\ -\092\001\255\255\094\001\095\001\096\001\255\255\255\255\255\255\ -\255\255\255\255\255\255\103\001\000\001\105\001\255\255\003\001\ -\108\001\255\255\255\255\111\001\008\001\255\255\010\001\115\001\ -\255\255\013\001\014\001\255\255\016\001\017\001\018\001\019\001\ -\020\001\021\001\255\255\255\255\024\001\025\001\026\001\255\255\ -\028\001\029\001\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\037\001\255\255\255\255\040\001\041\001\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\049\001\255\255\000\000\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\060\001\255\255\255\255\063\001\255\255\255\255\255\255\067\001\ -\068\001\255\255\070\001\255\255\255\255\073\001\074\001\255\255\ -\255\255\255\255\255\255\255\255\080\001\000\000\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\091\001\ -\092\001\255\255\094\001\095\001\096\001\255\255\255\255\255\255\ -\255\255\255\255\255\255\103\001\000\001\105\001\255\255\003\001\ -\108\001\255\255\255\255\111\001\008\001\255\255\010\001\115\001\ -\255\255\013\001\014\001\255\255\016\001\017\001\018\001\019\001\ -\020\001\021\001\255\255\255\255\024\001\025\001\026\001\255\255\ -\028\001\029\001\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\037\001\255\255\255\255\040\001\041\001\255\255\255\255\ -\255\255\255\255\000\000\255\255\255\255\049\001\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\060\001\255\255\255\255\063\001\255\255\255\255\255\255\067\001\ -\068\001\255\255\070\001\255\255\255\255\073\001\074\001\255\255\ -\255\255\255\255\255\255\255\255\080\001\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\091\001\ -\092\001\255\255\094\001\095\001\096\001\255\255\255\255\255\255\ -\255\255\255\255\255\255\103\001\000\001\105\001\255\255\003\001\ -\108\001\255\255\255\255\111\001\008\001\255\255\010\001\115\001\ -\255\255\013\001\014\001\255\255\016\001\017\001\018\001\019\001\ -\020\001\021\001\255\255\255\255\024\001\025\001\026\001\255\255\ -\028\001\029\001\000\001\255\255\255\255\255\255\255\255\255\255\ -\255\255\037\001\008\001\255\255\040\001\041\001\255\255\013\001\ -\255\255\255\255\000\000\255\255\255\255\049\001\255\255\255\255\ -\255\255\255\255\255\255\255\255\026\001\255\255\028\001\029\001\ -\060\001\255\255\255\255\063\001\255\255\255\255\255\255\067\001\ -\068\001\255\255\070\001\041\001\255\255\073\001\074\001\255\255\ -\000\000\255\255\255\255\255\255\080\001\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\060\001\091\001\ -\092\001\063\001\094\001\095\001\096\001\067\001\068\001\000\001\ -\255\255\255\255\003\001\103\001\074\001\105\001\255\255\008\001\ -\108\001\010\001\080\001\111\001\013\001\014\001\255\255\115\001\ -\017\001\255\255\019\001\020\001\021\001\255\255\092\001\024\001\ -\025\001\026\001\096\001\028\001\029\001\000\001\255\255\255\255\ -\255\255\255\255\255\255\255\255\037\001\255\255\108\001\040\001\ -\041\001\111\001\013\001\255\255\255\255\000\000\255\255\255\255\ -\049\001\255\255\255\255\255\255\255\255\255\255\255\255\026\001\ -\255\255\028\001\029\001\060\001\255\255\255\255\063\001\255\255\ -\255\255\255\255\067\001\068\001\255\255\070\001\041\001\255\255\ -\073\001\074\001\255\255\000\000\255\255\255\255\255\255\080\001\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\060\001\091\001\092\001\063\001\094\001\095\001\096\001\ -\067\001\068\001\000\001\255\255\255\255\003\001\103\001\074\001\ -\105\001\255\255\008\001\108\001\010\001\080\001\111\001\013\001\ -\014\001\255\255\115\001\017\001\255\255\019\001\020\001\021\001\ -\255\255\092\001\024\001\025\001\026\001\096\001\028\001\029\001\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\037\001\ -\255\255\108\001\040\001\041\001\111\001\255\255\255\255\255\255\ -\000\000\255\255\255\255\049\001\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\060\001\255\255\ -\255\255\063\001\255\255\255\255\255\255\067\001\068\001\255\255\ -\070\001\255\255\255\255\073\001\074\001\255\255\255\255\255\255\ -\255\255\255\255\080\001\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\091\001\092\001\255\255\ -\094\001\095\001\096\001\255\255\255\255\255\255\255\255\255\255\ -\255\255\103\001\000\001\105\001\255\255\003\001\108\001\255\255\ -\255\255\111\001\008\001\255\255\010\001\115\001\255\255\013\001\ -\014\001\255\255\255\255\017\001\255\255\019\001\020\001\021\001\ -\255\255\255\255\024\001\025\001\026\001\255\255\028\001\029\001\ -\000\001\255\255\255\255\255\255\255\255\255\255\255\255\037\001\ -\255\255\255\255\040\001\041\001\255\255\013\001\255\255\255\255\ -\000\000\255\255\255\255\049\001\255\255\255\255\255\255\255\255\ -\255\255\255\255\026\001\255\255\028\001\029\001\060\001\255\255\ -\255\255\063\001\255\255\255\255\255\255\067\001\068\001\255\255\ -\070\001\041\001\255\255\073\001\074\001\255\255\000\000\255\255\ -\255\255\255\255\080\001\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\060\001\091\001\092\001\063\001\ -\094\001\095\001\096\001\067\001\068\001\000\001\255\255\255\255\ -\003\001\103\001\074\001\105\001\255\255\008\001\108\001\010\001\ -\080\001\111\001\013\001\014\001\255\255\115\001\017\001\255\255\ -\019\001\020\001\021\001\255\255\092\001\024\001\025\001\026\001\ -\096\001\028\001\029\001\000\001\255\255\255\255\003\001\255\255\ -\255\255\255\255\037\001\255\255\108\001\040\001\041\001\111\001\ -\013\001\255\255\255\255\000\000\255\255\255\255\049\001\255\255\ -\255\255\255\255\255\255\255\255\255\255\026\001\255\255\028\001\ -\029\001\060\001\255\255\255\255\063\001\255\255\255\255\255\255\ -\067\001\068\001\255\255\070\001\041\001\255\255\073\001\074\001\ -\255\255\000\000\255\255\255\255\255\255\080\001\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\060\001\ -\091\001\092\001\063\001\094\001\095\001\096\001\255\255\068\001\ -\000\001\255\255\255\255\003\001\103\001\074\001\105\001\255\255\ -\008\001\108\001\010\001\080\001\111\001\013\001\014\001\255\255\ -\115\001\017\001\255\255\019\001\020\001\021\001\255\255\092\001\ -\024\001\025\001\026\001\096\001\028\001\029\001\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\037\001\255\255\108\001\ -\040\001\041\001\111\001\255\255\255\255\255\255\000\000\255\255\ -\255\255\049\001\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\060\001\255\255\255\255\063\001\ -\255\255\255\255\255\255\067\001\068\001\255\255\070\001\255\255\ -\255\255\073\001\074\001\255\255\255\255\255\255\255\255\255\255\ -\080\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\091\001\092\001\255\255\094\001\095\001\ -\096\001\255\255\255\255\255\255\255\255\255\255\255\255\103\001\ -\000\001\105\001\255\255\003\001\108\001\255\255\255\255\111\001\ -\008\001\255\255\010\001\115\001\255\255\013\001\014\001\255\255\ -\255\255\017\001\255\255\019\001\020\001\021\001\255\255\255\255\ -\024\001\025\001\026\001\255\255\028\001\029\001\000\001\255\255\ -\255\255\255\255\255\255\255\255\255\255\037\001\255\255\255\255\ -\040\001\041\001\255\255\013\001\255\255\255\255\000\000\255\255\ -\255\255\049\001\255\255\255\255\255\255\255\255\255\255\255\255\ -\026\001\255\255\028\001\029\001\060\001\255\255\255\255\063\001\ -\255\255\255\255\255\255\067\001\068\001\255\255\070\001\041\001\ -\255\255\073\001\074\001\255\255\000\000\255\255\255\255\255\255\ -\080\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\060\001\091\001\092\001\063\001\094\001\095\001\ -\096\001\067\001\068\001\000\001\255\255\255\255\003\001\103\001\ -\074\001\105\001\255\255\008\001\108\001\010\001\080\001\111\001\ -\013\001\014\001\255\255\115\001\017\001\255\255\019\001\020\001\ -\021\001\255\255\092\001\024\001\025\001\026\001\096\001\028\001\ -\029\001\000\001\255\255\255\255\255\255\255\255\255\255\255\255\ -\037\001\255\255\108\001\040\001\041\001\111\001\013\001\255\255\ -\255\255\000\000\255\255\255\255\049\001\255\255\255\255\255\255\ -\255\255\255\255\255\255\026\001\255\255\028\001\029\001\060\001\ -\255\255\255\255\063\001\255\255\255\255\255\255\067\001\068\001\ -\255\255\070\001\041\001\255\255\073\001\074\001\255\255\000\000\ -\255\255\255\255\255\255\080\001\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\060\001\091\001\092\001\ -\063\001\094\001\095\001\096\001\067\001\068\001\000\001\255\255\ -\255\255\003\001\103\001\074\001\105\001\255\255\008\001\108\001\ -\010\001\080\001\111\001\013\001\014\001\255\255\115\001\017\001\ -\255\255\019\001\020\001\021\001\255\255\092\001\024\001\025\001\ -\026\001\096\001\028\001\029\001\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\037\001\255\255\108\001\040\001\041\001\ -\111\001\255\255\255\255\255\255\000\000\255\255\255\255\049\001\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\060\001\255\255\255\255\063\001\255\255\255\255\ -\255\255\067\001\068\001\255\255\070\001\255\255\255\255\073\001\ -\074\001\255\255\255\255\255\255\255\255\255\255\080\001\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\091\001\092\001\255\255\094\001\095\001\096\001\255\255\ -\255\255\255\255\255\255\255\255\255\255\103\001\000\001\105\001\ -\255\255\003\001\108\001\255\255\255\255\111\001\008\001\255\255\ -\010\001\115\001\255\255\013\001\014\001\255\255\255\255\017\001\ -\255\255\019\001\020\001\021\001\255\255\255\255\024\001\025\001\ -\026\001\255\255\028\001\029\001\000\001\255\255\255\255\255\255\ -\255\255\255\255\255\255\037\001\255\255\255\255\040\001\041\001\ -\255\255\013\001\255\255\255\255\000\000\255\255\255\255\049\001\ -\255\255\255\255\255\255\255\255\255\255\255\255\026\001\255\255\ -\028\001\029\001\060\001\255\255\255\255\063\001\255\255\255\255\ -\255\255\067\001\068\001\255\255\070\001\041\001\255\255\073\001\ -\074\001\255\255\000\000\255\255\255\255\255\255\080\001\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\060\001\091\001\092\001\063\001\094\001\095\001\096\001\255\255\ -\068\001\000\001\255\255\255\255\003\001\103\001\074\001\105\001\ -\255\255\008\001\108\001\010\001\080\001\111\001\013\001\014\001\ -\255\255\115\001\017\001\255\255\019\001\020\001\021\001\255\255\ -\092\001\024\001\025\001\026\001\096\001\028\001\029\001\000\001\ -\255\255\255\255\255\255\255\255\255\255\255\255\037\001\255\255\ -\108\001\040\001\041\001\111\001\013\001\255\255\255\255\000\000\ -\255\255\255\255\049\001\255\255\255\255\255\255\255\255\255\255\ -\255\255\026\001\255\255\028\001\029\001\060\001\255\255\255\255\ -\063\001\255\255\255\255\255\255\067\001\068\001\255\255\070\001\ -\041\001\255\255\073\001\074\001\255\255\255\255\255\255\255\255\ -\255\255\080\001\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\060\001\091\001\092\001\063\001\094\001\ -\095\001\096\001\255\255\068\001\000\001\255\255\255\255\003\001\ -\103\001\074\001\105\001\255\255\008\001\108\001\010\001\080\001\ -\111\001\013\001\014\001\255\255\115\001\017\001\255\255\019\001\ -\020\001\021\001\255\255\092\001\024\001\025\001\026\001\096\001\ -\028\001\029\001\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\037\001\255\255\108\001\040\001\041\001\111\001\255\255\ -\255\255\255\255\255\255\255\255\255\255\049\001\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\000\000\255\255\255\255\ -\060\001\255\255\255\255\063\001\255\255\255\255\255\255\067\001\ -\068\001\255\255\070\001\255\255\255\255\073\001\074\001\255\255\ -\255\255\255\255\255\255\255\255\080\001\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\091\001\ -\092\001\255\255\094\001\095\001\096\001\255\255\255\255\255\255\ -\255\255\255\255\255\255\103\001\000\001\105\001\255\255\003\001\ -\108\001\255\255\255\255\111\001\008\001\255\255\010\001\115\001\ -\255\255\013\001\014\001\255\255\255\255\017\001\255\255\019\001\ -\020\001\021\001\255\255\255\255\024\001\025\001\026\001\255\255\ -\028\001\029\001\000\001\255\255\255\255\255\255\255\255\255\255\ -\255\255\037\001\255\255\255\255\040\001\041\001\255\255\013\001\ -\255\255\255\255\255\255\255\255\255\255\049\001\255\255\255\255\ -\000\000\255\255\255\255\255\255\026\001\255\255\028\001\029\001\ -\060\001\255\255\255\255\063\001\255\255\255\255\255\255\067\001\ -\068\001\255\255\070\001\041\001\255\255\073\001\074\001\255\255\ -\255\255\255\255\255\255\255\255\080\001\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\060\001\091\001\ -\092\001\063\001\094\001\095\001\096\001\255\255\068\001\000\001\ -\255\255\255\255\003\001\103\001\074\001\105\001\255\255\008\001\ -\108\001\010\001\080\001\111\001\013\001\014\001\255\255\115\001\ -\017\001\255\255\019\001\020\001\021\001\255\255\092\001\024\001\ -\025\001\026\001\096\001\028\001\029\001\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\037\001\255\255\108\001\040\001\ -\041\001\111\001\255\255\255\255\255\255\255\255\255\255\255\255\ -\049\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\060\001\255\255\255\255\063\001\255\255\ -\255\255\255\255\067\001\068\001\000\000\070\001\255\255\255\255\ -\073\001\074\001\255\255\255\255\255\255\255\255\255\255\080\001\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\091\001\092\001\255\255\094\001\255\255\096\001\ -\255\255\255\255\255\255\255\255\255\255\255\255\103\001\255\255\ -\105\001\255\255\255\255\108\001\255\255\000\001\111\001\002\001\ -\003\001\004\001\115\001\255\255\255\255\008\001\255\255\255\255\ -\255\255\255\255\013\001\255\255\255\255\255\255\017\001\018\001\ -\019\001\255\255\255\255\255\255\255\255\255\255\255\255\026\001\ -\027\001\028\001\029\001\255\255\255\255\255\255\255\255\255\255\ -\255\255\036\001\255\255\255\255\255\255\040\001\041\001\255\255\ -\255\255\255\255\255\255\255\255\255\255\048\001\049\001\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\000\000\ -\255\255\060\001\255\255\255\255\063\001\255\255\255\255\066\001\ -\067\001\068\001\255\255\070\001\255\255\255\255\073\001\074\001\ -\255\255\255\255\255\255\255\255\255\255\080\001\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\091\001\092\001\255\255\094\001\095\001\096\001\255\255\255\255\ -\000\001\100\001\255\255\003\001\255\255\255\255\255\255\255\255\ -\008\001\108\001\010\001\255\255\111\001\013\001\014\001\255\255\ -\115\001\017\001\255\255\019\001\020\001\021\001\255\255\255\255\ -\024\001\255\255\026\001\255\255\028\001\029\001\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\037\001\255\255\255\255\ -\040\001\041\001\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\049\001\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\000\000\255\255\060\001\255\255\255\255\063\001\ -\255\255\255\255\255\255\067\001\068\001\255\255\070\001\255\255\ -\255\255\073\001\074\001\255\255\255\255\255\255\255\255\255\255\ -\080\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\091\001\092\001\255\255\094\001\095\001\ -\096\001\255\255\255\255\255\255\255\255\255\255\255\255\103\001\ -\255\255\105\001\255\255\255\255\108\001\255\255\255\255\111\001\ -\255\255\255\255\255\255\115\001\000\001\255\255\002\001\003\001\ -\004\001\255\255\255\255\255\255\008\001\255\255\255\255\255\255\ -\255\255\013\001\255\255\255\255\255\255\017\001\018\001\019\001\ -\255\255\255\255\255\255\255\255\255\255\255\255\026\001\027\001\ -\028\001\029\001\255\255\255\255\008\001\255\255\255\255\255\255\ -\036\001\255\255\255\255\255\255\255\255\041\001\255\255\000\000\ -\255\255\255\255\255\255\023\001\048\001\049\001\255\255\255\255\ -\255\255\255\255\030\001\255\255\255\255\255\255\255\255\255\255\ -\060\001\255\255\255\255\063\001\255\255\255\255\066\001\067\001\ -\068\001\255\255\070\001\255\255\255\255\073\001\074\001\255\255\ -\255\255\255\255\255\255\055\001\080\001\057\001\058\001\059\001\ -\255\255\061\001\255\255\255\255\064\001\065\001\255\255\091\001\ -\092\001\255\255\094\001\095\001\096\001\255\255\255\255\000\001\ -\255\255\002\001\003\001\004\001\255\255\081\001\255\255\008\001\ -\108\001\255\255\255\255\111\001\013\001\089\001\090\001\115\001\ -\017\001\018\001\019\001\255\255\255\255\097\001\255\255\255\255\ -\255\255\026\001\027\001\028\001\029\001\255\255\106\001\255\255\ -\255\255\109\001\110\001\036\001\255\255\255\255\255\255\255\255\ -\041\001\255\255\000\000\255\255\255\255\255\255\255\255\048\001\ -\049\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\060\001\255\255\255\255\063\001\255\255\ -\255\255\066\001\067\001\068\001\255\255\070\001\255\255\255\255\ -\255\255\074\001\255\255\255\255\255\255\255\255\255\255\080\001\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\091\001\092\001\255\255\094\001\095\001\096\001\ -\255\255\255\255\000\001\255\255\002\001\003\001\004\001\255\255\ -\255\255\255\255\008\001\108\001\255\255\255\255\111\001\013\001\ -\255\255\255\255\115\001\017\001\018\001\019\001\255\255\255\255\ -\255\255\255\255\255\255\255\255\026\001\027\001\028\001\029\001\ -\255\255\255\255\255\255\255\255\000\000\255\255\036\001\255\255\ -\255\255\255\255\255\255\041\001\255\255\255\255\000\000\255\255\ -\255\255\255\255\048\001\049\001\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\060\001\255\255\ -\255\255\063\001\255\255\255\255\066\001\067\001\068\001\255\255\ -\070\001\255\255\255\255\255\255\074\001\255\255\255\255\255\255\ -\255\255\255\255\080\001\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\091\001\092\001\000\000\ -\094\001\095\001\096\001\255\255\255\255\255\255\255\255\000\001\ -\255\255\002\001\003\001\004\001\255\255\255\255\108\001\008\001\ -\255\255\111\001\255\255\255\255\013\001\115\001\255\255\255\255\ -\017\001\018\001\019\001\255\255\255\255\255\255\255\255\255\255\ -\255\255\026\001\027\001\028\001\029\001\255\255\255\255\255\255\ -\255\255\255\255\255\255\036\001\255\255\255\255\255\255\255\255\ -\041\001\255\255\255\255\255\255\255\255\255\255\255\255\048\001\ -\049\001\000\000\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\060\001\255\255\255\255\063\001\255\255\ -\255\255\066\001\067\001\068\001\255\255\070\001\255\255\255\255\ -\255\255\074\001\255\255\255\255\255\255\255\255\055\001\080\001\ -\057\001\058\001\059\001\255\255\061\001\255\255\255\255\064\001\ -\065\001\255\255\091\001\092\001\255\255\094\001\095\001\096\001\ -\255\255\255\255\000\001\255\255\002\001\003\001\004\001\255\255\ -\081\001\255\255\008\001\108\001\255\255\255\255\111\001\013\001\ -\089\001\090\001\115\001\017\001\018\001\019\001\255\255\255\255\ -\097\001\255\255\255\255\255\255\026\001\027\001\028\001\029\001\ -\255\255\255\255\255\255\255\255\109\001\110\001\036\001\255\255\ -\255\255\255\255\255\255\041\001\255\255\255\255\255\255\255\255\ -\255\255\255\255\048\001\049\001\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\060\001\255\255\ -\255\255\063\001\000\000\255\255\066\001\067\001\068\001\255\255\ -\070\001\255\255\255\255\255\255\074\001\255\255\255\255\255\255\ -\255\255\255\255\080\001\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\000\001\091\001\092\001\003\001\ -\094\001\095\001\096\001\255\255\255\255\255\255\000\001\255\255\ -\255\255\013\001\255\255\255\255\255\255\017\001\108\001\019\001\ -\255\255\111\001\255\255\013\001\255\255\115\001\026\001\027\001\ -\028\001\029\001\255\255\255\255\255\255\255\255\255\255\255\255\ -\026\001\255\255\028\001\029\001\255\255\041\001\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\041\001\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\000\001\ -\060\001\255\255\255\255\063\001\255\255\255\255\255\255\067\001\ -\068\001\255\255\060\001\255\255\013\001\073\001\074\001\255\255\ -\017\001\067\001\068\001\255\255\080\001\255\255\255\255\255\255\ -\074\001\026\001\027\001\028\001\029\001\000\000\080\001\255\255\ -\092\001\255\255\094\001\255\255\096\001\255\255\255\255\255\255\ -\041\001\255\255\092\001\255\255\255\255\255\255\096\001\255\255\ -\108\001\255\255\255\255\111\001\255\255\255\255\255\255\115\001\ -\255\255\000\001\108\001\060\001\003\001\111\001\063\001\255\255\ -\255\255\066\001\067\001\068\001\255\255\255\255\013\001\255\255\ -\073\001\074\001\017\001\255\255\255\255\255\255\255\255\080\001\ -\255\255\255\255\255\255\026\001\027\001\028\001\029\001\255\255\ -\255\255\255\255\255\255\092\001\255\255\094\001\255\255\096\001\ -\255\255\255\255\041\001\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\108\001\255\255\255\255\111\001\255\255\ -\255\255\255\255\115\001\255\255\255\255\060\001\255\255\255\255\ -\063\001\255\255\255\255\255\255\067\001\068\001\255\255\255\255\ -\255\255\255\255\073\001\074\001\055\001\255\255\057\001\058\001\ -\059\001\080\001\061\001\255\255\000\000\064\001\065\001\255\255\ -\255\255\255\255\255\255\255\255\255\255\092\001\255\255\094\001\ -\255\255\096\001\255\255\255\255\255\255\255\255\081\001\255\255\ -\255\255\255\255\255\255\255\255\255\255\108\001\089\001\090\001\ -\111\001\255\255\000\001\255\255\115\001\003\001\097\001\005\001\ -\006\001\007\001\008\001\255\255\255\255\011\001\012\001\013\001\ -\255\255\255\255\109\001\110\001\255\255\019\001\255\255\255\255\ -\255\255\023\001\255\255\255\255\026\001\255\255\028\001\029\001\ -\030\001\031\001\032\001\033\001\034\001\035\001\036\001\255\255\ -\255\255\039\001\040\001\041\001\255\255\255\255\000\000\255\255\ -\255\255\255\255\048\001\049\001\050\001\051\001\052\001\053\001\ -\054\001\055\001\056\001\057\001\058\001\059\001\060\001\061\001\ -\255\255\063\001\064\001\065\001\255\255\067\001\068\001\069\001\ -\070\001\071\001\072\001\255\255\074\001\075\001\255\255\077\001\ -\078\001\255\255\080\001\081\001\255\255\255\255\084\001\085\001\ -\255\255\087\001\088\001\089\001\090\001\091\001\092\001\093\001\ -\255\255\095\001\096\001\097\001\255\255\099\001\255\255\101\001\ -\102\001\255\255\104\001\255\255\106\001\107\001\108\001\109\001\ -\110\001\111\001\112\001\000\000\114\001\000\001\255\255\255\255\ -\255\255\004\001\255\255\006\001\255\255\008\001\255\255\010\001\ -\255\255\012\001\255\255\014\001\015\001\255\255\017\001\018\001\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\027\001\028\001\255\255\030\001\031\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\050\001\ -\051\001\052\001\053\001\255\255\055\001\056\001\255\255\255\255\ -\059\001\000\000\255\255\255\255\255\255\064\001\065\001\066\001\ -\255\255\255\255\255\255\255\255\071\001\255\255\073\001\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\081\001\255\255\ -\255\255\084\001\255\255\255\255\255\255\255\255\089\001\255\255\ -\091\001\092\001\255\255\094\001\095\001\255\255\097\001\255\255\ -\255\255\255\255\101\001\255\255\255\255\104\001\255\255\106\001\ -\255\255\255\255\109\001\110\001\000\001\255\255\113\001\255\255\ -\004\001\255\255\006\001\000\000\008\001\255\255\010\001\255\255\ -\012\001\255\255\014\001\015\001\255\255\017\001\018\001\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\027\001\ -\255\255\255\255\030\001\031\001\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\050\001\051\001\ -\255\255\053\001\255\255\055\001\056\001\255\255\255\255\059\001\ -\255\255\255\255\255\255\255\255\064\001\065\001\066\001\255\255\ -\255\255\255\255\255\255\071\001\255\255\073\001\000\001\255\255\ -\255\255\003\001\255\255\255\255\255\255\081\001\008\001\255\255\ -\084\001\255\255\255\255\013\001\014\001\089\001\255\255\091\001\ -\092\001\019\001\094\001\095\001\022\001\097\001\255\255\255\255\ -\026\001\101\001\028\001\029\001\104\001\255\255\106\001\255\255\ -\255\255\109\001\110\001\255\255\255\255\113\001\255\255\041\001\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\055\001\ -\000\000\057\001\058\001\059\001\255\255\061\001\255\255\255\255\ -\064\001\065\001\060\001\255\255\255\255\063\001\255\255\065\001\ -\066\001\067\001\068\001\000\001\255\255\255\255\003\001\255\255\ -\074\001\081\001\255\255\008\001\255\255\079\001\080\001\255\255\ -\013\001\089\001\090\001\255\255\255\255\255\255\019\001\255\255\ -\255\255\097\001\092\001\255\255\255\255\026\001\096\001\028\001\ -\029\001\255\255\255\255\255\255\255\255\109\001\110\001\255\255\ -\000\000\255\255\108\001\040\001\041\001\111\001\055\001\255\255\ -\057\001\058\001\059\001\255\255\061\001\255\255\255\255\064\001\ -\065\001\255\255\255\255\255\255\255\255\255\255\255\255\060\001\ -\255\255\000\001\063\001\255\255\003\001\066\001\067\001\068\001\ -\081\001\008\001\255\255\255\255\073\001\074\001\013\001\255\255\ -\089\001\090\001\255\255\080\001\019\001\255\255\255\255\255\255\ -\097\001\255\255\255\255\026\001\255\255\028\001\029\001\092\001\ -\000\000\255\255\255\255\096\001\109\001\110\001\255\255\100\001\ -\255\255\040\001\041\001\255\255\255\255\255\255\255\255\108\001\ -\255\255\255\255\111\001\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\000\001\255\255\060\001\003\001\255\255\ -\063\001\255\255\255\255\066\001\067\001\068\001\255\255\255\255\ -\013\001\255\255\073\001\074\001\255\255\255\255\019\001\255\255\ -\255\255\080\001\255\255\255\255\255\255\026\001\255\255\028\001\ -\029\001\000\001\000\000\255\255\003\001\092\001\255\255\255\255\ -\255\255\096\001\255\255\040\001\041\001\255\255\013\001\255\255\ -\255\255\255\255\017\001\048\001\049\001\108\001\255\255\255\255\ -\111\001\255\255\255\255\026\001\027\001\028\001\029\001\060\001\ -\255\255\255\255\063\001\255\255\255\255\255\255\255\255\068\001\ -\255\255\070\001\041\001\255\255\255\255\074\001\255\255\255\255\ -\255\255\255\255\055\001\080\001\057\001\058\001\059\001\255\255\ -\061\001\255\255\000\000\064\001\065\001\060\001\255\255\092\001\ -\063\001\255\255\255\255\096\001\067\001\068\001\255\255\255\255\ -\255\255\255\255\006\001\074\001\081\001\255\255\255\255\108\001\ -\012\001\080\001\111\001\255\255\089\001\090\001\255\255\255\255\ -\000\001\255\255\255\255\003\001\097\001\092\001\255\255\094\001\ -\008\001\096\001\030\001\031\001\255\255\013\001\255\255\255\255\ -\109\001\110\001\255\255\019\001\255\255\108\001\255\255\000\000\ -\111\001\255\255\026\001\255\255\028\001\029\001\050\001\255\255\ -\052\001\053\001\255\255\055\001\056\001\255\255\255\255\059\001\ -\255\255\041\001\255\255\255\255\064\001\065\001\255\255\255\255\ -\255\255\255\255\255\255\071\001\255\255\255\255\255\255\255\255\ -\000\001\255\255\255\255\003\001\060\001\255\255\255\255\063\001\ -\084\001\255\255\066\001\067\001\068\001\013\001\255\255\255\255\ -\255\255\017\001\074\001\255\255\000\000\097\001\255\255\255\255\ -\080\001\101\001\026\001\027\001\028\001\029\001\106\001\255\255\ -\255\255\109\001\110\001\255\255\092\001\255\255\255\255\255\255\ -\096\001\041\001\255\255\000\000\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\108\001\255\255\255\255\111\001\ -\000\001\255\255\255\255\003\001\060\001\255\255\255\255\063\001\ -\255\255\255\255\255\255\067\001\068\001\013\001\255\255\255\255\ -\255\255\000\000\074\001\019\001\255\255\255\255\255\255\255\255\ -\080\001\255\255\026\001\255\255\028\001\029\001\255\255\255\255\ -\255\255\255\255\255\255\255\255\092\001\255\255\094\001\255\255\ -\096\001\041\001\255\255\255\255\255\255\255\255\255\255\255\255\ -\048\001\255\255\255\255\255\255\108\001\255\255\255\255\111\001\ -\255\255\255\255\000\001\255\255\060\001\003\001\255\255\063\001\ -\255\255\255\255\255\255\067\001\068\001\255\255\070\001\013\001\ -\255\255\000\000\074\001\255\255\255\255\019\001\255\255\255\255\ -\080\001\255\255\255\255\255\255\026\001\255\255\028\001\029\001\ -\255\255\255\255\255\255\255\255\092\001\255\255\255\255\255\255\ -\096\001\255\255\255\255\041\001\255\255\255\255\255\255\000\000\ -\255\255\255\255\255\255\255\255\108\001\255\255\255\255\111\001\ -\255\255\255\255\000\001\255\255\255\255\003\001\060\001\255\255\ -\255\255\063\001\008\001\255\255\255\255\067\001\068\001\013\001\ -\255\255\255\255\255\255\255\255\074\001\019\001\255\255\255\255\ -\255\255\255\255\080\001\255\255\026\001\255\255\028\001\029\001\ -\086\001\255\255\255\255\255\255\255\255\255\255\092\001\255\255\ -\255\255\255\255\096\001\041\001\255\255\255\255\255\255\000\000\ -\255\255\255\255\255\255\255\255\255\255\255\255\108\001\000\001\ -\255\255\111\001\003\001\255\255\255\255\255\255\060\001\255\255\ -\000\000\063\001\255\255\255\255\013\001\067\001\068\001\255\255\ -\255\255\255\255\019\001\255\255\074\001\255\255\255\255\255\255\ -\255\255\026\001\080\001\028\001\029\001\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\092\001\255\255\ -\041\001\255\255\096\001\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\000\001\255\255\108\001\003\001\ -\255\255\111\001\255\255\060\001\255\255\255\255\063\001\255\255\ -\000\000\013\001\067\001\068\001\255\255\255\255\255\255\019\001\ -\255\255\074\001\255\255\000\001\255\255\255\255\026\001\080\001\ -\028\001\029\001\255\255\008\001\255\255\000\000\255\255\255\255\ -\013\001\255\255\255\255\092\001\255\255\041\001\000\000\096\001\ -\255\255\255\255\255\255\255\255\255\255\026\001\255\255\028\001\ -\029\001\000\001\255\255\108\001\003\001\255\255\111\001\255\255\ -\060\001\255\255\255\255\063\001\041\001\255\255\013\001\067\001\ -\068\001\255\255\255\255\255\255\019\001\255\255\074\001\255\255\ -\255\255\000\000\255\255\026\001\080\001\028\001\029\001\060\001\ -\255\255\255\255\063\001\255\255\255\255\066\001\067\001\068\001\ -\092\001\255\255\041\001\255\255\096\001\074\001\000\000\255\255\ -\255\255\255\255\255\255\080\001\255\255\255\255\255\255\255\255\ -\108\001\000\001\255\255\111\001\003\001\060\001\255\255\092\001\ -\063\001\255\255\255\255\096\001\067\001\068\001\013\001\255\255\ -\255\255\255\255\255\255\074\001\019\001\255\255\255\255\108\001\ -\255\255\080\001\111\001\026\001\255\255\028\001\029\001\000\001\ -\255\255\255\255\003\001\255\255\255\255\092\001\255\255\255\255\ -\255\255\096\001\041\001\255\255\013\001\255\255\255\255\255\255\ -\255\255\255\255\019\001\255\255\255\255\108\001\255\255\255\255\ -\111\001\026\001\255\255\028\001\029\001\060\001\255\255\255\255\ -\063\001\255\255\255\255\255\255\067\001\068\001\255\255\255\255\ -\041\001\255\255\255\255\074\001\255\255\255\255\255\255\255\255\ -\255\255\080\001\255\255\255\255\255\255\255\255\255\255\000\001\ -\255\255\255\255\003\001\060\001\255\255\092\001\063\001\255\255\ -\255\255\096\001\067\001\068\001\013\001\255\255\255\255\255\255\ -\000\001\074\001\019\001\255\255\255\255\108\001\255\255\080\001\ -\111\001\026\001\255\255\028\001\029\001\013\001\255\255\255\255\ -\255\255\255\255\255\255\092\001\255\255\255\255\255\255\096\001\ -\041\001\255\255\026\001\255\255\028\001\029\001\255\255\255\255\ -\255\255\255\255\255\255\108\001\255\255\255\255\111\001\255\255\ -\255\255\041\001\255\255\060\001\255\255\255\255\063\001\255\255\ -\255\255\255\255\067\001\068\001\255\255\255\255\255\255\255\255\ -\000\001\074\001\255\255\255\255\060\001\255\255\255\255\080\001\ -\255\255\255\255\066\001\067\001\068\001\013\001\255\255\255\255\ -\255\255\255\255\074\001\092\001\255\255\000\001\255\255\096\001\ -\080\001\255\255\026\001\255\255\028\001\029\001\000\001\255\255\ -\255\255\255\255\013\001\108\001\092\001\255\255\111\001\255\255\ -\096\001\041\001\255\255\013\001\255\255\255\255\255\255\026\001\ -\255\255\028\001\029\001\255\255\108\001\255\255\255\255\111\001\ -\026\001\255\255\028\001\029\001\060\001\255\255\041\001\063\001\ -\255\255\000\001\255\255\255\255\068\001\255\255\255\255\041\001\ -\255\255\255\255\074\001\255\255\255\255\255\255\013\001\255\255\ -\080\001\060\001\255\255\255\255\063\001\255\255\000\001\255\255\ -\255\255\068\001\060\001\026\001\092\001\028\001\029\001\074\001\ -\096\001\255\255\068\001\013\001\255\255\080\001\255\255\255\255\ -\074\001\255\255\041\001\255\255\108\001\255\255\080\001\111\001\ -\026\001\092\001\028\001\029\001\255\255\096\001\255\255\255\255\ -\255\255\255\255\092\001\255\255\255\255\060\001\096\001\041\001\ -\255\255\108\001\255\255\255\255\111\001\068\001\255\255\255\255\ -\255\255\255\255\108\001\074\001\255\255\111\001\255\255\255\255\ -\255\255\080\001\060\001\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\068\001\255\255\255\255\092\001\255\255\255\255\ -\074\001\096\001\255\255\255\255\255\255\255\255\080\001\255\255\ -\255\255\255\255\255\255\255\255\255\255\108\001\255\255\255\255\ -\111\001\255\255\092\001\000\001\255\255\255\255\096\001\255\255\ -\005\001\006\001\007\001\008\001\255\255\255\255\011\001\012\001\ -\013\001\014\001\108\001\255\255\255\255\111\001\019\001\255\255\ -\255\255\255\255\255\255\255\255\255\255\026\001\255\255\028\001\ -\029\001\030\001\031\001\032\001\033\001\034\001\035\001\255\255\ -\255\255\255\255\039\001\255\255\041\001\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\049\001\050\001\051\001\052\001\ -\053\001\054\001\055\001\056\001\255\255\255\255\059\001\060\001\ -\255\255\255\255\063\001\064\001\065\001\066\001\255\255\068\001\ -\069\001\070\001\071\001\072\001\255\255\074\001\255\255\255\255\ -\077\001\078\001\255\255\080\001\081\001\255\255\255\255\084\001\ -\085\001\255\255\087\001\255\255\089\001\090\001\255\255\092\001\ -\093\001\255\255\255\255\096\001\097\001\255\255\099\001\255\255\ -\101\001\102\001\255\255\104\001\255\255\106\001\107\001\108\001\ -\109\001\110\001\111\001\112\001\000\001\114\001\255\255\255\255\ -\255\255\005\001\006\001\007\001\008\001\255\255\255\255\011\001\ -\012\001\255\255\255\255\255\255\255\255\255\255\255\255\019\001\ -\255\255\255\255\255\255\255\255\255\255\255\255\026\001\255\255\ -\028\001\255\255\030\001\031\001\032\001\033\001\034\001\035\001\ -\255\255\255\255\255\255\039\001\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\049\001\050\001\051\001\ -\052\001\053\001\054\001\055\001\056\001\255\255\255\255\059\001\ -\060\001\255\255\255\255\063\001\064\001\065\001\255\255\255\255\ -\068\001\069\001\070\001\071\001\072\001\255\255\074\001\255\255\ -\255\255\077\001\078\001\255\255\255\255\081\001\255\255\255\255\ -\084\001\085\001\255\255\087\001\255\255\089\001\090\001\255\255\ -\255\255\093\001\255\255\255\255\255\255\097\001\255\255\099\001\ -\255\255\101\001\102\001\255\255\104\001\255\255\106\001\107\001\ -\255\255\109\001\110\001\111\001\112\001\255\255\114\001\000\001\ -\001\001\002\001\255\255\255\255\005\001\006\001\007\001\255\255\ -\009\001\255\255\011\001\012\001\255\255\255\255\015\001\016\001\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\027\001\255\255\255\255\030\001\031\001\032\001\ -\033\001\034\001\255\255\036\001\255\255\255\255\039\001\255\255\ -\255\255\042\001\043\001\044\001\045\001\046\001\047\001\255\255\ -\255\255\050\001\255\255\052\001\053\001\054\001\055\001\056\001\ -\255\255\255\255\059\001\255\255\061\001\255\255\063\001\064\001\ -\065\001\255\255\255\255\255\255\069\001\255\255\071\001\072\001\ -\255\255\074\001\255\255\255\255\255\255\078\001\255\255\255\255\ -\255\255\082\001\083\001\084\001\085\001\086\001\087\001\255\255\ -\255\255\255\255\255\255\255\255\255\255\094\001\255\255\255\255\ -\255\255\098\001\255\255\100\001\101\001\255\255\255\255\255\255\ -\255\255\106\001\107\001\255\255\109\001\110\001\000\001\001\001\ -\002\001\114\001\255\255\005\001\006\001\007\001\255\255\009\001\ -\255\255\011\001\012\001\255\255\255\255\015\001\016\001\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\027\001\255\255\255\255\030\001\031\001\032\001\033\001\ -\034\001\255\255\036\001\255\255\255\255\039\001\255\255\255\255\ -\042\001\043\001\044\001\045\001\046\001\047\001\255\255\255\255\ -\050\001\255\255\052\001\053\001\054\001\055\001\056\001\255\255\ -\255\255\059\001\255\255\061\001\255\255\063\001\064\001\065\001\ -\255\255\255\255\255\255\069\001\255\255\071\001\072\001\255\255\ -\074\001\255\255\255\255\255\255\078\001\255\255\255\255\255\255\ -\082\001\083\001\084\001\085\001\086\001\087\001\255\255\255\255\ -\255\255\255\255\255\255\255\255\094\001\255\255\255\255\255\255\ -\098\001\255\255\100\001\101\001\255\255\255\255\255\255\255\255\ -\106\001\107\001\255\255\109\001\110\001\000\001\255\255\255\255\ -\114\001\255\255\005\001\006\001\007\001\255\255\255\255\255\255\ -\011\001\012\001\013\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\026\001\ -\255\255\028\001\029\001\030\001\031\001\032\001\033\001\034\001\ -\255\255\255\255\255\255\255\255\039\001\255\255\041\001\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\050\001\ -\255\255\052\001\053\001\054\001\055\001\056\001\255\255\255\255\ -\059\001\060\001\255\255\255\255\063\001\064\001\065\001\255\255\ -\255\255\068\001\069\001\255\255\071\001\072\001\255\255\074\001\ -\255\255\255\255\255\255\078\001\255\255\080\001\255\255\255\255\ -\255\255\084\001\085\001\000\001\087\001\255\255\255\255\255\255\ -\005\001\006\001\007\001\255\255\255\255\096\001\011\001\012\001\ -\255\255\255\255\101\001\255\255\255\255\255\255\255\255\106\001\ -\107\001\108\001\109\001\110\001\111\001\255\255\255\255\114\001\ -\255\255\030\001\031\001\032\001\033\001\034\001\255\255\255\255\ -\255\255\255\255\039\001\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\050\001\255\255\052\001\ -\053\001\054\001\055\001\056\001\255\255\255\255\059\001\255\255\ -\255\255\255\255\063\001\064\001\065\001\255\255\255\255\255\255\ -\069\001\255\255\071\001\072\001\255\255\255\255\255\255\255\255\ -\255\255\078\001\255\255\255\255\255\255\255\255\255\255\084\001\ -\085\001\000\001\087\001\255\255\255\255\255\255\005\001\006\001\ -\007\001\094\001\255\255\255\255\011\001\012\001\255\255\255\255\ -\101\001\255\255\255\255\255\255\255\255\106\001\107\001\255\255\ -\109\001\110\001\255\255\255\255\255\255\114\001\255\255\030\001\ -\031\001\032\001\033\001\034\001\255\255\255\255\255\255\255\255\ -\039\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\050\001\255\255\052\001\053\001\054\001\ -\055\001\056\001\255\255\255\255\059\001\255\255\255\255\255\255\ -\063\001\064\001\065\001\255\255\255\255\255\255\069\001\255\255\ -\071\001\072\001\255\255\255\255\255\255\255\255\255\255\078\001\ -\255\255\255\255\255\255\255\255\255\255\084\001\085\001\000\001\ -\087\001\255\255\255\255\255\255\005\001\006\001\007\001\094\001\ -\255\255\255\255\011\001\012\001\255\255\255\255\101\001\255\255\ -\255\255\255\255\255\255\106\001\107\001\255\255\109\001\110\001\ -\255\255\255\255\255\255\114\001\255\255\030\001\031\001\032\001\ -\033\001\034\001\255\255\255\255\255\255\255\255\039\001\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\050\001\255\255\052\001\053\001\054\001\055\001\056\001\ -\255\255\255\255\059\001\255\255\255\255\255\255\063\001\064\001\ -\065\001\255\255\255\255\255\255\069\001\255\255\071\001\072\001\ -\255\255\255\255\255\255\255\255\255\255\078\001\255\255\255\255\ -\255\255\255\255\255\255\084\001\085\001\000\001\087\001\255\255\ -\255\255\255\255\005\001\006\001\007\001\094\001\255\255\255\255\ -\011\001\012\001\255\255\255\255\101\001\255\255\255\255\255\255\ -\255\255\106\001\107\001\255\255\109\001\110\001\255\255\255\255\ -\255\255\114\001\255\255\030\001\031\001\032\001\033\001\034\001\ -\255\255\255\255\255\255\255\255\039\001\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\050\001\ -\255\255\052\001\053\001\054\001\055\001\056\001\255\255\255\255\ -\059\001\255\255\255\255\255\255\063\001\064\001\065\001\255\255\ -\255\255\255\255\069\001\255\255\071\001\072\001\255\255\255\255\ -\255\255\255\255\255\255\078\001\255\255\255\255\255\255\255\255\ -\255\255\084\001\085\001\255\255\087\001\255\255\255\255\255\255\ -\255\255\255\255\255\255\094\001\003\001\004\001\005\001\255\255\ -\255\255\255\255\101\001\255\255\011\001\255\255\013\001\106\001\ -\107\001\255\255\109\001\110\001\019\001\020\001\021\001\114\001\ -\255\255\024\001\025\001\026\001\255\255\028\001\029\001\030\001\ -\255\255\032\001\033\001\034\001\035\001\255\255\255\255\255\255\ -\039\001\040\001\041\001\255\255\255\255\255\255\255\255\255\255\ -\255\255\048\001\049\001\255\255\255\255\052\001\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\063\001\064\001\255\255\255\255\255\255\000\001\069\001\070\001\ -\255\255\004\001\255\255\074\001\075\001\076\001\077\001\078\001\ -\079\001\080\001\255\255\082\001\255\255\255\255\017\001\255\255\ -\019\001\088\001\255\255\022\001\255\255\255\255\093\001\026\001\ -\027\001\255\255\255\255\255\255\099\001\255\255\255\255\102\001\ -\103\001\036\001\105\001\106\001\107\001\108\001\109\001\255\255\ -\111\001\112\001\113\001\114\001\115\001\048\001\049\001\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\060\001\255\255\255\255\255\255\064\001\255\255\066\001\ -\067\001\068\001\255\255\070\001\255\255\255\255\073\001\255\255\ -\255\255\255\255\000\001\001\001\002\001\255\255\255\255\255\255\ -\006\001\007\001\255\255\009\001\255\255\255\255\012\001\090\001\ -\091\001\015\001\016\001\255\255\095\001\255\255\097\001\255\255\ -\255\255\100\001\255\255\255\255\255\255\027\001\028\001\255\255\ -\030\001\031\001\109\001\255\255\111\001\255\255\036\001\255\255\ -\255\255\255\255\255\255\255\255\042\001\043\001\044\001\045\001\ -\046\001\047\001\255\255\255\255\050\001\255\255\052\001\053\001\ -\255\255\055\001\056\001\255\255\255\255\059\001\255\255\061\001\ -\255\255\255\255\064\001\065\001\255\255\255\255\255\255\255\255\ -\255\255\071\001\072\001\255\255\074\001\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\082\001\083\001\084\001\085\001\ -\086\001\087\001\255\255\255\255\255\255\255\255\255\255\255\255\ -\094\001\255\255\255\255\097\001\098\001\255\255\100\001\101\001\ -\255\255\255\255\255\255\255\255\106\001\255\255\108\001\109\001\ -\110\001\000\001\001\001\002\001\255\255\255\255\255\255\006\001\ -\007\001\255\255\009\001\255\255\255\255\012\001\255\255\255\255\ -\015\001\016\001\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\027\001\028\001\255\255\030\001\ -\031\001\255\255\255\255\255\255\255\255\036\001\255\255\255\255\ -\255\255\255\255\255\255\042\001\043\001\044\001\045\001\046\001\ -\047\001\255\255\255\255\050\001\255\255\052\001\053\001\255\255\ -\055\001\056\001\255\255\255\255\059\001\255\255\061\001\255\255\ -\255\255\064\001\065\001\255\255\255\255\255\255\255\255\255\255\ -\071\001\072\001\255\255\074\001\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\082\001\083\001\084\001\085\001\086\001\ -\087\001\255\255\255\255\255\255\255\255\255\255\255\255\094\001\ -\255\255\255\255\097\001\098\001\255\255\100\001\101\001\255\255\ -\255\255\255\255\255\255\106\001\255\255\108\001\109\001\110\001\ -\000\001\001\001\002\001\255\255\255\255\255\255\006\001\007\001\ -\255\255\009\001\255\255\255\255\012\001\255\255\255\255\015\001\ -\016\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\027\001\028\001\255\255\030\001\031\001\ -\255\255\255\255\255\255\255\255\036\001\255\255\255\255\255\255\ -\255\255\255\255\042\001\043\001\044\001\045\001\046\001\047\001\ -\255\255\255\255\050\001\255\255\052\001\053\001\255\255\055\001\ -\056\001\255\255\255\255\059\001\255\255\061\001\255\255\255\255\ -\064\001\065\001\255\255\255\255\255\255\255\255\255\255\071\001\ -\072\001\255\255\074\001\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\082\001\083\001\084\001\085\001\086\001\087\001\ -\255\255\255\255\255\255\255\255\255\255\255\255\094\001\255\255\ -\255\255\097\001\098\001\255\255\100\001\101\001\255\255\255\255\ -\255\255\255\255\106\001\255\255\108\001\109\001\110\001\000\001\ -\001\001\002\001\255\255\255\255\255\255\006\001\007\001\255\255\ -\009\001\255\255\255\255\012\001\255\255\255\255\015\001\016\001\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\027\001\028\001\255\255\030\001\031\001\255\255\ -\255\255\255\255\255\255\036\001\255\255\255\255\255\255\255\255\ -\255\255\042\001\043\001\044\001\045\001\046\001\047\001\255\255\ -\255\255\050\001\255\255\052\001\053\001\255\255\055\001\056\001\ -\255\255\255\255\059\001\255\255\061\001\255\255\255\255\064\001\ -\065\001\255\255\255\255\255\255\255\255\255\255\071\001\072\001\ -\255\255\074\001\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\082\001\083\001\084\001\085\001\086\001\087\001\255\255\ -\255\255\000\001\255\255\255\255\255\255\094\001\255\255\006\001\ -\097\001\098\001\255\255\100\001\101\001\012\001\255\255\255\255\ -\015\001\106\001\255\255\255\255\109\001\110\001\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\028\001\255\255\030\001\ -\031\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\050\001\255\255\052\001\053\001\255\255\ -\055\001\056\001\255\255\255\255\059\001\255\255\000\001\255\255\ -\255\255\064\001\065\001\255\255\006\001\255\255\255\255\255\255\ -\071\001\255\255\012\001\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\084\001\255\255\255\255\ -\255\255\255\255\028\001\255\255\030\001\031\001\255\255\094\001\ -\255\255\255\255\097\001\255\255\255\255\255\255\101\001\255\255\ -\255\255\255\255\255\255\106\001\255\255\255\255\109\001\110\001\ -\050\001\255\255\052\001\053\001\255\255\055\001\056\001\255\255\ -\255\255\059\001\255\255\000\001\255\255\255\255\064\001\065\001\ -\255\255\006\001\255\255\255\255\255\255\071\001\255\255\012\001\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\084\001\255\255\255\255\255\255\255\255\028\001\ -\255\255\030\001\031\001\255\255\255\255\255\255\255\255\097\001\ -\255\255\255\255\255\255\101\001\255\255\255\255\255\255\255\255\ -\106\001\255\255\255\255\109\001\110\001\050\001\255\255\052\001\ -\053\001\255\255\055\001\056\001\255\255\255\255\059\001\255\255\ -\000\001\255\255\255\255\064\001\065\001\255\255\006\001\255\255\ -\255\255\255\255\071\001\255\255\012\001\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\084\001\ -\255\255\255\255\255\255\255\255\028\001\255\255\030\001\031\001\ -\255\255\255\255\255\255\255\255\097\001\255\255\255\255\255\255\ -\101\001\255\255\255\255\255\255\255\255\106\001\255\255\255\255\ -\109\001\110\001\050\001\255\255\052\001\053\001\255\255\055\001\ -\056\001\255\255\255\255\059\001\255\255\000\001\255\255\255\255\ -\064\001\065\001\255\255\006\001\255\255\255\255\255\255\071\001\ -\255\255\012\001\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\084\001\255\255\255\255\255\255\ -\255\255\028\001\255\255\030\001\031\001\255\255\255\255\255\255\ -\255\255\097\001\255\255\255\255\255\255\101\001\255\255\255\255\ -\255\255\255\255\106\001\255\255\255\255\109\001\110\001\050\001\ -\255\255\052\001\053\001\255\255\055\001\056\001\255\255\255\255\ -\059\001\255\255\000\001\255\255\255\255\064\001\065\001\255\255\ -\006\001\255\255\255\255\255\255\071\001\255\255\012\001\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\084\001\255\255\255\255\255\255\255\255\028\001\255\255\ -\030\001\031\001\255\255\255\255\255\255\255\255\097\001\255\255\ -\255\255\255\255\101\001\255\255\255\255\255\255\255\255\106\001\ -\255\255\255\255\109\001\110\001\050\001\255\255\052\001\053\001\ -\255\255\055\001\056\001\255\255\255\255\059\001\255\255\255\255\ -\255\255\255\255\064\001\065\001\005\001\006\001\007\001\255\255\ -\255\255\071\001\011\001\012\001\013\001\014\001\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\084\001\255\255\ -\255\255\255\255\255\255\028\001\029\001\030\001\031\001\032\001\ -\033\001\034\001\255\255\097\001\255\255\255\255\039\001\101\001\ -\041\001\255\255\255\255\255\255\106\001\255\255\255\255\109\001\ -\110\001\050\001\255\255\052\001\053\001\054\001\055\001\056\001\ -\255\255\255\255\059\001\060\001\255\255\255\255\063\001\064\001\ -\065\001\255\255\255\255\068\001\069\001\255\255\071\001\072\001\ -\255\255\074\001\255\255\255\255\255\255\078\001\255\255\080\001\ -\255\255\255\255\255\255\084\001\085\001\255\255\087\001\255\255\ -\089\001\255\255\255\255\005\001\006\001\007\001\255\255\096\001\ -\255\255\011\001\012\001\013\001\101\001\255\255\255\255\255\255\ -\255\255\106\001\107\001\108\001\109\001\110\001\111\001\255\255\ -\255\255\114\001\028\001\029\001\030\001\031\001\032\001\033\001\ -\034\001\255\255\255\255\255\255\255\255\039\001\255\255\041\001\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\050\001\255\255\052\001\053\001\054\001\055\001\056\001\255\255\ -\255\255\059\001\060\001\255\255\255\255\063\001\064\001\065\001\ -\255\255\255\255\068\001\069\001\255\255\071\001\072\001\255\255\ -\074\001\255\255\255\255\255\255\078\001\255\255\080\001\255\255\ -\255\255\255\255\084\001\085\001\255\255\087\001\255\255\255\255\ -\255\255\005\001\006\001\007\001\255\255\255\255\096\001\011\001\ -\012\001\255\255\255\255\101\001\255\255\255\255\255\255\255\255\ -\106\001\107\001\108\001\109\001\110\001\111\001\255\255\255\255\ -\114\001\255\255\030\001\031\001\032\001\033\001\034\001\255\255\ -\255\255\255\255\255\255\039\001\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\050\001\255\255\ -\052\001\053\001\054\001\055\001\056\001\255\255\255\255\059\001\ -\255\255\255\255\255\255\063\001\064\001\065\001\255\255\255\255\ -\255\255\069\001\255\255\071\001\072\001\255\255\255\255\255\255\ -\255\255\255\255\078\001\255\255\255\255\255\255\255\255\255\255\ -\084\001\085\001\255\255\087\001\255\255\255\255\255\255\255\255\ -\092\001\005\001\006\001\007\001\255\255\255\255\010\001\011\001\ -\012\001\101\001\255\255\255\255\255\255\255\255\106\001\107\001\ -\255\255\109\001\110\001\255\255\255\255\255\255\114\001\255\255\ -\255\255\255\255\030\001\031\001\032\001\033\001\034\001\255\255\ -\255\255\255\255\255\255\039\001\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\050\001\255\255\ -\052\001\053\001\054\001\055\001\056\001\255\255\255\255\059\001\ -\255\255\255\255\255\255\063\001\064\001\065\001\255\255\255\255\ -\255\255\069\001\255\255\071\001\072\001\255\255\255\255\255\255\ -\255\255\255\255\078\001\255\255\255\255\255\255\255\255\255\255\ -\084\001\085\001\255\255\087\001\255\255\255\255\005\001\006\001\ -\007\001\255\255\255\255\255\255\011\001\012\001\255\255\255\255\ -\255\255\101\001\255\255\255\255\255\255\255\255\106\001\107\001\ -\255\255\109\001\110\001\026\001\255\255\255\255\114\001\030\001\ -\031\001\032\001\033\001\034\001\255\255\255\255\255\255\255\255\ -\039\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\050\001\255\255\052\001\053\001\054\001\ -\055\001\056\001\255\255\255\255\059\001\255\255\255\255\255\255\ -\063\001\064\001\065\001\255\255\255\255\255\255\069\001\255\255\ -\071\001\072\001\255\255\255\255\255\255\255\255\255\255\078\001\ -\255\255\255\255\255\255\255\255\255\255\084\001\085\001\255\255\ -\087\001\255\255\255\255\005\001\006\001\007\001\255\255\255\255\ -\255\255\011\001\012\001\255\255\255\255\255\255\101\001\255\255\ -\255\255\255\255\255\255\106\001\107\001\255\255\109\001\110\001\ -\255\255\255\255\255\255\114\001\030\001\031\001\032\001\033\001\ -\034\001\255\255\255\255\255\255\255\255\039\001\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\050\001\255\255\052\001\053\001\054\001\055\001\056\001\255\255\ -\255\255\059\001\255\255\255\255\255\255\063\001\064\001\065\001\ -\255\255\255\255\255\255\069\001\255\255\071\001\072\001\255\255\ -\255\255\255\255\255\255\255\255\078\001\255\255\255\255\255\255\ -\255\255\083\001\084\001\085\001\255\255\087\001\255\255\255\255\ -\005\001\006\001\007\001\255\255\255\255\255\255\011\001\012\001\ -\255\255\255\255\255\255\101\001\255\255\255\255\255\255\255\255\ -\106\001\107\001\255\255\109\001\110\001\255\255\255\255\255\255\ -\114\001\030\001\031\001\032\001\033\001\034\001\255\255\255\255\ -\255\255\255\255\039\001\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\050\001\255\255\052\001\ -\053\001\054\001\055\001\056\001\255\255\255\255\059\001\255\255\ -\255\255\255\255\063\001\064\001\065\001\255\255\255\255\255\255\ -\069\001\255\255\071\001\072\001\255\255\255\255\255\255\255\255\ -\255\255\078\001\255\255\255\255\255\255\255\255\255\255\084\001\ -\085\001\255\255\087\001\255\255\255\255\255\255\255\255\092\001\ -\005\001\006\001\007\001\255\255\255\255\010\001\011\001\012\001\ -\101\001\255\255\255\255\255\255\255\255\106\001\107\001\255\255\ -\109\001\110\001\255\255\255\255\255\255\114\001\255\255\255\255\ -\255\255\030\001\031\001\032\001\033\001\034\001\255\255\255\255\ -\255\255\255\255\039\001\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\050\001\255\255\052\001\ -\053\001\054\001\055\001\056\001\255\255\255\255\059\001\255\255\ -\255\255\255\255\063\001\064\001\065\001\255\255\255\255\255\255\ -\069\001\255\255\071\001\072\001\255\255\255\255\255\255\255\255\ -\255\255\078\001\255\255\255\255\255\255\255\255\255\255\084\001\ -\085\001\255\255\087\001\255\255\255\255\255\255\005\001\006\001\ -\007\001\255\255\255\255\255\255\011\001\012\001\255\255\255\255\ -\101\001\255\255\255\255\255\255\255\255\106\001\107\001\022\001\ -\109\001\110\001\255\255\255\255\255\255\114\001\255\255\030\001\ -\031\001\032\001\033\001\034\001\255\255\255\255\255\255\255\255\ -\039\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\050\001\255\255\052\001\053\001\054\001\ -\055\001\056\001\255\255\255\255\059\001\255\255\255\255\255\255\ -\063\001\064\001\065\001\255\255\255\255\255\255\069\001\255\255\ -\071\001\072\001\255\255\255\255\255\255\255\255\255\255\078\001\ -\255\255\255\255\255\255\255\255\255\255\084\001\085\001\255\255\ -\087\001\255\255\255\255\005\001\006\001\007\001\255\255\255\255\ -\255\255\011\001\012\001\255\255\255\255\255\255\101\001\255\255\ -\255\255\255\255\255\255\106\001\107\001\255\255\109\001\110\001\ -\026\001\255\255\255\255\114\001\030\001\031\001\032\001\033\001\ -\034\001\255\255\255\255\255\255\255\255\039\001\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\050\001\255\255\052\001\053\001\054\001\055\001\056\001\255\255\ -\255\255\059\001\255\255\255\255\255\255\063\001\064\001\065\001\ -\255\255\255\255\255\255\069\001\255\255\071\001\072\001\255\255\ -\255\255\255\255\255\255\255\255\078\001\255\255\255\255\255\255\ -\255\255\255\255\084\001\085\001\255\255\087\001\255\255\255\255\ -\005\001\006\001\007\001\255\255\255\255\255\255\011\001\012\001\ -\255\255\255\255\255\255\101\001\255\255\255\255\255\255\255\255\ -\106\001\107\001\255\255\109\001\110\001\255\255\255\255\255\255\ -\114\001\030\001\031\001\032\001\033\001\034\001\255\255\255\255\ -\255\255\255\255\039\001\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\050\001\255\255\052\001\ -\053\001\054\001\055\001\056\001\255\255\255\255\059\001\255\255\ -\255\255\255\255\063\001\064\001\065\001\255\255\255\255\255\255\ -\069\001\255\255\071\001\072\001\255\255\255\255\255\255\255\255\ -\255\255\078\001\255\255\255\255\255\255\255\255\255\255\084\001\ -\085\001\255\255\087\001\255\255\255\255\005\001\006\001\007\001\ -\255\255\255\255\255\255\011\001\012\001\255\255\255\255\255\255\ -\101\001\255\255\255\255\255\255\255\255\106\001\107\001\255\255\ -\109\001\110\001\255\255\255\255\255\255\114\001\030\001\031\001\ -\032\001\033\001\034\001\255\255\255\255\255\255\255\255\039\001\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\050\001\255\255\052\001\053\001\054\001\055\001\ -\056\001\255\255\255\255\059\001\255\255\255\255\255\255\063\001\ -\064\001\065\001\255\255\255\255\255\255\069\001\255\255\071\001\ -\072\001\255\255\255\255\255\255\255\255\255\255\078\001\255\255\ -\255\255\255\255\255\255\255\255\084\001\085\001\255\255\087\001\ -\255\255\255\255\005\001\006\001\007\001\255\255\255\255\255\255\ -\011\001\012\001\255\255\255\255\255\255\101\001\255\255\255\255\ -\255\255\255\255\106\001\107\001\255\255\109\001\110\001\255\255\ -\255\255\255\255\114\001\030\001\031\001\032\001\033\001\034\001\ -\255\255\255\255\255\255\255\255\039\001\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\050\001\ -\255\255\052\001\053\001\054\001\055\001\056\001\255\255\255\255\ -\059\001\255\255\255\255\255\255\063\001\064\001\065\001\255\255\ -\255\255\006\001\069\001\255\255\071\001\072\001\255\255\012\001\ -\255\255\014\001\255\255\078\001\017\001\255\255\255\255\255\255\ -\255\255\084\001\085\001\255\255\087\001\255\255\027\001\255\255\ -\255\255\030\001\031\001\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\101\001\255\255\255\255\255\255\255\255\106\001\ -\107\001\255\255\109\001\110\001\255\255\050\001\051\001\114\001\ -\053\001\255\255\055\001\056\001\255\255\255\255\059\001\255\255\ -\255\255\255\255\255\255\064\001\065\001\255\255\006\001\255\255\ -\255\255\255\255\071\001\255\255\012\001\255\255\014\001\255\255\ -\255\255\017\001\255\255\255\255\081\001\255\255\255\255\084\001\ -\255\255\255\255\255\255\027\001\089\001\255\255\030\001\031\001\ -\255\255\006\001\255\255\255\255\097\001\255\255\255\255\012\001\ -\101\001\014\001\255\255\104\001\255\255\106\001\255\255\255\255\ -\109\001\110\001\050\001\051\001\255\255\053\001\255\255\055\001\ -\056\001\030\001\031\001\059\001\255\255\255\255\255\255\255\255\ -\064\001\065\001\255\255\255\255\255\255\255\255\255\255\071\001\ -\255\255\255\255\255\255\255\255\255\255\050\001\051\001\255\255\ -\053\001\081\001\055\001\056\001\084\001\255\255\059\001\255\255\ -\255\255\089\001\255\255\064\001\065\001\255\255\255\255\255\255\ -\255\255\097\001\071\001\255\255\073\001\101\001\255\255\255\255\ -\104\001\255\255\106\001\255\255\081\001\109\001\110\001\084\001\ -\255\255\255\255\006\001\255\255\089\001\255\255\255\255\255\255\ -\012\001\255\255\014\001\255\255\097\001\255\255\255\255\255\255\ -\101\001\255\255\255\255\104\001\255\255\106\001\255\255\027\001\ -\109\001\110\001\030\001\031\001\255\255\006\001\255\255\255\255\ -\255\255\255\255\255\255\012\001\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\050\001\051\001\ -\255\255\053\001\255\255\055\001\056\001\030\001\031\001\059\001\ -\255\255\255\255\255\255\255\255\064\001\065\001\255\255\255\255\ -\255\255\255\255\255\255\071\001\255\255\255\255\255\255\255\255\ -\255\255\050\001\051\001\255\255\053\001\081\001\055\001\056\001\ -\084\001\255\255\059\001\255\255\255\255\089\001\255\255\064\001\ -\065\001\255\255\006\001\255\255\255\255\097\001\071\001\255\255\ -\012\001\101\001\255\255\255\255\104\001\255\255\106\001\255\255\ -\081\001\109\001\110\001\084\001\255\255\255\255\255\255\255\255\ -\089\001\255\255\030\001\031\001\255\255\255\255\255\255\255\255\ -\097\001\255\255\255\255\255\255\101\001\255\255\255\255\104\001\ -\255\255\106\001\255\255\255\255\109\001\110\001\050\001\051\001\ -\255\255\053\001\255\255\055\001\056\001\255\255\255\255\059\001\ -\255\255\255\255\255\255\255\255\064\001\065\001\255\255\255\255\ -\006\001\255\255\255\255\071\001\255\255\255\255\012\001\255\255\ -\255\255\255\255\255\255\255\255\255\255\081\001\255\255\255\255\ -\084\001\255\255\255\255\255\255\255\255\089\001\028\001\255\255\ -\030\001\031\001\255\255\255\255\255\255\097\001\255\255\255\255\ -\255\255\101\001\255\255\255\255\104\001\255\255\106\001\255\255\ -\255\255\109\001\110\001\255\255\050\001\255\255\052\001\053\001\ -\255\255\055\001\056\001\255\255\255\255\059\001\255\255\255\255\ -\255\255\255\255\064\001\065\001\255\255\255\255\255\255\006\001\ -\255\255\071\001\255\255\010\001\255\255\012\001\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\084\001\255\255\ -\255\255\255\255\255\255\255\255\255\255\028\001\092\001\030\001\ -\031\001\255\255\255\255\097\001\255\255\255\255\255\255\101\001\ -\255\255\255\255\255\255\255\255\106\001\255\255\255\255\109\001\ -\110\001\255\255\255\255\050\001\255\255\052\001\053\001\255\255\ -\055\001\056\001\255\255\255\255\059\001\255\255\255\255\255\255\ -\255\255\064\001\065\001\255\255\006\001\255\255\255\255\255\255\ -\071\001\255\255\012\001\255\255\255\255\255\255\255\255\255\255\ -\255\255\006\001\007\001\255\255\255\255\084\001\011\001\012\001\ -\255\255\255\255\028\001\255\255\030\001\031\001\255\255\255\255\ -\255\255\255\255\097\001\255\255\255\255\255\255\101\001\255\255\ -\255\255\030\001\031\001\106\001\255\255\255\255\109\001\110\001\ -\050\001\255\255\052\001\053\001\255\255\055\001\056\001\255\255\ -\255\255\059\001\255\255\255\255\255\255\050\001\064\001\065\001\ -\053\001\054\001\055\001\056\001\255\255\071\001\059\001\255\255\ -\006\001\255\255\008\001\064\001\065\001\255\255\012\001\255\255\ -\255\255\255\255\084\001\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\092\001\255\255\255\255\255\255\028\001\097\001\ -\030\001\031\001\087\001\101\001\255\255\255\255\255\255\255\255\ -\106\001\255\255\255\255\109\001\110\001\255\255\255\255\255\255\ -\101\001\255\255\255\255\255\255\050\001\106\001\052\001\053\001\ -\109\001\055\001\056\001\255\255\255\255\059\001\255\255\255\255\ -\255\255\255\255\064\001\065\001\255\255\006\001\255\255\255\255\ -\255\255\071\001\255\255\012\001\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\084\001\255\255\ -\255\255\255\255\255\255\028\001\255\255\030\001\031\001\255\255\ -\255\255\255\255\255\255\097\001\255\255\255\255\255\255\101\001\ -\255\255\255\255\255\255\255\255\106\001\255\255\255\255\109\001\ -\110\001\050\001\255\255\052\001\053\001\255\255\055\001\056\001\ -\255\255\255\255\059\001\255\255\255\255\255\255\255\255\064\001\ -\065\001\255\255\006\001\255\255\255\255\255\255\071\001\255\255\ -\012\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\084\001\255\255\255\255\255\255\255\255\ -\028\001\255\255\030\001\031\001\255\255\006\001\255\255\255\255\ -\097\001\255\255\255\255\012\001\101\001\255\255\255\255\255\255\ -\255\255\106\001\255\255\255\255\109\001\110\001\050\001\255\255\ -\052\001\053\001\255\255\055\001\056\001\030\001\031\001\059\001\ -\255\255\255\255\255\255\255\255\064\001\065\001\255\255\255\255\ -\255\255\255\255\255\255\071\001\255\255\255\255\255\255\255\255\ -\255\255\050\001\255\255\052\001\053\001\255\255\055\001\056\001\ -\084\001\255\255\059\001\255\255\255\255\255\255\255\255\064\001\ -\065\001\255\255\006\001\255\255\255\255\097\001\071\001\255\255\ -\012\001\101\001\255\255\255\255\255\255\255\255\106\001\255\255\ -\255\255\109\001\110\001\084\001\255\255\255\255\255\255\255\255\ -\028\001\255\255\030\001\031\001\093\001\006\001\255\255\255\255\ -\097\001\255\255\255\255\012\001\101\001\255\255\255\255\255\255\ -\255\255\106\001\255\255\255\255\109\001\110\001\050\001\255\255\ -\052\001\053\001\255\255\055\001\056\001\030\001\031\001\059\001\ -\255\255\255\255\255\255\255\255\064\001\065\001\255\255\255\255\ -\255\255\255\255\255\255\071\001\255\255\255\255\255\255\255\255\ -\255\255\050\001\255\255\052\001\053\001\255\255\055\001\056\001\ -\084\001\255\255\059\001\255\255\255\255\255\255\255\255\064\001\ -\065\001\255\255\006\001\255\255\255\255\097\001\071\001\255\255\ -\012\001\101\001\255\255\255\255\255\255\255\255\106\001\255\255\ -\255\255\109\001\110\001\084\001\255\255\255\255\255\255\255\255\ -\255\255\255\255\030\001\031\001\255\255\006\001\255\255\255\255\ -\097\001\255\255\255\255\012\001\101\001\255\255\255\255\255\255\ -\255\255\106\001\255\255\255\255\109\001\110\001\050\001\255\255\ -\052\001\053\001\255\255\055\001\056\001\030\001\031\001\059\001\ -\255\255\255\255\255\255\255\255\064\001\065\001\255\255\255\255\ -\255\255\255\255\255\255\071\001\255\255\255\255\255\255\255\255\ -\255\255\050\001\255\255\255\255\053\001\255\255\055\001\056\001\ -\084\001\255\255\059\001\255\255\255\255\255\255\255\255\064\001\ -\065\001\255\255\006\001\255\255\255\255\097\001\071\001\255\255\ -\012\001\101\001\255\255\255\255\255\255\255\255\106\001\255\255\ -\255\255\109\001\110\001\084\001\255\255\255\255\255\255\255\255\ -\255\255\255\255\030\001\031\001\255\255\255\255\255\255\255\255\ -\097\001\255\255\255\255\255\255\101\001\255\255\255\255\255\255\ -\255\255\106\001\255\255\255\255\109\001\110\001\050\001\255\255\ -\255\255\053\001\255\255\055\001\056\001\255\255\255\255\059\001\ -\255\255\255\255\255\255\255\255\064\001\065\001\255\255\006\001\ -\007\001\255\255\255\255\071\001\011\001\012\001\006\001\007\001\ -\255\255\255\255\255\255\011\001\012\001\255\255\255\255\022\001\ -\084\001\255\255\255\255\255\255\255\255\255\255\255\255\030\001\ -\031\001\255\255\255\255\255\255\255\255\097\001\030\001\031\001\ -\255\255\101\001\255\255\255\255\255\255\255\255\106\001\255\255\ -\047\001\109\001\110\001\050\001\051\001\255\255\053\001\054\001\ -\055\001\056\001\050\001\051\001\059\001\053\001\054\001\055\001\ -\056\001\064\001\065\001\059\001\255\255\255\255\255\255\255\255\ -\064\001\065\001\255\255\255\255\255\255\255\255\255\255\006\001\ -\007\001\255\255\081\001\255\255\011\001\012\001\255\255\255\255\ -\087\001\081\001\089\001\255\255\255\255\255\255\255\255\087\001\ -\255\255\089\001\097\001\098\001\255\255\255\255\101\001\030\001\ -\031\001\104\001\255\255\106\001\255\255\101\001\109\001\255\255\ -\104\001\255\255\106\001\255\255\255\255\109\001\255\255\255\255\ -\255\255\255\255\255\255\050\001\255\255\255\255\053\001\054\001\ -\055\001\056\001\255\255\255\255\059\001\255\255\255\255\255\255\ -\255\255\064\001\065\001\255\255\255\255\000\001\001\001\002\001\ -\255\255\255\255\255\255\255\255\255\255\255\255\009\001\255\255\ -\255\255\255\255\255\255\014\001\015\001\016\001\017\001\018\001\ -\087\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\027\001\255\255\255\255\255\255\255\255\255\255\101\001\255\255\ -\255\255\036\001\255\255\106\001\255\255\255\255\109\001\042\001\ -\043\001\044\001\045\001\046\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\061\001\255\255\015\001\255\255\255\255\066\001\ -\255\255\255\255\255\255\255\255\071\001\072\001\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\082\001\ -\083\001\084\001\085\001\086\001\255\255\000\001\001\001\002\001\ -\255\255\255\255\255\255\094\001\007\001\255\255\009\001\255\255\ -\255\255\100\001\255\255\255\255\055\001\016\001\057\001\058\001\ -\059\001\255\255\061\001\255\255\255\255\064\001\065\001\255\255\ -\027\001\255\255\255\255\255\255\255\255\255\255\255\255\074\001\ -\255\255\036\001\255\255\255\255\255\255\255\255\081\001\042\001\ -\043\001\044\001\045\001\046\001\047\001\255\255\089\001\090\001\ -\255\255\255\255\255\255\094\001\255\255\255\255\097\001\255\255\ -\255\255\255\255\061\001\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\109\001\110\001\071\001\072\001\255\255\074\001\ -\255\255\255\255\255\255\255\255\000\001\001\001\002\001\082\001\ -\083\001\084\001\085\001\086\001\087\001\009\001\255\255\255\255\ -\255\255\255\255\255\255\015\001\016\001\255\255\018\001\098\001\ -\255\255\100\001\255\255\255\255\255\255\255\255\255\255\027\001\ -\255\255\255\255\255\255\255\255\000\001\001\001\002\001\255\255\ -\036\001\255\255\255\255\255\255\255\255\009\001\042\001\043\001\ -\044\001\045\001\046\001\015\001\016\001\255\255\018\001\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\027\001\ -\255\255\061\001\255\255\255\255\255\255\255\255\066\001\255\255\ -\036\001\255\255\255\255\071\001\072\001\255\255\042\001\043\001\ -\044\001\045\001\046\001\255\255\255\255\255\255\082\001\083\001\ -\084\001\085\001\086\001\255\255\255\255\255\255\255\255\091\001\ -\255\255\061\001\255\255\255\255\255\255\255\255\066\001\255\255\ -\100\001\255\255\255\255\071\001\072\001\255\255\255\255\255\255\ -\255\255\255\255\000\001\001\001\002\001\255\255\082\001\083\001\ -\084\001\085\001\086\001\009\001\255\255\255\255\255\255\255\255\ -\092\001\015\001\016\001\255\255\018\001\255\255\255\255\255\255\ -\100\001\255\255\255\255\255\255\255\255\027\001\255\255\255\255\ -\255\255\255\255\000\001\001\001\002\001\255\255\036\001\255\255\ -\255\255\255\255\255\255\009\001\042\001\043\001\044\001\045\001\ -\046\001\015\001\016\001\255\255\018\001\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\027\001\255\255\061\001\ -\255\255\255\255\255\255\255\255\066\001\255\255\036\001\255\255\ -\255\255\071\001\072\001\255\255\042\001\043\001\044\001\045\001\ -\046\001\255\255\255\255\255\255\082\001\083\001\084\001\085\001\ -\086\001\255\255\255\255\255\255\255\255\255\255\255\255\061\001\ -\094\001\255\255\255\255\255\255\066\001\255\255\100\001\255\255\ -\255\255\071\001\072\001\255\255\255\255\255\255\255\255\255\255\ -\000\001\001\001\002\001\255\255\082\001\083\001\084\001\085\001\ -\086\001\009\001\255\255\255\255\255\255\091\001\255\255\015\001\ -\016\001\255\255\018\001\255\255\255\255\255\255\100\001\255\255\ -\255\255\255\255\255\255\027\001\255\255\255\255\255\255\255\255\ -\000\001\001\001\002\001\255\255\036\001\255\255\255\255\255\255\ -\255\255\009\001\042\001\043\001\044\001\045\001\046\001\015\001\ -\016\001\255\255\018\001\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\027\001\255\255\061\001\255\255\255\255\ -\255\255\255\255\066\001\255\255\036\001\255\255\255\255\071\001\ -\072\001\255\255\042\001\043\001\044\001\045\001\046\001\255\255\ -\255\255\255\255\082\001\083\001\084\001\085\001\086\001\255\255\ -\255\255\255\255\255\255\255\255\092\001\061\001\255\255\255\255\ -\255\255\255\255\066\001\255\255\100\001\255\255\255\255\071\001\ -\072\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\082\001\083\001\084\001\085\001\086\001\000\001\ -\001\001\002\001\255\255\255\255\255\255\255\255\094\001\255\255\ -\009\001\255\255\255\255\255\255\100\001\255\255\015\001\016\001\ -\255\255\018\001\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\027\001\255\255\255\255\255\255\255\255\000\001\ -\001\001\002\001\255\255\036\001\255\255\255\255\255\255\255\255\ -\009\001\042\001\043\001\044\001\045\001\046\001\015\001\016\001\ -\255\255\018\001\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\027\001\255\255\061\001\255\255\255\255\255\255\ -\255\255\066\001\255\255\036\001\255\255\255\255\071\001\072\001\ -\255\255\042\001\043\001\044\001\045\001\046\001\255\255\255\255\ -\255\255\082\001\083\001\084\001\085\001\086\001\255\255\255\255\ -\255\255\255\255\091\001\255\255\061\001\255\255\255\255\255\255\ -\255\255\066\001\255\255\100\001\255\255\255\255\071\001\072\001\ -\255\255\255\255\255\255\255\255\255\255\000\001\001\001\002\001\ -\255\255\082\001\083\001\084\001\085\001\086\001\009\001\255\255\ -\255\255\255\255\255\255\092\001\015\001\016\001\255\255\018\001\ -\255\255\255\255\255\255\100\001\255\255\255\255\255\255\255\255\ -\027\001\255\255\255\255\255\255\255\255\000\001\001\001\002\001\ -\255\255\036\001\255\255\255\255\255\255\255\255\009\001\042\001\ -\043\001\044\001\045\001\046\001\015\001\016\001\255\255\018\001\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\027\001\255\255\061\001\255\255\255\255\255\255\255\255\066\001\ -\255\255\036\001\255\255\255\255\071\001\072\001\255\255\042\001\ -\043\001\044\001\045\001\046\001\255\255\255\255\255\255\082\001\ -\083\001\084\001\085\001\086\001\255\255\255\255\255\255\255\255\ -\255\255\255\255\061\001\094\001\255\255\255\255\255\255\066\001\ -\255\255\100\001\255\255\255\255\071\001\072\001\255\255\255\255\ -\255\255\255\255\255\255\000\001\001\001\002\001\255\255\082\001\ -\083\001\084\001\085\001\086\001\009\001\255\255\255\255\255\255\ -\091\001\255\255\015\001\016\001\255\255\018\001\255\255\255\255\ -\255\255\100\001\255\255\255\255\255\255\255\255\027\001\255\255\ -\255\255\255\255\255\255\000\001\001\001\002\001\255\255\036\001\ -\255\255\255\255\255\255\255\255\009\001\042\001\043\001\044\001\ -\045\001\046\001\015\001\016\001\255\255\018\001\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\027\001\255\255\ -\061\001\255\255\255\255\255\255\255\255\066\001\255\255\036\001\ -\255\255\255\255\071\001\072\001\255\255\042\001\043\001\044\001\ -\045\001\046\001\255\255\255\255\255\255\082\001\083\001\084\001\ -\085\001\086\001\255\255\255\255\255\255\255\255\255\255\092\001\ -\061\001\001\001\002\001\255\255\255\255\066\001\255\255\100\001\ -\255\255\009\001\071\001\072\001\255\255\255\255\255\255\015\001\ -\016\001\255\255\018\001\255\255\255\255\082\001\083\001\084\001\ -\085\001\086\001\255\255\027\001\255\255\255\255\255\255\255\255\ -\255\255\094\001\255\255\255\255\036\001\255\255\255\255\100\001\ -\255\255\255\255\042\001\043\001\044\001\045\001\046\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\061\001\255\255\255\255\ -\255\255\255\255\066\001\255\255\255\255\255\255\255\255\071\001\ -\072\001\001\001\002\001\255\255\255\255\255\255\255\255\255\255\ -\255\255\009\001\082\001\083\001\084\001\085\001\086\001\015\001\ -\016\001\255\255\018\001\255\255\255\255\255\255\255\255\095\001\ -\255\255\025\001\255\255\027\001\100\001\255\255\255\255\255\255\ -\255\255\001\001\002\001\255\255\036\001\255\255\255\255\255\255\ -\255\255\009\001\042\001\043\001\044\001\045\001\046\001\015\001\ -\016\001\255\255\018\001\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\027\001\255\255\061\001\255\255\255\255\ -\255\255\255\255\066\001\255\255\036\001\255\255\255\255\071\001\ -\072\001\255\255\042\001\043\001\044\001\045\001\046\001\255\255\ -\255\255\255\255\082\001\083\001\084\001\085\001\086\001\255\255\ -\255\255\255\255\255\255\255\255\255\255\061\001\001\001\002\001\ -\255\255\255\255\066\001\255\255\100\001\255\255\009\001\071\001\ -\072\001\255\255\255\255\255\255\015\001\255\255\255\255\255\255\ -\255\255\255\255\082\001\083\001\084\001\085\001\086\001\255\255\ -\027\001\255\255\255\255\255\255\255\255\255\255\001\001\002\001\ -\255\255\036\001\255\255\255\255\100\001\255\255\255\255\042\001\ -\043\001\044\001\045\001\046\001\015\001\255\255\255\255\255\255\ -\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\027\001\255\255\061\001\255\255\255\255\255\255\255\255\066\001\ -\255\255\036\001\255\255\255\255\071\001\072\001\255\255\042\001\ -\043\001\044\001\045\001\046\001\013\001\255\255\255\255\082\001\ -\083\001\084\001\085\001\086\001\255\255\255\255\255\255\255\255\ -\255\255\255\255\061\001\028\001\029\001\255\255\255\255\066\001\ -\255\255\100\001\255\255\255\255\071\001\072\001\255\255\255\255\ -\041\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\083\001\084\001\085\001\086\001\255\255\255\255\055\001\255\255\ -\057\001\058\001\059\001\060\001\061\001\255\255\255\255\064\001\ -\065\001\100\001\255\255\068\001\255\255\255\255\255\255\255\255\ -\255\255\074\001\255\255\255\255\255\255\255\255\255\255\080\001\ -\081\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\089\001\090\001\255\255\255\255\255\255\255\255\255\255\096\001\ -\097\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ -\255\255\255\255\255\255\108\001\109\001\110\001\111\001" - -let yynames_const = "\ - AMPERAMPER\000\ - AMPERSAND\000\ - AND\000\ - AS\000\ - ASSERT\000\ - BACKQUOTE\000\ - BANG\000\ - BAR\000\ - BARBAR\000\ - BARRBRACKET\000\ - BEGIN\000\ - CLASS\000\ - COLON\000\ - COLONCOLON\000\ - COLONEQUAL\000\ - COLONGREATER\000\ - COMMA\000\ - CONSTRAINT\000\ - DO\000\ - DONE\000\ - DOT\000\ - DOTDOT\000\ - DOWNTO\000\ - ELSE\000\ - END\000\ - EOF\000\ - EQUAL\000\ - EXCEPTION\000\ - EXTERNAL\000\ - FALSE\000\ - FOR\000\ - FUN\000\ - FUNCTION\000\ - FUNCTOR\000\ - GREATER\000\ - GREATERRBRACE\000\ - GREATERRBRACKET\000\ - IF\000\ - IN\000\ - INCLUDE\000\ - INHERIT\000\ - INITIALIZER\000\ - LAZY\000\ - LBRACE\000\ - LBRACELESS\000\ - LBRACKET\000\ - LBRACKETBAR\000\ - LBRACKETLESS\000\ - LBRACKETGREATER\000\ - LBRACKETPERCENT\000\ - LBRACKETPERCENTPERCENT\000\ - LESS\000\ - LESSMINUS\000\ - LET\000\ - LPAREN\000\ - LBRACKETAT\000\ - LBRACKETATAT\000\ - LBRACKETATATAT\000\ - MATCH\000\ - METHOD\000\ - MINUS\000\ - MINUSDOT\000\ - MINUSGREATER\000\ - MODULE\000\ - MUTABLE\000\ - NEW\000\ - NONREC\000\ - OBJECT\000\ - OF\000\ - OPEN\000\ - OR\000\ - PERCENT\000\ - PLUS\000\ - PLUSDOT\000\ - PLUSEQ\000\ - PRIVATE\000\ - QUESTION\000\ - QUOTE\000\ - RBRACE\000\ - RBRACKET\000\ - REC\000\ - RPAREN\000\ - SEMI\000\ - SEMISEMI\000\ - HASH\000\ - SIG\000\ - STAR\000\ - STRUCT\000\ - THEN\000\ - TILDE\000\ - TO\000\ - TRUE\000\ - TRY\000\ - TYPE\000\ - UNDERSCORE\000\ - VAL\000\ - VIRTUAL\000\ - WHEN\000\ - WHILE\000\ - WITH\000\ - EOL\000\ - " - -let yynames_block = "\ - CHAR\000\ - FLOAT\000\ - INFIXOP0\000\ - INFIXOP1\000\ - INFIXOP2\000\ - INFIXOP3\000\ - INFIXOP4\000\ - DOTOP\000\ - INT\000\ - LABEL\000\ - LIDENT\000\ - OPTLABEL\000\ - PREFIXOP\000\ - HASHOP\000\ - STRING\000\ - UIDENT\000\ - COMMENT\000\ - DOCSTRING\000\ - " - -let yyact = [| - (fun _ -> failwith "parser") -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'structure) in - Obj.repr( -# 568 "ml/parser.mly" - ( extra_str 1 _1 ) -# 6360 "ml/parser.ml" - : Parsetree.structure)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'signature) in - Obj.repr( -# 571 "ml/parser.mly" - ( extra_sig 1 _1 ) -# 6367 "ml/parser.ml" - : Parsetree.signature)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'core_type) in - Obj.repr( -# 576 "ml/parser.mly" - ( _1 ) -# 6374 "ml/parser.ml" - : Parsetree.core_type)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'seq_expr) in - Obj.repr( -# 579 "ml/parser.mly" - ( _1 ) -# 6381 "ml/parser.ml" - : Parsetree.expression)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'pattern) in - Obj.repr( -# 582 "ml/parser.mly" - ( _1 ) -# 6388 "ml/parser.ml" - : Parsetree.pattern)) -; (fun __caml_parser_env -> - Obj.repr( -# 589 "ml/parser.mly" - ( mkrhs "*" 2, None ) -# 6394 "ml/parser.ml" - : 'functor_arg)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 3 : 'functor_arg_name) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'module_type) in - Obj.repr( -# 591 "ml/parser.mly" - ( mkrhs _2 2, Some _4 ) -# 6402 "ml/parser.ml" - : 'functor_arg)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in - Obj.repr( -# 595 "ml/parser.mly" - ( _1 ) -# 6409 "ml/parser.ml" - : 'functor_arg_name)) -; (fun __caml_parser_env -> - Obj.repr( -# 596 "ml/parser.mly" - ( "_" ) -# 6415 "ml/parser.ml" - : 'functor_arg_name)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'functor_args) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'functor_arg) in - Obj.repr( -# 601 "ml/parser.mly" - ( _2 :: _1 ) -# 6423 "ml/parser.ml" - : 'functor_args)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'functor_arg) in - Obj.repr( -# 603 "ml/parser.mly" - ( [ _1 ] ) -# 6430 "ml/parser.ml" - : 'functor_args)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'mod_longident) in - Obj.repr( -# 608 "ml/parser.mly" - ( mkmod(Pmod_ident (mkrhs _1 1)) ) -# 6437 "ml/parser.ml" - : 'module_expr)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 1 : 'structure) in - Obj.repr( -# 610 "ml/parser.mly" - ( mkmod ~attrs:_2 (Pmod_structure(extra_str 3 _3)) ) -# 6445 "ml/parser.ml" - : 'module_expr)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 1 : 'structure) in - Obj.repr( -# 612 "ml/parser.mly" - ( unclosed "struct" 1 "end" 4 ) -# 6453 "ml/parser.ml" - : 'module_expr)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 3 : 'attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 2 : 'functor_args) in - let _5 = (Parsing.peek_val __caml_parser_env 0 : 'module_expr) in - Obj.repr( -# 614 "ml/parser.mly" - ( let modexp = - List.fold_left - (fun acc (n, t) -> mkmod(Pmod_functor(n, t, acc))) - _5 _3 - in wrap_mod_attrs modexp _2 ) -# 6466 "ml/parser.ml" - : 'module_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'module_expr) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'paren_module_expr) in - Obj.repr( -# 620 "ml/parser.mly" - ( mkmod(Pmod_apply(_1, _2)) ) -# 6474 "ml/parser.ml" - : 'module_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'module_expr) in - Obj.repr( -# 622 "ml/parser.mly" - ( mkmod(Pmod_apply(_1, mkmod (Pmod_structure []))) ) -# 6481 "ml/parser.ml" - : 'module_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'paren_module_expr) in - Obj.repr( -# 624 "ml/parser.mly" - ( _1 ) -# 6488 "ml/parser.ml" - : 'module_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'module_expr) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'attribute) in - Obj.repr( -# 626 "ml/parser.mly" - ( Mod.attr _1 _2 ) -# 6496 "ml/parser.ml" - : 'module_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'extension) in - Obj.repr( -# 628 "ml/parser.mly" - ( mkmod(Pmod_extension _1) ) -# 6503 "ml/parser.ml" - : 'module_expr)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 3 : 'module_expr) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'module_type) in - Obj.repr( -# 633 "ml/parser.mly" - ( mkmod(Pmod_constraint(_2, _4)) ) -# 6511 "ml/parser.ml" - : 'paren_module_expr)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 3 : 'module_expr) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'module_type) in - Obj.repr( -# 635 "ml/parser.mly" - ( unclosed "(" 1 ")" 5 ) -# 6519 "ml/parser.ml" - : 'paren_module_expr)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 1 : 'module_expr) in - Obj.repr( -# 637 "ml/parser.mly" - ( _2 ) -# 6526 "ml/parser.ml" - : 'paren_module_expr)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 1 : 'module_expr) in - Obj.repr( -# 639 "ml/parser.mly" - ( unclosed "(" 1 ")" 3 ) -# 6533 "ml/parser.ml" - : 'paren_module_expr)) -; (fun __caml_parser_env -> - let _3 = (Parsing.peek_val __caml_parser_env 2 : 'attributes) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'expr) in - Obj.repr( -# 641 "ml/parser.mly" - ( mkmod ~attrs:_3 (Pmod_unpack _4)) -# 6541 "ml/parser.ml" - : 'paren_module_expr)) -; (fun __caml_parser_env -> - let _3 = (Parsing.peek_val __caml_parser_env 4 : 'attributes) in - let _4 = (Parsing.peek_val __caml_parser_env 3 : 'expr) in - let _6 = (Parsing.peek_val __caml_parser_env 1 : 'package_type) in - Obj.repr( -# 643 "ml/parser.mly" - ( mkmod ~attrs:_3 - (Pmod_unpack( - ghexp(Pexp_constraint(_4, ghtyp(Ptyp_package _6))))) ) -# 6552 "ml/parser.ml" - : 'paren_module_expr)) -; (fun __caml_parser_env -> - let _3 = (Parsing.peek_val __caml_parser_env 6 : 'attributes) in - let _4 = (Parsing.peek_val __caml_parser_env 5 : 'expr) in - let _6 = (Parsing.peek_val __caml_parser_env 3 : 'package_type) in - let _8 = (Parsing.peek_val __caml_parser_env 1 : 'package_type) in - Obj.repr( -# 648 "ml/parser.mly" - ( mkmod ~attrs:_3 - (Pmod_unpack( - ghexp(Pexp_coerce(_4, (), - ghtyp(Ptyp_package _8))))) ) -# 6565 "ml/parser.ml" - : 'paren_module_expr)) -; (fun __caml_parser_env -> - let _3 = (Parsing.peek_val __caml_parser_env 4 : 'attributes) in - let _4 = (Parsing.peek_val __caml_parser_env 3 : 'expr) in - let _6 = (Parsing.peek_val __caml_parser_env 1 : 'package_type) in - Obj.repr( -# 653 "ml/parser.mly" - ( mkmod ~attrs:_3 - (Pmod_unpack( - ghexp(Pexp_coerce(_4, (), ghtyp(Ptyp_package _6))))) ) -# 6576 "ml/parser.ml" - : 'paren_module_expr)) -; (fun __caml_parser_env -> - let _3 = (Parsing.peek_val __caml_parser_env 3 : 'attributes) in - let _4 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in - Obj.repr( -# 657 "ml/parser.mly" - ( unclosed "(" 1 ")" 6 ) -# 6584 "ml/parser.ml" - : 'paren_module_expr)) -; (fun __caml_parser_env -> - let _3 = (Parsing.peek_val __caml_parser_env 3 : 'attributes) in - let _4 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in - Obj.repr( -# 659 "ml/parser.mly" - ( unclosed "(" 1 ")" 6 ) -# 6592 "ml/parser.ml" - : 'paren_module_expr)) -; (fun __caml_parser_env -> - let _3 = (Parsing.peek_val __caml_parser_env 2 : 'attributes) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'expr) in - Obj.repr( -# 661 "ml/parser.mly" - ( unclosed "(" 1 ")" 5 ) -# 6600 "ml/parser.ml" - : 'paren_module_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'seq_expr) in - let _2 = (Parsing.peek_val __caml_parser_env 1 : 'post_item_attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'structure_tail) in - Obj.repr( -# 666 "ml/parser.mly" - ( mark_rhs_docs 1 2; - (text_str 1) @ mkstrexp _1 _2 :: _3 ) -# 6610 "ml/parser.ml" - : 'structure)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'structure_tail) in - Obj.repr( -# 668 "ml/parser.mly" - ( _1 ) -# 6617 "ml/parser.ml" - : 'structure)) -; (fun __caml_parser_env -> - Obj.repr( -# 671 "ml/parser.mly" - ( [] ) -# 6623 "ml/parser.ml" - : 'structure_tail)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'structure) in - Obj.repr( -# 672 "ml/parser.mly" - ( (text_str 1) @ _2 ) -# 6630 "ml/parser.ml" - : 'structure_tail)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'structure_item) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'structure_tail) in - Obj.repr( -# 673 "ml/parser.mly" - ( (text_str 1) @ _1 :: _2 ) -# 6638 "ml/parser.ml" - : 'structure_tail)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'let_bindings) in - Obj.repr( -# 677 "ml/parser.mly" - ( val_of_let_bindings _1 ) -# 6645 "ml/parser.ml" - : 'structure_item)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'primitive_declaration) in - Obj.repr( -# 679 "ml/parser.mly" - ( let (body, ext) = _1 in mkstr_ext (Pstr_primitive body) ext ) -# 6652 "ml/parser.ml" - : 'structure_item)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'value_description) in - Obj.repr( -# 681 "ml/parser.mly" - ( let (body, ext) = _1 in mkstr_ext (Pstr_primitive body) ext ) -# 6659 "ml/parser.ml" - : 'structure_item)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'type_declarations) in - Obj.repr( -# 683 "ml/parser.mly" - ( let (nr, l, ext ) = _1 in mkstr_ext (Pstr_type (nr, List.rev l)) ext ) -# 6666 "ml/parser.ml" - : 'structure_item)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'str_type_extension) in - Obj.repr( -# 685 "ml/parser.mly" - ( let (l, ext) = _1 in mkstr_ext (Pstr_typext l) ext ) -# 6673 "ml/parser.ml" - : 'structure_item)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'str_exception_declaration) in - Obj.repr( -# 687 "ml/parser.mly" - ( let (l, ext) = _1 in mkstr_ext (Pstr_exception l) ext ) -# 6680 "ml/parser.ml" - : 'structure_item)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'module_binding) in - Obj.repr( -# 689 "ml/parser.mly" - ( let (body, ext) = _1 in mkstr_ext (Pstr_module body) ext ) -# 6687 "ml/parser.ml" - : 'structure_item)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'rec_module_bindings) in - Obj.repr( -# 691 "ml/parser.mly" - ( let (l, ext) = _1 in mkstr_ext (Pstr_recmodule(List.rev l)) ext ) -# 6694 "ml/parser.ml" - : 'structure_item)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'module_type_declaration) in - Obj.repr( -# 693 "ml/parser.mly" - ( let (body, ext) = _1 in mkstr_ext (Pstr_modtype body) ext ) -# 6701 "ml/parser.ml" - : 'structure_item)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'open_statement) in - Obj.repr( -# 695 "ml/parser.mly" - ( let (body, ext) = _1 in mkstr_ext (Pstr_open body) ext ) -# 6708 "ml/parser.ml" - : 'structure_item)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'class_type_declarations) in - Obj.repr( -# 697 "ml/parser.mly" - ( let (_l, ext) = _1 in mkstr_ext (Pstr_class_type ()) ext ) -# 6715 "ml/parser.ml" - : 'structure_item)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'str_include_statement) in - Obj.repr( -# 699 "ml/parser.mly" - ( let (body, ext) = _1 in mkstr_ext (Pstr_include body) ext ) -# 6722 "ml/parser.ml" - : 'structure_item)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'item_extension) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in - Obj.repr( -# 701 "ml/parser.mly" - ( mkstr(Pstr_extension (_1, (add_docs_attrs (symbol_docs ()) _2))) ) -# 6730 "ml/parser.ml" - : 'structure_item)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'floating_attribute) in - Obj.repr( -# 703 "ml/parser.mly" - ( mark_symbol_docs (); - mkstr(Pstr_attribute _1) ) -# 6738 "ml/parser.ml" - : 'structure_item)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'ext_attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 1 : 'module_expr) in - let _4 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in - Obj.repr( -# 708 "ml/parser.mly" - ( let (ext, attrs) = _2 in - Incl.mk _3 ~attrs:(attrs@_4) - ~loc:(symbol_rloc()) ~docs:(symbol_docs ()) - , ext ) -# 6750 "ml/parser.ml" - : 'str_include_statement)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'module_expr) in - Obj.repr( -# 715 "ml/parser.mly" - ( _2 ) -# 6757 "ml/parser.ml" - : 'module_binding_body)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'module_type) in - let _4 = (Parsing.peek_val __caml_parser_env 0 : 'module_expr) in - Obj.repr( -# 717 "ml/parser.mly" - ( mkmod(Pmod_constraint(_4, _2)) ) -# 6765 "ml/parser.ml" - : 'module_binding_body)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'functor_arg) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'module_binding_body) in - Obj.repr( -# 719 "ml/parser.mly" - ( mkmod(Pmod_functor(fst _1, snd _1, _2)) ) -# 6773 "ml/parser.ml" - : 'module_binding_body)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 3 : 'ext_attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 2 : string) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'module_binding_body) in - let _5 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in - Obj.repr( -# 723 "ml/parser.mly" - ( let (ext, attrs) = _2 in - Mb.mk (mkrhs _3 3) _4 ~attrs:(attrs@_5) - ~loc:(symbol_rloc ()) ~docs:(symbol_docs ()) - , ext ) -# 6786 "ml/parser.ml" - : 'module_binding)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'rec_module_binding) in - Obj.repr( -# 729 "ml/parser.mly" - ( let (b, ext) = _1 in ([b], ext) ) -# 6793 "ml/parser.ml" - : 'rec_module_bindings)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'rec_module_bindings) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'and_module_binding) in - Obj.repr( -# 731 "ml/parser.mly" - ( let (l, ext) = _1 in (_2 :: l, ext) ) -# 6801 "ml/parser.ml" - : 'rec_module_bindings)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 4 : 'ext_attributes) in - let _4 = (Parsing.peek_val __caml_parser_env 2 : string) in - let _5 = (Parsing.peek_val __caml_parser_env 1 : 'module_binding_body) in - let _6 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in - Obj.repr( -# 735 "ml/parser.mly" - ( let (ext, attrs) = _2 in - Mb.mk (mkrhs _4 4) _5 ~attrs:(attrs@_6) - ~loc:(symbol_rloc ()) ~docs:(symbol_docs ()) - , ext ) -# 6814 "ml/parser.ml" - : 'rec_module_binding)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 3 : 'attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 2 : string) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'module_binding_body) in - let _5 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in - Obj.repr( -# 742 "ml/parser.mly" - ( Mb.mk (mkrhs _3 3) _4 ~attrs:(_2@_5) ~loc:(symbol_rloc ()) - ~text:(symbol_text ()) ~docs:(symbol_docs ()) ) -# 6825 "ml/parser.ml" - : 'and_module_binding)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'mty_longident) in - Obj.repr( -# 750 "ml/parser.mly" - ( mkmty(Pmty_ident (mkrhs _1 1)) ) -# 6832 "ml/parser.ml" - : 'module_type)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 1 : 'signature) in - Obj.repr( -# 752 "ml/parser.mly" - ( mkmty ~attrs:_2 (Pmty_signature (extra_sig 3 _3)) ) -# 6840 "ml/parser.ml" - : 'module_type)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 1 : 'signature) in - Obj.repr( -# 754 "ml/parser.mly" - ( unclosed "sig" 1 "end" 4 ) -# 6848 "ml/parser.ml" - : 'module_type)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 3 : 'attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 2 : 'functor_args) in - let _5 = (Parsing.peek_val __caml_parser_env 0 : 'module_type) in - Obj.repr( -# 757 "ml/parser.mly" - ( let mty = - List.fold_left - (fun acc (n, t) -> mkmty(Pmty_functor(n, t, acc))) - _5 _3 - in wrap_mty_attrs mty _2 ) -# 6861 "ml/parser.ml" - : 'module_type)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'module_type) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'module_type) in - Obj.repr( -# 764 "ml/parser.mly" - ( mkmty(Pmty_functor(mknoloc "_", Some _1, _3)) ) -# 6869 "ml/parser.ml" - : 'module_type)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'module_type) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'with_constraints) in - Obj.repr( -# 766 "ml/parser.mly" - ( mkmty(Pmty_with(_1, List.rev _3)) ) -# 6877 "ml/parser.ml" - : 'module_type)) -; (fun __caml_parser_env -> - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'attributes) in - let _5 = (Parsing.peek_val __caml_parser_env 0 : 'module_expr) in - Obj.repr( -# 768 "ml/parser.mly" - ( mkmty ~attrs:_4 (Pmty_typeof _5) ) -# 6885 "ml/parser.ml" - : 'module_type)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 1 : 'module_type) in - Obj.repr( -# 772 "ml/parser.mly" - ( _2 ) -# 6892 "ml/parser.ml" - : 'module_type)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 1 : 'module_type) in - Obj.repr( -# 774 "ml/parser.mly" - ( unclosed "(" 1 ")" 3 ) -# 6899 "ml/parser.ml" - : 'module_type)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'extension) in - Obj.repr( -# 776 "ml/parser.mly" - ( mkmty(Pmty_extension _1) ) -# 6906 "ml/parser.ml" - : 'module_type)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'module_type) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'attribute) in - Obj.repr( -# 778 "ml/parser.mly" - ( Mty.attr _1 _2 ) -# 6914 "ml/parser.ml" - : 'module_type)) -; (fun __caml_parser_env -> - Obj.repr( -# 781 "ml/parser.mly" - ( [] ) -# 6920 "ml/parser.ml" - : 'signature)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'signature) in - Obj.repr( -# 782 "ml/parser.mly" - ( (text_sig 1) @ _2 ) -# 6927 "ml/parser.ml" - : 'signature)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'signature_item) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'signature) in - Obj.repr( -# 783 "ml/parser.mly" - ( (text_sig 1) @ _1 :: _2 ) -# 6935 "ml/parser.ml" - : 'signature)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'value_description) in - Obj.repr( -# 787 "ml/parser.mly" - ( let (body, ext) = _1 in mksig_ext (Psig_value body) ext ) -# 6942 "ml/parser.ml" - : 'signature_item)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'primitive_declaration) in - Obj.repr( -# 789 "ml/parser.mly" - ( let (body, ext) = _1 in mksig_ext (Psig_value body) ext) -# 6949 "ml/parser.ml" - : 'signature_item)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'type_declarations) in - Obj.repr( -# 791 "ml/parser.mly" - ( let (nr, l, ext) = _1 in mksig_ext (Psig_type (nr, List.rev l)) ext ) -# 6956 "ml/parser.ml" - : 'signature_item)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'sig_type_extension) in - Obj.repr( -# 793 "ml/parser.mly" - ( let (l, ext) = _1 in mksig_ext (Psig_typext l) ext ) -# 6963 "ml/parser.ml" - : 'signature_item)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'sig_exception_declaration) in - Obj.repr( -# 795 "ml/parser.mly" - ( let (l, ext) = _1 in mksig_ext (Psig_exception l) ext ) -# 6970 "ml/parser.ml" - : 'signature_item)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'module_declaration) in - Obj.repr( -# 797 "ml/parser.mly" - ( let (body, ext) = _1 in mksig_ext (Psig_module body) ext ) -# 6977 "ml/parser.ml" - : 'signature_item)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'module_alias) in - Obj.repr( -# 799 "ml/parser.mly" - ( let (body, ext) = _1 in mksig_ext (Psig_module body) ext ) -# 6984 "ml/parser.ml" - : 'signature_item)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'rec_module_declarations) in - Obj.repr( -# 801 "ml/parser.mly" - ( let (l, ext) = _1 in mksig_ext (Psig_recmodule (List.rev l)) ext ) -# 6991 "ml/parser.ml" - : 'signature_item)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'module_type_declaration) in - Obj.repr( -# 803 "ml/parser.mly" - ( let (body, ext) = _1 in mksig_ext (Psig_modtype body) ext ) -# 6998 "ml/parser.ml" - : 'signature_item)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'open_statement) in - Obj.repr( -# 805 "ml/parser.mly" - ( let (body, ext) = _1 in mksig_ext (Psig_open body) ext ) -# 7005 "ml/parser.ml" - : 'signature_item)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'sig_include_statement) in - Obj.repr( -# 807 "ml/parser.mly" - ( let (body, ext) = _1 in mksig_ext (Psig_include body) ext ) -# 7012 "ml/parser.ml" - : 'signature_item)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'class_type_declarations) in - Obj.repr( -# 809 "ml/parser.mly" - ( let (_l, ext) = _1 in mksig_ext (Psig_class_type ()) ext ) -# 7019 "ml/parser.ml" - : 'signature_item)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'item_extension) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in - Obj.repr( -# 811 "ml/parser.mly" - ( mksig(Psig_extension (_1, (add_docs_attrs (symbol_docs ()) _2))) ) -# 7027 "ml/parser.ml" - : 'signature_item)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'floating_attribute) in - Obj.repr( -# 813 "ml/parser.mly" - ( mark_symbol_docs (); - mksig(Psig_attribute _1) ) -# 7035 "ml/parser.ml" - : 'signature_item)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 3 : 'override_flag) in - let _3 = (Parsing.peek_val __caml_parser_env 2 : 'ext_attributes) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'mod_longident) in - let _5 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in - Obj.repr( -# 818 "ml/parser.mly" - ( let (ext, attrs) = _3 in - Opn.mk (mkrhs _4 4) ~override:_2 ~attrs:(attrs@_5) - ~loc:(symbol_rloc()) ~docs:(symbol_docs ()) - , ext) -# 7048 "ml/parser.ml" - : 'open_statement)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'ext_attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 1 : 'module_type) in - let _4 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in - Obj.repr( -# 825 "ml/parser.mly" - ( let (ext, attrs) = _2 in - Incl.mk _3 ~attrs:(attrs@_4) - ~loc:(symbol_rloc()) ~docs:(symbol_docs ()) - , ext) -# 7060 "ml/parser.ml" - : 'sig_include_statement)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'module_type) in - Obj.repr( -# 832 "ml/parser.mly" - ( _2 ) -# 7067 "ml/parser.ml" - : 'module_declaration_body)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 4 : string) in - let _4 = (Parsing.peek_val __caml_parser_env 2 : 'module_type) in - let _6 = (Parsing.peek_val __caml_parser_env 0 : 'module_declaration_body) in - Obj.repr( -# 834 "ml/parser.mly" - ( mkmty(Pmty_functor(mkrhs _2 2, Some _4, _6)) ) -# 7076 "ml/parser.ml" - : 'module_declaration_body)) -; (fun __caml_parser_env -> - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'module_declaration_body) in - Obj.repr( -# 836 "ml/parser.mly" - ( mkmty(Pmty_functor(mkrhs "*" 1, None, _3)) ) -# 7083 "ml/parser.ml" - : 'module_declaration_body)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 3 : 'ext_attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 2 : string) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'module_declaration_body) in - let _5 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in - Obj.repr( -# 840 "ml/parser.mly" - ( let (ext, attrs) = _2 in - Md.mk (mkrhs _3 3) _4 ~attrs:(attrs@_5) - ~loc:(symbol_rloc()) ~docs:(symbol_docs ()) - , ext ) -# 7096 "ml/parser.ml" - : 'module_declaration)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 4 : 'ext_attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 3 : string) in - let _5 = (Parsing.peek_val __caml_parser_env 1 : 'mod_longident) in - let _6 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in - Obj.repr( -# 847 "ml/parser.mly" - ( let (ext, attrs) = _2 in - Md.mk (mkrhs _3 3) - (Mty.alias ~loc:(rhs_loc 5) (mkrhs _5 5)) ~attrs:(attrs@_6) - ~loc:(symbol_rloc()) ~docs:(symbol_docs ()) - , ext ) -# 7110 "ml/parser.ml" - : 'module_alias)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'rec_module_declaration) in - Obj.repr( -# 855 "ml/parser.mly" - ( let (body, ext) = _1 in ([body], ext) ) -# 7117 "ml/parser.ml" - : 'rec_module_declarations)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'rec_module_declarations) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'and_module_declaration) in - Obj.repr( -# 857 "ml/parser.mly" - ( let (l, ext) = _1 in (_2 :: l, ext) ) -# 7125 "ml/parser.ml" - : 'rec_module_declarations)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 5 : 'ext_attributes) in - let _4 = (Parsing.peek_val __caml_parser_env 3 : string) in - let _6 = (Parsing.peek_val __caml_parser_env 1 : 'module_type) in - let _7 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in - Obj.repr( -# 861 "ml/parser.mly" - ( let (ext, attrs) = _2 in - Md.mk (mkrhs _4 4) _6 ~attrs:(attrs@_7) - ~loc:(symbol_rloc()) ~docs:(symbol_docs ()) - , ext) -# 7138 "ml/parser.ml" - : 'rec_module_declaration)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 4 : 'attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 3 : string) in - let _5 = (Parsing.peek_val __caml_parser_env 1 : 'module_type) in - let _6 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in - Obj.repr( -# 868 "ml/parser.mly" - ( Md.mk (mkrhs _3 3) _5 ~attrs:(_2@_6) ~loc:(symbol_rloc()) - ~text:(symbol_text()) ~docs:(symbol_docs()) ) -# 7149 "ml/parser.ml" - : 'and_module_declaration)) -; (fun __caml_parser_env -> - Obj.repr( -# 872 "ml/parser.mly" - ( None ) -# 7155 "ml/parser.ml" - : 'module_type_declaration_body)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'module_type) in - Obj.repr( -# 873 "ml/parser.mly" - ( Some _2 ) -# 7162 "ml/parser.ml" - : 'module_type_declaration_body)) -; (fun __caml_parser_env -> - let _3 = (Parsing.peek_val __caml_parser_env 3 : 'ext_attributes) in - let _4 = (Parsing.peek_val __caml_parser_env 2 : 'ident) in - let _5 = (Parsing.peek_val __caml_parser_env 1 : 'module_type_declaration_body) in - let _6 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in - Obj.repr( -# 878 "ml/parser.mly" - ( let (ext, attrs) = _3 in - Mtd.mk (mkrhs _4 4) ?typ:_5 ~attrs:(attrs@_6) - ~loc:(symbol_rloc()) ~docs:(symbol_docs ()) - , ext ) -# 7175 "ml/parser.ml" - : 'module_type_declaration)) -; (fun __caml_parser_env -> - Obj.repr( -# 886 "ml/parser.mly" - ( [] ) -# 7181 "ml/parser.ml" - : 'class_type_parameters)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 1 : 'type_parameter_list) in - Obj.repr( -# 887 "ml/parser.mly" - ( List.rev _2 ) -# 7188 "ml/parser.ml" - : 'class_type_parameters)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'class_self_pattern) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'class_fields) in - Obj.repr( -# 891 "ml/parser.mly" - ( assert false ) -# 7196 "ml/parser.ml" - : 'class_structure)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 1 : 'pattern) in - Obj.repr( -# 895 "ml/parser.mly" - ( reloc_pat _2 ) -# 7203 "ml/parser.ml" - : 'class_self_pattern)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 3 : 'pattern) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'core_type) in - Obj.repr( -# 897 "ml/parser.mly" - ( mkpat(Ppat_constraint(_2, _4)) ) -# 7211 "ml/parser.ml" - : 'class_self_pattern)) -; (fun __caml_parser_env -> - Obj.repr( -# 899 "ml/parser.mly" - ( ghpat(Ppat_any) ) -# 7217 "ml/parser.ml" - : 'class_self_pattern)) -; (fun __caml_parser_env -> - Obj.repr( -# 903 "ml/parser.mly" - ( [] ) -# 7223 "ml/parser.ml" - : 'class_fields)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'class_fields) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'class_field) in - Obj.repr( -# 905 "ml/parser.mly" - ( _2 :: (text_cstr 2) @ _1 ) -# 7231 "ml/parser.ml" - : 'class_fields)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 1 : 'value) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in - Obj.repr( -# 909 "ml/parser.mly" - ( let _v, attrs = _2 in - mkcf (assert false) ~attrs:(attrs@_3) ~docs:(symbol_docs ()) ) -# 7240 "ml/parser.ml" - : 'class_field)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 1 : 'method_) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in - Obj.repr( -# 912 "ml/parser.mly" - ( let _meth, attrs = _2 in - mkcf (assert false) ~attrs:(attrs@_3) ~docs:(symbol_docs ()) ) -# 7249 "ml/parser.ml" - : 'class_field)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 1 : 'constrain_field) in - let _4 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in - Obj.repr( -# 915 "ml/parser.mly" - ( mkcf (assert false) ~attrs:(_2@_4) ~docs:(symbol_docs ()) ) -# 7258 "ml/parser.ml" - : 'class_field)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 1 : 'seq_expr) in - let _4 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in - Obj.repr( -# 917 "ml/parser.mly" - ( mkcf (assert false) ~attrs:(_2@_4) ~docs:(symbol_docs ()) ) -# 7267 "ml/parser.ml" - : 'class_field)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'item_extension) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in - Obj.repr( -# 919 "ml/parser.mly" - ( mkcf (assert false) ~attrs:_2 ~docs:(symbol_docs ()) ) -# 7275 "ml/parser.ml" - : 'class_field)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'floating_attribute) in - Obj.repr( -# 921 "ml/parser.mly" - ( mark_symbol_docs (); - mkcf (assert false) ) -# 7283 "ml/parser.ml" - : 'class_field)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 6 : 'override_flag) in - let _2 = (Parsing.peek_val __caml_parser_env 5 : 'attributes) in - let _5 = (Parsing.peek_val __caml_parser_env 2 : 'label) in - let _7 = (Parsing.peek_val __caml_parser_env 0 : 'core_type) in - Obj.repr( -# 927 "ml/parser.mly" - ( if _1 = Override then syntax_error (); - (mkloc _5 (rhs_loc 5), Mutable, assert false), _2 ) -# 7294 "ml/parser.ml" - : 'value)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 6 : 'override_flag) in - let _2 = (Parsing.peek_val __caml_parser_env 5 : 'attributes) in - let _4 = (Parsing.peek_val __caml_parser_env 3 : 'mutable_flag) in - let _5 = (Parsing.peek_val __caml_parser_env 2 : 'label) in - let _7 = (Parsing.peek_val __caml_parser_env 0 : 'core_type) in - Obj.repr( -# 930 "ml/parser.mly" - ( if _1 = Override then syntax_error (); - (mkrhs _5 5, _4, assert false), _2 ) -# 7306 "ml/parser.ml" - : 'value)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 5 : 'override_flag) in - let _2 = (Parsing.peek_val __caml_parser_env 4 : 'attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 3 : 'mutable_flag) in - let _4 = (Parsing.peek_val __caml_parser_env 2 : 'label) in - let _6 = (Parsing.peek_val __caml_parser_env 0 : 'seq_expr) in - Obj.repr( -# 933 "ml/parser.mly" - ( (mkrhs _4 4, _3, assert false), _2 ) -# 7317 "ml/parser.ml" - : 'value)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 6 : 'override_flag) in - let _2 = (Parsing.peek_val __caml_parser_env 5 : 'attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 4 : 'mutable_flag) in - let _4 = (Parsing.peek_val __caml_parser_env 3 : 'label) in - let _5 = (Parsing.peek_val __caml_parser_env 2 : 'type_constraint) in - let _7 = (Parsing.peek_val __caml_parser_env 0 : 'seq_expr) in - Obj.repr( -# 935 "ml/parser.mly" - ( - let _e = mkexp_constraint _7 _5 in - (mkrhs _4 4, _3, assert false), _2 - ) -# 7332 "ml/parser.ml" - : 'value)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 6 : 'override_flag) in - let _2 = (Parsing.peek_val __caml_parser_env 5 : 'attributes) in - let _5 = (Parsing.peek_val __caml_parser_env 2 : 'label) in - let _7 = (Parsing.peek_val __caml_parser_env 0 : 'poly_type) in - Obj.repr( -# 943 "ml/parser.mly" - ( if _1 = Override then syntax_error (); - (mkloc _5 (rhs_loc 5), Private, assert false), _2 ) -# 7343 "ml/parser.ml" - : 'method_)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 6 : 'override_flag) in - let _2 = (Parsing.peek_val __caml_parser_env 5 : 'attributes) in - let _4 = (Parsing.peek_val __caml_parser_env 3 : 'private_flag) in - let _5 = (Parsing.peek_val __caml_parser_env 2 : 'label) in - let _7 = (Parsing.peek_val __caml_parser_env 0 : 'poly_type) in - Obj.repr( -# 946 "ml/parser.mly" - ( if _1 = Override then syntax_error (); - (mkloc _5 (rhs_loc 5), _4, assert false), _2 ) -# 7355 "ml/parser.ml" - : 'method_)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 4 : 'override_flag) in - let _2 = (Parsing.peek_val __caml_parser_env 3 : 'attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 2 : 'private_flag) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'label) in - let _5 = (Parsing.peek_val __caml_parser_env 0 : 'strict_binding) in - Obj.repr( -# 949 "ml/parser.mly" - ( (mkloc _4 (rhs_loc 4), _3, - assert false), _2 ) -# 7367 "ml/parser.ml" - : 'method_)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 7 : 'override_flag) in - let _2 = (Parsing.peek_val __caml_parser_env 6 : 'attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 5 : 'private_flag) in - let _4 = (Parsing.peek_val __caml_parser_env 4 : 'label) in - let _6 = (Parsing.peek_val __caml_parser_env 2 : 'poly_type) in - let _8 = (Parsing.peek_val __caml_parser_env 0 : 'seq_expr) in - Obj.repr( -# 952 "ml/parser.mly" - ( (mkloc _4 (rhs_loc 4), _3, - assert false), _2 ) -# 7380 "ml/parser.ml" - : 'method_)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 10 : 'override_flag) in - let _2 = (Parsing.peek_val __caml_parser_env 9 : 'attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 8 : 'private_flag) in - let _4 = (Parsing.peek_val __caml_parser_env 7 : 'label) in - let _7 = (Parsing.peek_val __caml_parser_env 4 : 'lident_list) in - let _9 = (Parsing.peek_val __caml_parser_env 2 : 'core_type) in - let _11 = (Parsing.peek_val __caml_parser_env 0 : 'seq_expr) in - Obj.repr( -# 956 "ml/parser.mly" - ( let _exp, _poly = wrap_type_annotation _7 _9 _11 in - (mkloc _4 (rhs_loc 4), _3, - assert false), _2 ) -# 7395 "ml/parser.ml" - : 'method_)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'core_type_comma_list) in - let _4 = (Parsing.peek_val __caml_parser_env 0 : 'clty_longident) in - Obj.repr( -# 965 "ml/parser.mly" - ( mkcty(assert false) ) -# 7403 "ml/parser.ml" - : 'class_signature)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'clty_longident) in - Obj.repr( -# 967 "ml/parser.mly" - ( mkcty(assert false) ) -# 7410 "ml/parser.ml" - : 'class_signature)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 1 : 'class_sig_body) in - Obj.repr( -# 969 "ml/parser.mly" - ( mkcty ~attrs:_2 (assert false) ) -# 7418 "ml/parser.ml" - : 'class_signature)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 1 : 'class_sig_body) in - Obj.repr( -# 971 "ml/parser.mly" - ( unclosed "object" 1 "end" 4 ) -# 7426 "ml/parser.ml" - : 'class_signature)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'class_signature) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'attribute) in - Obj.repr( -# 973 "ml/parser.mly" - ( assert false ) -# 7434 "ml/parser.ml" - : 'class_signature)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'extension) in - Obj.repr( -# 975 "ml/parser.mly" - ( mkcty(assert false) ) -# 7441 "ml/parser.ml" - : 'class_signature)) -; (fun __caml_parser_env -> - let _3 = (Parsing.peek_val __caml_parser_env 4 : 'override_flag) in - let _4 = (Parsing.peek_val __caml_parser_env 3 : 'attributes) in - let _5 = (Parsing.peek_val __caml_parser_env 2 : 'mod_longident) in - let _7 = (Parsing.peek_val __caml_parser_env 0 : 'class_signature) in - Obj.repr( -# 977 "ml/parser.mly" - ( wrap_class_type_attrs (mkcty(assert false)) _4 ) -# 7451 "ml/parser.ml" - : 'class_signature)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'class_self_type) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'class_sig_fields) in - Obj.repr( -# 981 "ml/parser.mly" - ( assert false ) -# 7459 "ml/parser.ml" - : 'class_sig_body)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 1 : 'core_type) in - Obj.repr( -# 985 "ml/parser.mly" - ( _2 ) -# 7466 "ml/parser.ml" - : 'class_self_type)) -; (fun __caml_parser_env -> - Obj.repr( -# 987 "ml/parser.mly" - ( mktyp(Ptyp_any) ) -# 7472 "ml/parser.ml" - : 'class_self_type)) -; (fun __caml_parser_env -> - Obj.repr( -# 990 "ml/parser.mly" - ( [] ) -# 7478 "ml/parser.ml" - : 'class_sig_fields)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'class_sig_fields) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'class_sig_field) in - Obj.repr( -# 991 "ml/parser.mly" - ( _2 :: (text_csig 2) @ _1 ) -# 7486 "ml/parser.ml" - : 'class_sig_fields)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 1 : 'class_signature) in - let _4 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in - Obj.repr( -# 995 "ml/parser.mly" - ( mkctf (assert false) ~attrs:(_2@_4) ~docs:(symbol_docs ()) ) -# 7495 "ml/parser.ml" - : 'class_sig_field)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 1 : 'value_type) in - let _4 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in - Obj.repr( -# 997 "ml/parser.mly" - ( mkctf (assert false) ~attrs:(_2@_4) ~docs:(symbol_docs ()) ) -# 7504 "ml/parser.ml" - : 'class_sig_field)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 5 : 'attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 4 : 'private_virtual_flags) in - let _4 = (Parsing.peek_val __caml_parser_env 3 : 'label) in - let _6 = (Parsing.peek_val __caml_parser_env 1 : 'poly_type) in - let _7 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in - Obj.repr( -# 1000 "ml/parser.mly" - ( - let (_p, _v) = _3 in - mkctf (assert false) ~attrs:(_2@_7) ~docs:(symbol_docs ()) - ) -# 7518 "ml/parser.ml" - : 'class_sig_field)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 1 : 'constrain_field) in - let _4 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in - Obj.repr( -# 1005 "ml/parser.mly" - ( mkctf (assert false) ~attrs:(_2@_4) ~docs:(symbol_docs ()) ) -# 7527 "ml/parser.ml" - : 'class_sig_field)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'item_extension) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in - Obj.repr( -# 1007 "ml/parser.mly" - ( mkctf (assert false) ~attrs:_2 ~docs:(symbol_docs ()) ) -# 7535 "ml/parser.ml" - : 'class_sig_field)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'floating_attribute) in - Obj.repr( -# 1009 "ml/parser.mly" - ( mark_symbol_docs (); - mkctf(assert false) ) -# 7543 "ml/parser.ml" - : 'class_sig_field)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 3 : 'mutable_flag) in - let _3 = (Parsing.peek_val __caml_parser_env 2 : 'label) in - let _5 = (Parsing.peek_val __caml_parser_env 0 : 'core_type) in - Obj.repr( -# 1014 "ml/parser.mly" - ( mkrhs _3 3, _2, Virtual, _5 ) -# 7552 "ml/parser.ml" - : 'value_type)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 3 : 'virtual_flag) in - let _3 = (Parsing.peek_val __caml_parser_env 2 : 'label) in - let _5 = (Parsing.peek_val __caml_parser_env 0 : 'core_type) in - Obj.repr( -# 1016 "ml/parser.mly" - ( mkrhs _3 3, Mutable, _2, _5 ) -# 7561 "ml/parser.ml" - : 'value_type)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'label) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'core_type) in - Obj.repr( -# 1018 "ml/parser.mly" - ( mkrhs _1 1, Immutable, Concrete, _3 ) -# 7569 "ml/parser.ml" - : 'value_type)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'core_type) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'core_type) in - Obj.repr( -# 1021 "ml/parser.mly" - ( _1, _3, symbol_rloc() ) -# 7577 "ml/parser.ml" - : 'constrain)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'core_type) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'core_type) in - Obj.repr( -# 1024 "ml/parser.mly" - ( _1, _3 ) -# 7585 "ml/parser.ml" - : 'constrain_field)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'class_type_declaration) in - Obj.repr( -# 1028 "ml/parser.mly" - ( let (body, ext) = _1 in ([body],ext) ) -# 7592 "ml/parser.ml" - : 'class_type_declarations)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'class_type_declarations) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'and_class_type_declaration) in - Obj.repr( -# 1030 "ml/parser.mly" - ( let (l, ext) = _1 in (_2 :: l, ext) ) -# 7600 "ml/parser.ml" - : 'class_type_declarations)) -; (fun __caml_parser_env -> - let _3 = (Parsing.peek_val __caml_parser_env 6 : 'ext_attributes) in - let _4 = (Parsing.peek_val __caml_parser_env 5 : 'virtual_flag) in - let _5 = (Parsing.peek_val __caml_parser_env 4 : 'class_type_parameters) in - let _6 = (Parsing.peek_val __caml_parser_env 3 : string) in - let _8 = (Parsing.peek_val __caml_parser_env 1 : 'class_signature) in - let _9 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in - Obj.repr( -# 1035 "ml/parser.mly" - ( let (ext, _attrs) = _3 in - assert false - , ext) -# 7615 "ml/parser.ml" - : 'class_type_declaration)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 6 : 'attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 5 : 'virtual_flag) in - let _4 = (Parsing.peek_val __caml_parser_env 4 : 'class_type_parameters) in - let _5 = (Parsing.peek_val __caml_parser_env 3 : string) in - let _7 = (Parsing.peek_val __caml_parser_env 1 : 'class_signature) in - let _8 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in - Obj.repr( -# 1043 "ml/parser.mly" - ( assert false ) -# 7629 "ml/parser.ml" - : 'and_class_type_declaration)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in - Obj.repr( -# 1051 "ml/parser.mly" - ( _1 ) -# 7636 "ml/parser.ml" - : 'seq_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'expr) in - Obj.repr( -# 1052 "ml/parser.mly" - ( _1 ) -# 7643 "ml/parser.ml" - : 'seq_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'seq_expr) in - Obj.repr( -# 1053 "ml/parser.mly" - ( mkexp(Pexp_sequence(_1, _3)) ) -# 7651 "ml/parser.ml" - : 'seq_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 4 : 'expr) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'attr_id) in - let _5 = (Parsing.peek_val __caml_parser_env 0 : 'seq_expr) in - Obj.repr( -# 1055 "ml/parser.mly" - ( let seq = mkexp(Pexp_sequence (_1, _5)) in - let payload = PStr [mkstrexp seq []] in - mkexp (Pexp_extension (_4, payload)) ) -# 7662 "ml/parser.ml" - : 'seq_expr)) -; (fun __caml_parser_env -> - let _3 = (Parsing.peek_val __caml_parser_env 2 : 'label_let_pattern) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'opt_default) in - Obj.repr( -# 1061 "ml/parser.mly" - ( (Optional (fst _3), _4, snd _3) ) -# 7670 "ml/parser.ml" - : 'labeled_simple_pattern)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'label_var) in - Obj.repr( -# 1063 "ml/parser.mly" - ( (Optional (fst _2), None, snd _2) ) -# 7677 "ml/parser.ml" - : 'labeled_simple_pattern)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 4 : string) in - let _3 = (Parsing.peek_val __caml_parser_env 2 : 'let_pattern) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'opt_default) in - Obj.repr( -# 1065 "ml/parser.mly" - ( (Optional _1, _4, _3) ) -# 7686 "ml/parser.ml" - : 'labeled_simple_pattern)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : string) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'pattern_var) in - Obj.repr( -# 1067 "ml/parser.mly" - ( (Optional _1, None, _2) ) -# 7694 "ml/parser.ml" - : 'labeled_simple_pattern)) -; (fun __caml_parser_env -> - let _3 = (Parsing.peek_val __caml_parser_env 1 : 'label_let_pattern) in - Obj.repr( -# 1069 "ml/parser.mly" - ( (Labelled (fst _3), None, snd _3) ) -# 7701 "ml/parser.ml" - : 'labeled_simple_pattern)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'label_var) in - Obj.repr( -# 1071 "ml/parser.mly" - ( (Labelled (fst _2), None, snd _2) ) -# 7708 "ml/parser.ml" - : 'labeled_simple_pattern)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : string) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'simple_pattern) in - Obj.repr( -# 1073 "ml/parser.mly" - ( (Labelled _1, None, _2) ) -# 7716 "ml/parser.ml" - : 'labeled_simple_pattern)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'simple_pattern) in - Obj.repr( -# 1075 "ml/parser.mly" - ( (Nolabel, None, _1) ) -# 7723 "ml/parser.ml" - : 'labeled_simple_pattern)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in - Obj.repr( -# 1078 "ml/parser.mly" - ( mkpat(Ppat_var (mkrhs _1 1)) ) -# 7730 "ml/parser.ml" - : 'pattern_var)) -; (fun __caml_parser_env -> - Obj.repr( -# 1079 "ml/parser.mly" - ( mkpat Ppat_any ) -# 7736 "ml/parser.ml" - : 'pattern_var)) -; (fun __caml_parser_env -> - Obj.repr( -# 1082 "ml/parser.mly" - ( None ) -# 7742 "ml/parser.ml" - : 'opt_default)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'seq_expr) in - Obj.repr( -# 1083 "ml/parser.mly" - ( Some _2 ) -# 7749 "ml/parser.ml" - : 'opt_default)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'label_var) in - Obj.repr( -# 1087 "ml/parser.mly" - ( _1 ) -# 7756 "ml/parser.ml" - : 'label_let_pattern)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'label_var) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'core_type) in - Obj.repr( -# 1089 "ml/parser.mly" - ( let (lab, pat) = _1 in (lab, mkpat(Ppat_constraint(pat, _3))) ) -# 7764 "ml/parser.ml" - : 'label_let_pattern)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in - Obj.repr( -# 1092 "ml/parser.mly" - ( (_1, mkpat(Ppat_var (mkrhs _1 1))) ) -# 7771 "ml/parser.ml" - : 'label_var)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'pattern) in - Obj.repr( -# 1096 "ml/parser.mly" - ( _1 ) -# 7778 "ml/parser.ml" - : 'let_pattern)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'pattern) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'core_type) in - Obj.repr( -# 1098 "ml/parser.mly" - ( mkpat(Ppat_constraint(_1, _3)) ) -# 7786 "ml/parser.ml" - : 'let_pattern)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'simple_expr) in - Obj.repr( -# 1102 "ml/parser.mly" - ( _1 ) -# 7793 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'simple_expr) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'simple_labeled_expr_list) in - Obj.repr( -# 1104 "ml/parser.mly" - ( mkexp(Pexp_apply(_1, List.rev _2)) ) -# 7801 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'let_bindings) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'seq_expr) in - Obj.repr( -# 1106 "ml/parser.mly" - ( expr_of_let_bindings _1 _3 ) -# 7809 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _3 = (Parsing.peek_val __caml_parser_env 4 : 'ext_attributes) in - let _4 = (Parsing.peek_val __caml_parser_env 3 : string) in - let _5 = (Parsing.peek_val __caml_parser_env 2 : 'module_binding_body) in - let _7 = (Parsing.peek_val __caml_parser_env 0 : 'seq_expr) in - Obj.repr( -# 1108 "ml/parser.mly" - ( mkexp_attrs (Pexp_letmodule(mkrhs _4 4, _5, _7)) _3 ) -# 7819 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _3 = (Parsing.peek_val __caml_parser_env 3 : 'ext_attributes) in - let _4 = (Parsing.peek_val __caml_parser_env 2 : 'let_exception_declaration) in - let _6 = (Parsing.peek_val __caml_parser_env 0 : 'seq_expr) in - Obj.repr( -# 1110 "ml/parser.mly" - ( mkexp_attrs (Pexp_letexception(_4, _6)) _3 ) -# 7828 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _3 = (Parsing.peek_val __caml_parser_env 4 : 'override_flag) in - let _4 = (Parsing.peek_val __caml_parser_env 3 : 'ext_attributes) in - let _5 = (Parsing.peek_val __caml_parser_env 2 : 'mod_longident) in - let _7 = (Parsing.peek_val __caml_parser_env 0 : 'seq_expr) in - Obj.repr( -# 1112 "ml/parser.mly" - ( mkexp_attrs (Pexp_open(_3, mkrhs _5 5, _7)) _4 ) -# 7838 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'ext_attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 1 : 'opt_bar) in - let _4 = (Parsing.peek_val __caml_parser_env 0 : 'match_cases) in - Obj.repr( -# 1114 "ml/parser.mly" - ( mkexp_attrs (Pexp_function(List.rev _4)) _2 ) -# 7847 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'ext_attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 1 : 'labeled_simple_pattern) in - let _4 = (Parsing.peek_val __caml_parser_env 0 : 'fun_def) in - Obj.repr( -# 1116 "ml/parser.mly" - ( let (l,o,p) = _3 in - mkexp_attrs (Pexp_fun(l, o, p, _4)) _2 ) -# 7857 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 5 : 'ext_attributes) in - let _5 = (Parsing.peek_val __caml_parser_env 2 : 'lident_list) in - let _7 = (Parsing.peek_val __caml_parser_env 0 : 'fun_def) in - Obj.repr( -# 1119 "ml/parser.mly" - ( mkexp_attrs (mk_newtypes _5 _7).pexp_desc _2 ) -# 7866 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 4 : 'ext_attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 3 : 'seq_expr) in - let _5 = (Parsing.peek_val __caml_parser_env 1 : 'opt_bar) in - let _6 = (Parsing.peek_val __caml_parser_env 0 : 'match_cases) in - Obj.repr( -# 1121 "ml/parser.mly" - ( mkexp_attrs (Pexp_match(_3, List.rev _6)) _2 ) -# 7876 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 4 : 'ext_attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 3 : 'seq_expr) in - let _5 = (Parsing.peek_val __caml_parser_env 1 : 'opt_bar) in - let _6 = (Parsing.peek_val __caml_parser_env 0 : 'match_cases) in - Obj.repr( -# 1123 "ml/parser.mly" - ( mkexp_attrs (Pexp_try(_3, List.rev _6)) _2 ) -# 7886 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 3 : 'ext_attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 2 : 'seq_expr) in - Obj.repr( -# 1125 "ml/parser.mly" - ( syntax_error() ) -# 7894 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'expr_comma_list) in - Obj.repr( -# 1127 "ml/parser.mly" - ( mkexp(Pexp_tuple(List.rev _1)) ) -# 7901 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'constr_longident) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'simple_expr) in - Obj.repr( -# 1129 "ml/parser.mly" - ( mkexp(Pexp_construct(mkrhs _1 1, Some _2)) ) -# 7909 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'name_tag) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'simple_expr) in - Obj.repr( -# 1131 "ml/parser.mly" - ( mkexp(Pexp_variant(_1, Some _2)) ) -# 7917 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 5 : 'ext_attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 4 : 'seq_expr) in - let _5 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in - let _7 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in - Obj.repr( -# 1133 "ml/parser.mly" - ( mkexp_attrs(Pexp_ifthenelse(_3, _5, Some _7)) _2 ) -# 7927 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 3 : 'ext_attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 2 : 'seq_expr) in - let _5 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in - Obj.repr( -# 1135 "ml/parser.mly" - ( mkexp_attrs (Pexp_ifthenelse(_3, _5, None)) _2 ) -# 7936 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 4 : 'ext_attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 3 : 'seq_expr) in - let _5 = (Parsing.peek_val __caml_parser_env 1 : 'seq_expr) in - Obj.repr( -# 1137 "ml/parser.mly" - ( mkexp_attrs (Pexp_while(_3, _5)) _2 ) -# 7945 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 8 : 'ext_attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 7 : 'pattern) in - let _5 = (Parsing.peek_val __caml_parser_env 5 : 'seq_expr) in - let _6 = (Parsing.peek_val __caml_parser_env 4 : 'direction_flag) in - let _7 = (Parsing.peek_val __caml_parser_env 3 : 'seq_expr) in - let _9 = (Parsing.peek_val __caml_parser_env 1 : 'seq_expr) in - Obj.repr( -# 1140 "ml/parser.mly" - ( mkexp_attrs(Pexp_for(_3, _5, _7, _6, _9)) _2 ) -# 7957 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in - Obj.repr( -# 1142 "ml/parser.mly" - ( mkexp_cons (rhs_loc 2) (ghexp(Pexp_tuple[_1;_3])) (symbol_rloc()) ) -# 7965 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in - let _2 = (Parsing.peek_val __caml_parser_env 1 : string) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in - Obj.repr( -# 1144 "ml/parser.mly" - ( mkinfix _1 _2 _3 ) -# 7974 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in - let _2 = (Parsing.peek_val __caml_parser_env 1 : string) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in - Obj.repr( -# 1146 "ml/parser.mly" - ( mkinfix _1 _2 _3 ) -# 7983 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in - let _2 = (Parsing.peek_val __caml_parser_env 1 : string) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in - Obj.repr( -# 1148 "ml/parser.mly" - ( mkinfix _1 _2 _3 ) -# 7992 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in - let _2 = (Parsing.peek_val __caml_parser_env 1 : string) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in - Obj.repr( -# 1150 "ml/parser.mly" - ( mkinfix _1 _2 _3 ) -# 8001 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in - let _2 = (Parsing.peek_val __caml_parser_env 1 : string) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in - Obj.repr( -# 1152 "ml/parser.mly" - ( mkinfix _1 _2 _3 ) -# 8010 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in - Obj.repr( -# 1154 "ml/parser.mly" - ( mkinfix _1 "+" _3 ) -# 8018 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in - Obj.repr( -# 1156 "ml/parser.mly" - ( mkinfix _1 "+." _3 ) -# 8026 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in - Obj.repr( -# 1158 "ml/parser.mly" - ( mkinfix _1 "+=" _3 ) -# 8034 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in - Obj.repr( -# 1160 "ml/parser.mly" - ( mkinfix _1 "-" _3 ) -# 8042 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in - Obj.repr( -# 1162 "ml/parser.mly" - ( mkinfix _1 "-." _3 ) -# 8050 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in - Obj.repr( -# 1164 "ml/parser.mly" - ( mkinfix _1 "*" _3 ) -# 8058 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in - Obj.repr( -# 1166 "ml/parser.mly" - ( mkinfix _1 "%" _3 ) -# 8066 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in - Obj.repr( -# 1168 "ml/parser.mly" - ( mkinfix _1 "=" _3 ) -# 8074 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in - Obj.repr( -# 1170 "ml/parser.mly" - ( mkinfix _1 "<" _3 ) -# 8082 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in - Obj.repr( -# 1172 "ml/parser.mly" - ( mkinfix _1 ">" _3 ) -# 8090 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in - Obj.repr( -# 1174 "ml/parser.mly" - ( mkinfix _1 "or" _3 ) -# 8098 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in - Obj.repr( -# 1176 "ml/parser.mly" - ( mkinfix _1 "||" _3 ) -# 8106 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in - Obj.repr( -# 1178 "ml/parser.mly" - ( mkinfix _1 "&" _3 ) -# 8114 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in - Obj.repr( -# 1180 "ml/parser.mly" - ( mkinfix _1 "&&" _3 ) -# 8122 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in - Obj.repr( -# 1182 "ml/parser.mly" - ( mkinfix _1 ":=" _3 ) -# 8130 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'subtractive) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in - Obj.repr( -# 1184 "ml/parser.mly" - ( mkuminus _1 _2 ) -# 8138 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'additive) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in - Obj.repr( -# 1186 "ml/parser.mly" - ( mkuplus _1 _2 ) -# 8146 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 4 : 'simple_expr) in - let _3 = (Parsing.peek_val __caml_parser_env 2 : 'label_longident) in - let _5 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in - Obj.repr( -# 1188 "ml/parser.mly" - ( mkexp(Pexp_setfield(_1, mkrhs _3 3, _5)) ) -# 8155 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 6 : 'simple_expr) in - let _4 = (Parsing.peek_val __caml_parser_env 3 : 'seq_expr) in - let _7 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in - Obj.repr( -# 1190 "ml/parser.mly" - ( mkexp(Pexp_apply(ghexp(Pexp_ident(array_function "Array" "set")), - [Nolabel,_1; Nolabel,_4; Nolabel,_7])) ) -# 8165 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 6 : 'simple_expr) in - let _4 = (Parsing.peek_val __caml_parser_env 3 : 'seq_expr) in - let _7 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in - Obj.repr( -# 1193 "ml/parser.mly" - ( mkexp(Pexp_apply(ghexp(Pexp_ident(array_function "String" "set")), - [Nolabel,_1; Nolabel,_4; Nolabel,_7])) ) -# 8175 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 6 : 'simple_expr) in - let _2 = (Parsing.peek_val __caml_parser_env 5 : string) in - let _4 = (Parsing.peek_val __caml_parser_env 3 : 'expr) in - let _7 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in - Obj.repr( -# 1196 "ml/parser.mly" - ( let id = mkexp @@ Pexp_ident( ghloc @@ Lident ("." ^ _2 ^ "[]<-")) in - mkexp @@ Pexp_apply(id , [Nolabel, _1; Nolabel, _4; Nolabel, _7]) ) -# 8186 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 6 : 'simple_expr) in - let _2 = (Parsing.peek_val __caml_parser_env 5 : string) in - let _4 = (Parsing.peek_val __caml_parser_env 3 : 'expr) in - let _7 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in - Obj.repr( -# 1199 "ml/parser.mly" - ( let id = mkexp @@ Pexp_ident( ghloc @@ Lident ("." ^ _2 ^ "()<-")) in - mkexp @@ Pexp_apply(id , [Nolabel, _1; Nolabel, _4; Nolabel, _7]) ) -# 8197 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 6 : 'simple_expr) in - let _2 = (Parsing.peek_val __caml_parser_env 5 : string) in - let _4 = (Parsing.peek_val __caml_parser_env 3 : 'expr) in - let _7 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in - Obj.repr( -# 1202 "ml/parser.mly" - ( let id = mkexp @@ Pexp_ident( ghloc @@ Lident ("." ^ _2 ^ "{}<-")) in - mkexp @@ Pexp_apply(id , [Nolabel, _1; Nolabel, _4; Nolabel, _7]) ) -# 8208 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 8 : 'simple_expr) in - let _3 = (Parsing.peek_val __caml_parser_env 6 : 'mod_longident) in - let _4 = (Parsing.peek_val __caml_parser_env 5 : string) in - let _6 = (Parsing.peek_val __caml_parser_env 3 : 'expr) in - let _9 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in - Obj.repr( -# 1205 "ml/parser.mly" - ( let id = mkexp @@ Pexp_ident( ghloc @@ Ldot(_3,"." ^ _4 ^ "[]<-")) in - mkexp @@ Pexp_apply(id , [Nolabel, _1; Nolabel, _6; Nolabel, _9]) ) -# 8220 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 8 : 'simple_expr) in - let _3 = (Parsing.peek_val __caml_parser_env 6 : 'mod_longident) in - let _4 = (Parsing.peek_val __caml_parser_env 5 : string) in - let _6 = (Parsing.peek_val __caml_parser_env 3 : 'expr) in - let _9 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in - Obj.repr( -# 1208 "ml/parser.mly" - ( let id = mkexp @@ Pexp_ident( ghloc @@ Ldot(_3, "." ^ _4 ^ "()<-")) in - mkexp @@ Pexp_apply(id , [Nolabel, _1; Nolabel, _6; Nolabel, _9]) ) -# 8232 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 8 : 'simple_expr) in - let _3 = (Parsing.peek_val __caml_parser_env 6 : 'mod_longident) in - let _4 = (Parsing.peek_val __caml_parser_env 5 : string) in - let _6 = (Parsing.peek_val __caml_parser_env 3 : 'expr) in - let _9 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in - Obj.repr( -# 1211 "ml/parser.mly" - ( let id = mkexp @@ Pexp_ident( ghloc @@ Ldot(_3, "." ^ _4 ^ "{}<-")) in - mkexp @@ Pexp_apply(id , [Nolabel, _1; Nolabel, _6; Nolabel, _9]) ) -# 8244 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'label) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in - Obj.repr( -# 1214 "ml/parser.mly" - ( mkexp(Pexp_setinstvar(mkrhs _1 1, _3)) ) -# 8252 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 1 : 'ext_attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'simple_expr) in - Obj.repr( -# 1216 "ml/parser.mly" - ( mkexp_attrs (Pexp_assert _3) _2 ) -# 8260 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 1 : 'ext_attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'simple_expr) in - Obj.repr( -# 1218 "ml/parser.mly" - ( mkexp_attrs (Pexp_lazy _3) _2 ) -# 8268 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'ext_attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 1 : 'class_structure) in - Obj.repr( -# 1220 "ml/parser.mly" - ( mkexp_attrs (Pexp_object ()) _2 ) -# 8276 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'ext_attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 1 : 'class_structure) in - Obj.repr( -# 1222 "ml/parser.mly" - ( unclosed "object" 1 "end" 4 ) -# 8284 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'expr) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'attribute) in - Obj.repr( -# 1224 "ml/parser.mly" - ( Exp.attr _1 _2 ) -# 8292 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - Obj.repr( -# 1226 "ml/parser.mly" - ( not_expecting 1 "wildcard \"_\"" ) -# 8298 "ml/parser.ml" - : 'expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'val_longident) in - Obj.repr( -# 1230 "ml/parser.mly" - ( mkexp(Pexp_ident (mkrhs _1 1)) ) -# 8305 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'constant) in - Obj.repr( -# 1232 "ml/parser.mly" - ( mkexp(Pexp_constant _1) ) -# 8312 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'constr_longident) in - Obj.repr( -# 1234 "ml/parser.mly" - ( mkexp(Pexp_construct(mkrhs _1 1, None)) ) -# 8319 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'name_tag) in - Obj.repr( -# 1236 "ml/parser.mly" - ( mkexp(Pexp_variant(_1, None)) ) -# 8326 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 1 : 'seq_expr) in - Obj.repr( -# 1238 "ml/parser.mly" - ( reloc_exp _2 ) -# 8333 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 1 : 'seq_expr) in - Obj.repr( -# 1240 "ml/parser.mly" - ( unclosed "(" 1 ")" 3 ) -# 8340 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'ext_attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 1 : 'seq_expr) in - Obj.repr( -# 1242 "ml/parser.mly" - ( wrap_exp_attrs (reloc_exp _3) _2 (* check location *) ) -# 8348 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 1 : 'ext_attributes) in - Obj.repr( -# 1244 "ml/parser.mly" - ( mkexp_attrs (Pexp_construct (mkloc (Lident "()") (symbol_rloc ()), - None)) _2 ) -# 8356 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'ext_attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 1 : 'seq_expr) in - Obj.repr( -# 1247 "ml/parser.mly" - ( unclosed "begin" 1 "end" 4 ) -# 8364 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'seq_expr) in - let _3 = (Parsing.peek_val __caml_parser_env 1 : 'type_constraint) in - Obj.repr( -# 1249 "ml/parser.mly" - ( mkexp_constraint _2 _3 ) -# 8372 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'simple_expr) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'label_longident) in - Obj.repr( -# 1251 "ml/parser.mly" - ( mkexp(Pexp_field(_1, mkrhs _3 3)) ) -# 8380 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 4 : 'mod_longident) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'seq_expr) in - Obj.repr( -# 1253 "ml/parser.mly" - ( mkexp(Pexp_open(Fresh, mkrhs _1 1, _4)) ) -# 8388 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 3 : 'mod_longident) in - Obj.repr( -# 1255 "ml/parser.mly" - ( mkexp(Pexp_open(Fresh, mkrhs _1 1, - mkexp(Pexp_construct(mkrhs (Lident "()") 1, None)))) ) -# 8396 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 4 : 'mod_longident) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'seq_expr) in - Obj.repr( -# 1258 "ml/parser.mly" - ( unclosed "(" 3 ")" 5 ) -# 8404 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 4 : 'simple_expr) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'seq_expr) in - Obj.repr( -# 1260 "ml/parser.mly" - ( mkexp(Pexp_apply(ghexp(Pexp_ident(array_function "Array" "get")), - [Nolabel,_1; Nolabel,_4])) ) -# 8413 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 4 : 'simple_expr) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'seq_expr) in - Obj.repr( -# 1263 "ml/parser.mly" - ( unclosed "(" 3 ")" 5 ) -# 8421 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 4 : 'simple_expr) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'seq_expr) in - Obj.repr( -# 1265 "ml/parser.mly" - ( mkexp(Pexp_apply(ghexp(Pexp_ident(array_function "String" "get")), - [Nolabel,_1; Nolabel,_4])) ) -# 8430 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 4 : 'simple_expr) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'seq_expr) in - Obj.repr( -# 1268 "ml/parser.mly" - ( unclosed "[" 3 "]" 5 ) -# 8438 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 4 : 'simple_expr) in - let _2 = (Parsing.peek_val __caml_parser_env 3 : string) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'expr) in - Obj.repr( -# 1270 "ml/parser.mly" - ( let id = mkexp @@ Pexp_ident( ghloc @@ Lident ("." ^ _2 ^ "[]")) in - mkexp @@ Pexp_apply(id, [Nolabel, _1; Nolabel, _4]) ) -# 8448 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 4 : 'simple_expr) in - let _2 = (Parsing.peek_val __caml_parser_env 3 : string) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'expr) in - Obj.repr( -# 1273 "ml/parser.mly" - ( unclosed "[" 3 "]" 5 ) -# 8457 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 4 : 'simple_expr) in - let _2 = (Parsing.peek_val __caml_parser_env 3 : string) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'expr) in - Obj.repr( -# 1275 "ml/parser.mly" - ( let id = mkexp @@ Pexp_ident( ghloc @@ Lident ("." ^ _2 ^ "()")) in - mkexp @@ Pexp_apply(id, [Nolabel, _1; Nolabel, _4]) ) -# 8467 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 4 : 'simple_expr) in - let _2 = (Parsing.peek_val __caml_parser_env 3 : string) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'expr) in - Obj.repr( -# 1278 "ml/parser.mly" - ( unclosed "(" 3 ")" 5 ) -# 8476 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 4 : 'simple_expr) in - let _2 = (Parsing.peek_val __caml_parser_env 3 : string) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'expr) in - Obj.repr( -# 1280 "ml/parser.mly" - ( let id = mkexp @@ Pexp_ident( ghloc @@ Lident ("." ^ _2 ^ "{}")) in - mkexp @@ Pexp_apply(id, [Nolabel, _1; Nolabel, _4]) ) -# 8486 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 4 : 'simple_expr) in - let _2 = (Parsing.peek_val __caml_parser_env 3 : string) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'expr) in - Obj.repr( -# 1283 "ml/parser.mly" - ( unclosed "{" 3 "}" 5 ) -# 8495 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 6 : 'simple_expr) in - let _3 = (Parsing.peek_val __caml_parser_env 4 : 'mod_longident) in - let _4 = (Parsing.peek_val __caml_parser_env 3 : string) in - let _6 = (Parsing.peek_val __caml_parser_env 1 : 'expr) in - Obj.repr( -# 1285 "ml/parser.mly" - ( let id = mkexp @@ Pexp_ident( ghloc @@ Ldot(_3, "." ^ _4 ^ "[]")) in - mkexp @@ Pexp_apply(id, [Nolabel, _1; Nolabel, _6]) ) -# 8506 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 6 : 'simple_expr) in - let _3 = (Parsing.peek_val __caml_parser_env 4 : 'mod_longident) in - let _4 = (Parsing.peek_val __caml_parser_env 3 : string) in - let _6 = (Parsing.peek_val __caml_parser_env 1 : 'expr) in - Obj.repr( -# 1288 "ml/parser.mly" - ( unclosed "[" 5 "]" 7 ) -# 8516 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 6 : 'simple_expr) in - let _3 = (Parsing.peek_val __caml_parser_env 4 : 'mod_longident) in - let _4 = (Parsing.peek_val __caml_parser_env 3 : string) in - let _6 = (Parsing.peek_val __caml_parser_env 1 : 'expr) in - Obj.repr( -# 1290 "ml/parser.mly" - ( let id = mkexp @@ Pexp_ident( ghloc @@ Ldot(_3, "." ^ _4 ^ "()")) in - mkexp @@ Pexp_apply(id, [Nolabel, _1; Nolabel, _6]) ) -# 8527 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 6 : 'simple_expr) in - let _3 = (Parsing.peek_val __caml_parser_env 4 : 'mod_longident) in - let _4 = (Parsing.peek_val __caml_parser_env 3 : string) in - let _6 = (Parsing.peek_val __caml_parser_env 1 : 'expr) in - Obj.repr( -# 1293 "ml/parser.mly" - ( unclosed "(" 5 ")" 7 ) -# 8537 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 6 : 'simple_expr) in - let _3 = (Parsing.peek_val __caml_parser_env 4 : 'mod_longident) in - let _4 = (Parsing.peek_val __caml_parser_env 3 : string) in - let _6 = (Parsing.peek_val __caml_parser_env 1 : 'expr) in - Obj.repr( -# 1295 "ml/parser.mly" - ( let id = mkexp @@ Pexp_ident( ghloc @@ Ldot(_3, "." ^ _4 ^ "{}")) in - mkexp @@ Pexp_apply(id, [Nolabel, _1; Nolabel, _6]) ) -# 8548 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 6 : 'simple_expr) in - let _3 = (Parsing.peek_val __caml_parser_env 4 : 'mod_longident) in - let _4 = (Parsing.peek_val __caml_parser_env 3 : string) in - let _6 = (Parsing.peek_val __caml_parser_env 1 : 'expr) in - Obj.repr( -# 1298 "ml/parser.mly" - ( unclosed "{" 5 "}" 7 ) -# 8558 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 4 : 'simple_expr) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'expr_comma_list) in - Obj.repr( -# 1300 "ml/parser.mly" - ( unclosed "{" 3 "}" 5 ) -# 8566 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 1 : 'record_expr) in - Obj.repr( -# 1302 "ml/parser.mly" - ( let (exten, fields) = _2 in mkexp (Pexp_record(fields, exten)) ) -# 8573 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 1 : 'record_expr) in - Obj.repr( -# 1304 "ml/parser.mly" - ( unclosed "{" 1 "}" 3 ) -# 8580 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 4 : 'mod_longident) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'record_expr) in - Obj.repr( -# 1306 "ml/parser.mly" - ( let (exten, fields) = _4 in - let rec_exp = mkexp(Pexp_record(fields, exten)) in - mkexp(Pexp_open(Fresh, mkrhs _1 1, rec_exp)) ) -# 8590 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 4 : 'mod_longident) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'record_expr) in - Obj.repr( -# 1310 "ml/parser.mly" - ( unclosed "{" 3 "}" 5 ) -# 8598 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'expr_semi_list) in - let _3 = (Parsing.peek_val __caml_parser_env 1 : 'opt_semi) in - Obj.repr( -# 1312 "ml/parser.mly" - ( mkexp (Pexp_array(List.rev _2)) ) -# 8606 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'expr_semi_list) in - let _3 = (Parsing.peek_val __caml_parser_env 1 : 'opt_semi) in - Obj.repr( -# 1314 "ml/parser.mly" - ( unclosed "[|" 1 "|]" 4 ) -# 8614 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - Obj.repr( -# 1316 "ml/parser.mly" - ( mkexp (Pexp_array []) ) -# 8620 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 5 : 'mod_longident) in - let _4 = (Parsing.peek_val __caml_parser_env 2 : 'expr_semi_list) in - let _5 = (Parsing.peek_val __caml_parser_env 1 : 'opt_semi) in - Obj.repr( -# 1318 "ml/parser.mly" - ( mkexp(Pexp_open(Fresh, mkrhs _1 1, mkexp(Pexp_array(List.rev _4)))) ) -# 8629 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 3 : 'mod_longident) in - Obj.repr( -# 1320 "ml/parser.mly" - ( mkexp(Pexp_open(Fresh, mkrhs _1 1, mkexp(Pexp_array []))) ) -# 8636 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 5 : 'mod_longident) in - let _4 = (Parsing.peek_val __caml_parser_env 2 : 'expr_semi_list) in - let _5 = (Parsing.peek_val __caml_parser_env 1 : 'opt_semi) in - Obj.repr( -# 1322 "ml/parser.mly" - ( unclosed "[|" 3 "|]" 6 ) -# 8645 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'expr_semi_list) in - let _3 = (Parsing.peek_val __caml_parser_env 1 : 'opt_semi) in - Obj.repr( -# 1324 "ml/parser.mly" - ( reloc_exp (mktailexp (rhs_loc 4) (List.rev _2)) ) -# 8653 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'expr_semi_list) in - let _3 = (Parsing.peek_val __caml_parser_env 1 : 'opt_semi) in - Obj.repr( -# 1326 "ml/parser.mly" - ( unclosed "[" 1 "]" 4 ) -# 8661 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 5 : 'mod_longident) in - let _4 = (Parsing.peek_val __caml_parser_env 2 : 'expr_semi_list) in - let _5 = (Parsing.peek_val __caml_parser_env 1 : 'opt_semi) in - Obj.repr( -# 1328 "ml/parser.mly" - ( let list_exp = reloc_exp (mktailexp (rhs_loc 6) (List.rev _4)) in - mkexp(Pexp_open(Fresh, mkrhs _1 1, list_exp)) ) -# 8671 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 3 : 'mod_longident) in - Obj.repr( -# 1331 "ml/parser.mly" - ( mkexp(Pexp_open(Fresh, mkrhs _1 1, - mkexp(Pexp_construct(mkrhs (Lident "[]") 1, None)))) ) -# 8679 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 5 : 'mod_longident) in - let _4 = (Parsing.peek_val __caml_parser_env 2 : 'expr_semi_list) in - let _5 = (Parsing.peek_val __caml_parser_env 1 : 'opt_semi) in - Obj.repr( -# 1334 "ml/parser.mly" - ( unclosed "[" 3 "]" 6 ) -# 8688 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : string) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'simple_expr) in - Obj.repr( -# 1336 "ml/parser.mly" - ( mkexp(Pexp_apply(mkoperator _1 1, [Nolabel,_2])) ) -# 8696 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'simple_expr) in - Obj.repr( -# 1338 "ml/parser.mly" - ( mkexp(Pexp_apply(mkoperator "!" 1, [Nolabel,_2])) ) -# 8703 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 1 : 'field_expr_list) in - Obj.repr( -# 1340 "ml/parser.mly" - ( mkexp (Pexp_override _2) ) -# 8710 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 1 : 'field_expr_list) in - Obj.repr( -# 1342 "ml/parser.mly" - ( unclosed "{<" 1 ">}" 3 ) -# 8717 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - Obj.repr( -# 1344 "ml/parser.mly" - ( mkexp (Pexp_override [])) -# 8723 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 4 : 'mod_longident) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'field_expr_list) in - Obj.repr( -# 1346 "ml/parser.mly" - ( mkexp(Pexp_open(Fresh, mkrhs _1 1, mkexp (Pexp_override _4)))) -# 8731 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 3 : 'mod_longident) in - Obj.repr( -# 1348 "ml/parser.mly" - ( mkexp(Pexp_open(Fresh, mkrhs _1 1, mkexp (Pexp_override [])))) -# 8738 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 4 : 'mod_longident) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'field_expr_list) in - Obj.repr( -# 1350 "ml/parser.mly" - ( unclosed "{<" 3 ">}" 5 ) -# 8746 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'simple_expr) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'label) in - Obj.repr( -# 1352 "ml/parser.mly" - ( mkexp(Pexp_send(_1, mkrhs _3 3)) ) -# 8754 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'simple_expr) in - let _2 = (Parsing.peek_val __caml_parser_env 1 : string) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'simple_expr) in - Obj.repr( -# 1354 "ml/parser.mly" - ( mkinfix _1 _2 _3 ) -# 8763 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _3 = (Parsing.peek_val __caml_parser_env 2 : 'ext_attributes) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'module_expr) in - Obj.repr( -# 1356 "ml/parser.mly" - ( mkexp_attrs (Pexp_pack _4) _3 ) -# 8771 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _3 = (Parsing.peek_val __caml_parser_env 4 : 'ext_attributes) in - let _4 = (Parsing.peek_val __caml_parser_env 3 : 'module_expr) in - let _6 = (Parsing.peek_val __caml_parser_env 1 : 'package_type) in - Obj.repr( -# 1358 "ml/parser.mly" - ( mkexp_attrs (Pexp_constraint (ghexp (Pexp_pack _4), - ghtyp (Ptyp_package _6))) - _3 ) -# 8782 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _3 = (Parsing.peek_val __caml_parser_env 3 : 'ext_attributes) in - let _4 = (Parsing.peek_val __caml_parser_env 2 : 'module_expr) in - Obj.repr( -# 1362 "ml/parser.mly" - ( unclosed "(" 1 ")" 6 ) -# 8790 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 8 : 'mod_longident) in - let _5 = (Parsing.peek_val __caml_parser_env 4 : 'ext_attributes) in - let _6 = (Parsing.peek_val __caml_parser_env 3 : 'module_expr) in - let _8 = (Parsing.peek_val __caml_parser_env 1 : 'package_type) in - Obj.repr( -# 1365 "ml/parser.mly" - ( mkexp(Pexp_open(Fresh, mkrhs _1 1, - mkexp_attrs (Pexp_constraint (ghexp (Pexp_pack _6), - ghtyp (Ptyp_package _8))) - _5 )) ) -# 8803 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 7 : 'mod_longident) in - let _5 = (Parsing.peek_val __caml_parser_env 3 : 'ext_attributes) in - let _6 = (Parsing.peek_val __caml_parser_env 2 : 'module_expr) in - Obj.repr( -# 1370 "ml/parser.mly" - ( unclosed "(" 3 ")" 8 ) -# 8812 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'extension) in - Obj.repr( -# 1372 "ml/parser.mly" - ( mkexp (Pexp_extension _1) ) -# 8819 "ml/parser.ml" - : 'simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'labeled_simple_expr) in - Obj.repr( -# 1376 "ml/parser.mly" - ( [_1] ) -# 8826 "ml/parser.ml" - : 'simple_labeled_expr_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'simple_labeled_expr_list) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'labeled_simple_expr) in - Obj.repr( -# 1378 "ml/parser.mly" - ( _2 :: _1 ) -# 8834 "ml/parser.ml" - : 'simple_labeled_expr_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'simple_expr) in - Obj.repr( -# 1382 "ml/parser.mly" - ( (Nolabel, _1) ) -# 8841 "ml/parser.ml" - : 'labeled_simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'label_expr) in - Obj.repr( -# 1384 "ml/parser.mly" - ( _1 ) -# 8848 "ml/parser.ml" - : 'labeled_simple_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : string) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'simple_expr) in - Obj.repr( -# 1388 "ml/parser.mly" - ( (Labelled _1, _2) ) -# 8856 "ml/parser.ml" - : 'label_expr)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'label_ident) in - Obj.repr( -# 1390 "ml/parser.mly" - ( (Labelled (fst _2), snd _2) ) -# 8863 "ml/parser.ml" - : 'label_expr)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'label_ident) in - Obj.repr( -# 1392 "ml/parser.mly" - ( (Optional (fst _2), snd _2) ) -# 8870 "ml/parser.ml" - : 'label_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : string) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'simple_expr) in - Obj.repr( -# 1394 "ml/parser.mly" - ( (Optional _1, _2) ) -# 8878 "ml/parser.ml" - : 'label_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in - Obj.repr( -# 1397 "ml/parser.mly" - ( (_1, mkexp(Pexp_ident(mkrhs (Lident _1) 1))) ) -# 8885 "ml/parser.ml" - : 'label_ident)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in - Obj.repr( -# 1400 "ml/parser.mly" - ( [mkrhs _1 1] ) -# 8892 "ml/parser.ml" - : 'lident_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : string) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'lident_list) in - Obj.repr( -# 1401 "ml/parser.mly" - ( mkrhs _1 1 :: _2 ) -# 8900 "ml/parser.ml" - : 'lident_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'val_ident) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'strict_binding) in - Obj.repr( -# 1405 "ml/parser.mly" - ( (mkpatvar _1 1, _2) ) -# 8908 "ml/parser.ml" - : 'let_binding_body)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 3 : 'val_ident) in - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'type_constraint) in - let _4 = (Parsing.peek_val __caml_parser_env 0 : 'seq_expr) in - Obj.repr( -# 1407 "ml/parser.mly" - ( let v = mkpatvar _1 1 in (* PR#7344 *) - let t = - match _2 with - Some t, None -> t - | _, Some t -> t - | _ -> assert false - in - (ghpat(Ppat_constraint(v, ghtyp(Ptyp_poly([],t)))), - mkexp_constraint _4 _2) ) -# 8925 "ml/parser.ml" - : 'let_binding_body)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 6 : 'val_ident) in - let _3 = (Parsing.peek_val __caml_parser_env 4 : 'typevar_list) in - let _5 = (Parsing.peek_val __caml_parser_env 2 : 'core_type) in - let _7 = (Parsing.peek_val __caml_parser_env 0 : 'seq_expr) in - Obj.repr( -# 1417 "ml/parser.mly" - ( (ghpat(Ppat_constraint(mkpatvar _1 1, - ghtyp(Ptyp_poly(List.rev _3,_5)))), - _7) ) -# 8937 "ml/parser.ml" - : 'let_binding_body)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 7 : 'val_ident) in - let _4 = (Parsing.peek_val __caml_parser_env 4 : 'lident_list) in - let _6 = (Parsing.peek_val __caml_parser_env 2 : 'core_type) in - let _8 = (Parsing.peek_val __caml_parser_env 0 : 'seq_expr) in - Obj.repr( -# 1421 "ml/parser.mly" - ( let exp, poly = wrap_type_annotation _4 _6 _8 in - (ghpat(Ppat_constraint(mkpatvar _1 1, poly)), exp) ) -# 8948 "ml/parser.ml" - : 'let_binding_body)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'pattern_no_exn) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'seq_expr) in - Obj.repr( -# 1424 "ml/parser.mly" - ( (_1, _3) ) -# 8956 "ml/parser.ml" - : 'let_binding_body)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 4 : 'simple_pattern_not_ident) in - let _3 = (Parsing.peek_val __caml_parser_env 2 : 'core_type) in - let _5 = (Parsing.peek_val __caml_parser_env 0 : 'seq_expr) in - Obj.repr( -# 1426 "ml/parser.mly" - ( (ghpat(Ppat_constraint(_1, _3)), _5) ) -# 8965 "ml/parser.ml" - : 'let_binding_body)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'let_binding) in - Obj.repr( -# 1429 "ml/parser.mly" - ( _1 ) -# 8972 "ml/parser.ml" - : 'let_bindings)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'let_bindings) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'and_let_binding) in - Obj.repr( -# 1430 "ml/parser.mly" - ( addlb _1 _2 ) -# 8980 "ml/parser.ml" - : 'let_bindings)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 3 : 'ext_attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 2 : 'rec_flag) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'let_binding_body) in - let _5 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in - Obj.repr( -# 1434 "ml/parser.mly" - ( let (ext, attr) = _2 in - mklbs ext _3 (mklb true _4 (attr@_5)) ) -# 8991 "ml/parser.ml" - : 'let_binding)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 1 : 'let_binding_body) in - let _4 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in - Obj.repr( -# 1439 "ml/parser.mly" - ( mklb false _3 (_2@_4) ) -# 9000 "ml/parser.ml" - : 'and_let_binding)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'strict_binding) in - Obj.repr( -# 1443 "ml/parser.mly" - ( _1 ) -# 9007 "ml/parser.ml" - : 'fun_binding)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'type_constraint) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'seq_expr) in - Obj.repr( -# 1445 "ml/parser.mly" - ( mkexp_constraint _3 _1 ) -# 9015 "ml/parser.ml" - : 'fun_binding)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'seq_expr) in - Obj.repr( -# 1449 "ml/parser.mly" - ( _2 ) -# 9022 "ml/parser.ml" - : 'strict_binding)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'labeled_simple_pattern) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'fun_binding) in - Obj.repr( -# 1451 "ml/parser.mly" - ( let (l, o, p) = _1 in ghexp(Pexp_fun(l, o, p, _2)) ) -# 9030 "ml/parser.ml" - : 'strict_binding)) -; (fun __caml_parser_env -> - let _3 = (Parsing.peek_val __caml_parser_env 2 : 'lident_list) in - let _5 = (Parsing.peek_val __caml_parser_env 0 : 'fun_binding) in - Obj.repr( -# 1453 "ml/parser.mly" - ( mk_newtypes _3 _5 ) -# 9038 "ml/parser.ml" - : 'strict_binding)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'match_case) in - Obj.repr( -# 1456 "ml/parser.mly" - ( [_1] ) -# 9045 "ml/parser.ml" - : 'match_cases)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'match_cases) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'match_case) in - Obj.repr( -# 1457 "ml/parser.mly" - ( _3 :: _1 ) -# 9053 "ml/parser.ml" - : 'match_cases)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'pattern) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'seq_expr) in - Obj.repr( -# 1461 "ml/parser.mly" - ( Exp.case _1 _3 ) -# 9061 "ml/parser.ml" - : 'match_case)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 4 : 'pattern) in - let _3 = (Parsing.peek_val __caml_parser_env 2 : 'seq_expr) in - let _5 = (Parsing.peek_val __caml_parser_env 0 : 'seq_expr) in - Obj.repr( -# 1463 "ml/parser.mly" - ( Exp.case _1 ~guard:_3 _5 ) -# 9070 "ml/parser.ml" - : 'match_case)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'pattern) in - Obj.repr( -# 1465 "ml/parser.mly" - ( Exp.case _1 (Exp.unreachable ~loc:(rhs_loc 3) ())) -# 9077 "ml/parser.ml" - : 'match_case)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'seq_expr) in - Obj.repr( -# 1469 "ml/parser.mly" - ( _2 ) -# 9084 "ml/parser.ml" - : 'fun_def)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'simple_core_type) in - let _4 = (Parsing.peek_val __caml_parser_env 0 : 'seq_expr) in - Obj.repr( -# 1471 "ml/parser.mly" - ( mkexp (Pexp_constraint (_4, _2)) ) -# 9092 "ml/parser.ml" - : 'fun_def)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'labeled_simple_pattern) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'fun_def) in - Obj.repr( -# 1474 "ml/parser.mly" - ( - let (l,o,p) = _1 in - ghexp(Pexp_fun(l, o, p, _2)) - ) -# 9103 "ml/parser.ml" - : 'fun_def)) -; (fun __caml_parser_env -> - let _3 = (Parsing.peek_val __caml_parser_env 2 : 'lident_list) in - let _5 = (Parsing.peek_val __caml_parser_env 0 : 'fun_def) in - Obj.repr( -# 1479 "ml/parser.mly" - ( mk_newtypes _3 _5 ) -# 9111 "ml/parser.ml" - : 'fun_def)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr_comma_list) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in - Obj.repr( -# 1482 "ml/parser.mly" - ( _3 :: _1 ) -# 9119 "ml/parser.ml" - : 'expr_comma_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in - Obj.repr( -# 1483 "ml/parser.mly" - ( [_3; _1] ) -# 9127 "ml/parser.ml" - : 'expr_comma_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'simple_expr) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'lbl_expr_list) in - Obj.repr( -# 1486 "ml/parser.mly" - ( (Some _1, _3) ) -# 9135 "ml/parser.ml" - : 'record_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'lbl_expr_list) in - Obj.repr( -# 1487 "ml/parser.mly" - ( (None, _1) ) -# 9142 "ml/parser.ml" - : 'record_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'lbl_expr) in - Obj.repr( -# 1490 "ml/parser.mly" - ( [_1] ) -# 9149 "ml/parser.ml" - : 'lbl_expr_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'lbl_expr) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'lbl_expr_list) in - Obj.repr( -# 1491 "ml/parser.mly" - ( _1 :: _3 ) -# 9157 "ml/parser.ml" - : 'lbl_expr_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'lbl_expr) in - Obj.repr( -# 1492 "ml/parser.mly" - ( [_1] ) -# 9164 "ml/parser.ml" - : 'lbl_expr_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 3 : 'label_longident) in - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'opt_type_constraint) in - let _4 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in - Obj.repr( -# 1496 "ml/parser.mly" - ( (mkrhs _1 1, mkexp_opt_constraint _4 _2) ) -# 9173 "ml/parser.ml" - : 'lbl_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'label_longident) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'opt_type_constraint) in - Obj.repr( -# 1498 "ml/parser.mly" - ( (mkrhs _1 1, mkexp_opt_constraint (exp_of_label _1 1) _2) ) -# 9181 "ml/parser.ml" - : 'lbl_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'field_expr) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'opt_semi) in - Obj.repr( -# 1501 "ml/parser.mly" - ( [_1] ) -# 9189 "ml/parser.ml" - : 'field_expr_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'field_expr) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'field_expr_list) in - Obj.repr( -# 1502 "ml/parser.mly" - ( _1 :: _3 ) -# 9197 "ml/parser.ml" - : 'field_expr_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'label) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in - Obj.repr( -# 1506 "ml/parser.mly" - ( (mkrhs _1 1, _3) ) -# 9205 "ml/parser.ml" - : 'field_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'label) in - Obj.repr( -# 1508 "ml/parser.mly" - ( (mkrhs _1 1, exp_of_label (Lident _1) 1) ) -# 9212 "ml/parser.ml" - : 'field_expr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in - Obj.repr( -# 1511 "ml/parser.mly" - ( [_1] ) -# 9219 "ml/parser.ml" - : 'expr_semi_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr_semi_list) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in - Obj.repr( -# 1512 "ml/parser.mly" - ( _3 :: _1 ) -# 9227 "ml/parser.ml" - : 'expr_semi_list)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'core_type) in - Obj.repr( -# 1515 "ml/parser.mly" - ( (Some _2, None) ) -# 9234 "ml/parser.ml" - : 'type_constraint)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'core_type) in - let _4 = (Parsing.peek_val __caml_parser_env 0 : 'core_type) in - Obj.repr( -# 1516 "ml/parser.mly" - ( (Some _2, Some _4) ) -# 9242 "ml/parser.ml" - : 'type_constraint)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'core_type) in - Obj.repr( -# 1517 "ml/parser.mly" - ( (None, Some _2) ) -# 9249 "ml/parser.ml" - : 'type_constraint)) -; (fun __caml_parser_env -> - Obj.repr( -# 1518 "ml/parser.mly" - ( syntax_error() ) -# 9255 "ml/parser.ml" - : 'type_constraint)) -; (fun __caml_parser_env -> - Obj.repr( -# 1519 "ml/parser.mly" - ( syntax_error() ) -# 9261 "ml/parser.ml" - : 'type_constraint)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'type_constraint) in - Obj.repr( -# 1522 "ml/parser.mly" - ( Some _1 ) -# 9268 "ml/parser.ml" - : 'opt_type_constraint)) -; (fun __caml_parser_env -> - Obj.repr( -# 1523 "ml/parser.mly" - ( None ) -# 9274 "ml/parser.ml" - : 'opt_type_constraint)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'pattern) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'val_ident) in - Obj.repr( -# 1530 "ml/parser.mly" - ( mkpat(Ppat_alias(_1, mkrhs _3 3)) ) -# 9282 "ml/parser.ml" - : 'pattern)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'pattern) in - Obj.repr( -# 1532 "ml/parser.mly" - ( expecting 3 "identifier" ) -# 9289 "ml/parser.ml" - : 'pattern)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'pattern_comma_list) in - Obj.repr( -# 1534 "ml/parser.mly" - ( mkpat(Ppat_tuple(List.rev _1)) ) -# 9296 "ml/parser.ml" - : 'pattern)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'pattern) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'pattern) in - Obj.repr( -# 1536 "ml/parser.mly" - ( mkpat_cons (rhs_loc 2) (ghpat(Ppat_tuple[_1;_3])) (symbol_rloc()) ) -# 9304 "ml/parser.ml" - : 'pattern)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'pattern) in - Obj.repr( -# 1538 "ml/parser.mly" - ( expecting 3 "pattern" ) -# 9311 "ml/parser.ml" - : 'pattern)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'pattern) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'pattern) in - Obj.repr( -# 1540 "ml/parser.mly" - ( mkpat(Ppat_or(_1, _3)) ) -# 9319 "ml/parser.ml" - : 'pattern)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'pattern) in - Obj.repr( -# 1542 "ml/parser.mly" - ( expecting 3 "pattern" ) -# 9326 "ml/parser.ml" - : 'pattern)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 1 : 'ext_attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'pattern) in - Obj.repr( -# 1544 "ml/parser.mly" - ( mkpat_attrs (Ppat_exception _3) _2) -# 9334 "ml/parser.ml" - : 'pattern)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'pattern) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'attribute) in - Obj.repr( -# 1546 "ml/parser.mly" - ( Pat.attr _1 _2 ) -# 9342 "ml/parser.ml" - : 'pattern)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'pattern_gen) in - Obj.repr( -# 1547 "ml/parser.mly" - ( _1 ) -# 9349 "ml/parser.ml" - : 'pattern)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'pattern_no_exn) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'val_ident) in - Obj.repr( -# 1551 "ml/parser.mly" - ( mkpat(Ppat_alias(_1, mkrhs _3 3)) ) -# 9357 "ml/parser.ml" - : 'pattern_no_exn)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'pattern_no_exn) in - Obj.repr( -# 1553 "ml/parser.mly" - ( expecting 3 "identifier" ) -# 9364 "ml/parser.ml" - : 'pattern_no_exn)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'pattern_no_exn_comma_list) in - Obj.repr( -# 1555 "ml/parser.mly" - ( mkpat(Ppat_tuple(List.rev _1)) ) -# 9371 "ml/parser.ml" - : 'pattern_no_exn)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'pattern_no_exn) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'pattern) in - Obj.repr( -# 1557 "ml/parser.mly" - ( mkpat_cons (rhs_loc 2) (ghpat(Ppat_tuple[_1;_3])) (symbol_rloc()) ) -# 9379 "ml/parser.ml" - : 'pattern_no_exn)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'pattern_no_exn) in - Obj.repr( -# 1559 "ml/parser.mly" - ( expecting 3 "pattern" ) -# 9386 "ml/parser.ml" - : 'pattern_no_exn)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'pattern_no_exn) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'pattern) in - Obj.repr( -# 1561 "ml/parser.mly" - ( mkpat(Ppat_or(_1, _3)) ) -# 9394 "ml/parser.ml" - : 'pattern_no_exn)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'pattern_no_exn) in - Obj.repr( -# 1563 "ml/parser.mly" - ( expecting 3 "pattern" ) -# 9401 "ml/parser.ml" - : 'pattern_no_exn)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'pattern_no_exn) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'attribute) in - Obj.repr( -# 1565 "ml/parser.mly" - ( Pat.attr _1 _2 ) -# 9409 "ml/parser.ml" - : 'pattern_no_exn)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'pattern_gen) in - Obj.repr( -# 1566 "ml/parser.mly" - ( _1 ) -# 9416 "ml/parser.ml" - : 'pattern_no_exn)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'simple_pattern) in - Obj.repr( -# 1570 "ml/parser.mly" - ( _1 ) -# 9423 "ml/parser.ml" - : 'pattern_gen)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'constr_longident) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'pattern) in - Obj.repr( -# 1572 "ml/parser.mly" - ( mkpat(Ppat_construct(mkrhs _1 1, Some _2)) ) -# 9431 "ml/parser.ml" - : 'pattern_gen)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'name_tag) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'pattern) in - Obj.repr( -# 1574 "ml/parser.mly" - ( mkpat(Ppat_variant(_1, Some _2)) ) -# 9439 "ml/parser.ml" - : 'pattern_gen)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 1 : 'ext_attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'simple_pattern) in - Obj.repr( -# 1576 "ml/parser.mly" - ( mkpat_attrs (Ppat_lazy _3) _2) -# 9447 "ml/parser.ml" - : 'pattern_gen)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'val_ident) in - Obj.repr( -# 1580 "ml/parser.mly" - ( mkpat(Ppat_var (mkrhs _1 1)) ) -# 9454 "ml/parser.ml" - : 'simple_pattern)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'simple_pattern_not_ident) in - Obj.repr( -# 1581 "ml/parser.mly" - ( _1 ) -# 9461 "ml/parser.ml" - : 'simple_pattern)) -; (fun __caml_parser_env -> - Obj.repr( -# 1585 "ml/parser.mly" - ( mkpat(Ppat_any) ) -# 9467 "ml/parser.ml" - : 'simple_pattern_not_ident)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'signed_constant) in - Obj.repr( -# 1587 "ml/parser.mly" - ( mkpat(Ppat_constant _1) ) -# 9474 "ml/parser.ml" - : 'simple_pattern_not_ident)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'signed_constant) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'signed_constant) in - Obj.repr( -# 1589 "ml/parser.mly" - ( mkpat(Ppat_interval (_1, _3)) ) -# 9482 "ml/parser.ml" - : 'simple_pattern_not_ident)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'constr_longident) in - Obj.repr( -# 1591 "ml/parser.mly" - ( mkpat(Ppat_construct(mkrhs _1 1, None)) ) -# 9489 "ml/parser.ml" - : 'simple_pattern_not_ident)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'name_tag) in - Obj.repr( -# 1593 "ml/parser.mly" - ( mkpat(Ppat_variant(_1, None)) ) -# 9496 "ml/parser.ml" - : 'simple_pattern_not_ident)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'type_longident) in - Obj.repr( -# 1595 "ml/parser.mly" - ( mkpat(Ppat_type (mkrhs _2 2)) ) -# 9503 "ml/parser.ml" - : 'simple_pattern_not_ident)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'simple_delimited_pattern) in - Obj.repr( -# 1597 "ml/parser.mly" - ( _1 ) -# 9510 "ml/parser.ml" - : 'simple_pattern_not_ident)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'mod_longident) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'simple_delimited_pattern) in - Obj.repr( -# 1599 "ml/parser.mly" - ( mkpat @@ Ppat_open(mkrhs _1 1, _3) ) -# 9518 "ml/parser.ml" - : 'simple_pattern_not_ident)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 3 : 'mod_longident) in - Obj.repr( -# 1601 "ml/parser.mly" - ( mkpat @@ Ppat_open(mkrhs _1 1, mkpat @@ - Ppat_construct ( mkrhs (Lident "[]") 4, None)) ) -# 9526 "ml/parser.ml" - : 'simple_pattern_not_ident)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 3 : 'mod_longident) in - Obj.repr( -# 1604 "ml/parser.mly" - ( mkpat @@ Ppat_open( mkrhs _1 1, mkpat @@ - Ppat_construct ( mkrhs (Lident "()") 4, None) ) ) -# 9534 "ml/parser.ml" - : 'simple_pattern_not_ident)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 4 : 'mod_longident) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'pattern) in - Obj.repr( -# 1607 "ml/parser.mly" - ( mkpat @@ Ppat_open (mkrhs _1 1, _4)) -# 9542 "ml/parser.ml" - : 'simple_pattern_not_ident)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 4 : 'mod_longident) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'pattern) in - Obj.repr( -# 1609 "ml/parser.mly" - (unclosed "(" 3 ")" 5 ) -# 9550 "ml/parser.ml" - : 'simple_pattern_not_ident)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 3 : 'mod_longident) in - Obj.repr( -# 1611 "ml/parser.mly" - ( expecting 4 "pattern" ) -# 9557 "ml/parser.ml" - : 'simple_pattern_not_ident)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 1 : 'pattern) in - Obj.repr( -# 1613 "ml/parser.mly" - ( reloc_pat _2 ) -# 9564 "ml/parser.ml" - : 'simple_pattern_not_ident)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 1 : 'pattern) in - Obj.repr( -# 1615 "ml/parser.mly" - ( unclosed "(" 1 ")" 3 ) -# 9571 "ml/parser.ml" - : 'simple_pattern_not_ident)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 3 : 'pattern) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'core_type) in - Obj.repr( -# 1617 "ml/parser.mly" - ( mkpat(Ppat_constraint(_2, _4)) ) -# 9579 "ml/parser.ml" - : 'simple_pattern_not_ident)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 3 : 'pattern) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'core_type) in - Obj.repr( -# 1619 "ml/parser.mly" - ( unclosed "(" 1 ")" 5 ) -# 9587 "ml/parser.ml" - : 'simple_pattern_not_ident)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'pattern) in - Obj.repr( -# 1621 "ml/parser.mly" - ( expecting 4 "type" ) -# 9594 "ml/parser.ml" - : 'simple_pattern_not_ident)) -; (fun __caml_parser_env -> - let _3 = (Parsing.peek_val __caml_parser_env 2 : 'ext_attributes) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : string) in - Obj.repr( -# 1623 "ml/parser.mly" - ( mkpat_attrs (Ppat_unpack (mkrhs _4 4)) _3 ) -# 9602 "ml/parser.ml" - : 'simple_pattern_not_ident)) -; (fun __caml_parser_env -> - let _3 = (Parsing.peek_val __caml_parser_env 4 : 'ext_attributes) in - let _4 = (Parsing.peek_val __caml_parser_env 3 : string) in - let _6 = (Parsing.peek_val __caml_parser_env 1 : 'package_type) in - Obj.repr( -# 1625 "ml/parser.mly" - ( mkpat_attrs - (Ppat_constraint(mkpat(Ppat_unpack (mkrhs _4 4)), - ghtyp(Ptyp_package _6))) - _3 ) -# 9614 "ml/parser.ml" - : 'simple_pattern_not_ident)) -; (fun __caml_parser_env -> - let _3 = (Parsing.peek_val __caml_parser_env 4 : 'ext_attributes) in - let _4 = (Parsing.peek_val __caml_parser_env 3 : string) in - let _6 = (Parsing.peek_val __caml_parser_env 1 : 'package_type) in - Obj.repr( -# 1630 "ml/parser.mly" - ( unclosed "(" 1 ")" 7 ) -# 9623 "ml/parser.ml" - : 'simple_pattern_not_ident)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'extension) in - Obj.repr( -# 1632 "ml/parser.mly" - ( mkpat(Ppat_extension _1) ) -# 9630 "ml/parser.ml" - : 'simple_pattern_not_ident)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 1 : 'lbl_pattern_list) in - Obj.repr( -# 1637 "ml/parser.mly" - ( let (fields, closed) = _2 in mkpat(Ppat_record(fields, closed)) ) -# 9637 "ml/parser.ml" - : 'simple_delimited_pattern)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 1 : 'lbl_pattern_list) in - Obj.repr( -# 1639 "ml/parser.mly" - ( unclosed "{" 1 "}" 3 ) -# 9644 "ml/parser.ml" - : 'simple_delimited_pattern)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'pattern_semi_list) in - let _3 = (Parsing.peek_val __caml_parser_env 1 : 'opt_semi) in - Obj.repr( -# 1641 "ml/parser.mly" - ( reloc_pat (mktailpat (rhs_loc 4) (List.rev _2)) ) -# 9652 "ml/parser.ml" - : 'simple_delimited_pattern)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'pattern_semi_list) in - let _3 = (Parsing.peek_val __caml_parser_env 1 : 'opt_semi) in - Obj.repr( -# 1643 "ml/parser.mly" - ( unclosed "[" 1 "]" 4 ) -# 9660 "ml/parser.ml" - : 'simple_delimited_pattern)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'pattern_semi_list) in - let _3 = (Parsing.peek_val __caml_parser_env 1 : 'opt_semi) in - Obj.repr( -# 1645 "ml/parser.mly" - ( mkpat(Ppat_array(List.rev _2)) ) -# 9668 "ml/parser.ml" - : 'simple_delimited_pattern)) -; (fun __caml_parser_env -> - Obj.repr( -# 1647 "ml/parser.mly" - ( mkpat(Ppat_array []) ) -# 9674 "ml/parser.ml" - : 'simple_delimited_pattern)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'pattern_semi_list) in - let _3 = (Parsing.peek_val __caml_parser_env 1 : 'opt_semi) in - Obj.repr( -# 1649 "ml/parser.mly" - ( unclosed "[|" 1 "|]" 4 ) -# 9682 "ml/parser.ml" - : 'simple_delimited_pattern)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'pattern_comma_list) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'pattern) in - Obj.repr( -# 1652 "ml/parser.mly" - ( _3 :: _1 ) -# 9690 "ml/parser.ml" - : 'pattern_comma_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'pattern) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'pattern) in - Obj.repr( -# 1653 "ml/parser.mly" - ( [_3; _1] ) -# 9698 "ml/parser.ml" - : 'pattern_comma_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'pattern) in - Obj.repr( -# 1654 "ml/parser.mly" - ( expecting 3 "pattern" ) -# 9705 "ml/parser.ml" - : 'pattern_comma_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'pattern_no_exn_comma_list) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'pattern) in - Obj.repr( -# 1657 "ml/parser.mly" - ( _3 :: _1 ) -# 9713 "ml/parser.ml" - : 'pattern_no_exn_comma_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'pattern_no_exn) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'pattern) in - Obj.repr( -# 1658 "ml/parser.mly" - ( [_3; _1] ) -# 9721 "ml/parser.ml" - : 'pattern_no_exn_comma_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'pattern_no_exn) in - Obj.repr( -# 1659 "ml/parser.mly" - ( expecting 3 "pattern" ) -# 9728 "ml/parser.ml" - : 'pattern_no_exn_comma_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'pattern) in - Obj.repr( -# 1662 "ml/parser.mly" - ( [_1] ) -# 9735 "ml/parser.ml" - : 'pattern_semi_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'pattern_semi_list) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'pattern) in - Obj.repr( -# 1663 "ml/parser.mly" - ( _3 :: _1 ) -# 9743 "ml/parser.ml" - : 'pattern_semi_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'lbl_pattern) in - Obj.repr( -# 1666 "ml/parser.mly" - ( [_1], Closed ) -# 9750 "ml/parser.ml" - : 'lbl_pattern_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'lbl_pattern) in - Obj.repr( -# 1667 "ml/parser.mly" - ( [_1], Closed ) -# 9757 "ml/parser.ml" - : 'lbl_pattern_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 3 : 'lbl_pattern) in - let _4 = (Parsing.peek_val __caml_parser_env 0 : 'opt_semi) in - Obj.repr( -# 1668 "ml/parser.mly" - ( [_1], Open ) -# 9765 "ml/parser.ml" - : 'lbl_pattern_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'lbl_pattern) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'lbl_pattern_list) in - Obj.repr( -# 1670 "ml/parser.mly" - ( let (fields, closed) = _3 in _1 :: fields, closed ) -# 9773 "ml/parser.ml" - : 'lbl_pattern_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 3 : 'label_longident) in - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'opt_pattern_type_constraint) in - let _4 = (Parsing.peek_val __caml_parser_env 0 : 'pattern) in - Obj.repr( -# 1674 "ml/parser.mly" - ( (mkrhs _1 1, mkpat_opt_constraint _4 _2) ) -# 9782 "ml/parser.ml" - : 'lbl_pattern)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'label_longident) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'opt_pattern_type_constraint) in - Obj.repr( -# 1676 "ml/parser.mly" - ( (mkrhs _1 1, mkpat_opt_constraint (pat_of_label _1 1) _2) ) -# 9790 "ml/parser.ml" - : 'lbl_pattern)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'core_type) in - Obj.repr( -# 1679 "ml/parser.mly" - ( Some _2 ) -# 9797 "ml/parser.ml" - : 'opt_pattern_type_constraint)) -; (fun __caml_parser_env -> - Obj.repr( -# 1680 "ml/parser.mly" - ( None ) -# 9803 "ml/parser.ml" - : 'opt_pattern_type_constraint)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 4 : 'ext_attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 3 : 'val_ident) in - let _5 = (Parsing.peek_val __caml_parser_env 1 : 'core_type) in - let _6 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in - Obj.repr( -# 1687 "ml/parser.mly" - ( let (ext, attrs) = _2 in - Val.mk (mkrhs _3 3) _5 ~attrs:(attrs@_6) - ~loc:(symbol_rloc()) ~docs:(symbol_docs ()) - , ext ) -# 9816 "ml/parser.ml" - : 'value_description)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : string * string option) in - Obj.repr( -# 1696 "ml/parser.mly" - ( [fst _1] ) -# 9823 "ml/parser.ml" - : 'primitive_declaration_body)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : string * string option) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'primitive_declaration_body) in - Obj.repr( -# 1697 "ml/parser.mly" - ( fst _1 :: _2 ) -# 9831 "ml/parser.ml" - : 'primitive_declaration_body)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 6 : 'ext_attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 5 : 'val_ident) in - let _5 = (Parsing.peek_val __caml_parser_env 3 : 'core_type) in - let _7 = (Parsing.peek_val __caml_parser_env 1 : 'primitive_declaration_body) in - let _8 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in - Obj.repr( -# 1702 "ml/parser.mly" - ( let (ext, attrs) = _2 in - Val.mk (mkrhs _3 3) _5 ~prim:_7 ~attrs:(attrs@_8) - ~loc:(symbol_rloc ()) ~docs:(symbol_docs ()) - , ext ) -# 9845 "ml/parser.ml" - : 'primitive_declaration)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'type_declaration) in - Obj.repr( -# 1712 "ml/parser.mly" - ( let (nonrec_flag, ty, ext) = _1 in (nonrec_flag, [ty], ext) ) -# 9852 "ml/parser.ml" - : 'type_declarations)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'type_declarations) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'and_type_declaration) in - Obj.repr( -# 1714 "ml/parser.mly" - ( let (nonrec_flag, tys, ext) = _1 in (nonrec_flag, _2 :: tys, ext) ) -# 9860 "ml/parser.ml" - : 'type_declarations)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 6 : 'ext_attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 5 : 'nonrec_flag) in - let _4 = (Parsing.peek_val __caml_parser_env 4 : 'optional_type_parameters) in - let _5 = (Parsing.peek_val __caml_parser_env 3 : string) in - let _6 = (Parsing.peek_val __caml_parser_env 2 : 'type_kind) in - let _7 = (Parsing.peek_val __caml_parser_env 1 : 'constraints) in - let _8 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in - Obj.repr( -# 1720 "ml/parser.mly" - ( let (kind, priv, manifest) = _6 in - let (ext, attrs) = _2 in - let ty = - Type.mk (mkrhs _5 5) ~params:_4 ~cstrs:(List.rev _7) ~kind - ~priv ?manifest ~attrs:(attrs@_8) - ~loc:(symbol_rloc ()) ~docs:(symbol_docs ()) - in - (_3, ty, ext) ) -# 9880 "ml/parser.ml" - : 'type_declaration)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 5 : 'attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 4 : 'optional_type_parameters) in - let _4 = (Parsing.peek_val __caml_parser_env 3 : string) in - let _5 = (Parsing.peek_val __caml_parser_env 2 : 'type_kind) in - let _6 = (Parsing.peek_val __caml_parser_env 1 : 'constraints) in - let _7 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in - Obj.repr( -# 1732 "ml/parser.mly" - ( let (kind, priv, manifest) = _5 in - Type.mk (mkrhs _4 4) ~params:_3 ~cstrs:(List.rev _6) - ~kind ~priv ?manifest ~attrs:(_2@_7) ~loc:(symbol_rloc ()) - ~text:(symbol_text ()) ~docs:(symbol_docs ()) ) -# 9895 "ml/parser.ml" - : 'and_type_declaration)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'constraints) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'constrain) in - Obj.repr( -# 1738 "ml/parser.mly" - ( _3 :: _1 ) -# 9903 "ml/parser.ml" - : 'constraints)) -; (fun __caml_parser_env -> - Obj.repr( -# 1739 "ml/parser.mly" - ( [] ) -# 9909 "ml/parser.ml" - : 'constraints)) -; (fun __caml_parser_env -> - Obj.repr( -# 1743 "ml/parser.mly" - ( (Ptype_abstract, Public, None) ) -# 9915 "ml/parser.ml" - : 'type_kind)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'core_type) in - Obj.repr( -# 1745 "ml/parser.mly" - ( (Ptype_abstract, Public, Some _2) ) -# 9922 "ml/parser.ml" - : 'type_kind)) -; (fun __caml_parser_env -> - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'core_type) in - Obj.repr( -# 1747 "ml/parser.mly" - ( (Ptype_abstract, Private, Some _3) ) -# 9929 "ml/parser.ml" - : 'type_kind)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'constructor_declarations) in - Obj.repr( -# 1749 "ml/parser.mly" - ( (Ptype_variant(List.rev _2), Public, None) ) -# 9936 "ml/parser.ml" - : 'type_kind)) -; (fun __caml_parser_env -> - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'constructor_declarations) in - Obj.repr( -# 1751 "ml/parser.mly" - ( (Ptype_variant(List.rev _3), Private, None) ) -# 9943 "ml/parser.ml" - : 'type_kind)) -; (fun __caml_parser_env -> - Obj.repr( -# 1753 "ml/parser.mly" - ( (Ptype_open, Public, None) ) -# 9949 "ml/parser.ml" - : 'type_kind)) -; (fun __caml_parser_env -> - Obj.repr( -# 1755 "ml/parser.mly" - ( (Ptype_open, Private, None) ) -# 9955 "ml/parser.ml" - : 'type_kind)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 3 : 'private_flag) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'label_declarations) in - Obj.repr( -# 1757 "ml/parser.mly" - ( (Ptype_record _4, _2, None) ) -# 9963 "ml/parser.ml" - : 'type_kind)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 3 : 'core_type) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'private_flag) in - let _5 = (Parsing.peek_val __caml_parser_env 0 : 'constructor_declarations) in - Obj.repr( -# 1759 "ml/parser.mly" - ( (Ptype_variant(List.rev _5), _4, Some _2) ) -# 9972 "ml/parser.ml" - : 'type_kind)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 3 : 'core_type) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'private_flag) in - Obj.repr( -# 1761 "ml/parser.mly" - ( (Ptype_open, _4, Some _2) ) -# 9980 "ml/parser.ml" - : 'type_kind)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 5 : 'core_type) in - let _4 = (Parsing.peek_val __caml_parser_env 3 : 'private_flag) in - let _6 = (Parsing.peek_val __caml_parser_env 1 : 'label_declarations) in - Obj.repr( -# 1763 "ml/parser.mly" - ( (Ptype_record _6, _4, Some _2) ) -# 9989 "ml/parser.ml" - : 'type_kind)) -; (fun __caml_parser_env -> - Obj.repr( -# 1766 "ml/parser.mly" - ( [] ) -# 9995 "ml/parser.ml" - : 'optional_type_parameters)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'optional_type_parameter) in - Obj.repr( -# 1767 "ml/parser.mly" - ( [_1] ) -# 10002 "ml/parser.ml" - : 'optional_type_parameters)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 1 : 'optional_type_parameter_list) in - Obj.repr( -# 1768 "ml/parser.mly" - ( List.rev _2 ) -# 10009 "ml/parser.ml" - : 'optional_type_parameters)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'type_variance) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'optional_type_variable) in - Obj.repr( -# 1771 "ml/parser.mly" - ( _2, _1 ) -# 10017 "ml/parser.ml" - : 'optional_type_parameter)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'optional_type_parameter) in - Obj.repr( -# 1774 "ml/parser.mly" - ( [_1] ) -# 10024 "ml/parser.ml" - : 'optional_type_parameter_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'optional_type_parameter_list) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'optional_type_parameter) in - Obj.repr( -# 1775 "ml/parser.mly" - ( _3 :: _1 ) -# 10032 "ml/parser.ml" - : 'optional_type_parameter_list)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'ident) in - Obj.repr( -# 1778 "ml/parser.mly" - ( mktyp(Ptyp_var _2) ) -# 10039 "ml/parser.ml" - : 'optional_type_variable)) -; (fun __caml_parser_env -> - Obj.repr( -# 1779 "ml/parser.mly" - ( mktyp(Ptyp_any) ) -# 10045 "ml/parser.ml" - : 'optional_type_variable)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'type_variance) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'type_variable) in - Obj.repr( -# 1784 "ml/parser.mly" - ( _2, _1 ) -# 10053 "ml/parser.ml" - : 'type_parameter)) -; (fun __caml_parser_env -> - Obj.repr( -# 1787 "ml/parser.mly" - ( Invariant ) -# 10059 "ml/parser.ml" - : 'type_variance)) -; (fun __caml_parser_env -> - Obj.repr( -# 1788 "ml/parser.mly" - ( Covariant ) -# 10065 "ml/parser.ml" - : 'type_variance)) -; (fun __caml_parser_env -> - Obj.repr( -# 1789 "ml/parser.mly" - ( Contravariant ) -# 10071 "ml/parser.ml" - : 'type_variance)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'ident) in - Obj.repr( -# 1792 "ml/parser.mly" - ( mktyp(Ptyp_var _2) ) -# 10078 "ml/parser.ml" - : 'type_variable)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'type_parameter) in - Obj.repr( -# 1795 "ml/parser.mly" - ( [_1] ) -# 10085 "ml/parser.ml" - : 'type_parameter_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'type_parameter_list) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'type_parameter) in - Obj.repr( -# 1796 "ml/parser.mly" - ( _3 :: _1 ) -# 10093 "ml/parser.ml" - : 'type_parameter_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'constructor_declaration) in - Obj.repr( -# 1799 "ml/parser.mly" - ( [_1] ) -# 10100 "ml/parser.ml" - : 'constructor_declarations)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'bar_constructor_declaration) in - Obj.repr( -# 1800 "ml/parser.mly" - ( [_1] ) -# 10107 "ml/parser.ml" - : 'constructor_declarations)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'constructor_declarations) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'bar_constructor_declaration) in - Obj.repr( -# 1801 "ml/parser.mly" - ( _2 :: _1 ) -# 10115 "ml/parser.ml" - : 'constructor_declarations)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'constr_ident) in - let _2 = (Parsing.peek_val __caml_parser_env 1 : 'generalized_constructor_arguments) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'attributes) in - Obj.repr( -# 1805 "ml/parser.mly" - ( - let args,res = _2 in - Type.constructor (mkrhs _1 1) ~args ?res ~attrs:_3 - ~loc:(symbol_rloc()) ~info:(symbol_info ()) - ) -# 10128 "ml/parser.ml" - : 'constructor_declaration)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'constr_ident) in - let _3 = (Parsing.peek_val __caml_parser_env 1 : 'generalized_constructor_arguments) in - let _4 = (Parsing.peek_val __caml_parser_env 0 : 'attributes) in - Obj.repr( -# 1813 "ml/parser.mly" - ( - let args,res = _3 in - Type.constructor (mkrhs _2 2) ~args ?res ~attrs:_4 - ~loc:(symbol_rloc()) ~info:(symbol_info ()) - ) -# 10141 "ml/parser.ml" - : 'bar_constructor_declaration)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'sig_exception_declaration) in - Obj.repr( -# 1820 "ml/parser.mly" - ( _1 ) -# 10148 "ml/parser.ml" - : 'str_exception_declaration)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 5 : 'ext_attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 4 : 'constr_ident) in - let _5 = (Parsing.peek_val __caml_parser_env 2 : 'constr_longident) in - let _6 = (Parsing.peek_val __caml_parser_env 1 : 'attributes) in - let _7 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in - Obj.repr( -# 1823 "ml/parser.mly" - ( let (ext,attrs) = _2 in - Te.rebind (mkrhs _3 3) (mkrhs _5 5) ~attrs:(attrs @ _6 @ _7) - ~loc:(symbol_rloc()) ~docs:(symbol_docs ()) - , ext ) -# 10162 "ml/parser.ml" - : 'str_exception_declaration)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 4 : 'ext_attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 3 : 'constr_ident) in - let _4 = (Parsing.peek_val __caml_parser_env 2 : 'generalized_constructor_arguments) in - let _5 = (Parsing.peek_val __caml_parser_env 1 : 'attributes) in - let _6 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in - Obj.repr( -# 1831 "ml/parser.mly" - ( let args, res = _4 in - let (ext,attrs) = _2 in - Te.decl (mkrhs _3 3) ~args ?res ~attrs:(attrs @ _5 @ _6) - ~loc:(symbol_rloc()) ~docs:(symbol_docs ()) - , ext ) -# 10177 "ml/parser.ml" - : 'sig_exception_declaration)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'constr_ident) in - let _2 = (Parsing.peek_val __caml_parser_env 1 : 'generalized_constructor_arguments) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'attributes) in - Obj.repr( -# 1839 "ml/parser.mly" - ( let args, res = _2 in - Te.decl (mkrhs _1 1) ~args ?res ~attrs:_3 ~loc:(symbol_rloc()) ) -# 10187 "ml/parser.ml" - : 'let_exception_declaration)) -; (fun __caml_parser_env -> - Obj.repr( -# 1843 "ml/parser.mly" - ( (Pcstr_tuple [],None) ) -# 10193 "ml/parser.ml" - : 'generalized_constructor_arguments)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'constructor_arguments) in - Obj.repr( -# 1844 "ml/parser.mly" - ( (_2,None) ) -# 10200 "ml/parser.ml" - : 'generalized_constructor_arguments)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'constructor_arguments) in - let _4 = (Parsing.peek_val __caml_parser_env 0 : 'simple_core_type) in - Obj.repr( -# 1846 "ml/parser.mly" - ( (_2,Some _4) ) -# 10208 "ml/parser.ml" - : 'generalized_constructor_arguments)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'simple_core_type) in - Obj.repr( -# 1848 "ml/parser.mly" - ( (Pcstr_tuple [],Some _2) ) -# 10215 "ml/parser.ml" - : 'generalized_constructor_arguments)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'core_type_list) in - Obj.repr( -# 1852 "ml/parser.mly" - ( Pcstr_tuple (List.rev _1) ) -# 10222 "ml/parser.ml" - : 'constructor_arguments)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 1 : 'label_declarations) in - Obj.repr( -# 1853 "ml/parser.mly" - ( Pcstr_record _2 ) -# 10229 "ml/parser.ml" - : 'constructor_arguments)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'label_declaration) in - Obj.repr( -# 1856 "ml/parser.mly" - ( [_1] ) -# 10236 "ml/parser.ml" - : 'label_declarations)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'label_declaration_semi) in - Obj.repr( -# 1857 "ml/parser.mly" - ( [_1] ) -# 10243 "ml/parser.ml" - : 'label_declarations)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'label_declaration_semi) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'label_declarations) in - Obj.repr( -# 1858 "ml/parser.mly" - ( _1 :: _2 ) -# 10251 "ml/parser.ml" - : 'label_declarations)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 4 : 'mutable_flag) in - let _2 = (Parsing.peek_val __caml_parser_env 3 : 'label) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'poly_type_no_attr) in - let _5 = (Parsing.peek_val __caml_parser_env 0 : 'attributes) in - Obj.repr( -# 1862 "ml/parser.mly" - ( - Type.field (mkrhs _2 2) _4 ~mut:_1 ~attrs:_5 - ~loc:(symbol_rloc()) ~info:(symbol_info ()) - ) -# 10264 "ml/parser.ml" - : 'label_declaration)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 6 : 'mutable_flag) in - let _2 = (Parsing.peek_val __caml_parser_env 5 : 'label) in - let _4 = (Parsing.peek_val __caml_parser_env 3 : 'poly_type_no_attr) in - let _5 = (Parsing.peek_val __caml_parser_env 2 : 'attributes) in - let _7 = (Parsing.peek_val __caml_parser_env 0 : 'attributes) in - Obj.repr( -# 1869 "ml/parser.mly" - ( - let info = - match rhs_info 5 with - | Some _ as info_before_semi -> info_before_semi - | None -> symbol_info () - in - Type.field (mkrhs _2 2) _4 ~mut:_1 ~attrs:(_5 @ _7) - ~loc:(symbol_rloc()) ~info - ) -# 10283 "ml/parser.ml" - : 'label_declaration_semi)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 7 : 'ext_attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 6 : 'nonrec_flag) in - let _4 = (Parsing.peek_val __caml_parser_env 5 : 'optional_type_parameters) in - let _5 = (Parsing.peek_val __caml_parser_env 4 : 'type_longident) in - let _7 = (Parsing.peek_val __caml_parser_env 2 : 'private_flag) in - let _8 = (Parsing.peek_val __caml_parser_env 1 : 'str_extension_constructors) in - let _9 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in - Obj.repr( -# 1885 "ml/parser.mly" - ( let (ext, attrs) = _2 in - if _3 <> Recursive then not_expecting 3 "nonrec flag"; - Te.mk (mkrhs _5 5) (List.rev _8) ~params:_4 ~priv:_7 - ~attrs:(attrs@_9) ~docs:(symbol_docs ()) - , ext ) -# 10300 "ml/parser.ml" - : 'str_type_extension)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 7 : 'ext_attributes) in - let _3 = (Parsing.peek_val __caml_parser_env 6 : 'nonrec_flag) in - let _4 = (Parsing.peek_val __caml_parser_env 5 : 'optional_type_parameters) in - let _5 = (Parsing.peek_val __caml_parser_env 4 : 'type_longident) in - let _7 = (Parsing.peek_val __caml_parser_env 2 : 'private_flag) in - let _8 = (Parsing.peek_val __caml_parser_env 1 : 'sig_extension_constructors) in - let _9 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in - Obj.repr( -# 1894 "ml/parser.mly" - ( let (ext, attrs) = _2 in - if _3 <> Recursive then not_expecting 3 "nonrec flag"; - Te.mk (mkrhs _5 5) (List.rev _8) ~params:_4 ~priv:_7 - ~attrs:(attrs @ _9) ~docs:(symbol_docs ()) - , ext ) -# 10317 "ml/parser.ml" - : 'sig_type_extension)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'extension_constructor_declaration) in - Obj.repr( -# 1901 "ml/parser.mly" - ( [_1] ) -# 10324 "ml/parser.ml" - : 'str_extension_constructors)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'bar_extension_constructor_declaration) in - Obj.repr( -# 1902 "ml/parser.mly" - ( [_1] ) -# 10331 "ml/parser.ml" - : 'str_extension_constructors)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'extension_constructor_rebind) in - Obj.repr( -# 1903 "ml/parser.mly" - ( [_1] ) -# 10338 "ml/parser.ml" - : 'str_extension_constructors)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'bar_extension_constructor_rebind) in - Obj.repr( -# 1904 "ml/parser.mly" - ( [_1] ) -# 10345 "ml/parser.ml" - : 'str_extension_constructors)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'str_extension_constructors) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'bar_extension_constructor_declaration) in - Obj.repr( -# 1906 "ml/parser.mly" - ( _2 :: _1 ) -# 10353 "ml/parser.ml" - : 'str_extension_constructors)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'str_extension_constructors) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'bar_extension_constructor_rebind) in - Obj.repr( -# 1908 "ml/parser.mly" - ( _2 :: _1 ) -# 10361 "ml/parser.ml" - : 'str_extension_constructors)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'extension_constructor_declaration) in - Obj.repr( -# 1911 "ml/parser.mly" - ( [_1] ) -# 10368 "ml/parser.ml" - : 'sig_extension_constructors)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'bar_extension_constructor_declaration) in - Obj.repr( -# 1912 "ml/parser.mly" - ( [_1] ) -# 10375 "ml/parser.ml" - : 'sig_extension_constructors)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'sig_extension_constructors) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'bar_extension_constructor_declaration) in - Obj.repr( -# 1914 "ml/parser.mly" - ( _2 :: _1 ) -# 10383 "ml/parser.ml" - : 'sig_extension_constructors)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'constr_ident) in - let _2 = (Parsing.peek_val __caml_parser_env 1 : 'generalized_constructor_arguments) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'attributes) in - Obj.repr( -# 1918 "ml/parser.mly" - ( let args, res = _2 in - Te.decl (mkrhs _1 1) ~args ?res ~attrs:_3 - ~loc:(symbol_rloc()) ~info:(symbol_info ()) ) -# 10394 "ml/parser.ml" - : 'extension_constructor_declaration)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'constr_ident) in - let _3 = (Parsing.peek_val __caml_parser_env 1 : 'generalized_constructor_arguments) in - let _4 = (Parsing.peek_val __caml_parser_env 0 : 'attributes) in - Obj.repr( -# 1924 "ml/parser.mly" - ( let args, res = _3 in - Te.decl (mkrhs _2 2) ~args ?res ~attrs:_4 - ~loc:(symbol_rloc()) ~info:(symbol_info ()) ) -# 10405 "ml/parser.ml" - : 'bar_extension_constructor_declaration)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 3 : 'constr_ident) in - let _3 = (Parsing.peek_val __caml_parser_env 1 : 'constr_longident) in - let _4 = (Parsing.peek_val __caml_parser_env 0 : 'attributes) in - Obj.repr( -# 1930 "ml/parser.mly" - ( Te.rebind (mkrhs _1 1) (mkrhs _3 3) ~attrs:_4 - ~loc:(symbol_rloc()) ~info:(symbol_info ()) ) -# 10415 "ml/parser.ml" - : 'extension_constructor_rebind)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 3 : 'constr_ident) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'constr_longident) in - let _5 = (Parsing.peek_val __caml_parser_env 0 : 'attributes) in - Obj.repr( -# 1935 "ml/parser.mly" - ( Te.rebind (mkrhs _2 2) (mkrhs _4 4) ~attrs:_5 - ~loc:(symbol_rloc()) ~info:(symbol_info ()) ) -# 10425 "ml/parser.ml" - : 'bar_extension_constructor_rebind)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'with_constraint) in - Obj.repr( -# 1942 "ml/parser.mly" - ( [_1] ) -# 10432 "ml/parser.ml" - : 'with_constraints)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'with_constraints) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'with_constraint) in - Obj.repr( -# 1943 "ml/parser.mly" - ( _3 :: _1 ) -# 10440 "ml/parser.ml" - : 'with_constraints)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 4 : 'optional_type_parameters) in - let _3 = (Parsing.peek_val __caml_parser_env 3 : 'label_longident) in - let _4 = (Parsing.peek_val __caml_parser_env 2 : 'with_type_binder) in - let _5 = (Parsing.peek_val __caml_parser_env 1 : 'core_type_no_attr) in - let _6 = (Parsing.peek_val __caml_parser_env 0 : 'constraints) in - Obj.repr( -# 1948 "ml/parser.mly" - ( Pwith_type - (mkrhs _3 3, - (Type.mk (mkrhs (Longident.last _3) 3) - ~params:_2 - ~cstrs:(List.rev _6) - ~manifest:_5 - ~priv:_4 - ~loc:(symbol_rloc()))) ) -# 10458 "ml/parser.ml" - : 'with_constraint)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 3 : 'optional_type_parameters) in - let _3 = (Parsing.peek_val __caml_parser_env 2 : 'label_longident) in - let _5 = (Parsing.peek_val __caml_parser_env 0 : 'core_type_no_attr) in - Obj.repr( -# 1959 "ml/parser.mly" - ( Pwith_typesubst - (mkrhs _3 3, - (Type.mk (mkrhs (Longident.last _3) 3) - ~params:_2 - ~manifest:_5 - ~loc:(symbol_rloc()))) ) -# 10472 "ml/parser.ml" - : 'with_constraint)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'mod_longident) in - let _4 = (Parsing.peek_val __caml_parser_env 0 : 'mod_ext_longident) in - Obj.repr( -# 1966 "ml/parser.mly" - ( Pwith_module (mkrhs _2 2, mkrhs _4 4) ) -# 10480 "ml/parser.ml" - : 'with_constraint)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'mod_longident) in - let _4 = (Parsing.peek_val __caml_parser_env 0 : 'mod_ext_longident) in - Obj.repr( -# 1968 "ml/parser.mly" - ( Pwith_modsubst (mkrhs _2 2, mkrhs _4 4) ) -# 10488 "ml/parser.ml" - : 'with_constraint)) -; (fun __caml_parser_env -> - Obj.repr( -# 1971 "ml/parser.mly" - ( Public ) -# 10494 "ml/parser.ml" - : 'with_type_binder)) -; (fun __caml_parser_env -> - Obj.repr( -# 1972 "ml/parser.mly" - ( Private ) -# 10500 "ml/parser.ml" - : 'with_type_binder)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'ident) in - Obj.repr( -# 1978 "ml/parser.mly" - ( [mkrhs _2 2] ) -# 10507 "ml/parser.ml" - : 'typevar_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'typevar_list) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'ident) in - Obj.repr( -# 1979 "ml/parser.mly" - ( mkrhs _3 3 :: _1 ) -# 10515 "ml/parser.ml" - : 'typevar_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'core_type) in - Obj.repr( -# 1983 "ml/parser.mly" - ( _1 ) -# 10522 "ml/parser.ml" - : 'poly_type)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'typevar_list) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'core_type) in - Obj.repr( -# 1985 "ml/parser.mly" - ( mktyp(Ptyp_poly(List.rev _1, _3)) ) -# 10530 "ml/parser.ml" - : 'poly_type)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'core_type_no_attr) in - Obj.repr( -# 1989 "ml/parser.mly" - ( _1 ) -# 10537 "ml/parser.ml" - : 'poly_type_no_attr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'typevar_list) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'core_type_no_attr) in - Obj.repr( -# 1991 "ml/parser.mly" - ( mktyp(Ptyp_poly(List.rev _1, _3)) ) -# 10545 "ml/parser.ml" - : 'poly_type_no_attr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'core_type_no_attr) in - Obj.repr( -# 1998 "ml/parser.mly" - ( _1 ) -# 10552 "ml/parser.ml" - : 'core_type)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'core_type) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'attribute) in - Obj.repr( -# 2000 "ml/parser.mly" - ( Typ.attr _1 _2 ) -# 10560 "ml/parser.ml" - : 'core_type)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'core_type2) in - Obj.repr( -# 2004 "ml/parser.mly" - ( _1 ) -# 10567 "ml/parser.ml" - : 'core_type_no_attr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 3 : 'core_type2) in - let _4 = (Parsing.peek_val __caml_parser_env 0 : 'ident) in - Obj.repr( -# 2006 "ml/parser.mly" - ( mktyp(Ptyp_alias(_1, _4)) ) -# 10575 "ml/parser.ml" - : 'core_type_no_attr)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'simple_core_type_or_tuple) in - Obj.repr( -# 2010 "ml/parser.mly" - ( _1 ) -# 10582 "ml/parser.ml" - : 'core_type2)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 4 : string) in - let _4 = (Parsing.peek_val __caml_parser_env 2 : 'core_type2) in - let _6 = (Parsing.peek_val __caml_parser_env 0 : 'core_type2) in - Obj.repr( -# 2012 "ml/parser.mly" - ( let param = extra_rhs_core_type _4 ~pos:4 in - mktyp (Ptyp_arrow(Optional _2 , param, _6)) ) -# 10592 "ml/parser.ml" - : 'core_type2)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 3 : string) in - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'core_type2) in - let _4 = (Parsing.peek_val __caml_parser_env 0 : 'core_type2) in - Obj.repr( -# 2015 "ml/parser.mly" - ( let param = extra_rhs_core_type _2 ~pos:2 in - mktyp(Ptyp_arrow(Optional _1 , param, _4)) - ) -# 10603 "ml/parser.ml" - : 'core_type2)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 4 : string) in - let _3 = (Parsing.peek_val __caml_parser_env 2 : 'core_type2) in - let _5 = (Parsing.peek_val __caml_parser_env 0 : 'core_type2) in - Obj.repr( -# 2019 "ml/parser.mly" - ( let param = extra_rhs_core_type _3 ~pos:3 in - mktyp(Ptyp_arrow(Labelled _1, param, _5)) ) -# 10613 "ml/parser.ml" - : 'core_type2)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'core_type2) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'core_type2) in - Obj.repr( -# 2022 "ml/parser.mly" - ( let param = extra_rhs_core_type _1 ~pos:1 in - mktyp(Ptyp_arrow(Nolabel, param, _3)) ) -# 10622 "ml/parser.ml" - : 'core_type2)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'simple_core_type2) in - Obj.repr( -# 2028 "ml/parser.mly" - ( _1 ) -# 10629 "ml/parser.ml" - : 'simple_core_type)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 1 : 'core_type_comma_list) in - Obj.repr( -# 2030 "ml/parser.mly" - ( match _2 with [sty] -> sty | _ -> raise Parse_error ) -# 10636 "ml/parser.ml" - : 'simple_core_type)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'ident) in - Obj.repr( -# 2035 "ml/parser.mly" - ( mktyp(Ptyp_var _2) ) -# 10643 "ml/parser.ml" - : 'simple_core_type2)) -; (fun __caml_parser_env -> - Obj.repr( -# 2037 "ml/parser.mly" - ( mktyp(Ptyp_any) ) -# 10649 "ml/parser.ml" - : 'simple_core_type2)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'type_longident) in - Obj.repr( -# 2039 "ml/parser.mly" - ( mktyp(Ptyp_constr(mkrhs _1 1, [])) ) -# 10656 "ml/parser.ml" - : 'simple_core_type2)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'simple_core_type2) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'type_longident) in - Obj.repr( -# 2041 "ml/parser.mly" - ( mktyp(Ptyp_constr(mkrhs _2 2, [_1])) ) -# 10664 "ml/parser.ml" - : 'simple_core_type2)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'core_type_comma_list) in - let _4 = (Parsing.peek_val __caml_parser_env 0 : 'type_longident) in - Obj.repr( -# 2043 "ml/parser.mly" - ( mktyp(Ptyp_constr(mkrhs _4 4, List.rev _2)) ) -# 10672 "ml/parser.ml" - : 'simple_core_type2)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 1 : 'meth_list) in - Obj.repr( -# 2045 "ml/parser.mly" - ( let (f, c) = _2 in mktyp(Ptyp_object (f, c)) ) -# 10679 "ml/parser.ml" - : 'simple_core_type2)) -; (fun __caml_parser_env -> - Obj.repr( -# 2047 "ml/parser.mly" - ( mktyp(Ptyp_object ([], Closed)) ) -# 10685 "ml/parser.ml" - : 'simple_core_type2)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'class_longident) in - Obj.repr( -# 2049 "ml/parser.mly" - ( mktyp(Ptyp_class()) ) -# 10692 "ml/parser.ml" - : 'simple_core_type2)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'simple_core_type2) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'class_longident) in - Obj.repr( -# 2051 "ml/parser.mly" - ( mktyp(Ptyp_class()) ) -# 10700 "ml/parser.ml" - : 'simple_core_type2)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 3 : 'core_type_comma_list) in - let _5 = (Parsing.peek_val __caml_parser_env 0 : 'class_longident) in - Obj.repr( -# 2053 "ml/parser.mly" - ( mktyp(Ptyp_class()) ) -# 10708 "ml/parser.ml" - : 'simple_core_type2)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 1 : 'tag_field) in - Obj.repr( -# 2055 "ml/parser.mly" - ( mktyp(Ptyp_variant([_2], Closed, None)) ) -# 10715 "ml/parser.ml" - : 'simple_core_type2)) -; (fun __caml_parser_env -> - let _3 = (Parsing.peek_val __caml_parser_env 1 : 'row_field_list) in - Obj.repr( -# 2061 "ml/parser.mly" - ( mktyp(Ptyp_variant(List.rev _3, Closed, None)) ) -# 10722 "ml/parser.ml" - : 'simple_core_type2)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 3 : 'row_field) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'row_field_list) in - Obj.repr( -# 2063 "ml/parser.mly" - ( mktyp(Ptyp_variant(_2 :: List.rev _4, Closed, None)) ) -# 10730 "ml/parser.ml" - : 'simple_core_type2)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'opt_bar) in - let _3 = (Parsing.peek_val __caml_parser_env 1 : 'row_field_list) in - Obj.repr( -# 2065 "ml/parser.mly" - ( mktyp(Ptyp_variant(List.rev _3, Open, None)) ) -# 10738 "ml/parser.ml" - : 'simple_core_type2)) -; (fun __caml_parser_env -> - Obj.repr( -# 2067 "ml/parser.mly" - ( mktyp(Ptyp_variant([], Open, None)) ) -# 10744 "ml/parser.ml" - : 'simple_core_type2)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'opt_bar) in - let _3 = (Parsing.peek_val __caml_parser_env 1 : 'row_field_list) in - Obj.repr( -# 2069 "ml/parser.mly" - ( mktyp(Ptyp_variant(List.rev _3, Closed, Some [])) ) -# 10752 "ml/parser.ml" - : 'simple_core_type2)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 4 : 'opt_bar) in - let _3 = (Parsing.peek_val __caml_parser_env 3 : 'row_field_list) in - let _5 = (Parsing.peek_val __caml_parser_env 1 : 'name_tag_list) in - Obj.repr( -# 2071 "ml/parser.mly" - ( mktyp(Ptyp_variant(List.rev _3, Closed, Some (List.rev _5))) ) -# 10761 "ml/parser.ml" - : 'simple_core_type2)) -; (fun __caml_parser_env -> - let _3 = (Parsing.peek_val __caml_parser_env 2 : 'ext_attributes) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'package_type) in - Obj.repr( -# 2073 "ml/parser.mly" - ( mktyp_attrs (Ptyp_package _4) _3 ) -# 10769 "ml/parser.ml" - : 'simple_core_type2)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'extension) in - Obj.repr( -# 2075 "ml/parser.mly" - ( mktyp (Ptyp_extension _1) ) -# 10776 "ml/parser.ml" - : 'simple_core_type2)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'module_type) in - Obj.repr( -# 2078 "ml/parser.mly" - ( package_type_of_module_type _1 ) -# 10783 "ml/parser.ml" - : 'package_type)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'row_field) in - Obj.repr( -# 2081 "ml/parser.mly" - ( [_1] ) -# 10790 "ml/parser.ml" - : 'row_field_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'row_field_list) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'row_field) in - Obj.repr( -# 2082 "ml/parser.mly" - ( _3 :: _1 ) -# 10798 "ml/parser.ml" - : 'row_field_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'tag_field) in - Obj.repr( -# 2085 "ml/parser.mly" - ( _1 ) -# 10805 "ml/parser.ml" - : 'row_field)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'simple_core_type) in - Obj.repr( -# 2086 "ml/parser.mly" - ( Rinherit _1 ) -# 10812 "ml/parser.ml" - : 'row_field)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 4 : 'name_tag) in - let _3 = (Parsing.peek_val __caml_parser_env 2 : 'opt_ampersand) in - let _4 = (Parsing.peek_val __caml_parser_env 1 : 'amper_type_list) in - let _5 = (Parsing.peek_val __caml_parser_env 0 : 'attributes) in - Obj.repr( -# 2090 "ml/parser.mly" - ( Rtag (mkrhs _1 1, add_info_attrs (symbol_info ()) _5, - _3, List.rev _4) ) -# 10823 "ml/parser.ml" - : 'tag_field)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'name_tag) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'attributes) in - Obj.repr( -# 2093 "ml/parser.mly" - ( Rtag (mkrhs _1 1, add_info_attrs (symbol_info ()) _2, true, []) ) -# 10831 "ml/parser.ml" - : 'tag_field)) -; (fun __caml_parser_env -> - Obj.repr( -# 2096 "ml/parser.mly" - ( true ) -# 10837 "ml/parser.ml" - : 'opt_ampersand)) -; (fun __caml_parser_env -> - Obj.repr( -# 2097 "ml/parser.mly" - ( false ) -# 10843 "ml/parser.ml" - : 'opt_ampersand)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'core_type_no_attr) in - Obj.repr( -# 2100 "ml/parser.mly" - ( [_1] ) -# 10850 "ml/parser.ml" - : 'amper_type_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'amper_type_list) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'core_type_no_attr) in - Obj.repr( -# 2101 "ml/parser.mly" - ( _3 :: _1 ) -# 10858 "ml/parser.ml" - : 'amper_type_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'name_tag) in - Obj.repr( -# 2104 "ml/parser.mly" - ( [_1] ) -# 10865 "ml/parser.ml" - : 'name_tag_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'name_tag_list) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'name_tag) in - Obj.repr( -# 2105 "ml/parser.mly" - ( _2 :: _1 ) -# 10873 "ml/parser.ml" - : 'name_tag_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'simple_core_type) in - Obj.repr( -# 2108 "ml/parser.mly" - ( _1 ) -# 10880 "ml/parser.ml" - : 'simple_core_type_or_tuple)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'simple_core_type) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'core_type_list) in - Obj.repr( -# 2110 "ml/parser.mly" - ( mktyp(Ptyp_tuple(_1 :: List.rev _3)) ) -# 10888 "ml/parser.ml" - : 'simple_core_type_or_tuple)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'core_type) in - Obj.repr( -# 2113 "ml/parser.mly" - ( [_1] ) -# 10895 "ml/parser.ml" - : 'core_type_comma_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'core_type_comma_list) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'core_type) in - Obj.repr( -# 2114 "ml/parser.mly" - ( _3 :: _1 ) -# 10903 "ml/parser.ml" - : 'core_type_comma_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'simple_core_type) in - Obj.repr( -# 2117 "ml/parser.mly" - ( [_1] ) -# 10910 "ml/parser.ml" - : 'core_type_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'core_type_list) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'simple_core_type) in - Obj.repr( -# 2118 "ml/parser.mly" - ( _3 :: _1 ) -# 10918 "ml/parser.ml" - : 'core_type_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'field_semi) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'meth_list) in - Obj.repr( -# 2121 "ml/parser.mly" - ( let (f, c) = _2 in (_1 :: f, c) ) -# 10926 "ml/parser.ml" - : 'meth_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'inherit_field_semi) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'meth_list) in - Obj.repr( -# 2122 "ml/parser.mly" - ( let (f, c) = _2 in (_1 :: f, c) ) -# 10934 "ml/parser.ml" - : 'meth_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'field_semi) in - Obj.repr( -# 2123 "ml/parser.mly" - ( [_1], Closed ) -# 10941 "ml/parser.ml" - : 'meth_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'field) in - Obj.repr( -# 2124 "ml/parser.mly" - ( [_1], Closed ) -# 10948 "ml/parser.ml" - : 'meth_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'inherit_field_semi) in - Obj.repr( -# 2125 "ml/parser.mly" - ( [_1], Closed ) -# 10955 "ml/parser.ml" - : 'meth_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'simple_core_type) in - Obj.repr( -# 2126 "ml/parser.mly" - ( [Oinherit _1], Closed ) -# 10962 "ml/parser.ml" - : 'meth_list)) -; (fun __caml_parser_env -> - Obj.repr( -# 2127 "ml/parser.mly" - ( [], Open ) -# 10968 "ml/parser.ml" - : 'meth_list)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 3 : 'label) in - let _3 = (Parsing.peek_val __caml_parser_env 1 : 'poly_type_no_attr) in - let _4 = (Parsing.peek_val __caml_parser_env 0 : 'attributes) in - Obj.repr( -# 2131 "ml/parser.mly" - ( Otag (mkrhs _1 1, add_info_attrs (symbol_info ()) _4, _3) ) -# 10977 "ml/parser.ml" - : 'field)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 5 : 'label) in - let _3 = (Parsing.peek_val __caml_parser_env 3 : 'poly_type_no_attr) in - let _4 = (Parsing.peek_val __caml_parser_env 2 : 'attributes) in - let _6 = (Parsing.peek_val __caml_parser_env 0 : 'attributes) in - Obj.repr( -# 2136 "ml/parser.mly" - ( let info = - match rhs_info 4 with - | Some _ as info_before_semi -> info_before_semi - | None -> symbol_info () - in - ( Otag (mkrhs _1 1, add_info_attrs info (_4 @ _6), _3)) ) -# 10992 "ml/parser.ml" - : 'field_semi)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'simple_core_type) in - Obj.repr( -# 2145 "ml/parser.mly" - ( Oinherit _1 ) -# 10999 "ml/parser.ml" - : 'inherit_field_semi)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in - Obj.repr( -# 2148 "ml/parser.mly" - ( _1 ) -# 11006 "ml/parser.ml" - : 'label)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : string * char option) in - Obj.repr( -# 2154 "ml/parser.mly" - ( let (n, m) = _1 in Pconst_integer (n, m) ) -# 11013 "ml/parser.ml" - : 'constant)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : char) in - Obj.repr( -# 2155 "ml/parser.mly" - ( Pconst_char (Char.code _1) ) -# 11020 "ml/parser.ml" - : 'constant)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : string * string option) in - Obj.repr( -# 2156 "ml/parser.mly" - ( let (s, d) = _1 in Pconst_string (s, d) ) -# 11027 "ml/parser.ml" - : 'constant)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : string * char option) in - Obj.repr( -# 2157 "ml/parser.mly" - ( let (f, m) = _1 in Pconst_float (f, m) ) -# 11034 "ml/parser.ml" - : 'constant)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'constant) in - Obj.repr( -# 2160 "ml/parser.mly" - ( _1 ) -# 11041 "ml/parser.ml" - : 'signed_constant)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 0 : string * char option) in - Obj.repr( -# 2161 "ml/parser.mly" - ( let (n, m) = _2 in Pconst_integer("-" ^ n, m) ) -# 11048 "ml/parser.ml" - : 'signed_constant)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 0 : string * char option) in - Obj.repr( -# 2162 "ml/parser.mly" - ( let (f, m) = _2 in Pconst_float("-" ^ f, m) ) -# 11055 "ml/parser.ml" - : 'signed_constant)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 0 : string * char option) in - Obj.repr( -# 2163 "ml/parser.mly" - ( let (n, m) = _2 in Pconst_integer (n, m) ) -# 11062 "ml/parser.ml" - : 'signed_constant)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 0 : string * char option) in - Obj.repr( -# 2164 "ml/parser.mly" - ( let (f, m) = _2 in Pconst_float(f, m) ) -# 11069 "ml/parser.ml" - : 'signed_constant)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in - Obj.repr( -# 2170 "ml/parser.mly" - ( _1 ) -# 11076 "ml/parser.ml" - : 'ident)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in - Obj.repr( -# 2171 "ml/parser.mly" - ( _1 ) -# 11083 "ml/parser.ml" - : 'ident)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in - Obj.repr( -# 2174 "ml/parser.mly" - ( _1 ) -# 11090 "ml/parser.ml" - : 'val_ident)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 1 : 'operator) in - Obj.repr( -# 2175 "ml/parser.mly" - ( _2 ) -# 11097 "ml/parser.ml" - : 'val_ident)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 1 : 'operator) in - Obj.repr( -# 2176 "ml/parser.mly" - ( unclosed "(" 1 ")" 3 ) -# 11104 "ml/parser.ml" - : 'val_ident)) -; (fun __caml_parser_env -> - Obj.repr( -# 2177 "ml/parser.mly" - ( expecting 2 "operator" ) -# 11110 "ml/parser.ml" - : 'val_ident)) -; (fun __caml_parser_env -> - Obj.repr( -# 2178 "ml/parser.mly" - ( expecting 3 "module-expr" ) -# 11116 "ml/parser.ml" - : 'val_ident)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in - Obj.repr( -# 2181 "ml/parser.mly" - ( _1 ) -# 11123 "ml/parser.ml" - : 'operator)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in - Obj.repr( -# 2182 "ml/parser.mly" - ( _1 ) -# 11130 "ml/parser.ml" - : 'operator)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in - Obj.repr( -# 2183 "ml/parser.mly" - ( _1 ) -# 11137 "ml/parser.ml" - : 'operator)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in - Obj.repr( -# 2184 "ml/parser.mly" - ( _1 ) -# 11144 "ml/parser.ml" - : 'operator)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in - Obj.repr( -# 2185 "ml/parser.mly" - ( _1 ) -# 11151 "ml/parser.ml" - : 'operator)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in - Obj.repr( -# 2186 "ml/parser.mly" - ( _1 ) -# 11158 "ml/parser.ml" - : 'operator)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : string) in - Obj.repr( -# 2187 "ml/parser.mly" - ( "."^ _1 ^"()" ) -# 11165 "ml/parser.ml" - : 'operator)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 3 : string) in - Obj.repr( -# 2188 "ml/parser.mly" - ( "."^ _1 ^ "()<-" ) -# 11172 "ml/parser.ml" - : 'operator)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : string) in - Obj.repr( -# 2189 "ml/parser.mly" - ( "."^ _1 ^"[]" ) -# 11179 "ml/parser.ml" - : 'operator)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 3 : string) in - Obj.repr( -# 2190 "ml/parser.mly" - ( "."^ _1 ^ "[]<-" ) -# 11186 "ml/parser.ml" - : 'operator)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : string) in - Obj.repr( -# 2191 "ml/parser.mly" - ( "."^ _1 ^"{}" ) -# 11193 "ml/parser.ml" - : 'operator)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 3 : string) in - Obj.repr( -# 2192 "ml/parser.mly" - ( "."^ _1 ^ "{}<-" ) -# 11200 "ml/parser.ml" - : 'operator)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in - Obj.repr( -# 2193 "ml/parser.mly" - ( _1 ) -# 11207 "ml/parser.ml" - : 'operator)) -; (fun __caml_parser_env -> - Obj.repr( -# 2194 "ml/parser.mly" - ( "!" ) -# 11213 "ml/parser.ml" - : 'operator)) -; (fun __caml_parser_env -> - Obj.repr( -# 2195 "ml/parser.mly" - ( "+" ) -# 11219 "ml/parser.ml" - : 'operator)) -; (fun __caml_parser_env -> - Obj.repr( -# 2196 "ml/parser.mly" - ( "+." ) -# 11225 "ml/parser.ml" - : 'operator)) -; (fun __caml_parser_env -> - Obj.repr( -# 2197 "ml/parser.mly" - ( "-" ) -# 11231 "ml/parser.ml" - : 'operator)) -; (fun __caml_parser_env -> - Obj.repr( -# 2198 "ml/parser.mly" - ( "-." ) -# 11237 "ml/parser.ml" - : 'operator)) -; (fun __caml_parser_env -> - Obj.repr( -# 2199 "ml/parser.mly" - ( "*" ) -# 11243 "ml/parser.ml" - : 'operator)) -; (fun __caml_parser_env -> - Obj.repr( -# 2200 "ml/parser.mly" - ( "=" ) -# 11249 "ml/parser.ml" - : 'operator)) -; (fun __caml_parser_env -> - Obj.repr( -# 2201 "ml/parser.mly" - ( "<" ) -# 11255 "ml/parser.ml" - : 'operator)) -; (fun __caml_parser_env -> - Obj.repr( -# 2202 "ml/parser.mly" - ( ">" ) -# 11261 "ml/parser.ml" - : 'operator)) -; (fun __caml_parser_env -> - Obj.repr( -# 2203 "ml/parser.mly" - ( "or" ) -# 11267 "ml/parser.ml" - : 'operator)) -; (fun __caml_parser_env -> - Obj.repr( -# 2204 "ml/parser.mly" - ( "||" ) -# 11273 "ml/parser.ml" - : 'operator)) -; (fun __caml_parser_env -> - Obj.repr( -# 2205 "ml/parser.mly" - ( "&" ) -# 11279 "ml/parser.ml" - : 'operator)) -; (fun __caml_parser_env -> - Obj.repr( -# 2206 "ml/parser.mly" - ( "&&" ) -# 11285 "ml/parser.ml" - : 'operator)) -; (fun __caml_parser_env -> - Obj.repr( -# 2207 "ml/parser.mly" - ( ":=" ) -# 11291 "ml/parser.ml" - : 'operator)) -; (fun __caml_parser_env -> - Obj.repr( -# 2208 "ml/parser.mly" - ( "+=" ) -# 11297 "ml/parser.ml" - : 'operator)) -; (fun __caml_parser_env -> - Obj.repr( -# 2209 "ml/parser.mly" - ( "%" ) -# 11303 "ml/parser.ml" - : 'operator)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in - Obj.repr( -# 2212 "ml/parser.mly" - ( _1 ) -# 11310 "ml/parser.ml" - : 'constr_ident)) -; (fun __caml_parser_env -> - Obj.repr( -# 2213 "ml/parser.mly" - ( "[]" ) -# 11316 "ml/parser.ml" - : 'constr_ident)) -; (fun __caml_parser_env -> - Obj.repr( -# 2214 "ml/parser.mly" - ( "()" ) -# 11322 "ml/parser.ml" - : 'constr_ident)) -; (fun __caml_parser_env -> - Obj.repr( -# 2215 "ml/parser.mly" - ( "::" ) -# 11328 "ml/parser.ml" - : 'constr_ident)) -; (fun __caml_parser_env -> - Obj.repr( -# 2216 "ml/parser.mly" - ( "false" ) -# 11334 "ml/parser.ml" - : 'constr_ident)) -; (fun __caml_parser_env -> - Obj.repr( -# 2217 "ml/parser.mly" - ( "true" ) -# 11340 "ml/parser.ml" - : 'constr_ident)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'val_ident) in - Obj.repr( -# 2221 "ml/parser.mly" - ( Lident _1 ) -# 11347 "ml/parser.ml" - : 'val_longident)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'mod_longident) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'val_ident) in - Obj.repr( -# 2222 "ml/parser.mly" - ( Ldot(_1, _3) ) -# 11355 "ml/parser.ml" - : 'val_longident)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'mod_longident) in - Obj.repr( -# 2225 "ml/parser.mly" - ( _1 ) -# 11362 "ml/parser.ml" - : 'constr_longident)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 4 : 'mod_longident) in - Obj.repr( -# 2226 "ml/parser.mly" - ( Ldot(_1,"::") ) -# 11369 "ml/parser.ml" - : 'constr_longident)) -; (fun __caml_parser_env -> - Obj.repr( -# 2227 "ml/parser.mly" - ( Lident "[]" ) -# 11375 "ml/parser.ml" - : 'constr_longident)) -; (fun __caml_parser_env -> - Obj.repr( -# 2228 "ml/parser.mly" - ( Lident "()" ) -# 11381 "ml/parser.ml" - : 'constr_longident)) -; (fun __caml_parser_env -> - Obj.repr( -# 2229 "ml/parser.mly" - ( Lident "::" ) -# 11387 "ml/parser.ml" - : 'constr_longident)) -; (fun __caml_parser_env -> - Obj.repr( -# 2230 "ml/parser.mly" - ( Lident "false" ) -# 11393 "ml/parser.ml" - : 'constr_longident)) -; (fun __caml_parser_env -> - Obj.repr( -# 2231 "ml/parser.mly" - ( Lident "true" ) -# 11399 "ml/parser.ml" - : 'constr_longident)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in - Obj.repr( -# 2234 "ml/parser.mly" - ( Lident _1 ) -# 11406 "ml/parser.ml" - : 'label_longident)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'mod_longident) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : string) in - Obj.repr( -# 2235 "ml/parser.mly" - ( Ldot(_1, _3) ) -# 11414 "ml/parser.ml" - : 'label_longident)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in - Obj.repr( -# 2238 "ml/parser.mly" - ( Lident _1 ) -# 11421 "ml/parser.ml" - : 'type_longident)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'mod_ext_longident) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : string) in - Obj.repr( -# 2239 "ml/parser.mly" - ( Ldot(_1, _3) ) -# 11429 "ml/parser.ml" - : 'type_longident)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in - Obj.repr( -# 2242 "ml/parser.mly" - ( Lident _1 ) -# 11436 "ml/parser.ml" - : 'mod_longident)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'mod_longident) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : string) in - Obj.repr( -# 2243 "ml/parser.mly" - ( Ldot(_1, _3) ) -# 11444 "ml/parser.ml" - : 'mod_longident)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in - Obj.repr( -# 2246 "ml/parser.mly" - ( Lident _1 ) -# 11451 "ml/parser.ml" - : 'mod_ext_longident)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'mod_ext_longident) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : string) in - Obj.repr( -# 2247 "ml/parser.mly" - ( Ldot(_1, _3) ) -# 11459 "ml/parser.ml" - : 'mod_ext_longident)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 3 : 'mod_ext_longident) in - let _3 = (Parsing.peek_val __caml_parser_env 1 : 'mod_ext_longident) in - Obj.repr( -# 2248 "ml/parser.mly" - ( lapply _1 _3 ) -# 11467 "ml/parser.ml" - : 'mod_ext_longident)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'ident) in - Obj.repr( -# 2251 "ml/parser.mly" - ( Lident _1 ) -# 11474 "ml/parser.ml" - : 'mty_longident)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'mod_ext_longident) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'ident) in - Obj.repr( -# 2252 "ml/parser.mly" - ( Ldot(_1, _3) ) -# 11482 "ml/parser.ml" - : 'mty_longident)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in - Obj.repr( -# 2255 "ml/parser.mly" - ( Lident _1 ) -# 11489 "ml/parser.ml" - : 'clty_longident)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'mod_ext_longident) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : string) in - Obj.repr( -# 2256 "ml/parser.mly" - ( Ldot(_1, _3) ) -# 11497 "ml/parser.ml" - : 'clty_longident)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in - Obj.repr( -# 2259 "ml/parser.mly" - ( Lident _1 ) -# 11504 "ml/parser.ml" - : 'class_longident)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'mod_longident) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : string) in - Obj.repr( -# 2260 "ml/parser.mly" - ( Ldot(_1, _3) ) -# 11512 "ml/parser.ml" - : 'class_longident)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'ident) in - Obj.repr( -# 2269 "ml/parser.mly" - ( _2 ) -# 11519 "ml/parser.ml" - : 'name_tag)) -; (fun __caml_parser_env -> - Obj.repr( -# 2272 "ml/parser.mly" - ( Nonrecursive ) -# 11525 "ml/parser.ml" - : 'rec_flag)) -; (fun __caml_parser_env -> - Obj.repr( -# 2273 "ml/parser.mly" - ( Recursive ) -# 11531 "ml/parser.ml" - : 'rec_flag)) -; (fun __caml_parser_env -> - Obj.repr( -# 2276 "ml/parser.mly" - ( Recursive ) -# 11537 "ml/parser.ml" - : 'nonrec_flag)) -; (fun __caml_parser_env -> - Obj.repr( -# 2277 "ml/parser.mly" - ( Nonrecursive ) -# 11543 "ml/parser.ml" - : 'nonrec_flag)) -; (fun __caml_parser_env -> - Obj.repr( -# 2280 "ml/parser.mly" - ( Upto ) -# 11549 "ml/parser.ml" - : 'direction_flag)) -; (fun __caml_parser_env -> - Obj.repr( -# 2281 "ml/parser.mly" - ( Downto ) -# 11555 "ml/parser.ml" - : 'direction_flag)) -; (fun __caml_parser_env -> - Obj.repr( -# 2284 "ml/parser.mly" - ( Public ) -# 11561 "ml/parser.ml" - : 'private_flag)) -; (fun __caml_parser_env -> - Obj.repr( -# 2285 "ml/parser.mly" - ( Private ) -# 11567 "ml/parser.ml" - : 'private_flag)) -; (fun __caml_parser_env -> - Obj.repr( -# 2288 "ml/parser.mly" - ( Immutable ) -# 11573 "ml/parser.ml" - : 'mutable_flag)) -; (fun __caml_parser_env -> - Obj.repr( -# 2289 "ml/parser.mly" - ( Mutable ) -# 11579 "ml/parser.ml" - : 'mutable_flag)) -; (fun __caml_parser_env -> - Obj.repr( -# 2292 "ml/parser.mly" - ( Concrete ) -# 11585 "ml/parser.ml" - : 'virtual_flag)) -; (fun __caml_parser_env -> - Obj.repr( -# 2293 "ml/parser.mly" - ( Virtual ) -# 11591 "ml/parser.ml" - : 'virtual_flag)) -; (fun __caml_parser_env -> - Obj.repr( -# 2296 "ml/parser.mly" - ( Public, Concrete ) -# 11597 "ml/parser.ml" - : 'private_virtual_flags)) -; (fun __caml_parser_env -> - Obj.repr( -# 2297 "ml/parser.mly" - ( Private, Concrete ) -# 11603 "ml/parser.ml" - : 'private_virtual_flags)) -; (fun __caml_parser_env -> - Obj.repr( -# 2298 "ml/parser.mly" - ( Public, Virtual ) -# 11609 "ml/parser.ml" - : 'private_virtual_flags)) -; (fun __caml_parser_env -> - Obj.repr( -# 2299 "ml/parser.mly" - ( Private, Virtual ) -# 11615 "ml/parser.ml" - : 'private_virtual_flags)) -; (fun __caml_parser_env -> - Obj.repr( -# 2300 "ml/parser.mly" - ( Private, Virtual ) -# 11621 "ml/parser.ml" - : 'private_virtual_flags)) -; (fun __caml_parser_env -> - Obj.repr( -# 2303 "ml/parser.mly" - ( Fresh ) -# 11627 "ml/parser.ml" - : 'override_flag)) -; (fun __caml_parser_env -> - Obj.repr( -# 2304 "ml/parser.mly" - ( Override ) -# 11633 "ml/parser.ml" - : 'override_flag)) -; (fun __caml_parser_env -> - Obj.repr( -# 2307 "ml/parser.mly" - ( () ) -# 11639 "ml/parser.ml" - : 'opt_bar)) -; (fun __caml_parser_env -> - Obj.repr( -# 2308 "ml/parser.mly" - ( () ) -# 11645 "ml/parser.ml" - : 'opt_bar)) -; (fun __caml_parser_env -> - Obj.repr( -# 2311 "ml/parser.mly" - ( () ) -# 11651 "ml/parser.ml" - : 'opt_semi)) -; (fun __caml_parser_env -> - Obj.repr( -# 2312 "ml/parser.mly" - ( () ) -# 11657 "ml/parser.ml" - : 'opt_semi)) -; (fun __caml_parser_env -> - Obj.repr( -# 2315 "ml/parser.mly" - ( "-" ) -# 11663 "ml/parser.ml" - : 'subtractive)) -; (fun __caml_parser_env -> - Obj.repr( -# 2316 "ml/parser.mly" - ( "-." ) -# 11669 "ml/parser.ml" - : 'subtractive)) -; (fun __caml_parser_env -> - Obj.repr( -# 2319 "ml/parser.mly" - ( "+" ) -# 11675 "ml/parser.ml" - : 'additive)) -; (fun __caml_parser_env -> - Obj.repr( -# 2320 "ml/parser.mly" - ( "+." ) -# 11681 "ml/parser.ml" - : 'additive)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in - Obj.repr( -# 2326 "ml/parser.mly" - ( _1 ) -# 11688 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in - Obj.repr( -# 2327 "ml/parser.mly" - ( _1 ) -# 11695 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2328 "ml/parser.mly" - ( "and" ) -# 11701 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2329 "ml/parser.mly" - ( "as" ) -# 11707 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2330 "ml/parser.mly" - ( "assert" ) -# 11713 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2331 "ml/parser.mly" - ( "begin" ) -# 11719 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2332 "ml/parser.mly" - ( "class" ) -# 11725 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2333 "ml/parser.mly" - ( "constraint" ) -# 11731 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2334 "ml/parser.mly" - ( "do" ) -# 11737 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2335 "ml/parser.mly" - ( "done" ) -# 11743 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2336 "ml/parser.mly" - ( "downto" ) -# 11749 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2337 "ml/parser.mly" - ( "else" ) -# 11755 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2338 "ml/parser.mly" - ( "end" ) -# 11761 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2339 "ml/parser.mly" - ( "exception" ) -# 11767 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2340 "ml/parser.mly" - ( "external" ) -# 11773 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2341 "ml/parser.mly" - ( "false" ) -# 11779 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2342 "ml/parser.mly" - ( "for" ) -# 11785 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2343 "ml/parser.mly" - ( "fun" ) -# 11791 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2344 "ml/parser.mly" - ( "function" ) -# 11797 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2345 "ml/parser.mly" - ( "functor" ) -# 11803 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2346 "ml/parser.mly" - ( "if" ) -# 11809 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2347 "ml/parser.mly" - ( "in" ) -# 11815 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2348 "ml/parser.mly" - ( "include" ) -# 11821 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2349 "ml/parser.mly" - ( "inherit" ) -# 11827 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2350 "ml/parser.mly" - ( "initializer" ) -# 11833 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2351 "ml/parser.mly" - ( "lazy" ) -# 11839 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2352 "ml/parser.mly" - ( "let" ) -# 11845 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2353 "ml/parser.mly" - ( "match" ) -# 11851 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2354 "ml/parser.mly" - ( "method" ) -# 11857 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2355 "ml/parser.mly" - ( "module" ) -# 11863 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2356 "ml/parser.mly" - ( "mutable" ) -# 11869 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2357 "ml/parser.mly" - ( "new" ) -# 11875 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2358 "ml/parser.mly" - ( "nonrec" ) -# 11881 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2359 "ml/parser.mly" - ( "object" ) -# 11887 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2360 "ml/parser.mly" - ( "of" ) -# 11893 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2361 "ml/parser.mly" - ( "open" ) -# 11899 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2362 "ml/parser.mly" - ( "or" ) -# 11905 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2363 "ml/parser.mly" - ( "private" ) -# 11911 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2364 "ml/parser.mly" - ( "rec" ) -# 11917 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2365 "ml/parser.mly" - ( "sig" ) -# 11923 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2366 "ml/parser.mly" - ( "struct" ) -# 11929 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2367 "ml/parser.mly" - ( "then" ) -# 11935 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2368 "ml/parser.mly" - ( "to" ) -# 11941 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2369 "ml/parser.mly" - ( "true" ) -# 11947 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2370 "ml/parser.mly" - ( "try" ) -# 11953 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2371 "ml/parser.mly" - ( "type" ) -# 11959 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2372 "ml/parser.mly" - ( "val" ) -# 11965 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2373 "ml/parser.mly" - ( "virtual" ) -# 11971 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2374 "ml/parser.mly" - ( "when" ) -# 11977 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2375 "ml/parser.mly" - ( "while" ) -# 11983 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - Obj.repr( -# 2376 "ml/parser.mly" - ( "with" ) -# 11989 "ml/parser.ml" - : 'single_attr_id)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'single_attr_id) in - Obj.repr( -# 2381 "ml/parser.mly" - ( mkloc _1 (symbol_rloc()) ) -# 11996 "ml/parser.ml" - : 'attr_id)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 2 : 'single_attr_id) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'attr_id) in - Obj.repr( -# 2382 "ml/parser.mly" - ( mkloc (_1 ^ "." ^ _3.txt) (symbol_rloc())) -# 12004 "ml/parser.ml" - : 'attr_id)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'attr_id) in - let _3 = (Parsing.peek_val __caml_parser_env 1 : 'payload) in - Obj.repr( -# 2385 "ml/parser.mly" - ( (_2, _3) ) -# 12012 "ml/parser.ml" - : 'attribute)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'attr_id) in - let _3 = (Parsing.peek_val __caml_parser_env 1 : 'payload) in - Obj.repr( -# 2388 "ml/parser.mly" - ( (_2, _3) ) -# 12020 "ml/parser.ml" - : 'post_item_attribute)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'attr_id) in - let _3 = (Parsing.peek_val __caml_parser_env 1 : 'payload) in - Obj.repr( -# 2391 "ml/parser.mly" - ( (_2, _3) ) -# 12028 "ml/parser.ml" - : 'floating_attribute)) -; (fun __caml_parser_env -> - Obj.repr( -# 2394 "ml/parser.mly" - ( [] ) -# 12034 "ml/parser.ml" - : 'post_item_attributes)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'post_item_attribute) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in - Obj.repr( -# 2395 "ml/parser.mly" - ( _1 :: _2 ) -# 12042 "ml/parser.ml" - : 'post_item_attributes)) -; (fun __caml_parser_env -> - Obj.repr( -# 2398 "ml/parser.mly" - ( [] ) -# 12048 "ml/parser.ml" - : 'attributes)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'attribute) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'attributes) in - Obj.repr( -# 2399 "ml/parser.mly" - ( _1 :: _2 ) -# 12056 "ml/parser.ml" - : 'attributes)) -; (fun __caml_parser_env -> - Obj.repr( -# 2402 "ml/parser.mly" - ( None, [] ) -# 12062 "ml/parser.ml" - : 'ext_attributes)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 1 : 'attribute) in - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'attributes) in - Obj.repr( -# 2403 "ml/parser.mly" - ( None, _1 :: _2 ) -# 12070 "ml/parser.ml" - : 'ext_attributes)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 1 : 'attr_id) in - let _3 = (Parsing.peek_val __caml_parser_env 0 : 'attributes) in - Obj.repr( -# 2404 "ml/parser.mly" - ( Some _2, _3 ) -# 12078 "ml/parser.ml" - : 'ext_attributes)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'attr_id) in - let _3 = (Parsing.peek_val __caml_parser_env 1 : 'payload) in - Obj.repr( -# 2407 "ml/parser.mly" - ( (_2, _3) ) -# 12086 "ml/parser.ml" - : 'extension)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'attr_id) in - let _3 = (Parsing.peek_val __caml_parser_env 1 : 'payload) in - Obj.repr( -# 2410 "ml/parser.mly" - ( (_2, _3) ) -# 12094 "ml/parser.ml" - : 'item_extension)) -; (fun __caml_parser_env -> - let _1 = (Parsing.peek_val __caml_parser_env 0 : 'structure) in - Obj.repr( -# 2413 "ml/parser.mly" - ( PStr _1 ) -# 12101 "ml/parser.ml" - : 'payload)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'signature) in - Obj.repr( -# 2414 "ml/parser.mly" - ( PSig _2 ) -# 12108 "ml/parser.ml" - : 'payload)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'core_type) in - Obj.repr( -# 2415 "ml/parser.mly" - ( PTyp _2 ) -# 12115 "ml/parser.ml" - : 'payload)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 0 : 'pattern) in - Obj.repr( -# 2416 "ml/parser.mly" - ( PPat (_2, None) ) -# 12122 "ml/parser.ml" - : 'payload)) -; (fun __caml_parser_env -> - let _2 = (Parsing.peek_val __caml_parser_env 2 : 'pattern) in - let _4 = (Parsing.peek_val __caml_parser_env 0 : 'seq_expr) in - Obj.repr( -# 2417 "ml/parser.mly" - ( PPat (_2, Some _4) ) -# 12130 "ml/parser.ml" - : 'payload)) -(* Entry implementation *) -; (fun __caml_parser_env -> raise (Parsing.YYexit (Parsing.peek_val __caml_parser_env 0))) -(* Entry interface *) -; (fun __caml_parser_env -> raise (Parsing.YYexit (Parsing.peek_val __caml_parser_env 0))) -(* Entry parse_core_type *) -; (fun __caml_parser_env -> raise (Parsing.YYexit (Parsing.peek_val __caml_parser_env 0))) -(* Entry parse_expression *) -; (fun __caml_parser_env -> raise (Parsing.YYexit (Parsing.peek_val __caml_parser_env 0))) -(* Entry parse_pattern *) -; (fun __caml_parser_env -> raise (Parsing.YYexit (Parsing.peek_val __caml_parser_env 0))) -|] -let yytables = - { Parsing.actions=yyact; - Parsing.transl_const=yytransl_const; - Parsing.transl_block=yytransl_block; - Parsing.lhs=yylhs; - Parsing.len=yylen; - Parsing.defred=yydefred; - Parsing.dgoto=yydgoto; - Parsing.sindex=yysindex; - Parsing.rindex=yyrindex; - Parsing.gindex=yygindex; - Parsing.tablesize=yytablesize; - Parsing.table=yytable; - Parsing.check=yycheck; - Parsing.error_function=parse_error; - Parsing.names_const=yynames_const; - Parsing.names_block=yynames_block } -let implementation (lexfun : Lexing.lexbuf -> token) (lexbuf : Lexing.lexbuf) = - (Parsing.yyparse yytables 1 lexfun lexbuf : Parsetree.structure) -let interface (lexfun : Lexing.lexbuf -> token) (lexbuf : Lexing.lexbuf) = - (Parsing.yyparse yytables 2 lexfun lexbuf : Parsetree.signature) -let parse_core_type (lexfun : Lexing.lexbuf -> token) (lexbuf : Lexing.lexbuf) = - (Parsing.yyparse yytables 3 lexfun lexbuf : Parsetree.core_type) -let parse_expression (lexfun : Lexing.lexbuf -> token) (lexbuf : Lexing.lexbuf) = - (Parsing.yyparse yytables 4 lexfun lexbuf : Parsetree.expression) -let parse_pattern (lexfun : Lexing.lexbuf -> token) (lexbuf : Lexing.lexbuf) = - (Parsing.yyparse yytables 5 lexfun lexbuf : Parsetree.pattern) -;; diff --git a/jscomp/ml/parser.mli b/jscomp/ml/parser.mli deleted file mode 100644 index fd7969f7b3..0000000000 --- a/jscomp/ml/parser.mli +++ /dev/null @@ -1,131 +0,0 @@ -type token = - | AMPERAMPER - | AMPERSAND - | AND - | AS - | ASSERT - | BACKQUOTE - | BANG - | BAR - | BARBAR - | BARRBRACKET - | BEGIN - | CHAR of (char) - | CLASS - | COLON - | COLONCOLON - | COLONEQUAL - | COLONGREATER - | COMMA - | CONSTRAINT - | DO - | DONE - | DOT - | DOTDOT - | DOWNTO - | ELSE - | END - | EOF - | EQUAL - | EXCEPTION - | EXTERNAL - | FALSE - | FLOAT of (string * char option) - | FOR - | FUN - | FUNCTION - | FUNCTOR - | GREATER - | GREATERRBRACE - | GREATERRBRACKET - | IF - | IN - | INCLUDE - | INFIXOP0 of (string) - | INFIXOP1 of (string) - | INFIXOP2 of (string) - | INFIXOP3 of (string) - | INFIXOP4 of (string) - | DOTOP of (string) - | INHERIT - | INITIALIZER - | INT of (string * char option) - | LABEL of (string) - | LAZY - | LBRACE - | LBRACELESS - | LBRACKET - | LBRACKETBAR - | LBRACKETLESS - | LBRACKETGREATER - | LBRACKETPERCENT - | LBRACKETPERCENTPERCENT - | LESS - | LESSMINUS - | LET - | LIDENT of (string) - | LPAREN - | LBRACKETAT - | LBRACKETATAT - | LBRACKETATATAT - | MATCH - | METHOD - | MINUS - | MINUSDOT - | MINUSGREATER - | MODULE - | MUTABLE - | NEW - | NONREC - | OBJECT - | OF - | OPEN - | OPTLABEL of (string) - | OR - | PERCENT - | PLUS - | PLUSDOT - | PLUSEQ - | PREFIXOP of (string) - | PRIVATE - | QUESTION - | QUOTE - | RBRACE - | RBRACKET - | REC - | RPAREN - | SEMI - | SEMISEMI - | HASH - | HASHOP of (string) - | SIG - | STAR - | STRING of (string * string option) - | STRUCT - | THEN - | TILDE - | TO - | TRUE - | TRY - | TYPE - | UIDENT of (string) - | UNDERSCORE - | VAL - | VIRTUAL - | WHEN - | WHILE - | WITH - | COMMENT of (string * Location.t) - | DOCSTRING of (Docstrings.docstring) - | EOL - -val implementation : - (Lexing.lexbuf -> token) -> Lexing.lexbuf -> Parsetree.structure -val interface : - (Lexing.lexbuf -> token) -> Lexing.lexbuf -> Parsetree.signature -val parse_core_type : - (Lexing.lexbuf -> token) -> Lexing.lexbuf -> Parsetree.core_type -val parse_expression : - (Lexing.lexbuf -> token) -> Lexing.lexbuf -> Parsetree.expression -val parse_pattern : - (Lexing.lexbuf -> token) -> Lexing.lexbuf -> Parsetree.pattern diff --git a/jscomp/ml/parser.mly b/jscomp/ml/parser.mly deleted file mode 100644 index c35fc5b505..0000000000 --- a/jscomp/ml/parser.mly +++ /dev/null @@ -1,2411 +0,0 @@ -/**************************************************************************/ -/* */ -/* OCaml */ -/* */ -/* Xavier Leroy, projet Cristal, INRIA Rocquencourt */ -/* */ -/* Copyright 1996 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. */ -/* */ -/**************************************************************************/ - -/* The parser definition */ - -%{ -open Location -open Asttypes -open Longident -open Parsetree -open Ast_helper -open Docstrings - -let mktyp d = Typ.mk ~loc:(symbol_rloc()) d -let mkpat d = Pat.mk ~loc:(symbol_rloc()) d -let mkexp d = Exp.mk ~loc:(symbol_rloc()) d -let mkmty ?attrs d = Mty.mk ~loc:(symbol_rloc()) ?attrs d -let mksig d = Sig.mk ~loc:(symbol_rloc()) d -let mkmod ?attrs d = Mod.mk ~loc:(symbol_rloc()) ?attrs d -let mkstr d = Str.mk ~loc:(symbol_rloc()) d -let mkcty ?attrs _d = let _ = attrs in assert false -let mkctf ?attrs ?docs d = let _ = (attrs, docs) in assert false -let mkcf ?attrs ?docs d = assert false - -let mkrhs rhs pos = mkloc rhs (rhs_loc pos) - -let reloc_pat x = { x with ppat_loc = symbol_rloc () };; -let reloc_exp x = { x with pexp_loc = symbol_rloc () };; - -let mkoperator name pos = - let loc = rhs_loc pos in - Exp.mk ~loc (Pexp_ident(mkloc (Lident name) loc)) - -let mkpatvar name pos = - Pat.mk ~loc:(rhs_loc pos) (Ppat_var (mkrhs name pos)) - -(* - 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. -*) -let ghexp d = Exp.mk ~loc:(symbol_gloc ()) d -let ghpat d = Pat.mk ~loc:(symbol_gloc ()) d -let ghtyp d = Typ.mk ~loc:(symbol_gloc ()) d -let ghloc d = { txt = d; loc = symbol_gloc () } -let ghstr d = Str.mk ~loc:(symbol_gloc()) d -let ghsig d = Sig.mk ~loc:(symbol_gloc()) d - -let mkinfix arg1 name arg2 = - mkexp(Pexp_apply(mkoperator name 2, [Nolabel, arg1; Nolabel, 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, 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))) - | _ -> - mkexp(Pexp_apply(mkoperator ("~" ^ name) 1, [Nolabel, arg])) - -let mkuplus name arg = - let desc = arg.pexp_desc in - match name, desc with - | "+", Pexp_constant(Pconst_integer _) - | ("+" | "+."), Pexp_constant(Pconst_float _) -> mkexp desc - | _ -> - mkexp(Pexp_apply(mkoperator ("~" ^ name) 1, [Nolabel, arg])) - -let mkexp_cons consloc args loc = - Exp.mk ~loc (Pexp_construct(mkloc (Lident "::") consloc, Some args)) - -let mkpat_cons consloc args loc = - Pat.mk ~loc (Ppat_construct(mkloc (Lident "::") consloc, Some args)) - -let rec mktailexp nilloc = function - [] -> - let loc = { nilloc with loc_ghost = true } in - let nil = { txt = Lident "[]"; loc = loc } in - Exp.mk ~loc (Pexp_construct (nil, None)) - | e1 :: el -> - let exp_el = mktailexp nilloc el in - let loc = {loc_start = e1.pexp_loc.loc_start; - loc_end = exp_el.pexp_loc.loc_end; - loc_ghost = true} - in - let arg = Exp.mk ~loc (Pexp_tuple [e1; exp_el]) in - mkexp_cons {loc with loc_ghost = true} arg loc - -let rec mktailpat nilloc = function - [] -> - let loc = { nilloc with loc_ghost = true } in - let nil = { txt = Lident "[]"; loc = loc } in - Pat.mk ~loc (Ppat_construct (nil, None)) - | p1 :: pl -> - let pat_pl = mktailpat nilloc pl in - let loc = {loc_start = p1.ppat_loc.loc_start; - loc_end = pat_pl.ppat_loc.loc_end; - loc_ghost = true} - in - let arg = Pat.mk ~loc (Ppat_tuple [p1; pat_pl]) in - mkpat_cons {loc with loc_ghost = true} arg loc - -let mkstrexp e attrs = - { pstr_desc = Pstr_eval (e, attrs); pstr_loc = e.pexp_loc } - -let mkexp_constraint e (t1, t2) = - match t1, t2 with - | Some t, None -> ghexp(Pexp_constraint(e, t)) - | _, Some t -> ghexp(Pexp_coerce(e, (), t)) - | None, None -> assert false - -let mkexp_opt_constraint e = function - | None -> e - | Some constraint_ -> mkexp_constraint e constraint_ - -let mkpat_opt_constraint p = function - | None -> p - | Some typ -> mkpat (Ppat_constraint(p, typ)) - -let array_function str name = - ghloc (Ldot(Lident str, (if !Clflags.fast then "unsafe_" ^ name else name))) - -let syntax_error () = - raise Syntaxerr.Escape_error - -let unclosed opening_name opening_num closing_name closing_num = - raise(Syntaxerr.Error(Syntaxerr.Unclosed(rhs_loc opening_num, opening_name, - rhs_loc closing_num, closing_name))) - -let expecting pos nonterm = - raise Syntaxerr.(Error(Expecting(rhs_loc pos, nonterm))) - -let not_expecting pos nonterm = - raise Syntaxerr.(Error(Not_expecting(rhs_loc pos, nonterm))) - - -let lapply p1 p2 = - if !Clflags.applicative_functors - then Lapply(p1, p2) - else raise (Syntaxerr.Error(Syntaxerr.Applicative_path (symbol_rloc()))) - -let exp_of_label lbl pos = - mkexp (Pexp_ident(mkrhs (Lident(Longident.last lbl)) pos)) - -let pat_of_label lbl pos = - mkpat (Ppat_var (mkrhs (Longident.last lbl) pos)) - -let mk_newtypes newtypes exp = - List.fold_right (fun newtype exp -> mkexp (Pexp_newtype (newtype, exp))) - newtypes exp - -let wrap_type_annotation newtypes core_type body = - let exp = mkexp(Pexp_constraint(body,core_type)) in - let exp = mk_newtypes newtypes exp in - (exp, ghtyp(Ptyp_poly(newtypes, Typ.varify_constructors newtypes core_type))) - -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 -> ghexp(Pexp_extension (id, PStr [mkstrexp body []])) - -let mkexp_attrs d attrs = - wrap_exp_attrs (mkexp d) attrs - -let wrap_typ_attrs typ (ext, attrs) = - (* todo: keep exact location for the entire attribute *) - let typ = {typ with ptyp_attributes = attrs @ typ.ptyp_attributes} in - match ext with - | None -> typ - | Some id -> ghtyp(Ptyp_extension (id, PTyp typ)) - -let mktyp_attrs d attrs = - wrap_typ_attrs (mktyp d) attrs - -let wrap_pat_attrs pat (ext, attrs) = - (* todo: keep exact location for the entire attribute *) - let pat = {pat with ppat_attributes = attrs @ pat.ppat_attributes} in - match ext with - | None -> pat - | Some id -> ghpat(Ppat_extension (id, PPat (pat, None))) - -let mkpat_attrs d attrs = - wrap_pat_attrs (mkpat d) attrs - -let wrap_class_type_attrs _body _attrs = assert false -let wrap_mod_attrs body attrs = - {body with pmod_attributes = attrs @ body.pmod_attributes} -let wrap_mty_attrs body attrs = - {body with pmty_attributes = attrs @ body.pmty_attributes} - -let wrap_str_ext body ext = - match ext with - | None -> body - | Some id -> ghstr(Pstr_extension ((id, PStr [body]), [])) - -let mkstr_ext d ext = - wrap_str_ext (mkstr d) ext - -let wrap_sig_ext body ext = - match ext with - | None -> body - | Some id -> ghsig(Psig_extension ((id, PSig [body]), [])) - -let mksig_ext d ext = - wrap_sig_ext (mksig d) ext - -let text_str pos = Str.text (rhs_text pos) -let text_sig pos = Sig.text (rhs_text pos) -let text_cstr pos = assert false -let text_csig _pos = assert false - - -let extra_text text pos items = - let pre_extras = rhs_pre_extra_text pos in - let post_extras = rhs_post_extra_text pos in - text pre_extras @ items @ text post_extras - -let extra_str pos items = extra_text Str.text pos items -let extra_sig pos items = extra_text Sig.text pos items - -let extra_rhs_core_type ct ~pos = - let docs = rhs_info pos in - { ct with ptyp_attributes = add_info_attrs docs ct.ptyp_attributes } - -type let_binding = - { lb_pattern: pattern; - lb_expression: expression; - lb_attributes: attributes; - lb_docs: docs Lazy.t; - lb_text: text Lazy.t; - lb_loc: Location.t; } - -type [@warning "-69"] let_bindings = - { lbs_bindings: let_binding list; - lbs_rec: rec_flag; - lbs_extension: string Asttypes.loc option; - lbs_loc: Location.t } - -let mklb first (p, e) attrs = - { lb_pattern = p; - lb_expression = e; - lb_attributes = attrs; - lb_docs = symbol_docs_lazy (); - lb_text = if first then empty_text_lazy - else symbol_text_lazy (); - lb_loc = symbol_rloc (); } - -let mklbs ext rf lb = - { lbs_bindings = [lb]; - lbs_rec = rf; - lbs_extension = ext ; - lbs_loc = symbol_rloc (); } - -let addlb lbs lb = - { lbs with lbs_bindings = lb :: lbs.lbs_bindings } - -let val_of_let_bindings lbs = - let bindings = - List.map - (fun lb -> - Vb.mk ~loc:lb.lb_loc ~attrs:lb.lb_attributes - ~docs:(Lazy.force lb.lb_docs) - ~text:(Lazy.force lb.lb_text) - lb.lb_pattern lb.lb_expression) - lbs.lbs_bindings - in - let str = mkstr(Pstr_value(lbs.lbs_rec, List.rev bindings)) in - match lbs.lbs_extension with - | None -> str - | Some id -> ghstr (Pstr_extension((id, PStr [str]), [])) - -let expr_of_let_bindings lbs body = - let bindings = - List.map - (fun lb -> - Vb.mk ~loc:lb.lb_loc ~attrs:lb.lb_attributes - lb.lb_pattern lb.lb_expression) - lbs.lbs_bindings - in - mkexp_attrs (Pexp_let(lbs.lbs_rec, List.rev bindings, body)) - (lbs.lbs_extension, []) - - - -(* Alternatively, we could keep the generic module type in the Parsetree - and extract the package type during type-checking. In that case, - the assertions below should be turned into explicit checks. *) -let package_type_of_module_type pmty = - let err loc s = - raise (Syntaxerr.Error (Syntaxerr.Invalid_package_type (loc, s))) - in - let map_cstr = function - | Pwith_type (lid, ptyp) -> - let loc = ptyp.ptype_loc in - if ptyp.ptype_params <> [] then - err loc "parametrized types are not supported"; - if ptyp.ptype_cstrs <> [] then - err loc "constrained types are not supported"; - if ptyp.ptype_private <> Public then - err 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) - | _ -> - err pmty.pmty_loc "only 'with type t =' constraints are supported" - in - match pmty with - | {pmty_desc = Pmty_ident lid} -> (lid, []) - | {pmty_desc = Pmty_with({pmty_desc = Pmty_ident lid}, cstrs)} -> - (lid, List.map map_cstr cstrs) - | _ -> - err pmty.pmty_loc - "only module type identifier and 'with type' constraints are supported" - - -%} - -/* Tokens */ - -%token AMPERAMPER -%token AMPERSAND -%token AND -%token AS -%token ASSERT -%token BACKQUOTE -%token BANG -%token BAR -%token BARBAR -%token BARRBRACKET -%token BEGIN -%token CHAR -%token CLASS -%token COLON -%token COLONCOLON -%token COLONEQUAL -%token COLONGREATER -%token COMMA -%token CONSTRAINT -%token DO -%token DONE -%token DOT -%token DOTDOT -%token DOWNTO -%token ELSE -%token END -%token EOF -%token EQUAL -%token EXCEPTION -%token EXTERNAL -%token FALSE -%token FLOAT -%token FOR -%token FUN -%token FUNCTION -%token FUNCTOR -%token GREATER -%token GREATERRBRACE -%token GREATERRBRACKET -%token IF -%token IN -%token INCLUDE -%token INFIXOP0 -%token INFIXOP1 -%token INFIXOP2 -%token INFIXOP3 -%token INFIXOP4 -%token DOTOP -%token INHERIT -%token INITIALIZER -%token INT -%token LABEL -%token LAZY -%token LBRACE -%token LBRACELESS -%token LBRACKET -%token LBRACKETBAR -%token LBRACKETLESS -%token LBRACKETGREATER -%token LBRACKETPERCENT -%token LBRACKETPERCENTPERCENT -%token LESS -%token LESSMINUS -%token LET -%token LIDENT -%token LPAREN -%token LBRACKETAT -%token LBRACKETATAT -%token LBRACKETATATAT -%token MATCH -%token METHOD -%token MINUS -%token MINUSDOT -%token MINUSGREATER -%token MODULE -%token MUTABLE -%token NEW -%token NONREC -%token OBJECT -%token OF -%token OPEN -%token OPTLABEL -%token OR -/* %token PARSER */ -%token PERCENT -%token PLUS -%token PLUSDOT -%token PLUSEQ -%token PREFIXOP -%token PRIVATE -%token QUESTION -%token QUOTE -%token RBRACE -%token RBRACKET -%token REC -%token RPAREN -%token SEMI -%token SEMISEMI -%token HASH -%token HASHOP -%token SIG -%token STAR -%token STRING -%token STRUCT -%token THEN -%token TILDE -%token TO -%token TRUE -%token TRY -%token TYPE -%token UIDENT -%token UNDERSCORE -%token VAL -%token VIRTUAL -%token WHEN -%token WHILE -%token WITH -%token COMMENT -%token DOCSTRING - -%token EOL - -/* Precedences and associativities. - -Tokens and rules have precedences. A reduce/reduce conflict is resolved -in favor of the first rule (in source file order). A shift/reduce conflict -is resolved by comparing the precedence and associativity of the token to -be shifted with those of the rule to be reduced. - -By default, a rule has the precedence of its rightmost terminal (if any). - -When there is a shift/reduce conflict between a rule and a token that -have the same precedence, it is resolved using the associativity: -if the token is left-associative, the parser will reduce; if -right-associative, the parser will shift; if non-associative, -the parser will declare a syntax error. - -We will only use associativities with operators of the kind x * x -> x -for example, in the rules of the form expr: expr BINOP expr -in all other cases, we define two precedences if needed to resolve -conflicts. - -The precedences must be listed from low to high. -*/ - -%nonassoc IN -%nonassoc below_SEMI -%nonassoc SEMI /* below EQUAL ({lbl=...; lbl=...}) */ -%nonassoc LET /* above SEMI ( ...; let ... in ...) */ -%nonassoc below_WITH -%nonassoc FUNCTION WITH /* below BAR (match ... with ...) */ -%nonassoc AND /* above WITH (module rec A: SIG with ... and ...) */ -%nonassoc THEN /* below ELSE (if ... then ...) */ -%nonassoc ELSE /* (if ... then ... else ...) */ -%nonassoc LESSMINUS /* below COLONEQUAL (lbl <- x := e) */ -%right COLONEQUAL /* expr (e := e := e) */ -%nonassoc AS -%left BAR /* pattern (p|p|p) */ -%nonassoc below_COMMA -%left COMMA /* expr/expr_comma_list (e,e,e) */ -%right MINUSGREATER /* core_type2 (t -> t -> t) */ -%right OR BARBAR /* expr (e || e || e) */ -%right AMPERSAND AMPERAMPER /* expr (e && e && e) */ -%nonassoc below_EQUAL -%left INFIXOP0 EQUAL LESS GREATER /* expr (e OP e OP e) */ -%right INFIXOP1 /* expr (e OP e OP e) */ -%nonassoc below_LBRACKETAT -%nonassoc LBRACKETAT -%nonassoc LBRACKETATAT -%right COLONCOLON /* expr (e :: e :: e) */ -%left INFIXOP2 PLUS PLUSDOT MINUS MINUSDOT PLUSEQ /* expr (e OP e OP e) */ -%left PERCENT INFIXOP3 STAR /* expr (e OP e OP e) */ -%right INFIXOP4 /* expr (e OP e OP e) */ -%nonassoc prec_unary_minus prec_unary_plus /* unary - */ -%nonassoc prec_constant_constructor /* cf. simple_expr (C versus C x) */ -%nonassoc prec_constr_appl /* above AS BAR COLONCOLON COMMA */ -%nonassoc below_HASH -%nonassoc HASH /* simple_expr/toplevel_directive */ -%left HASHOP -%nonassoc below_DOT -%nonassoc DOT DOTOP -/* Finally, the first tokens of simple_expr are above everything else. */ -%nonassoc BACKQUOTE BANG BEGIN CHAR FALSE FLOAT INT - LBRACE LBRACELESS LBRACKET LBRACKETBAR LIDENT LPAREN - NEW PREFIXOP STRING TRUE UIDENT - LBRACKETPERCENT LBRACKETPERCENTPERCENT - - -/* Entry points */ - -%start implementation /* for implementation files */ -%type implementation -%start interface /* for interface files */ -%type interface -%start parse_core_type -%type parse_core_type -%start parse_expression -%type parse_expression -%start parse_pattern -%type parse_pattern -%% - -/* Entry points */ - -implementation: - structure EOF { extra_str 1 $1 } -; -interface: - signature EOF { extra_sig 1 $1 } -; - - -parse_core_type: - core_type EOF { $1 } -; -parse_expression: - seq_expr EOF { $1 } -; -parse_pattern: - pattern EOF { $1 } -; - -/* Module expressions */ - -functor_arg: - LPAREN RPAREN - { mkrhs "*" 2, None } - | LPAREN functor_arg_name COLON module_type RPAREN - { mkrhs $2 2, Some $4 } -; - -functor_arg_name: - UIDENT { $1 } - | UNDERSCORE { "_" } -; - -functor_args: - functor_args functor_arg - { $2 :: $1 } - | functor_arg - { [ $1 ] } -; - -module_expr: - mod_longident - { mkmod(Pmod_ident (mkrhs $1 1)) } - | STRUCT attributes structure END - { mkmod ~attrs:$2 (Pmod_structure(extra_str 3 $3)) } - | STRUCT attributes structure error - { unclosed "struct" 1 "end" 4 } - | FUNCTOR attributes functor_args MINUSGREATER module_expr - { let modexp = - List.fold_left - (fun acc (n, t) -> mkmod(Pmod_functor(n, t, acc))) - $5 $3 - in wrap_mod_attrs modexp $2 } - | module_expr paren_module_expr - { mkmod(Pmod_apply($1, $2)) } - | module_expr LPAREN RPAREN - { mkmod(Pmod_apply($1, mkmod (Pmod_structure []))) } - | paren_module_expr - { $1 } - | module_expr attribute - { Mod.attr $1 $2 } - | extension - { mkmod(Pmod_extension $1) } -; - -paren_module_expr: - LPAREN module_expr COLON module_type RPAREN - { mkmod(Pmod_constraint($2, $4)) } - | LPAREN module_expr COLON module_type error - { unclosed "(" 1 ")" 5 } - | LPAREN module_expr RPAREN - { $2 } - | LPAREN module_expr error - { unclosed "(" 1 ")" 3 } - | LPAREN VAL attributes expr RPAREN - { mkmod ~attrs:$3 (Pmod_unpack $4)} - | LPAREN VAL attributes expr COLON package_type RPAREN - { mkmod ~attrs:$3 - (Pmod_unpack( - ghexp(Pexp_constraint($4, ghtyp(Ptyp_package $6))))) } - | LPAREN VAL attributes expr COLON package_type COLONGREATER package_type - RPAREN - { mkmod ~attrs:$3 - (Pmod_unpack( - ghexp(Pexp_coerce($4, Some(ghtyp(Ptyp_package $6)), - ghtyp(Ptyp_package $8))))) } - | LPAREN VAL attributes expr COLONGREATER package_type RPAREN - { mkmod ~attrs:$3 - (Pmod_unpack( - ghexp(Pexp_coerce($4, None, ghtyp(Ptyp_package $6))))) } - | LPAREN VAL attributes expr COLON error - { unclosed "(" 1 ")" 6 } - | LPAREN VAL attributes expr COLONGREATER error - { unclosed "(" 1 ")" 6 } - | LPAREN VAL attributes expr error - { unclosed "(" 1 ")" 5 } -; - -structure: - seq_expr post_item_attributes structure_tail - { mark_rhs_docs 1 2; - (text_str 1) @ mkstrexp $1 $2 :: $3 } - | structure_tail { $1 } -; -structure_tail: - /* empty */ { [] } - | SEMISEMI structure { (text_str 1) @ $2 } - | structure_item structure_tail { (text_str 1) @ $1 :: $2 } -; -structure_item: - let_bindings - { val_of_let_bindings $1 } - | primitive_declaration - { let (body, ext) = $1 in mkstr_ext (Pstr_primitive body) ext } - | value_description - { let (body, ext) = $1 in mkstr_ext (Pstr_primitive body) ext } - | type_declarations - { let (nr, l, ext ) = $1 in mkstr_ext (Pstr_type (nr, List.rev l)) ext } - | str_type_extension - { let (l, ext) = $1 in mkstr_ext (Pstr_typext l) ext } - | str_exception_declaration - { let (l, ext) = $1 in mkstr_ext (Pstr_exception l) ext } - | module_binding - { let (body, ext) = $1 in mkstr_ext (Pstr_module body) ext } - | rec_module_bindings - { let (l, ext) = $1 in mkstr_ext (Pstr_recmodule(List.rev l)) ext } - | module_type_declaration - { let (body, ext) = $1 in mkstr_ext (Pstr_modtype body) ext } - | open_statement - { let (body, ext) = $1 in mkstr_ext (Pstr_open body) ext } - | class_type_declarations - { let (_l, ext) = $1 in mkstr_ext (Pstr_class_type ()) ext } - | str_include_statement - { let (body, ext) = $1 in mkstr_ext (Pstr_include body) ext } - | item_extension post_item_attributes - { mkstr(Pstr_extension ($1, (add_docs_attrs (symbol_docs ()) $2))) } - | floating_attribute - { mark_symbol_docs (); - mkstr(Pstr_attribute $1) } -; -str_include_statement: - INCLUDE ext_attributes module_expr post_item_attributes - { let (ext, attrs) = $2 in - Incl.mk $3 ~attrs:(attrs@$4) - ~loc:(symbol_rloc()) ~docs:(symbol_docs ()) - , ext } -; -module_binding_body: - EQUAL module_expr - { $2 } - | COLON module_type EQUAL module_expr - { mkmod(Pmod_constraint($4, $2)) } - | functor_arg module_binding_body - { mkmod(Pmod_functor(fst $1, snd $1, $2)) } -; -module_binding: - MODULE ext_attributes UIDENT module_binding_body post_item_attributes - { let (ext, attrs) = $2 in - Mb.mk (mkrhs $3 3) $4 ~attrs:(attrs@$5) - ~loc:(symbol_rloc ()) ~docs:(symbol_docs ()) - , ext } -; -rec_module_bindings: - rec_module_binding { let (b, ext) = $1 in ([b], ext) } - | rec_module_bindings and_module_binding - { let (l, ext) = $1 in ($2 :: l, ext) } -; -rec_module_binding: - MODULE ext_attributes REC UIDENT module_binding_body post_item_attributes - { let (ext, attrs) = $2 in - Mb.mk (mkrhs $4 4) $5 ~attrs:(attrs@$6) - ~loc:(symbol_rloc ()) ~docs:(symbol_docs ()) - , ext } -; -and_module_binding: - AND attributes UIDENT module_binding_body post_item_attributes - { Mb.mk (mkrhs $3 3) $4 ~attrs:($2@$5) ~loc:(symbol_rloc ()) - ~text:(symbol_text ()) ~docs:(symbol_docs ()) } -; - -/* Module types */ - -module_type: - mty_longident - { mkmty(Pmty_ident (mkrhs $1 1)) } - | SIG attributes signature END - { mkmty ~attrs:$2 (Pmty_signature (extra_sig 3 $3)) } - | SIG attributes signature error - { unclosed "sig" 1 "end" 4 } - | FUNCTOR attributes functor_args MINUSGREATER module_type - %prec below_WITH - { let mty = - List.fold_left - (fun acc (n, t) -> mkmty(Pmty_functor(n, t, acc))) - $5 $3 - in wrap_mty_attrs mty $2 } - | module_type MINUSGREATER module_type - %prec below_WITH - { mkmty(Pmty_functor(mknoloc "_", Some $1, $3)) } - | module_type WITH with_constraints - { mkmty(Pmty_with($1, List.rev $3)) } - | MODULE TYPE OF attributes module_expr %prec below_LBRACKETAT - { mkmty ~attrs:$4 (Pmty_typeof $5) } -/* | LPAREN MODULE mod_longident RPAREN - { mkmty (Pmty_alias (mkrhs $3 3)) } */ - | LPAREN module_type RPAREN - { $2 } - | LPAREN module_type error - { unclosed "(" 1 ")" 3 } - | extension - { mkmty(Pmty_extension $1) } - | module_type attribute - { Mty.attr $1 $2 } -; -signature: - /* empty */ { [] } - | SEMISEMI signature { (text_sig 1) @ $2 } - | signature_item signature { (text_sig 1) @ $1 :: $2 } -; -signature_item: - value_description - { let (body, ext) = $1 in mksig_ext (Psig_value body) ext } - | primitive_declaration - { let (body, ext) = $1 in mksig_ext (Psig_value body) ext} - | type_declarations - { let (nr, l, ext) = $1 in mksig_ext (Psig_type (nr, List.rev l)) ext } - | sig_type_extension - { let (l, ext) = $1 in mksig_ext (Psig_typext l) ext } - | sig_exception_declaration - { let (l, ext) = $1 in mksig_ext (Psig_exception l) ext } - | module_declaration - { let (body, ext) = $1 in mksig_ext (Psig_module body) ext } - | module_alias - { let (body, ext) = $1 in mksig_ext (Psig_module body) ext } - | rec_module_declarations - { let (l, ext) = $1 in mksig_ext (Psig_recmodule (List.rev l)) ext } - | module_type_declaration - { let (body, ext) = $1 in mksig_ext (Psig_modtype body) ext } - | open_statement - { let (body, ext) = $1 in mksig_ext (Psig_open body) ext } - | sig_include_statement - { let (body, ext) = $1 in mksig_ext (Psig_include body) ext } - | class_type_declarations - { let (l, ext) = $1 in mksig_ext (Psig_class_type ()) ext } - | item_extension post_item_attributes - { mksig(Psig_extension ($1, (add_docs_attrs (symbol_docs ()) $2))) } - | floating_attribute - { mark_symbol_docs (); - mksig(Psig_attribute $1) } -; -open_statement: - | OPEN override_flag ext_attributes mod_longident post_item_attributes - { let (ext, attrs) = $3 in - Opn.mk (mkrhs $4 4) ~override:$2 ~attrs:(attrs@$5) - ~loc:(symbol_rloc()) ~docs:(symbol_docs ()) - , ext} -; -sig_include_statement: - INCLUDE ext_attributes module_type post_item_attributes %prec below_WITH - { let (ext, attrs) = $2 in - Incl.mk $3 ~attrs:(attrs@$4) - ~loc:(symbol_rloc()) ~docs:(symbol_docs ()) - , ext} -; -module_declaration_body: - COLON module_type - { $2 } - | LPAREN UIDENT COLON module_type RPAREN module_declaration_body - { mkmty(Pmty_functor(mkrhs $2 2, Some $4, $6)) } - | LPAREN RPAREN module_declaration_body - { mkmty(Pmty_functor(mkrhs "*" 1, None, $3)) } -; -module_declaration: - MODULE ext_attributes UIDENT module_declaration_body post_item_attributes - { let (ext, attrs) = $2 in - Md.mk (mkrhs $3 3) $4 ~attrs:(attrs@$5) - ~loc:(symbol_rloc()) ~docs:(symbol_docs ()) - , ext } -; -module_alias: - MODULE ext_attributes UIDENT EQUAL mod_longident post_item_attributes - { let (ext, attrs) = $2 in - Md.mk (mkrhs $3 3) - (Mty.alias ~loc:(rhs_loc 5) (mkrhs $5 5)) ~attrs:(attrs@$6) - ~loc:(symbol_rloc()) ~docs:(symbol_docs ()) - , ext } -; -rec_module_declarations: - rec_module_declaration - { let (body, ext) = $1 in ([body], ext) } - | rec_module_declarations and_module_declaration - { let (l, ext) = $1 in ($2 :: l, ext) } -; -rec_module_declaration: - MODULE ext_attributes REC UIDENT COLON module_type post_item_attributes - { let (ext, attrs) = $2 in - Md.mk (mkrhs $4 4) $6 ~attrs:(attrs@$7) - ~loc:(symbol_rloc()) ~docs:(symbol_docs ()) - , ext} -; -and_module_declaration: - AND attributes UIDENT COLON module_type post_item_attributes - { Md.mk (mkrhs $3 3) $5 ~attrs:($2@$6) ~loc:(symbol_rloc()) - ~text:(symbol_text()) ~docs:(symbol_docs()) } -; -module_type_declaration_body: - /* empty */ { None } - | EQUAL module_type { Some $2 } -; -module_type_declaration: - MODULE TYPE ext_attributes ident module_type_declaration_body - post_item_attributes - { let (ext, attrs) = $3 in - Mtd.mk (mkrhs $4 4) ?typ:$5 ~attrs:(attrs@$6) - ~loc:(symbol_rloc()) ~docs:(symbol_docs ()) - , ext } -; -/* Class expressions */ - -class_type_parameters: - /*empty*/ { [] } - | LBRACKET type_parameter_list RBRACKET { List.rev $2 } -; -class_structure: - | class_self_pattern class_fields - { assert false } -; -class_self_pattern: - LPAREN pattern RPAREN - { reloc_pat $2 } - | LPAREN pattern COLON core_type RPAREN - { mkpat(Ppat_constraint($2, $4)) } - | /* empty */ - { ghpat(Ppat_any) } -; -class_fields: - /* empty */ - { [] } - | class_fields class_field - { $2 :: (text_cstr 2) @ $1 } -; -class_field: - | VAL value post_item_attributes - { let v, attrs = $2 in - mkcf (Pcf_val v) ~attrs:(attrs@$3) ~docs:(symbol_docs ()) } - | METHOD method_ post_item_attributes - { let meth, attrs = $2 in - mkcf (Pcf_method meth) ~attrs:(attrs@$3) ~docs:(symbol_docs ()) } - | CONSTRAINT attributes constrain_field post_item_attributes - { mkcf (Pcf_constraint $3) ~attrs:($2@$4) ~docs:(symbol_docs ()) } - | INITIALIZER attributes seq_expr post_item_attributes - { mkcf (Pcf_initializer $3) ~attrs:($2@$4) ~docs:(symbol_docs ()) } - | item_extension post_item_attributes - { mkcf (Pcf_extension $1) ~attrs:$2 ~docs:(symbol_docs ()) } - | floating_attribute - { mark_symbol_docs (); - mkcf (Pcf_attribute $1) } -; -value: -/* TODO: factorize these rules (also with method): */ - override_flag attributes MUTABLE VIRTUAL label COLON core_type - { if $1 = Override then syntax_error (); - (mkloc $5 (rhs_loc 5), Mutable, Cfk_virtual $7), $2 } - | override_flag attributes VIRTUAL mutable_flag label COLON core_type - { if $1 = Override then syntax_error (); - (mkrhs $5 5, $4, Cfk_virtual $7), $2 } - | override_flag attributes mutable_flag label EQUAL seq_expr - { (mkrhs $4 4, $3, Cfk_concrete ($1, $6)), $2 } - | override_flag attributes mutable_flag label type_constraint EQUAL seq_expr - { - let e = mkexp_constraint $7 $5 in - (mkrhs $4 4, $3, Cfk_concrete ($1, e)), $2 - } -; -method_: -/* TODO: factorize those rules... */ - override_flag attributes PRIVATE VIRTUAL label COLON poly_type - { if $1 = Override then syntax_error (); - (mkloc $5 (rhs_loc 5), Private, Cfk_virtual $7), $2 } - | override_flag attributes VIRTUAL private_flag label COLON poly_type - { if $1 = Override then syntax_error (); - (mkloc $5 (rhs_loc 5), $4, Cfk_virtual $7), $2 } - | override_flag attributes private_flag label strict_binding - { (mkloc $4 (rhs_loc 4), $3, - Cfk_concrete ($1, ghexp(Pexp_poly ($5, None)))), $2 } - | override_flag attributes private_flag label COLON poly_type EQUAL seq_expr - { (mkloc $4 (rhs_loc 4), $3, - Cfk_concrete ($1, ghexp(Pexp_poly($8, Some $6)))), $2 } - | override_flag attributes private_flag label COLON TYPE lident_list - DOT core_type EQUAL seq_expr - { let exp, poly = wrap_type_annotation $7 $9 $11 in - (mkloc $4 (rhs_loc 4), $3, - Cfk_concrete ($1, ghexp(Pexp_poly(exp, Some poly)))), $2 } -; - -/* Class types */ - -class_signature: - LBRACKET core_type_comma_list RBRACKET clty_longident - { mkcty(Pcty_constr (mkloc $4 (rhs_loc 4), List.rev $2)) } - | clty_longident - { mkcty(Pcty_constr (mkrhs $1 1, [])) } - | OBJECT attributes class_sig_body END - { mkcty ~attrs:$2 (Pcty_signature $3) } - | OBJECT attributes class_sig_body error - { unclosed "object" 1 "end" 4 } - | class_signature attribute - { assert false } - | extension - { mkcty(Pcty_extension $1) } - | LET OPEN override_flag attributes mod_longident IN class_signature - { wrap_class_type_attrs (mkcty(Pcty_open($3, mkrhs $5 5, $7))) $4 } -; -class_sig_body: - class_self_type class_sig_fields - { assert false } -; -class_self_type: - LPAREN core_type RPAREN - { $2 } - | /* empty */ - { mktyp(Ptyp_any) } -; -class_sig_fields: - /* empty */ { [] } -| class_sig_fields class_sig_field { $2 :: (text_csig 2) @ $1 } -; -class_sig_field: - INHERIT attributes class_signature post_item_attributes - { mkctf (Pctf_inherit $3) ~attrs:($2@$4) ~docs:(symbol_docs ()) } - | VAL attributes value_type post_item_attributes - { mkctf (Pctf_val $3) ~attrs:($2@$4) ~docs:(symbol_docs ()) } - | METHOD attributes private_virtual_flags label COLON poly_type - post_item_attributes - { - let (p, v) = $3 in - mkctf (Pctf_method (mkrhs $4 4, p, v, $6)) ~attrs:($2@$7) ~docs:(symbol_docs ()) - } - | CONSTRAINT attributes constrain_field post_item_attributes - { mkctf (Pctf_constraint $3) ~attrs:($2@$4) ~docs:(symbol_docs ()) } - | item_extension post_item_attributes - { mkctf (Pctf_extension $1) ~attrs:$2 ~docs:(symbol_docs ()) } - | floating_attribute - { mark_symbol_docs (); - mkctf(Pctf_attribute $1) } -; -value_type: - VIRTUAL mutable_flag label COLON core_type - { mkrhs $3 3, $2, Virtual, $5 } - | MUTABLE virtual_flag label COLON core_type - { mkrhs $3 3, Mutable, $2, $5 } - | label COLON core_type - { mkrhs $1 1, Immutable, Concrete, $3 } -; -constrain: - core_type EQUAL core_type { $1, $3, symbol_rloc() } -; -constrain_field: - core_type EQUAL core_type { $1, $3 } -; -class_type_declarations: - class_type_declaration - { let (body, ext) = $1 in ([body],ext) } - | class_type_declarations and_class_type_declaration - { let (l, ext) = $1 in ($2 :: l, ext) } -; -class_type_declaration: - CLASS TYPE ext_attributes virtual_flag class_type_parameters LIDENT EQUAL - class_signature post_item_attributes - { let (ext, attrs) = $3 in - assert false - , ext} -; -and_class_type_declaration: - AND attributes virtual_flag class_type_parameters LIDENT EQUAL - class_signature post_item_attributes - { assert false } -; - -/* Core expressions */ - -seq_expr: - | expr %prec below_SEMI { $1 } - | expr SEMI { $1 } - | expr SEMI seq_expr { mkexp(Pexp_sequence($1, $3)) } - | expr SEMI PERCENT attr_id seq_expr - { let seq = mkexp(Pexp_sequence ($1, $5)) in - let payload = PStr [mkstrexp seq []] in - mkexp (Pexp_extension ($4, payload)) } -; -labeled_simple_pattern: - QUESTION LPAREN label_let_pattern opt_default RPAREN - { (Optional (fst $3), $4, snd $3) } - | QUESTION label_var - { (Optional (fst $2), None, snd $2) } - | OPTLABEL LPAREN let_pattern opt_default RPAREN - { (Optional $1, $4, $3) } - | OPTLABEL pattern_var - { (Optional $1, None, $2) } - | TILDE LPAREN label_let_pattern RPAREN - { (Labelled (fst $3), None, snd $3) } - | TILDE label_var - { (Labelled (fst $2), None, snd $2) } - | LABEL simple_pattern - { (Labelled $1, None, $2) } - | simple_pattern - { (Nolabel, None, $1) } -; -pattern_var: - LIDENT { mkpat(Ppat_var (mkrhs $1 1)) } - | UNDERSCORE { mkpat Ppat_any } -; -opt_default: - /* empty */ { None } - | EQUAL seq_expr { Some $2 } -; -label_let_pattern: - label_var - { $1 } - | label_var COLON core_type - { let (lab, pat) = $1 in (lab, mkpat(Ppat_constraint(pat, $3))) } -; -label_var: - LIDENT { ($1, mkpat(Ppat_var (mkrhs $1 1))) } -; -let_pattern: - pattern - { $1 } - | pattern COLON core_type - { mkpat(Ppat_constraint($1, $3)) } -; -expr: - simple_expr %prec below_HASH - { $1 } - | simple_expr simple_labeled_expr_list - { mkexp(Pexp_apply($1, List.rev $2)) } - | let_bindings IN seq_expr - { expr_of_let_bindings $1 $3 } - | LET MODULE ext_attributes UIDENT module_binding_body IN seq_expr - { mkexp_attrs (Pexp_letmodule(mkrhs $4 4, $5, $7)) $3 } - | LET EXCEPTION ext_attributes let_exception_declaration IN seq_expr - { mkexp_attrs (Pexp_letexception($4, $6)) $3 } - | LET OPEN override_flag ext_attributes mod_longident IN seq_expr - { mkexp_attrs (Pexp_open($3, mkrhs $5 5, $7)) $4 } - | FUNCTION ext_attributes opt_bar match_cases - { mkexp_attrs (Pexp_function(List.rev $4)) $2 } - | FUN ext_attributes labeled_simple_pattern fun_def - { let (l,o,p) = $3 in - mkexp_attrs (Pexp_fun(l, o, p, $4)) $2 } - | FUN ext_attributes LPAREN TYPE lident_list RPAREN fun_def - { mkexp_attrs (mk_newtypes $5 $7).pexp_desc $2 } - | MATCH ext_attributes seq_expr WITH opt_bar match_cases - { mkexp_attrs (Pexp_match($3, List.rev $6)) $2 } - | TRY ext_attributes seq_expr WITH opt_bar match_cases - { mkexp_attrs (Pexp_try($3, List.rev $6)) $2 } - | TRY ext_attributes seq_expr WITH error - { syntax_error() } - | expr_comma_list %prec below_COMMA - { mkexp(Pexp_tuple(List.rev $1)) } - | constr_longident simple_expr %prec below_HASH - { mkexp(Pexp_construct(mkrhs $1 1, Some $2)) } - | name_tag simple_expr %prec below_HASH - { mkexp(Pexp_variant($1, Some $2)) } - | IF ext_attributes seq_expr THEN expr ELSE expr - { mkexp_attrs(Pexp_ifthenelse($3, $5, Some $7)) $2 } - | IF ext_attributes seq_expr THEN expr - { mkexp_attrs (Pexp_ifthenelse($3, $5, None)) $2 } - | WHILE ext_attributes seq_expr DO seq_expr DONE - { mkexp_attrs (Pexp_while($3, $5)) $2 } - | FOR ext_attributes pattern EQUAL seq_expr direction_flag seq_expr DO - seq_expr DONE - { mkexp_attrs(Pexp_for($3, $5, $7, $6, $9)) $2 } - | expr COLONCOLON expr - { mkexp_cons (rhs_loc 2) (ghexp(Pexp_tuple[$1;$3])) (symbol_rloc()) } - | expr INFIXOP0 expr - { mkinfix $1 $2 $3 } - | expr INFIXOP1 expr - { mkinfix $1 $2 $3 } - | expr INFIXOP2 expr - { mkinfix $1 $2 $3 } - | expr INFIXOP3 expr - { mkinfix $1 $2 $3 } - | expr INFIXOP4 expr - { mkinfix $1 $2 $3 } - | expr PLUS expr - { mkinfix $1 "+" $3 } - | expr PLUSDOT expr - { mkinfix $1 "+." $3 } - | expr PLUSEQ expr - { mkinfix $1 "+=" $3 } - | expr MINUS expr - { mkinfix $1 "-" $3 } - | expr MINUSDOT expr - { mkinfix $1 "-." $3 } - | expr STAR expr - { mkinfix $1 "*" $3 } - | expr PERCENT expr - { mkinfix $1 "%" $3 } - | expr EQUAL expr - { mkinfix $1 "=" $3 } - | expr LESS expr - { mkinfix $1 "<" $3 } - | expr GREATER expr - { mkinfix $1 ">" $3 } - | expr OR expr - { mkinfix $1 "or" $3 } - | expr BARBAR expr - { mkinfix $1 "||" $3 } - | expr AMPERSAND expr - { mkinfix $1 "&" $3 } - | expr AMPERAMPER expr - { mkinfix $1 "&&" $3 } - | expr COLONEQUAL expr - { mkinfix $1 ":=" $3 } - | subtractive expr %prec prec_unary_minus - { mkuminus $1 $2 } - | additive expr %prec prec_unary_plus - { mkuplus $1 $2 } - | simple_expr DOT label_longident LESSMINUS expr - { mkexp(Pexp_setfield($1, mkrhs $3 3, $5)) } - | simple_expr DOT LPAREN seq_expr RPAREN LESSMINUS expr - { mkexp(Pexp_apply(ghexp(Pexp_ident(array_function "Array" "set")), - [Nolabel,$1; Nolabel,$4; Nolabel,$7])) } - | simple_expr DOT LBRACKET seq_expr RBRACKET LESSMINUS expr - { mkexp(Pexp_apply(ghexp(Pexp_ident(array_function "String" "set")), - [Nolabel,$1; Nolabel,$4; Nolabel,$7])) } - | simple_expr DOTOP LBRACKET expr RBRACKET LESSMINUS expr - { let id = mkexp @@ Pexp_ident( ghloc @@ Lident ("." ^ $2 ^ "[]<-")) in - mkexp @@ Pexp_apply(id , [Nolabel, $1; Nolabel, $4; Nolabel, $7]) } - | simple_expr DOTOP LPAREN expr RPAREN LESSMINUS expr - { let id = mkexp @@ Pexp_ident( ghloc @@ Lident ("." ^ $2 ^ "()<-")) in - mkexp @@ Pexp_apply(id , [Nolabel, $1; Nolabel, $4; Nolabel, $7]) } - | simple_expr DOTOP LBRACE expr RBRACE LESSMINUS expr - { let id = mkexp @@ Pexp_ident( ghloc @@ Lident ("." ^ $2 ^ "{}<-")) in - mkexp @@ Pexp_apply(id , [Nolabel, $1; Nolabel, $4; Nolabel, $7]) } - | simple_expr DOT mod_longident DOTOP LBRACKET expr RBRACKET LESSMINUS expr - { let id = mkexp @@ Pexp_ident( ghloc @@ Ldot($3,"." ^ $4 ^ "[]<-")) in - mkexp @@ Pexp_apply(id , [Nolabel, $1; Nolabel, $6; Nolabel, $9]) } - | simple_expr DOT mod_longident DOTOP LPAREN expr RPAREN LESSMINUS expr - { let id = mkexp @@ Pexp_ident( ghloc @@ Ldot($3, "." ^ $4 ^ "()<-")) in - mkexp @@ Pexp_apply(id , [Nolabel, $1; Nolabel, $6; Nolabel, $9]) } - | simple_expr DOT mod_longident DOTOP LBRACE expr RBRACE LESSMINUS expr - { let id = mkexp @@ Pexp_ident( ghloc @@ Ldot($3, "." ^ $4 ^ "{}<-")) in - mkexp @@ Pexp_apply(id , [Nolabel, $1; Nolabel, $6; Nolabel, $9]) } - | label LESSMINUS expr - { mkexp(Pexp_setinstvar(mkrhs $1 1, $3)) } - | ASSERT ext_attributes simple_expr %prec below_HASH - { mkexp_attrs (Pexp_assert $3) $2 } - | LAZY ext_attributes simple_expr %prec below_HASH - { mkexp_attrs (Pexp_lazy $3) $2 } - | OBJECT ext_attributes class_structure END - { mkexp_attrs (Pexp_object ()) $2 } - | OBJECT ext_attributes class_structure error - { unclosed "object" 1 "end" 4 } - | expr attribute - { Exp.attr $1 $2 } - | UNDERSCORE - { not_expecting 1 "wildcard \"_\"" } -; -simple_expr: - val_longident - { mkexp(Pexp_ident (mkrhs $1 1)) } - | constant - { mkexp(Pexp_constant $1) } - | constr_longident %prec prec_constant_constructor - { mkexp(Pexp_construct(mkrhs $1 1, None)) } - | name_tag %prec prec_constant_constructor - { mkexp(Pexp_variant($1, None)) } - | LPAREN seq_expr RPAREN - { reloc_exp $2 } - | LPAREN seq_expr error - { unclosed "(" 1 ")" 3 } - | BEGIN ext_attributes seq_expr END - { wrap_exp_attrs (reloc_exp $3) $2 (* check location *) } - | BEGIN ext_attributes END - { mkexp_attrs (Pexp_construct (mkloc (Lident "()") (symbol_rloc ()), - None)) $2 } - | BEGIN ext_attributes seq_expr error - { unclosed "begin" 1 "end" 4 } - | LPAREN seq_expr type_constraint RPAREN - { mkexp_constraint $2 $3 } - | simple_expr DOT label_longident - { mkexp(Pexp_field($1, mkrhs $3 3)) } - | mod_longident DOT LPAREN seq_expr RPAREN - { mkexp(Pexp_open(Fresh, mkrhs $1 1, $4)) } - | mod_longident DOT LPAREN RPAREN - { mkexp(Pexp_open(Fresh, mkrhs $1 1, - mkexp(Pexp_construct(mkrhs (Lident "()") 1, None)))) } - | mod_longident DOT LPAREN seq_expr error - { unclosed "(" 3 ")" 5 } - | simple_expr DOT LPAREN seq_expr RPAREN - { mkexp(Pexp_apply(ghexp(Pexp_ident(array_function "Array" "get")), - [Nolabel,$1; Nolabel,$4])) } - | simple_expr DOT LPAREN seq_expr error - { unclosed "(" 3 ")" 5 } - | simple_expr DOT LBRACKET seq_expr RBRACKET - { mkexp(Pexp_apply(ghexp(Pexp_ident(array_function "String" "get")), - [Nolabel,$1; Nolabel,$4])) } - | simple_expr DOT LBRACKET seq_expr error - { unclosed "[" 3 "]" 5 } - | simple_expr DOTOP LBRACKET expr RBRACKET - { let id = mkexp @@ Pexp_ident( ghloc @@ Lident ("." ^ $2 ^ "[]")) in - mkexp @@ Pexp_apply(id, [Nolabel, $1; Nolabel, $4]) } - | simple_expr DOTOP LBRACKET expr error - { unclosed "[" 3 "]" 5 } - | simple_expr DOTOP LPAREN expr RPAREN - { let id = mkexp @@ Pexp_ident( ghloc @@ Lident ("." ^ $2 ^ "()")) in - mkexp @@ Pexp_apply(id, [Nolabel, $1; Nolabel, $4]) } - | simple_expr DOTOP LPAREN expr error - { unclosed "(" 3 ")" 5 } - | simple_expr DOTOP LBRACE expr RBRACE - { let id = mkexp @@ Pexp_ident( ghloc @@ Lident ("." ^ $2 ^ "{}")) in - mkexp @@ Pexp_apply(id, [Nolabel, $1; Nolabel, $4]) } - | simple_expr DOTOP LBRACE expr error - { unclosed "{" 3 "}" 5 } - | simple_expr DOT mod_longident DOTOP LBRACKET expr RBRACKET - { let id = mkexp @@ Pexp_ident( ghloc @@ Ldot($3, "." ^ $4 ^ "[]")) in - mkexp @@ Pexp_apply(id, [Nolabel, $1; Nolabel, $6]) } - | simple_expr DOT mod_longident DOTOP LBRACKET expr error - { unclosed "[" 5 "]" 7 } - | simple_expr DOT mod_longident DOTOP LPAREN expr RPAREN - { let id = mkexp @@ Pexp_ident( ghloc @@ Ldot($3, "." ^ $4 ^ "()")) in - mkexp @@ Pexp_apply(id, [Nolabel, $1; Nolabel, $6]) } - | simple_expr DOT mod_longident DOTOP LPAREN expr error - { unclosed "(" 5 ")" 7 } - | simple_expr DOT mod_longident DOTOP LBRACE expr RBRACE - { let id = mkexp @@ Pexp_ident( ghloc @@ Ldot($3, "." ^ $4 ^ "{}")) in - mkexp @@ Pexp_apply(id, [Nolabel, $1; Nolabel, $6]) } - | simple_expr DOT mod_longident DOTOP LBRACE expr error - { unclosed "{" 5 "}" 7 } - | simple_expr DOT LBRACE expr_comma_list error - { unclosed "{" 3 "}" 5 } - | LBRACE record_expr RBRACE - { let (exten, fields) = $2 in mkexp (Pexp_record(fields, exten)) } - | LBRACE record_expr error - { unclosed "{" 1 "}" 3 } - | mod_longident DOT LBRACE record_expr RBRACE - { let (exten, fields) = $4 in - let rec_exp = mkexp(Pexp_record(fields, exten)) in - mkexp(Pexp_open(Fresh, mkrhs $1 1, rec_exp)) } - | mod_longident DOT LBRACE record_expr error - { unclosed "{" 3 "}" 5 } - | LBRACKETBAR expr_semi_list opt_semi BARRBRACKET - { mkexp (Pexp_array(List.rev $2)) } - | LBRACKETBAR expr_semi_list opt_semi error - { unclosed "[|" 1 "|]" 4 } - | LBRACKETBAR BARRBRACKET - { mkexp (Pexp_array []) } - | mod_longident DOT LBRACKETBAR expr_semi_list opt_semi BARRBRACKET - { mkexp(Pexp_open(Fresh, mkrhs $1 1, mkexp(Pexp_array(List.rev $4)))) } - | mod_longident DOT LBRACKETBAR BARRBRACKET - { mkexp(Pexp_open(Fresh, mkrhs $1 1, mkexp(Pexp_array []))) } - | mod_longident DOT LBRACKETBAR expr_semi_list opt_semi error - { unclosed "[|" 3 "|]" 6 } - | LBRACKET expr_semi_list opt_semi RBRACKET - { reloc_exp (mktailexp (rhs_loc 4) (List.rev $2)) } - | LBRACKET expr_semi_list opt_semi error - { unclosed "[" 1 "]" 4 } - | mod_longident DOT LBRACKET expr_semi_list opt_semi RBRACKET - { let list_exp = reloc_exp (mktailexp (rhs_loc 6) (List.rev $4)) in - mkexp(Pexp_open(Fresh, mkrhs $1 1, list_exp)) } - | mod_longident DOT LBRACKET RBRACKET - { mkexp(Pexp_open(Fresh, mkrhs $1 1, - mkexp(Pexp_construct(mkrhs (Lident "[]") 1, None)))) } - | mod_longident DOT LBRACKET expr_semi_list opt_semi error - { unclosed "[" 3 "]" 6 } - | PREFIXOP simple_expr - { mkexp(Pexp_apply(mkoperator $1 1, [Nolabel,$2])) } - | BANG simple_expr - { mkexp(Pexp_apply(mkoperator "!" 1, [Nolabel,$2])) } - | LBRACELESS field_expr_list GREATERRBRACE - { mkexp (Pexp_override $2) } - | LBRACELESS field_expr_list error - { unclosed "{<" 1 ">}" 3 } - | LBRACELESS GREATERRBRACE - { mkexp (Pexp_override [])} - | mod_longident DOT LBRACELESS field_expr_list GREATERRBRACE - { mkexp(Pexp_open(Fresh, mkrhs $1 1, mkexp (Pexp_override $4)))} - | mod_longident DOT LBRACELESS GREATERRBRACE - { mkexp(Pexp_open(Fresh, mkrhs $1 1, mkexp (Pexp_override [])))} - | mod_longident DOT LBRACELESS field_expr_list error - { unclosed "{<" 3 ">}" 5 } - | simple_expr HASH label - { mkexp(Pexp_send($1, mkrhs $3 3)) } - | simple_expr HASHOP simple_expr - { mkinfix $1 $2 $3 } - | LPAREN MODULE ext_attributes module_expr RPAREN - { mkexp_attrs (Pexp_pack $4) $3 } - | LPAREN MODULE ext_attributes module_expr COLON package_type RPAREN - { mkexp_attrs (Pexp_constraint (ghexp (Pexp_pack $4), - ghtyp (Ptyp_package $6))) - $3 } - | LPAREN MODULE ext_attributes module_expr COLON error - { unclosed "(" 1 ")" 6 } - | mod_longident DOT LPAREN MODULE ext_attributes module_expr COLON - package_type RPAREN - { mkexp(Pexp_open(Fresh, mkrhs $1 1, - mkexp_attrs (Pexp_constraint (ghexp (Pexp_pack $6), - ghtyp (Ptyp_package $8))) - $5 )) } - | mod_longident DOT LPAREN MODULE ext_attributes module_expr COLON error - { unclosed "(" 3 ")" 8 } - | extension - { mkexp (Pexp_extension $1) } -; -simple_labeled_expr_list: - labeled_simple_expr - { [$1] } - | simple_labeled_expr_list labeled_simple_expr - { $2 :: $1 } -; -labeled_simple_expr: - simple_expr %prec below_HASH - { (Nolabel, $1) } - | label_expr - { $1 } -; -label_expr: - LABEL simple_expr %prec below_HASH - { (Labelled $1, $2) } - | TILDE label_ident - { (Labelled (fst $2), snd $2) } - | QUESTION label_ident - { (Optional (fst $2), snd $2) } - | OPTLABEL simple_expr %prec below_HASH - { (Optional $1, $2) } -; -label_ident: - LIDENT { ($1, mkexp(Pexp_ident(mkrhs (Lident $1) 1))) } -; -lident_list: - LIDENT { [mkrhs $1 1] } - | LIDENT lident_list { mkrhs $1 1 :: $2 } -; -let_binding_body: - val_ident strict_binding - { (mkpatvar $1 1, $2) } - | val_ident type_constraint EQUAL seq_expr - { let v = mkpatvar $1 1 in (* PR#7344 *) - let t = - match $2 with - Some t, None -> t - | _, Some t -> t - | _ -> assert false - in - (ghpat(Ppat_constraint(v, ghtyp(Ptyp_poly([],t)))), - mkexp_constraint $4 $2) } - | val_ident COLON typevar_list DOT core_type EQUAL seq_expr - { (ghpat(Ppat_constraint(mkpatvar $1 1, - ghtyp(Ptyp_poly(List.rev $3,$5)))), - $7) } - | val_ident COLON TYPE lident_list DOT core_type EQUAL seq_expr - { let exp, poly = wrap_type_annotation $4 $6 $8 in - (ghpat(Ppat_constraint(mkpatvar $1 1, poly)), exp) } - | pattern_no_exn EQUAL seq_expr - { ($1, $3) } - | simple_pattern_not_ident COLON core_type EQUAL seq_expr - { (ghpat(Ppat_constraint($1, $3)), $5) } -; -let_bindings: - let_binding { $1 } - | let_bindings and_let_binding { addlb $1 $2 } -; -let_binding: - LET ext_attributes rec_flag let_binding_body post_item_attributes - { let (ext, attr) = $2 in - mklbs ext $3 (mklb true $4 (attr@$5)) } -; -and_let_binding: - AND attributes let_binding_body post_item_attributes - { mklb false $3 ($2@$4) } -; -fun_binding: - strict_binding - { $1 } - | type_constraint EQUAL seq_expr - { mkexp_constraint $3 $1 } -; -strict_binding: - EQUAL seq_expr - { $2 } - | labeled_simple_pattern fun_binding - { let (l, o, p) = $1 in ghexp(Pexp_fun(l, o, p, $2)) } - | LPAREN TYPE lident_list RPAREN fun_binding - { mk_newtypes $3 $5 } -; -match_cases: - match_case { [$1] } - | match_cases BAR match_case { $3 :: $1 } -; -match_case: - pattern MINUSGREATER seq_expr - { Exp.case $1 $3 } - | pattern WHEN seq_expr MINUSGREATER seq_expr - { Exp.case $1 ~guard:$3 $5 } - | pattern MINUSGREATER DOT - { Exp.case $1 (Exp.unreachable ~loc:(rhs_loc 3) ())} -; -fun_def: - MINUSGREATER seq_expr - { $2 } - | COLON simple_core_type MINUSGREATER seq_expr - { mkexp (Pexp_constraint ($4, $2)) } -/* Cf #5939: we used to accept (fun p when e0 -> e) */ - | labeled_simple_pattern fun_def - { - let (l,o,p) = $1 in - ghexp(Pexp_fun(l, o, p, $2)) - } - | LPAREN TYPE lident_list RPAREN fun_def - { mk_newtypes $3 $5 } -; -expr_comma_list: - expr_comma_list COMMA expr { $3 :: $1 } - | expr COMMA expr { [$3; $1] } -; -record_expr: - simple_expr WITH lbl_expr_list { (Some $1, $3) } - | lbl_expr_list { (None, $1) } -; -lbl_expr_list: - lbl_expr { [$1] } - | lbl_expr SEMI lbl_expr_list { $1 :: $3 } - | lbl_expr SEMI { [$1] } -; -lbl_expr: - label_longident opt_type_constraint EQUAL expr - { (mkrhs $1 1, mkexp_opt_constraint $4 $2) } - | label_longident opt_type_constraint - { (mkrhs $1 1, mkexp_opt_constraint (exp_of_label $1 1) $2) } -; -field_expr_list: - field_expr opt_semi { [$1] } - | field_expr SEMI field_expr_list { $1 :: $3 } -; -field_expr: - label EQUAL expr - { (mkrhs $1 1, $3) } - | label - { (mkrhs $1 1, exp_of_label (Lident $1) 1) } -; -expr_semi_list: - expr { [$1] } - | expr_semi_list SEMI expr { $3 :: $1 } -; -type_constraint: - COLON core_type { (Some $2, None) } - | COLON core_type COLONGREATER core_type { (Some $2, Some $4) } - | COLONGREATER core_type { (None, Some $2) } - | COLON error { syntax_error() } - | COLONGREATER error { syntax_error() } -; -opt_type_constraint: - type_constraint { Some $1 } - | /* empty */ { None } -; - -/* Patterns */ - -pattern: - | pattern AS val_ident - { mkpat(Ppat_alias($1, mkrhs $3 3)) } - | pattern AS error - { expecting 3 "identifier" } - | pattern_comma_list %prec below_COMMA - { mkpat(Ppat_tuple(List.rev $1)) } - | pattern COLONCOLON pattern - { mkpat_cons (rhs_loc 2) (ghpat(Ppat_tuple[$1;$3])) (symbol_rloc()) } - | pattern COLONCOLON error - { expecting 3 "pattern" } - | pattern BAR pattern - { mkpat(Ppat_or($1, $3)) } - | pattern BAR error - { expecting 3 "pattern" } - | EXCEPTION ext_attributes pattern %prec prec_constr_appl - { mkpat_attrs (Ppat_exception $3) $2} - | pattern attribute - { Pat.attr $1 $2 } - | pattern_gen { $1 } -; -pattern_no_exn: - | pattern_no_exn AS val_ident - { mkpat(Ppat_alias($1, mkrhs $3 3)) } - | pattern_no_exn AS error - { expecting 3 "identifier" } - | pattern_no_exn_comma_list %prec below_COMMA - { mkpat(Ppat_tuple(List.rev $1)) } - | pattern_no_exn COLONCOLON pattern - { mkpat_cons (rhs_loc 2) (ghpat(Ppat_tuple[$1;$3])) (symbol_rloc()) } - | pattern_no_exn COLONCOLON error - { expecting 3 "pattern" } - | pattern_no_exn BAR pattern - { mkpat(Ppat_or($1, $3)) } - | pattern_no_exn BAR error - { expecting 3 "pattern" } - | pattern_no_exn attribute - { Pat.attr $1 $2 } - | pattern_gen { $1 } -; -pattern_gen: - simple_pattern - { $1 } - | constr_longident pattern %prec prec_constr_appl - { mkpat(Ppat_construct(mkrhs $1 1, Some $2)) } - | name_tag pattern %prec prec_constr_appl - { mkpat(Ppat_variant($1, Some $2)) } - | LAZY ext_attributes simple_pattern - { mkpat_attrs (Ppat_lazy $3) $2} -; -simple_pattern: - val_ident %prec below_EQUAL - { mkpat(Ppat_var (mkrhs $1 1)) } - | simple_pattern_not_ident { $1 } -; -simple_pattern_not_ident: - | UNDERSCORE - { mkpat(Ppat_any) } - | signed_constant - { mkpat(Ppat_constant $1) } - | signed_constant DOTDOT signed_constant - { mkpat(Ppat_interval ($1, $3)) } - | constr_longident - { mkpat(Ppat_construct(mkrhs $1 1, None)) } - | name_tag - { mkpat(Ppat_variant($1, None)) } - | HASH type_longident - { mkpat(Ppat_type (mkrhs $2 2)) } - | simple_delimited_pattern - { $1 } - | mod_longident DOT simple_delimited_pattern - { mkpat @@ Ppat_open(mkrhs $1 1, $3) } - | mod_longident DOT LBRACKET RBRACKET - { mkpat @@ Ppat_open(mkrhs $1 1, mkpat @@ - Ppat_construct ( mkrhs (Lident "[]") 4, None)) } - | mod_longident DOT LPAREN RPAREN - { mkpat @@ Ppat_open( mkrhs $1 1, mkpat @@ - Ppat_construct ( mkrhs (Lident "()") 4, None) ) } - | mod_longident DOT LPAREN pattern RPAREN - { mkpat @@ Ppat_open (mkrhs $1 1, $4)} - | mod_longident DOT LPAREN pattern error - {unclosed "(" 3 ")" 5 } - | mod_longident DOT LPAREN error - { expecting 4 "pattern" } - | LPAREN pattern RPAREN - { reloc_pat $2 } - | LPAREN pattern error - { unclosed "(" 1 ")" 3 } - | LPAREN pattern COLON core_type RPAREN - { mkpat(Ppat_constraint($2, $4)) } - | LPAREN pattern COLON core_type error - { unclosed "(" 1 ")" 5 } - | LPAREN pattern COLON error - { expecting 4 "type" } - | LPAREN MODULE ext_attributes UIDENT RPAREN - { mkpat_attrs (Ppat_unpack (mkrhs $4 4)) $3 } - | LPAREN MODULE ext_attributes UIDENT COLON package_type RPAREN - { mkpat_attrs - (Ppat_constraint(mkpat(Ppat_unpack (mkrhs $4 4)), - ghtyp(Ptyp_package $6))) - $3 } - | LPAREN MODULE ext_attributes UIDENT COLON package_type error - { unclosed "(" 1 ")" 7 } - | extension - { mkpat(Ppat_extension $1) } -; - -simple_delimited_pattern: - | LBRACE lbl_pattern_list RBRACE - { let (fields, closed) = $2 in mkpat(Ppat_record(fields, closed)) } - | LBRACE lbl_pattern_list error - { unclosed "{" 1 "}" 3 } - | LBRACKET pattern_semi_list opt_semi RBRACKET - { reloc_pat (mktailpat (rhs_loc 4) (List.rev $2)) } - | LBRACKET pattern_semi_list opt_semi error - { unclosed "[" 1 "]" 4 } - | LBRACKETBAR pattern_semi_list opt_semi BARRBRACKET - { mkpat(Ppat_array(List.rev $2)) } - | LBRACKETBAR BARRBRACKET - { mkpat(Ppat_array []) } - | LBRACKETBAR pattern_semi_list opt_semi error - { unclosed "[|" 1 "|]" 4 } - -pattern_comma_list: - pattern_comma_list COMMA pattern { $3 :: $1 } - | pattern COMMA pattern { [$3; $1] } - | pattern COMMA error { expecting 3 "pattern" } -; -pattern_no_exn_comma_list: - pattern_no_exn_comma_list COMMA pattern { $3 :: $1 } - | pattern_no_exn COMMA pattern { [$3; $1] } - | pattern_no_exn COMMA error { expecting 3 "pattern" } -; -pattern_semi_list: - pattern { [$1] } - | pattern_semi_list SEMI pattern { $3 :: $1 } -; -lbl_pattern_list: - lbl_pattern { [$1], Closed } - | lbl_pattern SEMI { [$1], Closed } - | lbl_pattern SEMI UNDERSCORE opt_semi { [$1], Open } - | lbl_pattern SEMI lbl_pattern_list - { let (fields, closed) = $3 in $1 :: fields, closed } -; -lbl_pattern: - label_longident opt_pattern_type_constraint EQUAL pattern - { (mkrhs $1 1, mkpat_opt_constraint $4 $2) } - | label_longident opt_pattern_type_constraint - { (mkrhs $1 1, mkpat_opt_constraint (pat_of_label $1 1) $2) } -; -opt_pattern_type_constraint: - COLON core_type { Some $2 } - | /* empty */ { None } -; - -/* Value descriptions */ - -value_description: - VAL ext_attributes val_ident COLON core_type post_item_attributes - { let (ext, attrs) = $2 in - Val.mk (mkrhs $3 3) $5 ~attrs:(attrs@$6) - ~loc:(symbol_rloc()) ~docs:(symbol_docs ()) - , ext } -; - -/* Primitive declarations */ - -primitive_declaration_body: - STRING { [fst $1] } - | STRING primitive_declaration_body { fst $1 :: $2 } -; -primitive_declaration: - EXTERNAL ext_attributes val_ident COLON core_type EQUAL - primitive_declaration_body post_item_attributes - { let (ext, attrs) = $2 in - Val.mk (mkrhs $3 3) $5 ~prim:$7 ~attrs:(attrs@$8) - ~loc:(symbol_rloc ()) ~docs:(symbol_docs ()) - , ext } -; - -/* Type declarations */ - -type_declarations: - type_declaration - { let (nonrec_flag, ty, ext) = $1 in (nonrec_flag, [ty], ext) } - | type_declarations and_type_declaration - { let (nonrec_flag, tys, ext) = $1 in (nonrec_flag, $2 :: tys, ext) } -; - -type_declaration: - TYPE ext_attributes nonrec_flag optional_type_parameters LIDENT - type_kind constraints post_item_attributes - { let (kind, priv, manifest) = $6 in - let (ext, attrs) = $2 in - let ty = - Type.mk (mkrhs $5 5) ~params:$4 ~cstrs:(List.rev $7) ~kind - ~priv ?manifest ~attrs:(attrs@$8) - ~loc:(symbol_rloc ()) ~docs:(symbol_docs ()) - in - ($3, ty, ext) } -; -and_type_declaration: - AND attributes optional_type_parameters LIDENT type_kind constraints - post_item_attributes - { let (kind, priv, manifest) = $5 in - Type.mk (mkrhs $4 4) ~params:$3 ~cstrs:(List.rev $6) - ~kind ~priv ?manifest ~attrs:($2@$7) ~loc:(symbol_rloc ()) - ~text:(symbol_text ()) ~docs:(symbol_docs ()) } -; -constraints: - constraints CONSTRAINT constrain { $3 :: $1 } - | /* empty */ { [] } -; -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 DOTDOT - { (Ptype_open, Public, None) } - | EQUAL PRIVATE DOTDOT - { (Ptype_open, Private, None) } - | EQUAL private_flag LBRACE label_declarations RBRACE - { (Ptype_record $4, $2, None) } - | EQUAL core_type EQUAL private_flag constructor_declarations - { (Ptype_variant(List.rev $5), $4, Some $2) } - | EQUAL core_type EQUAL private_flag DOTDOT - { (Ptype_open, $4, Some $2) } - | EQUAL core_type EQUAL private_flag LBRACE label_declarations RBRACE - { (Ptype_record $6, $4, Some $2) } -; -optional_type_parameters: - /*empty*/ { [] } - | optional_type_parameter { [$1] } - | LPAREN optional_type_parameter_list RPAREN { List.rev $2 } -; -optional_type_parameter: - type_variance optional_type_variable { $2, $1 } -; -optional_type_parameter_list: - optional_type_parameter { [$1] } - | optional_type_parameter_list COMMA optional_type_parameter { $3 :: $1 } -; -optional_type_variable: - QUOTE ident { mktyp(Ptyp_var $2) } - | UNDERSCORE { mktyp(Ptyp_any) } -; - - -type_parameter: - type_variance type_variable { $2, $1 } -; -type_variance: - /* empty */ { Invariant } - | PLUS { Covariant } - | MINUS { Contravariant } -; -type_variable: - QUOTE ident { mktyp(Ptyp_var $2) } -; -type_parameter_list: - type_parameter { [$1] } - | type_parameter_list COMMA type_parameter { $3 :: $1 } -; -constructor_declarations: - constructor_declaration { [$1] } - | bar_constructor_declaration { [$1] } - | constructor_declarations bar_constructor_declaration { $2 :: $1 } -; -constructor_declaration: - | constr_ident generalized_constructor_arguments attributes - { - let args,res = $2 in - Type.constructor (mkrhs $1 1) ~args ?res ~attrs:$3 - ~loc:(symbol_rloc()) ~info:(symbol_info ()) - } -; -bar_constructor_declaration: - | BAR constr_ident generalized_constructor_arguments attributes - { - let args,res = $3 in - Type.constructor (mkrhs $2 2) ~args ?res ~attrs:$4 - ~loc:(symbol_rloc()) ~info:(symbol_info ()) - } -; -str_exception_declaration: - | sig_exception_declaration { $1 } - | EXCEPTION ext_attributes constr_ident EQUAL constr_longident attributes - post_item_attributes - { let (ext,attrs) = $2 in - Te.rebind (mkrhs $3 3) (mkrhs $5 5) ~attrs:(attrs @ $6 @ $7) - ~loc:(symbol_rloc()) ~docs:(symbol_docs ()) - , ext } -; -sig_exception_declaration: - | EXCEPTION ext_attributes constr_ident generalized_constructor_arguments - attributes post_item_attributes - { let args, res = $4 in - let (ext,attrs) = $2 in - Te.decl (mkrhs $3 3) ~args ?res ~attrs:(attrs @ $5 @ $6) - ~loc:(symbol_rloc()) ~docs:(symbol_docs ()) - , ext } -; -let_exception_declaration: - constr_ident generalized_constructor_arguments attributes - { let args, res = $2 in - Te.decl (mkrhs $1 1) ~args ?res ~attrs:$3 ~loc:(symbol_rloc()) } -; -generalized_constructor_arguments: - /*empty*/ { (Pcstr_tuple [],None) } - | OF constructor_arguments { ($2,None) } - | COLON constructor_arguments MINUSGREATER simple_core_type - { ($2,Some $4) } - | COLON simple_core_type - { (Pcstr_tuple [],Some $2) } -; - -constructor_arguments: - | core_type_list { Pcstr_tuple (List.rev $1) } - | LBRACE label_declarations RBRACE { Pcstr_record $2 } -; -label_declarations: - label_declaration { [$1] } - | label_declaration_semi { [$1] } - | label_declaration_semi label_declarations { $1 :: $2 } -; -label_declaration: - mutable_flag label COLON poly_type_no_attr attributes - { - Type.field (mkrhs $2 2) $4 ~mut:$1 ~attrs:$5 - ~loc:(symbol_rloc()) ~info:(symbol_info ()) - } -; -label_declaration_semi: - mutable_flag label COLON poly_type_no_attr attributes SEMI attributes - { - let info = - match rhs_info 5 with - | Some _ as info_before_semi -> info_before_semi - | None -> symbol_info () - in - Type.field (mkrhs $2 2) $4 ~mut:$1 ~attrs:($5 @ $7) - ~loc:(symbol_rloc()) ~info - } -; - -/* Type Extensions */ - -str_type_extension: - TYPE ext_attributes nonrec_flag optional_type_parameters type_longident - PLUSEQ private_flag str_extension_constructors post_item_attributes - { let (ext, attrs) = $2 in - if $3 <> Recursive then not_expecting 3 "nonrec flag"; - Te.mk (mkrhs $5 5) (List.rev $8) ~params:$4 ~priv:$7 - ~attrs:(attrs@$9) ~docs:(symbol_docs ()) - , ext } -; -sig_type_extension: - TYPE ext_attributes nonrec_flag optional_type_parameters type_longident - PLUSEQ private_flag sig_extension_constructors post_item_attributes - { let (ext, attrs) = $2 in - if $3 <> Recursive then not_expecting 3 "nonrec flag"; - Te.mk (mkrhs $5 5) (List.rev $8) ~params:$4 ~priv:$7 - ~attrs:(attrs @ $9) ~docs:(symbol_docs ()) - , ext } -; -str_extension_constructors: - extension_constructor_declaration { [$1] } - | bar_extension_constructor_declaration { [$1] } - | extension_constructor_rebind { [$1] } - | bar_extension_constructor_rebind { [$1] } - | str_extension_constructors bar_extension_constructor_declaration - { $2 :: $1 } - | str_extension_constructors bar_extension_constructor_rebind - { $2 :: $1 } -; -sig_extension_constructors: - extension_constructor_declaration { [$1] } - | bar_extension_constructor_declaration { [$1] } - | sig_extension_constructors bar_extension_constructor_declaration - { $2 :: $1 } -; -extension_constructor_declaration: - | constr_ident generalized_constructor_arguments attributes - { let args, res = $2 in - Te.decl (mkrhs $1 1) ~args ?res ~attrs:$3 - ~loc:(symbol_rloc()) ~info:(symbol_info ()) } -; -bar_extension_constructor_declaration: - | BAR constr_ident generalized_constructor_arguments attributes - { let args, res = $3 in - Te.decl (mkrhs $2 2) ~args ?res ~attrs:$4 - ~loc:(symbol_rloc()) ~info:(symbol_info ()) } -; -extension_constructor_rebind: - | constr_ident EQUAL constr_longident attributes - { Te.rebind (mkrhs $1 1) (mkrhs $3 3) ~attrs:$4 - ~loc:(symbol_rloc()) ~info:(symbol_info ()) } -; -bar_extension_constructor_rebind: - | BAR constr_ident EQUAL constr_longident attributes - { Te.rebind (mkrhs $2 2) (mkrhs $4 4) ~attrs:$5 - ~loc:(symbol_rloc()) ~info:(symbol_info ()) } -; - -/* "with" constraints (additional type equations over signature components) */ - -with_constraints: - with_constraint { [$1] } - | with_constraints AND with_constraint { $3 :: $1 } -; -with_constraint: - TYPE optional_type_parameters label_longident with_type_binder - core_type_no_attr constraints - { Pwith_type - (mkrhs $3 3, - (Type.mk (mkrhs (Longident.last $3) 3) - ~params:$2 - ~cstrs:(List.rev $6) - ~manifest:$5 - ~priv:$4 - ~loc:(symbol_rloc()))) } - /* used label_longident instead of type_longident to disallow - functor applications in type path */ - | TYPE optional_type_parameters label_longident COLONEQUAL core_type_no_attr - { Pwith_typesubst - (mkrhs $3 3, - (Type.mk (mkrhs (Longident.last $3) 3) - ~params:$2 - ~manifest:$5 - ~loc:(symbol_rloc()))) } - | MODULE mod_longident EQUAL mod_ext_longident - { Pwith_module (mkrhs $2 2, mkrhs $4 4) } - | MODULE mod_longident COLONEQUAL mod_ext_longident - { Pwith_modsubst (mkrhs $2 2, mkrhs $4 4) } -; -with_type_binder: - EQUAL { Public } - | EQUAL PRIVATE { Private } -; - -/* Polymorphic types */ - -typevar_list: - QUOTE ident { [mkrhs $2 2] } - | typevar_list QUOTE ident { mkrhs $3 3 :: $1 } -; -poly_type: - core_type - { $1 } - | typevar_list DOT core_type - { mktyp(Ptyp_poly(List.rev $1, $3)) } -; -poly_type_no_attr: - core_type_no_attr - { $1 } - | typevar_list DOT core_type_no_attr - { mktyp(Ptyp_poly(List.rev $1, $3)) } -; - -/* Core types */ - -core_type: - core_type_no_attr - { $1 } - | core_type attribute - { Typ.attr $1 $2 } -; -core_type_no_attr: - core_type2 %prec MINUSGREATER - { $1 } - | core_type2 AS QUOTE ident - { mktyp(Ptyp_alias($1, $4)) } -; -core_type2: - simple_core_type_or_tuple - { $1 } - | QUESTION LIDENT COLON core_type2 MINUSGREATER core_type2 - { let param = extra_rhs_core_type $4 ~pos:4 in - mktyp (Ptyp_arrow(Optional $2 , param, $6)) } - | OPTLABEL core_type2 MINUSGREATER core_type2 - { let param = extra_rhs_core_type $2 ~pos:2 in - mktyp(Ptyp_arrow(Optional $1 , param, $4)) - } - | LIDENT COLON core_type2 MINUSGREATER core_type2 - { let param = extra_rhs_core_type $3 ~pos:3 in - mktyp(Ptyp_arrow(Labelled $1, param, $5)) } - | core_type2 MINUSGREATER core_type2 - { let param = extra_rhs_core_type $1 ~pos:1 in - mktyp(Ptyp_arrow(Nolabel, param, $3)) } -; - -simple_core_type: - simple_core_type2 %prec below_HASH - { $1 } - | LPAREN core_type_comma_list RPAREN %prec below_HASH - { match $2 with [sty] -> sty | _ -> raise Parse_error } -; - -simple_core_type2: - QUOTE ident - { mktyp(Ptyp_var $2) } - | UNDERSCORE - { mktyp(Ptyp_any) } - | type_longident - { mktyp(Ptyp_constr(mkrhs $1 1, [])) } - | simple_core_type2 type_longident - { mktyp(Ptyp_constr(mkrhs $2 2, [$1])) } - | LPAREN core_type_comma_list RPAREN type_longident - { mktyp(Ptyp_constr(mkrhs $4 4, List.rev $2)) } - | LESS meth_list GREATER - { let (f, c) = $2 in mktyp(Ptyp_object (f, c)) } - | LESS GREATER - { mktyp(Ptyp_object ([], Closed)) } - | HASH class_longident - { mktyp(Ptyp_class()) } - | simple_core_type2 HASH class_longident - { mktyp(Ptyp_class()) } - | LPAREN core_type_comma_list RPAREN HASH class_longident - { mktyp(Ptyp_class()) } - | LBRACKET tag_field RBRACKET - { mktyp(Ptyp_variant([$2], Closed, None)) } -/* PR#3835: this is not LR(1), would need lookahead=2 - | LBRACKET simple_core_type RBRACKET - { mktyp(Ptyp_variant([$2], Closed, None)) } -*/ - | LBRACKET BAR row_field_list RBRACKET - { mktyp(Ptyp_variant(List.rev $3, Closed, None)) } - | LBRACKET row_field BAR row_field_list RBRACKET - { mktyp(Ptyp_variant($2 :: List.rev $4, Closed, None)) } - | LBRACKETGREATER opt_bar row_field_list RBRACKET - { mktyp(Ptyp_variant(List.rev $3, Open, None)) } - | LBRACKETGREATER RBRACKET - { mktyp(Ptyp_variant([], Open, None)) } - | LBRACKETLESS opt_bar row_field_list RBRACKET - { mktyp(Ptyp_variant(List.rev $3, Closed, Some [])) } - | LBRACKETLESS opt_bar row_field_list GREATER name_tag_list RBRACKET - { mktyp(Ptyp_variant(List.rev $3, Closed, Some (List.rev $5))) } - | LPAREN MODULE ext_attributes package_type RPAREN - { mktyp_attrs (Ptyp_package $4) $3 } - | extension - { mktyp (Ptyp_extension $1) } -; -package_type: - module_type { package_type_of_module_type $1 } -; -row_field_list: - row_field { [$1] } - | row_field_list BAR row_field { $3 :: $1 } -; -row_field: - tag_field { $1 } - | simple_core_type { Rinherit $1 } -; -tag_field: - name_tag OF opt_ampersand amper_type_list attributes - { Rtag (mkrhs $1 1, add_info_attrs (symbol_info ()) $5, - $3, List.rev $4) } - | name_tag attributes - { Rtag (mkrhs $1 1, add_info_attrs (symbol_info ()) $2, true, []) } -; -opt_ampersand: - AMPERSAND { true } - | /* empty */ { false } -; -amper_type_list: - core_type_no_attr { [$1] } - | amper_type_list AMPERSAND core_type_no_attr { $3 :: $1 } -; -name_tag_list: - name_tag { [$1] } - | name_tag_list name_tag { $2 :: $1 } -; -simple_core_type_or_tuple: - simple_core_type { $1 } - | simple_core_type STAR core_type_list - { mktyp(Ptyp_tuple($1 :: List.rev $3)) } -; -core_type_comma_list: - core_type { [$1] } - | core_type_comma_list COMMA core_type { $3 :: $1 } -; -core_type_list: - simple_core_type { [$1] } - | core_type_list STAR simple_core_type { $3 :: $1 } -; -meth_list: - field_semi meth_list { let (f, c) = $2 in ($1 :: f, c) } - | inherit_field_semi meth_list { let (f, c) = $2 in ($1 :: f, c) } - | field_semi { [$1], Closed } - | field { [$1], Closed } - | inherit_field_semi { [$1], Closed } - | simple_core_type { [Oinherit $1], Closed } - | DOTDOT { [], Open } -; -field: - label COLON poly_type_no_attr attributes - { Otag (mkrhs $1 1, add_info_attrs (symbol_info ()) $4, $3) } -; - -field_semi: - label COLON poly_type_no_attr attributes SEMI attributes - { let info = - match rhs_info 4 with - | Some _ as info_before_semi -> info_before_semi - | None -> symbol_info () - in - ( Otag (mkrhs $1 1, add_info_attrs info ($4 @ $6), $3)) } -; - -inherit_field_semi: - simple_core_type SEMI { Oinherit $1 } - -label: - LIDENT { $1 } -; - -/* Constants */ - -constant: - | INT { let (n, m) = $1 in Pconst_integer (n, m) } - | CHAR { Pconst_char (Char.code $1) } - | STRING { let (s, d) = $1 in Pconst_string (s, d) } - | FLOAT { let (f, m) = $1 in Pconst_float (f, m) } -; -signed_constant: - constant { $1 } - | MINUS INT { let (n, m) = $2 in Pconst_integer("-" ^ n, m) } - | MINUS FLOAT { let (f, m) = $2 in Pconst_float("-" ^ f, m) } - | PLUS INT { let (n, m) = $2 in Pconst_integer (n, m) } - | PLUS FLOAT { let (f, m) = $2 in Pconst_float(f, m) } -; - -/* Identifiers and long identifiers */ - -ident: - UIDENT { $1 } - | LIDENT { $1 } -; -val_ident: - LIDENT { $1 } - | LPAREN operator RPAREN { $2 } - | LPAREN operator error { unclosed "(" 1 ")" 3 } - | LPAREN error { expecting 2 "operator" } - | LPAREN MODULE error { expecting 3 "module-expr" } -; -operator: - PREFIXOP { $1 } - | INFIXOP0 { $1 } - | INFIXOP1 { $1 } - | INFIXOP2 { $1 } - | INFIXOP3 { $1 } - | INFIXOP4 { $1 } - | DOTOP LPAREN RPAREN { "."^ $1 ^"()" } - | DOTOP LPAREN RPAREN LESSMINUS { "."^ $1 ^ "()<-" } - | DOTOP LBRACKET RBRACKET { "."^ $1 ^"[]" } - | DOTOP LBRACKET RBRACKET LESSMINUS { "."^ $1 ^ "[]<-" } - | DOTOP LBRACE RBRACE { "."^ $1 ^"{}" } - | DOTOP LBRACE RBRACE LESSMINUS { "."^ $1 ^ "{}<-" } - | HASHOP { $1 } - | BANG { "!" } - | PLUS { "+" } - | PLUSDOT { "+." } - | MINUS { "-" } - | MINUSDOT { "-." } - | STAR { "*" } - | EQUAL { "=" } - | LESS { "<" } - | GREATER { ">" } - | OR { "or" } - | BARBAR { "||" } - | AMPERSAND { "&" } - | AMPERAMPER { "&&" } - | COLONEQUAL { ":=" } - | PLUSEQ { "+=" } - | PERCENT { "%" } -; -constr_ident: - UIDENT { $1 } - | LBRACKET RBRACKET { "[]" } - | LPAREN RPAREN { "()" } - | LPAREN COLONCOLON RPAREN { "::" } - | FALSE { "false" } - | TRUE { "true" } -; - -val_longident: - val_ident { Lident $1 } - | mod_longident DOT val_ident { Ldot($1, $3) } -; -constr_longident: - mod_longident %prec below_DOT { $1 } - | mod_longident DOT LPAREN COLONCOLON RPAREN { Ldot($1,"::") } - | LBRACKET RBRACKET { Lident "[]" } - | LPAREN RPAREN { Lident "()" } - | LPAREN COLONCOLON RPAREN { Lident "::" } - | FALSE { Lident "false" } - | TRUE { Lident "true" } -; -label_longident: - LIDENT { Lident $1 } - | mod_longident DOT LIDENT { Ldot($1, $3) } -; -type_longident: - LIDENT { Lident $1 } - | mod_ext_longident DOT LIDENT { Ldot($1, $3) } -; -mod_longident: - UIDENT { Lident $1 } - | mod_longident DOT UIDENT { Ldot($1, $3) } -; -mod_ext_longident: - UIDENT { Lident $1 } - | mod_ext_longident DOT UIDENT { Ldot($1, $3) } - | mod_ext_longident LPAREN mod_ext_longident RPAREN { lapply $1 $3 } -; -mty_longident: - ident { Lident $1 } - | mod_ext_longident DOT ident { Ldot($1, $3) } -; -clty_longident: - LIDENT { Lident $1 } - | mod_ext_longident DOT LIDENT { Ldot($1, $3) } -; -class_longident: - LIDENT { Lident $1 } - | mod_longident DOT LIDENT { Ldot($1, $3) } -; - -/* Toplevel directives */ - - -/* Miscellaneous */ - -name_tag: - BACKQUOTE ident { $2 } -; -rec_flag: - /* empty */ { Nonrecursive } - | REC { Recursive } -; -nonrec_flag: - /* empty */ { Recursive } - | NONREC { Nonrecursive } -; -direction_flag: - TO { Upto } - | DOWNTO { Downto } -; -private_flag: - /* empty */ { Public } - | PRIVATE { Private } -; -mutable_flag: - /* empty */ { Immutable } - | MUTABLE { Mutable } -; -virtual_flag: - /* empty */ { Concrete } - | VIRTUAL { Virtual } -; -private_virtual_flags: - /* empty */ { Public, Concrete } - | PRIVATE { Private, Concrete } - | VIRTUAL { Public, Virtual } - | PRIVATE VIRTUAL { Private, Virtual } - | VIRTUAL PRIVATE { Private, Virtual } -; -override_flag: - /* empty */ { Fresh } - | BANG { Override } -; -opt_bar: - /* empty */ { () } - | BAR { () } -; -opt_semi: - | /* empty */ { () } - | SEMI { () } -; -subtractive: - | MINUS { "-" } - | MINUSDOT { "-." } -; -additive: - | PLUS { "+" } - | PLUSDOT { "+." } -; - -/* Attributes and extensions */ - -single_attr_id: - LIDENT { $1 } - | UIDENT { $1 } - | 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" } - | FUNCTION { "function" } - | FUNCTOR { "functor" } - | IF { "if" } - | IN { "in" } - | INCLUDE { "include" } - | INHERIT { "inherit" } - | INITIALIZER { "initializer" } - | LAZY { "lazy" } - | LET { "let" } - | MATCH { "match" } - | METHOD { "method" } - | MODULE { "module" } - | MUTABLE { "mutable" } - | NEW { "new" } - | NONREC { "nonrec" } - | OBJECT { "object" } - | OF { "of" } - | OPEN { "open" } - | OR { "or" } - | PRIVATE { "private" } - | 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/land/lor/lxor/lsl/lsr/asr are not supported for now */ -; - -attr_id: - single_attr_id { mkloc $1 (symbol_rloc()) } - | single_attr_id DOT attr_id { mkloc ($1 ^ "." ^ $3.txt) (symbol_rloc())} -; -attribute: - LBRACKETAT attr_id payload RBRACKET { ($2, $3) } -; -post_item_attribute: - LBRACKETATAT attr_id payload RBRACKET { ($2, $3) } -; -floating_attribute: - LBRACKETATATAT attr_id payload RBRACKET { ($2, $3) } -; -post_item_attributes: - /* empty */ { [] } - | post_item_attribute post_item_attributes { $1 :: $2 } -; -attributes: - /* empty */{ [] } - | attribute attributes { $1 :: $2 } -; -ext_attributes: - /* empty */ { None, [] } - | attribute attributes { None, $1 :: $2 } - | PERCENT attr_id attributes { Some $2, $3 } -; -extension: - LBRACKETPERCENT attr_id payload RBRACKET { ($2, $3) } -; -item_extension: - LBRACKETPERCENTPERCENT attr_id payload RBRACKET { ($2, $3) } -; -payload: - structure { PStr $1 } - | COLON signature { PSig $2 } - | COLON core_type { PTyp $2 } - | QUESTION pattern { PPat ($2, None) } - | QUESTION pattern WHEN seq_expr { PPat ($2, Some $4) } -; -%% diff --git a/jscomp/ml/rescript_cpp.ml b/jscomp/ml/rescript_cpp.ml index 71938df29f..9e9cb15e25 100644 --- a/jscomp/ml/rescript_cpp.ml +++ b/jscomp/ml/rescript_cpp.ml @@ -22,22 +22,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) -type directive_type = - | Dir_type_bool - | Dir_type_float - | Dir_type_int - | Dir_type_string - | Dir_type_null - type pp_error = - | Unterminated_paren_in_conditional | Unterminated_if | Unterminated_else - | Unexpected_token_in_conditional - | Expect_hash_then_in_conditional - | Illegal_semver of string - | Unexpected_directive - | Conditional_expr_expected_type of directive_type * directive_type exception Pp_error of pp_error * Location.t @@ -48,52 +35,15 @@ type directive_value = | Dir_string of string | Dir_null -let type_of_directive x = - match x with - | Dir_bool _ -> Dir_type_bool - | Dir_float _ -> Dir_type_float - | Dir_int _ -> Dir_type_int - | Dir_string _ -> Dir_type_string - | Dir_null -> Dir_type_null - -let string_of_type_directive x = - match x with - | Dir_type_bool -> "bool" - | Dir_type_float -> "float" - | Dir_type_int -> "int" - | Dir_type_string -> "string" - | Dir_type_null -> "null" - let prepare_pp_error loc = function | Unterminated_if -> Location.errorf ~loc "#if not terminated" | Unterminated_else -> Location.errorf ~loc "#else not terminated" - | Unexpected_directive -> Location.errorf ~loc "Unexpected directive" - | Unexpected_token_in_conditional -> - Location.errorf ~loc "Unexpected token in conditional predicate" - | Unterminated_paren_in_conditional -> - Location.errorf ~loc "Unterminated parens in conditional predicate" - | Expect_hash_then_in_conditional -> - Location.errorf ~loc "Expect `then` after conditional predicate" - | Conditional_expr_expected_type (a, b) -> - Location.errorf ~loc "Conditional expression type mismatch (%s,%s)" - (string_of_type_directive a) - (string_of_type_directive b) - | Illegal_semver s -> - Location.errorf ~loc "Illegal semantic version string %s" s let () = Location.register_error_of_exn (function | Pp_error (err, loc) -> Some (prepare_pp_error loc err) | _ -> None) -let assert_same_type lexbuf x y = - let lhs = type_of_directive x in - let rhs = type_of_directive y in - if lhs <> rhs then - raise - (Pp_error (Conditional_expr_expected_type (lhs, rhs), Location.curr lexbuf)) - else y - let directive_built_in_values = Hashtbl.create 51 let replace_directive_built_in_value k v = @@ -117,8 +67,6 @@ let () = replace_directive_built_in_value "OCAML_VERSION" (Dir_string version); replace_directive_built_in_value "OS_TYPE" (Dir_string Sys.os_type) -let find_directive_built_in_value k = Hashtbl.find directive_built_in_values k - let iter_directive_built_in_value f = Hashtbl.iter f directive_built_in_values (* let iter_directive_built_in_value f = Hashtbl.iter f directive_built_in_values *) @@ -134,26 +82,6 @@ let iter_directive_built_in_value f = Hashtbl.iter f directive_built_in_values - : int * int * int * string = (12, 3, 10, "+x") ]} *) -let zero = Char.code '0' - -let dot = Char.code '.' - -let semantic_version_parse str start last_index = - let rec aux start acc last_index = - if start <= last_index then - let c = Char.code (String.unsafe_get str start) in - if c = dot then (acc, start + 1) (* consume [4.] instead of [4]*) - else - let v = c - zero in - if v >= 0 && v <= 9 then aux (start + 1) ((acc * 10) + v) last_index - else (acc, start) - else (acc, start) - in - let major, major_end = aux start 0 last_index in - let minor, minor_end = aux major_end 0 last_index in - let patch, patch_end = aux minor_end 0 last_index in - let additional = String.sub str patch_end (last_index - patch_end + 1) in - ((major, minor, patch), additional) (** {[ @@ -165,38 +93,6 @@ let semantic_version_parse str start last_index = semver Location.none "1.2.3" "<=1.3.0" = true ;; ]} *) -let semver loc lhs str = - let last_index = String.length str - 1 in - if last_index < 0 then raise (Pp_error (Illegal_semver str, loc)) - else - let pred, (((major, minor, _patch) as version), _) = - let v = String.unsafe_get str 0 in - match v with - | '>' -> - if last_index = 0 then raise (Pp_error (Illegal_semver str, loc)) - else if String.unsafe_get str 1 = '=' then - (`Ge, semantic_version_parse str 2 last_index) - else (`Gt, semantic_version_parse str 1 last_index) - | '<' -> - if last_index = 0 then raise (Pp_error (Illegal_semver str, loc)) - else if String.unsafe_get str 1 = '=' then - (`Le, semantic_version_parse str 2 last_index) - else (`Lt, semantic_version_parse str 1 last_index) - | '^' -> (`Compatible, semantic_version_parse str 1 last_index) - | '~' -> (`Approximate, semantic_version_parse str 1 last_index) - | _ -> (`Exact, semantic_version_parse str 0 last_index) - in - let ((l_major, l_minor, _l_patch) as lversion), _ = - semantic_version_parse lhs 0 (String.length lhs - 1) - in - match pred with - | `Ge -> lversion >= version - | `Gt -> lversion > version - | `Le -> lversion <= version - | `Lt -> lversion < version - | `Approximate -> major = l_major && minor = l_minor - | `Compatible -> major = l_major - | `Exact -> lversion = version let pp_directive_value fmt (x : directive_value) = match x with @@ -210,30 +106,6 @@ let list_variables fmt = iter_directive_built_in_value (fun s dir_value -> Format.fprintf fmt "@[%s@ %a@]@." s pp_directive_value dir_value) -let defined str = - match find_directive_built_in_value str with - | Dir_null -> false - | _ -> true - | exception _ -> ( - try - ignore @@ Sys.getenv str; - true - with _ -> false) - -let query _loc str = - match find_directive_built_in_value str with - | Dir_null -> Dir_bool false - | v -> v - | exception Not_found -> ( - match Sys.getenv str with - | v -> ( - try Dir_bool (bool_of_string v) - with _ -> ( - try Dir_int (int_of_string v) - with _ -> ( - try Dir_float (float_of_string v) with _ -> Dir_string v))) - | exception Not_found -> Dir_bool false) - let define_key_value key v = if String.length key > 0 && Char.uppercase_ascii key.[0] = key.[0] then ( replace_directive_built_in_value key @@ -248,169 +120,8 @@ let define_key_value key v = true) else false -let cvt_int_literal s = -int_of_string ("-" ^ s) - -let value_of_token loc (t : Parser.token) = - match t with - | INT (i, None) -> Dir_int (cvt_int_literal i) - | STRING (s, _) -> Dir_string s - | FLOAT (s, None) -> Dir_float (float_of_string s) - | TRUE -> Dir_bool true - | FALSE -> Dir_bool false - | UIDENT s -> query loc s - | _ -> raise (Pp_error (Unexpected_token_in_conditional, loc)) - -let directive_parse (token_with_comments : Lexing.lexbuf -> Parser.token) lexbuf - = - let look_ahead = ref None in - let token () : Parser.token = - let v = !look_ahead in - match v with - | Some v -> - look_ahead := None; - v - | None -> - let rec skip () = - match token_with_comments lexbuf with - | COMMENT _ | DOCSTRING _ -> skip () - | EOF -> raise (Pp_error (Unterminated_if, Location.curr lexbuf)) - | t -> t - in - skip () - in - let push e = - (* INVARIANT: only look at most one token *) - assert (!look_ahead = None); - look_ahead := Some e - in - let rec token_op calc ~no lhs = - match token () with - | (LESS | GREATER | INFIXOP0 "<=" | INFIXOP0 ">=" | EQUAL | INFIXOP0 "<>") - as op -> - let f = - match op with - | LESS -> ( < ) - | GREATER -> ( > ) - | INFIXOP0 "<=" -> ( <= ) - | EQUAL -> ( = ) - | INFIXOP0 "<>" -> ( <> ) - | _ -> assert false - in - let curr_loc = Location.curr lexbuf in - let rhs = value_of_token curr_loc (token ()) in - (not calc) || f lhs (assert_same_type lexbuf lhs rhs) - | INFIXOP0 "=~" -> ( - (not calc) - || - match lhs with - | Dir_string s -> ( - let curr_loc = Location.curr lexbuf in - let rhs = value_of_token curr_loc (token ()) in - match rhs with - | Dir_string rhs -> semver curr_loc s rhs - | _ -> - raise - (Pp_error - ( Conditional_expr_expected_type - (Dir_type_string, type_of_directive lhs), - Location.curr lexbuf ))) - | _ -> - raise - (Pp_error - ( Conditional_expr_expected_type - (Dir_type_string, type_of_directive lhs), - Location.curr lexbuf ))) - | e -> no e - and parse_or calc : bool = parse_or_aux calc (parse_and calc) - and (* a || (b || (c || d))*) - parse_or_aux calc v : bool = - (* let l = v in *) - match token () with - | BARBAR -> - let b = parse_or (calc && not v) in - v || b - | e -> - push e; - v - and parse_and calc = parse_and_aux calc (parse_relation calc) - and parse_and_aux calc v = - (* a && (b && (c && d)) *) - (* let l = v in *) - match token () with - | AMPERAMPER -> - let b = parse_and (calc && v) in - v && b - | e -> - push e; - v - and parse_relation (calc : bool) : bool = - let curr_token = token () in - let curr_loc = Location.curr lexbuf in - match curr_token with - | TRUE -> true - | FALSE -> false - | UIDENT v -> - let value_v = query curr_loc v in - token_op calc - ~no:(fun e -> - push e; - match value_v with - | Dir_bool b -> b - | _ -> - let ty = type_of_directive value_v in - raise - (Pp_error - ( Conditional_expr_expected_type (Dir_type_bool, ty), - curr_loc ))) - value_v - | INT (v, None) -> - let num_v = cvt_int_literal v in - token_op calc - ~no:(fun e -> - push e; - num_v <> 0) - (Dir_int num_v) - | FLOAT (v, None) -> - token_op calc - ~no:(fun _e -> - raise - (Pp_error - ( Conditional_expr_expected_type (Dir_type_bool, Dir_type_float), - curr_loc ))) - (Dir_float (float_of_string v)) - | STRING (v, _) -> - token_op calc - ~no:(fun _e -> - raise - (Pp_error - ( Conditional_expr_expected_type - (Dir_type_bool, Dir_type_string), - curr_loc ))) - (Dir_string v) - | LIDENT (("defined" | "undefined") as r) -> ( - let t = token () in - let loc = Location.curr lexbuf in - match t with - | UIDENT s -> - (not calc) || if r.[0] = 'u' then not @@ defined s else defined s - | _ -> raise (Pp_error (Unexpected_token_in_conditional, loc))) - | LPAREN -> ( - let v = parse_or calc in - match token () with - | RPAREN -> v - | _ -> - raise - (Pp_error (Unterminated_paren_in_conditional, Location.curr lexbuf)) - ) - | _ -> raise (Pp_error (Unexpected_token_in_conditional, curr_loc)) - in - let v = parse_or true in - match token () with - | THEN | EOL -> v - | _ -> - raise (Pp_error (Expect_hash_then_in_conditional, Location.curr lexbuf)) -type dir_conditional = Dir_if_true | Dir_if_false | Dir_out +type dir_conditional = Dir_if_true | Dir_out (* let string_of_dir_conditional (x : dir_conditional) = *) (* match x with *) @@ -435,107 +146,6 @@ let at_bol lexbuf = let pos = Lexing.lexeme_start_p lexbuf in pos.pos_cnum = pos.pos_bol -(* skip to #else | #end | #elif *) -let rec skip_from_if_false (token_with_comments : Lexing.lexbuf -> Parser.token) - cont lexbuf = - let token = token_with_comments lexbuf in - if token = EOF then raise (Pp_error (Unterminated_if, Location.curr lexbuf)) - else if token = HASH && at_bol lexbuf then - let token = token_with_comments lexbuf in - match token with - | END | LIDENT "endif" -> - update_if_then_else Dir_out; - cont lexbuf - | ELSE -> - update_if_then_else Dir_if_false; - cont lexbuf - | IF -> raise (Pp_error (Unexpected_directive, Location.curr lexbuf)) - | LIDENT "elif" when directive_parse token_with_comments lexbuf -> - update_if_then_else Dir_if_true; - cont lexbuf - | _ -> skip_from_if_false token_with_comments cont lexbuf - else skip_from_if_false token_with_comments cont lexbuf - -let interpret_directive_cont lexbuf ~cont - ~(token_with_comments : Lexing.lexbuf -> Parser.token) look_ahead = - (* current state *) - let if_then_else = !if_then_else in - match (token_with_comments lexbuf, if_then_else) with - | IF, Dir_out -> - if directive_parse token_with_comments lexbuf then ( - update_if_then_else Dir_if_true (* Next state: ELSE *); - cont lexbuf) - else skip_from_if_false token_with_comments cont lexbuf - | LIDENT (("ifndef" | "ifdef") as s), Dir_out -> - let rec token () = - match token_with_comments lexbuf with - | COMMENT _ | DOCSTRING _ -> token () - | EOF -> raise (Pp_error (Unterminated_if, Location.curr lexbuf)) - | t -> t - in - let t0 = token () in - let t = - match t0 with - | UIDENT t -> t - | _ -> - raise - (Pp_error (Unexpected_token_in_conditional, Location.curr lexbuf)) - in - let t1 = token () in - (match t1 with - | THEN | EOL -> () - | _ -> - raise - (Pp_error (Expect_hash_then_in_conditional, Location.curr lexbuf))); - let boolean = defined t = (s = "ifdef") in - if boolean then ( - update_if_then_else Dir_if_true (* Next state: ELSE *); - cont lexbuf) - else skip_from_if_false token_with_comments cont lexbuf - | (IF | LIDENT "ifndef" | LIDENT "ifdef"), (Dir_if_false | Dir_if_true) -> - raise (Pp_error (Unexpected_directive, Location.curr lexbuf)) - | LIDENT "elif", (Dir_if_false | Dir_out) -> - (* when the predicate is false, it will continue eating `elif` *) - raise (Pp_error (Unexpected_directive, Location.curr lexbuf)) - | ((LIDENT "elif" | ELSE) as token), Dir_if_true -> - (* looking for #end, however, it can not see #if anymore, - we need do some validation *) - let rec skip_from_if_true else_seen = - let token = token_with_comments lexbuf in - if token = EOF then - raise (Pp_error (Unterminated_else, Location.curr lexbuf)) - else if token = HASH && at_bol lexbuf then - let token = token_with_comments lexbuf in - match token with - | END | LIDENT "endif" -> - update_if_then_else Dir_out; - cont lexbuf - | IF -> raise (Pp_error (Unexpected_directive, Location.curr lexbuf)) - | ELSE -> - if else_seen then - raise (Pp_error (Unexpected_directive, Location.curr lexbuf)) - else skip_from_if_true true - | LIDENT "elif" when else_seen -> - raise (Pp_error (Unexpected_directive, Location.curr lexbuf)) - | _ -> skip_from_if_true else_seen - else skip_from_if_true else_seen - in - skip_from_if_true (token = ELSE) - | ELSE, Dir_if_false | ELSE, Dir_out -> - raise (Pp_error (Unexpected_directive, Location.curr lexbuf)) - | (END | LIDENT "endif"), (Dir_if_false | Dir_if_true) -> - update_if_then_else Dir_out; - cont lexbuf - | (END | LIDENT "endif"), Dir_out -> - raise (Pp_error (Unexpected_directive, Location.curr lexbuf)) - | token, (Dir_if_true | Dir_if_false | Dir_out) -> look_ahead token - -let interpret_directive lexbuf ~cont ~token_with_comments : Parser.token = - interpret_directive_cont lexbuf ~cont ~token_with_comments - (fun (token : 'a) : 'a -> - sharp_look_ahead := Some token; - HASH) - let eof_check lexbuf = if !if_then_else <> Dir_out then if !if_then_else = Dir_if_true then @@ -545,28 +155,3 @@ let eof_check lexbuf = let init () = sharp_look_ahead := None; update_if_then_else Dir_out - -let check_sharp_look_ahead action : Parser.token = - match !sharp_look_ahead with - | None -> action () - | Some token -> - sharp_look_ahead := None; - token - -let rec filter_directive ~(token_with_comments : Lexing.lexbuf -> Parser.token) - pos acc lexbuf : (int * int) list = - match token_with_comments lexbuf with - | HASH when at_bol lexbuf -> - (* ^[start_pos]#if ... #then^[end_pos] *) - let start_pos = Lexing.lexeme_start lexbuf in - interpret_directive_cont lexbuf - ~cont:(fun lexbuf -> - filter_directive (Lexing.lexeme_end lexbuf) ~token_with_comments - ((pos, start_pos) :: acc) lexbuf) - ~token_with_comments - (fun _token -> filter_directive pos acc lexbuf ~token_with_comments) - | EOF -> (pos, Lexing.lexeme_end lexbuf) :: acc - | _ -> filter_directive ~token_with_comments pos acc lexbuf - -let filter_directive_from_lexbuf lexbuf ~token_with_comments = - List.rev (filter_directive 0 [] lexbuf ~token_with_comments) diff --git a/jscomp/ml/rescript_cpp.mli b/jscomp/ml/rescript_cpp.mli index 46fe63110c..6a72da92df 100644 --- a/jscomp/ml/rescript_cpp.mli +++ b/jscomp/ml/rescript_cpp.mli @@ -24,18 +24,11 @@ val at_bol : Lexing.lexbuf -> bool -val interpret_directive : - Lexing.lexbuf -> - cont:(Lexing.lexbuf -> Parser.token) -> - token_with_comments:(Lexing.lexbuf -> Parser.token) -> - Parser.token val eof_check : Lexing.lexbuf -> unit val init : unit -> unit -val check_sharp_look_ahead : (unit -> Parser.token) -> Parser.token - (* Methods below are used for cpp, they are not needed by the compiler patches*) val remove_directive_built_in_value : string -> unit @@ -47,8 +40,3 @@ val define_key_value : string -> string -> bool (** @return false means failed to define *) val list_variables : Format.formatter -> unit - -val filter_directive_from_lexbuf : - Lexing.lexbuf -> - token_with_comments:(Lexing.lexbuf -> Parser.token) -> - (int * int) list diff --git a/jscomp/ml/typetexp.ml b/jscomp/ml/typetexp.ml index fd97a71df9..4365194ea6 100644 --- a/jscomp/ml/typetexp.ml +++ b/jscomp/ml/typetexp.ml @@ -785,7 +785,7 @@ let report_error env ppf = function (* modified *) Format.fprintf ppf "@[This type constructor, `%a`, can't be found.@ " Printtyp.longident lid; let has_candidate = super_spellcheck ppf Env.fold_types env lid in - if !Config.syntax_kind = `rescript && not has_candidate then + if not has_candidate then Format.fprintf ppf "If you wanted to write a recursive type, don't forget the `rec` in `type rec`@]" | Unbound_type_constructor_2 p -> fprintf ppf "The type constructor@ %a@ is not yet completely defined" diff --git a/jscomp/ounit_tests/ounit_bsb_pkg_tests.ml b/jscomp/ounit_tests/ounit_bsb_pkg_tests.ml index c692fa79a7..eae14ca573 100644 --- a/jscomp/ounit_tests/ounit_bsb_pkg_tests.ml +++ b/jscomp/ounit_tests/ounit_bsb_pkg_tests.ml @@ -34,12 +34,12 @@ let s_test1 s a = let group0 = Map_string.of_list [ "Liba", - {Bsb_db.info = Impl_intf; dir= "a";syntax_kind=Ml;case = false; + {Bsb_db.info = Impl_intf; dir= "a";case = false; name_sans_extension = "liba"} ] let group1 = Map_string.of_list [ "Ciba", - {Bsb_db.info = Impl_intf; dir= "b";syntax_kind=Ml;case = false; + {Bsb_db.info = Impl_intf; dir= "b";case = false; name_sans_extension = "liba"} ] diff --git a/jscomp/ounit_tests/ounit_depends_format_test.ml b/jscomp/ounit_tests/ounit_depends_format_test.ml deleted file mode 100644 index bc7ed6f7e5..0000000000 --- a/jscomp/ounit_tests/ounit_depends_format_test.ml +++ /dev/null @@ -1,20 +0,0 @@ -let ((>::), - (>:::)) = OUnit.((>::),(>:::)) - -let (=~) (xs : string list) (ys : string list) = - OUnit.assert_equal xs ys - ~printer:(fun xs -> String.concat "," xs ) - -let f (x : string) = - let stru = Parse.implementation (Lexing.from_string x) in - Ast_extract.Set_string.elements (Ast_extract.read_parse_and_extract Ml_binary.Ml stru) - - -let suites = - __FILE__ - >::: [ - __LOC__ >:: begin fun _ -> - f {|module X = List|} =~ ["List"]; - f {|module X = List module X0 = List1|} =~ ["List";"List1"] - end - ] \ No newline at end of file diff --git a/jscomp/ounit_tests/ounit_tests_main.ml b/jscomp/ounit_tests/ounit_tests_main.ml index daa402ec07..5d4dc9fae8 100644 --- a/jscomp/ounit_tests/ounit_tests_main.ml +++ b/jscomp/ounit_tests/ounit_tests_main.ml @@ -21,7 +21,6 @@ let suites = Ounit_unicode_tests.suites; Ounit_bsb_regex_tests.suites; Ounit_bsb_pkg_tests.suites; - Ounit_depends_format_test.suites; Ounit_util_tests.suites; ] diff --git a/jscomp/syntax/benchmarks/Benchmark.ml b/jscomp/syntax/benchmarks/Benchmark.ml index 3afa9e88f5..0ed13031a3 100644 --- a/jscomp/syntax/benchmarks/Benchmark.ml +++ b/jscomp/syntax/benchmarks/Benchmark.ml @@ -186,17 +186,11 @@ end = struct | Print -> "printer" (* TODO: we could at Reason here *) - type lang = Ocaml | Rescript + type lang = Rescript let string_of_lang lang = match lang with - | Ocaml -> "ocaml" | Rescript -> "rescript" - let parse_ocaml src filename = - let lexbuf = Lexing.from_string src in - Location.init lexbuf filename; - Parse.implementation lexbuf - let parse_rescript src filename = let p = Parser.make src filename in let structure = ResParser.parse_implementation p in @@ -214,10 +208,6 @@ end = struct fun _ -> let _ = Sys.opaque_identity (parse_rescript src filename) in () - | Ocaml, Parse -> - fun _ -> - let _ = Sys.opaque_identity (parse_ocaml src filename) in - () | Rescript, Print -> let p = Parser.make src filename in let ast = ResParser.parse_implementation p in @@ -230,7 +220,6 @@ end = struct Doc.to_string ~width:80 (Printer.print_structure ast cmt_tbl)) in () - | _ -> fun _ -> () in let b = Benchmark.make ~name ~f:benchmark_fn () in Benchmark.launch b; @@ -239,16 +228,13 @@ end = struct let run () = let data_dir = "jscomp/syntax/benchmarks/data" in benchmark (Filename.concat data_dir "RedBlackTree.res") Rescript Parse; - benchmark (Filename.concat data_dir "RedBlackTree.ml") Ocaml Parse; benchmark (Filename.concat data_dir "RedBlackTree.res") Rescript Print; benchmark (Filename.concat data_dir "RedBlackTreeNoComments.res") Rescript Print; benchmark (Filename.concat data_dir "Napkinscript.res") Rescript Parse; - benchmark (Filename.concat data_dir "Napkinscript.ml") Ocaml Parse; benchmark (Filename.concat data_dir "Napkinscript.res") Rescript Print; benchmark (Filename.concat data_dir "HeroGraphic.res") Rescript Parse; - benchmark (Filename.concat data_dir "HeroGraphic.ml") Ocaml Parse; benchmark (Filename.concat data_dir "HeroGraphic.res") Rescript Print end diff --git a/jscomp/syntax/benchmarks/data/HeroGraphic.ml b/jscomp/syntax/benchmarks/data/HeroGraphic.ml deleted file mode 100644 index fd79c89436..0000000000 --- a/jscomp/syntax/benchmarks/data/HeroGraphic.ml +++ /dev/null @@ -1,8654 +0,0 @@ -;;[%raw {|require('./HeroGraphic.css')|}] -let make ?(width= "760") ?(height= "380") = - ((svg ~width:((width)) ~height:((height)) - ~view_box:(("0 0 758 381")) ~fill:(("none") - ) ~xmlns:(("http://www.w3.org/2000/svg") - ) - ~children:[((path - ~d:(("M78.8374 255.364H664.923C664.923 255.364 677.451 256.743 677.451 270.971C677.451 285.2 667.673 288.178 667.673 288.178H579.485C579.485 288.178 592.014 290.163 592.014 304.888C592.014 319.612 582.785 321.101 582.785 321.101H524.544C524.544 321.101 507.676 322.59 508.776 333.896C509.876 345.201 520.204 346.194 520.204 346.194H626.849C626.849 346.194 644.266 347.683 643.166 363.897C642.066 380.11 632.288 380.11 632.288 380.11H186.032C186.032 380.11 166.964 379.118 167.514 364.393C168.064 349.668 186.582 350.661 186.582 350.661H121.801C121.801 350.661 104.628 351.598 104.628 338.252C104.628 320.715 121.862 322.149 121.862 322.149H142.457C142.457 322.149 159.264 323.362 159.264 306.101C159.264 293.748 144.657 292.7 144.657 292.7H77.6151C77.6151 292.7 56.4084 290.439 56.4695 275.769C56.5918 260.879 66.3089 255.364 78.8374 255.364Z") - ) ~fill:(("#0B1627")) - ~children:[] ()) - [@JSX ]); - ((path ~opacity:(("0.57")) - ~d:(("M393.453 244.555C393.453 244.555 398.709 220.841 391.437 205.344C384.103 189.848 369.68 187.145 369.68 187.145C366.991 161.722 351.59 142.916 317.794 145.288C283.998 147.714 270.614 166.134 270.614 166.134C270.614 166.134 274.342 158.358 267.925 150.251C261.508 142.144 247.757 143.799 247.757 143.799C247.757 143.799 253.502 135.14 241.646 128.578C229.79 122.015 220.378 126.868 220.378 126.868C220.378 126.868 226.55 103.595 203.572 99.1834C180.593 94.7163 163.542 110.379 163.542 110.379C163.542 110.379 153.641 104.753 138.852 109.441C124.001 114.184 122.717 134.203 122.717 134.203C122.717 134.203 90.5713 118.541 55.675 137.457C31.5349 150.527 27.2569 178.377 26.9514 194.425C32.9406 207.495 40.152 215.547 40.152 215.547C31.5349 242.349 51.886 248.14 51.886 248.14H90.0824H358.496L393.453 244.555Z") - ) ~fill:(("#0D1522")) - ~children:[] ()) - [@JSX ]); - ((path ~class_name:(("HeroGraphic-cloudLeft") - ) ~opacity:(("0.7")) - ~d:(("M0.4885 96.7017H97.599C97.599 96.7017 99.0047 89.1463 88.6152 87.8779C88.6152 87.8779 87.393 74.4216 72.6644 69.6237C57.9359 64.8258 51.2133 72.2157 51.2133 72.2157C51.2133 72.2157 46.6909 67.3075 40.8239 68.0244C34.8958 68.7413 32.4513 75.5246 32.4513 75.5246C32.4513 75.5246 28.9677 73.3187 25.3009 75.1386C21.634 76.9585 21.8174 79.385 21.8174 79.385C21.8174 79.385 17.6005 78.4475 14.6059 78.282C11.6113 78.0615 -2.75056 78.999 0.4885 96.7017Z") - ) ~fill:(("white")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M326.044 228.066H250.141V241.246H326.044V228.066Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path ~opacity:(("0.6")) - ~d:(("M331.606 228.066H291.759V240.198H331.606V228.066Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M432.811 224.15H375.303V240.915H432.811V224.15Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M382.514 226.466H378.419V227.128H382.514V226.466Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M389.053 226.466H384.959V227.128H389.053V226.466Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M395.531 226.466H391.437V227.128H395.531V226.466Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M402.009 226.466H397.915V227.128H402.009V226.466Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M408.488 226.466H404.393V227.128H408.488V226.466Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M414.966 226.466H410.871V227.128H414.966V226.466Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M421.444 226.466H417.349V227.128H421.444V226.466Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M427.983 226.466H423.888V227.128H427.983V226.466Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M382.514 228.727H378.419V229.389H382.514V228.727Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M389.053 228.727H384.959V229.389H389.053V228.727Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M395.531 228.727H391.437V229.389H395.531V228.727Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M402.009 228.727H397.915V229.389H402.009V228.727Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M408.488 228.727H404.393V229.389H408.488V228.727Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M414.966 228.727H410.871V229.389H414.966V228.727Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M421.444 228.727H417.349V229.389H421.444V228.727Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M427.983 228.727H423.888V229.389H427.983V228.727Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M382.514 230.988H378.419V231.65H382.514V230.988Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M389.053 230.988H384.959V231.65H389.053V230.988Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M395.531 230.988H391.437V231.65H395.531V230.988Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M402.009 230.988H397.915V231.65H402.009V230.988Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M408.488 230.988H404.393V231.65H408.488V230.988Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M414.966 230.988H410.871V231.65H414.966V230.988Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M421.444 230.988H417.349V231.65H421.444V230.988Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M427.983 230.988H423.888V231.65H427.983V230.988Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M382.514 233.25H378.419V233.911H382.514V233.25Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M389.053 233.25H384.959V233.911H389.053V233.25Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M395.531 233.25H391.437V233.911H395.531V233.25Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M402.009 233.25H397.915V233.911H402.009V233.25Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M408.488 233.25H404.393V233.911H408.488V233.25Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M414.966 233.25H410.871V233.911H414.966V233.25Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M421.444 233.25H417.349V233.911H421.444V233.25Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M427.983 233.25H423.888V233.911H427.983V233.25Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M382.514 235.511H378.419V236.172H382.514V235.511Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M389.053 235.511H384.959V236.172H389.053V235.511Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M395.531 235.511H391.437V236.172H395.531V235.511Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M402.009 235.511H397.915V236.172H402.009V235.511Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M408.488 235.511H404.393V236.172H408.488V235.511Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M414.966 235.511H410.871V236.172H414.966V235.511Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M421.444 235.511H417.349V236.172H421.444V235.511Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M427.983 235.511H423.888V236.172H427.983V235.511Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M378.969 224.15H375.303V240.915H378.969V224.15Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M178.087 221.999H171.181V225.032H178.087V221.999Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M186.826 221.999H179.92V225.032H186.826V221.999Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M195.566 221.999H188.66V225.032H195.566V221.999Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M178.087 226.411H171.181V229.444H178.087V226.411Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M186.826 226.411H179.92V229.444H186.826V226.411Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M195.566 226.411H188.66V229.444H195.566V226.411Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M160.914 230.933H112.206V244.555H160.914V230.933Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M117.4 220.234H115.689V221.779H117.4V220.234Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M122.412 220.234H120.701V221.779H122.412V220.234Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M127.362 220.234H125.651V221.779H127.362V220.234Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M132.312 220.234H130.601V221.779H132.312V220.234Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M137.263 220.234H135.551V221.779H137.263V220.234Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M142.274 220.234H140.563V221.779H142.274V220.234Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M147.224 220.234H145.513V221.779H147.224V220.234Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M152.174 220.234H150.463V221.779H152.174V220.234Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M157.125 220.234H155.413V221.779H157.125V220.234Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M117.4 223.819H115.689V225.363H117.4V223.819Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M122.412 223.819H120.701V225.363H122.412V223.819Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M127.362 223.819H125.651V225.363H127.362V223.819Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M132.312 223.819H130.601V225.363H132.312V223.819Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M137.263 223.819H135.551V225.363H137.263V223.819Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M142.274 223.819H140.563V225.363H142.274V223.819Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M147.224 223.819H145.513V225.363H147.224V223.819Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M152.174 223.819H150.463V225.363H152.174V223.819Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M157.125 223.819H155.413V225.363H157.125V223.819Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M117.4 227.459H115.689V229.003H117.4V227.459Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M122.412 227.459H120.701V229.003H122.412V227.459Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M127.362 227.459H125.651V229.003H127.362V227.459Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M132.312 227.459H130.601V229.003H132.312V227.459Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M137.263 227.459H135.551V229.003H137.263V227.459Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M142.274 227.459H140.563V229.003H142.274V227.459Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M147.224 227.459H145.513V229.003H147.224V227.459Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M152.174 227.459H150.463V229.003H152.174V227.459Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M157.125 227.459H155.413V229.003H157.125V227.459Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~class_name:(("HeroGraphic-wave")) - ~d:(("M81.5264 248.14H667.612C667.612 248.14 680.14 249.518 680.14 263.747C680.14 277.975 670.362 280.953 670.362 280.953H582.174C582.174 280.953 594.703 282.939 594.703 297.663C594.703 312.388 585.474 313.877 585.474 313.877H527.233C527.233 313.877 510.365 315.366 511.465 326.671C512.565 337.977 522.893 338.969 522.893 338.969H629.538C629.538 338.969 646.955 340.458 645.855 356.672C644.755 372.886 634.977 372.886 634.977 372.886H188.721C188.721 372.886 169.653 371.893 170.203 357.168C170.753 342.444 189.271 343.436 189.271 343.436H124.49C124.49 343.436 107.317 344.374 107.317 331.028C107.317 313.491 124.551 314.925 124.551 314.925H145.146C145.146 314.925 161.953 316.138 161.953 298.876C161.953 286.523 147.346 285.475 147.346 285.475H80.3041C80.3041 285.475 59.0975 283.214 59.1586 268.545C59.2808 253.655 68.998 248.14 81.5264 248.14Z") - ) ~fill:(("url(#paint0_linear)") - ) ~fill_opacity:(("0.7") - ) ~children:[] ()) - [@JSX ]); - ((path ~opacity:(("0.66")) - ~d:(("M112.206 248.14V285.365H147.408C147.408 285.365 151.869 285.696 155.841 288.067H160.914V274.39L169.592 269.923V268.655H181.998H199.477V264.464H201.066V273.949L205.527 274.28V284.979V285.641H203.571V287.35H228.751H252.096V285.641H250.141V284.979V277.424L265.419 278.527H274.831V264.298H279.048V273.674H291.393V286.799H291.82V298.38V299.704H297.26V303.013H300.804V312.002H301.904V303.013H303.31V312.002H304.41V303.013H318.222V312.002H319.322V303.013H320.727V312.002H321.828V303.013H326.228V299.704H331.667V298.38V286.799H341.812V273.839H354.707V273.949H354.89V287.24H390.948V282.497H396.265V290.935H401.948V306.763L405.798 306.983L406.349 307.038L412.582 307.424H412.704L414.966 307.59L415.821 307.645L417.349 307.755L418.205 307.81L419.733 307.921L420.588 307.976L425.233 308.252V304.998H432.933V278.747H439.472L445.034 282.938V293.692H475.285V276.155H508.47V287.295H544.528V282.552H550.639V294.575V295.126H559.806V295.568V297.222H564.757V304.722H566.529V297.167H569.707V295.512V295.071H571.418V308.362H592.319C593.725 305.935 594.703 302.516 594.703 297.608C594.703 282.883 582.174 280.898 582.174 280.898H635.894V248.085H112.206V248.14Z") - ) ~fill:(("#0D1522")) - ~children:[] ()) - [@JSX ]); - ((path ~opacity:(("0.5")) - ~d:(("M125.712 326.34V326.782H126.14V326.34H129.073L130.54 339.19V339.025L131.885 326.34H134.879L136.346 339.19L137.69 326.34H140.379V326.782H140.929V326.34H141.235V326.23H140.929V321.984H144.169V314.87H124.673C124.673 314.87 123.817 314.814 122.412 314.87V321.929H125.773V326.175V326.34H125.712ZM138.118 321.929H140.379V326.175H137.69L138.118 321.929ZM132.312 321.929H134.329L134.818 326.175H131.823L132.312 321.929ZM126.079 321.929H128.523L129.012 326.175H126.14V321.929H126.079Z") - ) ~fill:(("#0D1522")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M552.717 270.806C552.717 272.57 551.128 274.06 549.111 274.06H480.358C478.402 274.06 476.752 272.626 476.752 270.806C476.752 269.041 478.341 267.552 480.358 267.552H549.173C551.128 267.552 552.717 269.041 552.717 270.806Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M165.008 261.1C165.008 262.313 163.97 263.25 162.625 263.25H153.458C152.113 263.25 151.074 262.313 151.074 261.1C151.074 259.886 152.113 258.949 153.458 258.949H162.625C163.97 258.949 165.008 259.941 165.008 261.1Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M226.673 263.25C226.673 264.464 225.634 265.401 224.289 265.401H192.449C191.104 265.401 190.065 264.464 190.065 263.25C190.065 262.037 191.104 261.1 192.449 261.1H224.289C225.573 261.1 226.673 262.092 226.673 263.25Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M376.036 297.553C376.036 298.27 375.425 298.821 374.63 298.821H361.613C360.819 298.821 360.207 298.27 360.207 297.553C360.207 296.836 360.819 296.284 361.613 296.284H374.63C375.425 296.284 376.036 296.836 376.036 297.553Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path ~class_name:(("HeroGraphic-wave")) - ~d:(("M391.681 296.836C391.681 295.733 392.659 294.85 393.881 294.85H479.747C480.969 294.85 481.947 295.733 481.947 296.836C481.947 297.939 480.969 298.821 479.747 298.821H393.881C392.659 298.766 391.681 297.884 391.681 296.836Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M208.4 296.174C208.4 296.891 207.727 297.498 206.933 297.498H194.343C193.549 297.498 192.877 296.891 192.877 296.174C192.877 295.457 193.549 294.85 194.343 294.85H206.872C207.727 294.85 208.4 295.457 208.4 296.174Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path ~class_name:(("HeroGraphic-wave")) - ~d:(("M309.788 324.631C309.788 326.009 308.566 327.168 306.977 327.168H236.634C235.106 327.168 233.823 326.065 233.823 324.631C233.823 323.252 235.045 322.094 236.634 322.094H307.038C308.505 322.094 309.788 323.252 309.788 324.631Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M372.186 328.932C372.186 329.925 371.269 330.752 370.169 330.752H355.074C353.974 330.752 353.057 329.925 353.057 328.932C353.057 327.94 353.974 327.112 355.074 327.112H370.169C371.33 327.112 372.186 327.94 372.186 328.932Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M537.255 360.863C537.255 360.477 537.622 360.146 538.05 360.146H551.984C552.412 360.146 552.778 360.477 552.778 360.863C552.778 361.249 552.412 361.58 551.984 361.58H538.05C537.561 361.58 537.255 361.249 537.255 360.863Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M224.656 359.816C224.656 358.823 223.739 357.996 222.639 357.996H212.678C211.578 357.996 210.661 358.823 210.661 359.816C210.661 360.808 211.578 361.635 212.678 361.635H222.639C223.8 361.58 224.656 360.753 224.656 359.816Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M151.136 332.517C151.136 331.524 150.219 330.697 149.119 330.697H141.968C140.868 330.697 139.952 331.524 139.952 332.517C139.952 333.51 140.868 334.337 141.968 334.337H149.119C150.219 334.337 151.136 333.51 151.136 332.517Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path ~opacity:(("0.6")) - ~d:(("M250.202 228.066H205.649V241.246H250.202V228.066Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M630.149 117.052H611.326V120.802H630.149V117.052Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M630.149 119.588H611.326V120.857H630.149V119.588Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path ~opacity:(("0.6")) - ~d:(("M199.538 230.933H160.914V240.529H199.538V230.933Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M339.795 222.606H337.473V224.702H339.795V222.606Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M345.234 222.606H342.912V224.702H345.234V222.606Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M350.673 222.606H348.351V224.702H350.673V222.606Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M356.052 222.606H353.79V224.702H356.052V222.606Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M361.552 222.606H359.229V224.702H361.552V222.606Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M366.991 222.606H364.669V224.702H366.991V222.606Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M372.43 222.606H370.108V224.702H372.43V222.606Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M480.175 221.007H478.769V222.661H480.175V221.007Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M483.536 221.007H482.13V222.661H483.536V221.007Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M486.836 221.007H485.43V222.661H486.836V221.007Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M490.197 221.007H488.792V222.661H490.197V221.007Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M493.497 221.007H492.092V222.661H493.497V221.007Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M496.859 221.007H495.453V222.661H496.859V221.007Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M500.22 221.007H498.814V222.661H500.22V221.007Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M503.337 221.007H501.931V222.661H503.337V221.007Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M507.493 221.007H506.087V222.661H507.493V221.007Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M480.175 224.26H478.769V225.915H480.175V224.26Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M483.536 224.26H482.13V225.915H483.536V224.26Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M486.836 224.26H485.43V225.915H486.836V224.26Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M490.197 224.26H488.792V225.915H490.197V224.26Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M493.497 224.26H492.092V225.915H493.497V224.26Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M496.859 224.26H495.453V225.915H496.859V224.26Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M500.22 224.26H498.814V225.915H500.22V224.26Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M503.337 224.26H501.931V225.915H503.337V224.26Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M507.493 224.26H506.087V225.915H507.493V224.26Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M480.175 227.569H478.769V229.224H480.175V227.569Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M483.536 227.569H482.13V229.224H483.536V227.569Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M486.836 227.569H485.43V229.224H486.836V227.569Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M490.197 227.569H488.792V229.224H490.197V227.569Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M493.497 227.569H492.092V229.224H493.497V227.569Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M496.859 227.569H495.453V229.224H496.859V227.569Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M500.22 227.569H498.814V229.224H500.22V227.569Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M503.337 227.569H501.931V229.224H503.337V227.569Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M507.493 227.569H506.087V229.224H507.493V227.569Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M480.175 230.878H478.769V232.533H480.175V230.878Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M483.536 230.878H482.13V232.533H483.536V230.878Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M486.836 230.878H485.43V232.533H486.836V230.878Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M490.197 230.878H488.792V232.533H490.197V230.878Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M493.497 230.878H492.092V232.533H493.497V230.878Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M496.859 230.878H495.453V232.533H496.859V230.878Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M500.22 230.878H498.814V232.533H500.22V230.878Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M503.337 230.878H501.931V232.533H503.337V230.878Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M507.493 230.878H506.087V232.533H507.493V230.878Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M480.175 234.132H478.769V235.786H480.175V234.132Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M483.536 234.132H482.13V235.786H483.536V234.132Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M486.836 234.132H485.43V235.786H486.836V234.132Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M490.197 234.132H488.792V235.786H490.197V234.132Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M493.497 234.132H492.092V235.786H493.497V234.132Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M496.859 234.132H495.453V235.786H496.859V234.132Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M500.22 234.132H498.814V235.786H500.22V234.132Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M503.337 234.132H501.931V235.786H503.337V234.132Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M507.493 234.132H506.087V235.786H507.493V234.132Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M339.795 228.01H337.473V230.106H339.795V228.01Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M345.234 228.01H342.912V230.106H345.234V228.01Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M350.673 228.01H348.351V230.106H350.673V228.01Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M356.052 228.01H353.79V230.106H356.052V228.01Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M361.552 228.01H359.229V230.106H361.552V228.01Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M366.991 228.01H364.669V230.106H366.991V228.01Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M372.43 228.01H370.108V230.106H372.43V228.01Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M267.925 236.228H266.519V237.496H267.925V236.228Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M271.286 236.228H269.88V237.496H271.286V236.228Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M274.586 236.228H273.181V237.496H274.586V236.228Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M277.886 236.228H276.481V237.496H277.886V236.228Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M281.187 236.228H279.781V237.496H281.187V236.228Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M284.487 236.228H283.081V237.496H284.487V236.228Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M287.787 236.228H286.381V237.496H287.787V236.228Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~opacity:(("0.6")) - ~d:(("M375.303 228.066H334.173V240.253H375.303V228.066Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path ~opacity:(("0.3")) - ~d:(("M432.811 228.066H375.303V240.253H432.811V228.066Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M444.362 220.4H434.767V223.819H444.362V220.4Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M454.69 220.4H445.095V223.819H454.69V220.4Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M464.957 220.4H455.362V223.819H464.957V220.4Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M475.224 220.4H465.629V223.819H475.224V220.4Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M444.362 224.536H434.767V227.955H444.362V224.536Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M454.69 224.536H445.095V227.955H454.69V224.536Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M464.957 224.536H455.362V227.955H464.957V224.536Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M475.224 224.536H465.629V227.955H475.224V224.536Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M444.362 228.672H434.767V232.091H444.362V228.672Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M454.69 228.672H445.095V232.091H454.69V228.672Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M464.957 228.672H455.362V232.091H464.957V228.672Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M475.224 228.672H465.629V232.091H475.224V228.672Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M444.362 231.54H434.767V234.959H444.362V231.54Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M454.69 231.54H445.095V234.959H454.69V231.54Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M464.957 231.54H455.362V234.959H464.957V231.54Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M475.224 231.54H465.629V234.959H475.224V231.54Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~opacity:(("0.3")) - ~d:(("M476.141 228.01H432.628V241.081H476.141V228.01Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path ~opacity:(("0.6")) - ~d:(("M509.998 230.713H476.08V240.474H509.998V230.713Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path ~opacity:(("0.4")) - ~d:(("M548.867 230.713H514.949V240.474H548.867V230.713Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path ~opacity:(("0.7")) - ~d:(("M603.809 230.713H578.569V240.474H603.809V230.713Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M128.401 75.3592L130.479 36.0934L132.374 75.3592H128.401Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M130.477 36.4794V36.0934L128.461 75.3592H128.95C129.744 75.1386 130.539 74.8628 130.539 74.8628V36.4794H130.477Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M134.207 75.3592L136.285 36.0934L138.179 75.3592H134.207Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M136.283 36.4794V36.0934L134.266 75.3592H134.755C135.55 75.1386 136.344 74.8628 136.344 74.8628V36.4794H136.283Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M126.14 62.8405H125.712V73.7599H126.14V62.8405Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M140.868 62.8405H140.318V73.7599H140.868V62.8405Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M141.174 63.778H125.712V64.0538H141.174V63.778Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M144.107 73.3187H122.351V105.801H144.107V73.3187Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M125.284 75.3592H124.001V76.5173H125.284V75.3592Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M128.157 75.3592H126.873V76.5173H128.157V75.3592Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M130.968 75.3592H129.684V76.5173H130.968V75.3592Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M133.84 75.3592H132.557V76.5173H133.84V75.3592Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M136.713 75.3592H135.429V76.5173H136.713V75.3592Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M139.585 75.3592H138.302V76.5173H139.585V75.3592Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M142.457 75.3592H141.174V76.5173H142.457V75.3592Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M125.284 77.2343H124.001V78.3924H125.284V77.2343Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M128.157 77.2343H126.873V78.3924H128.157V77.2343Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M130.968 77.2343H129.684V78.3924H130.968V77.2343Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M133.84 77.2343H132.557V78.3924H133.84V77.2343Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M136.713 77.2343H135.429V78.3924H136.713V77.2343Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M139.585 77.2343H138.302V78.3924H139.585V77.2343Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M142.457 77.2343H141.174V78.3924H142.457V77.2343Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M124.612 79.2747H124.001V79.8262H124.612V79.2747Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M127.118 79.2747H126.506V79.8262H127.118V79.2747Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M129.684 79.2747H129.073V79.8262H129.684V79.2747Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M132.251 79.2747H131.64V79.8262H132.251V79.2747Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M134.757 79.2747H134.146V79.8262H134.757V79.2747Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M137.324 79.2747H136.712V79.8262H137.324V79.2747Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M139.891 79.2747H139.279V79.8262H139.891V79.2747Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M142.396 79.2747H141.785V79.8262H142.396V79.2747Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M124.612 81.7564H124.001V82.3079H124.612V81.7564Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M127.118 81.7564H126.506V82.3079H127.118V81.7564Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M129.684 81.7564H129.073V82.3079H129.684V81.7564Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M132.251 81.7564H131.64V82.3079H132.251V81.7564Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M134.757 81.7564H134.146V82.3079H134.757V81.7564Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M137.324 81.7564H136.712V82.3079H137.324V81.7564Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M139.891 81.7564H139.279V82.3079H139.891V81.7564Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M142.396 81.7564H141.785V82.3079H142.396V81.7564Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M124.612 84.2381H124.001V84.7896H124.612V84.2381Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M127.118 84.2381H126.506V84.7896H127.118V84.2381Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M129.684 84.2381H129.073V84.7896H129.684V84.2381Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M132.251 84.2381H131.64V84.7896H132.251V84.2381Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M134.757 84.2381H134.146V84.7896H134.757V84.2381Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M137.324 84.2381H136.712V84.7896H137.324V84.2381Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M139.891 84.2381H139.279V84.7896H139.891V84.2381Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M142.396 84.2381H141.785V84.7896H142.396V84.2381Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M124.612 86.6647H124.001V87.2162H124.612V86.6647Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M127.118 86.6647H126.506V87.2162H127.118V86.6647Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M129.684 86.6647H129.073V87.2162H129.684V86.6647Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M132.251 86.6647H131.64V87.2162H132.251V86.6647Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M134.757 86.6647H134.146V87.2162H134.757V86.6647Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M137.324 86.6647H136.712V87.2162H137.324V86.6647Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M139.891 86.6647H139.279V87.2162H139.891V86.6647Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M142.396 86.6647H141.785V87.2162H142.396V86.6647Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M124.612 89.1464H124.001V89.6978H124.612V89.1464Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M127.118 89.1464H126.506V89.6978H127.118V89.1464Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M129.684 89.1464H129.073V89.6978H129.684V89.1464Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M132.251 89.1464H131.64V89.6978H132.251V89.1464Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M134.757 89.1464H134.146V89.6978H134.757V89.1464Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M137.324 89.1464H136.712V89.6978H137.324V89.1464Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M139.891 89.1464H139.279V89.6978H139.891V89.1464Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M142.396 89.1464H141.785V89.6978H142.396V89.1464Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M124.612 91.628H124.001V92.1795H124.612V91.628Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M127.118 91.628H126.506V92.1795H127.118V91.628Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M129.684 91.628H129.073V92.1795H129.684V91.628Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M132.251 91.628H131.64V92.1795H132.251V91.628Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M134.757 91.628H134.146V92.1795H134.757V91.628Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M137.324 91.628H136.712V92.1795H137.324V91.628Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M139.891 91.628H139.279V92.1795H139.891V91.628Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M142.396 91.628H141.785V92.1795H142.396V91.628Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M124.612 94.1097H124.001V94.6612H124.612V94.1097Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M127.118 94.1097H126.506V94.6612H127.118V94.1097Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M129.684 94.1097H129.073V94.6612H129.684V94.1097Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M132.251 94.1097H131.64V94.6612H132.251V94.1097Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M134.757 94.1097H134.146V94.6612H134.757V94.1097Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M137.324 94.1097H136.712V94.6612H137.324V94.1097Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M139.891 94.1097H139.279V94.6612H139.891V94.1097Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M142.396 94.1097H141.785V94.6612H142.396V94.1097Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M124.612 96.5914H124.001V97.1429H124.612V96.5914Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M127.118 96.5914H126.506V97.1429H127.118V96.5914Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M129.684 96.5914H129.073V97.1429H129.684V96.5914Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M132.251 96.5914H131.64V97.1429H132.251V96.5914Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M134.757 96.5914H134.146V97.1429H134.757V96.5914Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M137.324 96.5914H136.712V97.1429H137.324V96.5914Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M139.891 96.5914H139.279V97.1429H139.891V96.5914Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M142.396 96.5914H141.785V97.1429H142.396V96.5914Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M124.612 99.0731H124.001V99.6246H124.612V99.0731Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M127.118 99.0731H126.506V99.6246H127.118V99.0731Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M129.684 99.0731H129.073V99.6246H129.684V99.0731Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M132.251 99.0731H131.64V99.6246H132.251V99.0731Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M134.757 99.0731H134.146V99.6246H134.757V99.0731Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M137.324 99.0731H136.712V99.6246H137.324V99.0731Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M139.891 99.0731H139.279V99.6246H139.891V99.0731Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M142.396 99.0731H141.785V99.6246H142.396V99.0731Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M124.612 101.279H124.001V101.831H124.612V101.279Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M127.118 101.279H126.506V101.831H127.118V101.279Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M129.684 101.279H129.073V101.831H129.684V101.279Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M132.251 101.279H131.64V101.831H132.251V101.279Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M134.757 101.279H134.146V101.831H134.757V101.279Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M137.324 101.279H136.712V101.831H137.324V101.279Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M139.891 101.279H139.279V101.831H139.891V101.279Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M142.396 101.279H141.785V101.831H142.396V101.279Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M144.107 99.1833H122.351V105.746H144.107V99.1833Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M301.904 94.7715H300.804V115.618H301.904V94.7715Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M304.349 94.7715H303.249V115.618H304.349V94.7715Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M319.261 94.7715H318.161V115.618H319.261V94.7715Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M321.766 94.7715H320.666V115.618H321.766V94.7715Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M326.167 114.184H297.26V121.353H326.167V114.184Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M323.722 119.588H299.521V120.305H323.722V119.588Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M139.707 197.348H201.066V176.833L265.419 167.016H274.831V197.789H278.987V177.494H291.332V149.148H341.751V177.053H354.829V148.1H390.887V158.358H400.787L408.671 169.718V178.818H417.777V166.575H458.54V240.143H133.535L139.707 197.348Z") - ) ~fill:(("#21477C")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M293.287 197.348H354.646V176.833L418.999 167.016H428.411V197.789H432.567V177.494L444.912 157.586V134.203H475.163V172.035H508.409V148.1H544.467V158.358H554.306L562.251 169.718V178.818H571.357V102.492H612.976V240.143H287.115L293.287 197.348Z") - ) ~fill:(("#1B3B68")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M425.172 241.522H401.887V106.077L425.172 102.878V241.522Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M401.887 140.269H396.204V241.522H401.887V140.269Z") - ) ~fill:(("#1073AA")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M432.872 109.937H425.172V241.522H432.872V109.937Z") - ) ~fill:(("#1073AA")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M406.226 105.47L405.371 105.581V121.298H406.226V105.47Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M410.993 104.809L410.138 104.919V121.298H410.993V104.809Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M408.61 105.139L407.754 105.25V121.298H408.61V105.139Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M413.377 104.478L412.46 104.588V121.298H413.377V104.478Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M415.76 104.147L414.844 104.257V121.298H415.76V104.147Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M419.61 103.595V121.298H420.527V103.485L419.61 103.595Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M418.144 103.816L417.227 103.926V121.298H418.144V103.816Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M406.043 128.081H403.415V129.129H406.043V128.081Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M409.588 128.081H406.96V129.129H409.588V128.081Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M413.132 128.081H410.504V129.129H413.132V128.081Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M416.677 128.081H414.049V129.129H416.677V128.081Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M420.222 128.081H417.594V129.129H420.222V128.081Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M423.766 128.081H421.138V129.129H423.766V128.081Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M406.043 130.453H403.415V131.501H406.043V130.453Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M409.588 130.453H406.96V131.501H409.588V130.453Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M413.132 130.453H410.504V131.501H413.132V130.453Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M416.677 130.453H414.049V131.501H416.677V130.453Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M420.222 130.453H417.594V131.501H420.222V130.453Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M423.766 130.453H421.138V131.501H423.766V130.453Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M406.043 132.824H403.415V133.872H406.043V132.824Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M409.588 132.824H406.96V133.872H409.588V132.824Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M413.132 132.824H410.504V133.872H413.132V132.824Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M416.677 132.824H414.049V133.872H416.677V132.824Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M420.222 132.824H417.594V133.872H420.222V132.824Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M423.766 132.824H421.138V133.872H423.766V132.824Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M406.043 135.14H403.415V136.188H406.043V135.14Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M409.588 135.14H406.96V136.188H409.588V135.14Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M413.132 135.14H410.504V136.188H413.132V135.14Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M416.677 135.14H414.049V136.188H416.677V135.14Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M420.222 135.14H417.594V136.188H420.222V135.14Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M423.766 135.14H421.138V136.188H423.766V135.14Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M406.043 137.512H403.415V138.56H406.043V137.512Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M409.588 137.512H406.96V138.56H409.588V137.512Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M413.132 137.512H410.504V138.56H413.132V137.512Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M416.677 137.512H414.049V138.56H416.677V137.512Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M420.222 137.512H417.594V138.56H420.222V137.512Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M423.766 137.512H421.138V138.56H423.766V137.512Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M406.043 139.828H403.415V140.876H406.043V139.828Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M409.588 139.828H406.96V140.876H409.588V139.828Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M413.132 139.828H410.504V140.876H413.132V139.828Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M416.677 139.828H414.049V140.876H416.677V139.828Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M420.222 139.828H417.594V140.876H420.222V139.828Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M423.766 139.828H421.138V140.876H423.766V139.828Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M406.043 142.199H403.415V143.247H406.043V142.199Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M409.588 142.199H406.96V143.247H409.588V142.199Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M413.132 142.199H410.504V143.247H413.132V142.199Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M416.677 142.199H414.049V143.247H416.677V142.199Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M420.222 142.199H417.594V143.247H420.222V142.199Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M423.766 142.199H421.138V143.247H423.766V142.199Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M406.043 144.571H403.415V145.619H406.043V144.571Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M409.588 144.571H406.96V145.619H409.588V144.571Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M413.132 144.571H410.504V145.619H413.132V144.571Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M416.677 144.571H414.049V145.619H416.677V144.571Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M420.222 144.571H417.594V145.619H420.222V144.571Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M423.766 144.571H421.138V145.619H423.766V144.571Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M406.043 146.887H403.415V147.935H406.043V146.887Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M409.588 146.887H406.96V147.935H409.588V146.887Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M413.132 146.887H410.504V147.935H413.132V146.887Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M416.677 146.887H414.049V147.935H416.677V146.887Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M420.222 146.887H417.594V147.935H420.222V146.887Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M423.766 146.887H421.138V147.935H423.766V146.887Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M406.043 149.258H403.415V150.306H406.043V149.258Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M409.588 149.258H406.96V150.306H409.588V149.258Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M413.132 149.258H410.504V150.306H413.132V149.258Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M416.677 149.258H414.049V150.306H416.677V149.258Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M420.222 149.258H417.594V150.306H420.222V149.258Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M423.766 149.258H421.138V150.306H423.766V149.258Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M406.043 151.575H403.415V152.622H406.043V151.575Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M409.588 151.575H406.96V152.622H409.588V151.575Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M413.132 151.575H410.504V152.622H413.132V151.575Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M416.677 151.575H414.049V152.622H416.677V151.575Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M420.222 151.575H417.594V152.622H420.222V151.575Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M423.766 151.575H421.138V152.622H423.766V151.575Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M406.043 153.946H403.415V154.994H406.043V153.946Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M409.588 153.946H406.96V154.994H409.588V153.946Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M413.132 153.946H410.504V154.994H413.132V153.946Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M416.677 153.946H414.049V154.994H416.677V153.946Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M420.222 153.946H417.594V154.994H420.222V153.946Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M423.766 153.946H421.138V154.994H423.766V153.946Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M406.043 163.321H403.415V164.369H406.043V163.321Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M409.588 163.321H406.96V164.369H409.588V163.321Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M413.132 163.321H410.504V164.369H413.132V163.321Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M416.677 163.321H414.049V164.369H416.677V163.321Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M420.222 163.321H417.594V164.369H420.222V163.321Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M423.766 163.321H421.138V164.369H423.766V163.321Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M406.043 165.693H403.415V166.74H406.043V165.693Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M409.588 165.693H406.96V166.74H409.588V165.693Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M413.132 165.693H410.504V166.74H413.132V165.693Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M416.677 165.693H414.049V166.74H416.677V165.693Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M420.222 165.693H417.594V166.74H420.222V165.693Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M423.766 165.693H421.138V166.74H423.766V165.693Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M406.043 168.064H403.415V169.112H406.043V168.064Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M409.588 168.064H406.96V169.112H409.588V168.064Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M413.132 168.064H410.504V169.112H413.132V168.064Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M416.677 168.064H414.049V169.112H416.677V168.064Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M420.222 168.064H417.594V169.112H420.222V168.064Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M423.766 168.064H421.138V169.112H423.766V168.064Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M406.043 170.38H403.415V171.428H406.043V170.38Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M409.588 170.38H406.96V171.428H409.588V170.38Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M413.132 170.38H410.504V171.428H413.132V170.38Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M416.677 170.38H414.049V171.428H416.677V170.38Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M420.222 170.38H417.594V171.428H420.222V170.38Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M423.766 170.38H421.138V171.428H423.766V170.38Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M406.043 172.752H403.415V173.799H406.043V172.752Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M409.588 172.752H406.96V173.799H409.588V172.752Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M413.132 172.752H410.504V173.799H413.132V172.752Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M416.677 172.752H414.049V173.799H416.677V172.752Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M420.222 172.752H417.594V173.799H420.222V172.752Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M423.766 172.752H421.138V173.799H423.766V172.752Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M406.043 175.068H403.415V176.116H406.043V175.068Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M409.588 175.068H406.96V176.116H409.588V175.068Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M413.132 175.068H410.504V176.116H413.132V175.068Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M416.677 175.068H414.049V176.116H416.677V175.068Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M420.222 175.068H417.594V176.116H420.222V175.068Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M423.766 175.068H421.138V176.116H423.766V175.068Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M406.043 177.439H403.415V178.487H406.043V177.439Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M409.588 177.439H406.96V178.487H409.588V177.439Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M413.132 177.439H410.504V178.487H413.132V177.439Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M416.677 177.439H414.049V178.487H416.677V177.439Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M420.222 177.439H417.594V178.487H420.222V177.439Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M423.766 177.439H421.138V178.487H423.766V177.439Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M406.043 179.811H403.415V180.858H406.043V179.811Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M409.588 179.811H406.96V180.858H409.588V179.811Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M413.132 179.811H410.504V180.858H413.132V179.811Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M416.677 179.811H414.049V180.858H416.677V179.811Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M420.222 179.811H417.594V180.858H420.222V179.811Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M423.766 179.811H421.138V180.858H423.766V179.811Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M406.043 182.127H403.415V183.175H406.043V182.127Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M409.588 182.127H406.96V183.175H409.588V182.127Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M413.132 182.127H410.504V183.175H413.132V182.127Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M416.677 182.127H414.049V183.175H416.677V182.127Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M420.222 182.127H417.594V183.175H420.222V182.127Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M423.766 182.127H421.138V183.175H423.766V182.127Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M406.043 184.498H403.415V185.546H406.043V184.498Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M409.588 184.498H406.96V185.546H409.588V184.498Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M413.132 184.498H410.504V185.546H413.132V184.498Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M416.677 184.498H414.049V185.546H416.677V184.498Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M420.222 184.498H417.594V185.546H420.222V184.498Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M423.766 184.498H421.138V185.546H423.766V184.498Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M406.043 186.87H403.415V187.917H406.043V186.87Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M409.588 186.87H406.96V187.917H409.588V186.87Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M413.132 186.87H410.504V187.917H413.132V186.87Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M416.677 186.87H414.049V187.917H416.677V186.87Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M420.222 186.87H417.594V187.917H420.222V186.87Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M423.766 186.87H421.138V187.917H423.766V186.87Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M406.043 189.186H403.415V190.234H406.043V189.186Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M409.588 189.186H406.96V190.234H409.588V189.186Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M413.132 189.186H410.504V190.234H413.132V189.186Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M416.677 189.186H414.049V190.234H416.677V189.186Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M420.222 189.186H417.594V190.234H420.222V189.186Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M423.766 189.186H421.138V190.234H423.766V189.186Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M406.043 191.557H403.415V192.605H406.043V191.557Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M409.588 191.557H406.96V192.605H409.588V191.557Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M413.132 191.557H410.504V192.605H413.132V191.557Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M416.677 191.557H414.049V192.605H416.677V191.557Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M420.222 191.557H417.594V192.605H420.222V191.557Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M423.766 191.557H421.138V192.605H423.766V191.557Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M406.043 193.874H403.415V194.921H406.043V193.874Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M409.588 193.874H406.96V194.921H409.588V193.874Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M413.132 193.874H410.504V194.921H413.132V193.874Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M416.677 193.874H414.049V194.921H416.677V193.874Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M420.222 193.874H417.594V194.921H420.222V193.874Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M423.766 193.874H421.138V194.921H423.766V193.874Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M406.043 203.304H403.415V204.352H406.043V203.304Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M409.588 203.304H406.96V204.352H409.588V203.304Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M413.132 203.304H410.504V204.352H413.132V203.304Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M416.677 203.304H414.049V204.352H416.677V203.304Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M420.222 203.304H417.594V204.352H420.222V203.304Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M423.766 203.304H421.138V204.352H423.766V203.304Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M406.043 205.62H403.415V206.668H406.043V205.62Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M409.588 205.62H406.96V206.668H409.588V205.62Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M413.132 205.62H410.504V206.668H413.132V205.62Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M416.677 205.62H414.049V206.668H416.677V205.62Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M420.222 205.62H417.594V206.668H420.222V205.62Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M423.766 205.62H421.138V206.668H423.766V205.62Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M406.043 207.992H403.415V209.039H406.043V207.992Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M409.588 207.992H406.96V209.039H409.588V207.992Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M413.132 207.992H410.504V209.039H413.132V207.992Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M416.677 207.992H414.049V209.039H416.677V207.992Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M420.222 207.992H417.594V209.039H420.222V207.992Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M423.766 207.992H421.138V209.039H423.766V207.992Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M406.043 210.363H403.415V211.411H406.043V210.363Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M409.588 210.363H406.96V211.411H409.588V210.363Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M413.132 210.363H410.504V211.411H413.132V210.363Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M416.677 210.363H414.049V211.411H416.677V210.363Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M420.222 210.363H417.594V211.411H420.222V210.363Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M423.766 210.363H421.138V211.411H423.766V210.363Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M406.043 212.679H403.415V213.727H406.043V212.679Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M409.588 212.679H406.96V213.727H409.588V212.679Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M413.132 212.679H410.504V213.727H413.132V212.679Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M416.677 212.679H414.049V213.727H416.677V212.679Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M420.222 212.679H417.594V213.727H420.222V212.679Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M423.766 212.679H421.138V213.727H423.766V212.679Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M406.043 215.051H403.415V216.098H406.043V215.051Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M409.588 215.051H406.96V216.098H409.588V215.051Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M413.132 215.051H410.504V216.098H413.132V215.051Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M416.677 215.051H414.049V216.098H416.677V215.051Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M420.222 215.051H417.594V216.098H420.222V215.051Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M423.766 215.051H421.138V216.098H423.766V215.051Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M406.043 217.367H403.415V218.415H406.043V217.367Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M409.588 217.367H406.96V218.415H409.588V217.367Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M413.132 217.367H410.504V218.415H413.132V217.367Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M416.677 217.367H414.049V218.415H416.677V217.367Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M420.222 217.367H417.594V218.415H420.222V217.367Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M423.766 217.367H421.138V218.415H423.766V217.367Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M406.043 219.738H403.415V220.786H406.043V219.738Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M409.588 219.738H406.96V220.786H409.588V219.738Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M413.132 219.738H410.504V220.786H413.132V219.738Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M416.677 219.738H414.049V220.786H416.677V219.738Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M420.222 219.738H417.594V220.786H420.222V219.738Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M423.766 219.738H421.138V220.786H423.766V219.738Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M406.043 222.11H403.415V223.157H406.043V222.11Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M409.588 222.11H406.96V223.157H409.588V222.11Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M413.132 222.11H410.504V223.157H413.132V222.11Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M416.677 222.11H414.049V223.157H416.677V222.11Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M420.222 222.11H417.594V223.157H420.222V222.11Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M423.766 222.11H421.138V223.157H423.766V222.11Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M406.043 224.426H403.415V225.474H406.043V224.426Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M409.588 224.426H406.96V225.474H409.588V224.426Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M413.132 224.426H410.504V225.474H413.132V224.426Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M416.677 224.426H414.049V225.474H416.677V224.426Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M420.222 224.426H417.594V225.474H420.222V224.426Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M423.766 224.426H421.138V225.474H423.766V224.426Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M406.043 226.797H403.415V227.845H406.043V226.797Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M409.588 226.797H406.96V227.845H409.588V226.797Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M413.132 226.797H410.504V227.845H413.132V226.797Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M416.677 226.797H414.049V227.845H416.677V226.797Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M420.222 226.797H417.594V227.845H420.222V226.797Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M423.766 226.797H421.138V227.845H423.766V226.797Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M406.043 229.113H403.415V230.161H406.043V229.113Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M409.588 229.113H406.96V230.161H409.588V229.113Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M413.132 229.113H410.504V230.161H413.132V229.113Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M416.677 229.113H414.049V230.161H416.677V229.113Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M420.222 229.113H417.594V230.161H420.222V229.113Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M423.766 229.113H421.138V230.161H423.766V229.113Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M406.043 231.485H403.415V232.533H406.043V231.485Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M409.588 231.485H406.96V232.533H409.588V231.485Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M413.132 231.485H410.504V232.533H413.132V231.485Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M416.677 231.485H414.049V232.533H416.677V231.485Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M420.222 231.485H417.594V232.533H420.222V231.485Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M423.766 231.485H421.138V232.533H423.766V231.485Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M406.043 233.856H403.415V234.904H406.043V233.856Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M409.588 233.856H406.96V234.904H409.588V233.856Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M413.132 233.856H410.504V234.904H413.132V233.856Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M416.677 233.856H414.049V234.904H416.677V233.856Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M420.222 233.856H417.594V234.904H420.222V233.856Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M423.766 233.856H421.138V234.904H423.766V233.856Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~opacity:(("0.4")) - ~d:(("M425.172 227.955H401.887V240.474H425.172V227.955Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M326.044 212.128H250.141V241.246H326.044V212.128Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M263.83 213.286H252.157V214.72H263.83V213.286Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M276.42 213.286H264.747V214.72H276.42V213.286Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M288.826 213.286H277.153V214.72H288.826V213.286Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M263.83 215.878H252.157V217.312H263.83V215.878Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M276.42 215.878H264.747V217.312H276.42V215.878Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M288.826 215.878H277.153V217.312H288.826V215.878Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M263.83 218.47H252.157V219.904H263.83V218.47Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M276.42 218.47H264.747V219.904H276.42V218.47Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M288.826 218.47H277.153V219.904H288.826V218.47Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M263.83 221.062H252.157V222.496H263.83V221.062Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M276.42 221.062H264.747V222.496H276.42V221.062Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M288.826 221.062H277.153V222.496H288.826V221.062Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M263.83 223.654H252.157V225.088H263.83V223.654Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M276.42 223.654H264.747V225.088H276.42V223.654Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M288.826 223.654H277.153V225.088H288.826V223.654Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M263.83 226.191H252.157V227.624H263.83V226.191Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M276.42 226.191H264.747V227.624H276.42V226.191Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M288.826 226.191H277.153V227.624H288.826V226.191Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M263.83 228.783H252.157V230.216H263.83V228.783Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M276.42 228.783H264.747V230.216H276.42V228.783Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M288.826 228.783H277.153V230.216H288.826V228.783Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M263.83 231.375H252.157V232.808H263.83V231.375Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M276.42 231.375H264.747V232.808H276.42V231.375Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M288.826 231.375H277.153V232.808H288.826V231.375Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M360.818 199.664H358.191V209.701H360.818V199.664Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M360.818 199.664H358.191V205.014H360.818V199.664Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M368.274 209.701H334.173V215.216H368.274V209.701Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M375.303 215.216H334.173V240.915H375.303V215.216Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M331.606 121.298H291.759V240.253H331.606V121.298Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M299.582 126.592H294.143V127.254H299.582V126.592Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M305.449 126.592H300.01V127.254H305.449V126.592Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M311.194 126.592H305.754V127.254H311.194V126.592Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M316.938 126.592H311.499V127.254H316.938V126.592Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M322.866 126.592H317.427V127.254H322.866V126.592Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M328.611 126.592H323.172V127.254H328.611V126.592Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M299.582 129.46H294.143V130.122H299.582V129.46Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M305.449 129.46H300.01V130.122H305.449V129.46Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M311.194 129.46H305.755V130.122H311.194V129.46Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M316.938 129.46H311.499V130.122H316.938V129.46Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M322.866 129.46H317.427V130.122H322.866V129.46Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M328.611 129.46H323.172V130.122H328.611V129.46Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M299.582 132.383H294.143V133.045H299.582V132.383Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M305.449 132.383H300.01V133.045H305.449V132.383Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M311.194 132.383H305.755V133.045H311.194V132.383Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M316.938 132.383H311.499V133.045H316.938V132.383Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M322.866 132.383H317.427V133.045H322.866V132.383Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M328.611 132.383H323.172V133.045H328.611V132.383Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M299.582 135.251H294.143V135.912H299.582V135.251Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M305.449 135.251H300.01V135.912H305.449V135.251Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M311.194 135.251H305.755V135.912H311.194V135.251Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M316.938 135.251H311.499V135.912H316.938V135.251Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M322.866 135.251H317.427V135.912H322.866V135.251Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M328.611 135.251H323.172V135.912H328.611V135.251Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M299.582 138.173H294.143V138.835H299.582V138.173Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M305.449 138.173H300.01V138.835H305.449V138.173Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M311.194 138.173H305.755V138.835H311.194V138.173Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M316.938 138.173H311.499V138.835H316.938V138.173Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M322.866 138.173H317.427V138.835H322.866V138.173Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M328.611 138.173H323.172V138.835H328.611V138.173Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M299.582 141.041H294.143V141.703H299.582V141.041Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M305.449 141.041H300.01V141.703H305.449V141.041Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M311.194 141.041H305.755V141.703H311.194V141.041Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M316.938 141.041H311.499V141.703H316.938V141.041Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M322.866 141.041H317.427V141.703H322.866V141.041Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M328.611 141.041H323.172V141.703H328.611V141.041Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M298.237 144.626H294.143V145.288H298.237V144.626Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M308.016 144.626H303.921V145.288H308.016V144.626Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M317.794 144.626H313.699V145.288H317.794V144.626Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M327.572 144.626H323.478V145.288H327.572V144.626Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M303.127 148.045H299.032V148.707H303.127V148.045Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M312.905 148.045H308.81V148.707H312.905V148.045Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M322.683 148.045H318.589V148.707H322.683V148.045Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M298.237 151.519H294.143V152.181H298.237V151.519Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M308.016 151.519H303.921V152.181H308.016V151.519Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M317.794 151.519H313.699V152.181H317.794V151.519Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M327.572 151.519H323.478V152.181H327.572V151.519Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M303.127 154.883H299.032V155.545H303.127V154.883Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M312.905 154.883H308.81V155.545H312.905V154.883Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M322.683 154.883H318.589V155.545H322.683V154.883Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M298.237 158.413H294.143V159.075H298.237V158.413Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M308.016 158.413H303.921V159.075H308.016V158.413Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M317.794 158.413H313.699V159.075H317.794V158.413Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M327.572 158.413H323.478V159.075H327.572V158.413Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M303.127 161.777H299.032V162.439H303.127V161.777Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M312.905 161.777H308.81V162.439H312.905V161.777Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M322.683 161.777H318.589V162.439H322.683V161.777Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M298.237 165.307H294.143V165.968H298.237V165.307Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M308.016 165.307H303.921V165.968H308.016V165.307Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M317.794 165.307H313.699V165.968H317.794V165.307Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M327.572 165.307H323.478V165.968H327.572V165.307Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M303.127 168.671H299.032V169.332H303.127V168.671Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M312.905 168.671H308.81V169.332H312.905V168.671Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M322.683 168.671H318.589V169.332H322.683V168.671Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M298.237 172.2H294.143V172.862H298.237V172.2Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M308.016 172.2H303.921V172.862H308.016V172.2Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M317.794 172.2H313.699V172.862H317.794V172.2Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M327.572 172.2H323.478V172.862H327.572V172.2Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M303.127 175.564H299.032V176.226H303.127V175.564Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M312.905 175.564H308.81V176.226H312.905V175.564Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M322.683 175.564H318.589V176.226H322.683V175.564Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M298.237 179.094H294.143V179.755H298.237V179.094Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M308.016 179.094H303.921V179.755H308.016V179.094Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M317.794 179.094H313.699V179.755H317.794V179.094Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M327.572 179.094H323.478V179.755H327.572V179.094Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M303.127 182.458H299.032V183.12H303.127V182.458Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M312.905 182.458H308.81V183.12H312.905V182.458Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M322.683 182.458H318.589V183.12H322.683V182.458Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M298.237 185.932H294.143V186.594H298.237V185.932Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M308.016 185.932H303.921V186.594H308.016V185.932Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M317.794 185.932H313.699V186.594H317.794V185.932Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M327.572 185.932H323.478V186.594H327.572V185.932Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M303.127 189.351H299.032V190.013H303.127V189.351Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M312.905 189.351H308.81V190.013H312.905V189.351Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M322.683 189.351H318.589V190.013H322.683V189.351Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M298.237 192.826H294.143V193.487H298.237V192.826Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M308.016 192.826H303.921V193.487H308.016V192.826Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M317.794 192.826H313.699V193.487H317.794V192.826Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M327.572 192.826H323.478V193.487H327.572V192.826Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M303.127 196.245H299.032V196.907H303.127V196.245Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M312.905 196.245H308.81V196.907H312.905V196.245Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M322.683 196.245H318.589V196.907H322.683V196.245Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M298.237 199.719H294.143V200.381H298.237V199.719Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M308.016 199.719H303.921V200.381H308.016V199.719Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M317.794 199.719H313.699V200.381H317.794V199.719Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M327.572 199.719H323.478V200.381H327.572V199.719Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M303.127 203.138H299.032V203.8H303.127V203.138Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M312.905 203.138H308.81V203.8H312.905V203.138Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M322.683 203.138H318.589V203.8H322.683V203.138Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M298.237 206.613H294.143V207.275H298.237V206.613Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M308.016 206.613H303.921V207.275H308.016V206.613Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M317.794 206.613H313.699V207.275H317.794V206.613Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M327.572 206.613H323.478V207.275H327.572V206.613Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M303.127 209.977H299.032V210.639H303.127V209.977Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M312.905 209.977H308.81V210.639H312.905V209.977Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M322.683 209.977H318.589V210.639H322.683V209.977Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M298.237 213.506H294.143V214.168H298.237V213.506Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M308.016 213.506H303.921V214.168H308.016V213.506Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M317.794 213.506H313.699V214.168H317.794V213.506Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M327.572 213.506H323.478V214.168H327.572V213.506Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M303.127 216.87H299.032V217.532H303.127V216.87Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M312.905 216.87H308.81V217.532H312.905V216.87Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M322.683 216.87H318.589V217.532H322.683V216.87Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M298.237 220.4H294.143V221.062H298.237V220.4Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M308.016 220.4H303.921V221.062H308.016V220.4Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M317.794 220.4H313.699V221.062H317.794V220.4Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M327.572 220.4H323.478V221.062H327.572V220.4Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M303.127 223.764H299.032V224.426H303.127V223.764Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M312.905 223.764H308.81V224.426H312.905V223.764Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M322.683 223.764H318.589V224.426H322.683V223.764Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M298.237 227.294H294.143V227.955H298.237V227.294Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M308.016 227.294H303.921V227.955H308.016V227.294Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M317.794 227.294H313.699V227.955H317.794V227.294Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M327.572 227.294H323.478V227.955H327.572V227.294Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M303.127 230.658H299.032V231.319H303.127V230.658Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M312.905 230.658H308.81V231.319H312.905V230.658Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M322.683 230.658H318.589V231.319H322.683V230.658Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M199.538 188.303H169.531V240.695H199.538V188.303Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M178.087 191.226H171.181V194.26H178.087V191.226Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M186.826 191.226H179.92V194.26H186.826V191.226Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M195.566 191.226H188.66V194.26H195.566V191.226Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M178.087 195.638H171.181V198.671H178.087V195.638Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M186.826 195.638H179.92V198.671H186.826V195.638Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M195.566 195.638H188.66V198.671H195.566V195.638Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M178.087 200.05H171.181V203.083H178.087V200.05Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M186.826 200.05H179.92V203.083H186.826V200.05Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M195.566 200.05H188.66V203.083H195.566V200.05Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M178.087 204.407H171.181V207.44H178.087V204.407Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M186.826 204.407H179.92V207.44H186.826V204.407Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M195.566 204.407H188.66V207.44H195.566V204.407Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M178.087 208.819H171.181V211.852H178.087V208.819Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M186.826 208.819H179.92V211.852H186.826V208.819Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M195.566 208.819H188.66V211.852H195.566V208.819Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M178.087 213.231H171.181V216.264H178.087V213.231Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M186.826 213.231H179.92V216.264H186.826V213.231Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M195.566 213.231H188.66V216.264H195.566V213.231Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M178.087 217.587H171.181V220.621H178.087V217.587Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M186.826 217.587H179.92V220.621H186.826V217.587Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M195.566 217.587H188.66V220.621H195.566V217.587Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M160.914 175.84L169.653 185.546V244.555H160.914V175.84Z") - ) ~fill:(("#1474AA")) - ~children:[] ()) - [@JSX ]); - ((path ~opacity:(("0.6")) - ~d:(("M163.542 242.57V178.763L160.914 175.895V241.963C162.014 242.349 163.542 242.57 163.542 242.57Z") - ) ~fill:(("#1474AA")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M154.191 108.448H144.046V146.335H154.191V108.448Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M151.991 108.448H144.046V146.335H151.991V108.448Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M160.914 146.335H112.206V244.555H160.914V146.335Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M147.835 105.746H117.462V146.335H147.835V105.746Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M120.639 115.066H119.539V116.059H120.639V115.066Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M123.756 115.066H122.656V116.059H123.756V115.066Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M126.873 115.066H125.773V116.059H126.873V115.066Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M130.051 115.066H128.951V116.059H130.051V115.066Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M133.168 115.066H132.068V116.059H133.168V115.066Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M136.285 115.066H135.185V116.059H136.285V115.066Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M139.463 115.066H138.363V116.059H139.463V115.066Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M142.58 115.066H141.479V116.059H142.58V115.066Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M145.696 115.066H144.596V116.059H145.696V115.066Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M120.639 118.871H119.539V119.864H120.639V118.871Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M123.756 118.871H122.656V119.864H123.756V118.871Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M126.873 118.871H125.773V119.864H126.873V118.871Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M130.051 118.871H128.951V119.864H130.051V118.871Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M133.168 118.871H132.068V119.864H133.168V118.871Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M136.285 118.871H135.185V119.864H136.285V118.871Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M139.463 118.871H138.363V119.864H139.463V118.871Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M142.58 118.871H141.479V119.864H142.58V118.871Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M145.696 118.871H144.596V119.864H145.696V118.871Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M120.639 122.732H119.539V123.724H120.639V122.732Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M123.756 122.732H122.656V123.724H123.756V122.732Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M126.873 122.732H125.773V123.724H126.873V122.732Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M130.051 122.732H128.951V123.724H130.051V122.732Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M133.168 122.732H132.068V123.724H133.168V122.732Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M136.285 122.732H135.185V123.724H136.285V122.732Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M139.463 122.732H138.363V123.724H139.463V122.732Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M142.58 122.732H141.479V123.724H142.58V122.732Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M145.696 122.732H144.596V123.724H145.696V122.732Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M120.639 126.592H119.539V127.585H120.639V126.592Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M123.756 126.592H122.656V127.585H123.756V126.592Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M126.873 126.592H125.773V127.585H126.873V126.592Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M130.051 126.592H128.951V127.585H130.051V126.592Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M133.168 126.592H132.068V127.585H133.168V126.592Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M136.285 126.592H135.185V127.585H136.285V126.592Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M139.463 126.592H138.363V127.585H139.463V126.592Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M142.58 126.592H141.479V127.585H142.58V126.592Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M145.696 126.592H144.596V127.585H145.696V126.592Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M120.639 130.397H119.539V131.39H120.639V130.397Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M123.756 130.397H122.656V131.39H123.756V130.397Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M126.873 130.397H125.773V131.39H126.873V130.397Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M130.051 130.397H128.951V131.39H130.051V130.397Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M133.168 130.397H132.068V131.39H133.168V130.397Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M136.285 130.397H135.185V131.39H136.285V130.397Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M139.463 130.397H138.363V131.39H139.463V130.397Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M142.58 130.397H141.479V131.39H142.58V130.397Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M145.696 130.397H144.596V131.39H145.696V130.397Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M120.639 134.258H119.539V135.251H120.639V134.258Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M123.756 134.258H122.656V135.251H123.756V134.258Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M126.873 134.258H125.773V135.251H126.873V134.258Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M130.051 134.258H128.951V135.251H130.051V134.258Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M133.168 134.258H132.068V135.251H133.168V134.258Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M136.285 134.258H135.185V135.251H136.285V134.258Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M139.463 134.258H138.363V135.251H139.463V134.258Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M142.58 134.258H141.479V135.251H142.58V134.258Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M145.696 134.258H144.596V135.251H145.696V134.258Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M120.639 138.063H119.539V139.056H120.639V138.063Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M123.756 138.063H122.656V139.056H123.756V138.063Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M126.873 138.063H125.773V139.056H126.873V138.063Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M130.051 138.063H128.951V139.056H130.051V138.063Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M133.168 138.063H132.068V139.056H133.168V138.063Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M136.285 138.063H135.185V139.056H136.285V138.063Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M139.463 138.063H138.363V139.056H139.463V138.063Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M142.58 138.063H141.479V139.056H142.58V138.063Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M145.696 138.063H144.596V139.056H145.696V138.063Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M120.639 141.924H119.539V142.916H120.639V141.924Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M123.756 141.924H122.656V142.916H123.756V141.924Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M126.873 141.924H125.773V142.916H126.873V141.924Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M130.051 141.924H128.951V142.916H130.051V141.924Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M133.168 141.924H132.068V142.916H133.168V141.924Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M136.285 141.924H135.185V142.916H136.285V141.924Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M139.463 141.924H138.363V142.916H139.463V141.924Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M142.58 141.924H141.479V142.916H142.58V141.924Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M145.696 141.924H144.596V142.916H145.696V141.924Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M121.556 109.496H119.539V111.316H121.556V109.496Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M123.94 109.496H121.923V111.316H123.94V109.496Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M126.384 109.496H124.367V111.316H126.384V109.496Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M128.768 109.496H126.751V111.316H128.768V109.496Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M131.212 109.496H129.195V111.316H131.212V109.496Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M133.596 109.496H131.579V111.316H133.596V109.496Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M136.04 109.496H134.023V111.316H136.04V109.496Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M138.424 109.496H136.407V111.316H138.424V109.496Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M140.868 109.496H138.851V111.316H140.868V109.496Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M143.252 109.496H141.235V111.316H143.252V109.496Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M145.696 109.496H143.68V111.316H145.696V109.496Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M121.556 111.647H119.539V113.467H121.556V111.647Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M123.94 111.647H121.923V113.467H123.94V111.647Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M126.384 111.647H124.367V113.467H126.384V111.647Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M128.768 111.647H126.751V113.467H128.768V111.647Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M131.212 111.647H129.195V113.467H131.212V111.647Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M133.596 111.647H131.579V113.467H133.596V111.647Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M136.04 111.647H134.023V113.467H136.04V111.647Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M138.424 111.647H136.407V113.467H138.424V111.647Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M140.868 111.647H138.851V113.467H140.868V111.647Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M143.252 111.647H141.235V113.467H143.252V111.647Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M145.696 111.647H143.68V113.467H145.696V111.647Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M117.462 141.317V146.335H144.046H147.835H154.191V141.317H117.462Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M118.928 150.968H115.689V153.891H118.928V150.968Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M122.778 150.968H119.539V153.891H122.778V150.968Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M126.568 150.968H123.328V153.891H126.568V150.968Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M130.418 150.968H127.179V153.891H130.418V150.968Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M134.268 150.968H131.029V153.891H134.268V150.968Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M138.057 150.968H134.818V153.891H138.057V150.968Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M141.907 150.968H138.668V153.891H141.907V150.968Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M145.696 150.968H142.457V153.891H145.696V150.968Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M149.546 150.968H146.307V153.891H149.546V150.968Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M153.336 150.968H150.097V153.891H153.336V150.968Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M157.186 150.968H153.947V153.891H157.186V150.968Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M118.928 154.442H115.689V157.365H118.928V154.442Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M117.4 158.634H115.689V160.178H117.4V158.634Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M122.412 158.634H120.701V160.178H122.412V158.634Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M127.362 158.634H125.651V160.178H127.362V158.634Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M132.312 158.634H130.601V160.178H132.312V158.634Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M137.263 158.634H135.551V160.178H137.263V158.634Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M142.274 158.634H140.563V160.178H142.274V158.634Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M147.224 158.634H145.513V160.178H147.224V158.634Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M152.174 158.634H150.463V160.178H152.174V158.634Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M157.125 158.634H155.414V160.178H157.125V158.634Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M117.4 162.273H115.689V163.818H117.4V162.273Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M122.412 162.273H120.701V163.818H122.412V162.273Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M127.362 162.273H125.651V163.818H127.362V162.273Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M132.312 162.273H130.601V163.818H132.312V162.273Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M137.263 162.273H135.551V163.818H137.263V162.273Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M142.274 162.273H140.563V163.818H142.274V162.273Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M147.224 162.273H145.513V163.818H147.224V162.273Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M152.174 162.273H150.463V163.818H152.174V162.273Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M157.125 162.273H155.414V163.818H157.125V162.273Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M117.4 165.913H115.689V167.457H117.4V165.913Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M122.412 165.913H120.701V167.457H122.412V165.913Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M127.362 165.913H125.651V167.457H127.362V165.913Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M132.312 165.913H130.601V167.457H132.312V165.913Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M137.263 165.913H135.551V167.457H137.263V165.913Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M142.274 165.913H140.563V167.457H142.274V165.913Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M147.224 165.913H145.513V167.457H147.224V165.913Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M152.174 165.913H150.463V167.457H152.174V165.913Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M157.125 165.913H155.414V167.457H157.125V165.913Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M117.4 169.498H115.689V171.042H117.4V169.498Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M122.412 169.498H120.701V171.042H122.412V169.498Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M127.362 169.498H125.651V171.042H127.362V169.498Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M132.312 169.498H130.601V171.042H132.312V169.498Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M137.263 169.498H135.551V171.042H137.263V169.498Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M142.274 169.498H140.563V171.042H142.274V169.498Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M147.224 169.498H145.513V171.042H147.224V169.498Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M152.174 169.498H150.463V171.042H152.174V169.498Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M157.125 169.498H155.414V171.042H157.125V169.498Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M117.4 173.138H115.689V174.682H117.4V173.138Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M122.412 173.138H120.701V174.682H122.412V173.138Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M127.362 173.138H125.651V174.682H127.362V173.138Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M132.312 173.138H130.601V174.682H132.312V173.138Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M137.263 173.138H135.551V174.682H137.263V173.138Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M142.274 173.138H140.563V174.682H142.274V173.138Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M147.224 173.138H145.513V174.682H147.224V173.138Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M152.174 173.138H150.463V174.682H152.174V173.138Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M157.125 173.138H155.414V174.682H157.125V173.138Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M117.4 176.777H115.689V178.322H117.4V176.777Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M122.412 176.777H120.701V178.322H122.412V176.777Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M127.362 176.777H125.651V178.322H127.362V176.777Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M132.312 176.777H130.601V178.322H132.312V176.777Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M137.263 176.777H135.551V178.322H137.263V176.777Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M142.274 176.777H140.563V178.322H142.274V176.777Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M147.224 176.777H145.513V178.322H147.224V176.777Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M152.174 176.777H150.463V178.322H152.174V176.777Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M157.125 176.777H155.414V178.322H157.125V176.777Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M117.4 180.362H115.689V181.906H117.4V180.362Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M122.412 180.362H120.701V181.906H122.412V180.362Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M127.362 180.362H125.651V181.906H127.362V180.362Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M132.312 180.362H130.601V181.906H132.312V180.362Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M137.263 180.362H135.551V181.906H137.263V180.362Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M142.274 180.362H140.563V181.906H142.274V180.362Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M147.224 180.362H145.513V181.906H147.224V180.362Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M152.174 180.362H150.463V181.906H152.174V180.362Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M157.125 180.362H155.414V181.906H157.125V180.362Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M117.4 184.002H115.689V185.546H117.4V184.002Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M122.412 184.002H120.701V185.546H122.412V184.002Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M127.362 184.002H125.651V185.546H127.362V184.002Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M132.312 184.002H130.601V185.546H132.312V184.002Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M137.263 184.002H135.551V185.546H137.263V184.002Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M142.274 184.002H140.563V185.546H142.274V184.002Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M147.224 184.002H145.513V185.546H147.224V184.002Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M152.174 184.002H150.463V185.546H152.174V184.002Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M157.125 184.002H155.414V185.546H157.125V184.002Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M117.4 187.642H115.689V189.186H117.4V187.642Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M122.412 187.642H120.701V189.186H122.412V187.642Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M127.362 187.642H125.651V189.186H127.362V187.642Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M132.312 187.642H130.601V189.186H132.312V187.642Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M137.263 187.642H135.551V189.186H137.263V187.642Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M142.274 187.642H140.563V189.186H142.274V187.642Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M147.224 187.642H145.513V189.186H147.224V187.642Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M152.174 187.642H150.463V189.186H152.174V187.642Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M157.125 187.642H155.414V189.186H157.125V187.642Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M117.4 191.226H115.689V192.771H117.4V191.226Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M122.412 191.226H120.701V192.771H122.412V191.226Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M127.362 191.226H125.651V192.771H127.362V191.226Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M132.312 191.226H130.601V192.771H132.312V191.226Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M137.263 191.226H135.551V192.771H137.263V191.226Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M142.274 191.226H140.563V192.771H142.274V191.226Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M147.224 191.226H145.513V192.771H147.224V191.226Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M152.174 191.226H150.463V192.771H152.174V191.226Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M157.125 191.226H155.414V192.771H157.125V191.226Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M117.4 194.866H115.689V196.41H117.4V194.866Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M122.412 194.866H120.701V196.41H122.412V194.866Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M127.362 194.866H125.651V196.41H127.362V194.866Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M132.312 194.866H130.601V196.41H132.312V194.866Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M137.263 194.866H135.551V196.41H137.263V194.866Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M142.274 194.866H140.563V196.41H142.274V194.866Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M147.224 194.866H145.513V196.41H147.224V194.866Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M152.174 194.866H150.463V196.41H152.174V194.866Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M157.125 194.866H155.414V196.41H157.125V194.866Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M117.4 198.506H115.689V200.05H117.4V198.506Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M122.412 198.506H120.701V200.05H122.412V198.506Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M127.362 198.506H125.651V200.05H127.362V198.506Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M132.312 198.506H130.601V200.05H132.312V198.506Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M137.263 198.506H135.551V200.05H137.263V198.506Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M142.274 198.506H140.563V200.05H142.274V198.506Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M147.224 198.506H145.513V200.05H147.224V198.506Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M152.174 198.506H150.463V200.05H152.174V198.506Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M157.125 198.506H155.414V200.05H157.125V198.506Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M117.4 202.091H115.689V203.635H117.4V202.091Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M122.412 202.091H120.701V203.635H122.412V202.091Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M127.362 202.091H125.651V203.635H127.362V202.091Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M132.312 202.091H130.601V203.635H132.312V202.091Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M137.263 202.091H135.551V203.635H137.263V202.091Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M142.274 202.091H140.563V203.635H142.274V202.091Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M147.224 202.091H145.513V203.635H147.224V202.091Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M152.174 202.091H150.463V203.635H152.174V202.091Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M157.125 202.091H155.414V203.635H157.125V202.091Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M117.4 205.73H115.689V207.275H117.4V205.73Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M122.412 205.73H120.701V207.275H122.412V205.73Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M127.362 205.73H125.651V207.275H127.362V205.73Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M132.312 205.73H130.601V207.275H132.312V205.73Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M137.263 205.73H135.551V207.275H137.263V205.73Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M142.274 205.73H140.563V207.275H142.274V205.73Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M147.224 205.73H145.513V207.275H147.224V205.73Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M152.174 205.73H150.463V207.275H152.174V205.73Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M157.125 205.73H155.414V207.275H157.125V205.73Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M117.4 209.37H115.689V210.914H117.4V209.37Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M122.412 209.37H120.701V210.914H122.412V209.37Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M127.362 209.37H125.651V210.914H127.362V209.37Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M132.312 209.37H130.601V210.914H132.312V209.37Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M137.263 209.37H135.551V210.914H137.263V209.37Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M142.274 209.37H140.563V210.914H142.274V209.37Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M147.224 209.37H145.513V210.914H147.224V209.37Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M152.174 209.37H150.463V210.914H152.174V209.37Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M157.125 209.37H155.414V210.914H157.125V209.37Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M117.4 212.955H115.689V214.499H117.4V212.955Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M122.412 212.955H120.701V214.499H122.412V212.955Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M127.362 212.955H125.651V214.499H127.362V212.955Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M132.312 212.955H130.601V214.499H132.312V212.955Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M137.263 212.955H135.551V214.499H137.263V212.955Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M142.274 212.955H140.563V214.499H142.274V212.955Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M147.224 212.955H145.513V214.499H147.224V212.955Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M152.174 212.955H150.463V214.499H152.174V212.955Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M157.125 212.955H155.414V214.499H157.125V212.955Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M117.4 216.595H115.689V218.139H117.4V216.595Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M122.412 216.595H120.701V218.139H122.412V216.595Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M127.362 216.595H125.651V218.139H127.362V216.595Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M132.312 216.595H130.601V218.139H132.312V216.595Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M137.263 216.595H135.551V218.139H137.263V216.595Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M142.274 216.595H140.563V218.139H142.274V216.595Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M147.224 216.595H145.513V218.139H147.224V216.595Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M152.174 216.595H150.463V218.139H152.174V216.595Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M157.125 216.595H155.414V218.139H157.125V216.595Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M122.778 154.442H119.539V157.365H122.778V154.442Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M126.568 154.442H123.328V157.365H126.568V154.442Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M130.418 154.442H127.179V157.365H130.418V154.442Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M134.268 154.442H131.029V157.365H134.268V154.442Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M138.057 154.442H134.818V157.365H138.057V154.442Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M141.907 154.442H138.668V157.365H141.907V154.442Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M145.696 154.442H142.457V157.365H145.696V154.442Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M149.546 154.442H146.307V157.365H149.546V154.442Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M153.336 154.442H150.097V157.365H153.336V154.442Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M157.186 154.442H153.947V157.365H157.186V154.442Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M509.998 178.597H476.08V240.474H509.998V178.597Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M250.141 150.968H205.588V241.246H250.141V150.968Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M213.594 157.475H209.377V159.351H213.594V157.475Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M220.378 160.288H216.161V162.163H220.378V160.288Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M237.368 160.288H233.151V162.163H237.368V160.288Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M228.751 157.475H224.534V159.351H228.751V157.475Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M245.863 157.475H241.646V159.351H245.863V157.475Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M213.594 164.204H209.377V166.079H213.594V164.204Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M220.378 167.016H216.161V168.891H220.378V167.016Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M237.368 167.016H233.151V168.891H237.368V167.016Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M228.751 164.204H224.534V166.079H228.751V164.204Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M245.863 164.204H241.646V166.079H245.863V164.204Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M213.594 170.932H209.377V172.807H213.594V170.932Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M220.378 173.689H216.161V175.564H220.378V173.689Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M237.368 173.689H233.151V175.564H237.368V173.689Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M228.751 170.932H224.534V172.807H228.751V170.932Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M245.863 170.932H241.646V172.807H245.863V170.932Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M213.594 177.605H209.377V179.48H213.594V177.605Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M220.378 180.417H216.161V182.292H220.378V180.417Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M237.368 180.417H233.151V182.292H237.368V180.417Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M228.751 177.605H224.534V179.48H228.751V177.605Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M245.863 177.605H241.646V179.48H245.863V177.605Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M213.594 184.333H209.377V186.208H213.594V184.333Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M220.378 187.145H216.161V189.02H220.378V187.145Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M237.368 187.145H233.151V189.02H237.368V187.145Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M228.751 184.333H224.534V186.208H228.751V184.333Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M245.863 184.333H241.646V186.208H245.863V184.333Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M213.594 191.061H209.377V192.936H213.594V191.061Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M220.378 193.874H216.161V195.749H220.378V193.874Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M237.368 193.874H233.151V195.749H237.368V193.874Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M228.751 191.061H224.534V192.936H228.751V191.061Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M245.863 191.061H241.646V192.936H245.863V191.061Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M213.594 197.789H209.377V199.664H213.594V197.789Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M220.378 200.602H216.161V202.477H220.378V200.602Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M237.368 200.602H233.151V202.477H237.368V200.602Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M228.751 197.789H224.534V199.664H228.751V197.789Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M245.863 197.789H241.646V199.664H245.863V197.789Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M213.594 204.517H209.377V206.392H213.594V204.517Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M220.378 207.33H216.161V209.205H220.378V207.33Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M237.368 207.33H233.151V209.205H237.368V207.33Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M228.751 204.517H224.534V206.392H228.751V204.517Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M245.863 204.517H241.646V206.392H245.863V204.517Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M213.594 211.245H209.377V213.12H213.594V211.245Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M220.378 214.003H216.161V215.878H220.378V214.003Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M237.368 214.003H233.151V215.878H237.368V214.003Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M228.751 211.245H224.534V213.12H228.751V211.245Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M245.863 211.245H241.646V213.12H245.863V211.245Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M213.594 217.918H209.377V219.793H213.594V217.918Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M220.378 220.731H216.161V222.606H220.378V220.731Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M237.368 220.731H233.151V222.606H237.368V220.731Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M228.751 217.918H224.534V219.793H228.751V217.918Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M245.863 217.918H241.646V219.793H245.863V217.918Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M213.594 224.646H209.377V226.521H213.594V224.646Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M220.378 227.459H216.161V229.334H220.378V227.459Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M237.368 227.459H233.151V229.334H237.368V227.459Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M228.751 224.646H224.534V226.521H228.751V224.646Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M245.863 224.646H241.646V226.521H245.863V224.646Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M476.141 192.55H432.628V241.081H476.141V192.55Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M465.996 185.27H441.306V192.55H465.996V185.27Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M465.996 184.057H441.306V185.27H465.996V184.057Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M465.996 178.873H441.306V180.086H465.996V178.873Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M464.163 180.086H442.406V184.057H464.163V180.086Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M464.163 180.086H442.406V180.858H464.163V180.086Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M442.406 178.873L448.884 165.527H458.051L464.957 178.873H442.406Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M531.877 158.964L514.765 181.741V240.364H531.877H549.05V181.741L531.877 158.964Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M549.05 189.241H514.765V189.958H549.05V189.241Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M549.05 190.785H514.765V191.502H549.05V190.785Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M549.05 192.385H514.765V193.101H549.05V192.385Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M549.05 193.984H514.765V194.701H549.05V193.984Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M549.05 195.528H514.765V196.245H549.05V195.528Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M549.05 197.127H514.765V197.844H549.05V197.127Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M549.05 198.671H514.765V199.388H549.05V198.671Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M549.05 200.271H514.765V200.988H549.05V200.271Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M549.05 201.87H514.765V202.587H549.05V201.87Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M549.05 203.414H514.765V204.131H549.05V203.414Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M549.05 205.014H514.765V205.73H549.05V205.014Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M549.05 206.613H514.765V207.33H549.05V206.613Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M549.05 208.157H514.765V208.874H549.05V208.157Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M549.05 209.756H514.765V210.473H549.05V209.756Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M549.05 211.3H514.765V212.017H549.05V211.3Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M549.05 212.9H514.765V213.617H549.05V212.9Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M549.05 214.499H514.765V215.216H549.05V214.499Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M549.05 216.043H514.765V216.76H549.05V216.043Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M549.05 217.643H514.765V218.36H549.05V217.643Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M549.05 219.187H514.765V219.904H549.05V219.187Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M549.05 220.786H514.765V221.503H549.05V220.786Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M549.05 222.385H514.765V223.102H549.05V222.385Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M549.05 223.93H514.765V224.646H549.05V223.93Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M549.05 225.529H514.765V226.246H549.05V225.529Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M549.05 227.128H514.765V227.845H549.05V227.128Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M549.05 228.672H514.765V229.389H549.05V228.672Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M549.05 230.272H514.765V230.989H549.05V230.272Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M549.05 231.816H514.765V232.533H549.05V231.816Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M549.05 233.415H514.765V234.132H549.05V233.415Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M549.05 235.014H514.765V235.731H549.05V235.014Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M549.05 236.559H514.765V237.275H549.05V236.559Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M549.05 181.741L531.877 158.964L514.765 181.741L530.594 206.282L549.05 181.741Z") - ) ~fill:(("#1073AA")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M578.568 240.75V162.218L590.975 141.593L603.747 160.84V240.75H578.568Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M587.552 161.832H594.825L591.036 143.026L587.552 161.832Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M635.894 120.802H605.581V241.081H635.894V120.802Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path ~opacity:(("0.6")) - ~d:(("M182.059 188.303H169.531V240.695H182.059V188.303Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M250.141 150.968H205.588V153.064H250.141V150.968Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M252.096 147.99H203.572V151.74H252.096V147.99Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path ~opacity:(("0.4")) - ~d:(("M228.751 241.246V147.99H203.572V151.685H205.588V241.246H228.751Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M331.606 121.298H291.759V124.166H331.606V121.298Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M336.801 199.664H334.173V209.701H336.801V199.664Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M336.801 199.664H334.173V205.014H336.801V199.664Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M338.94 211.962H337.106V213.672H338.94V211.962Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M343.34 211.962H341.506V213.672H343.34V211.962Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M347.801 211.962H345.968V213.672H347.801V211.962Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M352.201 211.962H350.368V213.672H352.201V211.962Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M356.602 211.962H354.768V213.672H356.602V211.962Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M361.002 211.962H359.168V213.672H361.002V211.962Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M365.402 211.962H363.569V213.672H365.402V211.962Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M339.795 217.146H337.473V219.242H339.795V217.146Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M345.234 217.146H342.912V219.242H345.234V217.146Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M350.673 217.146H348.351V219.242H350.673V217.146Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M356.052 217.146H353.79V219.242H356.052V217.146Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M361.552 217.146H359.229V219.242H361.552V217.146Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M366.991 217.146H364.669V219.242H366.991V217.146Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M372.43 217.146H370.108V219.242H372.43V217.146Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M480.175 181.52H478.769V183.175H480.175V181.52Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M483.536 181.52H482.13V183.175H483.536V181.52Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M486.836 181.52H485.43V183.175H486.836V181.52Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M490.197 181.52H488.792V183.175H490.197V181.52Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M493.498 181.52H492.092V183.175H493.498V181.52Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M496.859 181.52H495.453V183.175H496.859V181.52Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M500.22 181.52H498.814V183.175H500.22V181.52Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M503.337 181.52H501.931V183.175H503.337V181.52Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M507.493 181.52H506.087V183.175H507.493V181.52Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M480.175 184.774H478.769V186.428H480.175V184.774Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M483.536 184.774H482.13V186.428H483.536V184.774Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M486.836 184.774H485.43V186.428H486.836V184.774Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M490.197 184.774H488.792V186.428H490.197V184.774Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M493.498 184.774H492.092V186.428H493.498V184.774Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M496.859 184.774H495.453V186.428H496.859V184.774Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M500.22 184.774H498.814V186.428H500.22V184.774Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M503.337 184.774H501.931V186.428H503.337V184.774Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M507.493 184.774H506.087V186.428H507.493V184.774Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M480.175 188.083H478.769V189.737H480.175V188.083Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M483.536 188.083H482.13V189.737H483.536V188.083Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M486.836 188.083H485.43V189.737H486.836V188.083Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M490.197 188.083H488.792V189.737H490.197V188.083Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M493.498 188.083H492.092V189.737H493.498V188.083Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M496.859 188.083H495.453V189.737H496.859V188.083Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M500.22 188.083H498.814V189.737H500.22V188.083Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M503.337 188.083H501.931V189.737H503.337V188.083Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M507.493 188.083H506.087V189.737H507.493V188.083Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M480.175 191.392H478.769V193.046H480.175V191.392Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M483.536 191.392H482.13V193.046H483.536V191.392Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M486.836 191.392H485.43V193.046H486.836V191.392Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M490.197 191.392H488.792V193.046H490.197V191.392Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M493.498 191.392H492.092V193.046H493.498V191.392Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M496.859 191.392H495.453V193.046H496.859V191.392Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M500.22 191.392H498.814V193.046H500.22V191.392Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M503.337 191.392H501.931V193.046H503.337V191.392Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M507.493 191.392H506.087V193.046H507.493V191.392Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M480.175 194.646H478.769V196.3H480.175V194.646Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M483.536 194.646H482.13V196.3H483.536V194.646Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M486.836 194.646H485.43V196.3H486.836V194.646Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M490.197 194.646H488.792V196.3H490.197V194.646Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M493.498 194.646H492.092V196.3H493.498V194.646Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M496.859 194.646H495.453V196.3H496.859V194.646Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M500.22 194.646H498.814V196.3H500.22V194.646Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M503.337 194.646H501.931V196.3H503.337V194.646Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M507.493 194.646H506.087V196.3H507.493V194.646Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M480.175 197.954H478.769V199.609H480.175V197.954Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M483.536 197.954H482.13V199.609H483.536V197.954Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M486.836 197.954H485.43V199.609H486.836V197.954Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M490.197 197.954H488.792V199.609H490.197V197.954Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M493.498 197.954H492.092V199.609H493.498V197.954Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M496.859 197.954H495.453V199.609H496.859V197.954Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M500.22 197.954H498.814V199.609H500.22V197.954Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M503.337 197.954H501.931V199.609H503.337V197.954Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M507.493 197.954H506.087V199.609H507.493V197.954Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M480.175 201.263H478.769V202.918H480.175V201.263Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M483.536 201.263H482.13V202.918H483.536V201.263Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M486.836 201.263H485.43V202.918H486.836V201.263Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M490.197 201.263H488.792V202.918H490.197V201.263Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M493.498 201.263H492.092V202.918H493.498V201.263Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M496.859 201.263H495.453V202.918H496.859V201.263Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M500.22 201.263H498.814V202.918H500.22V201.263Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M503.337 201.263H501.931V202.918H503.337V201.263Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M507.493 201.263H506.087V202.918H507.493V201.263Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M480.175 204.517H478.769V206.172H480.175V204.517Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M483.536 204.517H482.13V206.172H483.536V204.517Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M486.836 204.517H485.43V206.172H486.836V204.517Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M490.197 204.517H488.792V206.172H490.197V204.517Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M493.498 204.517H492.092V206.172H493.498V204.517Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M496.859 204.517H495.453V206.172H496.859V204.517Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M500.22 204.517H498.814V206.172H500.22V204.517Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M503.337 204.517H501.931V206.172H503.337V204.517Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M507.493 204.517H506.087V206.172H507.493V204.517Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M480.175 207.826H478.769V209.481H480.175V207.826Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M483.536 207.826H482.13V209.481H483.536V207.826Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M486.836 207.826H485.43V209.481H486.836V207.826Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M490.197 207.826H488.792V209.481H490.197V207.826Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M493.498 207.826H492.092V209.481H493.498V207.826Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M496.859 207.826H495.453V209.481H496.859V207.826Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M500.22 207.826H498.814V209.481H500.22V207.826Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M503.337 207.826H501.931V209.481H503.337V207.826Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M507.493 207.826H506.087V209.481H507.493V207.826Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M480.175 211.135H478.769V212.789H480.175V211.135Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M483.536 211.135H482.13V212.789H483.536V211.135Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M486.836 211.135H485.43V212.789H486.836V211.135Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M490.197 211.135H488.792V212.789H490.197V211.135Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M493.498 211.135H492.092V212.789H493.498V211.135Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M496.859 211.135H495.453V212.789H496.859V211.135Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M500.22 211.135H498.814V212.789H500.22V211.135Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M503.337 211.135H501.931V212.789H503.337V211.135Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M507.493 211.135H506.087V212.789H507.493V211.135Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M480.175 214.389H478.769V216.043H480.175V214.389Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M483.536 214.389H482.13V216.043H483.536V214.389Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M486.836 214.389H485.43V216.043H486.836V214.389Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M490.197 214.389H488.792V216.043H490.197V214.389Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M493.498 214.389H492.092V216.043H493.498V214.389Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M496.859 214.389H495.453V216.043H496.859V214.389Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M500.22 214.389H498.814V216.043H500.22V214.389Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M503.337 214.389H501.931V216.043H503.337V214.389Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M507.493 214.389H506.087V216.043H507.493V214.389Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M480.175 217.698H478.769V219.352H480.175V217.698Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M483.536 217.698H482.13V219.352H483.536V217.698Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M486.836 217.698H485.43V219.352H486.836V217.698Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M490.197 217.698H488.792V219.352H490.197V217.698Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M493.498 217.698H492.092V219.352H493.498V217.698Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M496.859 217.698H495.453V219.352H496.859V217.698Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M500.22 217.698H498.814V219.352H500.22V217.698Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M503.337 217.698H501.931V219.352H503.337V217.698Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M507.493 217.698H506.087V219.352H507.493V217.698Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M360.88 197.844H334.173V203.911H360.88V197.844Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M337.84 199.333H336.312V200.712H337.84V199.333Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M341.384 199.333H339.856V200.712H341.384V199.333Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M344.929 199.333H343.401V200.712H344.929V199.333Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M348.473 199.333H346.946V200.712H348.473V199.333Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M352.079 199.333H350.551V200.712H352.079V199.333Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M355.624 199.333H354.096V200.712H355.624V199.333Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M359.168 199.333H357.641V200.712H359.168V199.333Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~opacity:(("0.5")) - ~d:(("M368.274 212.459H334.173V215.216H368.274V212.459Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M446.317 186.594H443.811V188.028H446.317V186.594Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M449.617 186.594H447.112V188.028H449.617V186.594Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M452.918 186.594H450.412V188.028H452.918V186.594Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M456.157 186.594H453.651V188.028H456.157V186.594Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M459.457 186.594H456.951V188.028H459.457V186.594Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M462.757 186.594H460.251V188.028H462.757V186.594Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M446.317 188.524H443.811V189.958H446.317V188.524Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M449.617 188.524H447.112V189.958H449.617V188.524Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M452.918 188.524H450.412V189.958H452.918V188.524Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M456.157 188.524H453.651V189.958H456.157V188.524Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M459.457 188.524H456.951V189.958H459.457V188.524Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M462.757 188.524H460.251V189.958H462.757V188.524Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M446.317 190.454H443.811V191.888H446.317V190.454Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M449.617 190.454H447.112V191.888H449.617V190.454Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M452.918 190.454H450.412V191.888H452.918V190.454Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M456.157 190.454H453.651V191.888H456.157V190.454Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M459.457 190.454H456.951V191.888H459.457V190.454Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M462.757 190.454H460.251V191.888H462.757V190.454Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~opacity:(("0.5")) - ~d:(("M465.996 190.454H441.306V192.55H465.996V190.454Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M444.362 195.473H434.767V198.892H444.362V195.473Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M454.69 195.473H445.095V198.892H454.69V195.473Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M464.957 195.473H455.362V198.892H464.957V195.473Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M475.224 195.473H465.629V198.892H475.224V195.473Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M444.362 199.609H434.767V203.028H444.362V199.609Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M454.69 199.609H445.095V203.028H454.69V199.609Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M464.957 199.609H455.362V203.028H464.957V199.609Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M475.224 199.609H465.629V203.028H475.224V199.609Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M444.362 203.8H434.767V207.219H444.362V203.8Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M454.69 203.8H445.095V207.219H454.69V203.8Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M464.957 203.8H455.362V207.219H464.957V203.8Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M475.224 203.8H465.629V207.219H475.224V203.8Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M444.362 207.936H434.767V211.356H444.362V207.936Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M454.69 207.936H445.095V211.356H454.69V207.936Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M464.957 207.936H455.362V211.356H464.957V207.936Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M475.224 207.936H465.629V211.356H475.224V207.936Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M444.362 212.073H434.767V215.492H444.362V212.073Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M454.69 212.073H445.095V215.492H454.69V212.073Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M464.957 212.073H455.362V215.492H464.957V212.073Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M475.224 212.073H465.629V215.492H475.224V212.073Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M444.362 216.209H434.767V219.628H444.362V216.209Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M454.69 216.209H445.095V219.628H454.69V216.209Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M464.957 216.209H455.362V219.628H464.957V216.209Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M475.224 216.209H465.629V219.628H475.224V216.209Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~opacity:(("0.6")) - ~d:(("M476.141 192.55H467.402V240.474H476.141V192.55Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M569.646 126.647H559.745V134.313H569.646V126.647Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M569.646 130.287H559.745V133.431H569.646V130.287Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M566.468 110.379H564.695V128.853H566.468V110.379Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M573.863 132.383H550.578V240.474H573.863V132.383Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M573.863 131.17H550.578V239.261H573.863V131.17Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M553.023 140.765H551.678V142.034H553.023V140.765Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M556.262 140.765H554.917V142.034H556.262V140.765Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M559.501 140.765H558.156V142.034H559.501V140.765Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M562.74 140.765H561.396V142.034H562.74V140.765Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M565.979 140.765H564.634V142.034H565.979V140.765Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M569.157 140.765H567.812V142.034H569.157V140.765Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M572.396 140.765H571.052V142.034H572.396V140.765Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M553.023 143.743H551.678V145.012H553.023V143.743Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M556.262 143.743H554.917V145.012H556.262V143.743Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M559.501 143.743H558.156V145.012H559.501V143.743Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M562.74 143.743H561.396V145.012H562.74V143.743Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M565.979 143.743H564.634V145.012H565.979V143.743Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M569.157 143.743H567.812V145.012H569.157V143.743Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M572.396 143.743H571.052V145.012H572.396V143.743Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M553.023 149.865H551.678V151.133H553.023V149.865Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M556.262 149.865H554.917V151.133H556.262V149.865Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M559.501 149.865H558.156V151.133H559.501V149.865Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M562.74 149.865H561.396V151.133H562.74V149.865Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M565.979 149.865H564.634V151.133H565.979V149.865Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M569.157 149.865H567.812V151.133H569.157V149.865Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M572.396 149.865H571.052V151.133H572.396V149.865Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M553.023 152.843H551.678V154.111H553.023V152.843Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M556.262 152.843H554.917V154.111H556.262V152.843Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M559.501 152.843H558.156V154.111H559.501V152.843Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M562.74 152.843H561.396V154.111H562.74V152.843Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M565.979 152.843H564.634V154.111H565.979V152.843Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M569.157 152.843H567.812V154.111H569.157V152.843Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M572.396 152.843H571.052V154.111H572.396V152.843Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M553.023 158.964H551.678V160.233H553.023V158.964Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M556.262 158.964H554.917V160.233H556.262V158.964Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M559.501 158.964H558.156V160.233H559.501V158.964Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M562.74 158.964H561.396V160.233H562.74V158.964Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M565.979 158.964H564.634V160.233H565.979V158.964Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M569.157 158.964H567.812V160.233H569.157V158.964Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M572.396 158.964H571.052V160.233H572.396V158.964Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M553.023 161.942H551.678V163.211H553.023V161.942Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M556.262 161.942H554.917V163.211H556.262V161.942Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M559.501 161.942H558.156V163.211H559.501V161.942Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M562.74 161.942H561.396V163.211H562.74V161.942Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M565.979 161.942H564.634V163.211H565.979V161.942Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M569.157 161.942H567.812V163.211H569.157V161.942Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M572.396 161.942H571.052V163.211H572.396V161.942Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M553.023 168.064H551.678V169.332H553.023V168.064Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M556.262 168.064H554.917V169.332H556.262V168.064Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M559.501 168.064H558.156V169.332H559.501V168.064Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M562.74 168.064H561.396V169.332H562.74V168.064Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M565.979 168.064H564.634V169.332H565.979V168.064Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M569.157 168.064H567.812V169.332H569.157V168.064Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M572.396 168.064H571.052V169.332H572.396V168.064Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M553.023 171.042H551.678V172.31H553.023V171.042Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M556.262 171.042H554.917V172.31H556.262V171.042Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M559.501 171.042H558.156V172.31H559.501V171.042Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M562.74 171.042H561.396V172.31H562.74V171.042Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M565.979 171.042H564.634V172.31H565.979V171.042Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M569.157 171.042H567.812V172.31H569.157V171.042Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M572.396 171.042H571.052V172.31H572.396V171.042Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M553.023 177.163H551.678V178.432H553.023V177.163Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M556.262 177.163H554.917V178.432H556.262V177.163Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M559.501 177.163H558.156V178.432H559.501V177.163Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M562.74 177.163H561.396V178.432H562.74V177.163Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M565.979 177.163H564.634V178.432H565.979V177.163Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M569.157 177.163H567.812V178.432H569.157V177.163Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M572.396 177.163H571.052V178.432H572.396V177.163Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M553.023 180.141H551.678V181.41H553.023V180.141Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M556.262 180.141H554.917V181.41H556.262V180.141Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M559.501 180.141H558.156V181.41H559.501V180.141Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M562.74 180.141H561.396V181.41H562.74V180.141Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M565.979 180.141H564.634V181.41H565.979V180.141Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M569.157 180.141H567.812V181.41H569.157V180.141Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M572.396 180.141H571.052V181.41H572.396V180.141Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M553.023 186.263H551.678V187.531H553.023V186.263Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M556.262 186.263H554.917V187.531H556.262V186.263Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M559.501 186.263H558.156V187.531H559.501V186.263Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M562.74 186.263H561.396V187.531H562.74V186.263Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M565.979 186.263H564.634V187.531H565.979V186.263Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M569.157 186.263H567.812V187.531H569.157V186.263Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M572.396 186.263H571.052V187.531H572.396V186.263Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M553.023 189.241H551.678V190.509H553.023V189.241Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M556.262 189.241H554.917V190.509H556.262V189.241Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M559.501 189.241H558.156V190.509H559.501V189.241Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M562.74 189.241H561.396V190.509H562.74V189.241Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M565.979 189.241H564.634V190.509H565.979V189.241Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M569.157 189.241H567.812V190.509H569.157V189.241Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M572.396 189.241H571.052V190.509H572.396V189.241Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M553.023 195.307H551.678V196.576H553.023V195.307Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M556.262 195.307H554.917V196.576H556.262V195.307Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M559.501 195.307H558.156V196.576H559.501V195.307Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M562.74 195.307H561.396V196.576H562.74V195.307Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M565.979 195.307H564.634V196.576H565.979V195.307Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M569.157 195.307H567.812V196.576H569.157V195.307Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M572.396 195.307H571.052V196.576H572.396V195.307Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M553.023 198.341H551.678V199.609H553.023V198.341Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M556.262 198.341H554.917V199.609H556.262V198.341Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M559.501 198.341H558.156V199.609H559.501V198.341Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M562.74 198.341H561.396V199.609H562.74V198.341Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M565.979 198.341H564.634V199.609H565.979V198.341Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M569.157 198.341H567.812V199.609H569.157V198.341Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M572.396 198.341H571.052V199.609H572.396V198.341Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M553.023 204.407H551.678V205.675H553.023V204.407Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M556.262 204.407H554.917V205.675H556.262V204.407Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M559.501 204.407H558.156V205.675H559.501V204.407Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M562.74 204.407H561.396V205.675H562.74V204.407Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M565.979 204.407H564.634V205.675H565.979V204.407Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M569.157 204.407H567.812V205.675H569.157V204.407Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M572.396 204.407H571.052V205.675H572.396V204.407Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M553.023 207.44H551.678V208.708H553.023V207.44Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M556.262 207.44H554.917V208.708H556.262V207.44Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M559.501 207.44H558.156V208.708H559.501V207.44Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M562.74 207.44H561.396V208.708H562.74V207.44Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M565.979 207.44H564.634V208.708H565.979V207.44Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M569.157 207.44H567.812V208.708H569.157V207.44Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M572.396 207.44H571.052V208.708H572.396V207.44Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M553.023 213.506H551.678V214.775H553.023V213.506Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M556.262 213.506H554.917V214.775H556.262V213.506Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M559.501 213.506H558.156V214.775H559.501V213.506Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M562.74 213.506H561.396V214.775H562.74V213.506Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M565.979 213.506H564.634V214.775H565.979V213.506Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M569.157 213.506H567.812V214.775H569.157V213.506Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M572.396 213.506H571.052V214.775H572.396V213.506Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M553.023 216.484H551.678V217.753H553.023V216.484Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M556.262 216.484H554.917V217.753H556.262V216.484Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M559.501 216.484H558.156V217.753H559.501V216.484Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M562.74 216.484H561.396V217.753H562.74V216.484Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M565.979 216.484H564.634V217.753H565.979V216.484Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M569.157 216.484H567.812V217.753H569.157V216.484Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M572.396 216.484H571.052V217.753H572.396V216.484Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M553.023 222.606H551.678V223.874H553.023V222.606Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M556.262 222.606H554.917V223.874H556.262V222.606Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M559.501 222.606H558.156V223.874H559.501V222.606Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M562.74 222.606H561.396V223.874H562.74V222.606Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M565.979 222.606H564.634V223.874H565.979V222.606Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M569.157 222.606H567.812V223.874H569.157V222.606Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M572.396 222.606H571.052V223.874H572.396V222.606Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M553.023 225.584H551.678V226.852H553.023V225.584Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M556.262 225.584H554.917V226.852H556.262V225.584Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M559.501 225.584H558.156V226.852H559.501V225.584Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M562.74 225.584H561.396V226.852H562.74V225.584Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M565.979 225.584H564.634V226.852H565.979V225.584Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M569.157 225.584H567.812V226.852H569.157V225.584Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M572.396 225.584H571.052V226.852H572.396V225.584Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M553.023 231.705H551.678V232.974H553.023V231.705Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M556.262 231.705H554.917V232.974H556.262V231.705Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M559.501 231.705H558.156V232.974H559.501V231.705Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M562.74 231.705H561.396V232.974H562.74V231.705Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M565.979 231.705H564.634V232.974H565.979V231.705Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M569.157 231.705H567.812V232.974H569.157V231.705Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M572.396 231.705H571.052V232.974H572.396V231.705Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M553.023 234.683H551.678V235.952H553.023V234.683Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M556.262 234.683H554.917V235.952H556.262V234.683Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M559.501 234.683H558.156V235.952H559.501V234.683Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M562.74 234.683H561.396V235.952H562.74V234.683Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M565.979 234.683H564.634V235.952H565.979V234.683Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M569.157 234.683H567.812V235.952H569.157V234.683Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M572.396 234.683H571.052V235.952H572.396V234.683Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~opacity:(("0.3")) - ~d:(("M573.863 230.988H550.578V240.474H573.863V230.988Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path ~opacity:(("0.6")) - ~d:(("M562.068 131.17H550.578V240.364H562.068V131.17Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M531.877 158.964L549.05 181.741L530.594 206.282L514.765 181.741L531.877 158.964Z") - ) ~stroke:(("#E37056")) - ~stroke_width:(("3")) - ~stroke_miterlimit:(("10")) - ~stroke_linecap:(("round")) - ~stroke_linejoin:(("round")) ~children:[] - ()) - [@JSX ]); - ((path - ~d:(("M579.73 161.667H584.986L590.425 143.247L579.73 161.667Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M602.77 161.667H597.575L591.586 143.247L602.77 161.667Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M590.058 165.251H589.386V180.472H590.058V165.251Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M588.897 165.858H588.225V181.079H588.897V165.858Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M587.797 166.41H587.125V181.631H587.797V166.41Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M586.697 167.016H586.025V182.237H586.697V167.016Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M585.536 167.623H584.863V182.844H585.536V167.623Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M584.435 168.174H583.763V183.395H584.435V168.174Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M583.336 168.781H582.663V184.002H583.336V168.781Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M582.174 169.332H581.502V184.553H582.174V169.332Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M593.542 165.251H592.869V180.472H593.542V165.251Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M594.703 165.858H594.03V181.079H594.703V165.858Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M595.803 166.41H595.13V181.631H595.803V166.41Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M596.903 167.016H596.231V182.237H596.903V167.016Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M598.064 167.623H597.392V182.844H598.064V167.623Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M599.164 168.174H598.492V183.395H599.164V168.174Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M600.264 168.781H599.592V184.002H600.264V168.781Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M601.425 169.332H600.753V184.553H601.425V169.332Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M590.058 182.734H589.386V197.955H590.058V182.734Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M588.897 183.285H588.225V198.506H588.897V183.285Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M587.797 183.892H587.125V199.113H587.797V183.892Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M586.697 184.443H586.025V199.664H586.697V184.443Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M585.536 185.05H584.863V200.271H585.536V185.05Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M584.435 185.656H583.763V200.877H584.435V185.656Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M583.336 186.208H582.663V201.429H583.336V186.208Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M582.174 186.815H581.502V202.036H582.174V186.815Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M593.542 182.734H592.869V197.955H593.542V182.734Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M594.703 183.285H594.03V198.506H594.703V183.285Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M595.803 183.892H595.13V199.113H595.803V183.892Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M596.903 184.443H596.231V199.664H596.903V184.443Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M598.064 185.05H597.392V200.271H598.064V185.05Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M599.164 185.656H598.492V200.877H599.164V185.656Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M600.264 186.208H599.592V201.429H600.264V186.208Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M601.425 186.814H600.753V202.035H601.425V186.814Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M590.058 200.16H589.386V215.381H590.058V200.16Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M588.897 200.767H588.225V215.988H588.897V200.767Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M587.797 201.319H587.125V216.54H587.797V201.319Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M586.697 201.925H586.025V217.146H586.697V201.925Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M585.536 202.532H584.863V217.753H585.536V202.532Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M584.435 203.083H583.763V218.304H584.435V203.083Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M583.336 203.69H582.663V218.911H583.336V203.69Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M582.174 204.241H581.502V219.462H582.174V204.241Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M593.542 200.16H592.869V215.381H593.542V200.16Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M594.703 200.767H594.03V215.988H594.703V200.767Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M595.803 201.318H595.13V216.54H595.803V201.318Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M596.903 201.925H596.231V217.146H596.903V201.925Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M598.064 202.532H597.392V217.753H598.064V202.532Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M599.164 203.083H598.492V218.304H599.164V203.083Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M600.264 203.69H599.592V218.911H600.264V203.69Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M601.425 204.241H600.753V219.462H601.425V204.241Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M590.058 217.643H589.386V232.864H590.058V217.643Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M588.897 218.194H588.225V233.415H588.897V218.194Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M587.797 218.801H587.125V234.022H587.797V218.801Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M586.697 219.407H586.025V234.628H586.697V219.407Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M585.536 219.959H584.863V235.18H585.536V219.959Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M584.435 220.565H583.763V235.786H584.435V220.565Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M583.336 221.117H582.663V236.338H583.336V221.117Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M582.174 221.724H581.502V236.945H582.174V221.724Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M593.542 217.643H592.869V232.864H593.542V217.643Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M594.703 218.194H594.03V233.415H594.703V218.194Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M595.803 218.801H595.13V234.022H595.803V218.801Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M596.903 219.407H596.231V234.628H596.903V219.407Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M598.064 219.959H597.392V235.18H598.064V219.959Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M599.164 220.565H598.492V235.786H599.164V220.565Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M600.264 221.117H599.592V236.338H600.264V221.117Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M601.425 221.724H600.753V236.945H601.425V221.724Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M609.92 134.258H608.331V135.692H609.92V134.258Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M614.565 134.258H612.976V135.692H614.565V134.258Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M619.21 134.258H617.62V135.692H619.21V134.258Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M623.854 134.258H622.265V135.692H623.854V134.258Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M628.499 134.258H626.91V135.692H628.499V134.258Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M633.144 134.258H631.555V135.692H633.144V134.258Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M609.92 137.622H608.331V139.056H609.92V137.622Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M614.565 137.622H612.976V139.056H614.565V137.622Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M619.21 137.622H617.62V139.056H619.21V137.622Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M623.854 137.622H622.265V139.056H623.854V137.622Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M628.499 137.622H626.91V139.056H628.499V137.622Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M633.144 137.622H631.555V139.056H633.144V137.622Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M609.92 141.041H608.331V142.475H609.92V141.041Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M614.565 141.041H612.976V142.475H614.565V141.041Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M619.21 141.041H617.62V142.475H619.21V141.041Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M623.854 141.041H622.265V142.475H623.854V141.041Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M628.499 141.041H626.91V142.475H628.499V141.041Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M633.144 141.041H631.555V142.475H633.144V141.041Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M609.92 144.405H608.331V145.839H609.92V144.405Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M614.565 144.405H612.976V145.839H614.565V144.405Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M619.21 144.405H617.62V145.839H619.21V144.405Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M623.854 144.405H622.265V145.839H623.854V144.405Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M628.499 144.405H626.91V145.839H628.499V144.405Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M633.144 144.405H631.555V145.839H633.144V144.405Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M609.92 147.769H608.331V149.203H609.92V147.769Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M614.565 147.769H612.976V149.203H614.565V147.769Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M619.21 147.769H617.62V149.203H619.21V147.769Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M623.854 147.769H622.265V149.203H623.854V147.769Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M628.499 147.769H626.91V149.203H628.499V147.769Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M633.144 147.769H631.555V149.203H633.144V147.769Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M609.92 151.188H608.331V152.622H609.92V151.188Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M614.565 151.188H612.976V152.622H614.565V151.188Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M619.21 151.188H617.62V152.622H619.21V151.188Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M623.854 151.188H622.265V152.622H623.854V151.188Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M628.499 151.188H626.91V152.622H628.499V151.188Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M633.144 151.188H631.555V152.622H633.144V151.188Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M609.92 154.553H608.331V155.986H609.92V154.553Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M614.565 154.553H612.976V155.986H614.565V154.553Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M619.21 154.553H617.62V155.986H619.21V154.553Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M623.854 154.553H622.265V155.986H623.854V154.553Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M628.499 154.553H626.91V155.986H628.499V154.553Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M633.144 154.553H631.555V155.986H633.144V154.553Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M609.92 157.972H608.331V159.406H609.92V157.972Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M614.565 157.972H612.976V159.406H614.565V157.972Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M619.21 157.972H617.62V159.406H619.21V157.972Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M623.854 157.972H622.265V159.406H623.854V157.972Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M628.499 157.972H626.91V159.406H628.499V157.972Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M633.144 157.972H631.555V159.406H633.144V157.972Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M609.92 161.336H608.331V162.77H609.92V161.336Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M614.565 161.336H612.976V162.77H614.565V161.336Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M619.21 161.336H617.62V162.77H619.21V161.336Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M623.854 161.336H622.265V162.77H623.854V161.336Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M628.499 161.336H626.91V162.77H628.499V161.336Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M633.144 161.336H631.555V162.77H633.144V161.336Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M609.92 164.7H608.331V166.134H609.92V164.7Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M614.565 164.7H612.976V166.134H614.565V164.7Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M619.21 164.7H617.62V166.134H619.21V164.7Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M623.854 164.7H622.265V166.134H623.854V164.7Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M628.499 164.7H626.91V166.134H628.499V164.7Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M633.144 164.7H631.555V166.134H633.144V164.7Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M609.92 168.119H608.331V169.553H609.92V168.119Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M614.565 168.119H612.976V169.553H614.565V168.119Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M619.21 168.119H617.62V169.553H619.21V168.119Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M623.854 168.119H622.265V169.553H623.854V168.119Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M628.499 168.119H626.91V169.553H628.499V168.119Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M633.144 168.119H631.555V169.553H633.144V168.119Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M609.92 171.483H608.331V172.917H609.92V171.483Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M614.565 171.483H612.976V172.917H614.565V171.483Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M619.21 171.483H617.62V172.917H619.21V171.483Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M623.854 171.483H622.265V172.917H623.854V171.483Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M628.499 171.483H626.91V172.917H628.499V171.483Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M633.144 171.483H631.555V172.917H633.144V171.483Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M609.92 174.902H608.331V176.336H609.92V174.902Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M614.565 174.902H612.976V176.336H614.565V174.902Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M619.21 174.902H617.62V176.336H619.21V174.902Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M623.854 174.902H622.265V176.336H623.854V174.902Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M628.499 174.902H626.91V176.336H628.499V174.902Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M633.144 174.902H631.555V176.336H633.144V174.902Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M609.92 178.266H608.331V179.7H609.92V178.266Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M614.565 178.266H612.976V179.7H614.565V178.266Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M619.21 178.266H617.62V179.7H619.21V178.266Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M623.854 178.266H622.265V179.7H623.854V178.266Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M628.499 178.266H626.91V179.7H628.499V178.266Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M633.144 178.266H631.555V179.7H633.144V178.266Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M609.92 181.63H608.331V183.064H609.92V181.63Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M614.565 181.63H612.976V183.064H614.565V181.63Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M619.21 181.63H617.62V183.064H619.21V181.63Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M623.854 181.63H622.265V183.064H623.854V181.63Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M628.499 181.63H626.91V183.064H628.499V181.63Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M633.144 181.63H631.555V183.064H633.144V181.63Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M609.92 185.05H608.331V186.484H609.92V185.05Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M614.565 185.05H612.976V186.484H614.565V185.05Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M619.21 185.05H617.62V186.484H619.21V185.05Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M623.854 185.05H622.265V186.484H623.854V185.05Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M628.499 185.05H626.91V186.484H628.499V185.05Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M633.144 185.05H631.555V186.484H633.144V185.05Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M609.92 188.414H608.331V189.848H609.92V188.414Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M614.565 188.414H612.976V189.848H614.565V188.414Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M619.21 188.414H617.62V189.848H619.21V188.414Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M623.854 188.414H622.265V189.848H623.854V188.414Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M628.499 188.414H626.91V189.848H628.499V188.414Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M633.144 188.414H631.555V189.848H633.144V188.414Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M609.92 191.833H608.331V193.267H609.92V191.833Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M614.565 191.833H612.976V193.267H614.565V191.833Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M619.21 191.833H617.62V193.267H619.21V191.833Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M623.854 191.833H622.265V193.267H623.854V191.833Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M628.499 191.833H626.91V193.267H628.499V191.833Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M633.144 191.833H631.555V193.267H633.144V191.833Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M609.92 195.197H608.331V196.631H609.92V195.197Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M614.565 195.197H612.976V196.631H614.565V195.197Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M619.21 195.197H617.62V196.631H619.21V195.197Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M623.854 195.197H622.265V196.631H623.854V195.197Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M628.499 195.197H626.91V196.631H628.499V195.197Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M633.144 195.197H631.555V196.631H633.144V195.197Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M609.92 198.616H608.331V200.05H609.92V198.616Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M614.565 198.616H612.976V200.05H614.565V198.616Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M619.21 198.616H617.62V200.05H619.21V198.616Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M623.854 198.616H622.265V200.05H623.854V198.616Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M628.499 198.616H626.91V200.05H628.499V198.616Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M633.144 198.616H631.555V200.05H633.144V198.616Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M609.92 201.925H608.331V203.359H609.92V201.925Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M614.565 201.925H612.976V203.359H614.565V201.925Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M619.21 201.925H617.62V203.359H619.21V201.925Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M623.854 201.925H622.265V203.359H623.854V201.925Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M628.499 201.925H626.91V203.359H628.499V201.925Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M633.144 201.925H631.555V203.359H633.144V201.925Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M609.92 205.344H608.331V206.778H609.92V205.344Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M614.565 205.344H612.976V206.778H614.565V205.344Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M619.21 205.344H617.62V206.778H619.21V205.344Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M623.854 205.344H622.265V206.778H623.854V205.344Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M628.499 205.344H626.91V206.778H628.499V205.344Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M633.144 205.344H631.555V206.778H633.144V205.344Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M609.92 208.708H608.331V210.142H609.92V208.708Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M614.565 208.708H612.976V210.142H614.565V208.708Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M619.21 208.708H617.62V210.142H619.21V208.708Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M623.854 208.708H622.265V210.142H623.854V208.708Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M628.499 208.708H626.91V210.142H628.499V208.708Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M633.144 208.708H631.555V210.142H633.144V208.708Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M609.92 212.073H608.331V213.506H609.92V212.073Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M614.565 212.073H612.976V213.506H614.565V212.073Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M619.21 212.073H617.62V213.506H619.21V212.073Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M623.854 212.073H622.265V213.506H623.854V212.073Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M628.499 212.073H626.91V213.506H628.499V212.073Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M633.144 212.073H631.555V213.506H633.144V212.073Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M609.92 215.492H608.331V216.926H609.92V215.492Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M614.565 215.492H612.976V216.926H614.565V215.492Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M619.21 215.492H617.62V216.926H619.21V215.492Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M623.854 215.492H622.265V216.926H623.854V215.492Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M628.499 215.492H626.91V216.926H628.499V215.492Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M633.144 215.492H631.555V216.926H633.144V215.492Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M609.92 218.856H608.331V220.29H609.92V218.856Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M614.565 218.856H612.976V220.29H614.565V218.856Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M619.21 218.856H617.62V220.29H619.21V218.856Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M623.854 218.856H622.265V220.29H623.854V218.856Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M628.499 218.856H626.91V220.29H628.499V218.856Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M633.144 218.856H631.555V220.29H633.144V218.856Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M609.92 222.275H608.331V223.709H609.92V222.275Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M614.565 222.275H612.976V223.709H614.565V222.275Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M619.21 222.275H617.62V223.709H619.21V222.275Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M623.854 222.275H622.265V223.709H623.854V222.275Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M628.499 222.275H626.91V223.709H628.499V222.275Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M633.144 222.275H631.555V223.709H633.144V222.275Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M609.92 225.639H608.331V227.073H609.92V225.639Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M614.565 225.639H612.976V227.073H614.565V225.639Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M619.21 225.639H617.62V227.073H619.21V225.639Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M623.854 225.639H622.265V227.073H623.854V225.639Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M628.499 225.639H626.91V227.073H628.499V225.639Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M633.144 225.639H631.555V227.073H633.144V225.639Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M609.92 229.003H608.331V230.437H609.92V229.003Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M614.565 229.003H612.976V230.437H614.565V229.003Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M619.21 229.003H617.62V230.437H619.21V229.003Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M623.854 229.003H622.265V230.437H623.854V229.003Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M628.499 229.003H626.91V230.437H628.499V229.003Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M633.144 229.003H631.555V230.437H633.144V229.003Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M609.92 232.422H608.331V233.856H609.92V232.422Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M614.565 232.422H612.976V233.856H614.565V232.422Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~d:(("M619.21 232.422H617.62V233.856H619.21V232.422Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M623.854 232.422H622.265V233.856H623.854V232.422Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M628.499 232.422H626.91V233.856H628.499V232.422Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M633.144 232.422H631.555V233.856H633.144V232.422Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~opacity:(("0.7")) - ~d:(("M635.894 230.713H605.581V240.474H635.894V230.713Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path ~class_name:(("HeroGraphic-cloudRight") - ) ~opacity:(("0.7")) - ~d:(("M609.126 61.903H757.878C757.878 61.903 760.078 50.3218 744.127 48.3364C744.127 48.3364 742.232 27.7108 719.742 20.3761C697.252 13.0413 686.924 24.3468 686.924 24.3468C686.924 24.3468 680.018 16.8466 670.973 17.8944C661.928 18.9422 658.139 29.4205 658.139 29.4205C658.139 29.4205 652.822 26.0564 647.2 28.869C641.577 31.6815 641.883 35.3765 641.883 35.3765C641.883 35.3765 635.405 33.9426 630.821 33.6669C626.238 33.3912 604.237 34.825 609.126 61.903Z") - ) ~fill:(("white")) - ~children:[] ()) - [@JSX ]); - ((path ~opacity:(("0.5")) - ~d:(("M406.715 74.3666H472.413C472.413 74.3666 472.169 68.2451 465.079 68.2451C465.079 68.2451 463.063 64.8258 452.918 62.7302C442.773 60.6897 432.139 65.4876 432.139 65.4876C432.139 65.4876 429.45 63.8883 426.455 63.8883C423.461 63.8883 422.422 67.3075 422.422 67.3075C422.422 67.3075 406.715 64.881 406.715 74.3666Z") - ) ~fill:(("white")) - ~children:[] ()) - [@JSX ]); - ((path ~opacity:(("0.5")) - ~d:(("M233.09 126.647H283.02C283.02 126.647 277.581 121.022 267.192 117.493C256.802 113.963 250.141 117.493 250.141 117.493C250.141 117.493 247.207 114.68 242.807 117.493C238.407 120.305 239.385 121.298 239.385 121.298C239.385 121.298 231.99 120.36 233.09 126.647Z") - ) ~fill:(("white")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M173.992 45.193C173.992 39.0715 178.392 33.9427 184.504 32.1779C183.037 31.7367 181.509 31.5161 179.859 31.5161C171.487 31.5161 164.703 37.6376 164.703 45.193C164.703 52.7483 171.487 58.8698 179.859 58.8698C181.509 58.8698 183.037 58.6492 184.504 58.208C178.454 56.4433 173.992 51.3145 173.992 45.193Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M245.863 68.4656L246.474 69.5686L247.818 69.734L246.84 70.5613L247.085 71.7194L245.863 71.1679L244.701 71.7194L244.946 70.5613L243.968 69.734L245.313 69.5686L245.863 68.4656Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M334.173 43.2627L334.784 44.4208L336.189 44.5863L335.15 45.5238L335.395 46.7371L334.173 46.1856L332.889 46.7371L333.134 45.5238L332.156 44.5863L333.561 44.4208L334.173 43.2627Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M377.136 23.9056L377.686 24.9534L378.969 25.1188L378.053 25.8909L378.236 27.0491L377.136 26.4976L376.036 27.0491L376.219 25.8909L375.303 25.1188L376.586 24.9534L377.136 23.9056Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M498.815 134.644L499.365 135.692L500.587 135.857L499.67 136.629L499.915 137.732L498.815 137.236L497.653 137.732L497.898 136.629L496.981 135.857L498.203 135.692L498.815 134.644Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M354.096 0.90863L354.646 1.90131L355.868 2.06675L355.013 2.89398L355.196 3.99695L354.096 3.50061L352.935 3.99695L353.179 2.89398L352.263 2.06675L353.546 1.90131L354.096 0.90863Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M160.914 17.9495L161.464 18.9422L162.747 19.1076L161.831 19.9349L162.075 21.0378L160.914 20.4864L159.814 21.0378L159.997 19.9349L159.142 19.1076L160.364 18.9422L160.914 17.9495Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M40.8243 164.314L41.3743 165.362L42.6577 165.527L41.741 166.299L41.9244 167.457L40.8243 166.906L39.7243 167.457L39.9076 166.299L38.9909 165.527L40.2743 165.362L40.8243 164.314Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M380.497 53.9064L381.108 55.0093L382.453 55.1748L381.475 56.002L381.658 57.2153L380.497 56.6638L379.275 57.2153L379.519 56.002L378.542 55.1748L379.886 55.0093L380.497 53.9064Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M216.161 102.272L216.833 103.54L218.361 103.706L217.261 104.643L217.506 106.022L216.161 105.36L214.817 106.022L215.122 104.643L214.022 103.706L215.489 103.54L216.161 102.272Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M97.6606 109.993L98.1495 110.985L99.3718 111.151L98.5162 111.923L98.6995 112.971L97.6606 112.474L96.5605 112.971L96.7439 111.923L95.8883 111.151L97.1105 110.985L97.6606 109.993Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M90.9991 146.28L91.5491 147.273L92.7714 147.438L91.8547 148.21L92.0992 149.258L90.9991 148.762L89.9602 149.258L90.1435 148.21L89.2879 147.438L90.4491 147.273L90.9991 146.28Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M105.239 55.7263L105.728 56.6087L106.828 56.7741L106.033 57.4359L106.217 58.4286L105.239 57.9323L104.261 58.4286L104.444 57.4359L103.711 56.7741L104.75 56.6087L105.239 55.7263Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M115.689 19.4937L116.3 20.5415L117.584 20.7069L116.606 21.5342L116.85 22.6371L115.689 22.0856L114.589 22.6371L114.772 21.5342L113.856 20.7069L115.139 20.5415L115.689 19.4937Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M486.164 101.831L486.347 102.217L486.836 102.272L486.469 102.603L486.592 102.989L486.164 102.823L485.736 102.989L485.797 102.603L485.492 102.272L485.981 102.217L486.164 101.831Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M418.999 18.3907L419.305 18.887L419.977 18.9973L419.488 19.4385L419.61 19.99L418.999 19.7143L418.449 19.99L418.51 19.4385L418.082 18.9973L418.694 18.887L418.999 18.3907Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M558.156 67.9141L558.89 69.2377L560.418 69.4031L559.318 70.451L559.562 71.8848L558.156 71.1679L556.751 71.8848L556.995 70.451L555.834 69.4031L557.423 69.2377L558.156 67.9141Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~class_name:(("HeroGraphic-starCenterLeft") - ) - ~d:(("M380.497 100.893L381.17 102.161L382.759 102.382L381.658 103.375L381.903 104.809L380.497 104.147L379.092 104.809L379.336 103.375L378.175 102.382L379.764 102.161L380.497 100.893Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~class_name:(("HeroGraphic-startRight") - ) - ~d:(("M160.914 73.9805L161.647 75.2489L163.236 75.4695L162.075 76.4621L162.319 77.896L160.914 77.2342L159.508 77.896L159.814 76.4621L158.653 75.4695L160.242 75.2489L160.914 73.9805Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M348.473 94.3854L349.146 95.709L350.735 95.8744L349.635 96.9223L349.879 98.3561L348.473 97.6392L347.068 98.3561L347.312 96.9223L346.151 95.8744L347.74 95.709L348.473 94.3854Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M527.783 46.7922L528.271 47.7849L529.494 47.9504L528.638 48.7224L528.822 49.7703L527.783 49.2739L526.682 49.7703L526.866 48.7224L526.01 47.9504L527.233 47.7849L527.783 46.7922Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~class_name:(("HeroGraphic-starCenterLeft") - ) - ~d:(("M531.877 90.9662L532.427 91.9589L533.649 92.1244L532.733 92.8964L532.977 93.9443L531.877 93.4479L530.838 93.9443L531.022 92.8964L530.166 92.1244L531.388 91.9589L531.877 90.9662Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M632.349 87.8779L632.716 88.4846L633.449 88.5949L632.899 89.0912L633.021 89.753L632.349 89.4221L631.677 89.753L631.799 89.0912L631.249 88.5949L632.043 88.4846L632.349 87.8779Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M683.196 143.357L683.991 144.846L685.824 145.067L684.48 146.225L684.785 147.824L683.196 147.052L681.607 147.824L681.913 146.225L680.629 145.067L682.402 144.846L683.196 143.357Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~class_name:(("HeroGraphic-starRight") - ) - ~d:(("M669.873 94.3854L671.095 96.7017L673.907 97.0326L671.89 98.7973L672.379 101.334L669.873 100.121L667.368 101.334L667.856 98.7973L665.84 97.0326L668.59 96.7017L669.873 94.3854Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path ~class_name:(("HeroGraphic-starCenter") - ) - ~d:(("M261.997 28.0417L263.28 30.3028L266.03 30.6888L264.014 32.4536L264.502 34.9904L261.997 33.7771L259.552 34.9904L259.98 32.4536L257.963 30.6888L260.774 30.3028L261.997 28.0417Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M608.331 26.0012L608.698 26.6079L609.431 26.7182L608.881 27.2145L609.003 27.8763L608.331 27.6005L607.659 27.8763L607.781 27.2145L607.231 26.7182L607.964 26.6079L608.331 26.0012Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M656.123 163.211L656.489 163.873L657.284 163.983L656.673 164.479L656.856 165.141L656.123 164.81L655.45 165.141L655.572 164.479L655.022 163.983L655.817 163.873L656.123 163.211Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M497.959 92.4553L498.326 93.117L499.12 93.2273L498.509 93.7237L498.692 94.3855L497.959 94.0546L497.287 94.3855L497.409 93.7237L496.859 93.2273L497.653 93.117L497.959 92.4553Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M506.087 78.8887L506.393 79.4953L507.187 79.6056L506.637 80.1019L506.759 80.8189L506.087 80.488L505.354 80.8189L505.476 80.1019L504.926 79.6056L505.72 79.4953L506.087 78.8887Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M546.239 110.048L546.973 111.426L548.745 111.647L547.461 112.75L547.767 114.294L546.239 113.577L544.711 114.294L544.956 112.75L543.733 111.647L545.445 111.426L546.239 110.048Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M481.947 38.52L482.436 39.4023L483.536 39.5678L482.742 40.2847L482.925 41.2222L481.947 40.7811L480.969 41.2222L481.153 40.2847L480.358 39.5678L481.458 39.4023L481.947 38.52Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M304.349 67.142L304.838 68.0244L305.938 68.1347L305.143 68.8516L305.327 69.8443L304.349 69.348L303.371 69.8443L303.554 68.8516L302.76 68.1347L303.86 68.0244L304.349 67.142Z") - ) ~fill:(("#E37056")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M643.105 244.279C643.105 246.43 641.15 248.195 638.766 248.195H90.0824C87.699 248.195 85.7433 246.43 85.7433 244.279C85.7433 242.129 87.699 240.364 90.0824 240.364H638.766C641.211 240.364 643.105 242.129 643.105 244.279Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M643.105 244.22C643.105 246.371 641.15 248.135 638.766 248.135H90.0824C87.699 248.135 85.7433 246.371 85.7433 244.22C85.7433 242.069 87.699 240.304 90.0824 240.304H638.766C641.211 240.304 643.105 242.069 643.105 244.22Z") - ) ~fill:(("#2484C6")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M124.612 231.485C124.612 231.485 123.817 225.86 127.118 223.985C130.418 222.165 131.64 222.165 131.64 222.165C131.64 222.165 130.54 218.911 133.351 217.477C136.163 216.043 137.446 217.477 137.446 217.477C137.446 217.477 137.752 212.128 141.541 210.97C145.269 209.867 146.246 210.97 146.246 210.97C146.246 210.97 147.958 203.58 153.458 202.697C158.958 201.815 158.958 203.635 158.958 203.635C158.958 203.635 159.569 202.532 162.686 202.422C165.803 202.311 165.681 204.021 165.681 204.021C165.681 204.021 167.697 203.028 170.387 203.58C173.076 204.131 173.076 206.558 173.076 206.558C173.076 206.558 174.298 204.738 179.676 208.543C184.993 212.348 184.198 218.856 184.198 218.856C184.198 218.856 188.293 219.021 188.721 220.676C189.21 222.385 188.11 223.929 188.11 223.929C188.11 223.929 192.938 223.488 193.427 226.025C193.916 228.562 192.815 229.83 192.815 229.83C192.815 229.83 194.527 230.823 194.71 232.919C194.893 235.014 194.71 236.007 194.71 236.007C194.71 236.007 196.299 236.448 196.605 239.371C196.91 242.349 195.504 244.445 195.504 244.445C195.504 244.445 195.504 247.643 191.899 248.195C188.293 248.801 119.112 248.195 119.112 248.195C119.112 248.195 117.095 245.272 118.317 243.728C119.539 242.184 120.334 242.184 120.334 242.184C120.334 242.184 120.028 240.198 120.028 239.757C120.028 239.316 122.351 238.489 122.351 238.489C122.351 238.489 120.762 237.386 121.556 236.393C122.351 235.4 123.451 234.959 123.451 234.959C123.451 234.959 120.578 232.367 124.612 231.485Z") - ) ~fill:(("#0D1522")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M191.654 238.599C191.654 238.599 191.776 232.919 195.443 232.367C199.11 231.816 199.416 232.367 199.416 232.367C199.416 232.367 199.721 230.327 201.433 229.996C203.144 229.61 203.572 229.996 203.572 229.996C203.572 229.996 204.61 226.852 207.85 226.08C211.089 225.308 212.739 229.389 212.739 229.389C212.739 229.389 214.694 228.562 216.283 229.113C217.872 229.665 217.261 231.209 217.261 231.209C217.261 231.209 218.545 230.823 218.85 231.761C219.156 232.698 218.85 233.139 218.85 233.139C218.85 233.139 220.5 232.422 221.417 234.132C222.334 235.897 222.028 236.889 222.028 236.889C222.028 236.889 223.556 235.897 224.045 237.441C224.534 238.985 224.534 239.537 224.534 239.537C224.534 239.537 227.773 238.709 228.017 239.978C228.262 241.246 226.062 242.459 226.062 242.459C226.062 242.459 227.467 243.452 227.467 244.665C227.467 245.879 226.734 246.044 226.734 246.32C226.734 246.596 227.223 247.588 227.162 248.36C227.039 249.077 189.271 248.36 189.271 248.36L191.654 238.599Z") - ) ~fill:(("#0D1522")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M247.329 238.599C247.329 238.599 247.452 232.919 251.118 232.367C254.785 231.816 255.091 232.367 255.091 232.367C255.091 232.367 255.396 230.327 257.108 229.996C258.819 229.61 259.247 229.996 259.247 229.996C259.247 229.996 260.286 226.852 263.525 226.08C266.764 225.308 268.414 229.389 268.414 229.389C268.414 229.389 270.369 228.562 271.958 229.113C273.547 229.665 272.936 231.209 272.936 231.209C272.936 231.209 274.22 230.823 274.525 231.761C274.831 232.698 274.525 233.139 274.525 233.139C274.525 233.139 276.175 232.422 277.092 234.132C278.009 235.897 277.703 236.889 277.703 236.889C277.703 236.889 279.231 235.897 279.72 237.441C280.209 238.985 280.209 239.537 280.209 239.537C280.209 239.537 283.448 238.709 283.692 239.978C283.937 241.246 281.737 242.459 281.737 242.459C281.737 242.459 283.142 243.452 283.142 244.665C283.142 245.879 282.409 246.044 282.409 246.32C282.409 246.596 282.898 247.588 282.837 248.36C282.714 249.077 244.946 248.36 244.946 248.36L247.329 238.599Z") - ) ~fill:(("#0D1522")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M222.089 241.687C222.089 241.687 219.828 233.967 220.989 232.202C222.089 230.437 222.089 230.437 222.089 230.437C222.089 230.437 220.989 228.617 222.089 227.955C223.189 227.294 223.189 227.294 223.189 227.294C223.189 227.294 223.189 224.702 224.839 224.095C226.489 223.433 226.978 224.095 226.978 224.095C226.978 224.095 227.101 220.124 228.69 219.959C230.34 219.793 230.523 220.676 230.523 220.676C230.523 220.676 230.34 218.029 232.54 217.091C234.801 216.154 236.512 218.47 236.512 218.47C236.512 218.47 239.14 218.58 239.568 220.29C239.996 222.054 239.568 223.047 239.568 223.047C239.568 223.047 241.707 223.654 241.401 225.915C241.096 228.176 241.096 228.176 241.096 228.176C241.096 228.176 244.946 226.687 245.985 228.176C247.024 229.665 245.985 230.547 245.985 230.547C245.985 230.547 247.696 230.382 247.696 231.926C247.696 233.47 247.696 234.297 247.696 234.297C247.696 234.297 249.713 233.856 249.957 235.566C250.141 237.331 249.041 238.489 249.041 238.489C249.041 238.489 250.08 239.867 249.957 241.081C249.835 242.294 249.102 242.901 249.102 242.901C249.102 242.901 251.057 242.625 251.546 244.445C252.035 246.265 251.057 246.926 251.057 246.926L251.73 248.526H223.8L222.089 241.687Z") - ) ~fill:(("#0D1522")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M488.547 236.889C488.547 236.889 487.997 233.029 490.258 231.761C492.52 230.492 493.375 230.492 493.375 230.492C493.375 230.492 492.642 228.286 494.536 227.294C496.492 226.301 497.348 227.294 497.348 227.294C497.348 227.294 497.592 223.599 500.159 222.827C502.726 222.054 503.398 222.827 503.398 222.827C503.398 222.827 504.559 217.753 508.348 217.146C512.137 216.54 512.137 217.808 512.137 217.808C512.137 217.808 512.565 217.036 514.704 216.981C516.843 216.926 516.721 218.084 516.721 218.084C516.721 218.084 518.127 217.422 519.96 217.808C521.793 218.194 521.793 219.849 521.793 219.849C521.793 219.849 522.649 218.58 526.316 221.227C529.983 223.819 529.433 228.286 529.433 228.286C529.433 228.286 532.244 228.397 532.55 229.555C532.855 230.713 532.122 231.761 532.122 231.761C532.122 231.761 535.483 231.485 535.789 233.194C536.094 234.959 535.361 235.786 535.361 235.786C535.361 235.786 536.522 236.448 536.644 237.937C536.766 239.371 536.644 240.088 536.644 240.088C536.644 240.088 537.744 240.364 537.928 242.404C538.172 244.445 537.194 245.879 537.194 245.879C537.194 245.879 537.194 248.085 534.75 248.471C532.305 248.912 484.758 248.471 484.758 248.471C484.758 248.471 483.352 246.485 484.208 245.382C485.064 244.334 485.614 244.334 485.614 244.334C485.614 244.334 485.369 242.956 485.369 242.68C485.369 242.404 486.958 241.798 486.958 241.798C486.958 241.798 485.858 241.026 486.408 240.364C486.958 239.702 487.692 239.371 487.692 239.371C487.692 239.371 485.797 237.441 488.547 236.889Z") - ) ~fill:(("#0D1522")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M533.038 238.599C533.038 238.599 533.161 232.919 536.827 232.367C540.494 231.816 540.8 232.367 540.8 232.367C540.8 232.367 541.105 230.327 542.817 229.996C544.528 229.61 544.956 229.996 544.956 229.996C544.956 229.996 545.995 226.852 549.234 226.08C552.473 225.308 554.123 229.389 554.123 229.389C554.123 229.389 556.078 228.562 557.667 229.113C559.318 229.665 558.645 231.209 558.645 231.209C558.645 231.209 559.929 230.823 560.234 231.761C560.54 232.698 560.234 233.139 560.234 233.139C560.234 233.139 561.884 232.422 562.801 234.132C563.718 235.897 563.412 236.889 563.412 236.889C563.412 236.889 564.94 235.897 565.429 237.441C565.918 238.985 565.918 239.537 565.918 239.537C565.918 239.537 569.157 238.709 569.401 239.978C569.585 241.246 567.446 242.459 567.446 242.459C567.446 242.459 568.851 243.452 568.851 244.665C568.851 245.879 568.118 246.044 568.118 246.32C568.118 246.596 568.607 247.588 568.546 248.36C568.424 249.077 530.655 248.36 530.655 248.36L533.038 238.599Z") - ) ~fill:(("#0D1522")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M588.713 238.599C588.713 238.599 588.836 232.919 592.503 232.367C596.169 231.816 596.475 232.367 596.475 232.367C596.475 232.367 596.781 230.327 598.492 229.996C600.203 229.61 600.631 229.996 600.631 229.996C600.631 229.996 601.67 226.852 604.909 226.08C608.148 225.308 609.798 229.389 609.798 229.389C609.798 229.389 611.754 228.562 613.343 229.113C614.993 229.665 614.32 231.209 614.32 231.209C614.32 231.209 615.604 230.823 615.909 231.761C616.215 232.698 615.909 233.139 615.909 233.139C615.909 233.139 617.559 232.422 618.476 234.132C619.393 235.897 619.087 236.889 619.087 236.889C619.087 236.889 620.615 235.897 621.104 237.441C621.593 238.985 621.593 239.537 621.593 239.537C621.593 239.537 624.832 238.709 625.077 239.978C625.26 241.246 623.121 242.459 623.121 242.459C623.121 242.459 624.527 243.452 624.527 244.665C624.527 245.879 623.793 246.044 623.793 246.32C623.793 246.596 624.282 247.588 624.221 248.36C624.099 249.077 586.33 248.36 586.33 248.36L588.713 238.599Z") - ) ~fill:(("#0D1522")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M490.808 240.805C490.808 240.805 490.747 236.338 487.875 235.897C485.003 235.456 484.758 235.897 484.758 235.897C484.758 235.897 484.514 234.297 483.169 234.022C481.825 233.746 481.519 234.022 481.519 234.022C481.519 234.022 480.725 231.54 478.158 230.933C475.591 230.327 474.308 233.525 474.308 233.525C474.308 233.525 472.78 232.864 471.496 233.305C470.213 233.746 470.702 234.959 470.702 234.959C470.702 234.959 469.724 234.684 469.48 235.4C469.235 236.117 469.48 236.503 469.48 236.503C469.48 236.503 468.196 235.952 467.463 237.276C466.729 238.654 466.974 239.426 466.974 239.426C466.974 239.426 465.752 238.654 465.385 239.868C464.957 241.081 464.957 241.522 464.957 241.522C464.957 241.522 462.39 240.86 462.268 241.908C462.085 242.901 463.796 243.838 463.796 243.838C463.796 243.838 462.696 244.61 462.696 245.548C462.696 246.485 463.246 246.651 463.246 246.816C463.246 246.982 462.818 247.809 462.94 248.416C463.001 248.967 492.581 248.416 492.581 248.416L490.808 240.805Z") - ) ~fill:(("#0D1522")) - ~children:[] ()) - [@JSX ]); - ((path - ~d:(("M563.473 241.687C563.473 241.687 561.212 233.967 562.373 232.202C563.473 230.437 563.473 230.437 563.473 230.437C563.473 230.437 562.373 228.617 563.473 227.955C564.573 227.294 564.573 227.294 564.573 227.294C564.573 227.294 564.573 224.702 566.223 224.095C567.874 223.433 568.362 224.095 568.362 224.095C568.362 224.095 568.485 220.124 570.074 219.959C571.724 219.793 571.907 220.676 571.907 220.676C571.907 220.676 571.724 218.029 573.924 217.091C576.185 216.154 577.896 218.47 577.896 218.47C577.896 218.47 580.524 218.58 580.952 220.29C581.38 222.054 580.952 223.047 580.952 223.047C580.952 223.047 583.091 223.654 582.785 225.915C582.48 228.176 582.48 228.176 582.48 228.176C582.48 228.176 586.33 226.687 587.369 228.176C588.408 229.665 587.369 230.547 587.369 230.547C587.369 230.547 589.08 230.382 589.08 231.926C589.08 233.47 589.08 234.297 589.08 234.297C589.08 234.297 591.097 233.856 591.341 235.566C591.525 237.331 590.425 238.489 590.425 238.489C590.425 238.489 591.464 239.867 591.341 241.081C591.219 242.294 590.486 242.901 590.486 242.901C590.486 242.901 592.442 242.625 592.93 244.445C593.419 246.265 592.442 246.926 592.442 246.926L593.114 248.526H565.184L563.473 241.687Z") - ) ~fill:(("#0D1522")) - ~children:[] ()) - [@JSX ]); - ((defs - ~children:[((linear_gradient ~id:(("paint0_linear") - ) ~x1:(("374.5") - ) ~y1:(("180.64") - ) ~x2:(("362.765") - ) ~y2:(("435.722") - ) - ~gradient_units:(("userSpaceOnUse") - ) - ~children:[((stop ~offset:(("0.0658436") - ) - ~stop_color:(("#3A7DDD") - ) - ~children:[] ()) - [@JSX ]); - ((stop ~offset:(("0.4001") - ) - ~stop_color:(("#265291") - ) - ~children:[] ()) - [@JSX ]); - ((stop ~offset:(("0.571") - ) - ~stop_color:(("#1D3E6E") - ) - ~children:[] ()) - [@JSX ]); - ((stop ~offset:(("0.7224") - ) - ~stop_color:(("#173156") - ) - ~children:[] ()) - [@JSX ]); - ((stop ~offset:(("0.8486") - ) - ~stop_color:(("#10213A") - ) - ~children:[] ()) - [@JSX ]); - ((stop ~offset:(("0.9342") - ) - ~stop_color:(("#091321") - ) - ~children:[] ()) - [@JSX ])] ()) - [@JSX ])] ()) - [@JSX ])] ()) - [@JSX ])[@@react.component ] \ No newline at end of file diff --git a/jscomp/syntax/benchmarks/data/Napkinscript.ml b/jscomp/syntax/benchmarks/data/Napkinscript.ml deleted file mode 100644 index e6b7a0f5d2..0000000000 --- a/jscomp/syntax/benchmarks/data/Napkinscript.ml +++ /dev/null @@ -1,19541 +0,0 @@ -module MiniBuffer : sig - type t - val add_char : t -> char -> unit - val add_string : t -> string -> unit - val contents : t -> string - val create : int -> t - val flush_newline : t -> unit - val length : t -> int - val unsafe_get : t -> int -> char -end = struct - type t = { - mutable buffer : bytes; - mutable position : int; - mutable length : int; - } - - let create n = - let n = if n < 1 then 1 else n in - let s = (Bytes.create [@doesNotRaise]) n in - {buffer = s; position = 0; length = n} - - let contents b = Bytes.sub_string b.buffer 0 b.position - - let unsafe_get b ofs = - Bytes.unsafe_get b.buffer ofs - - let length b = b.position - - (* Can't be called directly, don't add to the interface *) - let resize_internal b more = - let len = b.length in - let new_len = ref len in - while b.position + more > !new_len do new_len := 2 * !new_len done; - if !new_len > Sys.max_string_length then begin - if b.position + more <= Sys.max_string_length - then new_len := Sys.max_string_length - end; - let new_buffer = (Bytes.create [@doesNotRaise]) !new_len in - (* PR#6148: let's keep using [blit] rather than [unsafe_blit] in - this tricky function that is slow anyway. *) - Bytes.blit b.buffer 0 new_buffer 0 b.position [@doesNotRaise]; - b.buffer <- new_buffer; - b.length <- !new_len - - let add_char b c = - let pos = b.position in - if pos >= b.length then resize_internal b 1; - Bytes.unsafe_set b.buffer pos c; - b.position <- pos + 1 - - let add_string b s = - let len = String.length s in - let new_position = b.position + len in - if new_position > b.length then resize_internal b len; - Bytes.blit_string s 0 b.buffer b.position len [@doesNotRaise]; - b.position <- new_position - - (* adds newline and trims all preceding whitespace *) - let flush_newline b = - let position = ref (b.position) in - while (Bytes.unsafe_get b.buffer (!position - 1)) = ' ' && !position >= 0 do - position := !position - 1; - done; - b.position <- !position; - add_char b '\n' -end - -module Doc = struct - type mode = Break | Flat - - type line_style = - | Classic (* fits? -> replace with space *) - | Soft (* fits? -> replaced with nothing *) - | Hard (* always included, forces breaks in parents *) - - type t = - | Nil - | Text of string - | Concat of t list - | Indent of t - | IfBreaks of {yes: t; no: t} - | LineSuffix of t - | LineBreak of line_style - | Group of {should_break: bool; doc: t} - | CustomLayout of t list - | BreakParent - (* | Cursor *) - - let nil = Nil - let line = LineBreak Classic - let hard_line = LineBreak Hard - let soft_line = LineBreak Soft - let text s = Text s - let concat l = Concat l - let indent d = Indent d - let if_breaks t f = IfBreaks {yes = t; no = f} - let line_suffix d = LineSuffix d - let group d = Group {should_break = false; doc = d} - let breakable_group ~force_break d = Group {should_break = force_break; doc = d} - let custom_layout gs = CustomLayout gs - let break_parent = BreakParent - (* let cursor = Cursor *) - - let space = Text " " - let comma = Text "," - let dot = Text "." - let dotdot = Text ".." - let dotdotdot = Text "..." - let less_than = Text "<" - let greater_than = Text ">" - let lbrace = Text "{" - let rbrace = Text "}" - let lparen = Text "(" - let rparen = Text ")" - let lbracket = Text "[" - let rbracket = Text "]" - let question = Text "?" - let tilde = Text "~" - let equal = Text "=" - let trailing_comma = IfBreaks {yes = comma; no = nil} - let double_quote = Text "\"" - - let propagate_forced_breaks doc = - let rec walk doc = match doc with - | Text _ | Nil | LineSuffix _ -> - (false, doc) - | BreakParent -> - (true, Nil) - | LineBreak Hard -> - (true, doc) - | LineBreak (Classic | Soft) -> - (false, doc) - | Indent children -> - let (child_forces_break, new_children) = walk children in - (child_forces_break, Indent new_children) - | IfBreaks {yes = true_doc; no = false_doc} -> - let (false_force_break, false_doc) = walk false_doc in - if false_force_break then - let (_, true_doc) = walk true_doc in - (true, true_doc) - else - let force_break, true_doc = walk true_doc in - (force_break, IfBreaks {yes = true_doc; no = false_doc}) - | Group {should_break = force_break; doc = children} -> - let (child_forces_break, new_children) = walk children in - let should_break = force_break || child_forces_break in - (should_break, Group {should_break; doc = new_children}) - | Concat children -> - let (force_break, new_children) = List.fold_left (fun (force_break, new_children) child -> - let (child_forces_break, new_child) = walk child in - (force_break || child_forces_break, new_child::new_children) - ) (false, []) children - in - (force_break, Concat (List.rev new_children)) - | CustomLayout children -> - (* When using CustomLayout, we don't want to propagate forced breaks - * from the children up. By definition it picks the first layout that fits - * otherwise it takes the last of the list. - * However we do want to propagate forced breaks in the sublayouts. They - * might need to be broken. We just don't propagate them any higher here *) - let children = match walk (Concat children) with - | (_, Concat children) -> children - | _ -> assert false - in - (false, CustomLayout children) - in - let (_, processed_doc) = walk doc in - processed_doc - - let join ~sep docs = - let rec loop acc sep docs = - match docs with - | [] -> List.rev acc - | [x] -> List.rev (x::acc) - | x::xs -> loop (sep::x::acc) sep xs - in - Concat(loop [] sep docs) - - let rec fits w doc = match doc with - | _ when w < 0 -> false - | [] -> true - | (_ind, _mode, Text txt)::rest -> fits (w - String.length txt) rest - | (ind, mode, Indent doc)::rest -> fits w ((ind + 2, mode, doc)::rest) - | (_ind, Flat, LineBreak break)::rest -> - if break = Hard then true - else - let w = if break = Classic then w - 1 else w in - fits w rest - | (_ind, _mode, Nil)::rest -> fits w rest - | (_ind, Break, LineBreak _break)::_rest -> true - | (ind, mode, Group {should_break = force_break; doc})::rest -> - let mode = if force_break then Break else mode in - fits w ((ind, mode, doc)::rest) - | (ind, mode, IfBreaks {yes = break_doc; no = flat_doc})::rest -> - if mode = Break then - fits w ((ind, mode, break_doc)::rest) - else - fits w ((ind, mode, flat_doc)::rest) - | (ind, mode, Concat docs)::rest -> - let ops = List.map (fun doc -> (ind, mode, doc)) docs in - fits w (List.append ops rest) - (* | (_ind, _mode, Cursor)::rest -> fits w rest *) - | (_ind, _mode, LineSuffix _)::rest -> fits w rest - | (_ind, _mode, BreakParent)::rest -> fits w rest - | (ind, mode, CustomLayout (hd::_))::rest -> - (* TODO: if we have nested custom layouts, what we should do here? *) - fits w ((ind, mode, hd)::rest) - | (_ind, _mode, CustomLayout _)::rest -> - fits w rest - - let to_string ~width doc = - let doc = propagate_forced_breaks doc in - let buffer = MiniBuffer.create 1000 in - - let rec process ~pos line_suffices stack = - match stack with - | ((ind, mode, doc) as cmd)::rest -> - begin match doc with - | Nil | BreakParent -> - process ~pos line_suffices rest - | Text txt -> - MiniBuffer.add_string buffer txt; - process ~pos:(String.length txt + pos) line_suffices rest - | LineSuffix doc -> - process ~pos ((ind, mode, doc)::line_suffices) rest - | Concat docs -> - let ops = List.map (fun doc -> (ind, mode, doc)) docs in - process ~pos line_suffices (List.append ops rest) - | Indent doc -> - process ~pos line_suffices ((ind + 2, mode, doc)::rest) - | IfBreaks {yes = break_doc; no = flat_doc} -> - if mode = Break then - process ~pos line_suffices ((ind, mode, break_doc)::rest) - else - process ~pos line_suffices ((ind, mode, flat_doc)::rest) - | LineBreak line_style -> - if mode = Break then ( - begin match line_suffices with - | [] -> - MiniBuffer.flush_newline buffer; - MiniBuffer.add_string buffer (String.make ind ' ' [@doesNotRaise]); - process ~pos:ind [] rest - | _docs -> - process ~pos:ind [] (List.concat [List.rev line_suffices; cmd::rest]) - end - ) else (* mode = Flat *) ( - let pos = match line_style with - | Classic -> MiniBuffer.add_string buffer " "; pos + 1 - | Hard -> MiniBuffer.flush_newline buffer; 0 - | Soft -> pos - in - process ~pos line_suffices rest - ) - | Group {should_break; doc} -> - if should_break || not (fits (width - pos) ((ind, Flat, doc)::rest)) then - process ~pos line_suffices ((ind, Break, doc)::rest) - else - process ~pos line_suffices ((ind, Flat, doc)::rest) - | CustomLayout docs -> - let rec find_group_that_fits groups = match groups with - | [] -> Nil - | [last_group] -> last_group - | doc::docs -> - if (fits (width - pos) ((ind, Flat, doc)::rest)) then - doc - else - find_group_that_fits docs - in - let doc = find_group_that_fits docs in - process ~pos line_suffices ((ind, Flat, doc)::rest) - end - | [] -> - begin match line_suffices with - | [] -> () - | suffices -> - process ~pos:0 [] (List.rev suffices) - end - in - process ~pos:0 [] [0, Flat, doc]; - - let len = MiniBuffer.length buffer in - if len > 0 && MiniBuffer.unsafe_get buffer (len - 1) != '\n' then - MiniBuffer.add_char buffer '\n'; - MiniBuffer.contents buffer - - - let debug t = - let rec to_doc = function - | Nil -> text "nil" - | BreakParent -> text "breakparent" - | Text txt -> text ("text(" ^ txt ^ ")") - | LineSuffix doc -> group( - concat [ - text "linesuffix("; - indent ( - concat [line; to_doc doc] - ); - line; - text ")" - ] - ) - | Concat docs -> group( - concat [ - text "concat("; - indent ( - concat [ - line; - join ~sep:(concat [text ","; line]) - (List.map to_doc docs) ; - ] - ); - line; - text ")" - ] - ) - | CustomLayout docs -> group( - concat [ - text "customLayout("; - indent ( - concat [ - line; - join ~sep:(concat [text ","; line]) - (List.map to_doc docs) ; - ] - ); - line; - text ")" - ] - ) - | Indent doc -> - concat [ - text "indent("; - soft_line; - to_doc doc; - soft_line; - text ")"; - ] - | IfBreaks {yes = true_doc; no = false_doc} -> - group( - concat [ - text "ifBreaks("; - indent ( - concat [ - line; - to_doc true_doc; - concat [text ","; line]; - to_doc false_doc; - ] - ); - line; - text ")" - ] - ) - | LineBreak break -> - let break_txt = match break with - | Classic -> "Classic" - | Soft -> "Soft" - | Hard -> "Hard" - in - text ("LineBreak(" ^ break_txt ^ ")") - | Group {should_break; doc} -> - group( - concat [ - text "Group("; - indent ( - concat [ - line; - text ("shouldBreak: " ^ (string_of_bool should_break)); - concat [text ","; line]; - to_doc doc; - ] - ); - line; - text ")" - ] - ) - in - let doc = to_doc t in - to_string ~width:10 doc |> print_endline - [@@live] -end - -module Sexp: sig - type t - - val atom: string -> t - val list: t list -> t - val to_string: t -> string -end = struct - type t = - | Atom of string - | List of t list - - let atom s = Atom s - let list l = List l - - let rec to_doc t = - match t with - | Atom s -> Doc.text s - | List [] -> Doc.text "()" - | List [sexpr] -> Doc.concat [Doc.lparen; to_doc sexpr; Doc.rparen;] - | List (hd::tail) -> - Doc.group ( - Doc.concat [ - Doc.lparen; - to_doc hd; - Doc.indent ( - Doc.concat [ - Doc.line; - Doc.join ~sep:Doc.line (List.map to_doc tail); - ] - ); - Doc.rparen; - ] - ) - - let to_string sexpr = - let doc = to_doc sexpr in - Doc.to_string ~width:80 doc -end - -module SexpAst: sig - val implementation: Parsetree.structure -> Sexp.t - val interface: Parsetree.signature -> Sexp.t -end = struct - open Parsetree - - let map_empty ~f items = - match items with - | [] -> [Sexp.list []] - | items -> List.map f items - - let string txt = - Sexp.atom ("\"" ^ txt ^ "\"") - - let char c = - Sexp.atom ("'" ^ (Char.escaped c) ^ "'") - - let opt_char oc = - match oc with - | None -> Sexp.atom "None" - | Some c -> - Sexp.list [ - Sexp.atom "Some"; - char c - ] - - let longident l = - let rec loop l = match l with - | Longident.Lident ident -> Sexp.list [ - Sexp.atom "Lident"; - string ident; - ] - | Longident.Ldot (lident, txt) -> - Sexp.list [ - Sexp.atom "Ldot"; - loop lident; - string txt; - ] - | Longident.Lapply (l1, l2) -> - Sexp.list [ - Sexp.atom "Lapply"; - loop l1; - loop l2; - ] - in - Sexp.list [ - Sexp.atom "longident"; - loop l; - ] - - let closed_flag flag = match flag with - | Asttypes.Closed -> Sexp.atom "Closed" - | Open -> Sexp.atom "Open" - - let direction_flag flag = match flag with - | Asttypes.Upto -> Sexp.atom "Upto" - | Downto -> Sexp.atom "Downto" - - let rec_flag flag = match flag with - | Asttypes.Recursive -> Sexp.atom "Recursive" - | Nonrecursive -> Sexp.atom "Nonrecursive" - - let override_flag flag = match flag with - | Asttypes.Override -> Sexp.atom "Override" - | Fresh -> Sexp.atom "Fresh" - - let private_flag flag = match flag with - | Asttypes.Public -> Sexp.atom "Public" - | Private -> Sexp.atom "Private" - - let mutable_flag flag = match flag with - | Asttypes.Immutable -> Sexp.atom "Immutable" - | Mutable -> Sexp.atom "Mutable" - - let variance v = match v with - | Asttypes.Covariant -> Sexp.atom "Covariant" - | Contravariant -> Sexp.atom "Contravariant" - | Invariant -> Sexp.atom "Invariant" - - let arg_label lbl = match lbl with - | Asttypes.Nolabel -> Sexp.atom "Nolabel" - | Labelled txt -> Sexp.list [ - Sexp.atom "Labelled"; - string txt; - ] - | Optional txt -> Sexp.list [ - Sexp.atom "Optional"; - string txt; - ] - - let constant c = - let sexpr = match c with - | Pconst_integer (txt, tag) -> - Sexp.list [ - Sexp.atom "Pconst_integer"; - string txt; - opt_char tag; - ] - | Pconst_char c -> - Sexp.list [ - Sexp.atom "Pconst_char"; - Sexp.atom (Char.escaped c); - ] - | Pconst_string (txt, tag) -> - Sexp.list [ - Sexp.atom "Pconst_string"; - string txt; - match tag with - | Some txt -> Sexp.list [ - Sexp.atom "Some"; - string txt; - ] - | None -> Sexp.atom "None"; - ] - | Pconst_float (txt, tag) -> - Sexp.list [ - Sexp.atom "Pconst_float"; - string txt; - opt_char tag; - ] - in - Sexp.list [ - Sexp.atom "constant"; - sexpr - ] - - let rec structure s = - Sexp.list ( - (Sexp.atom "structure")::(List.map structure_item s) - ) - - and structure_item si = - let desc = match si.pstr_desc with - | Pstr_eval (expr, attrs) -> - Sexp.list [ - Sexp.atom "Pstr_eval"; - expression expr; - attributes attrs; - ] - | Pstr_value (flag, vbs) -> - Sexp.list [ - Sexp.atom "Pstr_value"; - rec_flag flag; - Sexp.list (map_empty ~f:value_binding vbs) - ] - | Pstr_primitive (vd) -> - Sexp.list [ - Sexp.atom "Pstr_primitive"; - value_description vd; - ] - | Pstr_type (flag, tds) -> - Sexp.list [ - Sexp.atom "Pstr_type"; - rec_flag flag; - Sexp.list (map_empty ~f:type_declaration tds) - ] - | Pstr_typext typext -> - Sexp.list [ - Sexp.atom "Pstr_type"; - type_extension typext; - ] - | Pstr_exception ec -> - Sexp.list [ - Sexp.atom "Pstr_exception"; - extension_constructor ec; - ] - | Pstr_module mb -> - Sexp.list [ - Sexp.atom "Pstr_module"; - module_binding mb; - ] - | Pstr_recmodule mbs -> - Sexp.list [ - Sexp.atom "Pstr_recmodule"; - Sexp.list (map_empty ~f:module_binding mbs); - ] - | Pstr_modtype mod_typ_decl -> - Sexp.list [ - Sexp.atom "Pstr_modtype"; - module_type_declaration mod_typ_decl; - ] - | Pstr_open open_desc -> - Sexp.list [ - Sexp.atom "Pstr_open"; - open_description open_desc; - ] - | Pstr_class _ -> Sexp.atom "Pstr_class" - | Pstr_class_type _ -> Sexp.atom "Pstr_class_type" - | Pstr_include id -> - Sexp.list [ - Sexp.atom "Pstr_include"; - include_declaration id; - ] - | Pstr_attribute attr -> - Sexp.list [ - Sexp.atom "Pstr_attribute"; - attribute attr; - ] - | Pstr_extension (ext, attrs) -> - Sexp.list [ - Sexp.atom "Pstr_extension"; - extension ext; - attributes attrs; - ] - in - Sexp.list [ - Sexp.atom "structure_item"; - desc; - ] - - and include_declaration id = - Sexp.list [ - Sexp.atom "include_declaration"; - module_expression id.pincl_mod; - attributes id.pincl_attributes; - ] - - and open_description od = - Sexp.list [ - Sexp.atom "open_description"; - longident od.popen_lid.Asttypes.txt; - attributes od.popen_attributes; - ] - - and module_type_declaration mtd = - Sexp.list [ - Sexp.atom "module_type_declaration"; - string mtd.pmtd_name.Asttypes.txt; - (match mtd.pmtd_type with - | None -> Sexp.atom "None" - | Some mod_type -> Sexp.list [ - Sexp.atom "Some"; - module_type mod_type; - ]); - attributes mtd.pmtd_attributes; - ] - - and module_binding mb = - Sexp.list [ - Sexp.atom "module_binding"; - string mb.pmb_name.Asttypes.txt; - module_expression mb.pmb_expr; - attributes mb.pmb_attributes; - ] - - and module_expression me = - let desc = match me.pmod_desc with - | Pmod_ident mod_name -> - Sexp.list [ - Sexp.atom "Pmod_ident"; - longident mod_name.Asttypes.txt; - ] - | Pmod_structure s -> - Sexp.list [ - Sexp.atom "Pmod_structure"; - structure s; - ] - | Pmod_functor (lbl, opt_mod_type, mod_expr) -> - Sexp.list [ - Sexp.atom "Pmod_functor"; - string lbl.Asttypes.txt; - (match opt_mod_type with - | None -> Sexp.atom "None" - | Some mod_type -> Sexp.list [ - Sexp.atom "Some"; - module_type mod_type; - ]); - module_expression mod_expr; - ] - | Pmod_apply (call_mod_expr, mod_expr_arg) -> - Sexp.list [ - Sexp.atom "Pmod_apply"; - module_expression call_mod_expr; - module_expression mod_expr_arg; - ] - | Pmod_constraint (mod_expr, mod_type) -> - Sexp.list [ - Sexp.atom "Pmod_constraint"; - module_expression mod_expr; - module_type mod_type; - ] - | Pmod_unpack expr -> - Sexp.list [ - Sexp.atom "Pmod_unpack"; - expression expr; - ] - | Pmod_extension ext -> - Sexp.list [ - Sexp.atom "Pmod_extension"; - extension ext; - ] - in - Sexp.list [ - Sexp.atom "module_expr"; - desc; - attributes me.pmod_attributes; - ] - - and module_type mt = - let desc = match mt.pmty_desc with - | Pmty_ident longident_loc -> - Sexp.list [ - Sexp.atom "Pmty_ident"; - longident longident_loc.Asttypes.txt; - ] - | Pmty_signature s -> - Sexp.list [ - Sexp.atom "Pmty_signature"; - signature s; - ] - | Pmty_functor (lbl, opt_mod_type, mod_type) -> - Sexp.list [ - Sexp.atom "Pmty_functor"; - string lbl.Asttypes.txt; - (match opt_mod_type with - | None -> Sexp.atom "None" - | Some mod_type -> Sexp.list [ - Sexp.atom "Some"; - module_type mod_type; - ]); - module_type mod_type; - ] - | Pmty_alias longident_loc -> - Sexp.list [ - Sexp.atom "Pmty_alias"; - longident longident_loc.Asttypes.txt; - ] - | Pmty_extension ext -> - Sexp.list [ - Sexp.atom "Pmty_extension"; - extension ext; - ] - | Pmty_typeof mod_expr -> - Sexp.list [ - Sexp.atom "Pmty_typeof"; - module_expression mod_expr; - ] - | Pmty_with (mod_type, with_constraints) -> - Sexp.list [ - Sexp.atom "Pmty_with"; - module_type mod_type; - Sexp.list (map_empty ~f:with_constraint with_constraints); - ] - in - Sexp.list [ - Sexp.atom "module_type"; - desc; - attributes mt.pmty_attributes; - ] - - and with_constraint wc = match wc with - | Pwith_type (longident_loc, td) -> - Sexp.list [ - Sexp.atom "Pmty_with"; - longident longident_loc.Asttypes.txt; - type_declaration td; - ] - | Pwith_module (l1, l2) -> - Sexp.list [ - Sexp.atom "Pwith_module"; - longident l1.Asttypes.txt; - longident l2.Asttypes.txt; - ] - | Pwith_typesubst (longident_loc, td) -> - Sexp.list [ - Sexp.atom "Pwith_typesubst"; - longident longident_loc.Asttypes.txt; - type_declaration td; - ] - | Pwith_modsubst (l1, l2) -> - Sexp.list [ - Sexp.atom "Pwith_modsubst"; - longident l1.Asttypes.txt; - longident l2.Asttypes.txt; - ] - - and signature s = - Sexp.list ( - (Sexp.atom "signature")::(List.map signature_item s) - ) - - and signature_item si = - let descr = match si.psig_desc with - | Psig_value vd -> - Sexp.list [ - Sexp.atom "Psig_value"; - value_description vd; - ] - | Psig_type (flag, type_declarations) -> - Sexp.list [ - Sexp.atom "Psig_type"; - rec_flag flag; - Sexp.list (map_empty ~f:type_declaration type_declarations); - ] - | Psig_typext typ_ext -> - Sexp.list [ - Sexp.atom "Psig_typext"; - type_extension typ_ext; - ] - | Psig_exception ext_constr -> - Sexp.list [ - Sexp.atom "Psig_exception"; - extension_constructor ext_constr; - ] - | Psig_module mod_decl -> - Sexp.list [ - Sexp.atom "Psig_module"; - module_declaration mod_decl; - ] - | Psig_recmodule mod_decls -> - Sexp.list [ - Sexp.atom "Psig_recmodule"; - Sexp.list (map_empty ~f:module_declaration mod_decls); - ] - | Psig_modtype mod_typ_decl -> - Sexp.list [ - Sexp.atom "Psig_modtype"; - module_type_declaration mod_typ_decl; - ] - | Psig_open open_desc -> - Sexp.list [ - Sexp.atom "Psig_open"; - open_description open_desc; - ] - | Psig_include incl_decl -> - Sexp.list [ - Sexp.atom "Psig_include"; - include_description incl_decl - ] - | Psig_class _ -> Sexp.list [Sexp.atom "Psig_class";] - | Psig_class_type _ -> Sexp.list [ Sexp.atom "Psig_class_type"; ] - | Psig_attribute attr -> - Sexp.list [ - Sexp.atom "Psig_attribute"; - attribute attr; - ] - | Psig_extension (ext, attrs) -> - Sexp.list [ - Sexp.atom "Psig_extension"; - extension ext; - attributes attrs; - ] - in - Sexp.list [ - Sexp.atom "signature_item"; - descr; - ] - - and include_description id = - Sexp.list [ - Sexp.atom "include_description"; - module_type id.pincl_mod; - attributes id.pincl_attributes; - ] - - and module_declaration md = - Sexp.list [ - Sexp.atom "module_declaration"; - string md.pmd_name.Asttypes.txt; - module_type md.pmd_type; - attributes md.pmd_attributes; - ] - - and value_binding vb = - Sexp.list [ - Sexp.atom "value_binding"; - pattern vb.pvb_pat; - expression vb.pvb_expr; - attributes vb.pvb_attributes; - ] - - and value_description vd = - Sexp.list [ - Sexp.atom "value_description"; - string vd.pval_name.Asttypes.txt; - core_type vd.pval_type; - Sexp.list (map_empty ~f:string vd.pval_prim); - attributes vd.pval_attributes; - ] - - and type_declaration td = - Sexp.list [ - Sexp.atom "type_declaration"; - string td.ptype_name.Asttypes.txt; - Sexp.list [ - Sexp.atom "ptype_params"; - Sexp.list (map_empty ~f:(fun (typexpr, var) -> - Sexp.list [ - core_type typexpr; - variance var; - ]) td.ptype_params) - ]; - Sexp.list [ - Sexp.atom "ptype_cstrs"; - Sexp.list (map_empty ~f:(fun (typ1, typ2, _loc) -> - Sexp.list [ - core_type typ1; - core_type typ2; - ]) td.ptype_cstrs) - ]; - Sexp.list [ - Sexp.atom "ptype_kind"; - type_kind td.ptype_kind; - ]; - Sexp.list [ - Sexp.atom "ptype_manifest"; - match td.ptype_manifest with - | None -> Sexp.atom "None" - | Some typ -> Sexp.list [ - Sexp.atom "Some"; - core_type typ; - ] - ]; - Sexp.list [ - Sexp.atom "ptype_private"; - private_flag td.ptype_private; - ]; - attributes td.ptype_attributes; - ] - - and extension_constructor ec = - Sexp.list [ - Sexp.atom "extension_constructor"; - string ec.pext_name.Asttypes.txt; - extension_constructor_kind ec.pext_kind; - attributes ec.pext_attributes; - ] - - and extension_constructor_kind kind = match kind with - | Pext_decl (args, opt_typ_expr) -> - Sexp.list [ - Sexp.atom "Pext_decl"; - constructor_arguments args; - match opt_typ_expr with - | None -> Sexp.atom "None" - | Some typ -> Sexp.list [ - Sexp.atom "Some"; - core_type typ; - ] - ] - | Pext_rebind longident_loc -> - Sexp.list [ - Sexp.atom "Pext_rebind"; - longident longident_loc.Asttypes.txt; - ] - - and type_extension te = - Sexp.list [ - Sexp.atom "type_extension"; - Sexp.list [ - Sexp.atom "ptyext_path"; - longident te.ptyext_path.Asttypes.txt; - ]; - Sexp.list [ - Sexp.atom "ptyext_parms"; - Sexp.list (map_empty ~f:(fun (typexpr, var) -> - Sexp.list [ - core_type typexpr; - variance var; - ]) te.ptyext_params) - ]; - Sexp.list [ - Sexp.atom "ptyext_constructors"; - Sexp.list (map_empty ~f:extension_constructor te.ptyext_constructors); - ]; - Sexp.list [ - Sexp.atom "ptyext_private"; - private_flag te.ptyext_private; - ]; - attributes te.ptyext_attributes; - ] - - and type_kind kind = match kind with - | Ptype_abstract -> Sexp.atom "Ptype_abstract" - | Ptype_variant constr_decls -> - Sexp.list [ - Sexp.atom "Ptype_variant"; - Sexp.list (map_empty ~f:constructor_declaration constr_decls); - ] - | Ptype_record lbl_decls -> - Sexp.list [ - Sexp.atom "Ptype_record"; - Sexp.list (map_empty ~f:label_declaration lbl_decls); - ] - | Ptype_open -> Sexp.atom "Ptype_open" - - and constructor_declaration cd = - Sexp.list [ - Sexp.atom "constructor_declaration"; - string cd.pcd_name.Asttypes.txt; - Sexp.list [ - Sexp.atom "pcd_args"; - constructor_arguments cd.pcd_args; - ]; - Sexp.list [ - Sexp.atom "pcd_res"; - match cd.pcd_res with - | None -> Sexp.atom "None" - | Some typ -> Sexp.list [ - Sexp.atom "Some"; - core_type typ; - ] - ]; - attributes cd.pcd_attributes; - ] - - and constructor_arguments args = match args with - | Pcstr_tuple types -> - Sexp.list [ - Sexp.atom "Pcstr_tuple"; - Sexp.list (map_empty ~f:core_type types) - ] - | Pcstr_record lds -> - Sexp.list [ - Sexp.atom "Pcstr_record"; - Sexp.list (map_empty ~f:label_declaration lds) - ] - - and label_declaration ld = - Sexp.list [ - Sexp.atom "label_declaration"; - string ld.pld_name.Asttypes.txt; - mutable_flag ld.pld_mutable; - core_type ld.pld_type; - attributes ld.pld_attributes; - ] - - and expression expr = - let desc = match expr.pexp_desc with - | Pexp_ident longident_loc -> - Sexp.list [ - Sexp.atom "Pexp_ident"; - longident longident_loc.Asttypes.txt; - ] - | Pexp_constant c -> - Sexp.list [ - Sexp.atom "Pexp_constant"; - constant c - ] - | Pexp_let (flag, vbs, expr) -> - Sexp.list [ - Sexp.atom "Pexp_let"; - rec_flag flag; - Sexp.list (map_empty ~f:value_binding vbs); - expression expr; - ] - | Pexp_function cases -> - Sexp.list [ - Sexp.atom "Pexp_function"; - Sexp.list (map_empty ~f:case cases); - ] - | Pexp_fun (arg_lbl, expr_opt, pat, expr) -> - Sexp.list [ - Sexp.atom "Pexp_fun"; - arg_label arg_lbl; - (match expr_opt with - | None -> Sexp.atom "None" - | Some expr -> Sexp.list [ - Sexp.atom "Some"; - expression expr; - ]); - pattern pat; - expression expr; - ] - | Pexp_apply (expr, args) -> - Sexp.list [ - Sexp.atom "Pexp_apply"; - expression expr; - Sexp.list (map_empty ~f:(fun (arg_lbl, expr) -> Sexp.list [ - arg_label arg_lbl; - expression expr - ]) args); - ] - | Pexp_match (expr, cases) -> - Sexp.list [ - Sexp.atom "Pexp_match"; - expression expr; - Sexp.list (map_empty ~f:case cases); - ] - | Pexp_try (expr, cases) -> - Sexp.list [ - Sexp.atom "Pexp_try"; - expression expr; - Sexp.list (map_empty ~f:case cases); - ] - | Pexp_tuple exprs -> - Sexp.list [ - Sexp.atom "Pexp_tuple"; - Sexp.list (map_empty ~f:expression exprs); - ] - | Pexp_construct (longident_loc, expr_opt) -> - Sexp.list [ - Sexp.atom "Pexp_construct"; - longident longident_loc.Asttypes.txt; - match expr_opt with - | None -> Sexp.atom "None" - | Some expr -> - Sexp.list [ - Sexp.atom "Some"; - expression expr; - ] - ] - | Pexp_variant (lbl, expr_opt) -> - Sexp.list [ - Sexp.atom "Pexp_variant"; - string lbl; - match expr_opt with - | None -> Sexp.atom "None" - | Some expr -> - Sexp.list [ - Sexp.atom "Some"; - expression expr; - ] - ] - | Pexp_record (rows, opt_expr) -> - Sexp.list [ - Sexp.atom "Pexp_record"; - Sexp.list (map_empty ~f:(fun (longident_loc, expr) -> Sexp.list [ - longident longident_loc.Asttypes.txt; - expression expr; - ]) rows); - (match opt_expr with - | None -> Sexp.atom "None" - | Some expr -> - Sexp.list [ - Sexp.atom "Some"; - expression expr; - ]); - ] - | Pexp_field (expr, longident_loc) -> - Sexp.list [ - Sexp.atom "Pexp_field"; - expression expr; - longident longident_loc.Asttypes.txt; - ] - | Pexp_setfield (expr1, longident_loc, expr2) -> - Sexp.list [ - Sexp.atom "Pexp_setfield"; - expression expr1; - longident longident_loc.Asttypes.txt; - expression expr2; - ] - | Pexp_array exprs -> - Sexp.list [ - Sexp.atom "Pexp_array"; - Sexp.list (map_empty ~f:expression exprs); - ] - | Pexp_ifthenelse (expr1, expr2, opt_expr) -> - Sexp.list [ - Sexp.atom "Pexp_ifthenelse"; - expression expr1; - expression expr2; - (match opt_expr with - | None -> Sexp.atom "None" - | Some expr -> - Sexp.list [ - Sexp.atom "Some"; - expression expr; - ]); - ] - | Pexp_sequence (expr1, expr2) -> - Sexp.list [ - Sexp.atom "Pexp_sequence"; - expression expr1; - expression expr2; - ] - | Pexp_while (expr1, expr2) -> - Sexp.list [ - Sexp.atom "Pexp_while"; - expression expr1; - expression expr2; - ] - | Pexp_for (pat, e1, e2, flag, e3) -> - Sexp.list [ - Sexp.atom "Pexp_for"; - pattern pat; - expression e1; - expression e2; - direction_flag flag; - expression e3; - ] - | Pexp_constraint (expr, typexpr) -> - Sexp.list [ - Sexp.atom "Pexp_constraint"; - expression expr; - core_type typexpr; - ] - | Pexp_coerce (expr, opt_typ, typexpr) -> - Sexp.list [ - Sexp.atom "Pexp_coerce"; - expression expr; - (match opt_typ with - | None -> Sexp.atom "None" - | Some typ -> Sexp.list [ - Sexp.atom "Some"; - core_type typ; - ]); - core_type typexpr; - ] - | Pexp_send _ -> - Sexp.list [ - Sexp.atom "Pexp_send"; - ] - | Pexp_new _ -> - Sexp.list [ - Sexp.atom "Pexp_new"; - ] - | Pexp_setinstvar _ -> - Sexp.list [ - Sexp.atom "Pexp_setinstvar"; - ] - | Pexp_override _ -> - Sexp.list [ - Sexp.atom "Pexp_override"; - ] - | Pexp_letmodule (mod_name, mod_expr, expr) -> - Sexp.list [ - Sexp.atom "Pexp_letmodule"; - string mod_name.Asttypes.txt; - module_expression mod_expr; - expression expr; - ] - | Pexp_letexception (ext_constr, expr) -> - Sexp.list [ - Sexp.atom "Pexp_letexception"; - extension_constructor ext_constr; - expression expr; - ] - | Pexp_assert expr -> - Sexp.list [ - Sexp.atom "Pexp_assert"; - expression expr; - ] - | Pexp_lazy expr -> - Sexp.list [ - Sexp.atom "Pexp_lazy"; - expression expr; - ] - | Pexp_poly _ -> - Sexp.list [ - Sexp.atom "Pexp_poly"; - ] - | Pexp_object _ -> - Sexp.list [ - Sexp.atom "Pexp_object"; - ] - | Pexp_newtype (lbl, expr) -> - Sexp.list [ - Sexp.atom "Pexp_newtype"; - string lbl.Asttypes.txt; - expression expr; - ] - | Pexp_pack mod_expr -> - Sexp.list [ - Sexp.atom "Pexp_pack"; - module_expression mod_expr; - ] - | Pexp_open (flag, longident_loc, expr) -> - Sexp.list [ - Sexp.atom "Pexp_open"; - override_flag flag; - longident longident_loc.Asttypes.txt; - expression expr; - ] - | Pexp_extension ext -> - Sexp.list [ - Sexp.atom "Pexp_extension"; - extension ext; - ] - | Pexp_unreachable -> Sexp.atom "Pexp_unreachable" - in - Sexp.list [ - Sexp.atom "expression"; - desc; - ] - - and case c = - Sexp.list [ - Sexp.atom "case"; - Sexp.list [ - Sexp.atom "pc_lhs"; - pattern c.pc_lhs; - ]; - Sexp.list [ - Sexp.atom "pc_guard"; - match c.pc_guard with - | None -> Sexp.atom "None" - | Some expr -> Sexp.list [ - Sexp.atom "Some"; - expression expr; - ] - ]; - Sexp.list [ - Sexp.atom "pc_rhs"; - expression c.pc_rhs; - ] - ] - - and pattern p = - let descr = match p.ppat_desc with - | Ppat_any -> - Sexp.atom "Ppat_any" - | Ppat_var var -> - Sexp.list [ - Sexp.atom "Ppat_var"; - string var.Location.txt; - ] - | Ppat_alias (p, alias) -> - Sexp.list [ - Sexp.atom "Ppat_alias"; - pattern p; - string alias.txt; - ] - | Ppat_constant c -> - Sexp.list [ - Sexp.atom "Ppat_constant"; - constant c; - ] - | Ppat_interval (lo, hi) -> - Sexp.list [ - Sexp.atom "Ppat_interval"; - constant lo; - constant hi; - ] - | Ppat_tuple (patterns) -> - Sexp.list [ - Sexp.atom "Ppat_tuple"; - Sexp.list (map_empty ~f:pattern patterns); - ] - | Ppat_construct (longident_loc, opt_pattern) -> - Sexp.list [ - Sexp.atom "Ppat_construct"; - longident longident_loc.Location.txt; - match opt_pattern with - | None -> Sexp.atom "None" - | Some p -> Sexp.list [ - Sexp.atom "some"; - pattern p; - ] - ] - | Ppat_variant (lbl, opt_pattern) -> - Sexp.list [ - Sexp.atom "Ppat_variant"; - string lbl; - match opt_pattern with - | None -> Sexp.atom "None" - | Some p -> Sexp.list [ - Sexp.atom "Some"; - pattern p; - ] - ] - | Ppat_record (rows, flag) -> - Sexp.list [ - Sexp.atom "Ppat_record"; - closed_flag flag; - Sexp.list (map_empty ~f:(fun (longident_loc, p) -> - Sexp.list [ - longident longident_loc.Location.txt; - pattern p; - ] - ) rows) - ] - | Ppat_array patterns -> - Sexp.list [ - Sexp.atom "Ppat_array"; - Sexp.list (map_empty ~f:pattern patterns); - ] - | Ppat_or (p1, p2) -> - Sexp.list [ - Sexp.atom "Ppat_or"; - pattern p1; - pattern p2; - ] - | Ppat_constraint (p, typexpr) -> - Sexp.list [ - Sexp.atom "Ppat_constraint"; - pattern p; - core_type typexpr; - ] - | Ppat_type longident_loc -> - Sexp.list [ - Sexp.atom "Ppat_type"; - longident longident_loc.Location.txt - ] - | Ppat_lazy p -> - Sexp.list [ - Sexp.atom "Ppat_lazy"; - pattern p; - ] - | Ppat_unpack string_loc -> - Sexp.list [ - Sexp.atom "Ppat_unpack"; - string string_loc.Location.txt; - ] - | Ppat_exception p -> - Sexp.list [ - Sexp.atom "Ppat_exception"; - pattern p; - ] - | Ppat_extension ext -> - Sexp.list [ - Sexp.atom "Ppat_extension"; - extension ext; - ] - | Ppat_open (longident_loc, p) -> - Sexp.list [ - Sexp.atom "Ppat_open"; - longident longident_loc.Location.txt; - pattern p; - ] - in - Sexp.list [ - Sexp.atom "pattern"; - descr; - ] - - and object_field field = match field with - | Otag (lbl_loc, attrs, typexpr) -> - Sexp.list [ - Sexp.atom "Otag"; - string lbl_loc.txt; - attributes attrs; - core_type typexpr; - ] - | Oinherit typexpr -> - Sexp.list [ - Sexp.atom "Oinherit"; - core_type typexpr; - ] - - and row_field field = match field with - | Rtag (label_loc, attrs, truth, types) -> - Sexp.list [ - Sexp.atom "Rtag"; - string label_loc.txt; - attributes attrs; - Sexp.atom (if truth then "true" else "false"); - Sexp.list (map_empty ~f:core_type types); - ] - | Rinherit typexpr -> - Sexp.list [ - Sexp.atom "Rinherit"; - core_type typexpr; - ] - - and package_type (mod_name_loc, package_constraints) = - Sexp.list [ - Sexp.atom "package_type"; - longident mod_name_loc.Asttypes.txt; - Sexp.list (map_empty ~f:(fun (mod_name_loc, typexpr) -> - Sexp.list [ - longident mod_name_loc.Asttypes.txt; - core_type typexpr; - ] - ) package_constraints) - ] - - and core_type typexpr = - let desc = match typexpr.ptyp_desc with - | Ptyp_any -> Sexp.atom "Ptyp_any" - | Ptyp_var var -> Sexp.list [ - Sexp.atom "Ptyp_var"; - string var - ] - | Ptyp_arrow (arg_lbl, typ1, typ2) -> - Sexp.list [ - Sexp.atom "Ptyp_arrow"; - arg_label arg_lbl; - core_type typ1; - core_type typ2; - ] - | Ptyp_tuple types -> - Sexp.list [ - Sexp.atom "Ptyp_tuple"; - Sexp.list (map_empty ~f:core_type types); - ] - | Ptyp_constr (longident_loc, types) -> - Sexp.list [ - Sexp.atom "Ptyp_constr"; - longident longident_loc.txt; - Sexp.list (map_empty ~f:core_type types); - ] - | Ptyp_alias (typexpr, alias) -> - Sexp.list [ - Sexp.atom "Ptyp_alias"; - core_type typexpr; - string alias; - ] - | Ptyp_object (fields, flag) -> - Sexp.list [ - Sexp.atom "Ptyp_object"; - closed_flag flag; - Sexp.list (map_empty ~f:object_field fields) - ] - | Ptyp_class (longident_loc, types) -> - Sexp.list [ - Sexp.atom "Ptyp_class"; - longident longident_loc.Location.txt; - Sexp.list (map_empty ~f:core_type types) - ] - | Ptyp_variant (fields, flag, opt_labels) -> - Sexp.list [ - Sexp.atom "Ptyp_variant"; - Sexp.list (map_empty ~f:row_field fields); - closed_flag flag; - match opt_labels with - | None -> Sexp.atom "None" - | Some lbls -> Sexp.list (map_empty ~f:string lbls); - ] - | Ptyp_poly (lbls, typexpr) -> - Sexp.list [ - Sexp.atom "Ptyp_poly"; - Sexp.list (map_empty ~f:(fun lbl -> string lbl.Asttypes.txt) lbls); - core_type typexpr; - ] - | Ptyp_package (package) -> - Sexp.list [ - Sexp.atom "Ptyp_package"; - package_type package; - ] - | Ptyp_extension (ext) -> - Sexp.list [ - Sexp.atom "Ptyp_extension"; - extension ext; - ] - in - Sexp.list [ - Sexp.atom "core_type"; - desc; - ] - - and payload p = - match p with - | PStr s -> - Sexp.list ( - (Sexp.atom "PStr")::(map_empty ~f:structure_item s) - ) - | PSig s -> - Sexp.list [ - Sexp.atom "PSig"; - signature s; - ] - | PTyp ct -> - Sexp.list [ - Sexp.atom "PTyp"; - core_type ct - ] - | PPat (pat, opt_expr) -> - Sexp.list [ - Sexp.atom "PPat"; - pattern pat; - match opt_expr with - | Some expr -> Sexp.list [ - Sexp.atom "Some"; - expression expr; - ] - | None -> Sexp.atom "None"; - ] - - and attribute (string_loc, p) = - Sexp.list [ - Sexp.atom "attribute"; - Sexp.atom string_loc.Asttypes.txt; - payload p; - ] - - and extension (string_loc, p) = - Sexp.list [ - Sexp.atom "extension"; - Sexp.atom string_loc.Asttypes.txt; - payload p; - ] - - and attributes attrs = - let sexprs = map_empty ~f:attribute attrs in - Sexp.list ((Sexp.atom "attributes")::sexprs) - - let implementation = structure - let interface = signature -end - -module IO: sig - val read_file: string -> string - val read_stdin: unit -> string -end = struct - (* random chunk size: 2^15, TODO: why do we guess randomly? *) - let chunk_size = 32768 - - let read_file filename = - let chan = open_in filename in - let buffer = Buffer.create chunk_size in - let chunk = (Bytes.create [@doesNotRaise]) chunk_size in - let rec loop () = - let len = try input chan chunk 0 chunk_size with Invalid_argument _ -> 0 in - if len == 0 then ( - close_in_noerr chan; - Buffer.contents buffer - ) else ( - Buffer.add_subbytes buffer chunk 0 len; - loop () - ) - in - loop () - - let read_stdin () = - let buffer = Buffer.create chunk_size in - let chunk = (Bytes.create [@doesNotRaise]) chunk_size in - let rec loop () = - let len = try input stdin chunk 0 chunk_size with Invalid_argument _ -> 0 in - if len == 0 then ( - close_in_noerr stdin; - Buffer.contents buffer - ) else ( - Buffer.add_subbytes buffer chunk 0 len; - loop () - ) - in - loop () -end - -module CharacterCodes = struct - let eof = -1 - - let space = 0x0020 - let newline = 0x0A (* \n *) [@@live] - let line_feed = 0x0A (* \n *) - let carriage_return = 0x0D (* \r *) - let line_separator = 0x2028 - let paragraph_separator = 0x2029 - - let tab = 0x09 - - let bang = 0x21 - let dot = 0x2E - let colon = 0x3A - let comma = 0x2C - let backtick = 0x60 - (* let question = 0x3F *) - let semicolon = 0x3B - let underscore = 0x5F - let single_quote = 0x27 - let double_quote = 0x22 - let equal = 0x3D - let bar = 0x7C - let tilde = 0x7E - let question = 0x3F - let ampersand = 0x26 - let at = 0x40 - let dollar = 0x24 - let percent = 0x25 - - let lparen = 0x28 - let rparen = 0x29 - let lbracket = 0x5B - let rbracket = 0x5D - let lbrace = 0x7B - let rbrace = 0x7D - - let forwardslash = 0x2F (* / *) - let backslash = 0x5C (* \ *) - - let greater_than = 0x3E - let hash = 0x23 - let less_than = 0x3C - - let minus = 0x2D - let plus = 0x2B - let asterisk = 0x2A - - let _0 = 0x30 - let _1 = 0x31 [@@live] - let _2 = 0x32 [@@live] - let _3 = 0x33 [@@live] - let _4 = 0x34 [@@live] - let _5 = 0x35 [@@live] - let _6 = 0x36 [@@live] - let _7 = 0x37 [@@live] - let _8 = 0x38 [@@live] - let _9 = 0x39 - - module Lower = struct - let a = 0x61 - let b = 0x62 - let c = 0x63 [@@live] - let d = 0x64 [@@live] - let e = 0x65 - let f = 0x66 - let g = 0x67 - let h = 0x68 [@@live] - let i = 0x69 [@@live] - let j = 0x6A [@@live] - let k = 0x6B [@@live] - let l = 0x6C [@@live] - let m = 0x6D [@@live] - let n = 0x6E - let o = 0x6F - let p = 0x70 - let q = 0x71 [@@live] - let r = 0x72 - let s = 0x73 [@@live] - let t = 0x74 - let u = 0x75 [@@live] - let v = 0x76 [@@live] - let w = 0x77 [@@live] - let x = 0x78 - let y = 0x79 [@@live] - let z = 0x7A - end - - module Upper = struct - let a = 0x41 - (* let b = 0x42 *) - let c = 0x43 [@@live] - let d = 0x44 [@@live] - let e = 0x45 [@@live] - let f = 0x46 [@@live] - let g = 0x47 - let h = 0x48 [@@live] - let i = 0x49 [@@live] - let j = 0x4A [@@live] - let k = 0x4B [@@live] - let l = 0x4C [@@live] - let m = 0x4D [@@live] - let b = 0x4E [@@live] - let o = 0x4F [@@live] - let p = 0x50 [@@live] - let q = 0x51 [@@live] - let r = 0x52 [@@live] - let s = 0x53 [@@live] - let t = 0x54 [@@live] - let u = 0x55 [@@live] - let v = 0x56 [@@live] - let w = 0x57 [@@live] - let x = 0x58 [@@live] - let y = 0x59 [@@live] - let z = 0x5a - end - - (* returns lower-case ch, ch should be ascii *) - let lower ch = - (* if ch >= Lower.a && ch <= Lower.z then ch else ch + 32 *) - 32 lor ch - - let is_letter ch = - Lower.a <= ch && ch <= Lower.z || - Upper.a <= ch && ch <= Upper.z - - let is_upper_case ch = - Upper.a <= ch && ch <= Upper.z - - let is_digit ch = _0 <= ch && ch <= _9 - - let is_hex ch = - (_0 <= ch && ch <= _9) || - (Lower.a <= (lower ch) && (lower ch) <= Lower.f) - - (* - // ES5 7.3: - // The ECMAScript line terminator characters are listed in Table 3. - // Table 3: Line Terminator Characters - // Code Unit Value Name Formal Name - // \u000A Line Feed - // \u000D Carriage Return - // \u2028 Line separator - // \u2029 Paragraph separator - // Only the characters in Table 3 are treated as line terminators. Other new line or line - // breaking characters are treated as white space but not as line terminators. - *) - let is_line_break ch = - ch == line_feed - || ch == carriage_return - || ch == line_separator - || ch == paragraph_separator - - let digit_value ch = - if _0 <= ch && ch <= _9 then - ch - 48 - else if Lower.a <= (lower ch) && (lower ch) <= Lower.f then - (lower ch) - Lower.a + 10 - else - 16 (* larger than any legal value *) -end - -module Comment: sig - type t - - val to_string: t -> string - - val loc: t -> Location.t - val txt: t -> string - val prev_tok_end_pos: t -> Lexing.position - - val set_prev_tok_end_pos: t -> Lexing.position -> unit - - val is_single_line_comment: t -> bool - - val make_single_line_comment: loc:Location.t -> string -> t - val make_multi_line_comment: loc:Location.t -> string -> t - val from_ocaml_comment: - loc:Location.t -> txt:string -> prev_tok_end_pos:Lexing.position -> t - val trim_spaces: string -> string -end = struct - type style = - | SingleLine - | MultiLine - - let style_to_string s = match s with - | SingleLine -> "SingleLine" - | MultiLine -> "MultiLine" - - type t = { - txt: string; - style: style; - loc: Location.t; - mutable prev_tok_end_pos: Lexing.position; - } - - let loc t = t.loc - let txt t = t.txt - let prev_tok_end_pos t = t.prev_tok_end_pos - - let set_prev_tok_end_pos t pos = - t.prev_tok_end_pos <- pos - - let is_single_line_comment t = match t.style with - | SingleLine -> true - | MultiLine -> false - - let to_string t = - Format.sprintf - "(txt: %s\nstyle: %s\nlines: %d-%d)" - t.txt - (style_to_string t.style) - t.loc.loc_start.pos_lnum - t.loc.loc_end.pos_lnum - - let make_single_line_comment ~loc txt = { - txt; - loc; - style = SingleLine; - prev_tok_end_pos = Lexing.dummy_pos; - } - - let make_multi_line_comment ~loc txt = { - txt; - loc; - style = MultiLine; - prev_tok_end_pos = Lexing.dummy_pos; - } - - let from_ocaml_comment ~loc ~txt ~prev_tok_end_pos = { - txt; - loc; - style = MultiLine; - prev_tok_end_pos = prev_tok_end_pos - } - - let trim_spaces s = - let len = String.length s in - if len = 0 then s - else if String.unsafe_get s 0 = ' ' || String.unsafe_get s (len - 1) = ' ' then ( - let b = Bytes.of_string s in - let i = ref 0 in - while !i < len && (Bytes.unsafe_get b !i) = ' ' do - incr i - done; - let j = ref (len - 1) in - while !j >= !i && (Bytes.unsafe_get b !j) = ' ' do - decr j - done; - if !j >= !i then - (Bytes.sub [@doesNotRaise]) b !i (!j - !i + 1) |> Bytes.to_string - else - "" - ) else s -end - -module Token = struct - type t = - | Open - | True | False - | Character of char - | Int of {i: string; suffix: char option} - | Float of {f: string; suffix: char option} - | String of string - | Lident of string - | Uident of string - | As - | Dot | DotDot | DotDotDot - | Bang - | Semicolon - | Let - | And - | Rec - | Underscore - | SingleQuote - | Equal | EqualEqual | EqualEqualEqual - | Bar - | Lparen - | Rparen - | Lbracket - | Rbracket - | Lbrace - | Rbrace - | Colon - | Comma - | Eof - | Exception - | Backslash [@live] - | Forwardslash | ForwardslashDot - | Asterisk | AsteriskDot | Exponentiation - | Minus | MinusDot - | Plus | PlusDot | PlusPlus | PlusEqual - | ColonGreaterThan - | GreaterThan - | LessThan - | LessThanSlash - | Hash | HashEqual | HashHash - | Assert - | Lazy - | Tilde - | Question - | If | Else | For | In | To | Downto | While | Switch - | When - | EqualGreater | MinusGreater - | External - | Typ - | Private - | Mutable - | Constraint - | Include - | Module - | Of - | With - | Land | Lor - | Band (* Bitwise and: & *) - | BangEqual | BangEqualEqual - | LessEqual | GreaterEqual - | ColonEqual - | At | AtAt - | Percent | PercentPercent - | Comment of Comment.t - | List - | TemplateTail of string - | TemplatePart of string - | Backtick - | BarGreater - | Try | Catch - | Import - | Export - - let precedence = function - | HashEqual | ColonEqual -> 1 - | Lor -> 2 - | Land -> 3 - | Equal | EqualEqual | EqualEqualEqual | LessThan | GreaterThan - | BangEqual | BangEqualEqual | LessEqual | GreaterEqual | BarGreater -> 4 - | Plus | PlusDot | Minus | MinusDot | PlusPlus -> 5 - | Asterisk | AsteriskDot | Forwardslash | ForwardslashDot -> 6 - | Exponentiation -> 7 - | MinusGreater -> 8 - | Dot -> 9 - | _ -> 0 - - let to_string = function - | Open -> "open" - | True -> "true" | False -> "false" - | Character c -> "'" ^ (Char.escaped c) ^ "'" - | String s -> s - | Lident str -> str - | Uident str -> str - | Dot -> "." | DotDot -> ".." | DotDotDot -> "..." - | Int {i} -> "int " ^ i - | Float {f} -> "Float: " ^ f - | Bang -> "!" - | Semicolon -> ";" - | Let -> "let" - | And -> "and" - | Rec -> "rec" - | Underscore -> "_" - | SingleQuote -> "'" - | Equal -> "=" | EqualEqual -> "==" | EqualEqualEqual -> "===" - | Eof -> "eof" - | Bar -> "|" - | As -> "as" - | Lparen -> "(" | Rparen -> ")" - | Lbracket -> "[" | Rbracket -> "]" - | Lbrace -> "{" | Rbrace -> "}" - | ColonGreaterThan -> ":>" - | Colon -> ":" - | Comma -> "," - | Minus -> "-" | MinusDot -> "-." - | Plus -> "+" | PlusDot -> "+." | PlusPlus -> "++" | PlusEqual -> "+=" - | Backslash -> "\\" - | Forwardslash -> "/" | ForwardslashDot -> "/." - | Exception -> "exception" - | Hash -> "#" | HashHash -> "##" | HashEqual -> "#=" - | GreaterThan -> ">" - | LessThan -> "<" - | LessThanSlash -> " "*" | AsteriskDot -> "*." | Exponentiation -> "**" - | Assert -> "assert" - | Lazy -> "lazy" - | Tilde -> "tilde" - | Question -> "?" - | If -> "if" - | Else -> "else" - | For -> "for" - | In -> "in" - | To -> "to" - | Downto -> "downto" - | While -> "while" - | Switch -> "switch" - | When -> "when" - | EqualGreater -> "=>" | MinusGreater -> "->" - | External -> "external" - | Typ -> "type" - | Private -> "private" - | Constraint -> "constraint" - | Mutable -> "mutable" - | Include -> "include" - | Module -> "module" - | Of -> "of" - | With -> "with" - | Lor -> "||" - | Band -> "&" | Land -> "&&" - | BangEqual -> "!=" | BangEqualEqual -> "!==" - | GreaterEqual -> ">=" | LessEqual -> "<=" - | ColonEqual -> ":=" - | At -> "@" | AtAt -> "@@" - | Percent -> "%" | PercentPercent -> "%%" - | Comment c -> "Comment(" ^ (Comment.to_string c) ^ ")" - | List -> "list" - | TemplatePart text -> text ^ "${" - | TemplateTail text -> "TemplateTail(" ^ text ^ ")" - | Backtick -> "`" - | BarGreater -> "|>" - | Try -> "try" | Catch -> "catch" - | Import -> "import" - | Export -> "export" - - let keyword_table = function - | "true" -> True - | "false" -> False - | "open" -> Open - | "let" -> Let - | "rec" -> Rec - | "and" -> And - | "as" -> As - | "exception" -> Exception - | "assert" -> Assert - | "lazy" -> Lazy - | "if" -> If - | "else" -> Else - | "for" -> For - | "in" -> In - | "to" -> To - | "downto" -> Downto - | "while" -> While - | "switch" -> Switch - | "when" -> When - | "external" -> External - | "type" -> Typ - | "private" -> Private - | "mutable" -> Mutable - | "constraint" -> Constraint - | "include" -> Include - | "module" -> Module - | "of" -> Of - | "list" -> List - | "with" -> With - | "try" -> Try - | "catch" -> Catch - | "import" -> Import - | "export" -> Export - | _ -> raise Not_found - [@@raises Not_found] - - let is_keyword = function - | True | False | Open | Let | Rec | And | As - | Exception | Assert | Lazy | If | Else | For | In | To - | Downto | While | Switch | When | External | Typ | Private - | Mutable | Constraint | Include | Module | Of - | Land | Lor | List | With - | Try | Catch | Import | Export -> true - | _ -> false - - let lookup_keyword str = - try keyword_table str with - | Not_found -> - if CharacterCodes.is_upper_case (int_of_char (str.[0] [@doesNotRaise])) then - Uident str - else Lident str - - let is_keyword_txt str = - try let _ = keyword_table str in true with - | Not_found -> false -end - -module Grammar = struct - type t = - | OpenDescription (* open Belt *) - | ModuleLongIdent (* Foo or Foo.Bar *) [@live] - | Ternary (* condExpr ? trueExpr : falseExpr *) - | Es6ArrowExpr - | Jsx - | JsxAttribute - | JsxChild [@live] - | ExprOperand - | ExprUnary - | ExprSetField - | ExprBinaryAfterOp of Token.t - | ExprBlock - | ExprCall - | ExprList - | ExprArrayAccess - | ExprArrayMutation - | ExprIf - | IfCondition | IfBranch | ElseBranch - | TypeExpression - | External - | PatternMatching - | PatternMatchCase - | LetBinding - | PatternList - | PatternOcamlList - | PatternRecord - - | TypeDef - | TypeConstrName - | TypeParams - | TypeParam [@live] - | PackageConstraint - - | TypeRepresentation - - | RecordDecl - | ConstructorDeclaration - | ParameterList - | StringFieldDeclarations - | FieldDeclarations - | TypExprList - | FunctorArgs - | ModExprList - | TypeParameters - | RecordRows - | RecordRowsStringKey - | ArgumentList - | Signature - | Specification - | Structure - | Implementation - | Attribute - | TypeConstraint - | Primitive - | AtomicTypExpr - | ListExpr - | JsFfiImport - - let to_string = function - | OpenDescription -> "an open description" - | ModuleLongIdent -> "a module identifier" - | Ternary -> "a ternary expression" - | Es6ArrowExpr -> "an es6 arrow function" - | Jsx -> "a jsx expression" - | JsxAttribute -> "a jsx attribute" - | ExprOperand -> "a basic expression" - | ExprUnary -> "a unary expression" - | ExprBinaryAfterOp op -> "an expression after the operator \"" ^ Token.to_string op ^ "\"" - | ExprIf -> "an if expression" - | IfCondition -> "the condition of an if expression" - | IfBranch -> "the true-branch of an if expression" - | ElseBranch -> "the else-branch of an if expression" - | TypeExpression -> "a type" - | External -> "an external" - | PatternMatching -> "the cases of a pattern match" - | ExprBlock -> "a block with expressions" - | ExprSetField -> "a record field mutation" - | ExprCall -> "a function application" - | ExprArrayAccess -> "an array access expression" - | ExprArrayMutation -> "an array mutation" - | LetBinding -> "a let binding" - | TypeDef -> "a type definition" - | TypeParams -> "type parameters" - | TypeParam -> "a type parameter" - | TypeConstrName -> "a type-constructor name" - | TypeRepresentation -> "a type representation" - | RecordDecl -> "a record declaration" - | PatternMatchCase -> "a pattern match case" - | ConstructorDeclaration -> "a constructor declaration" - | ExprList -> "multiple expressions" - | PatternList -> "multiple patterns" - | PatternOcamlList -> "a list pattern" - | PatternRecord -> "a record pattern" - | ParameterList -> "parameters" - | StringFieldDeclarations -> "string field declarations" - | FieldDeclarations -> "field declarations" - | TypExprList -> "list of types" - | FunctorArgs -> "functor arguments" - | ModExprList -> "list of module expressions" - | TypeParameters -> "list of type parameters" - | RecordRows -> "rows of a record" - | RecordRowsStringKey -> "rows of a record with string keys" - | ArgumentList -> "arguments" - | Signature -> "signature" - | Specification -> "specification" - | Structure -> "structure" - | Implementation -> "implementation" - | Attribute -> "an attribute" - | TypeConstraint -> "constraints on a type" - | Primitive -> "an external primitive" - | AtomicTypExpr -> "a type" - | ListExpr -> "an ocaml list expr" - | PackageConstraint -> "a package constraint" - | JsFfiImport -> "js ffi import" - | JsxChild -> "jsx child" - - let is_signature_item_start = function - | Token.At - | Let - | Typ - | External - | Exception - | Open - | Include - | Module - | AtAt - | PercentPercent -> true - | _ -> false - - let is_atomic_pattern_start = function - | Token.Int _ | String _ | Character _ - | Lparen | Lbracket | Lbrace - | Underscore - | Lident _ | Uident _ | List - | Exception | Lazy - | Percent -> true - | _ -> false - - let is_atomic_expr_start = function - | Token.True | False - | Int _ | String _ | Float _ | Character _ - | Backtick - | Uident _ | Lident _ | Hash - | Lparen - | List - | Lbracket - | Lbrace - | LessThan - | Module - | Percent -> true - | _ -> false - - let is_atomic_typ_expr_start = function - | Token.SingleQuote | Underscore - | Lparen | Lbrace - | Uident _ | Lident _ | List - | Percent -> true - | _ -> false - - let is_expr_start = function - | Token.True | False - | Int _ | String _ | Float _ | Character _ | Backtick - | Underscore (* _ => doThings() *) - | Uident _ | Lident _ | Hash - | Lparen | List | Module | Lbracket | Lbrace - | LessThan - | Minus | MinusDot | Plus | PlusDot | Bang - | Percent | At - | If | Switch | While | For | Assert | Lazy | Try -> true - | _ -> false - - let is_jsx_attribute_start = function - | Token.Lident _ | Question -> true - | _ -> false - - let is_structure_item_start = function - | Token.Open - | Let - | Typ - | External | Import | Export - | Exception - | Include - | Module - | AtAt - | PercentPercent - | At -> true - | t when is_expr_start t -> true - | _ -> false - - let is_pattern_start = function - | Token.Int _ | Float _ | String _ | Character _ | True | False | Minus | Plus - | Lparen | Lbracket | Lbrace | List - | Underscore - | Lident _ | Uident _ | Hash | HashHash - | Exception | Lazy | Percent | Module - | At -> true - | _ -> false - - let is_parameter_start = function - | Token.Typ | Tilde | Dot -> true - | token when is_pattern_start token -> true - | _ -> false - - (* TODO: overparse Uident ? *) - let is_string_field_decl_start = function - | Token.String _ | At -> true - | _ -> false - - (* TODO: overparse Uident ? *) - let is_field_decl_start = function - | Token.At | Mutable | Lident _ | List -> true - (* recovery, TODO: this is not ideal… *) - | Uident _ -> true - | t when Token.is_keyword t -> true - | _ -> false - - let is_record_decl_start = function - | Token.At - | Mutable - | Lident _ | List -> true - | _ -> false - - let is_typ_expr_start = function - | Token.At - | SingleQuote - | Underscore - | Lparen | Lbracket - | Uident _ | Lident _ | List - | Module - | Percent - | Lbrace -> true - | _ -> false - - let is_type_parameter_start = function - | Token.Tilde | Dot -> true - | token when is_typ_expr_start token -> true - | _ -> false - - let is_type_param_start = function - | Token.Plus | Minus | SingleQuote | Underscore -> true - | _ -> false - - let is_functor_arg_start = function - | Token.At | Uident _ | Underscore - | Percent - | Lbrace - | Lparen -> true - | _ -> false - - let is_mod_expr_start = function - | Token.At | Percent - | Uident _ | Lbrace | Lparen -> true - | _ -> false - - let is_record_row_start = function - | Token.DotDotDot -> true - | Token.Uident _ | Lident _ | List -> true - (* TODO *) - | t when Token.is_keyword t -> true - | _ -> false - - let is_record_row_string_key_start = function - | Token.String _ -> true - | _ -> false - - let is_argument_start = function - | Token.Tilde | Dot | Underscore -> true - | t when is_expr_start t -> true - | _ -> false - - let is_pattern_match_start = function - | Token.Bar -> true - | t when is_pattern_start t -> true - | _ -> false - - let is_pattern_ocaml_list_start = function - | Token.DotDotDot -> true - | t when is_pattern_start t -> true - | _ -> false - - let is_pattern_record_item_start = function - | Token.DotDotDot | Uident _ | Lident _ | List | Underscore -> true - | _ -> false - - let is_attribute_start = function - | Token.At -> true - | _ -> false - - let is_js_ffi_import_start = function - | Token.Lident _ | At -> true - | _ -> false - - let is_jsx_child_start = is_atomic_expr_start - - let is_block_expr_start = function - | Token.At | Hash | Percent | Minus | MinusDot | Plus | PlusDot | Bang - | True | False | Int _ | String _ | Character _ | Lident _ | Uident _ - | Lparen | List | Lbracket | Lbrace | Forwardslash | Assert - | Lazy | If | For | While | Switch | Open | Module | Exception | Let - | LessThan | Backtick | Try | Underscore -> true - | _ -> false - - let is_list_element grammar token = - match grammar with - | ExprList -> token = Token.DotDotDot || is_expr_start token - | ListExpr -> token = DotDotDot || is_expr_start token - | PatternList -> token = DotDotDot || is_pattern_start token - | ParameterList -> is_parameter_start token - | StringFieldDeclarations -> is_string_field_decl_start token - | FieldDeclarations -> is_field_decl_start token - | RecordDecl -> is_record_decl_start token - | TypExprList -> is_typ_expr_start token || token = Token.LessThan - | TypeParams -> is_type_param_start token - | FunctorArgs -> is_functor_arg_start token - | ModExprList -> is_mod_expr_start token - | TypeParameters -> is_type_parameter_start token - | RecordRows -> is_record_row_start token - | RecordRowsStringKey -> is_record_row_string_key_start token - | ArgumentList -> is_argument_start token - | Signature | Specification -> is_signature_item_start token - | Structure | Implementation -> is_structure_item_start token - | PatternMatching -> is_pattern_match_start token - | PatternOcamlList -> is_pattern_ocaml_list_start token - | PatternRecord -> is_pattern_record_item_start token - | Attribute -> is_attribute_start token - | TypeConstraint -> token = Constraint - | PackageConstraint -> token = And - | ConstructorDeclaration -> token = Bar - | Primitive -> begin match token with Token.String _ -> true | _ -> false end - | JsxAttribute -> is_jsx_attribute_start token - | JsFfiImport -> is_js_ffi_import_start token - | _ -> false - - let is_list_terminator grammar token = - match grammar, token with - | _, Token.Eof - | ExprList, (Rparen | Forwardslash | Rbracket) - | ListExpr, Rparen - | ArgumentList, Rparen - | TypExprList, (Rparen | Forwardslash | GreaterThan | Equal) - | ModExprList, Rparen - | (PatternList | PatternOcamlList | PatternRecord), - (Forwardslash | Rbracket | Rparen | EqualGreater (* pattern matching => *) | In (* for expressions *) | Equal (* let {x} = foo *)) - | ExprBlock, Rbrace - | (Structure | Signature), Rbrace - | TypeParams, Rparen - | ParameterList, (EqualGreater | Lbrace) - | JsxAttribute, (Forwardslash | GreaterThan) - | JsFfiImport, Rbrace - | StringFieldDeclarations, Rbrace -> true - - | Attribute, token when token <> At -> true - | TypeConstraint, token when token <> Constraint -> true - | PackageConstraint, token when token <> And -> true - | ConstructorDeclaration, token when token <> Bar -> true - | Primitive, Semicolon -> true - | Primitive, token when is_structure_item_start token -> true - - | _ -> false - - let is_part_of_list grammar token = - is_list_element grammar token || is_list_terminator grammar token -end - -module Reporting = struct - module TerminalDoc = struct - type break = - | Never - | Always - - type document = - | Nil - | Group of {break: break; doc: document} - | Text of string - | Indent of {amount: int; doc: document} - | Append of {doc1: document; doc2: document} - - let group ~break doc = Group {break; doc} - let text txt = Text (txt) - let indent i d = Indent {amount = i; doc = d} - let append d1 d2 = Append {doc1 = d1; doc2 = d2} - let nil = Nil - - type stack = - | Empty - | Cons of {doc: document; stack: stack} - - let push stack doc = Cons {doc; stack} - - type mode = - | Flat - | Break - - let to_string (* ~width *) (doc : document) = - let buffer = Buffer.create 100 in - let rec loop stack mode offset = - match stack with - | Empty -> () - | Cons {doc; stack = rest} -> - begin match doc with - | Nil -> loop rest mode offset - | Text txt -> - Buffer.add_string buffer txt; - loop rest mode (offset + (String.length txt)) - | Indent {amount = i; doc} -> - let indentation = (String.make [@doesNotRaise]) i ' ' in - Buffer.add_string buffer indentation; - loop (push rest doc) mode (offset + i) - | Append {doc1; doc2} -> - let rest = push rest doc2 in - let rest = push rest - (match mode = Flat with - | true -> Nil - | false -> text "\n") - in - let rest = push rest doc1 in - loop rest mode offset - | Group {break; doc} -> - let rest = push rest doc in - begin match break with - | Always -> loop rest Break offset - | Never -> loop rest Flat offset - end - end - in - loop (push Empty doc) Flat 0; - Buffer.contents buffer - end - - type color = - | NoColor [@live] - | Red [@live] - - type style = { - underline: bool; [@live] - color: color; [@live] - } - - let highlight ~from ~len txt = - if from < 0 || (String.length txt) == 0 || (from >= String.length txt) then txt else - let before = try String.sub txt 0 from with Invalid_argument _ -> "" in - let content = - "\027[31m" ^ (try String.sub txt from len with Invalid_argument _ -> "") ^ "\027[0m" - in - let after = try String.sub txt (from + len) (String.length txt - (from + len)) with Invalid_argument _ -> "" in - before ^ content ^ after - - let underline ~from ~len txt = - let open TerminalDoc in - let indent = (String.make [@doesNotRaise]) from ' ' in - let underline = (String.make [@doesNotRaise]) len '^' in - let line = highlight ~from:0 ~len underline in - group ~break:Always - (append (text txt) (text (indent ^ line))) - - let rec drop n l = - if n == 1 then l - else drop (n - 1) (match l with | _x::xs -> xs | _ -> l) - - let rec take n l = - match l with - | _ when n == 0 -> [] - | [] -> [] - | x::xs -> x::(take (n -1) xs) - - (* TODO: cleanup *) - let render_code_context ~missing (src : string) start_pos end_pos = - let open Lexing in - let start_col = (start_pos.pos_cnum - start_pos.pos_bol) in - let end_col = end_pos.pos_cnum - start_pos.pos_cnum + start_col in - let start_line = max 1 (start_pos.pos_lnum - 2) in (* 2 lines before *) - let lines = String.split_on_char '\n' src in - let end_line = - let len = List.length lines in - min len (start_pos.pos_lnum + 3) (* 2 lines after *) - in - let lines = - lines - |> drop start_line - |> take (end_line - start_line) - |> Array.of_list - in - - let render_line x ix = - let x = if ix = start_pos.pos_lnum then - begin match missing with - | Some _len -> x ^ (String.make 10 ' ' [@doesNotRaise]) - | None -> x - end - else - x - in - - let open TerminalDoc in - let row_nr = - let txt = string_of_int ix in - let len = String.length txt in - if ix = start_pos.pos_lnum then - highlight ~from:0 ~len txt - else txt - in - let len = - let len = if end_col >= 0 then - end_col - start_col - else - 1 - in - if (start_col + len) > String.length x then String.length x - start_col - 1 else len - in - let line = - if ix = start_pos.pos_lnum then - begin match missing with - | Some len -> - underline - ~from:( - start_col + String.length (String.length (string_of_int ix) |> string_of_int) + 5 - ) ~len x - | None -> - let len = if start_col + len > String.length x then - (String.length x) - start_col - else - len - in - text (highlight ~from:start_col ~len x) - end - else text x - in - group ~break:Never - (append - (append (text row_nr) (text " │")) - (indent 2 line)) - in - - let report_doc = ref TerminalDoc.nil in - - let lines_len = Array.length lines in - for i = 0 to (lines_len - 1) do - let line = try (Array.get [@doesNotRaise]) lines i with Invalid_argument _ -> "" in - report_doc := - let open TerminalDoc in - let ix = start_line + i in - group ~break:Always (append !report_doc (render_line line ix)) - done; - - TerminalDoc.to_string !report_doc - - type problem = - | Unexpected of Token.t [@live] - | Expected of {token: Token.t; pos: Lexing.position; context: Grammar.t option} [@live] - | Message of string [@live] - | Uident [@live] - | Lident [@live] - | Unbalanced of Token.t [@live] - - type parse_error = Lexing.position * problem -end - -module Diagnostics: sig - type t - type category - type report - - type report_style - val parse_report_style: string -> report_style - - val unexpected: Token.t -> (Grammar.t * Lexing.position) list -> category - val expected: ?grammar:Grammar.t -> Lexing.position -> Token.t -> category - val uident: Token.t -> category - val lident: Token.t -> category - val unclosed_string: category - val unclosed_template: category - val unclosed_comment: category - val unknown_uchar: int -> category - val message: string -> category - - val make: - filename: string - -> start_pos: Lexing.position - -> end_pos: Lexing.position - -> category - -> t - - val string_of_report: style:report_style -> t list -> string -> string -end = struct - type category = - | Unexpected of {token: Token.t; context: (Grammar.t * Lexing.position) list} - | Expected of {context: Grammar.t option; pos: Lexing.position (* prev token end*); token: Token.t} - | Message of string - | Uident of Token.t - | Lident of Token.t - | UnclosedString - | UnclosedTemplate - | UnclosedComment - | UnknownUchar of int - - type t = { - filename: string; - start_pos: Lexing.position; - end_pos: Lexing.position; - category: category; - } - - type report = t list - - (* TODO: add json here *) - type report_style = - | Pretty - | Plain - - let parse_report_style txt = match (String.lowercase_ascii txt) with - | "plain" -> Plain - | _ -> Pretty - - let default_unexpected token = - "I'm not sure what to parse here when looking at \"" ^ (Token.to_string token) ^ "\"." - - let explain t = - match t.category with - | Uident current_token -> - begin match current_token with - | Lident lident -> - let guess = String.capitalize_ascii lident in - "Did you mean `" ^ guess ^"` instead of `" ^ lident ^ "`?" - | t when Token.is_keyword t -> - let token = Token.to_string t in - "`" ^ token ^ "` is a reserved keyword." - | _ -> - "At this point, I'm looking for an uppercased identifier like `Belt` or `Array`" - end - | Lident current_token -> - begin match current_token with - | Uident uident -> - let guess = String.uncapitalize_ascii uident in - "Did you mean `" ^ guess ^"` instead of `" ^ uident ^ "`?" - | t when Token.is_keyword t -> - let token = Token.to_string t in - "`" ^ token ^ "` is a reserved keyword. Keywords need to be escaped: \\\"" ^ token ^ "\"" - | Underscore -> - "`_` isn't a valid name." - | _ -> - "I'm expecting an lowercased identifier like `name` or `age`" - end - | Message txt -> txt - | UnclosedString -> - "This string is missing a double quote at the end" - | UnclosedTemplate -> - "Did you forget to close this template expression with a backtick?" - | UnclosedComment -> - "This comment seems to be missing a closing `*/`" - | UnknownUchar uchar -> - begin match uchar with - | 94 (* ^ *) -> - "Hmm, not sure what I should do here with this character.\nIf you're trying to deref an expression, use `foo.contents` instead." - | _ -> - "Hmm, I have no idea what this character means…" - end - | Expected {context; token = t} -> - let hint = match context with - | Some grammar -> "It signals the start of " ^ (Grammar.to_string grammar) - | None -> "" - in - "Did you forget a `" ^ (Token.to_string t) ^ "` here? " ^ hint - | Unexpected {token = t; context = breadcrumbs} -> - let name = (Token.to_string t) in - begin match breadcrumbs with - | (AtomicTypExpr, _)::breadcrumbs -> - begin match breadcrumbs, t with - | ((StringFieldDeclarations | FieldDeclarations) , _) :: _, (String _ | At | Rbrace | Comma | Eof) -> - "I'm missing a type here" - | _, t when Grammar.is_structure_item_start t || t = Eof -> - "Missing a type here" - | _ -> - default_unexpected t - end - | (ExprOperand, _)::breadcrumbs -> - begin match breadcrumbs, t with - | (ExprBlock, _) :: _, Rbrace -> - "It seems that this expression block is empty" - | (ExprBlock, _) :: _, Bar -> (* Pattern matching *) - "Looks like there might be an expression missing here" - | (ExprSetField, _) :: _, _ -> - "It seems that this record field mutation misses an expression" - | (ExprArrayMutation, _) :: _, _ -> - "Seems that an expression is missing, with what do I mutate the array?" - | ((ExprBinaryAfterOp _ | ExprUnary), _) ::_, _ -> - "Did you forget to write an expression here?" - | (Grammar.LetBinding, _)::_, _ -> - "This let-binding misses an expression" - | _::_, (Rbracket | Rbrace) -> - "Missing expression" - | _ -> - "I'm not sure what to parse here when looking at \"" ^ name ^ "\"." - end - | (TypeParam, _)::_ -> - begin match t with - | Lident ident -> - "Did you mean '" ^ ident ^"? A Type parameter starts with a quote." - | _ -> - "I'm not sure what to parse here when looking at \"" ^ name ^ "\"." - end - | _ -> - (* TODO: match on circumstance to verify Lident needed ? *) - if Token.is_keyword t then - "`" ^ name ^ "` is a reserved keyword. Keywords need to be escaped: \\\"" ^ (Token.to_string t) ^ "\"" - else - "I'm not sure what to parse here when looking at \"" ^ name ^ "\"." - end - - let to_plain_string t buffer = - Buffer.add_string buffer t.filename; - Buffer.add_char buffer '('; - Buffer.add_string buffer (string_of_int t.start_pos.pos_cnum); - Buffer.add_char buffer ','; - Buffer.add_string buffer (string_of_int t.end_pos.pos_cnum); - Buffer.add_char buffer ')'; - Buffer.add_char buffer ':'; - Buffer.add_string buffer (explain t) - - let to_string t src = - let open Lexing in - let startchar = t.start_pos.pos_cnum - t.start_pos.pos_bol in - let endchar = t.end_pos.pos_cnum - t.start_pos.pos_cnum + startchar in - let location_info = - Printf.sprintf (* ReasonLanguageServer requires the following format *) - "File \"%s\", line %d, characters %d-%d:" - t.filename - t.start_pos.pos_lnum - startchar - endchar - in - let code = - let missing = match t.category with - | Expected {token = t} -> - Some (String.length (Token.to_string t)) - | _ -> None - in - Reporting.render_code_context ~missing src t.start_pos t.end_pos - in - let explanation = explain t in - Printf.sprintf "%s\n\n%s\n\n%s\n\n" location_info code explanation - - let make ~filename ~start_pos ~end_pos category = { - filename; - start_pos; - end_pos; - category - } - - let string_of_report ~style diagnostics src = - match style with - | Pretty -> - List.fold_left (fun report diagnostic -> - report ^ (to_string diagnostic src) ^ "\n" - ) "\n" (List.rev diagnostics) - | Plain -> - let buffer = Buffer.create 100 in - List.iter (fun diagnostic -> - to_plain_string diagnostic buffer; - Buffer.add_char buffer '\n'; - ) diagnostics; - Buffer.contents buffer - - let unexpected token context = - Unexpected {token; context} - - let expected ?grammar pos token = - Expected {context = grammar; pos; token} - - let uident current_token = Uident current_token - let lident current_token = Lident current_token - let unclosed_string = UnclosedString - let unclosed_comment = UnclosedComment - let unclosed_template = UnclosedTemplate - let unknown_uchar code = UnknownUchar code - let message txt = Message txt -end - -(* Collection of utilities to view the ast in a more a convenient form, - * allowing for easier processing. - * Example: given a ptyp_arrow type, what are its arguments and what is the - * returnType? *) -module ParsetreeViewer : sig - (* Restructures a nested tree of arrow types into its args & returnType - * The parsetree contains: a => b => c => d, for printing purposes - * we restructure the tree into (a, b, c) and its returnType d *) - val arrow_type: Parsetree.core_type -> - Parsetree.attributes * - (Parsetree.attributes * Asttypes.arg_label * Parsetree.core_type) list * - Parsetree.core_type - - val functor_type: Parsetree.module_type -> - (Parsetree.attributes * string Asttypes.loc * Parsetree.module_type option) list * - Parsetree.module_type - - (* filters @bs out of the provided attributes *) - val process_uncurried_attribute: Parsetree.attributes -> bool * Parsetree.attributes - - (* if ... else if ... else ... is represented as nested expressions: if ... else { if ... } - * The purpose of this function is to flatten nested ifs into one sequence. - * Basically compute: ([if, else if, else if, else if], else) *) - val collect_if_expressions: - Parsetree.expression -> - (Parsetree.expression * Parsetree.expression) list * Parsetree.expression option - - val collect_list_expressions: - Parsetree.expression -> (Parsetree.expression list * Parsetree.expression option) - - type fun_param_kind = - | Parameter of { - attrs: Parsetree.attributes; - lbl: Asttypes.arg_label; - default_expr: Parsetree.expression option; - pat: Parsetree.pattern; - } - | NewTypes of {attrs: Parsetree.attributes; locs: string Asttypes.loc list} - - val fun_expr: - Parsetree.expression -> - Parsetree.attributes * - fun_param_kind list * - Parsetree.expression - - (* example: - * `makeCoordinate({ - * x: 1, - * y: 2, - * })` - * Notice howe `({` and `})` "hug" or stick to each other *) - val is_huggable_expression: Parsetree.expression -> bool - - val is_huggable_pattern: Parsetree.pattern -> bool - - val is_huggable_rhs: Parsetree.expression -> bool - - val operator_precedence: string -> int - - val is_unary_expression: Parsetree.expression -> bool - val is_binary_operator: string -> bool - val is_binary_expression: Parsetree.expression -> bool - - val flattenable_operators: string -> string -> bool - - val has_attributes: Parsetree.attributes -> bool - - val is_array_access: Parsetree.expression -> bool - val is_ternary_expr: Parsetree.expression -> bool - - val collect_ternary_parts: Parsetree.expression -> ((Parsetree.expression * Parsetree.expression) list * Parsetree.expression) - - val parameters_should_hug: - fun_param_kind list -> bool - - val filter_ternary_attributes: Parsetree.attributes -> Parsetree.attributes - - val is_jsx_expression: Parsetree.expression -> bool - val has_jsx_attribute: Parsetree.attributes -> bool - - val should_indent_binary_expr: Parsetree.expression -> bool - val should_inline_rhs_binary_expr: Parsetree.expression -> bool - val filter_printeable_attributes: Parsetree.attributes -> Parsetree.attributes - val partition_printeable_attributes: Parsetree.attributes -> (Parsetree.attributes * Parsetree.attributes) - - val requires_special_callback_printing_last_arg: (Asttypes.arg_label * Parsetree.expression) list -> bool - val requires_special_callback_printing_first_arg: (Asttypes.arg_label * Parsetree.expression) list -> bool - - val mod_expr_apply : Parsetree.module_expr -> ( - Parsetree.module_expr list * Parsetree.module_expr - ) - - val mod_expr_functor : Parsetree.module_expr -> ( - (Parsetree.attributes * string Asttypes.loc * Parsetree.module_type option) list * - Parsetree.module_expr - ) - - val split_gentype_attr: Parsetree.attributes -> (bool * Parsetree.attributes) - - val collect_patterns_from_list_construct: - Parsetree.pattern list -> Parsetree.pattern -> - (Parsetree.pattern list * Parsetree.pattern) - - val is_block_expr : Parsetree.expression -> bool - - val is_template_literal: Parsetree.expression -> bool - - val collect_or_pattern_chain: - Parsetree.pattern -> Parsetree.pattern list - - val process_braces_attr : Parsetree.expression -> (Parsetree.attribute option * Parsetree.expression) - - val filter_parsing_attrs : Parsetree.attributes -> Parsetree.attributes - - val is_braced_expr : Parsetree.expression -> bool - - val is_pipe_expr : Parsetree.expression -> bool - - val extract_value_description_from_mod_expr: Parsetree.module_expr -> Parsetree.value_description list - - type js_import_scope = - | JsGlobalImport (* nothing *) - | JsModuleImport of string (* from "path" *) - | JsScopedImport of string list (* window.location *) - - val classify_js_import: Parsetree.value_description -> js_import_scope - - (* (__x) => f(a, __x, c) -----> f(a, _, c) *) - val rewrite_underscore_apply: Parsetree.expression -> Parsetree.expression - - (* (__x) => f(a, __x, c) -----> f(a, _, c) *) - val is_underscore_apply_sugar: Parsetree.expression -> bool -end = struct - open Parsetree - - let arrow_type ct = - let rec process attrs_before acc typ = match typ with - | {ptyp_desc = Ptyp_arrow (Nolabel as lbl, typ1, typ2); ptyp_attributes = []} -> - let arg = ([], lbl, typ1) in - process attrs_before (arg::acc) typ2 - | {ptyp_desc = Ptyp_arrow (Nolabel as lbl, typ1, typ2); ptyp_attributes = [({txt ="bs"}, _) ] as attrs} -> - let arg = (attrs, lbl, typ1) in - process attrs_before (arg::acc) typ2 - | {ptyp_desc = Ptyp_arrow (Nolabel, _typ1, _typ2); ptyp_attributes = _attrs} as return_type -> - let args = List.rev acc in - (attrs_before, args, return_type) - | {ptyp_desc = Ptyp_arrow ((Labelled _ | Optional _) as lbl, typ1, typ2); ptyp_attributes = attrs} -> - let arg = (attrs, lbl, typ1) in - process attrs_before (arg::acc) typ2 - | typ -> - (attrs_before, List.rev acc, typ) - in - begin match ct with - | {ptyp_desc = Ptyp_arrow (Nolabel, _typ1, _typ2); ptyp_attributes = attrs} as typ -> - process attrs [] {typ with ptyp_attributes = []} - | typ -> process [] [] typ - end - - let functor_type modtype = - let rec process acc modtype = match modtype with - | {pmty_desc = Pmty_functor (lbl, arg_type, return_type); pmty_attributes = attrs} -> - let arg = (attrs, lbl, arg_type) in - process (arg::acc) return_type - | mod_type -> - (List.rev acc, mod_type) - in - process [] modtype - - let process_uncurried_attribute attrs = - let rec process uncurried_spotted acc attrs = - match attrs with - | [] -> (uncurried_spotted, List.rev acc) - | ({Location.txt = "bs"}, _)::rest -> process true acc rest - | attr::rest -> process uncurried_spotted (attr::acc) rest - in - process false [] attrs - - let collect_if_expressions expr = - let rec collect acc expr = match expr.pexp_desc with - | Pexp_ifthenelse (if_expr, then_expr, Some else_expr) -> - collect ((if_expr, then_expr)::acc) else_expr - | Pexp_ifthenelse (if_expr, then_expr, (None as else_expr)) -> - let ifs = List.rev ((if_expr, then_expr)::acc) in - (ifs, else_expr) - | _ -> - (List.rev acc, Some expr) - in - collect [] expr - - let collect_list_expressions expr = - let rec collect acc expr = match expr.pexp_desc with - | Pexp_construct ({txt = Longident.Lident "[]"}, _) -> - (List.rev acc, None) - | Pexp_construct ( - {txt = Longident.Lident "::"}, - Some {pexp_desc = Pexp_tuple (hd::[tail])} - ) -> - collect (hd::acc) tail - | _ -> - (List.rev acc, Some expr) - in - collect [] expr - - (* (__x) => f(a, __x, c) -----> f(a, _, c) *) - let rewrite_underscore_apply expr = - match expr.pexp_desc with - | Pexp_fun ( - Nolabel, - None, - {ppat_desc = Ppat_var {txt="__x"}}, - ({pexp_desc = Pexp_apply (call_expr, args)} as e) - ) -> - let new_args = List.map (fun arg -> - match arg with - | ( - lbl, - ({pexp_desc = Pexp_ident ({txt = Longident.Lident "__x"} as lid)} as arg_expr) - ) -> - (lbl, {arg_expr with pexp_desc = Pexp_ident ({lid with txt = Longident.Lident "_"})}) - | arg -> arg - ) args in - {e with pexp_desc = Pexp_apply (call_expr, new_args)} - | _ -> expr - - type fun_param_kind = - | Parameter of { - attrs: Parsetree.attributes; - lbl: Asttypes.arg_label; - default_expr: Parsetree.expression option; - pat: Parsetree.pattern; - } - | NewTypes of {attrs: Parsetree.attributes; locs: string Asttypes.loc list} - - let fun_expr expr = - (* Turns (type t, type u, type z) into "type t u z" *) - let rec collect_new_types acc return_expr = - match return_expr with - | {pexp_desc = Pexp_newtype (string_loc, return_expr); pexp_attributes = []} -> - collect_new_types (string_loc::acc) return_expr - | return_expr -> - (List.rev acc, return_expr) - in - let rec collect attrs_before acc expr = match expr with - | {pexp_desc = Pexp_fun ( - Nolabel, - None, - {ppat_desc = Ppat_var {txt="__x"}}, - {pexp_desc = Pexp_apply _} - )} -> - (attrs_before, List.rev acc, rewrite_underscore_apply expr) - | {pexp_desc = Pexp_fun (lbl, default_expr, pattern, return_expr); pexp_attributes = []} -> - let parameter = Parameter { - attrs = []; - lbl = lbl; - default_expr = default_expr; - pat = pattern; - } in - collect attrs_before (parameter::acc) return_expr - | {pexp_desc = Pexp_newtype (string_loc, rest); pexp_attributes = attrs} -> - let (string_locs, return_expr) = collect_new_types [string_loc] rest in - let param = NewTypes {attrs; locs = string_locs} in - collect attrs_before (param::acc) return_expr - | {pexp_desc = Pexp_fun (lbl, default_expr, pattern, return_expr); pexp_attributes = [({txt = "bs"}, _)] as attrs} -> - let parameter = Parameter { - attrs = attrs; - lbl = lbl; - default_expr = default_expr; - pat = pattern; - } in - collect attrs_before (parameter::acc) return_expr - | { - pexp_desc = Pexp_fun ((Labelled _ | Optional _) as lbl, default_expr, pattern, return_expr); - pexp_attributes = attrs - } -> - let parameter = Parameter { - attrs = attrs; - lbl = lbl; - default_expr = default_expr; - pat = pattern; - } in - collect attrs_before (parameter::acc) return_expr - | expr -> - (attrs_before, List.rev acc, expr) - in - begin match expr with - | {pexp_desc = Pexp_fun (Nolabel, _defaultExpr, _pattern, _returnExpr); pexp_attributes = attrs} as expr -> - collect attrs [] {expr with pexp_attributes = []} - | expr -> collect [] [] expr - end - - let process_braces_attr expr = - match expr.pexp_attributes with - | (({txt = "res.braces"}, _) as attr)::attrs -> - (Some attr, {expr with pexp_attributes = attrs}) - | _ -> - (None, expr) - - let filter_parsing_attrs attrs = - List.filter (fun attr -> - match attr with - | ({Location.txt = ("res.ternary" | "res.braces" | "bs" | "res.namedArgLoc")}, _) -> false - | _ -> true - ) attrs - - let is_block_expr expr = - match expr.pexp_desc with - | Pexp_letmodule _ - | Pexp_letexception _ - | Pexp_let _ - | Pexp_open _ - | Pexp_sequence _ -> true - | _ -> false - - let is_braced_expr expr = - match process_braces_attr expr with - | (Some _, _) -> true - | _ -> false - - let is_huggable_expression expr = - match expr.pexp_desc with - | Pexp_array _ - | Pexp_tuple _ - | Pexp_construct ({txt = Longident.Lident ("::" | "[]")}, _) - | Pexp_extension ({txt = "obj"}, _) - | Pexp_record _ -> true - | _ when is_block_expr expr -> true - | _ when is_braced_expr expr -> true - | _ -> false - - let is_huggable_rhs expr = - match expr.pexp_desc with - | Pexp_array _ - | Pexp_tuple _ - | Pexp_construct ({txt = Longident.Lident ("::" | "[]")}, _) - | Pexp_extension ({txt = "obj"}, _) - | Pexp_record _ -> true - | _ when is_braced_expr expr -> true - | _ -> false - - let is_huggable_pattern pattern = - match pattern.ppat_desc with - | Ppat_array _ - | Ppat_tuple _ - | Ppat_record _ - | Ppat_construct _ -> true - | _ -> false - - let operator_precedence operator = match operator with - | ":=" -> 1 - | "||" -> 2 - | "&&" -> 3 - | "=" | "==" | "<" | ">" | "!=" | "<>" | "!==" | "<=" | ">=" | "|>" -> 4 - | "+" | "+." | "-" | "-." | "^" -> 5 - | "*" | "*." | "/" | "/." -> 6 - | "**" -> 7 - | "#" | "##" | "|." -> 8 - | _ -> 0 - - let is_unary_operator operator = match operator with - | "~+" | "~+." | "~-" | "~-." | "not" -> true - | _ -> false - - let is_unary_expression expr = match expr.pexp_desc with - | Pexp_apply( - {pexp_desc = Pexp_ident {txt = Longident.Lident operator}}, - [Nolabel, _arg] - ) when is_unary_operator operator -> true - | _ -> false - - let is_binary_operator operator = match operator with - | ":=" - | "||" - | "&&" - | "=" | "==" | "<" | ">" | "!=" | "!==" | "<=" | ">=" | "|>" - | "+" | "+." | "-" | "-." | "^" - | "*" | "*." | "/" | "/." - | "**" - | "|." | "<>" -> true - | _ -> false - - let is_binary_expression expr = match expr.pexp_desc with - | Pexp_apply( - {pexp_desc = Pexp_ident {txt = Longident.Lident operator}}, - [(Nolabel, _operand1); (Nolabel, _operand2)] - ) when is_binary_operator operator -> true - | _ -> false - - let is_equality_operator operator = match operator with - | "=" | "==" | "<>" | "!=" -> true - | _ -> false - - let flattenable_operators parent_operator child_operator = - let prec_parent = operator_precedence parent_operator in - let prec_child = operator_precedence child_operator in - if prec_parent == prec_child then - not ( - is_equality_operator parent_operator && - is_equality_operator child_operator - ) - else - false - - let has_attributes attrs = - List.exists (fun attr -> match attr with - | ({Location.txt = "bs" | "res.ternary" | "res.braces"}, _) -> false - | _ -> true - ) attrs - - let is_array_access expr = match expr.pexp_desc with - | Pexp_apply ( - {pexp_desc = Pexp_ident {txt = Longident.Ldot (Lident "Array", "get")}}, - [Nolabel, _parentExpr; Nolabel, _memberExpr] - ) -> true - | _ -> false - - let rec has_ternary_attribute attrs = - match attrs with - | [] -> false - | ({Location.txt="res.ternary"},_)::_ -> true - | _::attrs -> has_ternary_attribute attrs - - let is_ternary_expr expr = match expr with - | { - pexp_attributes = attrs; - pexp_desc = Pexp_ifthenelse _ - } when has_ternary_attribute attrs -> true - | _ -> false - - let collect_ternary_parts expr = - let rec collect acc expr = match expr with - | { - pexp_attributes = attrs; - pexp_desc = Pexp_ifthenelse (condition, consequent, Some(alternate)) - } when has_ternary_attribute attrs -> collect ((condition, consequent)::acc) alternate - | alternate -> (List.rev acc, alternate) - in - collect [] expr - - let parameters_should_hug parameters = match parameters with - | [Parameter { - attrs = []; - lbl = Asttypes.Nolabel; - default_expr = None; - pat = pat - }] when is_huggable_pattern pat -> true - | _ -> false - - let filter_ternary_attributes attrs = - List.filter (fun attr -> match attr with - |({Location.txt="res.ternary"},_) -> false - | _ -> true - ) attrs - - let is_jsx_expression expr = - let rec loop attrs = - match attrs with - | [] -> false - | ({Location.txt = "JSX"}, _)::_ -> true - | _::attrs -> loop attrs - in - match expr.pexp_desc with - | Pexp_apply _ -> - loop expr.Parsetree.pexp_attributes - | _ -> false - - let has_jsx_attribute attributes = match attributes with - | ({Location.txt = "JSX"},_)::_ -> true - | _ -> false - - let should_indent_binary_expr expr = - let same_precedence_sub_expression operator sub_expression = - match sub_expression with - | {pexp_desc = Pexp_apply ( - {pexp_desc = Pexp_ident {txt = Longident.Lident sub_operator}}, - [Nolabel, _lhs; Nolabel, _rhs] - )} when is_binary_operator sub_operator -> - flattenable_operators operator sub_operator - | _ -> true - in - match expr with - | {pexp_desc = Pexp_apply ( - {pexp_desc = Pexp_ident {txt = Longident.Lident operator}}, - [Nolabel, lhs; Nolabel, _rhs] - )} when is_binary_operator operator -> - is_equality_operator operator || - not (same_precedence_sub_expression operator lhs) || - operator = ":=" - | _ -> false - - let should_inline_rhs_binary_expr rhs = match rhs.pexp_desc with - | Parsetree.Pexp_constant _ - | Pexp_let _ - | Pexp_letmodule _ - | Pexp_letexception _ - | Pexp_sequence _ - | Pexp_open _ - | Pexp_ifthenelse _ - | Pexp_for _ - | Pexp_while _ - | Pexp_try _ - | Pexp_array _ - | Pexp_record _ -> true - | _ -> false - - let filter_printeable_attributes attrs = - List.filter (fun attr -> match attr with - | ({Location.txt="bs" | "res.ternary"}, _) -> false - | _ -> true - ) attrs - - let partition_printeable_attributes attrs = - List.partition (fun attr -> match attr with - | ({Location.txt="bs" | "res.ternary"}, _) -> false - | _ -> true - ) attrs - - let requires_special_callback_printing_last_arg args = - let rec loop args = match args with - | [] -> false - | [(_, {pexp_desc = Pexp_fun _ | Pexp_newtype _})] -> true - | (_, {pexp_desc = Pexp_fun _ | Pexp_newtype _})::_ -> false - | _::rest -> loop rest - in - loop args - - let requires_special_callback_printing_first_arg args = - let rec loop args = match args with - | [] -> true - | (_, {pexp_desc = Pexp_fun _ | Pexp_newtype _})::_ -> false - | _::rest -> loop rest - in - match args with - | [(_, {pexp_desc = Pexp_fun _ | Pexp_newtype _})] -> false - | (_, {pexp_desc = Pexp_fun _ | Pexp_newtype _})::rest -> loop rest - | _ -> false - - let mod_expr_apply mod_expr = - let rec loop acc mod_expr = match mod_expr with - | {pmod_desc = Pmod_apply (next, arg)} -> - loop (arg::acc) next - | _ -> (acc, mod_expr) - in - loop [] mod_expr - - let mod_expr_functor mod_expr = - let rec loop acc mod_expr = match mod_expr with - | {pmod_desc = Pmod_functor (lbl, mod_type, return_mod_expr); pmod_attributes = attrs} -> - let param = (attrs, lbl, mod_type) in - loop (param::acc) return_mod_expr - | return_mod_expr -> - (List.rev acc, return_mod_expr) - in - loop [] mod_expr - - let split_gentype_attr attrs = - match attrs with - | ({Location.txt = "genType"}, _)::attrs -> (true, attrs) - | attrs -> (false, attrs) - - let rec collect_patterns_from_list_construct acc pattern = - let open Parsetree in - match pattern.ppat_desc with - | Ppat_construct( - {txt = Longident.Lident "::"}, - Some {ppat_desc=Ppat_tuple (pat::rest::[])} - ) -> - collect_patterns_from_list_construct (pat::acc) rest - | _ -> List.rev acc, pattern - - let rec is_template_literal expr = - let is_pexp_constant_string expr = match expr.pexp_desc with - | Pexp_constant (Pconst_string (_, Some _)) -> true - | _ -> false - in - match expr.pexp_desc with - | Pexp_apply ( - {pexp_desc = Pexp_ident {txt = Longident.Lident "^"}}, - [Nolabel, arg1; Nolabel, arg2] - ) when not (is_pexp_constant_string arg1 && is_pexp_constant_string arg2) -> - is_template_literal arg1 || is_template_literal arg2 - | Pexp_constant (Pconst_string (_, Some _)) -> true - | _ -> false - - (* Blue | Red | Green -> [Blue; Red; Green] *) - let collect_or_pattern_chain pat = - let rec loop pattern chain = - match pattern.ppat_desc with - | Ppat_or (left, right) -> loop left (right::chain) - | _ -> pattern::chain - in - loop pat [] - - let is_pipe_expr expr = match expr.pexp_desc with - | Pexp_apply( - {pexp_desc = Pexp_ident {txt = Longident.Lident ("|." | "|>") }}, - [(Nolabel, _operand1); (Nolabel, _operand2)] - ) -> true - | _ -> false - - let extract_value_description_from_mod_expr mod_expr = - let rec loop structure acc = - match structure with - | [] -> List.rev acc - | structure_item::structure -> - begin match structure_item.Parsetree.pstr_desc with - | Pstr_primitive vd -> loop structure (vd::acc) - | _ -> loop structure acc - end - in - match mod_expr.pmod_desc with - | Pmod_structure structure -> loop structure [] - | _ -> [] - - type js_import_scope = - | JsGlobalImport (* nothing *) - | JsModuleImport of string (* from "path" *) - | JsScopedImport of string list (* window.location *) - - let classify_js_import value_description = - let rec loop attrs = - let open Parsetree in - match attrs with - | [] -> JsGlobalImport - | ({Location.txt = "scope"}, PStr [{pstr_desc = Pstr_eval ({pexp_desc = Pexp_constant (Pconst_string (s, _))}, _)}])::_ -> - JsScopedImport [s] - | ({Location.txt = "genType.import"}, PStr [{pstr_desc = Pstr_eval ({pexp_desc = Pexp_constant (Pconst_string (s, _))}, _)}])::_ -> - JsModuleImport s - | ({Location.txt = "scope"}, PStr [{pstr_desc = Pstr_eval ({pexp_desc = Pexp_tuple exprs}, _)}])::_ -> - let scopes = List.fold_left (fun acc curr -> - match curr.Parsetree.pexp_desc with - | Pexp_constant (Pconst_string (s, _)) -> s::acc - | _ -> acc - ) [] exprs - in - JsScopedImport (List.rev scopes) - | _::attrs -> - loop attrs - in - loop value_description.pval_attributes - - let is_underscore_apply_sugar expr = - match expr.pexp_desc with - | Pexp_fun ( - Nolabel, - None, - {ppat_desc = Ppat_var {txt="__x"}}, - {pexp_desc = Pexp_apply _} - ) -> true - | _ -> false -end - -module Parens: sig - type kind = Parenthesized | Braced of Location.t | Nothing - - val expr: Parsetree.expression -> kind - val structure_expr: Parsetree.expression -> kind - - val unary_expr_operand: Parsetree.expression -> kind - - val binary_expr_operand: is_lhs:bool -> Parsetree.expression -> kind - val sub_binary_expr_operand: string -> string -> bool - val rhs_binary_expr_operand: string -> Parsetree.expression -> bool - val flatten_operand_rhs: string -> Parsetree.expression -> bool - - val lazy_or_assert_expr_rhs: Parsetree.expression -> kind - - val field_expr: Parsetree.expression -> kind - - val set_field_expr_rhs: Parsetree.expression -> kind - - val ternary_operand: Parsetree.expression -> kind - - val jsx_prop_expr: Parsetree.expression -> kind - val jsx_child_expr: Parsetree.expression -> kind - - val binary_expr: Parsetree.expression -> kind - val mod_type_functor_return: Parsetree.module_type -> bool - val mod_type_with_operand: Parsetree.module_type -> bool - val mod_expr_functor_constraint: Parsetree.module_type -> bool - - val braced_expr: Parsetree.expression -> bool - val call_expr: Parsetree.expression -> kind - - val include_mod_expr : Parsetree.module_expr -> bool -end = struct - type kind = Parenthesized | Braced of Location.t | Nothing - - let expr expr = - let opt_braces, _ = ParsetreeViewer.process_braces_attr expr in - match opt_braces with - | Some ({Location.loc = braces_loc}, _) -> Braced(braces_loc) - | _ -> - begin match expr with - | {Parsetree.pexp_desc = Pexp_constraint ( - {pexp_desc = Pexp_pack _}, - {ptyp_desc = Ptyp_package _} - )} -> Nothing - | {pexp_desc = Pexp_constraint _ } -> Parenthesized - | _ -> Nothing - end - - let call_expr expr = - let opt_braces, _ = ParsetreeViewer.process_braces_attr expr in - match opt_braces with - | Some ({Location.loc = braces_loc}, _) -> Braced(braces_loc) - | _ -> - begin match expr with - | {Parsetree.pexp_attributes = attrs} when - begin match ParsetreeViewer.filter_parsing_attrs attrs with - | _::_ -> true - | [] -> false - end - -> Parenthesized - | _ when ParsetreeViewer.is_unary_expression expr || ParsetreeViewer.is_binary_expression expr -> Parenthesized - | {Parsetree.pexp_desc = Pexp_constraint ( - {pexp_desc = Pexp_pack _}, - {ptyp_desc = Ptyp_package _} - )} -> Nothing - | {pexp_desc = Pexp_fun _} - when ParsetreeViewer.is_underscore_apply_sugar expr -> Nothing - | {pexp_desc = - Pexp_lazy _ - | Pexp_assert _ - | Pexp_fun _ - | Pexp_newtype _ - | Pexp_function _ - | Pexp_constraint _ - | Pexp_setfield _ - | Pexp_match _ - | Pexp_try _ - | Pexp_while _ - | Pexp_for _ - | Pexp_ifthenelse _ - } -> Parenthesized - | _ -> Nothing - end - - let structure_expr expr = - let opt_braces, _ = ParsetreeViewer.process_braces_attr expr in - match opt_braces with - | Some ({Location.loc = braces_loc}, _) -> Braced(braces_loc) - | None -> - begin match expr with - | _ when ParsetreeViewer.has_attributes expr.pexp_attributes && - not (ParsetreeViewer.is_jsx_expression expr) -> Parenthesized - | {Parsetree.pexp_desc = Pexp_constraint ( - {pexp_desc = Pexp_pack _}, - {ptyp_desc = Ptyp_package _} - )} -> Nothing - | {pexp_desc = Pexp_constraint _ } -> Parenthesized - | _ -> Nothing - end - - let unary_expr_operand expr = - let opt_braces, _ = ParsetreeViewer.process_braces_attr expr in - match opt_braces with - | Some ({Location.loc = braces_loc}, _) -> Braced(braces_loc) - | None -> - begin match expr with - | {Parsetree.pexp_attributes = attrs} when - begin match ParsetreeViewer.filter_parsing_attrs attrs with - | _::_ -> true - | [] -> false - end - -> Parenthesized - | expr when - ParsetreeViewer.is_unary_expression expr || - ParsetreeViewer.is_binary_expression expr - -> Parenthesized - | {pexp_desc = Pexp_constraint ( - {pexp_desc = Pexp_pack _}, - {ptyp_desc = Ptyp_package _} - )} -> Nothing - | {pexp_desc = Pexp_fun _} - when ParsetreeViewer.is_underscore_apply_sugar expr -> Nothing - | {pexp_desc = - Pexp_lazy _ - | Pexp_assert _ - | Pexp_fun _ - | Pexp_newtype _ - | Pexp_function _ - | Pexp_constraint _ - | Pexp_setfield _ - | Pexp_extension _ (* readability? maybe remove *) - | Pexp_match _ - | Pexp_try _ - | Pexp_while _ - | Pexp_for _ - | Pexp_ifthenelse _ - } -> Parenthesized - | _ -> Nothing - end - - let binary_expr_operand ~is_lhs expr = - let opt_braces, _ = ParsetreeViewer.process_braces_attr expr in - match opt_braces with - | Some ({Location.loc = braces_loc}, _) -> Braced(braces_loc) - | None -> - begin match expr with - | {Parsetree.pexp_desc = Pexp_constraint ( - {pexp_desc = Pexp_pack _}, - {ptyp_desc = Ptyp_package _} - )} -> Nothing - | {pexp_desc = Pexp_fun _} - when ParsetreeViewer.is_underscore_apply_sugar expr -> Nothing - | {pexp_desc = Pexp_constraint _ | Pexp_fun _ | Pexp_function _ | Pexp_newtype _} -> Parenthesized - | expr when ParsetreeViewer.is_binary_expression expr -> Parenthesized - | expr when ParsetreeViewer.is_ternary_expr expr -> Parenthesized - | {pexp_desc = - Pexp_lazy _ - | Pexp_assert _ - } when is_lhs -> Parenthesized - | _ -> Nothing - end - - let sub_binary_expr_operand parent_operator child_operator = - let prec_parent = ParsetreeViewer.operator_precedence parent_operator in - let prec_child = ParsetreeViewer.operator_precedence child_operator in - prec_parent > prec_child || - (prec_parent == prec_child && - not (ParsetreeViewer.flattenable_operators parent_operator child_operator)) || - (* a && b || c, add parens to (a && b) for readability, who knows the difference by heart… *) - (parent_operator = "||" && child_operator = "&&") - - let rhs_binary_expr_operand parent_operator rhs = - match rhs.Parsetree.pexp_desc with - | Parsetree.Pexp_apply( - {pexp_attributes = []; - pexp_desc = Pexp_ident {txt = Longident.Lident operator}}, - [_, _left; _, _right] - ) when ParsetreeViewer.is_binary_operator operator -> - let prec_parent = ParsetreeViewer.operator_precedence parent_operator in - let prec_child = ParsetreeViewer.operator_precedence operator in - prec_parent == prec_child - | _ -> false - - let flatten_operand_rhs parent_operator rhs = - match rhs.Parsetree.pexp_desc with - | Parsetree.Pexp_apply( - {pexp_desc = Pexp_ident {txt = Longident.Lident operator}}, - [_, _left; _, _right] - ) when ParsetreeViewer.is_binary_operator operator -> - let prec_parent = ParsetreeViewer.operator_precedence parent_operator in - let prec_child = ParsetreeViewer.operator_precedence operator in - prec_parent >= prec_child || rhs.pexp_attributes <> [] - | Pexp_constraint ( - {pexp_desc = Pexp_pack _}, - {ptyp_desc = Ptyp_package _} - ) -> false - | Pexp_fun _ when ParsetreeViewer.is_underscore_apply_sugar rhs -> false - | Pexp_fun _ - | Pexp_newtype _ - | Pexp_setfield _ - | Pexp_constraint _ -> true - | _ when ParsetreeViewer.is_ternary_expr rhs -> true - | _ -> false - - let lazy_or_assert_expr_rhs expr = - let opt_braces, _ = ParsetreeViewer.process_braces_attr expr in - match opt_braces with - | Some ({Location.loc = braces_loc}, _) -> Braced(braces_loc) - | None -> - begin match expr with - | {Parsetree.pexp_attributes = attrs} when - begin match ParsetreeViewer.filter_parsing_attrs attrs with - | _::_ -> true - | [] -> false - end - -> Parenthesized - | expr when ParsetreeViewer.is_binary_expression expr -> Parenthesized - | {pexp_desc = Pexp_constraint ( - {pexp_desc = Pexp_pack _}, - {ptyp_desc = Ptyp_package _} - )} -> Nothing - | {pexp_desc = Pexp_fun _} - when ParsetreeViewer.is_underscore_apply_sugar expr -> Nothing - | {pexp_desc = - Pexp_lazy _ - | Pexp_assert _ - | Pexp_fun _ - | Pexp_newtype _ - | Pexp_function _ - | Pexp_constraint _ - | Pexp_setfield _ - | Pexp_match _ - | Pexp_try _ - | Pexp_while _ - | Pexp_for _ - | Pexp_ifthenelse _ - } -> Parenthesized - | _ -> Nothing - end - - let is_negative_constant constant = - let is_neg txt = - let len = String.length txt in - len > 0 && (String.get [@doesNotRaise]) txt 0 = '-' - in - match constant with - | Parsetree.Pconst_integer (i, _) | Pconst_float (i, _) when is_neg i -> true - | _ -> false - - let field_expr expr = - let opt_braces, _ = ParsetreeViewer.process_braces_attr expr in - match opt_braces with - | Some ({Location.loc = braces_loc}, _) -> Braced(braces_loc) - | None -> - begin match expr with - | {Parsetree.pexp_attributes = attrs} when - begin match ParsetreeViewer.filter_parsing_attrs attrs with - | _::_ -> true - | [] -> false - end - -> Parenthesized - | expr when - ParsetreeViewer.is_binary_expression expr || - ParsetreeViewer.is_unary_expression expr - -> Parenthesized - | {pexp_desc = Pexp_constraint ( - {pexp_desc = Pexp_pack _}, - {ptyp_desc = Ptyp_package _} - )} -> Nothing - | {pexp_desc = Pexp_constant c } when is_negative_constant c -> Parenthesized - | {pexp_desc = Pexp_fun _} - when ParsetreeViewer.is_underscore_apply_sugar expr -> Nothing - | {pexp_desc = - Pexp_lazy _ - | Pexp_assert _ - | Pexp_extension _ (* %extension.x vs (%extension).x *) - | Pexp_fun _ - | Pexp_newtype _ - | Pexp_function _ - | Pexp_constraint _ - | Pexp_setfield _ - | Pexp_match _ - | Pexp_try _ - | Pexp_while _ - | Pexp_for _ - | Pexp_ifthenelse _ - } -> Parenthesized - | _ -> Nothing - end - - let set_field_expr_rhs expr = - let opt_braces, _ = ParsetreeViewer.process_braces_attr expr in - match opt_braces with - | Some ({Location.loc = braces_loc}, _) -> Braced(braces_loc) - | None -> - begin match expr with - | {Parsetree.pexp_desc = Pexp_constraint ( - {pexp_desc = Pexp_pack _}, - {ptyp_desc = Ptyp_package _} - )} -> Nothing - | {pexp_desc = Pexp_constraint _ } -> Parenthesized - | _ -> Nothing - end - - let ternary_operand expr = - let opt_braces, _ = ParsetreeViewer.process_braces_attr expr in - match opt_braces with - | Some ({Location.loc = braces_loc}, _) -> Braced(braces_loc) - | None -> - begin match expr with - | {Parsetree.pexp_desc = Pexp_constraint ( - {pexp_desc = Pexp_pack _}, - {ptyp_desc = Ptyp_package _} - )} -> Nothing - | {pexp_desc = Pexp_constraint _ } -> Parenthesized - | {pexp_desc = Pexp_fun _ | Pexp_newtype _} -> - let (_attrsOnArrow, _parameters, return_expr) = ParsetreeViewer.fun_expr expr in - begin match return_expr.pexp_desc with - | Pexp_constraint _ -> Parenthesized - | _ -> Nothing - end - | _ -> Nothing - end - - let starts_with_minus txt = - let len = String.length txt in - if len == 0 then - false - else - let s = (String.get [@doesNotRaise]) txt 0 in - s = '-' - - let jsx_prop_expr expr = - match expr.Parsetree.pexp_desc with - | Parsetree.Pexp_let _ - | Pexp_sequence _ - | Pexp_letexception _ - | Pexp_letmodule _ - | Pexp_open _ -> Nothing - | _ -> - let opt_braces, _ = ParsetreeViewer.process_braces_attr expr in - begin match opt_braces with - | Some ({Location.loc = braces_loc}, _) -> Braced(braces_loc) - | None -> - begin match expr with - | {Parsetree.pexp_desc = - Pexp_constant (Pconst_integer (x, _) | Pconst_float (x, _)); - pexp_attributes = []} - when starts_with_minus x -> Parenthesized - | {Parsetree.pexp_desc = - Pexp_ident _ | Pexp_constant _ | Pexp_field _ | Pexp_construct _ | Pexp_variant _ | - Pexp_array _ | Pexp_pack _ | Pexp_record _ | Pexp_extension _ | - Pexp_letmodule _ | Pexp_letexception _ | Pexp_open _ | Pexp_sequence _ | - Pexp_let _ | Pexp_tuple _; - pexp_attributes = [] - } -> Nothing - | {Parsetree.pexp_desc = Pexp_constraint ( - {pexp_desc = Pexp_pack _}, - {ptyp_desc = Ptyp_package _} - ); pexp_attributes = []} -> Nothing - | _ -> Parenthesized - end - end - - let jsx_child_expr expr = - match expr.Parsetree.pexp_desc with - | Parsetree.Pexp_let _ - | Pexp_sequence _ - | Pexp_letexception _ - | Pexp_letmodule _ - | Pexp_open _ -> Nothing - | _ -> - let opt_braces, _ = ParsetreeViewer.process_braces_attr expr in - begin match opt_braces with - | Some ({Location.loc = braces_loc}, _) -> Braced(braces_loc) - | _ -> - begin match expr with - | {Parsetree.pexp_desc = Pexp_constant (Pconst_integer (x, _) | Pconst_float (x, _)); - pexp_attributes = [] - } when starts_with_minus x -> Parenthesized - | {Parsetree.pexp_desc = - Pexp_ident _ | Pexp_constant _ | Pexp_field _ | Pexp_construct _ | Pexp_variant _ | - Pexp_array _ | Pexp_pack _ | Pexp_record _ | Pexp_extension _ | - Pexp_letmodule _ | Pexp_letexception _ | Pexp_open _ | Pexp_sequence _ | - Pexp_let _; - pexp_attributes = [] - } -> Nothing - | {Parsetree.pexp_desc = Pexp_constraint ( - {pexp_desc = Pexp_pack _}, - {ptyp_desc = Ptyp_package _} - ); pexp_attributes = []} -> Nothing - | expr when ParsetreeViewer.is_jsx_expression expr -> Nothing - | _ -> Parenthesized - end - end - - let binary_expr expr = - let opt_braces, _ = ParsetreeViewer.process_braces_attr expr in - match opt_braces with - | Some ({Location.loc = braces_loc}, _) -> Braced(braces_loc) - | None -> - begin match expr with - | {Parsetree.pexp_attributes = _::_} as expr - when ParsetreeViewer.is_binary_expression expr -> Parenthesized - | _ -> Nothing - end - - let mod_type_functor_return mod_type = match mod_type with - | {Parsetree.pmty_desc = Pmty_with _} -> true - | _ -> false - - (* Add parens for readability: - module type Functor = SetLike => Set with type t = A.t - This is actually: - module type Functor = (SetLike => Set) with type t = A.t - *) - let mod_type_with_operand mod_type = match mod_type with - | {Parsetree.pmty_desc = Pmty_functor _} -> true - | _ -> false - - let mod_expr_functor_constraint mod_type = match mod_type with - | {Parsetree.pmty_desc = Pmty_functor _ | Pmty_with _} -> true - | _ -> false - - let braced_expr expr = match expr.Parsetree.pexp_desc with - | Pexp_constraint ( - {pexp_desc = Pexp_pack _}, - {ptyp_desc = Ptyp_package _} - ) -> false - | Pexp_constraint _ -> true - | _ -> false - - let include_mod_expr mod_expr = match mod_expr.Parsetree.pmod_desc with - | Parsetree.Pmod_constraint _ -> true - | _ -> false -end - -module CommentTable = struct - type t = { - leading: (Location.t, Comment.t list) Hashtbl.t; - inside: (Location.t, Comment.t list) Hashtbl.t; - trailing: (Location.t, Comment.t list) Hashtbl.t; - } - - let make () = { - leading = Hashtbl.create 100; - inside = Hashtbl.create 100; - trailing = Hashtbl.create 100; - } - - let empty = make () - - let log t = - let open Location in - let leading_stuff = Hashtbl.fold (fun (k : Location.t) (v : Comment.t list) acc -> - let loc = Doc.concat [ - Doc.lbracket; - Doc.text (string_of_int k.loc_start.pos_lnum); - Doc.text ":"; - Doc.text (string_of_int (k.loc_start.pos_cnum - k.loc_start.pos_bol)); - Doc.text "-"; - Doc.text (string_of_int k.loc_end.pos_lnum); - Doc.text ":"; - Doc.text (string_of_int (k.loc_end.pos_cnum - k.loc_end.pos_bol)); - Doc.rbracket; - ] in - let doc = Doc.breakable_group ~force_break:true ( - Doc.concat [ - loc; - Doc.indent ( - Doc.concat [ - Doc.line; - Doc.join ~sep:Doc.comma (List.map (fun c -> Doc.text (Comment.txt c)) v) - ] - ); - Doc.line; - ] - ) in - doc::acc - ) t.leading [] - in - let trailing_stuff = Hashtbl.fold (fun (k : Location.t) (v : Comment.t list) acc -> - let loc = Doc.concat [ - Doc.lbracket; - Doc.text (string_of_int k.loc_start.pos_lnum); - Doc.text ":"; - Doc.text (string_of_int (k.loc_start.pos_cnum - k.loc_start.pos_bol)); - Doc.text "-"; - Doc.text (string_of_int k.loc_end.pos_lnum); - Doc.text ":"; - Doc.text (string_of_int (k.loc_end.pos_cnum - k.loc_end.pos_bol)); - Doc.rbracket; - ] in - let doc = Doc.breakable_group ~force_break:true ( - Doc.concat [ - loc; - Doc.indent ( - Doc.concat [ - Doc.line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) (List.map (fun c -> Doc.text (Comment.txt c)) v) - ] - ); - Doc.line; - ] - ) in - doc::acc - ) t.trailing [] - in - Doc.breakable_group ~force_break:true ( - Doc.concat [ - Doc.text "leading comments:"; - Doc.line; - Doc.indent (Doc.concat leading_stuff); - Doc.line; - Doc.line; - Doc.text "trailing comments:"; - Doc.indent (Doc.concat trailing_stuff); - Doc.line; - Doc.line; - ] - ) |> Doc.to_string ~width:80 |> print_endline - [@@live] - let attach tbl loc comments = - match comments with - | [] -> () - | comments -> Hashtbl.replace tbl loc comments - - let partition_by_loc comments loc = - let rec loop (leading, inside, trailing) comments = - let open Location in - match comments with - | comment::rest -> - let cmt_loc = Comment.loc comment in - if cmt_loc.loc_end.pos_cnum <= loc.loc_start.pos_cnum then - loop (comment::leading, inside, trailing) rest - else if cmt_loc.loc_start.pos_cnum >= loc.loc_end.pos_cnum then - loop (leading, inside, comment::trailing) rest - else - loop (leading, comment::inside, trailing) rest - | [] -> (List.rev leading, List.rev inside, List.rev trailing) - in - loop ([], [], []) comments - - let partition_leading_trailing comments loc = - let rec loop (leading, trailing) comments = - let open Location in - match comments with - | comment::rest -> - let cmt_loc = Comment.loc comment in - if cmt_loc.loc_end.pos_cnum <= loc.loc_start.pos_cnum then - loop (comment::leading, trailing) rest - else - loop (leading, comment::trailing) rest - | [] -> (List.rev leading, List.rev trailing) - in - loop ([], []) comments - - let partition_by_on_same_line loc comments = - let rec loop (on_same_line, on_other_line) comments = - let open Location in - match comments with - | [] -> (List.rev on_same_line, List.rev on_other_line) - | comment::rest -> - let cmt_loc = Comment.loc comment in - if cmt_loc.loc_start.pos_lnum == loc.loc_end.pos_lnum then - loop (comment::on_same_line, on_other_line) rest - else - loop (on_same_line, comment::on_other_line) rest - in - loop ([], []) comments - - let partition_adjacent_trailing loc1 comments = - let open Location in - let open Lexing in - let rec loop ~prev_end_pos after_loc1 comments = - match comments with - | [] -> (List.rev after_loc1, []) - | (comment::rest) as comments -> - let cmt_prev_end_pos = Comment.prev_tok_end_pos comment in - if prev_end_pos.Lexing.pos_cnum == cmt_prev_end_pos.pos_cnum then - let comment_end = (Comment.loc comment).loc_end in - loop ~prev_end_pos:comment_end (comment::after_loc1) rest - else - (List.rev after_loc1, comments) - in - loop ~prev_end_pos:loc1.loc_end [] comments - - let rec collect_list_patterns acc pattern = - let open Parsetree in - match pattern.ppat_desc with - | Ppat_construct( - {txt = Longident.Lident "::"}, - Some {ppat_desc=Ppat_tuple (pat::rest::[])} - ) -> - collect_list_patterns (pat::acc) rest - | Ppat_construct ({txt = Longident.Lident "[]"}, None) -> - List.rev acc - | _ -> List.rev (pattern::acc) - - let rec collect_list_exprs acc expr = - let open Parsetree in - match expr.pexp_desc with - | Pexp_construct( - {txt = Longident.Lident "::"}, - Some {pexp_desc=Pexp_tuple (expr::rest::[])} - ) -> - collect_list_exprs (expr::acc) rest - | Pexp_construct ({txt = Longident.Lident "[]"}, _) -> - List.rev acc - | _ -> List.rev (expr::acc) - - (* TODO: use ParsetreeViewer *) - let arrow_type ct = - let open Parsetree in - let rec process attrs_before acc typ = match typ with - | {ptyp_desc = Ptyp_arrow (Nolabel as lbl, typ1, typ2); ptyp_attributes = []} -> - let arg = ([], lbl, typ1) in - process attrs_before (arg::acc) typ2 - | {ptyp_desc = Ptyp_arrow (Nolabel as lbl, typ1, typ2); ptyp_attributes = [({txt ="bs"}, _) ] as attrs} -> - let arg = (attrs, lbl, typ1) in - process attrs_before (arg::acc) typ2 - | {ptyp_desc = Ptyp_arrow (Nolabel, _typ1, _typ2); ptyp_attributes = _attrs} as return_type -> - let args = List.rev acc in - (attrs_before, args, return_type) - | {ptyp_desc = Ptyp_arrow ((Labelled _ | Optional _) as lbl, typ1, typ2); ptyp_attributes = attrs} -> - let arg = (attrs, lbl, typ1) in - process attrs_before (arg::acc) typ2 - | typ -> - (attrs_before, List.rev acc, typ) - in - begin match ct with - | {ptyp_desc = Ptyp_arrow (Nolabel, _typ1, _typ2); ptyp_attributes = attrs} as typ -> - process attrs [] {typ with ptyp_attributes = []} - | typ -> process [] [] typ - end - - (* TODO: avoiding the dependency on ParsetreeViewer here, is this a good idea? *) - let mod_expr_apply mod_expr = - let rec loop acc mod_expr = match mod_expr with - | {Parsetree.pmod_desc = Pmod_apply (next, arg)} -> - loop (arg::acc) next - | _ -> (mod_expr::acc) - in - loop [] mod_expr - - (* TODO: avoiding the dependency on ParsetreeViewer here, is this a good idea? *) - let mod_expr_functor mod_expr = - let rec loop acc mod_expr = match mod_expr with - | {Parsetree.pmod_desc = Pmod_functor (lbl, mod_type, return_mod_expr); pmod_attributes = attrs} -> - let param = (attrs, lbl, mod_type) in - loop (param::acc) return_mod_expr - | return_mod_expr -> - (List.rev acc, return_mod_expr) - in - loop [] mod_expr - - let functor_type modtype = - let rec process acc modtype = match modtype with - | {Parsetree.pmty_desc = Pmty_functor (lbl, arg_type, return_type); pmty_attributes = attrs} -> - let arg = (attrs, lbl, arg_type) in - process (arg::acc) return_type - | mod_type -> - (List.rev acc, mod_type) - in - process [] modtype - - let fun_expr expr = - let open Parsetree in - (* Turns (type t, type u, type z) into "type t u z" *) - let rec collect_new_types acc return_expr = - match return_expr with - | {pexp_desc = Pexp_newtype (string_loc, return_expr); pexp_attributes = []} -> - collect_new_types (string_loc::acc) return_expr - | return_expr -> - let loc = match (acc, List.rev acc) with - | (_startLoc::_, end_loc::_) -> { end_loc.loc with loc_end = end_loc.loc.loc_end } - | _ -> Location.none - in - let txt = List.fold_right (fun curr acc -> acc ^ " " ^ curr.Location.txt) acc "type" in - (Location.mkloc txt loc, return_expr) - in - (* For simplicity reason Pexp_newtype gets converted to a Nolabel parameter, - * otherwise this function would need to return a variant: - * | NormalParamater(...) - * | NewType(...) - * This complicates printing with an extra variant/boxing/allocation for a code-path - * that is not often used. Lets just keep it simple for now *) - let rec collect attrs_before acc expr = match expr with - | {pexp_desc = Pexp_fun (lbl, default_expr, pattern, return_expr); pexp_attributes = []} -> - let parameter = ([], lbl, default_expr, pattern) in - collect attrs_before (parameter::acc) return_expr - | {pexp_desc = Pexp_newtype (string_loc, rest); pexp_attributes = attrs} -> - let (var, return_expr) = collect_new_types [string_loc] rest in - let parameter = ( - attrs, - Asttypes.Nolabel, - None, - Ast_helper.Pat.var ~loc:string_loc.loc var - ) in - collect attrs_before (parameter::acc) return_expr - | {pexp_desc = Pexp_fun (lbl, default_expr, pattern, return_expr); pexp_attributes = [({txt = "bs"}, _)] as attrs} -> - let parameter = (attrs, lbl, default_expr, pattern) in - collect attrs_before (parameter::acc) return_expr - | { - pexp_desc = Pexp_fun ((Labelled _ | Optional _) as lbl, default_expr, pattern, return_expr); - pexp_attributes = attrs - } -> - let parameter = (attrs, lbl, default_expr, pattern) in - collect attrs_before (parameter::acc) return_expr - | expr -> - (attrs_before, List.rev acc, expr) - in - begin match expr with - | {pexp_desc = Pexp_fun (Nolabel, _defaultExpr, _pattern, _returnExpr); pexp_attributes = attrs} as expr -> - collect attrs [] {expr with pexp_attributes = []} - | expr -> collect [] [] expr - end - - let rec is_block_expr expr = - let open Parsetree in - match expr.pexp_desc with - | Pexp_letmodule _ - | Pexp_letexception _ - | Pexp_let _ - | Pexp_open _ - | Pexp_sequence _ -> true - | Pexp_apply (call_expr, _) when is_block_expr call_expr -> true - | Pexp_constraint (expr, _) when is_block_expr expr -> true - | Pexp_field (expr, _) when is_block_expr expr -> true - | Pexp_setfield (expr, _, _) when is_block_expr expr -> true - | _ -> false - - let rec walk_structure s t comments = - match s with - | _ when comments = [] -> () - | [] -> attach t.inside Location.none comments - | s -> - walk_list - ~get_loc:(fun n -> n.Parsetree.pstr_loc) - ~walk_node:walk_structure_item - s - t - comments - - and walk_structure_item si t comments = - match si.Parsetree.pstr_desc with - | _ when comments = [] -> () - | Pstr_primitive value_description -> - walk_value_description value_description t comments - | Pstr_open open_description -> - walk_open_description open_description t comments - | Pstr_value (_, value_bindings) -> - walk_value_bindings value_bindings t comments - | Pstr_type (_, type_declarations) -> - walk_type_declarations type_declarations t comments - | Pstr_eval (expr, _) -> - walk_expr expr t comments - | Pstr_module module_binding -> - walk_module_binding module_binding t comments - | Pstr_recmodule module_bindings -> - walk_list - ~get_loc:(fun mb -> mb.Parsetree.pmb_loc) - ~walk_node:walk_module_binding - module_bindings - t - comments - | Pstr_modtype mod_typ_decl -> - walk_module_type_declaration mod_typ_decl t comments - | Pstr_attribute attribute -> - walk_attribute attribute t comments - | Pstr_extension (extension, _) -> - walk_extension extension t comments - | Pstr_include include_declaration -> - walk_include_declaration include_declaration t comments - | Pstr_exception extension_constructor -> - walk_ext_constr extension_constructor t comments - | Pstr_typext type_extension -> - walk_type_extension type_extension t comments - | Pstr_class_type _ | Pstr_class _ -> () - - and walk_value_description vd t comments = - let (leading, trailing) = - partition_leading_trailing comments vd.pval_name.loc in - attach t.leading vd.pval_name.loc leading; - let (after_name, rest) = - partition_adjacent_trailing vd.pval_name.loc trailing in - attach t.trailing vd.pval_name.loc after_name; - let (before, inside, after) = - partition_by_loc rest vd.pval_type.ptyp_loc - in - attach t.leading vd.pval_type.ptyp_loc before; - walk_typ_expr vd.pval_type t inside; - attach t.trailing vd.pval_type.ptyp_loc after - - and walk_type_extension te t comments = - let (leading, trailing) = - partition_leading_trailing comments te.ptyext_path.loc in - attach t.leading te.ptyext_path.loc leading; - let (after_path, rest) = - partition_adjacent_trailing te.ptyext_path.loc trailing in - attach t.trailing te.ptyext_path.loc after_path; - - (* type params *) - let rest = match te.ptyext_params with - | [] -> rest - | type_params -> - visit_list_but_continue_with_remaining_comments - ~get_loc:(fun (typexpr, _variance) -> typexpr.Parsetree.ptyp_loc) - ~walk_node:walk_type_param - ~newline_delimited:false - type_params - t - rest - in - walk_list - ~get_loc:(fun n -> n.Parsetree.pext_loc) - ~walk_node:walk_ext_constr - te.ptyext_constructors - t - rest - - and walk_include_declaration incl_decl t comments = - let (before, inside, after) = - partition_by_loc comments incl_decl.pincl_mod.pmod_loc in - attach t.leading incl_decl.pincl_mod.pmod_loc before; - walk_mod_expr incl_decl.pincl_mod t inside; - attach t.trailing incl_decl.pincl_mod.pmod_loc after - - and walk_module_type_declaration mtd t comments = - let (leading, trailing) = - partition_leading_trailing comments mtd.pmtd_name.loc in - attach t.leading mtd.pmtd_name.loc leading; - begin match mtd.pmtd_type with - | None -> - attach t.trailing mtd.pmtd_name.loc trailing - | Some mod_type -> - let (after_name, rest) = partition_adjacent_trailing mtd.pmtd_name.loc trailing in - attach t.trailing mtd.pmtd_name.loc after_name; - let (before, inside, after) = partition_by_loc rest mod_type.pmty_loc in - attach t.leading mod_type.pmty_loc before; - walk_mod_type mod_type t inside; - attach t.trailing mod_type.pmty_loc after - end - - and walk_module_binding mb t comments = - let (leading, trailing) = partition_leading_trailing comments mb.pmb_name.loc in - attach t.leading mb.pmb_name.loc leading; - let (after_name, rest) = partition_adjacent_trailing mb.pmb_name.loc trailing in - attach t.trailing mb.pmb_name.loc after_name; - let (leading, inside, trailing) = partition_by_loc rest mb.pmb_expr.pmod_loc in - begin match mb.pmb_expr.pmod_desc with - | Pmod_constraint _ -> - walk_mod_expr mb.pmb_expr t (List.concat [leading; inside]); - | _ -> - attach t.leading mb.pmb_expr.pmod_loc leading; - walk_mod_expr mb.pmb_expr t inside; - end; - attach t.trailing mb.pmb_expr.pmod_loc trailing - - and walk_signature signature t comments = - match signature with - | _ when comments = [] -> () - | [] -> attach t.inside Location.none comments - | _s -> - walk_list - ~get_loc:(fun n -> n.Parsetree.psig_loc) - ~walk_node:walk_signature_item - signature - t - comments - - and walk_signature_item si t comments = - match si.psig_desc with - | _ when comments = [] -> () - | Psig_value value_description -> - walk_value_description value_description t comments - | Psig_type (_, type_declarations) -> - walk_type_declarations type_declarations t comments - | Psig_typext type_extension -> - walk_type_extension type_extension t comments - | Psig_exception extension_constructor -> - walk_ext_constr extension_constructor t comments - | Psig_module module_declaration -> - walk_module_declaration module_declaration t comments - | Psig_recmodule module_declarations -> - walk_list - ~get_loc:(fun n -> n.Parsetree.pmd_loc) - ~walk_node:walk_module_declaration - module_declarations - t - comments - | Psig_modtype module_type_declaration -> - walk_module_type_declaration module_type_declaration t comments - | Psig_open open_description -> - walk_open_description open_description t comments - | Psig_include include_description -> - walk_include_description include_description t comments - | Psig_attribute attribute -> - walk_attribute attribute t comments - | Psig_extension (extension, _) -> - walk_extension extension t comments - | Psig_class _ | Psig_class_type _ -> () - - and walk_include_description id t comments = - let (before, inside, after) = - partition_by_loc comments id.pincl_mod.pmty_loc in - attach t.leading id.pincl_mod.pmty_loc before; - walk_mod_type id.pincl_mod t inside; - attach t.trailing id.pincl_mod.pmty_loc after - - and walk_module_declaration md t comments = - let (leading, trailing) = partition_leading_trailing comments md.pmd_name.loc in - attach t.leading md.pmd_name.loc leading; - let (after_name, rest) = partition_adjacent_trailing md.pmd_name.loc trailing in - attach t.trailing md.pmd_name.loc after_name; - let (leading, inside, trailing) = partition_by_loc rest md.pmd_type.pmty_loc in - attach t.leading md.pmd_type.pmty_loc leading; - walk_mod_type md.pmd_type t inside; - attach t.trailing md.pmd_type.pmty_loc trailing - - and walk_list: - 'node. - ?prev_loc:Location.t -> - get_loc:('node -> Location.t) -> - walk_node:('node -> t -> Comment.t list -> unit) -> - 'node list -> t -> Comment.t list -> unit - = fun ?prev_loc ~get_loc ~walk_node l t comments -> - let open Location in - match l with - | _ when comments = [] -> () - | [] -> - begin match prev_loc with - | Some loc -> - attach t.trailing loc comments - | None -> () - end - | node::rest -> - let curr_loc = get_loc node in - let (leading, inside, trailing) = partition_by_loc comments curr_loc in - begin match prev_loc with - | None -> (* first node, all leading comments attach here *) - attach t.leading curr_loc leading - | Some prev_loc -> - (* Same line *) - if prev_loc.loc_end.pos_lnum == curr_loc.loc_start.pos_lnum then - let (after_prev, before_curr) = partition_adjacent_trailing prev_loc leading in - let () = attach t.trailing prev_loc after_prev in - attach t.leading curr_loc before_curr - else - let (on_same_line_as_prev, after_prev) = partition_by_on_same_line prev_loc leading in - let () = attach t.trailing prev_loc on_same_line_as_prev in - let (leading, _inside, _trailing) = partition_by_loc after_prev curr_loc in - attach t.leading curr_loc leading - end; - walk_node node t inside; - walk_list ~prev_loc:curr_loc ~get_loc ~walk_node rest t trailing - - (* The parsetree doesn't always contain location info about the opening or - * closing token of a "list-of-things". This routine visits the whole list, - * but returns any remaining comments that likely fall after the whole list. *) - and visit_list_but_continue_with_remaining_comments: - 'node. - ?prev_loc:Location.t -> - newline_delimited:bool -> - get_loc:('node -> Location.t) -> - walk_node:('node -> t -> Comment.t list -> unit) -> - 'node list -> t -> Comment.t list -> Comment.t list - = fun ?prev_loc ~newline_delimited ~get_loc ~walk_node l t comments -> - let open Location in - match l with - | _ when comments = [] -> [] - | [] -> - begin match prev_loc with - | Some loc -> - let (after_prev, rest) = - if newline_delimited then - partition_by_on_same_line loc comments - else - partition_adjacent_trailing loc comments - in - attach t.trailing loc after_prev; - rest - | None -> comments - end - | node::rest -> - let curr_loc = get_loc node in - let (leading, inside, trailing) = partition_by_loc comments curr_loc in - let () = match prev_loc with - | None -> (* first node, all leading comments attach here *) - attach t.leading curr_loc leading; - () - | Some prev_loc -> - (* Same line *) - if prev_loc.loc_end.pos_lnum == curr_loc.loc_start.pos_lnum then - let (after_prev, before_curr) = partition_adjacent_trailing prev_loc leading in - let () = attach t.trailing prev_loc after_prev in - let () = attach t.leading curr_loc before_curr in - () - else - let (on_same_line_as_prev, after_prev) = partition_by_on_same_line prev_loc leading in - let () = attach t.trailing prev_loc on_same_line_as_prev in - let (leading, _inside, _trailing) = partition_by_loc after_prev curr_loc in - let () = attach t.leading curr_loc leading in - () - in - walk_node node t inside; - visit_list_but_continue_with_remaining_comments - ~prev_loc:curr_loc ~get_loc ~walk_node ~newline_delimited - rest t trailing - - and walk_value_bindings vbs t comments = - walk_list - ~get_loc:(fun n -> n.Parsetree.pvb_loc) - ~walk_node:walk_value_binding - vbs - t - comments - - and walk_open_description open_description t comments = - let loc = open_description.popen_lid.loc in - let (leading, trailing) = partition_leading_trailing comments loc in - attach t.leading loc leading; - attach t.trailing loc trailing; - - and walk_type_declarations type_declarations t comments = - walk_list - ~get_loc:(fun n -> n.Parsetree.ptype_loc) - ~walk_node:walk_type_declaration - type_declarations - t - comments - - and walk_type_param (typexpr, _variance) t comments = - walk_typ_expr typexpr t comments - - and walk_type_declaration td t comments = - let (before_name, rest) = - partition_leading_trailing comments td.ptype_name.loc in - attach t.leading td.ptype_name.loc before_name; - - let (after_name, rest) = - partition_adjacent_trailing td.ptype_name.loc rest in - attach t.trailing td.ptype_name.loc after_name; - - (* type params *) - let rest = match td.ptype_params with - | [] -> rest - | type_params -> - visit_list_but_continue_with_remaining_comments - ~get_loc:(fun (typexpr, _variance) -> typexpr.Parsetree.ptyp_loc) - ~walk_node:walk_type_param - ~newline_delimited:false - type_params - t - rest - in - - (* manifest: = typexpr *) - let rest = match td.ptype_manifest with - | Some typexpr -> - let (before_typ, inside_typ, after_typ) = - partition_by_loc rest typexpr.ptyp_loc in - attach t.leading typexpr.ptyp_loc before_typ; - walk_typ_expr typexpr t inside_typ; - let (after_typ, rest) = - partition_adjacent_trailing typexpr.Parsetree.ptyp_loc after_typ in - attach t.trailing typexpr.ptyp_loc after_typ; - rest - | None -> rest - in - - let rest = match td.ptype_kind with - | Ptype_abstract | Ptype_open -> rest - | Ptype_record label_declarations -> - let () = walk_list - ~get_loc:(fun ld -> ld.Parsetree.pld_loc) - ~walk_node:walk_label_declaration - label_declarations - t - rest - in - [] - | Ptype_variant constructor_declarations -> - walk_constructor_declarations constructor_declarations t rest - in - attach t.trailing td.ptype_loc rest - - and walk_label_declarations lds t comments = - visit_list_but_continue_with_remaining_comments - ~get_loc:(fun ld -> ld.Parsetree.pld_loc) - ~walk_node:walk_label_declaration - ~newline_delimited:false - lds - t - comments - - and walk_label_declaration ld t comments = - let (before_name, rest) = - partition_leading_trailing comments ld.pld_name.loc in - attach t.leading ld.pld_name.loc before_name; - let (after_name, rest) = partition_adjacent_trailing ld.pld_name.loc rest in - attach t.trailing ld.pld_name.loc after_name; - let (before_typ, inside_typ, after_typ) = - partition_by_loc rest ld.pld_type.ptyp_loc in - attach t.leading ld.pld_type.ptyp_loc before_typ; - walk_typ_expr ld.pld_type t inside_typ; - attach t.trailing ld.pld_type.ptyp_loc after_typ - - and walk_constructor_declarations cds t comments = - visit_list_but_continue_with_remaining_comments - ~get_loc:(fun cd -> cd.Parsetree.pcd_loc) - ~walk_node:walk_constructor_declaration - ~newline_delimited:false - cds - t - comments - - and walk_constructor_declaration cd t comments = - let (before_name, rest) = - partition_leading_trailing comments cd.pcd_name.loc in - attach t.leading cd.pcd_name.loc before_name; - let (after_name, rest) = - partition_adjacent_trailing cd.pcd_name.loc rest in - attach t.trailing cd.pcd_name.loc after_name; - let rest = walk_constructor_arguments cd.pcd_args t rest in - - let rest = match cd.pcd_res with - | Some typexpr -> - let (before_typ, inside_typ, after_typ) = - partition_by_loc rest typexpr.ptyp_loc in - attach t.leading typexpr.ptyp_loc before_typ; - walk_typ_expr typexpr t inside_typ; - let (after_typ, rest) = - partition_adjacent_trailing typexpr.Parsetree.ptyp_loc after_typ in - attach t.trailing typexpr.ptyp_loc after_typ; - rest - | None -> rest - in - attach t.trailing cd.pcd_loc rest - - and walk_constructor_arguments args t comments = - match args with - | Pcstr_tuple typexprs -> - visit_list_but_continue_with_remaining_comments - ~get_loc:(fun n -> n.Parsetree.ptyp_loc) - ~walk_node:walk_typ_expr - ~newline_delimited:false - typexprs - t - comments - | Pcstr_record label_declarations -> - walk_label_declarations label_declarations t comments - - and walk_value_binding vb t comments = - let open Location in - - let vb = - let open Parsetree in - match (vb.pvb_pat, vb.pvb_expr) with - | {ppat_desc = Ppat_constraint (pat, {ptyp_desc = Ptyp_poly ([], t)})}, - {pexp_desc = Pexp_constraint (expr, _typ)} -> - {vb with - pvb_pat = Ast_helper.Pat.constraint_ - ~loc:{pat.ppat_loc with loc_end = t.Parsetree.ptyp_loc.loc_end} pat t; - pvb_expr = expr; - } - | {ppat_desc = Ppat_constraint (pat, {ptyp_desc = Ptyp_poly (_::_, t)})}, - {pexp_desc = Pexp_fun _} -> - {vb with - pvb_pat = {vb.pvb_pat with - ppat_loc = {pat.ppat_loc with loc_end = t.ptyp_loc.loc_end}}} - | _ -> vb - in - let pattern_loc = vb.Parsetree.pvb_pat.ppat_loc in - let expr_loc = vb.Parsetree.pvb_expr.pexp_loc in - - let (leading, inside, trailing) = - partition_by_loc comments pattern_loc in - - (* everything before start of pattern can only be leading on the pattern: - * let |* before *| a = 1 *) - attach t.leading pattern_loc leading; - walk_pattern vb.Parsetree.pvb_pat t inside; - (* let pattern = expr -> pattern and expr on the same line *) - (* if patternLoc.loc_end.pos_lnum == exprLoc.loc_start.pos_lnum then ( *) - let (after_pat, surrounding_expr) = - partition_adjacent_trailing pattern_loc trailing - in - attach t.trailing pattern_loc after_pat; - let (before_expr, inside_expr, after_expr) = - partition_by_loc surrounding_expr expr_loc in - if is_block_expr vb.pvb_expr then ( - walk_expr vb.pvb_expr t (List.concat [before_expr; inside_expr; after_expr]) - ) else ( - attach t.leading expr_loc before_expr; - walk_expr vb.Parsetree.pvb_expr t inside_expr; - attach t.trailing expr_loc after_expr - ) - - and walk_expr expr t comments = - let open Location in - match expr.Parsetree.pexp_desc with - | _ when comments = [] -> () - | Pexp_constant _ -> - let (leading, trailing) = - partition_leading_trailing comments expr.pexp_loc in - attach t.leading expr.pexp_loc leading; - attach t.trailing expr.pexp_loc trailing; - | Pexp_ident longident -> - let (leading, trailing) = - partition_leading_trailing comments longident.loc in - attach t.leading longident.loc leading; - attach t.trailing longident.loc trailing; - | Pexp_let (_recFlag, value_bindings, expr2) -> - let comments = visit_list_but_continue_with_remaining_comments - ~get_loc:(fun n -> - if n.Parsetree.pvb_pat.ppat_loc.loc_ghost then - n.pvb_expr.pexp_loc - else - n.Parsetree.pvb_loc - ) - ~walk_node:walk_value_binding - ~newline_delimited:true - value_bindings - t - comments - in - if is_block_expr expr2 then ( - walk_expr expr2 t comments; - ) else ( - let (leading, inside, trailing) = partition_by_loc comments expr2.pexp_loc in - attach t.leading expr2.pexp_loc leading; - walk_expr expr2 t inside; - attach t.trailing expr2.pexp_loc trailing - ) - | Pexp_sequence (expr1, expr2) -> - let (leading, inside, trailing) = partition_by_loc comments expr1.pexp_loc in - let comments = if is_block_expr expr1 then ( - let (after_expr, comments) = partition_by_on_same_line expr1.pexp_loc trailing in - walk_expr expr1 t (List.concat [leading; inside; after_expr]); - comments - ) else ( - attach t.leading expr1.pexp_loc leading; - walk_expr expr1 t inside; - let (after_expr, comments) = partition_by_on_same_line expr1.pexp_loc trailing in - attach t.trailing expr1.pexp_loc after_expr; - comments - ) in - if is_block_expr expr2 then ( - walk_expr expr2 t comments - ) else ( - let (leading, inside, trailing) = partition_by_loc comments expr2.pexp_loc in - attach t.leading expr2.pexp_loc leading; - walk_expr expr2 t inside; - attach t.trailing expr2.pexp_loc trailing - ) - | Pexp_open (_override, longident, expr2) -> - let (leading, comments) = - partition_leading_trailing comments expr.pexp_loc in - attach - t.leading - {expr.pexp_loc with loc_end = longident.loc.loc_end} - leading; - let (leading, trailing) = - partition_leading_trailing comments longident.loc in - attach t.leading longident.loc leading; - let (after_longident, rest) = - partition_by_on_same_line longident.loc trailing in - attach t.trailing longident.loc after_longident; - if is_block_expr expr2 then ( - walk_expr expr2 t rest - ) else ( - let (leading, inside, trailing) = partition_by_loc rest expr2.pexp_loc in - attach t.leading expr2.pexp_loc leading; - walk_expr expr2 t inside; - attach t.trailing expr2.pexp_loc trailing - ) - | Pexp_extension ( - {txt = "obj"}, - PStr [{ - pstr_desc = Pstr_eval({pexp_desc = Pexp_record (rows, _)}, []) - }] - ) -> - walk_list - ~get_loc:(fun ( - (longident, expr): (Longident.t Asttypes.loc * Parsetree.expression) - ) -> { - longident.loc with loc_end = expr.pexp_loc.loc_end - }) - ~walk_node:walk_expr_record_row - rows - t - comments - | Pexp_extension extension -> - walk_extension extension t comments - | Pexp_letexception (extension_constructor, expr2) -> - let (leading, comments) = - partition_leading_trailing comments expr.pexp_loc in - attach - t.leading - {expr.pexp_loc with loc_end = extension_constructor.pext_loc.loc_end} - leading; - let (leading, inside, trailing) = - partition_by_loc comments extension_constructor.pext_loc in - attach t.leading extension_constructor.pext_loc leading; - walk_ext_constr extension_constructor t inside; - let (after_ext_constr, rest) = - partition_by_on_same_line extension_constructor.pext_loc trailing in - attach t.trailing extension_constructor.pext_loc after_ext_constr; - if is_block_expr expr2 then ( - walk_expr expr2 t rest - ) else ( - let (leading, inside, trailing) = partition_by_loc rest expr2.pexp_loc in - attach t.leading expr2.pexp_loc leading; - walk_expr expr2 t inside; - attach t.trailing expr2.pexp_loc trailing - ) - | Pexp_letmodule (string_loc, mod_expr, expr2) -> - let (leading, comments) = - partition_leading_trailing comments expr.pexp_loc in - attach t.leading {expr.pexp_loc with loc_end = mod_expr.pmod_loc.loc_end} leading; - let (leading, trailing) = partition_leading_trailing comments string_loc.loc in - attach t.leading string_loc.loc leading; - let (after_string, rest) = - partition_adjacent_trailing string_loc.loc trailing in - attach t.trailing string_loc.loc after_string; - let (before_mod_expr, inside_mod_expr, after_mod_expr) = - partition_by_loc rest mod_expr.pmod_loc in - attach t.leading mod_expr.pmod_loc before_mod_expr; - walk_mod_expr mod_expr t inside_mod_expr; - let (after_mod_expr, rest) = - partition_by_on_same_line mod_expr.pmod_loc after_mod_expr in - attach t.trailing mod_expr.pmod_loc after_mod_expr; - if is_block_expr expr2 then ( - walk_expr expr2 t rest; - ) else ( - let (leading, inside, trailing) = partition_by_loc rest expr2.pexp_loc in - attach t.leading expr2.pexp_loc leading; - walk_expr expr2 t inside; - attach t.trailing expr2.pexp_loc trailing - ) - | Pexp_assert expr - | Pexp_lazy expr -> - if is_block_expr expr then ( - walk_expr expr t comments - ) else ( - let (leading, inside, trailing) = partition_by_loc comments expr.pexp_loc in - attach t.leading expr.pexp_loc leading; - walk_expr expr t inside; - attach t.trailing expr.pexp_loc trailing - ) - | Pexp_coerce (expr, opt_typexpr, typexpr) -> - let (leading, inside, trailing) = partition_by_loc comments expr.pexp_loc in - attach t.leading expr.pexp_loc leading; - walk_expr expr t inside; - let (after_expr, rest) = - partition_adjacent_trailing expr.pexp_loc trailing in - attach t.trailing expr.pexp_loc after_expr; - let rest = match opt_typexpr with - | Some typexpr -> - let (leading, inside, trailing) = partition_by_loc comments typexpr.ptyp_loc in - attach t.leading typexpr.ptyp_loc leading; - walk_typ_expr typexpr t inside; - let (after_typ, rest) = - partition_adjacent_trailing typexpr.ptyp_loc trailing in - attach t.trailing typexpr.ptyp_loc after_typ; - rest - | None -> rest - in - let (leading, inside, trailing) = partition_by_loc rest typexpr.ptyp_loc in - attach t.leading typexpr.ptyp_loc leading; - walk_typ_expr typexpr t inside; - attach t.trailing typexpr.ptyp_loc trailing - | Pexp_constraint (expr, typexpr) -> - let (leading, inside, trailing) = partition_by_loc comments expr.pexp_loc in - attach t.leading expr.pexp_loc leading; - walk_expr expr t inside; - let (after_expr, rest) = - partition_adjacent_trailing expr.pexp_loc trailing in - attach t.trailing expr.pexp_loc after_expr; - let (leading, inside, trailing) = partition_by_loc rest typexpr.ptyp_loc in - attach t.leading typexpr.ptyp_loc leading; - walk_typ_expr typexpr t inside; - attach t.trailing typexpr.ptyp_loc trailing - | Pexp_tuple [] - | Pexp_array [] - | Pexp_construct({txt = Longident.Lident "[]"}, _) -> - attach t.inside expr.pexp_loc comments - | Pexp_construct({txt = Longident.Lident "::"}, _) -> - walk_list - ~get_loc:(fun n -> n.Parsetree.pexp_loc) - ~walk_node:walk_expr - (collect_list_exprs [] expr) - t - comments - | Pexp_construct (longident, args) -> - let (leading, trailing) = - partition_leading_trailing comments longident.loc in - attach t.leading longident.loc leading; - begin match args with - | Some expr -> - let (after_longident, rest) = - partition_adjacent_trailing longident.loc trailing in - attach t.trailing longident.loc after_longident; - walk_expr expr t rest - | None -> - attach t.trailing longident.loc trailing - end - | Pexp_variant (_label, None) -> - () - | Pexp_variant (_label, Some expr) -> - walk_expr expr t comments - | Pexp_array exprs | Pexp_tuple exprs -> - walk_list - ~get_loc:(fun n -> n.Parsetree.pexp_loc) - ~walk_node:walk_expr - exprs - t - comments - | Pexp_record (rows, spread_expr) -> - let comments = match spread_expr with - | None -> comments - | Some expr -> - let (leading, inside, trailing) = partition_by_loc comments expr.pexp_loc in - attach t.leading expr.pexp_loc leading; - walk_expr expr t inside; - let (after_expr, rest) = partition_adjacent_trailing expr.pexp_loc trailing in - attach t.trailing expr.pexp_loc after_expr; - rest - in - walk_list - ~get_loc:(fun ( - (longident, expr): (Longident.t Asttypes.loc * Parsetree.expression) - ) -> { - longident.loc with loc_end = expr.pexp_loc.loc_end - }) - ~walk_node:walk_expr_record_row - rows - t - comments - | Pexp_field (expr, longident) -> - let (leading, inside, trailing) = partition_by_loc comments expr.pexp_loc in - let trailing = if is_block_expr expr then ( - let (after_expr, rest) = - partition_adjacent_trailing expr.pexp_loc trailing in - walk_expr expr t (List.concat [leading; inside; after_expr]); - rest - ) else ( - attach t.leading expr.pexp_loc leading; - walk_expr expr t inside; - trailing - ) in - let (after_expr, rest) = partition_adjacent_trailing expr.pexp_loc trailing in - attach t.trailing expr.pexp_loc after_expr; - let (leading, trailing) = partition_leading_trailing rest longident.loc in - attach t.leading longident.loc leading; - attach t.trailing longident.loc trailing - | Pexp_setfield (expr1, longident, expr2) -> - let (leading, inside, trailing) = partition_by_loc comments expr1.pexp_loc in - let rest = if is_block_expr expr1 then ( - let (after_expr, rest) = - partition_adjacent_trailing expr1.pexp_loc trailing in - walk_expr expr1 t (List.concat [leading; inside; after_expr]); - rest - ) else ( - let (after_expr, rest) = - partition_adjacent_trailing expr1.pexp_loc trailing in - attach t.leading expr1.pexp_loc leading; - walk_expr expr1 t inside; - attach t.trailing expr1.pexp_loc after_expr; - rest - ) in - let (before_longident, after_longident) = partition_leading_trailing rest longident.loc in - attach t.leading longident.loc before_longident; - let (after_longident, rest) = partition_adjacent_trailing longident.loc after_longident in - attach t.trailing longident.loc after_longident; - if is_block_expr expr2 then - walk_expr expr2 t rest - else ( - let (leading, inside, trailing) = partition_by_loc rest expr2.pexp_loc in - attach t.leading expr2.pexp_loc leading; - walk_expr expr2 t inside; - attach t.trailing expr2.pexp_loc trailing - ) - | Pexp_ifthenelse (if_expr, then_expr, else_expr) -> - let (leading, inside, trailing) = partition_by_loc comments if_expr.pexp_loc in - let comments = if is_block_expr if_expr then ( - let (after_expr, comments) = partition_adjacent_trailing if_expr.pexp_loc trailing in - walk_expr if_expr t (List.concat [leading; inside; after_expr]); - comments - ) else ( - attach t.leading if_expr.pexp_loc leading; - walk_expr if_expr t inside; - let (after_expr, comments) = partition_adjacent_trailing if_expr.pexp_loc trailing in - attach t.trailing if_expr.pexp_loc after_expr; - comments - ) in - let (leading, inside, trailing) = partition_by_loc comments then_expr.pexp_loc in - let comments = if is_block_expr then_expr then ( - let (after_expr, trailing) = partition_adjacent_trailing then_expr.pexp_loc trailing in - walk_expr then_expr t (List.concat [leading; inside; after_expr]); - trailing - ) else ( - attach t.leading then_expr.pexp_loc leading; - walk_expr then_expr t inside; - let (after_expr, comments) = partition_adjacent_trailing then_expr.pexp_loc trailing in - attach t.trailing then_expr.pexp_loc after_expr; - comments - ) in - begin match else_expr with - | None -> () - | Some expr -> - if is_block_expr expr then - walk_expr expr t comments - else ( - let (leading, inside, trailing) = partition_by_loc comments expr.pexp_loc in - attach t.leading expr.pexp_loc leading; - walk_expr expr t inside; - attach t.trailing expr.pexp_loc trailing - ) - end - | Pexp_while (expr1, expr2) -> - let (leading, inside, trailing) = partition_by_loc comments expr1.pexp_loc in - let rest = if is_block_expr expr1 then - let (after_expr, rest) = partition_adjacent_trailing expr1.pexp_loc trailing in - walk_expr expr1 t (List.concat [leading; inside; after_expr]); - rest - else ( - attach t.leading expr1.pexp_loc leading; - walk_expr expr1 t inside; - let (after_expr, rest) = partition_adjacent_trailing expr1.pexp_loc trailing in - attach t.trailing expr1.pexp_loc after_expr; - rest - ) in - if is_block_expr expr2 then ( - walk_expr expr2 t rest - ) else ( - let (leading, inside, trailing) = partition_by_loc rest expr2.pexp_loc in - attach t.leading expr2.pexp_loc leading; - walk_expr expr2 t inside; - attach t.trailing expr2.pexp_loc trailing - ) - | Pexp_for (pat, expr1, expr2, _, expr3) -> - let (leading, inside, trailing) = partition_by_loc comments pat.ppat_loc in - attach t.leading pat.ppat_loc leading; - walk_pattern pat t inside; - let (after_pat, rest) = partition_adjacent_trailing pat.ppat_loc trailing in - attach t.trailing pat.ppat_loc after_pat; - let (leading, inside, trailing) = partition_by_loc rest expr1.pexp_loc in - attach t.leading expr1.pexp_loc leading; - walk_expr expr1 t inside; - let (after_expr, rest) = partition_adjacent_trailing expr1.pexp_loc trailing in - attach t.trailing expr1.pexp_loc after_expr; - let (leading, inside, trailing) = partition_by_loc rest expr2.pexp_loc in - attach t.leading expr2.pexp_loc leading; - walk_expr expr2 t inside; - let (after_expr, rest) = partition_adjacent_trailing expr2.pexp_loc trailing in - attach t.trailing expr2.pexp_loc after_expr; - if is_block_expr expr3 then ( - walk_expr expr3 t rest - ) else ( - let (leading, inside, trailing) = partition_by_loc rest expr3.pexp_loc in - attach t.leading expr3.pexp_loc leading; - walk_expr expr3 t inside; - attach t.trailing expr3.pexp_loc trailing - ) - | Pexp_pack mod_expr -> - let (before, inside, after) = partition_by_loc comments mod_expr.pmod_loc in - attach t.leading mod_expr.pmod_loc before; - walk_mod_expr mod_expr t inside; - attach t.trailing mod_expr.pmod_loc after - | Pexp_match (expr, cases) | Pexp_try (expr, cases) -> - let (before, inside, after) = partition_by_loc comments expr.pexp_loc in - let after = if is_block_expr expr then ( - let (after_expr, rest) = - partition_adjacent_trailing expr.pexp_loc after in - walk_expr expr t (List.concat [before; inside; after_expr]); - rest - ) else ( - attach t.leading expr.pexp_loc before; - walk_expr expr t inside; - after - ) in - let (after_expr, rest) = partition_adjacent_trailing expr.pexp_loc after in - attach t.trailing expr.pexp_loc after_expr; - walk_list - ~get_loc:(fun n -> {n.Parsetree.pc_lhs.ppat_loc with - loc_end = n.pc_rhs.pexp_loc.loc_end}) - ~walk_node:walk_case - cases - t - rest - (* unary expression: todo use parsetreeviewer *) - | Pexp_apply ( - {pexp_desc = Pexp_ident {txt = Longident.Lident - ("~+" | "~+." | "~-" | "~-." | "not" | "!") - }}, - [Nolabel, arg_expr] - ) -> - let (before, inside, after) = partition_by_loc comments arg_expr.pexp_loc in - attach t.leading arg_expr.pexp_loc before; - walk_expr arg_expr t inside; - attach t.trailing arg_expr.pexp_loc after - (* binary expression *) - | Pexp_apply( - {pexp_desc = Pexp_ident {txt = Longident.Lident - (":=" | "||" | "&&" | "=" | "==" | "<" | ">" - | "!=" | "!==" | "<=" | ">=" | "|>" | "+" | "+." - | "-" | "-." | "++" | "^" | "*" | "*." | "/" - | "/." | "**" | "|." | "<>") }}, - [(Nolabel, operand1); (Nolabel, operand2)] - ) -> - let (before, inside, after) = partition_by_loc comments operand1.pexp_loc in - attach t.leading operand1.pexp_loc before; - walk_expr operand1 t inside; - let (after_operand1, rest) = - partition_adjacent_trailing operand1.pexp_loc after in - attach t.trailing operand1.pexp_loc after_operand1; - let (before, inside, after) = partition_by_loc rest operand2.pexp_loc in - attach t.leading operand2.pexp_loc before; - walk_expr operand2 t inside; (* (List.concat [inside; after]); *) - attach t.trailing operand2.pexp_loc after; - | Pexp_apply (call_expr, arguments) -> - let (before, inside, after) = partition_by_loc comments call_expr.pexp_loc in - let after = if is_block_expr call_expr then ( - let (after_expr, rest) = - partition_adjacent_trailing call_expr.pexp_loc after in - walk_expr call_expr t (List.concat [before; inside; after_expr]); - rest - ) else ( - attach t.leading call_expr.pexp_loc before; - walk_expr call_expr t inside; - after - ) in - let (after_expr, rest) = partition_adjacent_trailing call_expr.pexp_loc after in - attach t.trailing call_expr.pexp_loc after_expr; - walk_list - ~get_loc:(fun (_argLabel, expr) -> - let loc = match expr.Parsetree.pexp_attributes with - | ({Location.txt = "res.namedArgLoc"; loc}, _)::_attrs -> - {loc with loc_end = expr.pexp_loc.loc_end} - | _ -> - expr.pexp_loc - in - loc) - ~walk_node:walk_expr_argument - arguments - t - rest - | Pexp_fun (_, _, _, _) | Pexp_newtype _ -> - let (_, parameters, return_expr) = fun_expr expr in - let comments = visit_list_but_continue_with_remaining_comments - ~newline_delimited:false - ~walk_node:walk_expr_pararameter - ~get_loc:(fun (_attrs, _argLbl, expr_opt, pattern) -> - let open Parsetree in - let start_pos = match pattern.ppat_attributes with - | ({Location.txt = "res.namedArgLoc"; loc}, _)::_attrs -> - loc.loc_start - | _ -> - pattern.ppat_loc.loc_start - in - match expr_opt with - | None -> {pattern.ppat_loc with loc_start = start_pos} - | Some expr -> { - pattern.ppat_loc with - loc_start = start_pos; - loc_end = expr.pexp_loc.loc_end - } - ) - parameters - t - comments - in - begin match return_expr.pexp_desc with - | Pexp_constraint (expr, typ) - when expr.pexp_loc.loc_start.pos_cnum >= typ.ptyp_loc.loc_end.pos_cnum - -> - let (leading, inside, trailing) = partition_by_loc comments typ.ptyp_loc in - attach t.leading typ.ptyp_loc leading; - walk_typ_expr typ t inside; - let (after_typ, comments) = - partition_adjacent_trailing typ.ptyp_loc trailing in - attach t.trailing typ.ptyp_loc after_typ; - if is_block_expr expr then - walk_expr expr t comments - else ( - let (leading, inside, trailing) = - partition_by_loc comments expr.pexp_loc in - attach t.leading expr.pexp_loc leading; - walk_expr expr t inside; - attach t.trailing expr.pexp_loc trailing - ) - | _ -> - if is_block_expr return_expr then - walk_expr return_expr t comments - else ( - let (leading, inside, trailing) = - partition_by_loc comments return_expr.pexp_loc in - attach t.leading return_expr.pexp_loc leading; - walk_expr return_expr t inside; - attach t.trailing return_expr.pexp_loc trailing - ) - end - | _ -> () - - and walk_expr_pararameter (_attrs, _argLbl, expr_opt, pattern) t comments = - let (leading, inside, trailing) = partition_by_loc comments pattern.ppat_loc in - attach t.leading pattern.ppat_loc leading; - walk_pattern pattern t inside; - begin match expr_opt with - | Some expr -> - let (_afterPat, rest) = - partition_adjacent_trailing pattern.ppat_loc trailing in - attach t.trailing pattern.ppat_loc trailing; - if is_block_expr expr then - walk_expr expr t rest - else ( - let (leading, inside, trailing) = partition_by_loc rest expr.pexp_loc in - attach t.leading expr.pexp_loc leading; - walk_expr expr t inside; - attach t.trailing expr.pexp_loc trailing - ) - | None -> - attach t.trailing pattern.ppat_loc trailing - end - - and walk_expr_argument (_argLabel, expr) t comments = - match expr.Parsetree.pexp_attributes with - | ({Location.txt = "res.namedArgLoc"; loc}, _)::_attrs -> - let (leading, trailing) = partition_leading_trailing comments loc in - attach t.leading loc leading; - let (after_label, rest) = partition_adjacent_trailing loc trailing in - attach t.trailing loc after_label; - let (before, inside, after) = partition_by_loc rest expr.pexp_loc in - attach t.leading expr.pexp_loc before; - walk_expr expr t inside; - attach t.trailing expr.pexp_loc after - | _ -> - let (before, inside, after) = partition_by_loc comments expr.pexp_loc in - attach t.leading expr.pexp_loc before; - walk_expr expr t inside; - attach t.trailing expr.pexp_loc after - - and walk_case case t comments = - let (before, inside, after) = partition_by_loc comments case.pc_lhs.ppat_loc in - (* cases don't have a location on their own, leading comments should go - * after the bar on the pattern *) - walk_pattern case.pc_lhs t (List.concat [before; inside]); - let (after_pat, rest) = partition_adjacent_trailing case.pc_lhs.ppat_loc after in - attach t.trailing case.pc_lhs.ppat_loc after_pat; - let comments = match case.pc_guard with - | Some expr -> - let (before, inside, after) = partition_by_loc rest expr.pexp_loc in - let (after_expr, rest) = partition_adjacent_trailing expr.pexp_loc after in - if is_block_expr expr then ( - walk_expr expr t (List.concat [before; inside; after_expr]) - ) else ( - attach t.leading expr.pexp_loc before; - walk_expr expr t inside; - attach t.trailing expr.pexp_loc after_expr; - ); - rest - | None -> rest - in - if is_block_expr case.pc_rhs then ( - walk_expr case.pc_rhs t comments - ) else ( - let (before, inside, after) = partition_by_loc comments case.pc_rhs.pexp_loc in - attach t.leading case.pc_rhs.pexp_loc before; - walk_expr case.pc_rhs t inside; - attach t.trailing case.pc_rhs.pexp_loc after - ) - - and walk_expr_record_row (longident, expr) t comments = - let (before_longident, after_longident) = - partition_leading_trailing comments longident.loc - in - attach t.leading longident.loc before_longident; - let (after_longident, rest) = - partition_adjacent_trailing longident.loc after_longident in - attach t.trailing longident.loc after_longident; - let (leading, inside, trailing) = partition_by_loc rest expr.pexp_loc in - attach t.leading expr.pexp_loc leading; - walk_expr expr t inside; - attach t.trailing expr.pexp_loc trailing - - and walk_ext_constr ext_constr t comments = - let (leading, trailing) = - partition_leading_trailing comments ext_constr.pext_name.loc in - attach t.leading ext_constr.pext_name.loc leading; - let (after_name, rest) = - partition_adjacent_trailing ext_constr.pext_name.loc trailing in - attach t.trailing ext_constr.pext_name.loc after_name; - walk_extension_constructor_kind ext_constr.pext_kind t rest - - and walk_extension_constructor_kind kind t comments = - match kind with - | Pext_rebind longident -> - let (leading, trailing) = - partition_leading_trailing comments longident.loc in - attach t.leading longident.loc leading; - attach t.trailing longident.loc trailing - | Pext_decl (constructor_arguments, maybe_typ_expr) -> - let rest = walk_constructor_arguments constructor_arguments t comments in - begin match maybe_typ_expr with - | None -> () - | Some typexpr -> - let (before, inside, after) = partition_by_loc rest typexpr.ptyp_loc in - attach t.leading typexpr.ptyp_loc before; - walk_typ_expr typexpr t inside; - attach t.trailing typexpr.ptyp_loc after - end - - and walk_mod_expr mod_expr t comments = - match mod_expr.pmod_desc with - | Pmod_ident longident -> - let (before, after) = partition_leading_trailing comments longident.loc in - attach t.leading longident.loc before; - attach t.trailing longident.loc after - | Pmod_structure structure -> - walk_structure structure t comments - | Pmod_extension extension -> - walk_extension extension t comments - | Pmod_unpack expr -> - let (before, inside, after) = partition_by_loc comments expr.pexp_loc in - attach t.leading expr.pexp_loc before; - walk_expr expr t inside; - attach t.trailing expr.pexp_loc after - | Pmod_constraint (modexpr, modtype) -> - if modtype.pmty_loc.loc_start >= modexpr.pmod_loc.loc_end then ( - let (before, inside, after) = partition_by_loc comments modexpr.pmod_loc in - attach t.leading modexpr.pmod_loc before; - walk_mod_expr modexpr t inside; - let (after, rest) = partition_adjacent_trailing modexpr.pmod_loc after in - attach t.trailing modexpr.pmod_loc after; - let (before, inside, after) = partition_by_loc rest modtype.pmty_loc in - attach t.leading modtype.pmty_loc before; - walk_mod_type modtype t inside; - attach t.trailing modtype.pmty_loc after - ) else ( - let (before, inside, after) = partition_by_loc comments modtype.pmty_loc in - attach t.leading modtype.pmty_loc before; - walk_mod_type modtype t inside; - let (after, rest) = partition_adjacent_trailing modtype.pmty_loc after in - attach t.trailing modtype.pmty_loc after; - let (before, inside, after) = partition_by_loc rest modexpr.pmod_loc in - attach t.leading modexpr.pmod_loc before; - walk_mod_expr modexpr t inside; - attach t.trailing modexpr.pmod_loc after; - ) - | Pmod_apply (_callModExpr, _argModExpr) -> - let mod_exprs = mod_expr_apply mod_expr in - walk_list - ~get_loc:(fun n -> n.Parsetree.pmod_loc) - ~walk_node:walk_mod_expr - mod_exprs - t - comments - | Pmod_functor _ -> - let (parameters, return_mod_expr) = mod_expr_functor mod_expr in - let comments = visit_list_but_continue_with_remaining_comments - ~get_loc:(fun - (_, lbl, mod_type_option) -> match mod_type_option with - | None -> lbl.Asttypes.loc - | Some mod_type -> {lbl.loc with loc_end = mod_type.Parsetree.pmty_loc.loc_end} - ) - ~walk_node:walk_mod_expr_parameter - ~newline_delimited:false - parameters - t - comments - in - begin match return_mod_expr.pmod_desc with - | Pmod_constraint (mod_expr, mod_type) - when mod_type.pmty_loc.loc_end.pos_cnum <= mod_expr.pmod_loc.loc_start.pos_cnum -> - let (before, inside, after) = partition_by_loc comments mod_type.pmty_loc in - attach t.leading mod_type.pmty_loc before; - walk_mod_type mod_type t inside; - let (after, rest) = partition_adjacent_trailing mod_type.pmty_loc after in - attach t.trailing mod_type.pmty_loc after; - let (before, inside, after) = partition_by_loc rest mod_expr.pmod_loc in - attach t.leading mod_expr.pmod_loc before; - walk_mod_expr mod_expr t inside; - attach t.trailing mod_expr.pmod_loc after - | _ -> - let (before, inside, after) = partition_by_loc comments return_mod_expr.pmod_loc in - attach t.leading return_mod_expr.pmod_loc before; - walk_mod_expr return_mod_expr t inside; - attach t.trailing return_mod_expr.pmod_loc after - end - - and walk_mod_expr_parameter parameter t comments = - let (_attrs, lbl, mod_type_option) = parameter in - let (leading, trailing) = partition_leading_trailing comments lbl.loc in - attach t.leading lbl.loc leading; - begin match mod_type_option with - | None -> attach t.trailing lbl.loc trailing - | Some mod_type -> - let (after_lbl, rest) = partition_adjacent_trailing lbl.loc trailing in - attach t.trailing lbl.loc after_lbl; - let (before, inside, after) = partition_by_loc rest mod_type.pmty_loc in - attach t.leading mod_type.pmty_loc before; - walk_mod_type mod_type t inside; - attach t.trailing mod_type.pmty_loc after; - end - - and walk_mod_type mod_type t comments = - match mod_type.pmty_desc with - | Pmty_ident longident | Pmty_alias longident -> - let (leading, trailing) = partition_leading_trailing comments longident.loc in - attach t.leading longident.loc leading; - attach t.trailing longident.loc trailing; - | Pmty_signature signature -> - walk_signature signature t comments - | Pmty_extension extension -> - walk_extension extension t comments - | Pmty_typeof mod_expr -> - let (before, inside, after) = partition_by_loc comments mod_expr.pmod_loc in - attach t.leading mod_expr.pmod_loc before; - walk_mod_expr mod_expr t inside; - attach t.trailing mod_expr.pmod_loc after; - | Pmty_with (mod_type, _withConstraints) -> - let (before, inside, after) = partition_by_loc comments mod_type.pmty_loc in - attach t.leading mod_type.pmty_loc before; - walk_mod_type mod_type t inside; - attach t.trailing mod_type.pmty_loc after - (* TODO: withConstraints*) - | Pmty_functor _ -> - let (parameters, return_mod_type) = functor_type mod_type in - let comments = visit_list_but_continue_with_remaining_comments - ~get_loc:(fun - (_, lbl, mod_type_option) -> match mod_type_option with - | None -> lbl.Asttypes.loc - | Some mod_type -> - if lbl.txt = "_" then mod_type.Parsetree.pmty_loc - else {lbl.loc with loc_end = mod_type.Parsetree.pmty_loc.loc_end} - ) - ~walk_node:walk_mod_type_parameter - ~newline_delimited:false - parameters - t - comments - in - let (before, inside, after) = partition_by_loc comments return_mod_type.pmty_loc in - attach t.leading return_mod_type.pmty_loc before; - walk_mod_type return_mod_type t inside; - attach t.trailing return_mod_type.pmty_loc after - - and walk_mod_type_parameter (_, lbl, mod_type_option) t comments = - let (leading, trailing) = partition_leading_trailing comments lbl.loc in - attach t.leading lbl.loc leading; - begin match mod_type_option with - | None -> attach t.trailing lbl.loc trailing - | Some mod_type -> - let (after_lbl, rest) = partition_adjacent_trailing lbl.loc trailing in - attach t.trailing lbl.loc after_lbl; - let (before, inside, after) = partition_by_loc rest mod_type.pmty_loc in - attach t.leading mod_type.pmty_loc before; - walk_mod_type mod_type t inside; - attach t.trailing mod_type.pmty_loc after; - end - - and walk_pattern pat t comments = - let open Location in - match pat.Parsetree.ppat_desc with - | _ when comments = [] -> () - | Ppat_alias (pat, alias) -> - let (leading, inside, trailing) = partition_by_loc comments pat.ppat_loc in - attach t.leading pat.ppat_loc leading; - walk_pattern pat t inside; - let (after_pat, rest) = partition_adjacent_trailing pat.ppat_loc trailing in - attach t.leading pat.ppat_loc leading; - attach t.trailing pat.ppat_loc after_pat; - let (before_alias, after_alias) = partition_leading_trailing rest alias.loc in - attach t.leading alias.loc before_alias; - attach t.trailing alias.loc after_alias - | Ppat_tuple [] - | Ppat_array [] - | Ppat_construct({txt = Longident.Lident "()"}, _) - | Ppat_construct({txt = Longident.Lident "[]"}, _) -> - attach t.inside pat.ppat_loc comments; - | Ppat_array patterns -> - walk_list - ~get_loc:(fun n -> n.Parsetree.ppat_loc) - ~walk_node:walk_pattern - patterns - t - comments - | Ppat_tuple patterns -> - walk_list - ~get_loc:(fun n -> n.Parsetree.ppat_loc) - ~walk_node:walk_pattern - patterns - t - comments - | Ppat_construct({txt = Longident.Lident "::"}, _) -> - walk_list - ~get_loc:(fun n -> n.Parsetree.ppat_loc) - ~walk_node:walk_pattern - (collect_list_patterns [] pat) - t - comments - | Ppat_construct (constr, None) -> - let (before_constr, after_constr) = - partition_leading_trailing comments constr.loc - in - attach t.leading constr.loc before_constr; - attach t.trailing constr.loc after_constr - | Ppat_construct (constr, Some pat) -> - let (leading, trailing) = partition_leading_trailing comments constr.loc in - attach t.leading constr.loc leading; - let (leading, inside, trailing) = partition_by_loc trailing pat.ppat_loc in - attach t.leading pat.ppat_loc leading; - walk_pattern pat t inside; - attach t.trailing pat.ppat_loc trailing - | Ppat_variant (_label, None) -> - () - | Ppat_variant (_label, Some pat) -> - walk_pattern pat t comments - | Ppat_type _ -> - () - | Ppat_record (record_rows, _) -> - walk_list - ~get_loc:(fun ( - (longident_loc, pattern): (Longident.t Asttypes.loc * Parsetree.pattern) - ) -> { - longident_loc.loc with - loc_end = pattern.Parsetree.ppat_loc.loc_end - }) - ~walk_node:walk_pattern_record_row - record_rows - t - comments - | Ppat_or (pattern1, pattern2) -> - let (before_pattern1, inside_pattern1, after_pattern1) = - partition_by_loc comments pattern1.ppat_loc - in - attach t.leading pattern1.ppat_loc before_pattern1; - walk_pattern pattern1 t inside_pattern1; - let (after_pattern1, rest) = - partition_adjacent_trailing pattern1.ppat_loc after_pattern1 - in - attach t.trailing pattern1.ppat_loc after_pattern1; - let (before_pattern2, inside_pattern2, after_pattern2) = - partition_by_loc rest pattern2.ppat_loc - in - attach t.leading pattern2.ppat_loc before_pattern2; - walk_pattern pattern2 t inside_pattern2; - attach t.trailing pattern2.ppat_loc after_pattern2 - | Ppat_constraint (pattern, typ) -> - let (before_pattern, inside_pattern, after_pattern) = - partition_by_loc comments pattern.ppat_loc - in - attach t.leading pattern.ppat_loc before_pattern; - walk_pattern pattern t inside_pattern; - let (after_pattern, rest) = - partition_adjacent_trailing pattern.ppat_loc after_pattern - in - attach t.trailing pattern.ppat_loc after_pattern; - let (before_typ, inside_typ, after_typ) = - partition_by_loc rest typ.ptyp_loc - in - attach t.leading typ.ptyp_loc before_typ; - walk_typ_expr typ t inside_typ; - attach t.trailing typ.ptyp_loc after_typ - | Ppat_lazy pattern | Ppat_exception pattern -> - let (leading, inside, trailing) = partition_by_loc comments pattern.ppat_loc in - attach t.leading pattern.ppat_loc leading; - walk_pattern pattern t inside; - attach t.trailing pattern.ppat_loc trailing - | Ppat_unpack string_loc -> - let (leading, trailing) = partition_leading_trailing comments string_loc.loc in - attach t.leading string_loc.loc leading; - attach t.trailing string_loc.loc trailing - | Ppat_extension extension -> - walk_extension extension t comments - | _ -> () - - (* name: firstName *) - and walk_pattern_record_row row t comments = - match row with - (* punned {x}*) - | ({Location.txt=Longident.Lident ident; loc = longident_loc}, - {Parsetree.ppat_desc=Ppat_var {txt;_}}) when ident = txt -> - let (before_lbl, after_lbl) = - partition_leading_trailing comments longident_loc - in - attach t.leading longident_loc before_lbl; - attach t.trailing longident_loc after_lbl - | (longident, pattern) -> - let (before_lbl, after_lbl) = - partition_leading_trailing comments longident.loc - in - attach t.leading longident.loc before_lbl; - let (after_lbl, rest) = partition_adjacent_trailing longident.loc after_lbl in - attach t.trailing longident.loc after_lbl; - let (leading, inside, trailing) = partition_by_loc rest pattern.ppat_loc in - attach t.leading pattern.ppat_loc leading; - walk_pattern pattern t inside; - attach t.trailing pattern.ppat_loc trailing - - and walk_typ_expr typ t comments = - match typ.Parsetree.ptyp_desc with - | _ when comments = [] -> () - | Ptyp_tuple typexprs -> - walk_list - ~get_loc:(fun n -> n.Parsetree.ptyp_loc) - ~walk_node:walk_typ_expr - typexprs - t - comments - | Ptyp_extension extension -> - walk_extension extension t comments - | Ptyp_package package_type -> - walk_package_type package_type t comments - | Ptyp_alias (typexpr, _alias) -> - let (before_typ, inside_typ, after_typ) = - partition_by_loc comments typexpr.ptyp_loc in - attach t.leading typexpr.ptyp_loc before_typ; - walk_typ_expr typexpr t inside_typ; - attach t.trailing typexpr.ptyp_loc after_typ; - | Ptyp_poly (strings, typexpr) -> - let comments = visit_list_but_continue_with_remaining_comments - ~get_loc:(fun n -> n.Asttypes.loc) - ~walk_node:(fun longident t comments -> - let (before_longident, after_longident) = - partition_leading_trailing comments longident.loc in - attach t.leading longident.loc before_longident; - attach t.trailing longident.loc after_longident - ) - ~newline_delimited:false - strings - t - comments - in - let (before_typ, inside_typ, after_typ) = - partition_by_loc comments typexpr.ptyp_loc in - attach t.leading typexpr.ptyp_loc before_typ; - walk_typ_expr typexpr t inside_typ; - attach t.trailing typexpr.ptyp_loc after_typ - | Ptyp_constr (longident, typexprs) -> - let (before_longident, _afterLongident) = - partition_leading_trailing comments longident.loc in - let (after_longident, rest) = - partition_adjacent_trailing longident.loc comments in - attach t.leading longident.loc before_longident; - attach t.trailing longident.loc after_longident; - walk_list - ~get_loc:(fun n -> n.Parsetree.ptyp_loc) - ~walk_node:walk_typ_expr - typexprs - t - rest - | Ptyp_arrow _ -> - let (_, parameters, typexpr) = arrow_type typ in - let comments = walk_type_parameters parameters t comments in - let (before_typ, inside_typ, after_typ) = - partition_by_loc comments typexpr.ptyp_loc in - attach t.leading typexpr.ptyp_loc before_typ; - walk_typ_expr typexpr t inside_typ; - attach t.trailing typexpr.ptyp_loc after_typ - | Ptyp_object (fields, _) -> - walk_typ_object_fields fields t comments - | _ -> () - - and walk_typ_object_fields fields t comments = - walk_list - ~get_loc:(fun field -> - match field with - | Parsetree.Otag (lbl, _, typ) -> - {lbl.loc with loc_end = typ.ptyp_loc.loc_end} - | _ -> Location.none - ) - ~walk_node:walk_typ_object_field - fields - t - comments - - and walk_typ_object_field field t comments = - match field with - | Otag (lbl, _, typexpr) -> - let (before_lbl, after_lbl) = partition_leading_trailing comments lbl.loc in - attach t.leading lbl.loc before_lbl; - let (after_lbl, rest) = partition_adjacent_trailing lbl.loc after_lbl in - attach t.trailing lbl.loc after_lbl; - let (before_typ, inside_typ, after_typ) = - partition_by_loc rest typexpr.ptyp_loc in - attach t.leading typexpr.ptyp_loc before_typ; - walk_typ_expr typexpr t inside_typ; - attach t.trailing typexpr.ptyp_loc after_typ - | _ -> () - - and walk_type_parameters type_parameters t comments = - visit_list_but_continue_with_remaining_comments - ~get_loc:(fun (_, _, typexpr) -> typexpr.Parsetree.ptyp_loc) - ~walk_node:walk_type_parameter - ~newline_delimited:false - type_parameters - t - comments - - and walk_type_parameter (_attrs, _lbl, typexpr) t comments = - let (before_typ, inside_typ, after_typ) = - partition_by_loc comments typexpr.ptyp_loc in - attach t.leading typexpr.ptyp_loc before_typ; - walk_typ_expr typexpr t inside_typ; - attach t.trailing typexpr.ptyp_loc after_typ - - and walk_package_type package_type t comments = - let (longident, package_constraints) = package_type in - let (before_longident, after_longident) = - partition_leading_trailing comments longident.loc in - attach t.leading longident.loc before_longident; - let (after_longident, rest) = - partition_adjacent_trailing longident.loc after_longident in - attach t.trailing longident.loc after_longident; - walk_package_constraints package_constraints t rest - - and walk_package_constraints package_constraints t comments = - walk_list - ~get_loc:(fun (longident, typexpr) -> {longident.Asttypes.loc with - loc_end = typexpr.Parsetree.ptyp_loc.loc_end - }) - ~walk_node:walk_package_constraint - package_constraints - t - comments - - and walk_package_constraint package_constraint t comments = - let (longident, typexpr) = package_constraint in - let (before_longident, after_longident) = - partition_leading_trailing comments longident.loc in - attach t.leading longident.loc before_longident; - let (after_longident, rest) = - partition_adjacent_trailing longident.loc after_longident in - attach t.trailing longident.loc after_longident; - let (before_typ, inside_typ, after_typ) = - partition_by_loc rest typexpr.ptyp_loc in - attach t.leading typexpr.ptyp_loc before_typ; - walk_typ_expr typexpr t inside_typ; - attach t.trailing typexpr.ptyp_loc after_typ; - - and walk_extension extension t comments = - let (id, payload) = extension in - let (before_id, after_id) = partition_leading_trailing comments id.loc in - attach t.leading id.loc before_id; - let (after_id, rest) = partition_adjacent_trailing id.loc after_id in - attach t.trailing id.loc after_id; - walk_payload payload t rest - - and walk_attribute (id, payload) t comments = - let (before_id, after_id) = partition_leading_trailing comments id.loc in - attach t.leading id.loc before_id; - let (after_id, rest) = partition_adjacent_trailing id.loc after_id in - attach t.trailing id.loc after_id; - walk_payload payload t rest - - and walk_payload payload t comments = - match payload with - | PStr s -> walk_structure s t comments - | _ -> () - -end - -module Printer = struct - let add_parens doc = - Doc.group ( - Doc.concat [ - Doc.lparen; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - doc - ] - ); - Doc.soft_line; - Doc.rparen; - ] - ) - - let add_braces doc = - Doc.group ( - Doc.concat [ - Doc.lbrace; - doc; - Doc.rbrace; - ] - ) - - let get_first_leading_comment tbl loc = - match Hashtbl.find tbl.CommentTable.leading loc with - | comment::_ -> Some comment - | [] -> None - | exception Not_found -> None - - let print_multiline_comment_content txt = - (* Turns - * |* first line - * * second line - * * third line *| - * Into - * |* first line - * * second line - * * third line *| - * - * What makes a comment suitable for this kind of indentation? - * -> multiple lines + every line starts with a star - *) - let rec indent_stars lines acc = - match lines with - | [] -> Doc.nil - | [last_line] -> - let line = String.trim last_line in - let doc = Doc.text (" " ^ line) in - let trailing_space = if String.length line > 0 then Doc.space else Doc.nil in - List.rev (trailing_space::doc::acc) |> Doc.concat - | line::lines -> - let line = String.trim line in - let len = String.length line in - if len > 0 && (String.get [@doesNotRaise]) line 0 == '*' then - let doc = Doc.text (" " ^ (String.trim line)) in - indent_stars lines (Doc.hard_line::doc::acc) - else - let trailing_space = - let len = String.length txt in - if len > 0 && (String.unsafe_get txt (len - 1) = ' ') then - Doc.space - else Doc.nil - in - let content = Comment.trim_spaces txt in - Doc.concat [Doc.text content; trailing_space] - in - let lines = String.split_on_char '\n' txt in - match lines with - | [] -> Doc.text "/* */" - | [line] -> Doc.concat [ - Doc.text "/* "; - Doc.text (Comment.trim_spaces line); - Doc.text " */"; - ] - | first::rest -> - let first_line = Comment.trim_spaces first in - Doc.concat [ - Doc.text "/*"; - if String.length first_line > 0 && not (String.equal first_line "*") then - Doc.space else Doc.nil; - indent_stars rest [Doc.hard_line; Doc.text first_line]; - Doc.text "*/"; - ] - - let print_trailing_comment (node_loc : Location.t) comment = - let single_line = Comment.is_single_line_comment comment in - let content = - let txt = Comment.txt comment in - if single_line then - Doc.text ("// " ^ String.trim txt) - else - print_multiline_comment_content txt - in - let diff = - let cmt_start = (Comment.loc comment).loc_start in - let prev_tok_end_pos = Comment.prev_tok_end_pos comment in - cmt_start.pos_lnum - prev_tok_end_pos.pos_lnum - in - let is_below = - (Comment.loc comment).loc_start.pos_lnum > node_loc.loc_end.pos_lnum in - if diff > 0 || is_below then - Doc.concat [ - Doc.break_parent; - Doc.line_suffix( - (Doc.concat [Doc.hard_line; if diff > 1 then Doc.hard_line else Doc.nil; content]) - ) - ] - else if not single_line then - Doc.concat [Doc.space; content] - else - Doc.line_suffix (Doc.concat [Doc.space; content]) - - let print_leading_comment ?next_comment comment = - let single_line = Comment.is_single_line_comment comment in - let content = - let txt = Comment.txt comment in - if single_line then - Doc.text ("// " ^ String.trim txt) - else - print_multiline_comment_content txt - in - let separator = Doc.concat [ - if single_line then Doc.concat [ - Doc.hard_line; - Doc.break_parent; - ] else Doc.nil; - (match next_comment with - | Some next -> - let next_loc = Comment.loc next in - let curr_loc = Comment.loc comment in - let diff = - next_loc.Location.loc_start.pos_lnum - - curr_loc.Location.loc_end.pos_lnum - in - let next_single_line = Comment.is_single_line_comment next in - if single_line && next_single_line then - if diff > 1 then Doc.hard_line else Doc.nil - else if single_line && not next_single_line then - if diff > 1 then Doc.hard_line else Doc.nil - else - if diff > 1 then Doc.concat [Doc.hard_line; Doc.hard_line] - else if diff == 1 then Doc.hard_line - else - Doc.space - | None -> Doc.nil) - ] - in - Doc.concat [ - content; - separator; - ] - - let print_comments_inside cmt_tbl loc = - let rec loop acc comments = - match comments with - | [] -> Doc.nil - | [comment] -> - let cmt_doc = print_leading_comment comment in - let doc = Doc.group ( - Doc.concat [ - Doc.concat (List.rev (cmt_doc::acc)); - ] - ) - in - doc - | comment::((next_comment::_comments) as rest) -> - let cmt_doc = print_leading_comment ~next_comment comment in - loop (cmt_doc::acc) rest - in - match Hashtbl.find cmt_tbl.CommentTable.inside loc with - | exception Not_found -> Doc.nil - | comments -> - Hashtbl.remove cmt_tbl.inside loc; - Doc.group ( - loop [] comments - ) - - let print_leading_comments node tbl loc = - let rec loop acc comments = - match comments with - | [] -> node - | [comment] -> - let cmt_doc = print_leading_comment comment in - let diff = - loc.Location.loc_start.pos_lnum - - (Comment.loc comment).Location.loc_end.pos_lnum - in - let separator = - if Comment.is_single_line_comment comment then - if diff > 1 then Doc.hard_line else Doc.nil - else if diff == 0 then - Doc.space - else if diff > 1 then Doc.concat [Doc.hard_line; Doc.hard_line] - else - Doc.hard_line - in - let doc = Doc.group ( - Doc.concat [ - Doc.concat (List.rev (cmt_doc::acc)); - separator; - node - ] - ) - in - doc - | comment::((next_comment::_comments) as rest) -> - let cmt_doc = print_leading_comment ~next_comment comment in - loop (cmt_doc::acc) rest - in - match Hashtbl.find tbl loc with - | exception Not_found -> node - | comments -> - (* Remove comments from tbl: Some ast nodes have the same location. - * We only want to print comments once *) - Hashtbl.remove tbl loc; - loop [] comments - - let print_trailing_comments node tbl loc = - let rec loop acc comments = - match comments with - | [] -> Doc.concat (List.rev acc) - | comment::comments -> - let cmt_doc = print_trailing_comment loc comment in - loop (cmt_doc::acc) comments - in - match Hashtbl.find tbl loc with - | exception Not_found -> node - | [] -> node - | (_first::_) as comments -> - (* Remove comments from tbl: Some ast nodes have the same location. - * We only want to print comments once *) - Hashtbl.remove tbl loc; - let cmts_doc = loop [] comments in - Doc.concat [ - node; - cmts_doc; - ] - - let print_comments doc (tbl: CommentTable.t) loc = - let doc_with_leading_comments = print_leading_comments doc tbl.leading loc in - print_trailing_comments doc_with_leading_comments tbl.trailing loc - - let print_list ~get_loc ~nodes ~print ?(force_break=false) t = - let rec loop (prev_loc: Location.t) acc nodes = - match nodes with - | [] -> (prev_loc, Doc.concat (List.rev acc)) - | node::nodes -> - let loc = get_loc node in - let start_pos = match get_first_leading_comment t loc with - | None -> loc.loc_start - | Some comment -> (Comment.loc comment).loc_start - in - let sep = if start_pos.pos_lnum - prev_loc.loc_end.pos_lnum > 1 then - Doc.concat [Doc.hard_line; Doc.hard_line] - else - Doc.hard_line - in - let doc = print_comments (print node t) t loc in - loop loc (doc::sep::acc) nodes - in - match nodes with - | [] -> Doc.nil - | node::nodes -> - let first_loc = get_loc node in - let doc = print_comments (print node t) t first_loc in - let (last_loc, docs) = loop first_loc [doc] nodes in - let force_break = - force_break || - first_loc.loc_start.pos_lnum != last_loc.loc_end.pos_lnum - in - Doc.breakable_group ~force_break docs - - let print_listi ~get_loc ~nodes ~print ?(force_break=false) t = - let rec loop i (prev_loc: Location.t) acc nodes = - match nodes with - | [] -> (prev_loc, Doc.concat (List.rev acc)) - | node::nodes -> - let loc = get_loc node in - let start_pos = match get_first_leading_comment t loc with - | None -> loc.loc_start - | Some comment -> (Comment.loc comment).loc_start - in - let sep = if start_pos.pos_lnum - prev_loc.loc_end.pos_lnum > 1 then - Doc.concat [Doc.hard_line; Doc.hard_line] - else - Doc.line - in - let doc = print_comments (print node t i) t loc in - loop (i + 1) loc (doc::sep::acc) nodes - in - match nodes with - | [] -> Doc.nil - | node::nodes -> - let first_loc = get_loc node in - let doc = print_comments (print node t 0) t first_loc in - let (last_loc, docs) = loop 1 first_loc [doc] nodes in - let force_break = - force_break || - first_loc.loc_start.pos_lnum != last_loc.loc_end.pos_lnum - in - Doc.breakable_group ~force_break docs - - let rec print_longident_aux accu = function - | Longident.Lident s -> (Doc.text s) :: accu - | Ldot(lid, s) -> print_longident_aux ((Doc.text s) :: accu) lid - | Lapply(lid1, lid2) -> - let d1 = Doc.join ~sep:Doc.dot (print_longident_aux [] lid1) in - let d2 = Doc.join ~sep:Doc.dot (print_longident_aux [] lid2) in - (Doc.concat [d1; Doc.lparen; d2; Doc.rparen]) :: accu - - let print_longident = function - | Longident.Lident txt -> Doc.text txt - | lid -> Doc.join ~sep:Doc.dot (print_longident_aux [] lid) - - type identifier_style = - | ExoticIdent - | NormalIdent - - let classify_ident_content ?(allow_uident=false) txt = - let len = String.length txt in - let rec go i = - if i == len then NormalIdent - else - let c = String.unsafe_get txt i in - if i == 0 && not ( - (allow_uident && (c >= 'A' && c <= 'Z')) || - (c >= 'a' && c <= 'z') || c = '_' || (c >= '0' && c <= '9')) then - ExoticIdent - else if not ( - (c >= 'a' && c <= 'z') - || (c >= 'A' && c <= 'Z') - || c = '\'' - || c = '_' - || (c >= '0' && c <= '9')) - then - ExoticIdent - else - go (i + 1) - in - if Token.is_keyword_txt txt && txt <> "list" then - ExoticIdent - else - go 0 - - let print_ident_like ?allow_uident txt = - match classify_ident_content ?allow_uident txt with - | ExoticIdent -> Doc.concat [ - Doc.text "\\\""; - Doc.text txt; - Doc.text"\"" - ] - | NormalIdent -> Doc.text txt - - let print_lident l = match l with - | Longident.Lident txt -> print_ident_like txt - | Longident.Ldot (path, txt) -> - let txts = Longident.flatten path in - Doc.concat [ - Doc.join ~sep:Doc.dot (List.map Doc.text txts); - Doc.dot; - print_ident_like txt; - ] - | _ -> Doc.text("printLident: Longident.Lapply is not supported") - - let print_longident_location l cmt_tbl = - let doc = print_longident l.Location.txt in - print_comments doc cmt_tbl l.loc - - (* Module.SubModule.x *) - let print_lident_path path cmt_tbl = - let doc = print_lident path.Location.txt in - print_comments doc cmt_tbl path.loc - - (* Module.SubModule.x or Module.SubModule.X *) - let print_ident_path path cmt_tbl = - let doc = print_lident path.Location.txt in - print_comments doc cmt_tbl path.loc - - let print_string_loc sloc cmt_tbl = - let doc = print_ident_like sloc.Location.txt in - print_comments doc cmt_tbl sloc.loc - - let print_constant c = match c with - | Parsetree.Pconst_integer (s, suffix) -> - begin match suffix with - | Some c -> Doc.text (s ^ (Char.escaped c)) - | None -> Doc.text s - end - | Pconst_string (txt, None) -> - Doc.text ("\"" ^ txt ^ "\"") - | Pconst_string (txt, Some prefix) -> - Doc.concat [ - if prefix = "" then Doc.nil else Doc.text prefix; - Doc.text ("`" ^ txt ^ "`") - ] - | Pconst_float (s, _) -> Doc.text s - | Pconst_char c -> Doc.text ("'" ^ (Char.escaped c) ^ "'") - - let rec print_structure (s : Parsetree.structure) t = - match s with - | [] -> print_comments_inside t Location.none - | structure -> - print_list - ~get_loc:(fun s -> s.Parsetree.pstr_loc) - ~nodes:structure - ~print:print_structure_item - t - - and print_structure_item (si: Parsetree.structure_item) cmt_tbl = - match si.pstr_desc with - | Pstr_value(rec_flag, value_bindings) -> - let rec_flag = match rec_flag with - | Asttypes.Nonrecursive -> Doc.nil - | Asttypes.Recursive -> Doc.text "rec " - in - print_value_bindings ~rec_flag value_bindings cmt_tbl - | Pstr_type(rec_flag, type_declarations) -> - let rec_flag = match rec_flag with - | Asttypes.Nonrecursive -> Doc.nil - | Asttypes.Recursive -> Doc.text "rec " - in - print_type_declarations ~rec_flag type_declarations cmt_tbl - | Pstr_primitive value_description -> - print_value_description value_description cmt_tbl - | Pstr_eval (expr, attrs) -> - let expr_doc = - let doc = print_expression_with_comments expr cmt_tbl in - match Parens.structure_expr expr with - | Parens.Parenthesized -> add_parens doc - | Braced braces -> print_braces doc expr braces - | Nothing -> doc - in - Doc.concat [ - print_attributes attrs; - expr_doc; - ] - | Pstr_attribute attr -> Doc.concat [ - Doc.text "@"; - print_attribute_with_comments attr cmt_tbl - ] - | Pstr_extension (extension, attrs) -> Doc.concat [ - print_attributes attrs; - Doc.concat [print_extension_with_comments ~at_module_lvl:true extension cmt_tbl]; - ] - | Pstr_include include_declaration -> - print_include_declaration include_declaration cmt_tbl - | Pstr_open open_description -> - print_open_description open_description cmt_tbl - | Pstr_modtype mod_type_decl -> - print_module_type_declaration mod_type_decl cmt_tbl - | Pstr_module module_binding -> - print_module_binding ~is_rec:false module_binding cmt_tbl 0 - | Pstr_recmodule module_bindings -> - print_listi - ~get_loc:(fun mb -> mb.Parsetree.pmb_loc) - ~nodes:module_bindings - ~print:(print_module_binding ~is_rec:true) - cmt_tbl - | Pstr_exception extension_constructor -> - print_exception_def extension_constructor cmt_tbl - | Pstr_typext type_extension -> - print_type_extension type_extension cmt_tbl - | Pstr_class _ | Pstr_class_type _ -> Doc.nil - - and print_type_extension (te : Parsetree.type_extension) cmt_tbl = - let prefix = Doc.text "type " in - let name = print_lident_path te.ptyext_path cmt_tbl in - let type_params = print_type_params te.ptyext_params cmt_tbl in - let extension_constructors = - let ecs = te.ptyext_constructors in - let force_break = - match (ecs, List.rev ecs) with - | (first::_, last::_) -> - first.pext_loc.loc_start.pos_lnum > te.ptyext_path.loc.loc_end.pos_lnum || - first.pext_loc.loc_start.pos_lnum < last.pext_loc.loc_end.pos_lnum - | _ -> false - in - let private_flag = match te.ptyext_private with - | Asttypes.Private -> Doc.concat [ - Doc.text "private"; - Doc.line; - ] - | Public -> Doc.nil - in - let rows = - print_listi - ~get_loc:(fun n -> n.Parsetree.pext_loc) - ~print:print_extension_constructor - ~nodes: ecs - ~force_break - cmt_tbl - in - Doc.breakable_group ~force_break ( - Doc.indent ( - Doc.concat [ - Doc.line; - private_flag; - rows; - (* Doc.join ~sep:Doc.line ( *) - (* List.mapi printExtensionConstructor ecs *) - (* ) *) - ] - ) - ) - in - Doc.group ( - Doc.concat [ - print_attributes ~loc: te.ptyext_path.loc te.ptyext_attributes; - prefix; - name; - type_params; - Doc.text " +="; - extension_constructors; - ] - ) - - and print_module_binding ~is_rec module_binding cmt_tbl i = - let prefix = if i = 0 then - Doc.concat [ - Doc.text "module "; - if is_rec then Doc.text "rec " else Doc.nil; - ] - else - Doc.text "and " - in - let (mod_expr_doc, mod_constraint_doc) = - match module_binding.pmb_expr with - | {pmod_desc = Pmod_constraint (mod_expr, mod_type)} -> - ( - print_mod_expr mod_expr cmt_tbl, - Doc.concat [ - Doc.text ": "; - print_mod_type mod_type cmt_tbl - ] - ) - | mod_expr -> - (print_mod_expr mod_expr cmt_tbl, Doc.nil) - in - let mod_name = - let doc = Doc.text module_binding.pmb_name.Location.txt in - print_comments doc cmt_tbl module_binding.pmb_name.loc - in - let doc = Doc.concat [ - print_attributes ~loc:module_binding.pmb_name.loc module_binding.pmb_attributes; - prefix; - mod_name; - mod_constraint_doc; - Doc.text " = "; - mod_expr_doc; - ] in - print_comments doc cmt_tbl module_binding.pmb_loc - - and print_module_type_declaration (mod_type_decl : Parsetree.module_type_declaration) cmt_tbl = - let mod_name = - let doc = Doc.text mod_type_decl.pmtd_name.txt in - print_comments doc cmt_tbl mod_type_decl.pmtd_name.loc - in - Doc.concat [ - print_attributes mod_type_decl.pmtd_attributes; - Doc.text "module type "; - mod_name; - (match mod_type_decl.pmtd_type with - | None -> Doc.nil - | Some mod_type -> Doc.concat [ - Doc.text " = "; - print_mod_type mod_type cmt_tbl; - ]); - ] - - and print_mod_type mod_type cmt_tbl = - let mod_type_doc = match mod_type.pmty_desc with - | Parsetree.Pmty_ident longident -> - Doc.concat [ - print_attributes ~loc:longident.loc mod_type.pmty_attributes; - print_longident_location longident cmt_tbl - ] - | Pmty_signature signature -> - let signature_doc = Doc.breakable_group ~force_break:true ( - Doc.concat [ - Doc.lbrace; - Doc.indent ( - Doc.concat [ - Doc.line; - print_signature signature cmt_tbl; - ] - ); - Doc.line; - Doc.rbrace; - ] - ) in - Doc.concat [ - print_attributes mod_type.pmty_attributes; - signature_doc - ] - | Pmty_functor _ -> - let (parameters, return_type) = ParsetreeViewer.functor_type mod_type in - let parameters_doc = match parameters with - | [] -> Doc.nil - | [attrs, {Location.txt = "_"; loc}, Some mod_type] -> - let cmt_loc = - {loc with loc_end = mod_type.Parsetree.pmty_loc.loc_end} - in - let attrs = match attrs with - | [] -> Doc.nil - | attrs -> Doc.concat [ - Doc.join ~sep:Doc.line (List.map print_attribute attrs); - Doc.line; - ] in - let doc = Doc.concat [ - attrs; - print_mod_type mod_type cmt_tbl - ] in - print_comments doc cmt_tbl cmt_loc - | params -> - Doc.group ( - Doc.concat [ - Doc.lparen; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) ( - List.map (fun (attrs, lbl, mod_type) -> - let cmt_loc = match mod_type with - | None -> lbl.Asttypes.loc - | Some mod_type -> - {lbl.Asttypes.loc with loc_end = mod_type.Parsetree.pmty_loc.loc_end} - in - let attrs = match attrs with - | [] -> Doc.nil - | attrs -> Doc.concat [ - Doc.join ~sep:Doc.line (List.map print_attribute attrs); - Doc.line; - ] in - let lbl_doc = if lbl.Location.txt = "_" then Doc.nil - else - let doc = Doc.text lbl.txt in - print_comments doc cmt_tbl lbl.loc - in - let doc = Doc.concat [ - attrs; - lbl_doc; - (match mod_type with - | None -> Doc.nil - | Some mod_type -> Doc.concat [ - if lbl.txt = "_" then Doc.nil else Doc.text ": "; - print_mod_type mod_type cmt_tbl; - ]); - ] in - print_comments doc cmt_tbl cmt_loc - ) params - ); - ] - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.rparen; - ] - ) - in - let return_doc = - let doc = print_mod_type return_type cmt_tbl in - if Parens.mod_type_functor_return return_type then add_parens doc else doc - in - Doc.group ( - Doc.concat [ - parameters_doc; - Doc.group ( - Doc.concat [ - Doc.text " =>"; - Doc.line; - return_doc; - ] - ) - ] - ) - | Pmty_typeof mod_expr -> Doc.concat [ - Doc.text "module type of "; - print_mod_expr mod_expr cmt_tbl - ] - | Pmty_extension extension -> print_extension_with_comments ~at_module_lvl:false extension cmt_tbl - | Pmty_alias longident -> Doc.concat [ - Doc.text "module "; - print_longident_location longident cmt_tbl; - ] - | Pmty_with (mod_type, with_constraints) -> - let operand = - let doc = print_mod_type mod_type cmt_tbl in - if Parens.mod_type_with_operand mod_type then add_parens doc else doc - in - Doc.group ( - Doc.concat [ - operand; - Doc.indent ( - Doc.concat [ - Doc.line; - print_with_constraints with_constraints cmt_tbl; - ] - ) - ] - ) - in - let attrs_already_printed = match mod_type.pmty_desc with - | Pmty_functor _ | Pmty_signature _ | Pmty_ident _ -> true - | _ -> false - in - let doc =Doc.concat [ - if attrs_already_printed then Doc.nil else print_attributes mod_type.pmty_attributes; - mod_type_doc; - ] in - print_comments doc cmt_tbl mod_type.pmty_loc - - and print_with_constraints with_constraints cmt_tbl = - let rows = List.mapi (fun i with_constraint -> - Doc.group ( - Doc.concat [ - if i == 0 then Doc.text "with " else Doc.text "and "; - print_with_constraint with_constraint cmt_tbl; - ] - ) - ) with_constraints - in - Doc.join ~sep:Doc.line rows - - and print_with_constraint (with_constraint : Parsetree.with_constraint) cmt_tbl = - match with_constraint with - (* with type X.t = ... *) - | Pwith_type (longident, type_declaration) -> - Doc.group (print_type_declaration - ~name:(print_lident_path longident cmt_tbl) - ~equal_sign:"=" - ~rec_flag:Doc.nil - 0 - type_declaration - CommentTable.empty) - (* with module X.Y = Z *) - | Pwith_module ({txt = longident1}, {txt = longident2}) -> - Doc.concat [ - Doc.text "module "; - print_longident longident1; - Doc.text " ="; - Doc.indent ( - Doc.concat [ - Doc.line; - print_longident longident2; - ] - ) - ] - (* with type X.t := ..., same format as [Pwith_type] *) - | Pwith_typesubst (longident, type_declaration) -> - Doc.group(print_type_declaration - ~name:(print_lident_path longident cmt_tbl) - ~equal_sign:":=" - ~rec_flag:Doc.nil - 0 - type_declaration - CommentTable.empty) - | Pwith_modsubst ({txt = longident1}, {txt = longident2}) -> - Doc.concat [ - Doc.text "module "; - print_longident longident1; - Doc.text " :="; - Doc.indent ( - Doc.concat [ - Doc.line; - print_longident longident2; - ] - ) - ] - - and print_signature signature cmt_tbl = - match signature with - | [] -> print_comments_inside cmt_tbl Location.none - | signature -> - print_list - ~get_loc:(fun s -> s.Parsetree.psig_loc) - ~nodes:signature - ~print:print_signature_item - cmt_tbl - - and print_signature_item (si : Parsetree.signature_item) cmt_tbl = - match si.psig_desc with - | Parsetree.Psig_value value_description -> - print_value_description value_description cmt_tbl - | Psig_type (rec_flag, type_declarations) -> - let rec_flag = match rec_flag with - | Asttypes.Nonrecursive -> Doc.nil - | Asttypes.Recursive -> Doc.text "rec " - in - print_type_declarations ~rec_flag type_declarations cmt_tbl - | Psig_typext type_extension -> - print_type_extension type_extension cmt_tbl - | Psig_exception extension_constructor -> - print_exception_def extension_constructor cmt_tbl - | Psig_module module_declaration -> - print_module_declaration module_declaration cmt_tbl - | Psig_recmodule module_declarations -> - print_rec_module_declarations module_declarations cmt_tbl - | Psig_modtype mod_type_decl -> - print_module_type_declaration mod_type_decl cmt_tbl - | Psig_open open_description -> - print_open_description open_description cmt_tbl - | Psig_include include_description -> - print_include_description include_description cmt_tbl - | Psig_attribute attr -> Doc.concat [ - Doc.text "@"; - print_attribute_with_comments attr cmt_tbl - ] - | Psig_extension (extension, attrs) -> Doc.concat [ - print_attributes attrs; - Doc.concat [print_extension_with_comments ~at_module_lvl:true extension cmt_tbl]; - ] - | Psig_class _ | Psig_class_type _ -> Doc.nil - - and print_rec_module_declarations module_declarations cmt_tbl = - print_listi - ~get_loc:(fun n -> n.Parsetree.pmd_loc) - ~nodes:module_declarations - ~print:print_rec_module_declaration - cmt_tbl - - and print_rec_module_declaration md cmt_tbl i = - let body = match md.pmd_type.pmty_desc with - | Parsetree.Pmty_alias longident -> - Doc.concat [Doc.text " = "; print_longident_location longident cmt_tbl] - | _ -> - let needs_parens = match md.pmd_type.pmty_desc with - | Pmty_with _ -> true - | _ -> false - in - let mod_type_doc = - let doc = print_mod_type md.pmd_type cmt_tbl in - if needs_parens then add_parens doc else doc - in - Doc.concat [Doc.text ": "; mod_type_doc] - in - let prefix = if i < 1 then "module rec " else "and " in - Doc.concat [ - print_attributes ~loc:md.pmd_name.loc md.pmd_attributes; - Doc.text prefix; - print_comments (Doc.text md.pmd_name.txt) cmt_tbl md.pmd_name.loc; - body - ] - - and print_module_declaration (md: Parsetree.module_declaration) cmt_tbl = - let body = match md.pmd_type.pmty_desc with - | Parsetree.Pmty_alias longident -> - Doc.concat [Doc.text " = "; print_longident_location longident cmt_tbl] - | _ -> Doc.concat [Doc.text ": "; print_mod_type md.pmd_type cmt_tbl] - in - Doc.concat [ - print_attributes ~loc:md.pmd_name.loc md.pmd_attributes; - Doc.text "module "; - print_comments (Doc.text md.pmd_name.txt) cmt_tbl md.pmd_name.loc; - body - ] - - and print_open_description (open_description : Parsetree.open_description) p = - Doc.concat [ - print_attributes open_description.popen_attributes; - Doc.text "open"; - (match open_description.popen_override with - | Asttypes.Fresh -> Doc.space - | Asttypes.Override -> Doc.text "! "); - print_longident_location open_description.popen_lid p - ] - - and print_include_description (include_description: Parsetree.include_description) cmt_tbl = - Doc.concat [ - print_attributes include_description.pincl_attributes; - Doc.text "include "; - print_mod_type include_description.pincl_mod cmt_tbl; - ] - - and print_include_declaration (include_declaration : Parsetree.include_declaration) cmt_tbl = - let is_js_ffi_import = List.exists (fun attr -> - match attr with - | ({Location.txt = "ns.jsFfi"}, _) -> true - | _ -> false - ) include_declaration.pincl_attributes - in - if is_js_ffi_import then - print_js_ffi_import_declaration include_declaration cmt_tbl - else - Doc.concat [ - print_attributes include_declaration.pincl_attributes; - Doc.text "include "; - let include_doc = - print_mod_expr include_declaration.pincl_mod cmt_tbl - in - if Parens.include_mod_expr include_declaration.pincl_mod then - add_parens include_doc - else include_doc; - ] - - and print_js_ffi_import (value_description: Parsetree.value_description) cmt_tbl = - let attrs = List.filter (fun attr -> - match attr with - | ({Location.txt = "val" | "genType.import" | "scope" }, _) -> false - | _ -> true - ) value_description.pval_attributes in - let (ident, alias) = match value_description.pval_prim with - | primitive::_ -> - if primitive <> value_description.pval_name.txt then - ( - print_ident_like primitive, - Doc.concat [ - Doc.text " as "; - print_ident_like value_description.pval_name.txt; - ] - ) - else - (print_ident_like primitive, Doc.nil) - | _ -> - (print_ident_like value_description.pval_name.txt, Doc.nil) - in - Doc.concat [ - print_attributes ~loc:value_description.pval_name.loc attrs; - ident; - alias; - Doc.text ": "; - print_typ_expr value_description.pval_type cmt_tbl; - ] - - and print_js_ffi_import_scope (scope: ParsetreeViewer.js_import_scope) = - match scope with - | JsGlobalImport -> Doc.nil - | JsModuleImport mod_name -> - Doc.concat [ - Doc.text " from "; - Doc.double_quote; - Doc.text mod_name; - Doc.double_quote; - ] - | JsScopedImport idents -> - Doc.concat [ - Doc.text " from "; - Doc.join ~sep:Doc.dot (List.map Doc.text idents) - ] - - and print_js_ffi_import_declaration (include_declaration: Parsetree.include_declaration) cmt_tbl = - let attrs = List.filter (fun attr -> - match attr with - | ({Location.txt = "ns.jsFfi"}, _) -> false - | _ -> true - ) include_declaration.pincl_attributes - in - let imports = ParsetreeViewer.extract_value_description_from_mod_expr include_declaration.pincl_mod in - let scope = match imports with - | vd::_ -> ParsetreeViewer.classify_js_import vd - | [] -> ParsetreeViewer.JsGlobalImport - in - let scope_doc = print_js_ffi_import_scope scope in - Doc.group ( - Doc.concat [ - print_attributes attrs; - Doc.text "import "; - Doc.group ( - Doc.concat [ - Doc.lbrace; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) ( - List.map (fun vd -> print_js_ffi_import vd cmt_tbl) imports - ) - ] - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.rbrace; - ] - ); - scope_doc; - ] - ) - - and print_value_bindings ~rec_flag (vbs: Parsetree.value_binding list) cmt_tbl = - print_listi - ~get_loc:(fun vb -> vb.Parsetree.pvb_loc) - ~nodes:vbs - ~print:(print_value_binding ~rec_flag) - cmt_tbl - - and print_value_description value_description cmt_tbl = - let is_external = - match value_description.pval_prim with | [] -> false | _ -> true - in - Doc.group ( - Doc.concat [ - print_attributes value_description.pval_attributes; - Doc.text (if is_external then "external " else "let "); - print_comments - (print_ident_like value_description.pval_name.txt) - cmt_tbl - value_description.pval_name.loc; - Doc.text ": "; - print_typ_expr value_description.pval_type cmt_tbl; - if is_external then - Doc.group ( - Doc.concat [ - Doc.text " ="; - Doc.indent( - Doc.concat [ - Doc.line; - Doc.join ~sep:Doc.line ( - List.map(fun s -> Doc.concat [ - Doc.text "\""; - Doc.text s; - Doc.text "\""; - ]) - value_description.pval_prim - ); - ] - ) - ] - ) - else Doc.nil - ] - ) - - and print_type_declarations ~rec_flag type_declarations cmt_tbl = - print_listi - ~get_loc:(fun n -> n.Parsetree.ptype_loc) - ~nodes:type_declarations - ~print:(print_type_declaration2 ~rec_flag) - cmt_tbl - - (* - * 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 = - * | 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 print_type_declaration ~name ~equal_sign ~rec_flag i (td: Parsetree.type_declaration) cmt_tbl = - let (has_gentype, attrs) = ParsetreeViewer.split_gentype_attr td.ptype_attributes in - let attrs = print_attributes ~loc:td.ptype_loc attrs in - let prefix = if i > 0 then - Doc.concat [ - Doc.text "and "; - if has_gentype then Doc.text "export " else Doc.nil - ] - else - Doc.concat [ - Doc.text (if has_gentype then "export type " else "type "); - rec_flag - ] - in - let type_name = name in - let type_params = print_type_params td.ptype_params cmt_tbl in - let manifest_and_kind = match td.ptype_kind with - | Ptype_abstract -> - begin match td.ptype_manifest with - | None -> Doc.nil - | Some(typ) -> - Doc.concat [ - Doc.concat [Doc.space; Doc.text equal_sign; Doc.space]; - print_private_flag td.ptype_private; - print_typ_expr typ cmt_tbl; - ] - end - | Ptype_open -> Doc.concat [ - Doc.concat [Doc.space; Doc.text equal_sign; Doc.space]; - print_private_flag td.ptype_private; - Doc.text ".."; - ] - | Ptype_record(lds) -> - let manifest = match td.ptype_manifest with - | None -> Doc.nil - | Some(typ) -> Doc.concat [ - Doc.concat [Doc.space; Doc.text equal_sign; Doc.space]; - print_typ_expr typ cmt_tbl; - ] - in - Doc.concat [ - manifest; - Doc.concat [Doc.space; Doc.text equal_sign; Doc.space]; - print_private_flag td.ptype_private; - print_record_declaration lds cmt_tbl; - ] - | Ptype_variant(cds) -> - let manifest = match td.ptype_manifest with - | None -> Doc.nil - | Some(typ) -> Doc.concat [ - Doc.concat [Doc.space; Doc.text equal_sign; Doc.space]; - print_typ_expr typ cmt_tbl; - ] - in - Doc.concat [ - manifest; - Doc.concat [Doc.space; Doc.text equal_sign]; - print_constructor_declarations ~private_flag:td.ptype_private cds cmt_tbl; - ] - in - let constraints = print_type_definition_constraints td.ptype_cstrs in - Doc.group ( - Doc.concat [ - attrs; - prefix; - type_name; - type_params; - manifest_and_kind; - constraints; - ] - ) - - and print_type_declaration2 ~rec_flag (td: Parsetree.type_declaration) cmt_tbl i = - let name = - let doc = print_ident_like td.Parsetree.ptype_name.txt in - print_comments doc cmt_tbl td.ptype_name.loc - in - let equal_sign = "=" in - let (has_gentype, attrs) = ParsetreeViewer.split_gentype_attr td.ptype_attributes in - let attrs = print_attributes ~loc:td.ptype_loc attrs in - let prefix = if i > 0 then - Doc.concat [ - Doc.text "and "; - if has_gentype then Doc.text "export " else Doc.nil - ] - else - Doc.concat [ - Doc.text (if has_gentype then "export type " else "type "); - rec_flag - ] - in - let type_name = name in - let type_params = print_type_params td.ptype_params cmt_tbl in - let manifest_and_kind = match td.ptype_kind with - | Ptype_abstract -> - begin match td.ptype_manifest with - | None -> Doc.nil - | Some(typ) -> - Doc.concat [ - Doc.concat [Doc.space; Doc.text equal_sign; Doc.space]; - print_private_flag td.ptype_private; - print_typ_expr typ cmt_tbl; - ] - end - | Ptype_open -> Doc.concat [ - Doc.concat [Doc.space; Doc.text equal_sign; Doc.space]; - print_private_flag td.ptype_private; - Doc.text ".."; - ] - | Ptype_record(lds) -> - let manifest = match td.ptype_manifest with - | None -> Doc.nil - | Some(typ) -> Doc.concat [ - Doc.concat [Doc.space; Doc.text equal_sign; Doc.space]; - print_typ_expr typ cmt_tbl; - ] - in - Doc.concat [ - manifest; - Doc.concat [Doc.space; Doc.text equal_sign; Doc.space]; - print_private_flag td.ptype_private; - print_record_declaration lds cmt_tbl; - ] - | Ptype_variant(cds) -> - let manifest = match td.ptype_manifest with - | None -> Doc.nil - | Some(typ) -> Doc.concat [ - Doc.concat [Doc.space; Doc.text equal_sign; Doc.space]; - print_typ_expr typ cmt_tbl; - ] - in - Doc.concat [ - manifest; - Doc.concat [Doc.space; Doc.text equal_sign]; - print_constructor_declarations ~private_flag:td.ptype_private cds cmt_tbl; - ] - in - let constraints = print_type_definition_constraints td.ptype_cstrs in - Doc.group ( - Doc.concat [ - attrs; - prefix; - type_name; - type_params; - manifest_and_kind; - constraints; - ] - ) - - and print_type_definition_constraints cstrs = - match cstrs with - | [] -> Doc.nil - | cstrs -> Doc.indent ( - Doc.group ( - Doc.concat [ - Doc.line; - Doc.group( - Doc.join ~sep:Doc.line ( - List.map print_type_definition_constraint cstrs - ) - ) - ] - ) - ) - - and print_type_definition_constraint ((typ1, typ2, _loc ): Parsetree.core_type * Parsetree.core_type * Location.t) = - Doc.concat [ - Doc.text "constraint "; - print_typ_expr typ1 CommentTable.empty; - Doc.text " = "; - print_typ_expr typ2 CommentTable.empty; - ] - - and print_private_flag (flag : Asttypes.private_flag) = match flag with - | Private -> Doc.text "private " - | Public -> Doc.nil - - and print_type_params type_params cmt_tbl = - match type_params with - | [] -> Doc.nil - | type_params -> - Doc.group ( - Doc.concat [ - Doc.less_than; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) ( - List.map (fun type_param -> - let doc = print_type_param type_param cmt_tbl in - print_comments doc cmt_tbl (fst type_param).Parsetree.ptyp_loc - ) type_params - ) - ] - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.greater_than; - ] - ) - - and print_type_param (param : (Parsetree.core_type * Asttypes.variance)) cmt_tbl = - let (typ, variance) = param in - let printed_variance = match variance with - | Covariant -> Doc.text "+" - | Contravariant -> Doc.text "-" - | Invariant -> Doc.nil - in - Doc.concat [ - printed_variance; - print_typ_expr typ cmt_tbl - ] - - and print_record_declaration (lds: Parsetree.label_declaration list) cmt_tbl = - let force_break = match (lds, List.rev lds) with - | (first::_, last::_) -> - first.pld_loc.loc_start.pos_lnum < last.pld_loc.loc_end.pos_lnum - | _ -> false - in - Doc.breakable_group ~force_break ( - Doc.concat [ - Doc.lbrace; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) - (List.map (fun ld -> - let doc = print_label_declaration ld cmt_tbl in - print_comments doc cmt_tbl ld.Parsetree.pld_loc - ) lds) - ] - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.rbrace; - ] - ) - - and print_constructor_declarations - ~private_flag (cds: Parsetree.constructor_declaration list) cmt_tbl - = - let force_break = match (cds, List.rev cds) with - | (first::_, last::_) -> - first.pcd_loc.loc_start.pos_lnum < last.pcd_loc.loc_end.pos_lnum - | _ -> false - in - let private_flag = match private_flag with - | Asttypes.Private -> Doc.concat [ - Doc.text "private"; - Doc.line; - ] - | Public -> Doc.nil - in - let rows = - print_listi - ~get_loc:(fun cd -> cd.Parsetree.pcd_loc) - ~nodes:cds - ~print:(fun cd cmt_tbl i -> - let doc = print_constructor_declaration2 i cd cmt_tbl in - print_comments doc cmt_tbl cd.Parsetree.pcd_loc - ) - ~force_break - cmt_tbl - in - Doc.breakable_group ~force_break ( - Doc.indent ( - Doc.concat [ - Doc.line; - private_flag; - rows; - ] - ) - ) - - and print_constructor_declaration2 i (cd : Parsetree.constructor_declaration) cmt_tbl = - let attrs = print_attributes cd.pcd_attributes in - let bar = if i > 0 then Doc.text "| " - else Doc.if_breaks (Doc.text "| ") Doc.nil - in - let constr_name = - let doc = Doc.text cd.pcd_name.txt in - print_comments doc cmt_tbl cd.pcd_name.loc - in - let constr_args = print_constructor_arguments ~indent:true cd.pcd_args cmt_tbl in - let gadt = match cd.pcd_res with - | None -> Doc.nil - | Some(typ) -> Doc.indent ( - Doc.concat [ - Doc.text ": "; - print_typ_expr typ cmt_tbl; - ] - ) - in - Doc.concat [ - bar; - Doc.group ( - Doc.concat [ - attrs; (* TODO: fix parsing of attributes, so when can print them above the bar? *) - constr_name; - constr_args; - gadt; - ] - ) - ] - - and print_constructor_arguments ~indent (cd_args : Parsetree.constructor_arguments) cmt_tbl = - match cd_args with - | Pcstr_tuple [] -> Doc.nil - | Pcstr_tuple types -> - let args = Doc.concat [ - Doc.lparen; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) ( - List.map (fun typexpr -> - print_typ_expr typexpr cmt_tbl - ) types - ) - ] - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.rparen; - ] in - Doc.group ( - if indent then Doc.indent args else args - ) - | Pcstr_record lds -> - let args = Doc.concat [ - Doc.lparen; - (* manually inline the printRecordDeclaration, gives better layout *) - Doc.lbrace; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) - (List.map (fun ld -> - let doc = print_label_declaration ld cmt_tbl in - print_comments doc cmt_tbl ld.Parsetree.pld_loc - ) lds) - ] - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.rbrace; - Doc.rparen; - ] in - if indent then Doc.indent args else args - - and print_label_declaration (ld : Parsetree.label_declaration) cmt_tbl = - let attrs = print_attributes ~loc:ld.pld_name.loc ld.pld_attributes in - let mutable_flag = match ld.pld_mutable with - | Mutable -> Doc.text "mutable " - | Immutable -> Doc.nil - in - let name = - let doc = print_ident_like ld.pld_name.txt in - print_comments doc cmt_tbl ld.pld_name.loc - in - Doc.group ( - Doc.concat [ - attrs; - mutable_flag; - name; - Doc.text ": "; - print_typ_expr ld.pld_type cmt_tbl; - ] - ) - - and print_typ_expr (typ_expr : Parsetree.core_type) cmt_tbl = - let rendered_type = match typ_expr.ptyp_desc with - | Ptyp_any -> Doc.text "_" - | Ptyp_var var -> Doc.concat [ - Doc.text "'"; - print_ident_like var; - ] - | Ptyp_extension(extension) -> - print_extension_with_comments ~at_module_lvl:false extension cmt_tbl - | Ptyp_alias(typ, alias) -> - let typ = - (* Technically type t = (string, float) => unit as 'x, doesn't require - * parens around the arrow expression. This is very confusing though. - * Is the "as" part of "unit" or "(string, float) => unit". By printing - * parens we guide the user towards its meaning.*) - let needs_parens = match typ.ptyp_desc with - | Ptyp_arrow _ -> true - | _ -> false - in - let doc = print_typ_expr typ cmt_tbl in - if needs_parens then - Doc.concat [Doc.lparen; doc; Doc.rparen] - else - doc - in - Doc.concat [typ; Doc.text " as "; Doc.concat [Doc.text "'"; print_ident_like alias]] - | Ptyp_constr({txt = Longident.Ldot(Longident.Lident "Js", "t")}, [{ptyp_desc = Ptyp_object (_fields, _openFlag)} as typ]) -> - let bs_object = print_typ_expr typ cmt_tbl in - begin match typ_expr.ptyp_attributes with - | [] -> bs_object - | attrs -> - Doc.concat [ - Doc.group ( - Doc.join ~sep:Doc.line (List.map print_attribute attrs) - ); - Doc.space; - print_typ_expr typ cmt_tbl; - ] - end - | Ptyp_constr(longident_loc, [{ ptyp_desc = Parsetree.Ptyp_tuple tuple }]) -> - let constr_name = print_lident_path longident_loc cmt_tbl in - Doc.group( - Doc.concat([ - constr_name; - Doc.less_than; - print_tuple_type ~inline:true tuple cmt_tbl; - Doc.greater_than; - ]) - ) - | Ptyp_constr(longident_loc, constr_args) -> - let constr_name = print_lident_path longident_loc cmt_tbl in - begin match constr_args with - | [] -> constr_name - | [{ - Parsetree.ptyp_desc = - Ptyp_constr({txt = Longident.Ldot(Longident.Lident "Js", "t")}, - [{ptyp_desc = Ptyp_object (fields, open_flag)}]) - }] -> - Doc.concat([ - constr_name; - Doc.less_than; - print_bs_object_sugar ~inline:true fields open_flag cmt_tbl; - Doc.greater_than; - ]) - | _args -> Doc.group( - Doc.concat([ - constr_name; - Doc.less_than; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) ( - List.map - (fun typexpr -> print_typ_expr typexpr cmt_tbl) - constr_args - ) - ] - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.greater_than; - ]) - ) - end - | Ptyp_arrow _ -> - let (attrs_before, args, return_type) = ParsetreeViewer.arrow_type typ_expr in - let return_type_needs_parens = match return_type.ptyp_desc with - | Ptyp_alias _ -> true - | _ -> false - in - let return_doc = - let doc = print_typ_expr return_type cmt_tbl in - if return_type_needs_parens then - Doc.concat [Doc.lparen; doc; Doc.rparen] - else doc - in - let (is_uncurried, attrs) = - ParsetreeViewer.process_uncurried_attribute attrs_before - in - begin match args with - | [] -> Doc.nil - | [([], Nolabel, n)] when not is_uncurried -> - let has_attrs_before = not (attrs = []) in - let attrs = if has_attrs_before then - Doc.concat [ - Doc.join ~sep:Doc.line (List.map print_attribute attrs_before); - Doc.space; - ] - else Doc.nil - in - let typ_doc = - let doc = print_typ_expr n cmt_tbl in - match n.ptyp_desc with - | Ptyp_arrow _ | Ptyp_tuple _ -> add_parens doc - | _ -> doc - in - Doc.group ( - Doc.concat [ - Doc.group attrs; - Doc.group ( - if has_attrs_before then - Doc.concat [ - Doc.lparen; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - typ_doc; - Doc.text " => "; - return_doc; - ] - ); - Doc.soft_line; - Doc.rparen - ] - else - Doc.concat [ - typ_doc; - Doc.text " => "; - return_doc; - ] - ) - ] - ) - | args -> - let attrs = match attrs with - | [] -> Doc.nil - | attrs -> Doc.concat [ - Doc.join ~sep:Doc.line (List.map print_attribute attrs); - Doc.space; - ] - in - let rendered_args = Doc.concat [ - attrs; - Doc.text "("; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - if is_uncurried then Doc.concat [Doc.dot; Doc.space] else Doc.nil; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) ( - List.map (fun tp -> print_type_parameter tp cmt_tbl) args - ) - ] - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.text ")"; - ] in - Doc.group ( - Doc.concat [ - rendered_args; - Doc.text " => "; - return_doc; - ] - ) - end - | Ptyp_tuple types -> print_tuple_type ~inline:false types cmt_tbl - | Ptyp_object (fields, open_flag) -> - print_bs_object_sugar ~inline:false fields open_flag cmt_tbl - | Ptyp_poly([], typ) -> - print_typ_expr typ cmt_tbl - | Ptyp_poly(string_locs, typ) -> - Doc.concat [ - Doc.join ~sep:Doc.space (List.map (fun {Location.txt; loc} -> - let doc = Doc.concat [Doc.text "'"; Doc.text txt] in - print_comments doc cmt_tbl loc - ) string_locs); - Doc.dot; - Doc.space; - print_typ_expr typ cmt_tbl - ] - | Ptyp_package package_type -> - print_package_type ~print_module_keyword_and_parens:true package_type cmt_tbl - | Ptyp_class _ -> - Doc.text "classes are not supported in types" - | Ptyp_variant (row_fields, closed_flag, labels_opt) -> - let print_row_field = function - | Parsetree.Rtag ({txt}, attrs, true, []) -> - Doc.concat [ - print_attributes attrs; - Doc.concat [Doc.text "#"; print_ident_like ~allow_uident:true txt] - ] - | Rtag ({txt}, attrs, truth, types) -> - let do_type t = match t.Parsetree.ptyp_desc with - | Ptyp_tuple _ -> print_typ_expr t cmt_tbl - | _ -> Doc.concat [ Doc.lparen; print_typ_expr t cmt_tbl; Doc.rparen ] - in - let printed_types = List.map do_type types in - let cases = Doc.join ~sep:(Doc.concat [Doc.line; Doc.text "& "]) printed_types in - let cases = if truth then Doc.concat [Doc.line; Doc.text "& "; cases] else cases in - Doc.group (Doc.concat [ - print_attributes attrs; - Doc.concat [Doc.text "#"; print_ident_like ~allow_uident:true txt]; - cases - ]) - | Rinherit core_type -> - print_typ_expr core_type cmt_tbl - in - let docs = List.map print_row_field row_fields in - let cases = Doc.join ~sep:(Doc.concat [Doc.line; Doc.text "| "]) docs in - let cases = if docs = [] then cases else Doc.concat [Doc.text "| "; cases] in - let opening_symbol = - if closed_flag = Open - then Doc.greater_than - else if labels_opt = None - then Doc.nil - else Doc.less_than in - let has_labels = labels_opt <> None && labels_opt <> Some [] in - let labels = match labels_opt with - | None - | Some([]) -> - Doc.nil - | Some(labels) -> - Doc.concat (List.map (fun label -> Doc.concat [Doc.line; Doc.text "#" ; print_ident_like ~allow_uident:true label] ) labels) - in - let closing_symbol = if has_labels then Doc.text " >" else Doc.nil in - Doc.group (Doc.concat [Doc.lbracket; opening_symbol; Doc.line; cases; closing_symbol; labels; Doc.line; Doc.rbracket]) - in - let should_print_its_own_attributes = match typ_expr.ptyp_desc with - | Ptyp_arrow _ (* es6 arrow types print their own attributes *) - | Ptyp_constr({txt = Longident.Ldot(Longident.Lident "Js", "t")}, _) -> true - | _ -> false - in - let doc = begin match typ_expr.ptyp_attributes with - | _::_ as attrs when not should_print_its_own_attributes -> - Doc.group ( - Doc.concat [ - print_attributes attrs; - rendered_type; - ] - ) - | _ -> rendered_type - end - in - print_comments doc cmt_tbl typ_expr.ptyp_loc - - and print_bs_object_sugar ~inline fields open_flag cmt_tbl = - let doc = match fields with - | [] -> Doc.concat [ - Doc.lbrace; - (match open_flag with - | Asttypes.Closed -> Doc.dot - | Open -> Doc.dotdot); - Doc.rbrace - ] - | fields -> - Doc.concat [ - Doc.lbrace; - (match open_flag with - | Asttypes.Closed -> Doc.nil - | Open -> Doc.dotdot); - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) ( - List.map (fun field -> print_object_field field cmt_tbl) fields - ) - ] - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.rbrace; - ] - in - if inline then doc else Doc.group doc - - and print_tuple_type ~inline (types: Parsetree.core_type list) cmt_tbl = - let tuple = Doc.concat([ - Doc.lparen; - Doc.indent ( - Doc.concat([ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) ( - List.map (fun typexpr -> print_typ_expr typexpr cmt_tbl) types - ) - ]) - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.rparen; - ]) - in - if inline == false then Doc.group(tuple) else tuple - - and print_object_field (field : Parsetree.object_field) cmt_tbl = - match field with - | Otag (label_loc, attrs, typ) -> - let lbl = - let doc = Doc.text ("\"" ^ label_loc.txt ^ "\"") in - print_comments doc cmt_tbl label_loc.loc - in - let doc = Doc.concat [ - print_attributes ~loc:label_loc.loc attrs; - lbl; - Doc.text ": "; - print_typ_expr typ cmt_tbl; - ] in - let cmt_loc = {label_loc.loc with loc_end = typ.ptyp_loc.loc_end} in - print_comments doc cmt_tbl cmt_loc - | _ -> Doc.nil - - (* es6 arrow type arg - * type t = (~foo: string, ~bar: float=?, unit) => unit - * i.e. ~foo: string, ~bar: float *) - and print_type_parameter (attrs, lbl, typ) cmt_tbl = - let (is_uncurried, attrs) = ParsetreeViewer.process_uncurried_attribute attrs in - let uncurried = if is_uncurried then Doc.concat [Doc.dot; Doc.space] else Doc.nil in - let attrs = match attrs with - | [] -> Doc.nil - | attrs -> Doc.concat [ - Doc.join ~sep:Doc.line (List.map print_attribute attrs); - Doc.line; - ] in - let label = match lbl with - | Asttypes.Nolabel -> Doc.nil - | Labelled lbl -> Doc.concat [ - Doc.text "~"; - print_ident_like lbl; - Doc.text ": "; - ] - | Optional lbl -> Doc.concat [ - Doc.text "~"; - print_ident_like lbl; - Doc.text ": "; - ] - in - let optional_indicator = match lbl with - | Asttypes.Nolabel - | Labelled _ -> Doc.nil - | Optional _lbl -> Doc.text "=?" - in - let doc = Doc.group ( - Doc.concat [ - uncurried; - attrs; - label; - print_typ_expr typ cmt_tbl; - optional_indicator; - ] - ) in - print_comments doc cmt_tbl typ.ptyp_loc - - and print_value_binding ~rec_flag vb cmt_tbl i = - let (has_gentype, attrs) = ParsetreeViewer.split_gentype_attr vb.pvb_attributes in - let attrs = print_attributes ~loc:vb.pvb_pat.ppat_loc attrs in - let header = - if i == 0 then - Doc.concat [ - if has_gentype then Doc.text "export " else Doc.text "let "; - rec_flag - ] else - Doc.concat [ - Doc.text "and "; - if has_gentype then Doc.text "export " else Doc.nil - ] - in - match vb with - | {pvb_pat = - {ppat_desc = Ppat_constraint (pattern, {ptyp_desc = Ptyp_poly _})}; - pvb_expr = - {pexp_desc = Pexp_newtype _} as expr - } -> - let (_attrs, parameters, return_expr) = ParsetreeViewer.fun_expr expr in - let abstract_type = match parameters with - | [NewTypes {locs = vars}] -> - Doc.concat [ - Doc.text "type "; - Doc.join ~sep:Doc.space (List.map (fun var -> Doc.text var.Asttypes.txt) vars); - Doc.dot; - ] - | _ -> Doc.nil - in - begin match return_expr.pexp_desc with - | Pexp_constraint (expr, typ) -> - Doc.group ( - Doc.concat [ - attrs; - header; - print_pattern pattern cmt_tbl; - Doc.text ":"; - Doc.indent ( - Doc.concat [ - Doc.line; - abstract_type; - Doc.space; - print_typ_expr typ cmt_tbl; - Doc.text " ="; - Doc.concat [ - Doc.line; - print_expression_with_comments expr cmt_tbl; - ] - ] - ) - ] - ) - | _ -> Doc.nil - end - | _ -> - let (opt_braces, expr) = ParsetreeViewer.process_braces_attr vb.pvb_expr in - let printed_expr = - let doc = print_expression_with_comments vb.pvb_expr cmt_tbl in - match Parens.expr vb.pvb_expr with - | Parens.Parenthesized -> add_parens doc - | Braced braces -> print_braces doc expr braces - | Nothing -> doc - in - if ParsetreeViewer.is_pipe_expr vb.pvb_expr then - Doc.custom_layout [ - Doc.group ( - Doc.concat [ - attrs; - header; - print_pattern vb.pvb_pat cmt_tbl; - Doc.text " ="; - Doc.space; - printed_expr; - ] - ); - Doc.group ( - Doc.concat [ - attrs; - header; - print_pattern vb.pvb_pat cmt_tbl; - Doc.text " ="; - Doc.indent ( - Doc.concat [ - Doc.line; - printed_expr; - ] - ) - ] - ); - ] - else - let should_indent = - match opt_braces with - | Some _ -> false - | _ -> - ParsetreeViewer.is_binary_expression expr || - (match vb.pvb_expr with - | { - pexp_attributes = [({Location.txt="res.ternary"}, _)]; - pexp_desc = Pexp_ifthenelse (if_expr, _, _) - } -> - ParsetreeViewer.is_binary_expression if_expr || ParsetreeViewer.has_attributes if_expr.pexp_attributes - | { pexp_desc = Pexp_newtype _} -> false - | e -> - ParsetreeViewer.has_attributes e.pexp_attributes || - ParsetreeViewer.is_array_access e - ) - in - Doc.group ( - Doc.concat [ - attrs; - header; - print_pattern vb.pvb_pat cmt_tbl; - Doc.text " ="; - if should_indent then - Doc.indent ( - Doc.concat [ - Doc.line; - printed_expr; - ] - ) - else - Doc.concat [ - Doc.space; - printed_expr; - ] - ] - ) - - and print_package_type ~print_module_keyword_and_parens (package_type: Parsetree.package_type) cmt_tbl = - let doc = match package_type with - | (longident_loc, []) -> Doc.group( - Doc.concat [ - print_longident_location longident_loc cmt_tbl; - ] - ) - | (longident_loc, package_constraints) -> Doc.group( - Doc.concat [ - print_longident_location longident_loc cmt_tbl; - print_package_constraints package_constraints cmt_tbl; - Doc.soft_line; - ] - ) - in - if print_module_keyword_and_parens then - Doc.concat[ - Doc.text "module("; - doc; - Doc.rparen - ] - else - doc - - and print_package_constraints package_constraints cmt_tbl = - Doc.concat [ - Doc.text " with"; - Doc.indent ( - Doc.concat [ - Doc.line; - Doc.join ~sep:Doc.line ( - List.mapi (fun i pc -> - let (longident, typexpr) = pc in - let cmt_loc = {longident.Asttypes.loc with - loc_end = typexpr.Parsetree.ptyp_loc.loc_end - } in - let doc = print_package_constraint i cmt_tbl pc in - print_comments doc cmt_tbl cmt_loc - ) package_constraints - ) - ] - ) - ] - - and print_package_constraint i cmt_tbl (longident_loc, typ) = - let prefix = if i == 0 then Doc.text "type " else Doc.text "and type " in - Doc.concat [ - prefix; - print_longident_location longident_loc cmt_tbl; - Doc.text " = "; - print_typ_expr typ cmt_tbl; - ] - - and print_extension_with_comments ~at_module_lvl (string_loc, payload) cmt_tbl = - let ext_name = - let doc = Doc.concat [ - Doc.text "%"; - if at_module_lvl then Doc.text "%" else Doc.nil; - Doc.text string_loc.Location.txt; - ] in - print_comments doc cmt_tbl string_loc.Location.loc - in - match payload with - | Parsetree.PStr [{pstr_desc = Pstr_eval (expr, attrs)}] -> - let expr_doc = print_expression_with_comments expr cmt_tbl in - let needs_parens = match attrs with | [] -> false | _ -> true in - Doc.group ( - Doc.concat [ - ext_name; - add_parens ( - Doc.concat [ - print_attributes attrs; - if needs_parens then add_parens expr_doc else expr_doc; - ] - ) - ] - ) - | _ -> ext_name - - and print_pattern (p : Parsetree.pattern) cmt_tbl = - let pattern_without_attributes = match p.ppat_desc with - | Ppat_any -> Doc.text "_" - | Ppat_var var -> print_ident_like var.txt - | Ppat_constant c -> print_constant c - | Ppat_tuple patterns -> - Doc.group( - Doc.concat([ - Doc.lparen; - Doc.indent ( - Doc.concat([ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.text ","; Doc.line]) - (List.map (fun pat -> - print_pattern pat cmt_tbl) patterns) - ]) - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.rparen - ]) - ) - | Ppat_array [] -> - Doc.concat [ - Doc.lbracket; - print_comments_inside cmt_tbl p.ppat_loc; - Doc.rbracket; - ] - | Ppat_array patterns -> - Doc.group( - Doc.concat([ - Doc.text "["; - Doc.indent ( - Doc.concat([ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.text ","; Doc.line]) - (List.map (fun pat -> - print_pattern pat cmt_tbl) patterns) - ]) - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.text "]"; - ]) - ) - | Ppat_construct({txt = Longident.Lident "()"}, _) -> - Doc.concat [ - Doc.lparen; - print_comments_inside cmt_tbl p.ppat_loc; - Doc.rparen; - ] - | Ppat_construct({txt = Longident.Lident "[]"}, _) -> - Doc.concat [ - Doc.text "list["; - print_comments_inside cmt_tbl p.ppat_loc; - Doc.rbracket; - ] - | Ppat_construct({txt = Longident.Lident "::"}, _) -> - let (patterns, tail) = ParsetreeViewer.collect_patterns_from_list_construct [] p in - let should_hug = match (patterns, tail) with - | ([pat], - {ppat_desc = Ppat_construct({txt = Longident.Lident "[]"}, _)}) when ParsetreeViewer.is_huggable_pattern pat -> true - | _ -> false - in - let children = Doc.concat([ - if should_hug then Doc.nil else Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.text ","; Doc.line]) - (List.map (fun pat -> - print_pattern pat cmt_tbl) patterns); - begin match tail.Parsetree.ppat_desc with - | Ppat_construct({txt = Longident.Lident "[]"}, _) -> Doc.nil - | _ -> - let doc = Doc.concat [Doc.text "..."; print_pattern tail cmt_tbl] in - let tail = print_comments doc cmt_tbl tail.ppat_loc in - Doc.concat([Doc.text ","; Doc.line; tail]) - end; - ]) in - Doc.group( - Doc.concat([ - Doc.text "list["; - if should_hug then children else Doc.concat [ - Doc.indent children; - Doc.if_breaks (Doc.text ",") Doc.nil; - Doc.soft_line; - ]; - Doc.rbracket; - ]) - ) - | Ppat_construct(constr_name, constructor_args) -> - let constr_name = print_longident constr_name.txt in - let args_doc = match constructor_args with - | None -> Doc.nil - | Some({ppat_loc; ppat_desc = Ppat_construct ({txt = Longident.Lident "()"}, _)}) -> - Doc.concat [ - Doc.lparen; - print_comments_inside cmt_tbl ppat_loc; - Doc.rparen; - ] - | Some({ppat_desc = Ppat_tuple []; ppat_loc = loc}) -> - Doc.concat [ - Doc.lparen; - Doc.soft_line; - print_comments_inside cmt_tbl loc; - Doc.rparen; - ] - (* Some((1, 2) *) - | Some({ppat_desc = Ppat_tuple [{ppat_desc = Ppat_tuple _} as arg]}) -> - Doc.concat [ - Doc.lparen; - print_pattern arg cmt_tbl; - Doc.rparen; - ] - | Some({ppat_desc = Ppat_tuple patterns}) -> - Doc.concat [ - Doc.lparen; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) ( - List.map (fun pat -> print_pattern pat cmt_tbl) patterns - ); - ] - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.rparen; - ] - | Some(arg) -> - let arg_doc = print_pattern arg cmt_tbl in - let should_hug = ParsetreeViewer.is_huggable_pattern arg in - Doc.concat [ - Doc.lparen; - if should_hug then arg_doc - else Doc.concat [ - Doc.indent ( - Doc.concat [ - Doc.soft_line; - arg_doc; - ] - ); - Doc.trailing_comma; - Doc.soft_line; - ]; - Doc.rparen; - - ] - in - Doc.group(Doc.concat [constr_name; args_doc]) - | Ppat_variant (label, None) -> - Doc.concat [Doc.text "#"; print_ident_like ~allow_uident:true label] - | Ppat_variant (label, variant_args) -> - let variant_name = - Doc.concat [Doc.text "#"; print_ident_like ~allow_uident:true label] in - let args_doc = match variant_args with - | None -> Doc.nil - | Some({ppat_desc = Ppat_construct ({txt = Longident.Lident "()"}, _)}) -> - Doc.text "()" - | Some({ppat_desc = Ppat_tuple []; ppat_loc = loc}) -> - Doc.concat [ - Doc.lparen; - Doc.soft_line; - print_comments_inside cmt_tbl loc; - Doc.rparen; - ] - (* Some((1, 2) *) - | Some({ppat_desc = Ppat_tuple [{ppat_desc = Ppat_tuple _} as arg]}) -> - Doc.concat [ - Doc.lparen; - print_pattern arg cmt_tbl; - Doc.rparen; - ] - | Some({ppat_desc = Ppat_tuple patterns}) -> - Doc.concat [ - Doc.lparen; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) ( - List.map (fun pat -> print_pattern pat cmt_tbl) patterns - ); - ] - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.rparen; - ] - | Some(arg) -> - let arg_doc = print_pattern arg cmt_tbl in - let should_hug = ParsetreeViewer.is_huggable_pattern arg in - Doc.concat [ - Doc.lparen; - if should_hug then arg_doc - else Doc.concat [ - Doc.indent ( - Doc.concat [ - Doc.soft_line; - arg_doc; - ] - ); - Doc.trailing_comma; - Doc.soft_line; - ]; - Doc.rparen; - - ] - in - Doc.group(Doc.concat [variant_name; args_doc]) - | Ppat_type ident -> - Doc.concat [Doc.text "##"; print_ident_path ident cmt_tbl] - | Ppat_record(rows, open_flag) -> - Doc.group( - Doc.concat([ - Doc.lbrace; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.text ","; Doc.line]) - (List.map (fun row -> print_pattern_record_row row cmt_tbl) rows); - begin match open_flag with - | Open -> Doc.concat [Doc.text ","; Doc.line; Doc.text "_"] - | Closed -> Doc.nil - end; - ] - ); - Doc.if_breaks (Doc.text ",") Doc.nil; - Doc.soft_line; - Doc.rbrace; - ]) - ) - - | Ppat_exception p -> - let needs_parens = match p.ppat_desc with - | Ppat_or (_, _) | Ppat_alias (_, _) -> true - | _ -> false - in - let pat = - let p = print_pattern p cmt_tbl in - if needs_parens then - Doc.concat [Doc.text "("; p; Doc.text ")"] - else - p - in - Doc.group ( - Doc.concat [Doc.text "exception"; Doc.line; pat] - ) - | Ppat_or _ -> - (* Blue | Red | Green -> [Blue; Red; Green] *) - let or_chain = ParsetreeViewer.collect_or_pattern_chain p in - let docs = List.mapi (fun i pat -> - let pattern_doc = print_pattern pat cmt_tbl in - Doc.concat [ - if i == 0 then Doc.nil else Doc.concat [Doc.line; Doc.text "| "]; - match pat.ppat_desc with - (* (Blue | Red) | (Green | Black) | White *) - | Ppat_or _ -> add_parens pattern_doc - | _ -> pattern_doc - ] - ) or_chain in - Doc.group (Doc.concat docs) - | Ppat_extension ext -> - print_extension_with_comments ~at_module_lvl:false ext cmt_tbl - | Ppat_lazy p -> - let needs_parens = match p.ppat_desc with - | Ppat_or (_, _) | Ppat_alias (_, _) -> true - | _ -> false - in - let pat = - let p = print_pattern p cmt_tbl in - if needs_parens then - Doc.concat [Doc.text "("; p; Doc.text ")"] - else - p - in - Doc.concat [Doc.text "lazy "; pat] - | Ppat_alias (p, alias_loc) -> - let needs_parens = match p.ppat_desc with - | Ppat_or (_, _) | Ppat_alias (_, _) -> true - | _ -> false - in - let rendered_pattern = - let p = print_pattern p cmt_tbl in - if needs_parens then - Doc.concat [Doc.text "("; p; Doc.text ")"] - else - p - in - Doc.concat([ - rendered_pattern; - Doc.text " as "; - print_string_loc alias_loc cmt_tbl; - ]) - - (* Note: module(P : S) is represented as *) - (* Ppat_constraint(Ppat_unpack, Ptyp_package) *) - | Ppat_constraint ({ppat_desc = Ppat_unpack string_loc}, {ptyp_desc = Ptyp_package package_type; ptyp_loc}) -> - Doc.concat [ - Doc.text "module("; - print_comments (Doc.text string_loc.txt) cmt_tbl string_loc.loc; - Doc.text ": "; - print_comments - (print_package_type ~print_module_keyword_and_parens:false package_type cmt_tbl) - cmt_tbl - ptyp_loc; - Doc.rparen; - ] - | Ppat_constraint (pattern, typ) -> - Doc.concat [ - print_pattern pattern cmt_tbl; - Doc.text ": "; - print_typ_expr typ cmt_tbl; - ] - - (* Note: module(P : S) is represented as *) - (* Ppat_constraint(Ppat_unpack, Ptyp_package) *) - | Ppat_unpack string_loc -> - Doc.concat [ - Doc.text "module("; - print_comments (Doc.text string_loc.txt) cmt_tbl string_loc.loc; - Doc.rparen; - ] - | Ppat_interval (a, b) -> - Doc.concat [ - print_constant a; - Doc.text " .. "; - print_constant b; - ] - | Ppat_open _ -> Doc.nil - in - let doc = match p.ppat_attributes with - | [] -> pattern_without_attributes - | attrs -> - Doc.group ( - Doc.concat [ - print_attributes attrs; - pattern_without_attributes; - ] - ) - in - print_comments doc cmt_tbl p.ppat_loc - - and print_pattern_record_row row cmt_tbl = - match row with - (* punned {x}*) - | ({Location.txt=Longident.Lident ident} as longident, - {Parsetree.ppat_desc=Ppat_var {txt;_}}) when ident = txt -> - print_lident_path longident cmt_tbl - | (longident, pattern) -> - let loc_for_comments = { - longident.loc with - loc_end = pattern.Parsetree.ppat_loc.loc_end - } in - let doc = Doc.group ( - Doc.concat([ - print_lident_path longident cmt_tbl; - Doc.text ": "; - Doc.indent( - Doc.concat [ - Doc.soft_line; - print_pattern pattern cmt_tbl; - ] - ) - ]) - ) in - print_comments doc cmt_tbl loc_for_comments - - and print_expression_with_comments expr cmt_tbl = - let doc = print_expression expr cmt_tbl in - print_comments doc cmt_tbl expr.Parsetree.pexp_loc - - and print_expression (e : Parsetree.expression) cmt_tbl = - let printed_expression = match e.pexp_desc with - | Parsetree.Pexp_constant c -> print_constant c - | Pexp_construct _ when ParsetreeViewer.has_jsx_attribute e.pexp_attributes -> - print_jsx_fragment e cmt_tbl - | Pexp_construct ({txt = Longident.Lident "()"}, _) -> Doc.text "()" - | Pexp_construct ({txt = Longident.Lident "[]"}, _) -> - Doc.concat [ - Doc.text "list["; - print_comments_inside cmt_tbl e.pexp_loc; - Doc.rbracket; - ] - | Pexp_construct ({txt = Longident.Lident "::"}, _) -> - let (expressions, spread) = ParsetreeViewer.collect_list_expressions e in - let spread_doc = match spread with - | Some(expr) -> Doc.concat [ - Doc.text ","; - Doc.line; - Doc.dotdotdot; - let doc = print_expression_with_comments expr cmt_tbl in - match Parens.expr expr with - | Parens.Parenthesized -> add_parens doc - | Braced braces -> print_braces doc expr braces - | Nothing -> doc - ] - | None -> Doc.nil - in - Doc.group( - Doc.concat([ - Doc.text "list["; - Doc.indent ( - Doc.concat([ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.text ","; Doc.line]) - (List.map - (fun expr -> - let doc = print_expression_with_comments expr cmt_tbl in - match Parens.expr expr with - | Parens.Parenthesized -> add_parens doc - | Braced braces -> print_braces doc expr braces - | Nothing -> doc - ) - expressions); - spread_doc; - ]) - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.rbracket; - ]) - ) - | Pexp_construct (longident_loc, args) -> - let constr = print_longident_location longident_loc cmt_tbl in - let args = match args with - | None -> Doc.nil - | Some({pexp_desc = Pexp_construct ({txt = Longident.Lident "()"}, _)}) -> - Doc.text "()" - (* Some((1, 2)) *) - | Some({pexp_desc = Pexp_tuple [{pexp_desc = Pexp_tuple _} as arg]}) -> - Doc.concat [ - Doc.lparen; - (let doc = print_expression_with_comments arg cmt_tbl in - match Parens.expr arg with - | Parens.Parenthesized -> add_parens doc - | Braced braces -> print_braces doc arg braces - | Nothing -> doc); - Doc.rparen; - ] - | Some({pexp_desc = Pexp_tuple args }) -> - Doc.concat [ - Doc.lparen; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) ( - List.map - (fun expr -> - let doc = print_expression_with_comments expr cmt_tbl in - match Parens.expr expr with - | Parens.Parenthesized -> add_parens doc - | Braced braces -> print_braces doc expr braces - | Nothing -> doc) - args - ) - ] - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.rparen; - ] - | Some(arg) -> - let arg_doc = - let doc = print_expression_with_comments arg cmt_tbl in - match Parens.expr arg with - | Parens.Parenthesized -> add_parens doc - | Braced braces -> print_braces doc arg braces - | Nothing -> doc - in - let should_hug = ParsetreeViewer.is_huggable_expression arg in - Doc.concat [ - Doc.lparen; - if should_hug then arg_doc - else Doc.concat [ - Doc.indent ( - Doc.concat [ - Doc.soft_line; - arg_doc; - ] - ); - Doc.trailing_comma; - Doc.soft_line; - ]; - Doc.rparen; - ] - in - Doc.group(Doc.concat [constr; args]) - | Pexp_ident path -> - print_lident_path path cmt_tbl - | Pexp_tuple exprs -> - Doc.group( - Doc.concat([ - Doc.lparen; - Doc.indent ( - Doc.concat([ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.text ","; Doc.line]) - (List.map (fun expr -> - let doc = print_expression_with_comments expr cmt_tbl in - match Parens.expr expr with - | Parens.Parenthesized -> add_parens doc - | Braced braces -> print_braces doc expr braces - | Nothing -> doc) - exprs) - ]) - ); - Doc.if_breaks (Doc.text ",") Doc.nil; - Doc.soft_line; - Doc.rparen; - ]) - ) - | Pexp_array [] -> - Doc.concat [ - Doc.lbracket; - print_comments_inside cmt_tbl e.pexp_loc; - Doc.rbracket; - ] - | Pexp_array exprs -> - Doc.group( - Doc.concat([ - Doc.lbracket; - Doc.indent ( - Doc.concat([ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.text ","; Doc.line]) - (List.map (fun expr -> - let doc = print_expression_with_comments expr cmt_tbl in - match Parens.expr expr with - | Parens.Parenthesized -> add_parens doc - | Braced braces -> print_braces doc expr braces - | Nothing -> doc - ) exprs) - ]) - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.rbracket; - ]) - ) - | Pexp_variant (label, args) -> - let variant_name = - Doc.concat [Doc.text "#"; print_ident_like ~allow_uident:true label] in - let args = match args with - | None -> Doc.nil - | Some({pexp_desc = Pexp_construct ({txt = Longident.Lident "()"}, _)}) -> - Doc.text "()" - (* #poly((1, 2) *) - | Some({pexp_desc = Pexp_tuple [{pexp_desc = Pexp_tuple _} as arg]}) -> - Doc.concat [ - Doc.lparen; - (let doc = print_expression_with_comments arg cmt_tbl in - match Parens.expr arg with - | Parens.Parenthesized -> add_parens doc - | Braced braces -> print_braces doc arg braces - | Nothing -> doc); - Doc.rparen; - ] - | Some({pexp_desc = Pexp_tuple args }) -> - Doc.concat [ - Doc.lparen; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) ( - List.map - (fun expr -> - let doc = print_expression_with_comments expr cmt_tbl in - match Parens.expr expr with - | Parens.Parenthesized -> add_parens doc - | Braced braces -> print_braces doc expr braces - | Nothing -> doc) - args - ) - ] - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.rparen; - ] - | Some(arg) -> - let arg_doc = - let doc = print_expression_with_comments arg cmt_tbl in - match Parens.expr arg with - | Parens.Parenthesized -> add_parens doc - | Braced braces -> print_braces doc arg braces - | Nothing -> doc - in - let should_hug = ParsetreeViewer.is_huggable_expression arg in - Doc.concat [ - Doc.lparen; - if should_hug then arg_doc - else Doc.concat [ - Doc.indent ( - Doc.concat [ - Doc.soft_line; - arg_doc; - ] - ); - Doc.trailing_comma; - Doc.soft_line; - ]; - Doc.rparen; - ] - in - Doc.group(Doc.concat [variant_name; args]) - | Pexp_record (rows, spread_expr) -> - let spread = match spread_expr with - | None -> Doc.nil - | Some expr -> Doc.concat [ - Doc.dotdotdot; - (let doc = print_expression_with_comments expr cmt_tbl in - match Parens.expr expr with - | Parens.Parenthesized -> add_parens doc - | Braced braces -> print_braces doc expr braces - | Nothing -> doc); - Doc.comma; - Doc.line; - ] - in - (* If the record is written over multiple lines, break automatically - * `let x = {a: 1, b: 3}` -> same line, break when line-width exceeded - * `let x = { - * a: 1, - * b: 2, - * }` -> record is written on multiple lines, break the group *) - let force_break = - e.pexp_loc.loc_start.pos_lnum < e.pexp_loc.loc_end.pos_lnum - in - Doc.breakable_group ~force_break ( - Doc.concat([ - Doc.lbrace; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - spread; - Doc.join ~sep:(Doc.concat [Doc.text ","; Doc.line]) - (List.map (fun row -> print_record_row row cmt_tbl) rows) - ] - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.rbrace; - ]) - ) - | Pexp_extension extension -> - begin match extension with - | ( - {txt = "obj"}, - PStr [{ - pstr_loc = loc; - pstr_desc = Pstr_eval({pexp_desc = Pexp_record (rows, _)}, []) - }] - ) -> - (* If the object is written over multiple lines, break automatically - * `let x = {"a": 1, "b": 3}` -> same line, break when line-width exceeded - * `let x = { - * "a": 1, - * "b": 2, - * }` -> object is written on multiple lines, break the group *) - let force_break = - loc.loc_start.pos_lnum < loc.loc_end.pos_lnum - in - Doc.breakable_group ~force_break ( - Doc.concat([ - Doc.lbrace; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.text ","; Doc.line]) - (List.map (fun row -> print_bs_object_row row cmt_tbl) rows) - ] - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.rbrace; - ]) - ) - | extension -> - print_extension_with_comments ~at_module_lvl:false extension cmt_tbl - end - | Pexp_apply _ -> - if ParsetreeViewer.is_unary_expression e then - print_unary_expression e cmt_tbl - else if ParsetreeViewer.is_template_literal e then - print_template_literal e cmt_tbl - else if ParsetreeViewer.is_binary_expression e then - print_binary_expression e cmt_tbl - else - print_pexp_apply e cmt_tbl - | Pexp_unreachable -> Doc.dot - | Pexp_field (expr, longident_loc) -> - let lhs = - let doc = print_expression_with_comments expr cmt_tbl in - match Parens.field_expr expr with - | Parens.Parenthesized -> add_parens doc - | Braced braces -> print_braces doc expr braces - | Nothing -> doc - in - Doc.concat [ - lhs; - Doc.dot; - print_lident_path longident_loc cmt_tbl; - ] - | Pexp_setfield (expr1, longident_loc, expr2) -> - print_set_field_expr e.pexp_attributes expr1 longident_loc expr2 e.pexp_loc cmt_tbl - | Pexp_ifthenelse (_ifExpr, _thenExpr, _elseExpr) -> - if ParsetreeViewer.is_ternary_expr e then - let (parts, alternate) = ParsetreeViewer.collect_ternary_parts e in - let ternary_doc = match parts with - | (condition1, consequent1)::rest -> - Doc.group (Doc.concat [ - print_ternary_operand condition1 cmt_tbl; - Doc.indent ( - Doc.concat [ - Doc.line; - Doc.indent ( - Doc.concat [ - Doc.text "? "; - print_ternary_operand consequent1 cmt_tbl - ] - ); - Doc.concat ( - List.map (fun (condition, consequent) -> - Doc.concat [ - Doc.line; - Doc.text ": "; - print_ternary_operand condition cmt_tbl; - Doc.line; - Doc.text "? "; - print_ternary_operand consequent cmt_tbl; - ] - ) rest - ); - Doc.line; - Doc.text ": "; - Doc.indent (print_ternary_operand alternate cmt_tbl); - ] - ) - ]) - | _ -> Doc.nil - in - let attrs = ParsetreeViewer.filter_ternary_attributes e.pexp_attributes in - let needs_parens = match ParsetreeViewer.filter_parsing_attrs attrs with - | [] -> false | _ -> true - in - Doc.concat [ - print_attributes attrs; - if needs_parens then add_parens ternary_doc else ternary_doc; - ] - else - let (ifs, else_expr) = ParsetreeViewer.collect_if_expressions e in - let if_docs = Doc.join ~sep:Doc.space ( - List.mapi (fun i (if_expr, then_expr) -> - let if_txt = if i > 0 then Doc.text "else if " else Doc.text "if " in - let condition = - if ParsetreeViewer.is_block_expr if_expr then - print_expression_block ~braces:true if_expr cmt_tbl - else - let doc = print_expression_with_comments if_expr cmt_tbl in - match Parens.expr if_expr with - | Parens.Parenthesized -> add_parens doc - | Braced braces -> print_braces doc if_expr braces - | Nothing -> Doc.if_breaks (add_parens doc) doc - in - Doc.concat [ - if_txt; - Doc.group (condition); - Doc.space; - let then_expr = match ParsetreeViewer.process_braces_attr then_expr with - (* This case only happens when coming from Reason, we strip braces *) - | (Some _, expr) -> expr - | _ -> then_expr - in - print_expression_block ~braces:true then_expr cmt_tbl; - ] - ) ifs - ) in - let else_doc = match else_expr with - | None -> Doc.nil - | Some expr -> Doc.concat [ - Doc.text " else "; - print_expression_block ~braces:true expr cmt_tbl; - ] - in - Doc.concat [ - print_attributes e.pexp_attributes; - if_docs; - else_doc; - ] - | Pexp_while (expr1, expr2) -> - let condition = - let doc = print_expression_with_comments expr1 cmt_tbl in - match Parens.expr expr1 with - | Parens.Parenthesized -> add_parens doc - | Braced braces -> print_braces doc expr1 braces - | Nothing -> doc - in - Doc.breakable_group ~force_break:true ( - Doc.concat [ - Doc.text "while "; - if ParsetreeViewer.is_block_expr expr1 then - condition - else - Doc.group ( - Doc.if_breaks (add_parens condition) condition - ); - Doc.space; - print_expression_block ~braces:true expr2 cmt_tbl; - ] - ) - | Pexp_for (pattern, from_expr, to_expr, direction_flag, body) -> - Doc.breakable_group ~force_break:true ( - Doc.concat [ - Doc.text "for "; - print_pattern pattern cmt_tbl; - Doc.text " in "; - (let doc = print_expression_with_comments from_expr cmt_tbl in - match Parens.expr from_expr with - | Parens.Parenthesized -> add_parens doc - | Braced braces -> print_braces doc from_expr braces - | Nothing -> doc); - print_direction_flag direction_flag; - (let doc = print_expression_with_comments to_expr cmt_tbl in - match Parens.expr to_expr with - | Parens.Parenthesized -> add_parens doc - | Braced braces -> print_braces doc to_expr braces - | Nothing -> doc); - Doc.space; - print_expression_block ~braces:true body cmt_tbl; - ] - ) - | Pexp_constraint( - {pexp_desc = Pexp_pack mod_expr}, - {ptyp_desc = Ptyp_package package_type; ptyp_loc} - ) -> - Doc.group ( - Doc.concat [ - Doc.text "module("; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - print_mod_expr mod_expr cmt_tbl; - Doc.text ": "; - print_comments - (print_package_type ~print_module_keyword_and_parens:false package_type cmt_tbl) - cmt_tbl - ptyp_loc - ] - ); - Doc.soft_line; - Doc.rparen; - ] - ) - - | Pexp_constraint (expr, typ) -> - let expr_doc = - let doc = print_expression_with_comments expr cmt_tbl in - match Parens.expr expr with - | Parens.Parenthesized -> add_parens doc - | Braced braces -> print_braces doc expr braces - | Nothing -> doc - in - Doc.concat [ - expr_doc; - Doc.text ": "; - print_typ_expr typ cmt_tbl; - ] - | Pexp_letmodule ({txt = _modName}, _modExpr, _expr) -> - print_expression_block ~braces:true e cmt_tbl - | Pexp_letexception (_extensionConstructor, _expr) -> - print_expression_block ~braces:true e cmt_tbl - | Pexp_assert expr -> - let rhs = - let doc = print_expression_with_comments expr cmt_tbl in - match Parens.lazy_or_assert_expr_rhs expr with - | Parens.Parenthesized -> add_parens doc - | Braced braces -> print_braces doc expr braces - | Nothing -> doc - in - Doc.concat [ - Doc.text "assert "; - rhs; - ] - | Pexp_lazy expr -> - let rhs = - let doc = print_expression_with_comments expr cmt_tbl in - match Parens.lazy_or_assert_expr_rhs expr with - | Parens.Parenthesized -> add_parens doc - | Braced braces -> print_braces doc expr braces - | Nothing -> doc - in - Doc.group ( - Doc.concat [ - Doc.text "lazy "; - rhs; - ] - ) - | Pexp_open (_overrideFlag, _longidentLoc, _expr) -> - print_expression_block ~braces:true e cmt_tbl - | Pexp_pack (mod_expr) -> - Doc.group (Doc.concat [ - Doc.text "module("; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - print_mod_expr mod_expr cmt_tbl; - ] - ); - Doc.soft_line; - Doc.rparen; - ]) - | Pexp_sequence _ -> - print_expression_block ~braces:true e cmt_tbl - | Pexp_let _ -> - print_expression_block ~braces:true e cmt_tbl - | Pexp_fun (Nolabel, None, {ppat_desc = Ppat_var {txt="__x"}}, ({pexp_desc = Pexp_apply _})) -> - - (* (__x) => f(a, __x, c) -----> f(a, _, c) *) - print_expression_with_comments (ParsetreeViewer.rewrite_underscore_apply e) cmt_tbl - | Pexp_fun _ | Pexp_newtype _ -> - let (attrs_on_arrow, parameters, return_expr) = ParsetreeViewer.fun_expr e in - let (uncurried, attrs) = - ParsetreeViewer.process_uncurried_attribute attrs_on_arrow - in - let (return_expr, typ_constraint) = match return_expr.pexp_desc with - | Pexp_constraint (expr, typ) -> ( - {expr with pexp_attributes = List.concat [ - expr.pexp_attributes; - return_expr.pexp_attributes; - ]}, - Some typ - ) - | _ -> (return_expr, None) - in - let has_constraint = match typ_constraint with | Some _ -> true | None -> false in - let parameters_doc = print_expr_fun_parameters - ~in_callback:false - ~uncurried - ~has_constraint - parameters - cmt_tbl - in - let return_expr_doc = - let (opt_braces, _) = ParsetreeViewer.process_braces_attr return_expr in - let should_inline = match (return_expr.pexp_desc, opt_braces) with - | (_, Some _ ) -> true - | ((Pexp_array _ - | Pexp_tuple _ - | Pexp_construct (_, Some _) - | Pexp_record _), _) -> true - | _ -> false - in - let should_indent = match return_expr.pexp_desc with - | Pexp_sequence _ - | Pexp_let _ - | Pexp_letmodule _ - | Pexp_letexception _ - | Pexp_open _ -> false - | _ -> true - in - let return_doc = - let doc = print_expression_with_comments return_expr cmt_tbl in - match Parens.expr return_expr with - | Parens.Parenthesized -> add_parens doc - | Braced braces -> print_braces doc return_expr braces - | Nothing -> doc - in - if should_inline then Doc.concat [ - Doc.space; - return_doc; - ] else - Doc.group ( - if should_indent then - Doc.indent ( - Doc.concat [ - Doc.line; - return_doc; - ] - ) - else - Doc.concat [ - Doc.space; - return_doc - ] - ) - in - let typ_constraint_doc = match typ_constraint with - | Some(typ) -> Doc.concat [Doc.text ": "; print_typ_expr typ cmt_tbl] - | _ -> Doc.nil - in - let attrs = print_attributes attrs in - Doc.group ( - Doc.concat [ - attrs; - parameters_doc; - typ_constraint_doc; - Doc.text " =>"; - return_expr_doc; - ] - ) - | Pexp_try (expr, cases) -> - let expr_doc = - let doc = print_expression_with_comments expr cmt_tbl in - match Parens.expr expr with - | Parens.Parenthesized -> add_parens doc - | Braced braces -> print_braces doc expr braces - | Nothing -> doc - in - Doc.concat [ - Doc.text "try "; - expr_doc; - Doc.text " catch "; - print_cases cases cmt_tbl; - ] - | Pexp_match (expr, cases) -> - let expr_doc = - let doc = print_expression_with_comments expr cmt_tbl in - match Parens.expr expr with - | Parens.Parenthesized -> add_parens doc - | Braced braces -> print_braces doc expr braces - | Nothing -> doc - in - Doc.concat [ - Doc.text "switch "; - expr_doc; - Doc.space; - print_cases cases cmt_tbl; - ] - | Pexp_function cases -> - Doc.concat [ - Doc.text "x => switch x "; - print_cases cases cmt_tbl; - ] - | Pexp_coerce (expr, typ_opt, typ) -> - let doc_expr = print_expression_with_comments expr cmt_tbl in - let doc_typ = print_typ_expr typ cmt_tbl in - let of_type = match typ_opt with - | None -> Doc.nil - | Some(typ1) -> - Doc.concat [Doc.text ": "; print_typ_expr typ1 cmt_tbl] - in - Doc.concat [Doc.lparen; doc_expr; of_type; Doc.text " :> "; doc_typ; Doc.rparen] - | Pexp_send _ -> - Doc.text "Pexp_send not implemented in printer" - | Pexp_new _ -> - Doc.text "Pexp_new not implemented in printer" - | Pexp_setinstvar _ -> - Doc.text "Pexp_setinstvar not implemented in printer" - | Pexp_override _ -> - Doc.text "Pexp_override not implemented in printer" - | Pexp_poly _ -> - Doc.text "Pexp_poly not implemented in printer" - | Pexp_object _ -> - Doc.text "Pexp_object not implemented in printer" - in - let should_print_its_own_attributes = match e.pexp_desc with - | Pexp_apply _ - | Pexp_fun _ - | Pexp_newtype _ - | Pexp_setfield _ - | Pexp_ifthenelse _ -> true - | Pexp_construct _ when ParsetreeViewer.has_jsx_attribute e.pexp_attributes -> true - | _ -> false - in - match e.pexp_attributes with - | [] -> printed_expression - | attrs when not should_print_its_own_attributes -> - Doc.group ( - Doc.concat [ - print_attributes attrs; - printed_expression; - ] - ) - | _ -> printed_expression - - and print_pexp_fun ~in_callback e cmt_tbl = - let (attrs_on_arrow, parameters, return_expr) = ParsetreeViewer.fun_expr e in - let (uncurried, attrs) = - ParsetreeViewer.process_uncurried_attribute attrs_on_arrow - in - let (return_expr, typ_constraint) = match return_expr.pexp_desc with - | Pexp_constraint (expr, typ) -> ( - {expr with pexp_attributes = List.concat [ - expr.pexp_attributes; - return_expr.pexp_attributes; - ]}, - Some typ - ) - | _ -> (return_expr, None) - in - let parameters_doc = print_expr_fun_parameters - ~in_callback - ~uncurried - ~has_constraint:(match typ_constraint with | Some _ -> true | None -> false) - parameters cmt_tbl in - let return_should_indent = match return_expr.pexp_desc with - | Pexp_sequence _ | Pexp_let _ | Pexp_letmodule _ | Pexp_letexception _ | Pexp_open _ -> false - | _ -> true - in - let return_expr_doc = - let (opt_braces, _) = ParsetreeViewer.process_braces_attr return_expr in - let should_inline = match (return_expr.pexp_desc, opt_braces) with - | (_, Some _) -> true - | ((Pexp_array _ - | Pexp_tuple _ - | Pexp_construct (_, Some _) - | Pexp_record _), _) -> true - | _ -> false - in - let return_doc = - let doc = print_expression_with_comments return_expr cmt_tbl in - match Parens.expr return_expr with - | Parens.Parenthesized -> add_parens doc - | Braced braces -> print_braces doc return_expr braces - | Nothing -> doc - in - if should_inline then Doc.concat [ - Doc.space; - return_doc; - ] else - Doc.group ( - if return_should_indent then - Doc.concat [ - Doc.indent ( - Doc.concat [ - Doc.line; - return_doc; - ] - ); - if in_callback then Doc.soft_line else Doc.nil; - ] - else - Doc.concat [ - Doc.space; - return_doc; - ] - ) - in - let typ_constraint_doc = match typ_constraint with - | Some(typ) -> Doc.concat [ - Doc.text ": "; - print_typ_expr typ cmt_tbl - ] - | _ -> Doc.nil - in - Doc.group ( - Doc.concat [ - print_attributes attrs; - parameters_doc; - typ_constraint_doc; - Doc.text " =>"; - return_expr_doc; - ] - ) - - and print_ternary_operand expr cmt_tbl = - let doc = print_expression_with_comments expr cmt_tbl in - match Parens.ternary_operand expr with - | Parens.Parenthesized -> add_parens doc - | Braced braces -> print_braces doc expr braces - | Nothing -> doc - - and print_set_field_expr attrs lhs longident_loc rhs loc cmt_tbl = - let rhs_doc = - let doc = print_expression_with_comments rhs cmt_tbl in - match Parens.set_field_expr_rhs rhs with - | Parens.Parenthesized -> add_parens doc - | Braced braces -> print_braces doc rhs braces - | Nothing -> doc - in - let lhs_doc = - let doc = print_expression_with_comments lhs cmt_tbl in - match Parens.field_expr lhs with - | Parens.Parenthesized -> add_parens doc - | Braced braces -> print_braces doc lhs braces - | Nothing -> doc - in - let should_indent = ParsetreeViewer.is_binary_expression rhs in - let doc = Doc.group (Doc.concat [ - lhs_doc; - Doc.dot; - print_lident_path longident_loc cmt_tbl; - Doc.text " ="; - if should_indent then Doc.group ( - Doc.indent ( - (Doc.concat [Doc.line; rhs_doc]) - ) - ) else - Doc.concat [Doc.space; rhs_doc] - ]) in - let doc = match attrs with - | [] -> doc - | attrs -> - Doc.group ( - Doc.concat [ - print_attributes attrs; - doc - ] - ) - in - print_comments doc cmt_tbl loc - - and print_template_literal expr cmt_tbl = - let tag = ref "j" in - let rec walk_expr expr = - let open Parsetree in - match expr.pexp_desc with - | Pexp_apply ( - {pexp_desc = Pexp_ident {txt = Longident.Lident "^"}}, - [Nolabel, arg1; Nolabel, arg2] - ) -> - let lhs = walk_expr arg1 in - let rhs = walk_expr arg2 in - Doc.concat [lhs; rhs] - | Pexp_constant (Pconst_string (txt, Some prefix)) -> - tag := prefix; - Doc.text txt - | _ -> - let doc = print_expression_with_comments expr cmt_tbl in - Doc.concat [Doc.text "${"; doc; Doc.rbrace] - in - let content = walk_expr expr in - Doc.concat [ - if !tag = "j" then Doc.nil else Doc.text !tag; - Doc.text "`"; - content; - Doc.text "`" - ] - - and print_unary_expression expr cmt_tbl = - let print_unary_operator op = Doc.text ( - match op with - | "~+" -> "+" - | "~+." -> "+." - | "~-" -> "-" - | "~-." -> "-." - | "not" -> "!" - | _ -> assert false - ) in - match expr.pexp_desc with - | Pexp_apply ( - {pexp_desc = Pexp_ident {txt = Longident.Lident operator}}, - [Nolabel, operand] - ) -> - let printed_operand = - let doc = print_expression_with_comments operand cmt_tbl in - match Parens.unary_expr_operand operand with - | Parens.Parenthesized -> add_parens doc - | Braced braces -> print_braces doc operand braces - | Nothing -> doc - in - let doc = Doc.concat [ - print_unary_operator operator; - printed_operand; - ] in - print_comments doc cmt_tbl expr.pexp_loc - | _ -> assert false - - and print_binary_expression (expr : Parsetree.expression) cmt_tbl = - let print_binary_operator ~inline_rhs operator = - let operator_txt = match operator with - | "|." -> "->" - | "^" -> "++" - | "=" -> "==" - | "==" -> "===" - | "<>" -> "!=" - | "!=" -> "!==" - | txt -> txt - in - let spacing_before_operator = - if operator = "|." then Doc.soft_line - else if operator = "|>" then Doc.line - else Doc.space; - in - let spacing_after_operator = - if operator = "|." then Doc.nil - else if operator = "|>" then Doc.space - else if inline_rhs then Doc.space else Doc.line - in - Doc.concat [ - spacing_before_operator; - Doc.text operator_txt; - spacing_after_operator; - ] - in - let print_operand ~is_lhs expr parent_operator = - let rec flatten ~is_lhs expr parent_operator = - if ParsetreeViewer.is_binary_expression expr then - begin match expr with - | {pexp_desc = Pexp_apply ( - {pexp_desc = Pexp_ident {txt = Longident.Lident operator}}, - [_, left; _, right] - )} -> - if ParsetreeViewer.flattenable_operators parent_operator operator && - not (ParsetreeViewer.has_attributes expr.pexp_attributes) - then - let left_printed = flatten ~is_lhs:true left operator in - let right_printed = - let (_, right_attrs) = - ParsetreeViewer.partition_printeable_attributes right.pexp_attributes - in - let doc = - print_expression_with_comments - {right with pexp_attributes = right_attrs} - cmt_tbl - in - let doc = if Parens.flatten_operand_rhs parent_operator right then - Doc.concat [Doc.lparen; doc; Doc.rparen] - else - doc - in - let printeable_attrs = - ParsetreeViewer.filter_printeable_attributes right.pexp_attributes - in - Doc.concat [print_attributes printeable_attrs; doc] - in - let doc = Doc.concat [ - left_printed; - print_binary_operator ~inline_rhs:false operator; - right_printed; - ] in - let doc = - if not is_lhs && (Parens.rhs_binary_expr_operand operator expr) then - Doc.concat [Doc.lparen; doc; Doc.rparen] - else doc - in - print_comments doc cmt_tbl expr.pexp_loc - else ( - let doc = print_expression_with_comments {expr with pexp_attributes = []} cmt_tbl in - let doc = if Parens.sub_binary_expr_operand parent_operator operator || - (expr.pexp_attributes <> [] && - (ParsetreeViewer.is_binary_expression expr || - ParsetreeViewer.is_ternary_expr expr)) - then - Doc.concat [Doc.lparen; doc; Doc.rparen] - else doc - in Doc.concat [ - print_attributes expr.pexp_attributes; - doc - ] - ) - | _ -> assert false - end - else - begin match expr.pexp_desc with - | Pexp_setfield (lhs, field, rhs) -> - let doc = print_set_field_expr expr.pexp_attributes lhs field rhs expr.pexp_loc cmt_tbl in - if is_lhs then add_parens doc else doc - | Pexp_apply( - {pexp_desc = Pexp_ident {txt = Longident.Lident "#="}}, - [(Nolabel, lhs); (Nolabel, rhs)] - ) -> - let rhs_doc = print_expression_with_comments rhs cmt_tbl in - let lhs_doc = print_expression_with_comments lhs cmt_tbl in - (* TODO: unify indentation of "=" *) - let should_indent = ParsetreeViewer.is_binary_expression rhs in - let doc = Doc.group ( - Doc.concat [ - lhs_doc; - Doc.text " ="; - if should_indent then Doc.group ( - Doc.indent (Doc.concat [Doc.line; rhs_doc]) - ) else - Doc.concat [Doc.space; rhs_doc] - ] - ) in - let doc = match expr.pexp_attributes with - | [] -> doc - | attrs -> - Doc.group ( - Doc.concat [ - print_attributes attrs; - doc - ] - ) - in - if is_lhs then add_parens doc else doc - | _ -> - let doc = print_expression_with_comments expr cmt_tbl in - begin match Parens.binary_expr_operand ~is_lhs expr with - | Parens.Parenthesized -> add_parens doc - | Braced braces -> print_braces doc expr braces - | Nothing -> doc - end - end - in - flatten ~is_lhs expr parent_operator - in - match expr.pexp_desc with - | Pexp_apply ( - {pexp_desc = Pexp_ident {txt = Longident.Lident (("|." | "|>") as op)}}, - [Nolabel, lhs; Nolabel, rhs] - ) when not ( - ParsetreeViewer.is_binary_expression lhs || - ParsetreeViewer.is_binary_expression rhs - ) -> - let lhs_doc = print_operand ~is_lhs:true lhs op in - let rhs_doc = print_operand ~is_lhs:false rhs op in - Doc.group ( - Doc.concat [ - lhs_doc; - (match op with - | "|." -> Doc.text "->" - | "|>" -> Doc.text " |> " - | _ -> assert false); - rhs_doc; - ] - ) - | Pexp_apply ( - {pexp_desc = Pexp_ident {txt = Longident.Lident operator}}, - [Nolabel, lhs; Nolabel, rhs] - ) -> - let right = - let operator_with_rhs = - let rhs_doc = print_operand ~is_lhs:false rhs operator in - Doc.concat [ - print_binary_operator - ~inline_rhs:(ParsetreeViewer.should_inline_rhs_binary_expr rhs) operator; - rhs_doc; - ] in - if ParsetreeViewer.should_indent_binary_expr expr then - Doc.group (Doc.indent operator_with_rhs) - else operator_with_rhs - in - let doc = Doc.group ( - Doc.concat [ - print_operand ~is_lhs:true lhs operator; - right - ] - ) in - Doc.group ( - Doc.concat [ - print_attributes expr.pexp_attributes; - match Parens.binary_expr {expr with - pexp_attributes = List.filter (fun attr -> - match attr with - | ({Location.txt = ("res.braces")}, _) -> false - | _ -> true - ) expr.pexp_attributes - } with - | Braced(braces_loc) -> print_braces doc expr braces_loc - | Parenthesized -> add_parens doc - | Nothing -> doc; - ] - ) - | _ -> Doc.nil - - (* callExpr(arg1, arg2) *) - and print_pexp_apply expr cmt_tbl = - match expr.pexp_desc with - | Pexp_apply ( - {pexp_desc = Pexp_ident {txt = Longident.Lident "##"}}, - [Nolabel, parent_expr; Nolabel, member_expr] - ) -> - let parent_doc = - let doc = print_expression_with_comments parent_expr cmt_tbl in - match Parens.unary_expr_operand parent_expr with - | Parens.Parenthesized -> add_parens doc - | Braced braces -> print_braces doc parent_expr braces - | Nothing -> doc - in - let member = - let member_doc = match member_expr.pexp_desc with - | Pexp_ident lident -> - print_comments (print_longident lident.txt) cmt_tbl member_expr.pexp_loc - | _ -> print_expression_with_comments member_expr cmt_tbl - in - Doc.concat [Doc.text "\""; member_doc; Doc.text "\""] - in - Doc.group (Doc.concat [ - print_attributes expr.pexp_attributes; - parent_doc; - Doc.lbracket; - member; - Doc.rbracket; - ]) - | Pexp_apply ( - {pexp_desc = Pexp_ident {txt = Longident.Lident "#="}}, - [Nolabel, lhs; Nolabel, rhs] - ) -> - let rhs_doc = - let doc = print_expression_with_comments rhs cmt_tbl in - match Parens.expr rhs with - | Parens.Parenthesized -> add_parens doc - | Braced braces -> print_braces doc rhs braces - | Nothing -> doc - in - (* TODO: unify indentation of "=" *) - let should_indent = not (ParsetreeViewer.is_braced_expr rhs) && ParsetreeViewer.is_binary_expression rhs in - let doc = Doc.group( - Doc.concat [ - print_expression_with_comments lhs cmt_tbl; - Doc.text " ="; - if should_indent then Doc.group ( - Doc.indent ( - (Doc.concat [Doc.line; rhs_doc]) - ) - ) else - Doc.concat [Doc.space; rhs_doc] - ] - ) in - begin match expr.pexp_attributes with - | [] -> doc - | attrs -> - Doc.group ( - Doc.concat [ - print_attributes attrs; - doc - ] - ) - end - | Pexp_apply ( - {pexp_desc = Pexp_ident {txt = Longident.Ldot (Lident "Array", "get")}}, - [Nolabel, parent_expr; Nolabel, member_expr] - ) -> - let member = - let member_doc = - let doc = print_expression_with_comments member_expr cmt_tbl in - match Parens.expr member_expr with - | Parens.Parenthesized -> add_parens doc - | Braced braces -> print_braces doc member_expr braces - | Nothing -> doc - in - let should_inline = match member_expr.pexp_desc with - | Pexp_constant _ | Pexp_ident _ -> true - | _ -> false - in - if should_inline then member_doc else ( - Doc.concat [ - Doc.indent ( - Doc.concat [ - Doc.soft_line; - member_doc; - ] - ); - Doc.soft_line - ] - ) - in - let parent_doc = - let doc = print_expression_with_comments parent_expr cmt_tbl in - match Parens.unary_expr_operand parent_expr with - | Parens.Parenthesized -> add_parens doc - | Braced braces -> print_braces doc parent_expr braces - | Nothing -> doc - in - Doc.group (Doc.concat [ - print_attributes expr.pexp_attributes; - parent_doc; - Doc.lbracket; - member; - Doc.rbracket; - ]) - | Pexp_apply ( - {pexp_desc = Pexp_ident {txt = Longident.Ldot (Lident "Array", "set")}}, - [Nolabel, parent_expr; Nolabel, member_expr; Nolabel, target_expr] - ) -> - let member = - let member_doc = - let doc = print_expression_with_comments member_expr cmt_tbl in - match Parens.expr member_expr with - | Parens.Parenthesized -> add_parens doc - | Braced braces -> print_braces doc member_expr braces - | Nothing -> doc - in - let should_inline = match member_expr.pexp_desc with - | Pexp_constant _ | Pexp_ident _ -> true - | _ -> false - in - if should_inline then member_doc else ( - Doc.concat [ - Doc.indent ( - Doc.concat [ - Doc.soft_line; - member_doc; - ] - ); - Doc.soft_line - ] - ) - in - let should_indent_target_expr = - if ParsetreeViewer.is_braced_expr target_expr then - false - else - ParsetreeViewer.is_binary_expression target_expr || - (match target_expr with - | { - pexp_attributes = [({Location.txt="res.ternary"}, _)]; - pexp_desc = Pexp_ifthenelse (if_expr, _, _) - } -> - ParsetreeViewer.is_binary_expression if_expr || ParsetreeViewer.has_attributes if_expr.pexp_attributes - | { pexp_desc = Pexp_newtype _} -> false - | e -> - ParsetreeViewer.has_attributes e.pexp_attributes || - ParsetreeViewer.is_array_access e - ) - in - let target_expr = - let doc = print_expression_with_comments target_expr cmt_tbl in - match Parens.expr target_expr with - | Parens.Parenthesized -> add_parens doc - | Braced braces -> print_braces doc target_expr braces - | Nothing -> doc - in - let parent_doc = - let doc = print_expression_with_comments parent_expr cmt_tbl in - match Parens.unary_expr_operand parent_expr with - | Parens.Parenthesized -> add_parens doc - | Braced braces -> print_braces doc parent_expr braces - | Nothing -> doc - in - Doc.group ( - Doc.concat [ - print_attributes expr.pexp_attributes; - parent_doc; - Doc.lbracket; - member; - Doc.rbracket; - Doc.text " ="; - if should_indent_target_expr then - Doc.indent ( - Doc.concat [ - Doc.line; - target_expr; - ] - ) - else - Doc.concat [ - Doc.space; - target_expr; - ] - ] - ) - (* TODO: cleanup, are those branches even remotely performant? *) - | Pexp_apply ( - {pexp_desc = Pexp_ident lident}, - args - ) when ParsetreeViewer.is_jsx_expression expr -> - print_jsx_expression lident args cmt_tbl - | Pexp_apply (call_expr, args) -> - let args = List.map (fun (lbl, arg) -> - (lbl, ParsetreeViewer.rewrite_underscore_apply arg) - ) args - in - let (uncurried, attrs) = - ParsetreeViewer.process_uncurried_attribute expr.pexp_attributes - in - let call_expr_doc = - let doc = print_expression_with_comments call_expr cmt_tbl in - match Parens.call_expr call_expr with - | Parens.Parenthesized -> add_parens doc - | Braced braces -> print_braces doc call_expr braces - | Nothing -> doc - in - if ParsetreeViewer.requires_special_callback_printing_first_arg args then - let args_doc = - print_arguments_with_callback_in_first_position ~uncurried args cmt_tbl - in - Doc.concat [ - print_attributes attrs; - call_expr_doc; - args_doc; - ] - else if ParsetreeViewer.requires_special_callback_printing_last_arg args then - let args_doc = - print_arguments_with_callback_in_last_position ~uncurried args cmt_tbl - in - Doc.concat [ - print_attributes attrs; - call_expr_doc; - args_doc; - ] - else - let args_doc = print_arguments ~uncurried args cmt_tbl in - Doc.concat [ - print_attributes attrs; - call_expr_doc; - args_doc; - ] - | _ -> assert false - - and print_jsx_expression lident args cmt_tbl = - let name = print_jsx_name lident in - let (formatted_props, children) = print_jsx_props args cmt_tbl in - (*
*) - let is_self_closing = match children with | [] -> true | _ -> false in - Doc.group ( - Doc.concat [ - Doc.group ( - Doc.concat [ - print_comments (Doc.concat [Doc.less_than; name]) cmt_tbl lident.Asttypes.loc; - formatted_props; - if is_self_closing then Doc.concat [Doc.line; Doc.text "/>"] else Doc.nil - ] - ); - if is_self_closing then Doc.nil - else - Doc.concat [ - Doc.greater_than; - Doc.indent ( - Doc.concat [ - Doc.line; - print_jsx_children children cmt_tbl; - ] - ); - Doc.line; - Doc.text "" in - let closing = Doc.text "" in - let (children, _) = ParsetreeViewer.collect_list_expressions expr in - Doc.group ( - Doc.concat [ - opening; - begin match children with - | [] -> Doc.nil - | children -> - Doc.indent ( - Doc.concat [ - Doc.line; - print_jsx_children children cmt_tbl; - ] - ) - end; - Doc.line; - closing; - ] - ) - - and print_jsx_children (children: Parsetree.expression list) cmt_tbl = - Doc.group ( - Doc.join ~sep:Doc.line ( - List.map (fun expr -> - let expr_doc = print_expression_with_comments expr cmt_tbl in - match Parens.jsx_child_expr expr with - | Parenthesized | Braced _ -> - (* {(20: int)} make sure that we also protect the expression inside *) - add_braces (if Parens.braced_expr expr then add_parens expr_doc else expr_doc) - | Nothing -> expr_doc - ) children - ) - ) - - and print_jsx_props args cmt_tbl = - let rec loop props args = - match args with - | [] -> (Doc.nil, []) - | [ - (Asttypes.Labelled "children", children); - ( - Asttypes.Nolabel, - {Parsetree.pexp_desc = Pexp_construct ({txt = Longident.Lident "()"}, None)} - ) - ] -> - let formatted_props = Doc.indent ( - match props with - | [] -> Doc.nil - | props -> - Doc.concat [ - Doc.line; - Doc.group ( - Doc.join ~sep:Doc.line (props |> List.rev) - ) - ] - ) in - let (children, _) = ParsetreeViewer.collect_list_expressions children in - (formatted_props, children) - | arg::args -> - let prop_doc = print_jsx_prop arg cmt_tbl in - loop (prop_doc::props) args - in - loop [] args - - and print_jsx_prop arg cmt_tbl = - match arg with - | ( - (Asttypes.Labelled lbl_txt | Optional lbl_txt) as lbl, - { - Parsetree.pexp_attributes = [({Location.txt = "res.namedArgLoc"; loc = arg_loc}, _)]; - pexp_desc = Pexp_ident {txt = Longident.Lident ident} - } - ) when lbl_txt = ident (* jsx punning *) -> - begin match lbl with - | Nolabel -> Doc.nil - | Labelled _lbl -> - print_comments (print_ident_like ident) cmt_tbl arg_loc - | Optional _lbl -> - let doc = Doc.concat [ - Doc.question; - print_ident_like ident; - ] in - print_comments doc cmt_tbl arg_loc - end - | ( - (Asttypes.Labelled lbl_txt | Optional lbl_txt) as lbl, - { - Parsetree.pexp_attributes = []; - pexp_desc = Pexp_ident {txt = Longident.Lident ident} - } - ) when lbl_txt = ident (* jsx punning when printing from Reason *) -> - begin match lbl with - | Nolabel -> Doc.nil - | Labelled _lbl -> print_ident_like ident - | Optional _lbl -> Doc.concat [ - Doc.question; - print_ident_like ident; - ] - end - | (lbl, expr) -> - let (arg_loc, expr) = match expr.pexp_attributes with - | ({Location.txt = "res.namedArgLoc"; loc}, _)::attrs -> - (loc, {expr with pexp_attributes = attrs}) - | _ -> - Location.none, expr - in - let lbl_doc = match lbl with - | Asttypes.Labelled lbl -> - let lbl = print_comments (print_ident_like lbl) cmt_tbl arg_loc in - Doc.concat [lbl; Doc.equal] - | Asttypes.Optional lbl -> - let lbl = print_comments (print_ident_like lbl) cmt_tbl arg_loc in - Doc.concat [lbl; Doc.equal; Doc.question] - | Nolabel -> Doc.nil - in - let expr_doc = - let doc = print_expression expr cmt_tbl in - match Parens.jsx_prop_expr expr with - | Parenthesized | Braced(_) -> - (* {(20: int)} make sure that we also protect the expression inside *) - add_braces (if Parens.braced_expr expr then add_parens doc else doc) - | _ -> doc - in - let full_loc = {arg_loc with loc_end = expr.pexp_loc.loc_end} in - print_comments - (Doc.concat [ - lbl_doc; - expr_doc; - ]) - cmt_tbl - full_loc - - (* div -> div. - * Navabar.createElement -> Navbar - * Staff.Users.createElement -> Staff.Users *) - and print_jsx_name {txt = lident} = - let rec flatten acc lident = match lident with - | Longident.Lident txt -> txt::acc - | Ldot (lident, txt) -> - let acc = if txt = "createElement" then acc else txt::acc in - flatten acc lident - | _ -> acc - in - match lident with - | Longident.Lident txt -> Doc.text txt - | _ as lident -> - let segments = flatten [] lident in - Doc.join ~sep:Doc.dot (List.map Doc.text segments) - - and print_arguments_with_callback_in_first_position ~uncurried args cmt_tbl = - let (callback, printed_args) = match args with - | (lbl, expr)::args -> - let lbl_doc = match lbl with - | Asttypes.Nolabel -> Doc.nil - | Asttypes.Labelled txt -> - Doc.concat [ - Doc.tilde; print_ident_like txt; Doc.equal; - ] - | Asttypes.Optional txt -> - Doc.concat [ - Doc.tilde; print_ident_like txt; Doc.equal; Doc.question; - ] - in - let callback = Doc.concat [ - lbl_doc; - print_pexp_fun ~in_callback:true expr cmt_tbl - ] in - let printed_args = List.map (fun arg -> - print_argument arg cmt_tbl - ) args |> Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) - in - (callback, printed_args) - | _ -> assert false - in - (* Thing.map((arg1, arg2) => MyModuleBlah.toList(argument), foo) *) - (* Thing.map((arg1, arg2) => { - * MyModuleBlah.toList(argument) - * }, longArgumet, veryLooooongArgument) - *) - let fits_on_one_line = Doc.concat [ - if uncurried then Doc.text "(. " else Doc.lparen; - callback; - Doc.comma; - Doc.line; - printed_args; - Doc.rparen; - ] in - - (* Thing.map( - * (param1, parm2) => doStuff(param1, parm2), - * arg1, - * arg2, - * arg3, - * ) - *) - let break_all_args = print_arguments ~uncurried args cmt_tbl in - Doc.custom_layout [ - fits_on_one_line; - break_all_args; - ] - - and print_arguments_with_callback_in_last_position ~uncurried args cmt_tbl = - let rec loop acc args = match args with - | [] -> (Doc.nil, Doc.nil) - | [lbl, expr] -> - let lbl_doc = match lbl with - | Asttypes.Nolabel -> Doc.nil - | Asttypes.Labelled txt -> - Doc.concat [ - Doc.tilde; print_ident_like txt; Doc.equal; - ] - | Asttypes.Optional txt -> - Doc.concat [ - Doc.tilde; print_ident_like txt; Doc.equal; Doc.question; - ] - in - let callback = print_pexp_fun ~in_callback:true expr cmt_tbl in - (Doc.concat (List.rev acc), Doc.concat [lbl_doc; callback]) - | arg::args -> - let arg_doc = print_argument arg cmt_tbl in - loop (Doc.line::Doc.comma::arg_doc::acc) args - in - let (printed_args, callback) = loop [] args in - - (* Thing.map(foo, (arg1, arg2) => MyModuleBlah.toList(argument)) *) - let fits_on_one_line = Doc.concat [ - if uncurried then Doc.text "(." else Doc.lparen; - printed_args; - callback; - Doc.rparen; - ] in - - (* Thing.map(longArgumet, veryLooooongArgument, (arg1, arg2) => - * MyModuleBlah.toList(argument) - * ) - *) - let arugments_fit_on_one_line = - Doc.concat [ - if uncurried then Doc.text "(." else Doc.lparen; - Doc.soft_line; - printed_args; - Doc.breakable_group ~force_break:true callback; - Doc.soft_line; - Doc.rparen; - ] - in - - (* Thing.map( - * arg1, - * arg2, - * arg3, - * (param1, parm2) => doStuff(param1, parm2) - * ) - *) - let break_all_args = print_arguments ~uncurried args cmt_tbl in - Doc.custom_layout [ - fits_on_one_line; - arugments_fit_on_one_line; - break_all_args; - ] - - and print_arguments ~uncurried (args : (Asttypes.arg_label * Parsetree.expression) list) cmt_tbl = - match args with - | [Nolabel, {pexp_desc = Pexp_construct ({txt = Longident.Lident "()"}, _)}] -> - if uncurried then Doc.text "(.)" else Doc.text "()" - | [(Nolabel, arg)] when ParsetreeViewer.is_huggable_expression arg -> - let arg_doc = - let doc = print_expression_with_comments arg cmt_tbl in - match Parens.expr arg with - | Parens.Parenthesized -> add_parens doc - | Braced braces -> print_braces doc arg braces - | Nothing -> doc - in - Doc.concat [ - if uncurried then Doc.text "(." else Doc.lparen; - arg_doc; - Doc.rparen; - ] - | args -> Doc.group ( - Doc.concat [ - if uncurried then Doc.text "(." else Doc.lparen; - Doc.indent ( - Doc.concat [ - if uncurried then Doc.line else Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) ( - List.map (fun arg -> print_argument arg cmt_tbl) args - ) - ] - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.rparen; - ] - ) - -(* - * argument ::= - * | _ (* syntax sugar *) - * | expr - * | expr : type - * | ~ label-name - * | ~ label-name - * | ~ label-name ? - * | ~ label-name = expr - * | ~ label-name = _ (* syntax sugar *) - * | ~ label-name = expr : type - * | ~ label-name = ? expr - * | ~ label-name = ? _ (* syntax sugar *) - * | ~ label-name = ? expr : type *) - and print_argument (arg_lbl, arg) cmt_tbl = - match (arg_lbl, arg) with - (* ~a (punned)*) - | ( - (Asttypes.Labelled lbl), - ({pexp_desc=Pexp_ident {txt = Longident.Lident name}; - pexp_attributes = ([] | [({Location.txt = "res.namedArgLoc";}, _)]) - } as arg_expr) - ) when lbl = name && not (ParsetreeViewer.is_braced_expr arg_expr) -> - let loc = match arg.pexp_attributes with - | ({Location.txt = "res.namedArgLoc"; loc}, _)::_ -> loc - | _ -> arg.pexp_loc - in - let doc = Doc.concat [ - Doc.tilde; - print_ident_like lbl - ] in - print_comments doc cmt_tbl loc - - (* ~a: int (punned)*) - | ( - (Asttypes.Labelled lbl), - {pexp_desc = Pexp_constraint ( - {pexp_desc = Pexp_ident {txt = Longident.Lident name}} as arg_expr, - typ - ); - pexp_loc; - pexp_attributes = ([] | [({Location.txt = "res.namedArgLoc";}, _)]) as attrs - } - ) when lbl = name && not (ParsetreeViewer.is_braced_expr arg_expr) -> - let loc = match attrs with - | ({Location.txt = "res.namedArgLoc"; loc}, _)::_ -> - {loc with loc_end = pexp_loc.loc_end} - | _ -> arg.pexp_loc - in - let doc = Doc.concat [ - Doc.tilde; - print_ident_like lbl; - Doc.text ": "; - print_typ_expr typ cmt_tbl; - ] in - print_comments doc cmt_tbl loc - (* ~a? (optional lbl punned)*) - | ( - (Asttypes.Optional lbl), - {pexp_desc=Pexp_ident {txt = Longident.Lident name}; - pexp_attributes = ([] | [({Location.txt = "res.namedArgLoc";}, _)]) - } - ) when lbl = name -> - let loc = match arg.pexp_attributes with - | ({Location.txt = "res.namedArgLoc"; loc}, _)::_ -> loc - | _ -> arg.pexp_loc - in - let doc = Doc.concat [ - Doc.tilde; - print_ident_like lbl; - Doc.question; - ] in - print_comments doc cmt_tbl loc - | (_lbl, expr) -> - let (arg_loc, expr) = match expr.pexp_attributes with - | ({Location.txt = "res.namedArgLoc"; loc}, _)::attrs -> - (loc, {expr with pexp_attributes = attrs}) - | _ -> - expr.pexp_loc, expr - in - let printed_lbl = match arg_lbl with - | Asttypes.Nolabel -> Doc.nil - | Asttypes.Labelled lbl -> - let doc = Doc.concat [Doc.tilde; print_ident_like lbl; Doc.equal] in - print_comments doc cmt_tbl arg_loc - | Asttypes.Optional lbl -> - let doc = Doc.concat [Doc.tilde; print_ident_like lbl; Doc.equal; Doc.question] in - print_comments doc cmt_tbl arg_loc - in - let printed_expr = - let doc = print_expression_with_comments expr cmt_tbl in - match Parens.expr expr with - | Parens.Parenthesized -> add_parens doc - | Braced braces -> print_braces doc expr braces - | Nothing -> doc - in - let loc = {arg_loc with loc_end = expr.pexp_loc.loc_end} in - let doc = Doc.concat [ - printed_lbl; - printed_expr; - ] in - print_comments doc cmt_tbl loc - - and print_cases (cases: Parsetree.case list) cmt_tbl = - Doc.breakable_group ~force_break:true ( - Doc.concat [ - Doc.lbrace; - Doc.concat [ - Doc.line; - print_list - ~get_loc:(fun n -> {n.Parsetree.pc_lhs.ppat_loc with - loc_end = - match ParsetreeViewer.process_braces_attr n.Parsetree.pc_rhs with - | (None, _) -> n.pc_rhs.pexp_loc.loc_end - | (Some ({loc}, _), _) -> loc.Location.loc_end - }) - ~print:print_case - ~nodes:cases - cmt_tbl - ]; - Doc.line; - Doc.rbrace; - ] - ) - - and print_case (case: Parsetree.case) cmt_tbl = - let rhs = match case.pc_rhs.pexp_desc with - | Pexp_let _ - | Pexp_letmodule _ - | Pexp_letexception _ - | Pexp_open _ - | Pexp_sequence _ -> - print_expression_block ~braces:(ParsetreeViewer.is_braced_expr case.pc_rhs) case.pc_rhs cmt_tbl - | _ -> - let doc = print_expression_with_comments case.pc_rhs cmt_tbl in - begin match Parens.expr case.pc_rhs with - | Parenthesized -> add_parens doc - | _ -> doc - end - - in - let guard = match case.pc_guard with - | None -> Doc.nil - | Some expr -> Doc.group ( - Doc.concat [ - Doc.line; - Doc.text "when "; - print_expression_with_comments expr cmt_tbl; - ] - ) - in - let should_inline_rhs = match case.pc_rhs.pexp_desc with - | Pexp_construct ({txt = Longident.Lident ("()" | "true" | "false")}, _) - | Pexp_constant _ - | Pexp_ident _ -> true - | _ when ParsetreeViewer.is_huggable_rhs case.pc_rhs -> true - | _ -> false - in - let should_indent_pattern = match case.pc_lhs.ppat_desc with - | Ppat_or _ -> false - | _ -> true - in - let pattern_doc = - let doc = print_pattern case.pc_lhs cmt_tbl in - match case.pc_lhs.ppat_desc with - | Ppat_constraint _ -> add_parens doc - | _ -> doc - in - let content = Doc.concat [ - if should_indent_pattern then Doc.indent pattern_doc else pattern_doc; - Doc.indent guard; - Doc.text " =>"; - Doc.indent ( - Doc.concat [ - if should_inline_rhs then Doc.space else Doc.line; - rhs; - ] - ) - ] in - Doc.group ( - Doc.concat [ - Doc.text "| "; - content; - ] - ) - - and print_expr_fun_parameters ~in_callback ~uncurried ~has_constraint parameters cmt_tbl = - match parameters with - (* let f = _ => () *) - | [ParsetreeViewer.Parameter { - attrs = []; - lbl = Asttypes.Nolabel; - default_expr = None; - pat = {Parsetree.ppat_desc = Ppat_any} - }] when not uncurried -> - if has_constraint then Doc.text "(_)" else Doc.text "_" - (* let f = a => () *) - | [ParsetreeViewer.Parameter { - attrs = []; - lbl = Asttypes.Nolabel; - default_expr = None; - pat = {Parsetree.ppat_desc = Ppat_var string_loc} - }] when not uncurried -> - let txt_doc = - let var = print_ident_like string_loc.txt in - if has_constraint then add_parens var else var - in - print_comments txt_doc cmt_tbl string_loc.loc - (* let f = () => () *) - | [ParsetreeViewer.Parameter { - attrs = []; - lbl = Asttypes.Nolabel; - default_expr = None; - pat = {ppat_desc = Ppat_construct({txt = Longident.Lident "()"}, None)} - }] when not uncurried -> - Doc.text "()" - (* let f = (~greeting, ~from as hometown, ~x=?) => () *) - | parameters -> - let lparen = if uncurried then Doc.text "(. " else Doc.lparen in - let should_hug = ParsetreeViewer.parameters_should_hug parameters in - let printed_paramaters = Doc.concat [ - if should_hug || in_callback then Doc.nil else Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; if in_callback then Doc.space else Doc.line]) - (List.map (fun p -> print_exp_fun_parameter p cmt_tbl) parameters) - ] in - Doc.group ( - Doc.concat [ - lparen; - if should_hug || in_callback then - printed_paramaters - else Doc.indent printed_paramaters; - if should_hug || in_callback then - Doc.nil - else - Doc.concat [Doc.trailing_comma; Doc.soft_line]; - Doc.rparen; - ] - ) - - and print_exp_fun_parameter parameter cmt_tbl = - match parameter with - | ParsetreeViewer.NewTypes {attrs; locs = lbls} -> - Doc.group ( - Doc.concat [ - print_attributes attrs; - Doc.text "type "; - Doc.join ~sep:Doc.space (List.map (fun lbl -> - print_comments (print_ident_like lbl.Asttypes.txt) cmt_tbl lbl.Asttypes.loc - ) lbls) - ] - ) - | Parameter {attrs; lbl; default_expr; pat = pattern} -> - let (is_uncurried, attrs) = ParsetreeViewer.process_uncurried_attribute attrs in - let uncurried = if is_uncurried then Doc.concat [Doc.dot; Doc.space] else Doc.nil in - let attrs = print_attributes attrs in - (* =defaultValue *) - let default_expr_doc = match default_expr with - | Some expr -> Doc.concat [ - Doc.text "="; - print_expression_with_comments expr cmt_tbl - ] - | None -> Doc.nil - in - (* ~from as hometown - * ~from -> punning *) - let label_with_pattern = match (lbl, pattern) with - | (Asttypes.Nolabel, pattern) -> print_pattern pattern cmt_tbl - | ( - (Asttypes.Labelled lbl | Optional lbl), - {ppat_desc = Ppat_var string_loc; - ppat_attributes = ([] | [({Location.txt = "res.namedArgLoc";}, _)]) - } - ) when lbl = string_loc.txt -> - (* ~d *) - Doc.concat [ - Doc.text "~"; - print_ident_like lbl; - ] - | ( - (Asttypes.Labelled lbl | Optional lbl), - ({ppat_desc = Ppat_constraint ({ ppat_desc = Ppat_var { txt } }, typ); - ppat_attributes = ([] | [({Location.txt = "res.namedArgLoc";}, _)]) - }) - ) when lbl = txt -> - (* ~d: e *) - Doc.concat [ - Doc.text "~"; - print_ident_like lbl; - Doc.text ": "; - print_typ_expr typ cmt_tbl; - ] - | ((Asttypes.Labelled lbl | Optional lbl), pattern) -> - (* ~b as c *) - Doc.concat [ - Doc.text "~"; - print_ident_like lbl; - Doc.text " as "; - print_pattern pattern cmt_tbl - ] - in - let optional_label_suffix = match (lbl, default_expr) with - | (Asttypes.Optional _, None) -> Doc.text "=?" - | _ -> Doc.nil - in - let doc = Doc.group ( - Doc.concat [ - uncurried; - attrs; - label_with_pattern; - default_expr_doc; - optional_label_suffix; - ] - ) in - let cmt_loc = match default_expr with - | None -> - begin match pattern.ppat_attributes with - | ({Location.txt = "res.namedArgLoc"; loc}, _)::_ -> - {loc with loc_end = pattern.ppat_loc.loc_end} - | _ -> pattern.ppat_loc - end - | Some expr -> - let start_pos = match pattern.ppat_attributes with - | ({Location.txt = "res.namedArgLoc"; loc}, _)::_ -> - loc.loc_start - | _ -> pattern.ppat_loc.loc_start - in { - pattern.ppat_loc with - loc_start = start_pos; - loc_end = expr.pexp_loc.loc_end - } - in - print_comments doc cmt_tbl cmt_loc - - and print_expression_block ~braces expr cmt_tbl = - let rec collect_rows acc expr = match expr.Parsetree.pexp_desc with - | Parsetree.Pexp_letmodule (mod_name, mod_expr, expr2) -> - let name = - let doc = Doc.text mod_name.txt in - print_comments doc cmt_tbl mod_name.loc - in - let let_module_doc = Doc.concat [ - Doc.text "module "; - name; - Doc.text " = "; - print_mod_expr mod_expr cmt_tbl; - ] in - let loc = {expr.pexp_loc with loc_end = mod_expr.pmod_loc.loc_end} in - collect_rows ((loc, let_module_doc)::acc) expr2 - | Pexp_letexception (extension_constructor, expr2) -> - let loc = - let loc = {expr.pexp_loc with loc_end = extension_constructor.pext_loc.loc_end} in - match get_first_leading_comment cmt_tbl loc with - | None -> loc - | Some comment -> - let cmt_loc = Comment.loc comment in - {cmt_loc with loc_end = loc.loc_end} - in - let let_exception_doc = print_exception_def extension_constructor cmt_tbl in - collect_rows ((loc, let_exception_doc)::acc) expr2 - | Pexp_open (override_flag, longident_loc, expr2) -> - let open_doc = Doc.concat [ - Doc.text "open"; - print_override_flag override_flag; - Doc.space; - print_longident_location longident_loc cmt_tbl; - ] in - let loc = {expr.pexp_loc with loc_end = longident_loc.loc.loc_end} in - collect_rows ((loc, open_doc)::acc) expr2 - | Pexp_sequence (expr1, expr2) -> - let expr_doc = - let doc = print_expression expr1 cmt_tbl in - match Parens.expr expr1 with - | Parens.Parenthesized -> add_parens doc - | Braced braces -> print_braces doc expr1 braces - | Nothing -> doc - in - let loc = expr1.pexp_loc in - collect_rows ((loc, expr_doc)::acc) expr2 - | Pexp_let (rec_flag, value_bindings, expr2) -> - let loc = - let loc = match (value_bindings, List.rev value_bindings) with - | (vb::_, last_vb::_) -> {vb.pvb_loc with loc_end = last_vb.pvb_loc.loc_end} - | _ -> Location.none - in - match get_first_leading_comment cmt_tbl loc with - | None -> loc - | Some comment -> - let cmt_loc = Comment.loc comment in - {cmt_loc with loc_end = loc.loc_end} - in - let rec_flag = match rec_flag with - | Asttypes.Nonrecursive -> Doc.nil - | Asttypes.Recursive -> Doc.text "rec " - in - let let_doc = print_value_bindings ~rec_flag value_bindings cmt_tbl in - (* let () = { - * let () = foo() - * () - * } - * We don't need to print the () on the last line of the block - *) - begin match expr2.pexp_desc with - | Pexp_construct ({txt = Longident.Lident "()"}, _) -> - List.rev ((loc, let_doc)::acc) - | _ -> - collect_rows ((loc, let_doc)::acc) expr2 - end - | _ -> - let expr_doc = - let doc = print_expression expr cmt_tbl in - match Parens.expr expr with - | Parens.Parenthesized -> add_parens doc - | Braced braces -> print_braces doc expr braces - | Nothing -> doc - in - List.rev ((expr.pexp_loc, expr_doc)::acc) - in - let rows = collect_rows [] expr in - let block = - print_list - ~get_loc:fst - ~nodes:rows - ~print:(fun (_, doc) _ -> doc) - ~force_break:true - cmt_tbl - in - Doc.breakable_group ~force_break:true ( - if braces then - Doc.concat [ - Doc.lbrace; - Doc.indent ( - Doc.concat [ - Doc.line; - block; - ] - ); - Doc.line; - Doc.rbrace; - ] - else block - ) - - (* - * // user types: - * let f = (a, b) => { a + b } - * - * // printer: everything is on one line - * let f = (a, b) => { a + b } - * - * // user types: over multiple lines - * let f = (a, b) => { - * a + b - * } - * - * // printer: over multiple lines - * let f = (a, b) => { - * a + b - * } - *) - and print_braces doc expr braces_loc = - let over_multiple_lines = - let open Location in - braces_loc.loc_end.pos_lnum > braces_loc.loc_start.pos_lnum - in - match expr.Parsetree.pexp_desc with - | Pexp_letmodule _ - | Pexp_letexception _ - | Pexp_let _ - | Pexp_open _ - | Pexp_sequence _ -> - (* already has braces *) - doc - | _ -> - Doc.breakable_group ~force_break:over_multiple_lines ( - Doc.concat [ - Doc.lbrace; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - if Parens.braced_expr expr then add_parens doc else doc; - ] - ); - Doc.soft_line; - Doc.rbrace; - ] - ) - - and print_override_flag override_flag = match override_flag with - | Asttypes.Override -> Doc.text "!" - | Fresh -> Doc.nil - - and print_direction_flag flag = match flag with - | Asttypes.Downto -> Doc.text " downto " - | Asttypes.Upto -> Doc.text " to " - - and print_record_row (lbl, expr) cmt_tbl = - let cmt_loc = {lbl.loc with loc_end = expr.pexp_loc.loc_end} in - let doc = Doc.group (Doc.concat [ - print_lident_path lbl cmt_tbl; - Doc.text ": "; - (let doc = print_expression_with_comments expr cmt_tbl in - match Parens.expr expr with - | Parens.Parenthesized -> add_parens doc - | Braced braces -> print_braces doc expr braces - | Nothing -> doc); - ]) in - print_comments doc cmt_tbl cmt_loc - - and print_bs_object_row (lbl, expr) cmt_tbl = - let cmt_loc = {lbl.loc with loc_end = expr.pexp_loc.loc_end} in - let lbl_doc = - let doc = Doc.concat [ - Doc.text "\""; - print_longident lbl.txt; - Doc.text "\""; - ] in - print_comments doc cmt_tbl lbl.loc - in - let doc = Doc.concat [ - lbl_doc; - Doc.text ": "; - print_expression_with_comments expr cmt_tbl - ] in - print_comments doc cmt_tbl cmt_loc - - (* The optional loc indicates whether we need to print the attributes in - * relation to some location. In practise this means the following: - * `@attr type t = string` -> on the same line, print on the same line - * `@attr - * type t = string` -> attr is on prev line, print the attributes - * with a line break between, we respect the users' original layout *) - and print_attributes ?loc (attrs: Parsetree.attributes) = - match ParsetreeViewer.filter_parsing_attrs attrs with - | [] -> Doc.nil - | attrs -> - let line_break = match loc with - | None -> Doc.line - | Some loc -> begin match List.rev attrs with - | ({loc = first_loc}, _)::_ when loc.loc_start.pos_lnum > first_loc.loc_end.pos_lnum -> - Doc.hard_line; - | _ -> Doc.line - end - in - Doc.concat [ - Doc.group (Doc.join ~sep:Doc.line (List.map print_attribute attrs)); - line_break; - ] - - and print_attribute ((id, payload) : Parsetree.attribute) = - let attr_name = Doc.concat [ - Doc.text "@"; - Doc.text id.txt - ] in - match payload with - | PStr [{pstr_desc = Pstr_eval (expr, attrs)}] -> - let expr_doc = print_expression expr CommentTable.empty in - let needs_parens = match attrs with | [] -> false | _ -> true in - Doc.group ( - Doc.concat [ - attr_name; - add_parens ( - Doc.concat [ - print_attributes attrs; - if needs_parens then add_parens expr_doc else expr_doc; - ] - ) - ] - ) - | PTyp typ -> - Doc.group ( - Doc.concat [ - attr_name; - Doc.lparen; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.text ": "; - print_typ_expr typ CommentTable.empty; - ] - ); - Doc.soft_line; - Doc.rparen; - ] - ) - | _ -> attr_name - - and print_attribute_with_comments ((id, payload) : Parsetree.attribute) cmt_tbl = - let attr_name = Doc.text ("@" ^ id.txt) in - match payload with - | PStr [{pstr_desc = Pstr_eval (expr, attrs)}] -> - let expr_doc = print_expression_with_comments expr cmt_tbl in - let needs_parens = match attrs with | [] -> false | _ -> true in - Doc.group ( - Doc.concat [ - attr_name; - add_parens ( - Doc.concat [ - print_attributes attrs; - if needs_parens then add_parens expr_doc else expr_doc; - ] - ) - ] - ) - | _ -> attr_name - - and print_mod_expr mod_expr cmt_tbl = - let doc = match mod_expr.pmod_desc with - | Pmod_ident longident_loc -> - print_longident_location longident_loc cmt_tbl - | Pmod_structure structure -> - Doc.breakable_group ~force_break:true ( - Doc.concat [ - Doc.lbrace; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - print_structure structure cmt_tbl; - ]; - ); - Doc.soft_line; - Doc.rbrace; - ] - ) - | Pmod_unpack expr -> - let should_hug = match expr.pexp_desc with - | Pexp_let _ -> true - | Pexp_constraint ( - {pexp_desc = Pexp_let _ }, - {ptyp_desc = Ptyp_package _packageType} - ) -> true - | _ -> false - in - let (expr, module_constraint) = match expr.pexp_desc with - | Pexp_constraint ( - expr, - {ptyp_desc = Ptyp_package package_type; ptyp_loc} - ) -> - let package_doc = - let doc = print_package_type ~print_module_keyword_and_parens:false package_type cmt_tbl in - print_comments doc cmt_tbl ptyp_loc - in - let type_doc = Doc.group (Doc.concat [ - Doc.text ":"; - Doc.indent ( - Doc.concat [ - Doc.line; - package_doc - ] - ) - ]) in - (expr, type_doc) - | _ -> (expr, Doc.nil) - in - let unpack_doc = Doc.group(Doc.concat [ - print_expression_with_comments expr cmt_tbl; - module_constraint; - ]) in - Doc.group ( - Doc.concat [ - Doc.text "unpack("; - if should_hug then unpack_doc - else - Doc.concat [ - Doc.indent ( - Doc.concat [ - Doc.soft_line; - unpack_doc; - ] - ); - Doc.soft_line; - ]; - Doc.rparen; - ] - ) - | Pmod_extension extension -> - print_extension_with_comments ~at_module_lvl:false extension cmt_tbl - | Pmod_apply _ -> - let (args, call_expr) = ParsetreeViewer.mod_expr_apply mod_expr in - let is_unit_sugar = match args with - | [{pmod_desc = Pmod_structure []}] -> true - | _ -> false - in - let should_hug = match args with - | [{pmod_desc = Pmod_structure _}] -> true - | _ -> false - in - Doc.group ( - Doc.concat [ - print_mod_expr call_expr cmt_tbl; - if is_unit_sugar then - print_mod_apply_arg (List.hd args [@doesNotRaise]) cmt_tbl - else - Doc.concat [ - Doc.lparen; - if should_hug then - print_mod_apply_arg (List.hd args [@doesNotRaise]) cmt_tbl - else - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) ( - List.map (fun mod_arg -> print_mod_apply_arg mod_arg cmt_tbl) args - ) - ] - ); - if not should_hug then - Doc.concat [ - Doc.trailing_comma; - Doc.soft_line; - ] - else Doc.nil; - Doc.rparen; - ] - ] - ) - | Pmod_constraint (mod_expr, mod_type) -> - Doc.concat [ - print_mod_expr mod_expr cmt_tbl; - Doc.text ": "; - print_mod_type mod_type cmt_tbl; - ] - | Pmod_functor _ -> - print_mod_functor mod_expr cmt_tbl - in - print_comments doc cmt_tbl mod_expr.pmod_loc - - and print_mod_functor mod_expr cmt_tbl = - let (parameters, return_mod_expr) = ParsetreeViewer.mod_expr_functor mod_expr in - (* let shouldInline = match returnModExpr.pmod_desc with *) - (* | Pmod_structure _ | Pmod_ident _ -> true *) - (* | Pmod_constraint ({pmod_desc = Pmod_structure _}, _) -> true *) - (* | _ -> false *) - (* in *) - let (return_constraint, return_mod_expr) = match return_mod_expr.pmod_desc with - | Pmod_constraint (mod_expr, mod_type) -> - let constraint_doc = - let doc = print_mod_type mod_type cmt_tbl in - if Parens.mod_expr_functor_constraint mod_type then add_parens doc else doc - in - let mod_constraint = Doc.concat [ - Doc.text ": "; - constraint_doc; - ] in - (mod_constraint, print_mod_expr mod_expr cmt_tbl) - | _ -> (Doc.nil, print_mod_expr return_mod_expr cmt_tbl) - in - let parameters_doc = match parameters with - | [(attrs, {txt = "*"}, None)] -> - let attrs = match attrs with - | [] -> Doc.nil - | attrs -> Doc.concat [ - Doc.join ~sep:Doc.line (List.map print_attribute attrs); - Doc.line; - ] in - Doc.group (Doc.concat [ - attrs; - Doc.text "()" - ]) - | [([], {txt = lbl}, None)] -> Doc.text lbl - | parameters -> - Doc.group ( - Doc.concat [ - Doc.lparen; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) ( - List.map (fun param -> print_mod_functor_param param cmt_tbl) parameters - ) - ] - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.rparen; - ] - ) - in - Doc.group ( - Doc.concat [ - parameters_doc; - return_constraint; - Doc.text " => "; - return_mod_expr - ] - ) - - and print_mod_functor_param (attrs, lbl, opt_mod_type) cmt_tbl = - let cmt_loc = match opt_mod_type with - | None -> lbl.Asttypes.loc - | Some mod_type -> {lbl.loc with loc_end = - mod_type.Parsetree.pmty_loc.loc_end - } - in - let attrs = match attrs with - | [] -> Doc.nil - | attrs -> Doc.concat [ - Doc.join ~sep:Doc.line (List.map print_attribute attrs); - Doc.line; - ] in - let lbl_doc = - let doc = Doc.text lbl.txt in - print_comments doc cmt_tbl lbl.loc - in - let doc = Doc.group ( - Doc.concat [ - attrs; - lbl_doc; - (match opt_mod_type with - | None -> Doc.nil - | Some mod_type -> - Doc.concat [ - Doc.text ": "; - print_mod_type mod_type cmt_tbl - ]); - ] - ) in - print_comments doc cmt_tbl cmt_loc - - and print_mod_apply_arg mod_expr cmt_tbl = - match mod_expr.pmod_desc with - | Pmod_structure [] -> Doc.text "()" - | _ -> print_mod_expr mod_expr cmt_tbl - - - and print_exception_def (constr : Parsetree.extension_constructor) cmt_tbl = - let kind = match constr.pext_kind with - | Pext_rebind longident -> Doc.indent ( - Doc.concat [ - Doc.text " ="; - Doc.line; - print_longident_location longident cmt_tbl; - ] - ) - | Pext_decl (Pcstr_tuple [], None) -> Doc.nil - | Pext_decl (args, gadt) -> - let gadt_doc = match gadt with - | Some typ -> Doc.concat [ - Doc.text ": "; - print_typ_expr typ cmt_tbl - ] - | None -> Doc.nil - in - Doc.concat [ - print_constructor_arguments ~indent:false args cmt_tbl; - gadt_doc - ] - in - let name = - print_comments - (Doc.text constr.pext_name.txt) - cmt_tbl - constr.pext_name.loc - in - let doc = Doc.group ( - Doc.concat [ - print_attributes constr.pext_attributes; - Doc.text "exception "; - name; - kind - ] - ) in - print_comments doc cmt_tbl constr.pext_loc - - and print_extension_constructor (constr : Parsetree.extension_constructor) cmt_tbl i = - let attrs = print_attributes constr.pext_attributes in - let bar = if i > 0 then Doc.text "| " - else Doc.if_breaks (Doc.text "| ") Doc.nil - in - let kind = match constr.pext_kind with - | Pext_rebind longident -> Doc.indent ( - Doc.concat [ - Doc.text " ="; - Doc.line; - print_longident_location longident cmt_tbl; - ] - ) - | Pext_decl (Pcstr_tuple [], None) -> Doc.nil - | Pext_decl (args, gadt) -> - let gadt_doc = match gadt with - | Some typ -> Doc.concat [ - Doc.text ": "; - print_typ_expr typ cmt_tbl; - ] - | None -> Doc.nil - in - Doc.concat [ - print_constructor_arguments ~indent:false args cmt_tbl; - gadt_doc - ] - in - let name = - print_comments (Doc.text constr.pext_name.txt) cmt_tbl constr.pext_name.loc - in - Doc.concat [ - bar; - Doc.group ( - Doc.concat [ - attrs; - name; - kind; - ] - ) - ] - - let print_implementation ~width (s: Parsetree.structure) comments = - let cmt_tbl = CommentTable.make () in - CommentTable.walk_structure s cmt_tbl comments; - (* CommentTable.log cmtTbl; *) - let doc = print_structure s cmt_tbl in - (* Doc.debug doc; *) - let string_doc = Doc.to_string ~width doc in - print_string string_doc - - let print_interface ~width (s: Parsetree.signature) comments = - let cmt_tbl = CommentTable.make () in - CommentTable.walk_signature s cmt_tbl comments; - let string_doc = Doc.to_string ~width (print_signature s cmt_tbl) in - print_string string_doc - -end - -module Scanner = struct - type mode = Template | Jsx | Diamond - - type t = { - filename: string; - src: bytes; - mutable err: - start_pos: Lexing.position - -> end_pos: Lexing.position - -> Diagnostics.category - -> unit; - mutable ch: int; (* current character *) - mutable offset: int; (* character offset *) - mutable rd_offset: int; (* reading offset (position after current character) *) - mutable line_offset: int; (* current line offset *) - mutable lnum: int; (* current line number *) - mutable mode: mode list; - } - - let set_diamond_mode scanner = - scanner.mode <- Diamond::scanner.mode - - let set_template_mode scanner = - scanner.mode <- Template::scanner.mode - - let set_jsx_mode scanner = - scanner.mode <- Jsx::scanner.mode - - let pop_mode scanner mode = - match scanner.mode with - | m::ms when m = mode -> - scanner.mode <- ms - | _ -> () - - let in_diamond_mode scanner = match scanner.mode with - | Diamond::_ -> true - | _ -> false - - let in_jsx_mode scanner = match scanner.mode with - | Jsx::_ -> true - | _ -> false - - let in_template_mode scanner = match scanner.mode with - | Template::_ -> true - | _ -> false - - let position scanner = Lexing.{ - pos_fname = scanner.filename; - (* line number *) - pos_lnum = scanner.lnum; - (* offset of the beginning of the line (number - of characters between the beginning of the scanner and the beginning - of the line) *) - pos_bol = scanner.line_offset; - (* [pos_cnum] is the offset of the position (number of - characters between the beginning of the scanner and the position). *) - pos_cnum = scanner.offset; - } - - let next scanner = - if scanner.rd_offset < (Bytes.length scanner.src) then ( - scanner.offset <- scanner.rd_offset; - let ch = (Bytes.get [@doesNotRaise]) scanner.src scanner.rd_offset in - scanner.rd_offset <- scanner.rd_offset + 1; - scanner.ch <- int_of_char ch - ) else ( - scanner.offset <- Bytes.length scanner.src; - scanner.ch <- -1 - ) - - let peek scanner = - if scanner.rd_offset < (Bytes.length scanner.src) then - int_of_char (Bytes.unsafe_get scanner.src scanner.rd_offset) - else - -1 - - let make b filename = - let scanner = { - filename; - src = b; - err = (fun ~start_pos:_ ~end_pos:_ _ -> ()); - ch = CharacterCodes.space; - offset = 0; - rd_offset = 0; - line_offset = 0; - lnum = 1; - mode = []; - } in - next scanner; - scanner - - let skip_whitespace scanner = - let rec scan () = - if scanner.ch == CharacterCodes.space || scanner.ch == CharacterCodes.tab then ( - next scanner; - scan() - ) else if CharacterCodes.is_line_break scanner.ch then ( - scanner.line_offset <- scanner.offset + 1; - scanner.lnum <- scanner.lnum + 1; - next scanner; - scan() - ) else ( - () - ) - in - scan() - - let scan_identifier scanner = - let start_off = scanner.offset in - while ( - CharacterCodes.is_letter scanner.ch || - CharacterCodes.is_digit scanner.ch || - CharacterCodes.underscore == scanner.ch || - CharacterCodes.single_quote == scanner.ch - ) do - next scanner - done; - let str = Bytes.sub_string scanner.src start_off (scanner.offset - start_off) in - Token.lookup_keyword str - - let scan_digits scanner ~base = - if base <= 10 then ( - while CharacterCodes.is_digit scanner.ch || scanner.ch == CharacterCodes.underscore do - next scanner - done; - ) else ( - while CharacterCodes.is_hex scanner.ch || scanner.ch == CharacterCodes.underscore do - next scanner - done; - ) - - (* float: (0…9) { 0…9∣ _ } [. { 0…9∣ _ }] [(e∣ E) [+∣ -] (0…9) { 0…9∣ _ }] *) - let scan_number scanner = - let start_off = scanner.offset in - - (* integer part *) - let base, _prefix = if scanner.ch != CharacterCodes.dot then ( - if scanner.ch == CharacterCodes._0 then ( - next scanner; - let ch = CharacterCodes.lower scanner.ch in - if ch == CharacterCodes.Lower.x then ( - next scanner; - 16, 'x' - ) else if ch == CharacterCodes.Lower.o then ( - next scanner; - 8, 'o' - ) else if ch == CharacterCodes.Lower.b then ( - next scanner; - 2, 'b' - ) else ( - 8, '0' - ) - ) else ( - 10, ' ' - ) - ) else (10, ' ') - in - scan_digits scanner ~base; - - (* *) - let is_float = if CharacterCodes.dot == scanner.ch then ( - next scanner; - scan_digits scanner ~base; - true - ) else ( - false - ) in - - (* exponent part *) - let is_float = - if let exp = CharacterCodes.lower scanner.ch in - exp == CharacterCodes.Lower.e || exp == CharacterCodes.Lower.p - then ( - next scanner; - if scanner.ch == CharacterCodes.plus || scanner.ch == CharacterCodes.minus then - next scanner; - scan_digits scanner ~base; - true - ) else - is_float - in - let literal = - Bytes.sub_string scanner.src start_off (scanner.offset - start_off) - in - - (* suffix *) - let suffix = - if scanner.ch >= CharacterCodes.Lower.g && scanner.ch <= CharacterCodes.Lower.z - || scanner.ch >= CharacterCodes.Upper.g && scanner.ch <= CharacterCodes.Upper.z - then ( - let ch = scanner.ch in - next scanner; - Some (Char.unsafe_chr ch) - ) else - None - in - if is_float then - Token.Float {f = literal; suffix} - else - Token.Int {i = literal; suffix} - - let scan_exotic_identifier scanner = - next scanner; - let buffer = Buffer.create 20 in - let start_pos = position scanner in - - let rec scan () = - if scanner.ch == CharacterCodes.eof then - let end_pos = position scanner in - scanner.err ~start_pos ~end_pos (Diagnostics.message "Did you forget a \" here?") - else if scanner.ch == CharacterCodes.double_quote then ( - next scanner - ) else if CharacterCodes.is_line_break scanner.ch then ( - scanner.line_offset <- scanner.offset + 1; - scanner.lnum <- scanner.lnum + 1; - let end_pos = position scanner in - scanner.err ~start_pos ~end_pos (Diagnostics.message "Did you forget a \" here?"); - next scanner - ) else ( - Buffer.add_char buffer ((Char.chr [@doesNotRaise]) scanner.ch); - next scanner; - scan() - ) - in - scan(); - Token.Lident (Buffer.contents buffer) - - let scan_string_escape_sequence ~start_pos scanner = - (* \ already consumed *) - if CharacterCodes.Lower.n == scanner.ch - || CharacterCodes.Lower.t == scanner.ch - || CharacterCodes.Lower.b == scanner.ch - || CharacterCodes.Lower.r == scanner.ch - || CharacterCodes.backslash == scanner.ch - || CharacterCodes.space == scanner.ch - || CharacterCodes.single_quote == scanner.ch - || CharacterCodes.double_quote == scanner.ch - then - next scanner - else - let (n, base, max) = - if CharacterCodes.is_digit scanner.ch then - (* decimal *) - (3, 10, 255) - else if scanner.ch == CharacterCodes.Lower.o then - (* octal *) - let () = next scanner in - (3, 8, 255) - else if scanner.ch == CharacterCodes.Lower.x then - (* hex *) - let () = next scanner in - (2, 16, 255) - else - (* unknown escape sequence - * TODO: we should warn the user here. Let's not make it a hard error for now, for reason compat *) - (* let pos = position scanner in *) - (* let () = *) - (* let msg = if scanner.ch == -1 then *) - (* "unclosed escape sequence" *) - (* else "unknown escape sequence" *) - (* in *) - (* scanner.err ~startPos ~endPos:pos (Diagnostics.message msg) *) - (* in *) - (-1, -1, -1) - in - if n < 0 then () - else - let rec while_ n x = - if n == 0 then x - else - let d = CharacterCodes.digit_value scanner.ch in - if d >= base then - let pos = position scanner in - let msg = if scanner.ch == -1 then - "unclosed escape sequence" - else "unknown escape sequence" - in - scanner.err ~start_pos ~end_pos:pos (Diagnostics.message msg); - -1 - else - let () = next scanner in - while_ (n - 1) (x * base + d) - in - let x = while_ n 0 in - if x > max then - let pos = position scanner in - let msg = "invalid escape sequence (value too high)" in - scanner.err ~start_pos ~end_pos:pos (Diagnostics.message msg); - () - - let scan_string scanner = - let offs = scanner.offset in - - let start_pos = position scanner in - let rec scan () = - if scanner.ch == CharacterCodes.eof then - let end_pos = position scanner in - scanner.err ~start_pos ~end_pos Diagnostics.unclosed_string - else if scanner.ch == CharacterCodes.double_quote then ( - next scanner; - ) else if scanner.ch == CharacterCodes.backslash then ( - let start_pos = position scanner in - next scanner; - scan_string_escape_sequence ~start_pos scanner; - scan () - ) else if CharacterCodes.is_line_break scanner.ch then ( - scanner.line_offset <- scanner.offset + 1; - scanner.lnum <- scanner.lnum + 1; - next scanner; - scan () - ) else ( - next scanner; - scan () - ) - in - scan (); - Token.String (Bytes.sub_string scanner.src offs (scanner.offset - offs - 1)) - - (* I wonder if this gets inlined *) - let convert_number scanner ~n ~base = - let x = ref 0 in - for _ = n downto 1 do - let d = CharacterCodes.digit_value scanner.ch in - x := (!x * base) + d; - next scanner - done; - !x - - let scan_escape scanner = - (* let offset = scanner.offset in *) - let c = match scanner.ch with - | 98 (* b *) -> next scanner; '\008' - | 110 (* n *) -> next scanner; '\010' - | 114 (* r *) -> next scanner; '\013' - | 116 (* t *) -> next scanner; '\009' - | ch when CharacterCodes.is_digit ch -> - let x = convert_number scanner ~n:3 ~base:10 in - (Char.chr [@doesNotRaise]) x - | ch when ch == CharacterCodes.Lower.x -> - next scanner; - let x = convert_number scanner ~n:2 ~base:16 in - (Char.chr [@doesNotRaise]) x - | ch when ch == CharacterCodes.Lower.o -> - next scanner; - let x = convert_number scanner ~n:3 ~base:8 in - (Char.chr [@doesNotRaise]) x - | ch -> - next scanner; - (Char.chr [@doesNotRaise]) ch - in - next scanner; (* Consume \' *) - Token.Character c - - let scan_single_line_comment scanner = - let start_off = scanner.offset in - let start_pos = position scanner in - while not (CharacterCodes.is_line_break scanner.ch) && scanner.ch >= 0 do - next scanner - done; - let end_pos = position scanner in - Token.Comment ( - Comment.make_single_line_comment - ~loc:(Location.{loc_start = start_pos; loc_end = end_pos; loc_ghost = false}) - (Bytes.sub_string scanner.src start_off (scanner.offset - start_off)) - ) - - let scan_multi_line_comment scanner = - let start_off = scanner.offset in - let start_pos = position scanner in - let rec scan ~depth () = - if scanner.ch == CharacterCodes.asterisk && - peek scanner == CharacterCodes.forwardslash then ( - next scanner; - next scanner; - if depth > 0 then scan ~depth:(depth - 1) () else () - ) else if scanner.ch == CharacterCodes.eof then ( - let end_pos = position scanner in - scanner.err ~start_pos ~end_pos Diagnostics.unclosed_comment - ) else if scanner.ch == CharacterCodes.forwardslash - && peek scanner == CharacterCodes. asterisk then ( - next scanner; - next scanner; - scan ~depth:(depth + 1) () - ) else ( - if CharacterCodes.is_line_break scanner.ch then ( - scanner.line_offset <- scanner.offset + 1; - scanner.lnum <- scanner.lnum + 1; - ); - next scanner; - scan ~depth () - ) - in - scan ~depth:0 (); - Token.Comment ( - Comment.make_multi_line_comment - ~loc:(Location.{loc_start = start_pos; loc_end = (position scanner); loc_ghost = false}) - (Bytes.sub_string scanner.src start_off (scanner.offset - 2 - start_off)) - ) - - let scan_template scanner = - let start_off = scanner.offset in - let start_pos = position scanner in - - let rec scan () = - if scanner.ch == CharacterCodes.eof then ( - let end_pos = position scanner in - scanner.err ~start_pos ~end_pos Diagnostics.unclosed_template; - pop_mode scanner Template; - Token.TemplateTail( - Bytes.sub_string scanner.src start_off (scanner.offset - 2 - start_off) - ) - ) - else if scanner.ch == CharacterCodes.backslash then ( - next scanner; - if scanner.ch == CharacterCodes.backtick - || scanner.ch == CharacterCodes.backslash - || scanner.ch == CharacterCodes.dollar - then next scanner; - scan() - ) else if scanner.ch == CharacterCodes.backtick then ( - next scanner; - let contents = - Bytes.sub_string scanner.src start_off (scanner.offset - 1 - start_off) - in - pop_mode scanner Template; - Token.TemplateTail contents - ) else if scanner.ch == CharacterCodes.dollar && - peek scanner == CharacterCodes.lbrace - then ( - next scanner; (* consume $ *) - next scanner; (* consume { *) - let contents = - Bytes.sub_string scanner.src start_off (scanner.offset - 2 - start_off) - in - pop_mode scanner Template; - Token.TemplatePart contents - ) else ( - if CharacterCodes.is_line_break scanner.ch then ( - scanner.line_offset <- scanner.offset + 1; - scanner.lnum <- scanner.lnum + 1; - ); - next scanner; - scan() - ) - in - scan() - - let rec scan scanner = - if not (in_template_mode scanner) then skip_whitespace scanner; - let start_pos = position scanner in - let ch = scanner.ch in - let token = if in_template_mode scanner then - scan_template scanner - else if ch == CharacterCodes.underscore then ( - let next_ch = peek scanner in - if next_ch == CharacterCodes.underscore || CharacterCodes.is_digit next_ch || CharacterCodes.is_letter next_ch then - scan_identifier scanner - else ( - next scanner; - Token.Underscore - ) - ) else if CharacterCodes.is_letter ch then - scan_identifier scanner - else if CharacterCodes.is_digit ch then - scan_number scanner - else begin - next scanner; - if ch == CharacterCodes.dot then - if scanner.ch == CharacterCodes.dot then ( - next scanner; - if scanner.ch == CharacterCodes.dot then ( - next scanner; - Token.DotDotDot - ) else ( - Token.DotDot - ) - ) else ( - Token.Dot - ) - else if ch == CharacterCodes.double_quote then - scan_string scanner - else if ch == CharacterCodes.single_quote then ( - if scanner.ch == CharacterCodes.backslash - && not ((peek scanner) == CharacterCodes.double_quote) (* start of exotic ident *) - then ( - next scanner; - scan_escape scanner - ) else if (peek scanner) == CharacterCodes.single_quote then ( - let ch = scanner.ch in - next scanner; - next scanner; - Token.Character ((Char.chr [@doesNotRaise]) ch) - ) else ( - SingleQuote - ) - ) else if ch == CharacterCodes.bang then - if scanner.ch == CharacterCodes.equal then ( - next scanner; - if scanner.ch == CharacterCodes.equal then ( - next scanner; - Token.BangEqualEqual - ) else ( - Token.BangEqual - ) - ) else ( - Token.Bang - ) - else if ch == CharacterCodes.semicolon then - Token.Semicolon - else if ch == CharacterCodes.equal then ( - if scanner.ch == CharacterCodes.greater_than then ( - next scanner; - Token.EqualGreater - ) else if scanner.ch == CharacterCodes.equal then ( - next scanner; - if scanner.ch == CharacterCodes.equal then ( - next scanner; - Token.EqualEqualEqual - ) else ( - Token.EqualEqual - ) - ) else ( - Token.Equal - ) - ) else if ch == CharacterCodes.bar then - if scanner.ch == CharacterCodes.bar then ( - next scanner; - Token.Lor - ) else if scanner.ch == CharacterCodes.greater_than then ( - next scanner; - Token.BarGreater - ) else ( - Token.Bar - ) - else if ch == CharacterCodes.ampersand then - if scanner.ch == CharacterCodes.ampersand then ( - next scanner; - Token.Land - ) else ( - Token.Band - ) - else if ch == CharacterCodes.lparen then - Token.Lparen - else if ch == CharacterCodes.rparen then - Token.Rparen - else if ch == CharacterCodes.lbracket then - Token.Lbracket - else if ch == CharacterCodes.rbracket then - Token.Rbracket - else if ch == CharacterCodes.lbrace then - Token.Lbrace - else if ch == CharacterCodes.rbrace then - Token.Rbrace - else if ch == CharacterCodes.comma then - Token.Comma - else if ch == CharacterCodes.colon then - if scanner.ch == CharacterCodes.equal then( - next scanner; - Token.ColonEqual - ) else if (scanner.ch == CharacterCodes.greater_than) then ( - next scanner; - Token.ColonGreaterThan - ) else ( - Token.Colon - ) - else if ch == CharacterCodes.backslash then - scan_exotic_identifier scanner - else if ch == CharacterCodes.forwardslash then - if scanner.ch == CharacterCodes.forwardslash then ( - next scanner; - scan_single_line_comment scanner - ) else if (scanner.ch == CharacterCodes.asterisk) then ( - next scanner; - scan_multi_line_comment scanner - ) else if scanner.ch == CharacterCodes.dot then ( - next scanner; - Token.ForwardslashDot - ) else ( - Token.Forwardslash - ) - else if ch == CharacterCodes.minus then - if scanner.ch == CharacterCodes.dot then ( - next scanner; - Token.MinusDot - ) else if scanner.ch == CharacterCodes.greater_than then ( - next scanner; - Token.MinusGreater; - ) else ( - Token.Minus - ) - else if ch == CharacterCodes.plus then - if scanner.ch == CharacterCodes.dot then ( - next scanner; - Token.PlusDot - ) else if scanner.ch == CharacterCodes.plus then ( - next scanner; - Token.PlusPlus - ) else if scanner.ch == CharacterCodes.equal then ( - next scanner; - Token.PlusEqual - ) else ( - Token.Plus - ) - else if ch == CharacterCodes.greater_than then - if scanner.ch == CharacterCodes.equal && not (in_diamond_mode scanner) then ( - next scanner; - Token.GreaterEqual - ) else ( - Token.GreaterThan - ) - else if ch == CharacterCodes.less_than then - (* Imagine the following:
< - * < indicates the start of a new jsx-element, the parser expects - * the name of a new element after the < - * Example:
- * This signals a closing element. To simulate the two-token lookahead, - * the < - * is `<` the start of a jsx-child?
- * reconsiderLessThan peeks at the next token and - * determines the correct token to disambiguate *) - let reconsider_less_than scanner = - (* < consumed *) - skip_whitespace scanner; - if scanner.ch == CharacterCodes.forwardslash then - let () = next scanner in - Token.LessThanSlash - else - Token.LessThan - - (* If an operator has whitespace around both sides, it's a binary operator *) - let is_binary_op src start_cnum end_cnum = - if start_cnum == 0 then false - else - let left_ok = - let c = - (start_cnum - 1) - |> (Bytes.get [@doesNotRaise]) src - |> Char.code - in - c == CharacterCodes.space || - c == CharacterCodes.tab || - CharacterCodes.is_line_break c - in - let right_ok = - let c = - if end_cnum == Bytes.length src then -1 - else end_cnum |> (Bytes.get [@doesNotRaise]) src |> Char.code - in - c == CharacterCodes.space || - c == CharacterCodes.tab || - CharacterCodes.is_line_break c || - c == CharacterCodes.eof - in - left_ok && right_ok -end - -(* AST for js externals *) -module JsFfi = struct - type scope = - | Global - | Module of string (* module("path") *) - | Scope of Longident.t (* scope(/"window", "location"/) *) - - type label_declaration = { - jld_attributes: Parsetree.attributes; [@live] - jld_name: string; - jld_alias: string; - jld_type: Parsetree.core_type; - jld_loc: Location.t - } - - type import_spec = - | Default of label_declaration - | Spec of label_declaration list - - type import_description = { - jid_loc: Location.t; - jid_spec: import_spec; - jid_scope: scope; - jid_attributes: Parsetree.attributes; - } - - let decl ~attrs ~loc ~name ~alias ~typ = { - jld_loc = loc; - jld_attributes = attrs; - jld_name = name; - jld_alias = alias; - jld_type = typ - } - - let import_descr ~attrs ~scope ~import_spec ~loc = { - jid_loc = loc; - jid_spec = import_spec; - jid_scope = scope; - jid_attributes = attrs; - } - - let to_parsetree import_descr = - let bs_val = (Location.mknoloc "val", Parsetree.PStr []) in - let attrs = match import_descr.jid_scope with - | Global -> [bs_val] - (* @genType.import("./MyMath"), - * @genType.import(/"./MyMath", "default"/) *) - | Module s -> - let structure = [ - Parsetree.Pconst_string (s, None) - |> Ast_helper.Exp.constant - |> Ast_helper.Str.eval - ] in - let gentype = (Location.mknoloc "genType.import", Parsetree.PStr structure) in - [gentype] - | Scope longident -> - let structure_item = - let expr = match Longident.flatten longident |> List.map (fun s -> - Ast_helper.Exp.constant (Parsetree.Pconst_string (s, None)) - ) with - | [expr] -> expr - | [] as exprs | (_ as exprs) -> exprs |> Ast_helper.Exp.tuple - in - Ast_helper.Str.eval expr - in - let bs_scope = ( - Location.mknoloc "scope", - Parsetree. PStr [structure_item] - ) in - [bs_val; bs_scope] - in - let value_descrs = match import_descr.jid_spec with - | Default decl -> - let prim = [decl.jld_name] in - let all_attrs = - List.concat [attrs; import_descr.jid_attributes] - |> List.map (fun attr -> match attr with - | ( - {Location.txt = "genType.import"} as id, - Parsetree.PStr [{pstr_desc = Parsetree.Pstr_eval (module_name, _) }] - ) -> - let default = - Parsetree.Pconst_string ("default", None) |> Ast_helper.Exp.constant - in - let structure_item = - [module_name; default] - |> Ast_helper.Exp.tuple - |> Ast_helper.Str.eval - in - (id, Parsetree.PStr [structure_item]) - | attr -> attr - ) - in - [Ast_helper.Val.mk - ~loc:import_descr.jid_loc - ~prim - ~attrs:all_attrs - (Location.mknoloc decl.jld_alias) - decl.jld_type - |> Ast_helper.Str.primitive] - | Spec decls -> - List.map (fun decl -> - let prim = [decl.jld_name] in - let all_attrs = List.concat [attrs; decl.jld_attributes] in - Ast_helper.Val.mk - ~loc:import_descr.jid_loc - ~prim - ~attrs:all_attrs - (Location.mknoloc decl.jld_alias) - decl.jld_type - |> Ast_helper.Str.primitive ~loc:decl.jld_loc - ) decls - in - let js_ffi_attr = (Location.mknoloc "ns.jsFfi", Parsetree.PStr []) in - Ast_helper.Mod.structure ~loc:import_descr.jid_loc value_descrs - |> Ast_helper.Incl.mk ~attrs:[js_ffi_attr] ~loc:import_descr.jid_loc - |> Ast_helper.Str.include_ ~loc:import_descr.jid_loc -end - -module ParsetreeCompatibility = struct - let concat_longidents l1 l2 = - let parts1 = Longident.flatten l1 in - let parts2 = Longident.flatten l2 in - match List.concat [parts1; parts2] |> Longident.unflatten with - | Some longident -> longident - | None -> l2 - - (* TODO: support nested open's ? *) - let rec rewrite_ppat_open longident_open pat = - let open Parsetree in - match pat.ppat_desc with - | Ppat_array (first::rest) -> - (* Color.[Red, Blue, Green] -> [Color.Red, Blue, Green] *) - {pat with ppat_desc = Ppat_array ((rewrite_ppat_open longident_open first)::rest)} - | Ppat_tuple (first::rest) -> - (* Color.(Red, Blue, Green) -> (Color.Red, Blue, Green) *) - {pat with ppat_desc = Ppat_tuple ((rewrite_ppat_open longident_open first)::rest)} - | Ppat_construct( - {txt = Longident.Lident "::"} as list_constructor, - Some ({ppat_desc=Ppat_tuple (pat::rest)} as element) - ) -> - (* Color.(list[Red, Blue, Green]) -> list[Color.Red, Blue, Green] *) - {pat with ppat_desc = - Ppat_construct ( - list_constructor, - Some {element with ppat_desc = Ppat_tuple ((rewrite_ppat_open longident_open pat)::rest)} - ) - } - | Ppat_construct ({txt = constructor} as longident_loc, opt_pattern) -> - (* Foo.(Bar(a)) -> Foo.Bar(a) *) - {pat with ppat_desc = - Ppat_construct ( - {longident_loc with txt = concat_longidents longident_open constructor}, - opt_pattern - ) - } - | Ppat_record (({txt = lbl} as longident_loc, first_pat)::rest, flag) -> - (* Foo.{x} -> {Foo.x: x} *) - let first_row = ( - {longident_loc with txt = concat_longidents longident_open lbl}, - first_pat - ) in - {pat with ppat_desc = Ppat_record (first_row::rest, flag)} - | Ppat_or (pat1, pat2) -> - {pat with ppat_desc = Ppat_or ( - rewrite_ppat_open longident_open pat1, - rewrite_ppat_open longident_open pat2 - )} - | Ppat_constraint (pattern, typ) -> - {pat with ppat_desc = Ppat_constraint ( - rewrite_ppat_open longident_open pattern, - typ - )} - | Ppat_type ({txt = constructor} as longident_loc) -> - {pat with ppat_desc = Ppat_type ( - {longident_loc with txt = concat_longidents longident_open constructor} - )} - | Ppat_lazy p -> - {pat with ppat_desc = Ppat_lazy (rewrite_ppat_open longident_open p)} - | Ppat_exception p -> - {pat with ppat_desc = Ppat_exception (rewrite_ppat_open longident_open p)} - | _ -> pat - - let rec rewrite_reason_fast_pipe expr = - let open Parsetree in - match expr.pexp_desc with - | Pexp_apply ( - {pexp_desc = Pexp_apply ( - {pexp_desc = Pexp_ident {txt = Longident.Lident "|."}} as op, - [Asttypes.Nolabel, lhs; Nolabel, rhs] - ); pexp_attributes = sub_attrs}, - args - ) -> - let rhs_loc = {rhs.pexp_loc with loc_end = expr.pexp_loc.loc_end} in - let new_lhs = - let expr = rewrite_reason_fast_pipe lhs in - {expr with pexp_attributes = sub_attrs} - in - let all_args = - (Asttypes.Nolabel, new_lhs)::[ - Asttypes.Nolabel, Ast_helper.Exp.apply ~loc:rhs_loc rhs args - ] - in - Ast_helper.Exp.apply ~attrs:expr.pexp_attributes ~loc:expr.pexp_loc op all_args - | _ -> expr - - let make_reason_arity_mapper ~for_printer = - let open Ast_mapper in - { default_mapper with - expr = begin fun mapper expr -> - match expr with - (* Don't mind this case, Reason doesn't handle this. *) - (* | {pexp_desc = Pexp_variant (lbl, args); pexp_loc; pexp_attributes} -> *) - (* let newArgs = match args with *) - (* | (Some {pexp_desc = Pexp_tuple [{pexp_desc = Pexp_tuple _ } as sp]}) as args-> *) - (* if forPrinter then args else Some sp *) - (* | Some {pexp_desc = Pexp_tuple [sp]} -> Some sp *) - (* | _ -> args *) - (* in *) - (* default_mapper.expr mapper {pexp_desc=Pexp_variant(lbl, newArgs); pexp_loc; pexp_attributes} *) - | {pexp_desc=Pexp_construct(lid, args); pexp_loc; pexp_attributes} -> - let new_args = match args with - | (Some {pexp_desc = Pexp_tuple [{pexp_desc = Pexp_tuple _ } as sp]}) as args -> - if for_printer then args else Some sp - | Some {pexp_desc = Pexp_tuple [sp]} -> Some sp - | _ -> args - in - default_mapper.expr mapper { pexp_desc=Pexp_construct(lid, new_args); pexp_loc; pexp_attributes} - | expr -> - default_mapper.expr mapper (rewrite_reason_fast_pipe expr) - end; - pat = begin fun mapper pattern -> - match pattern with - (* Don't mind this case, Reason doesn't handle this. *) - (* | {ppat_desc = Ppat_variant (lbl, args); ppat_loc; ppat_attributes} -> *) - (* let newArgs = match args with *) - (* | (Some {ppat_desc = Ppat_tuple [{ppat_desc = Ppat_tuple _} as sp]}) as args -> *) - (* if forPrinter then args else Some sp *) - (* | Some {ppat_desc = Ppat_tuple [sp]} -> Some sp *) - (* | _ -> args *) - (* in *) - (* default_mapper.pat mapper {ppat_desc = Ppat_variant (lbl, newArgs); ppat_loc; ppat_attributes;} *) - | {ppat_desc=Ppat_construct(lid, args); - ppat_loc; - ppat_attributes} -> - let new_args = match args with - | (Some {ppat_desc = Ppat_tuple [{ppat_desc = Ppat_tuple _} as sp]}) as args -> - if for_printer then args else Some sp - | Some {ppat_desc = Ppat_tuple [sp]} -> Some sp - | _ -> args in - default_mapper.pat mapper { ppat_desc=Ppat_construct(lid, new_args); ppat_loc; ppat_attributes;} - | x -> default_mapper.pat mapper x - end; - } - - let escape_template_literal s = - let len = String.length s in - let b = Buffer.create len in - let i = ref 0 in - while !i < len do - let c = (String.get [@doesNotRaise]) s !i in - if c = '`' then ( - Buffer.add_char b '\\'; - Buffer.add_char b '`'; - incr i; - ) else if c = '$' then ( - if !i + 1 < len then ( - let c2 = (String.get [@doesNotRaise]) s (!i + 1) in - if c2 = '{' then ( - Buffer.add_char b '\\'; - Buffer.add_char b '$'; - Buffer.add_char b '{'; - ) else ( - Buffer.add_char b c; - Buffer.add_char b c2; - ); - i := !i + 2; - ) else ( - Buffer.add_char b c; - incr i - ) - ) else if c = '\\' then ( - Buffer.add_char b '\\'; - Buffer.add_char b '\\'; - incr i; - ) else ( - Buffer.add_char b c; - incr i - ) - done; - Buffer.contents b - - let escape_string_contents s = - let len = String.length s in - let b = Buffer.create len in - - let i = ref 0 in - - while !i < len do - let c = String.unsafe_get s !i in - if c = '\\' then ( - incr i; - Buffer.add_char b c; - let c = String.unsafe_get s !i in - if !i < len then - let () = Buffer.add_char b c in - incr i - else - () - ) else if c = '"' then ( - Buffer.add_char b '\\'; - Buffer.add_char b c; - incr i; - ) else ( - Buffer.add_char b c; - incr i; - ) - done; - Buffer.contents b - - let looks_like_recursive_type_declaration type_declaration = - let open Parsetree in - let name = type_declaration.ptype_name.txt in - let rec check_kind kind = - match kind with - | Ptype_abstract | Ptype_open -> false - | Ptype_variant constructor_declarations -> - List.exists check_constructor_declaration constructor_declarations - | Ptype_record label_declarations -> - List.exists check_label_declaration label_declarations - - and check_constructor_declaration constr_decl = - check_constructor_arguments constr_decl.pcd_args - || (match constr_decl.pcd_res with - | Some typexpr -> - check_typ_expr typexpr - | None -> false - ) - - and check_label_declaration label_declaration = - check_typ_expr label_declaration.pld_type - - and check_constructor_arguments constr_arg = - match constr_arg with - | Pcstr_tuple types -> - List.exists check_typ_expr types - | Pcstr_record label_declarations -> - List.exists check_label_declaration label_declarations - - and check_typ_expr typ = - match typ.ptyp_desc with - | Ptyp_any -> false - | Ptyp_var _ -> false - | Ptyp_object _ -> false - | Ptyp_class _ -> false - | Ptyp_package _ -> false - | Ptyp_extension _ -> false - | Ptyp_arrow (_lbl, typ1, typ2) -> - check_typ_expr typ1 || check_typ_expr typ2 - | Ptyp_tuple types -> - List.exists check_typ_expr types - | Ptyp_constr ({txt = longident}, types) -> - (match longident with - | Lident ident -> ident = name - | _ -> false - ) || - List.exists check_typ_expr types - | Ptyp_alias (typ, _) -> check_typ_expr typ - | Ptyp_variant (row_fields, _, _) -> - List.exists check_row_fields row_fields - | Ptyp_poly (_, typ) -> - check_typ_expr typ - - and check_row_fields row_field = - match row_field with - | Rtag (_, _, _, types) -> - List.exists check_typ_expr types - | Rinherit typexpr -> - check_typ_expr typexpr - in - check_kind type_declaration.ptype_kind - - - let filter_reason_raw_literal attrs = - List.filter (fun attr -> - match attr with - | ({Location.txt = ("reason.raw_literal")}, _) -> false - | _ -> true - ) attrs - - let string_literal_mapper string_data = - let is_same_location l1 l2 = - let open Location in - l1.loc_start.pos_cnum == l2.loc_start.pos_cnum - in - let remaining_string_data = string_data in - let open Ast_mapper in - { default_mapper with - expr = (fun mapper expr -> - match expr.pexp_desc with - | Pexp_constant (Pconst_string (_txt, None)) -> - begin match - List.find_opt (fun (_stringData, string_loc) -> - is_same_location string_loc expr.pexp_loc - ) remaining_string_data - with - | Some(string_data, _) -> - let string_data = - let attr = List.find_opt (fun attr -> match attr with - | ({Location.txt = ("reason.raw_literal")}, _) -> true - | _ -> false - ) expr.pexp_attributes in - match attr with - | Some (_, PStr [{pstr_desc = Pstr_eval ({pexp_desc = Pexp_constant (Pconst_string (raw, _))}, _)}]) -> - raw - | _ -> (String.sub [@doesNotRaise]) string_data 1 (String.length string_data - 2) - in - {expr with - pexp_attributes = filter_reason_raw_literal expr.pexp_attributes; - pexp_desc = Pexp_constant (Pconst_string (string_data, None)) - } - | None -> - default_mapper.expr mapper expr - end - | _ -> default_mapper.expr mapper expr - ) - } - - let normalize = - let open Ast_mapper in - { default_mapper with - attributes = (fun mapper attrs -> - attrs - |> List.filter (fun attr -> - match attr with - | ({Location.txt = ( - "reason.preserve_braces" - | "explicit_arity" - | "implicity_arity" - )}, _) -> false - | _ ->true - ) - |> default_mapper.attributes mapper - ); - pat = begin fun mapper p -> - match p.ppat_desc with - | Ppat_open ({txt = longident_open}, pattern) -> - let p = rewrite_ppat_open longident_open pattern in - default_mapper.pat mapper p - | _ -> - default_mapper.pat mapper p - end; - expr = (fun mapper expr -> - match expr.pexp_desc with - | Pexp_constant (Pconst_string (txt, None)) -> - let raw = escape_string_contents txt in - let s = Parsetree.Pconst_string (raw, None) in - let expr = Ast_helper.Exp.constant - ~attrs:expr.pexp_attributes - ~loc:expr.pexp_loc s - in - expr - | Pexp_constant (Pconst_string (txt, tag)) -> - let s = Parsetree.Pconst_string ((escape_template_literal txt), tag) in - Ast_helper.Exp.constant - ~attrs:(mapper.attributes mapper expr.pexp_attributes) - ~loc:expr.pexp_loc - s - | Pexp_function cases -> - let loc = match (cases, List.rev cases) with - | (first::_), (last::_) -> - {first.pc_lhs.ppat_loc with loc_end = last.pc_rhs.pexp_loc.loc_end} - | _ -> Location.none - in - Ast_helper.Exp.fun_ ~loc - Asttypes.Nolabel None (Ast_helper.Pat.var (Location.mknoloc "x")) - (Ast_helper.Exp.match_ ~loc - (Ast_helper.Exp.ident (Location.mknoloc (Longident.Lident "x"))) - (default_mapper.cases mapper cases) - ) - | Pexp_apply ( - {pexp_desc = Pexp_ident {txt = Longident.Lident "!"}}, - [Asttypes.Nolabel, operand] - ) -> - (* turn `!foo` into `foo.contents` *) - Ast_helper.Exp.field ~loc:expr.pexp_loc ~attrs:expr.pexp_attributes - operand - (Location.mknoloc (Longident.Lident "contents")) - | Pexp_apply ( - {pexp_desc = Pexp_ident {txt = Longident.Lident "##"}} as op, - [Asttypes.Nolabel, lhs; Nolabel, ({pexp_desc = Pexp_constant (Pconst_string (txt, None))} as string_expr)] - ) -> - let ident = Ast_helper.Exp.ident ~loc:string_expr.pexp_loc - (Location.mkloc (Longident.Lident txt) string_expr.pexp_loc) - in - Ast_helper.Exp.apply ~loc:expr.pexp_loc ~attrs:expr.pexp_attributes - op [Asttypes.Nolabel, lhs; Nolabel, ident] - | Pexp_apply ( - {pexp_desc = Pexp_ident {txt = Longident.Lident "@@"}}, - [Asttypes.Nolabel, call_expr; Nolabel, arg_expr] - ) -> - Ast_helper.Exp.apply (mapper.expr mapper call_expr) [ - Asttypes.Nolabel, mapper.expr mapper arg_expr - ] - | Pexp_apply ( - {pexp_desc = Pexp_ident {txt = Longident.Lident "@"}}, - [Nolabel, arg1; Nolabel, arg2] - ) -> - let list_concat = Longident.Ldot (Longident.Lident "List", "append") in - Ast_helper.Exp.apply - (Ast_helper.Exp.ident (Location.mknoloc list_concat)) - [Nolabel, mapper.expr mapper arg1; Nolabel, mapper.expr mapper arg2] - | Pexp_match ( - condition, - [ - {pc_lhs = {ppat_desc = Ppat_construct ({txt = Longident.Lident "true"}, None)}; pc_rhs = then_expr }; - {pc_lhs = {ppat_desc = Ppat_construct ({txt = Longident.Lident "false"}, None)}; pc_rhs = else_expr }; - ] - ) -> - let ternary_marker = (Location.mknoloc "res.ternary", Parsetree.PStr []) in - Ast_helper.Exp.ifthenelse - ~loc:expr.pexp_loc - ~attrs:(ternary_marker::expr.pexp_attributes) - (default_mapper.expr mapper condition) - (default_mapper.expr mapper then_expr) - (Some (default_mapper.expr mapper else_expr)) - | _ -> default_mapper.expr mapper expr - ); - structure_item = begin fun mapper structure_item -> - match structure_item.pstr_desc with - (* heuristic: if we have multiple type declarations, mark them recursive *) - | Pstr_type (rec_flag, type_declarations) -> - let flag = match type_declarations with - | [td] -> - if looks_like_recursive_type_declaration td then Asttypes.Recursive - else Asttypes.Nonrecursive - | _ -> rec_flag - in - {structure_item with pstr_desc = Pstr_type ( - flag, - List.map (fun type_declaration -> - default_mapper.type_declaration mapper type_declaration - ) type_declarations - )} - | _ -> default_mapper.structure_item mapper structure_item - end; - signature_item = begin fun mapper signature_item -> - match signature_item.psig_desc with - (* heuristic: if we have multiple type declarations, mark them recursive *) - | Psig_type (rec_flag, type_declarations) -> - let flag = match type_declarations with - | [td] -> - if looks_like_recursive_type_declaration td then Asttypes.Recursive - else Asttypes.Nonrecursive - | _ -> rec_flag - in - {signature_item with psig_desc = Psig_type ( - flag, - List.map (fun type_declaration -> - default_mapper.type_declaration mapper type_declaration - ) type_declarations - )} - | _ -> default_mapper.signature_item mapper signature_item - end; - value_binding = begin fun mapper vb -> - match vb with - | { - pvb_pat = {ppat_desc = Ppat_var _} as pat; - pvb_expr = {pexp_loc = expr_loc; pexp_desc = Pexp_constraint (expr, typ) } - } when expr_loc.loc_ghost -> - (* let t: t = (expr : t) -> let t: t = expr *) - let typ = default_mapper.typ mapper typ in - let pat = default_mapper.pat mapper pat in - let expr = mapper.expr mapper expr in - let new_pattern = Ast_helper.Pat.constraint_ - ~loc:{pat.ppat_loc with loc_end = typ.ptyp_loc.loc_end} - pat typ in - {vb with - pvb_pat = new_pattern; - pvb_expr = expr; - pvb_attributes = default_mapper.attributes mapper vb.pvb_attributes} - | { - pvb_pat = {ppat_desc = Ppat_constraint (pat, {ptyp_desc = Ptyp_poly ([], _)})} ; - pvb_expr = {pexp_loc = expr_loc; pexp_desc = Pexp_constraint (expr, typ) } - } when expr_loc.loc_ghost -> - (* let t: . t = (expr : t) -> let t: t = expr *) - let typ = default_mapper.typ mapper typ in - let pat = default_mapper.pat mapper pat in - let expr = mapper.expr mapper expr in - let new_pattern = Ast_helper.Pat.constraint_ - ~loc:{pat.ppat_loc with loc_end = typ.ptyp_loc.loc_end} - pat typ in - {vb with - pvb_pat = new_pattern; - pvb_expr = expr; - pvb_attributes = default_mapper.attributes mapper vb.pvb_attributes} - | _ -> default_mapper.value_binding mapper vb - end; - } - - let normalize_reason_arity_structure ~for_printer s = - let mapper = make_reason_arity_mapper ~for_printer in - mapper.Ast_mapper.structure mapper s - - let normalize_reason_arity_signature ~for_printer s = - let mapper = make_reason_arity_mapper ~for_printer in - mapper.Ast_mapper.signature mapper s - - let structure s = normalize.Ast_mapper.structure normalize s - let signature s = normalize.Ast_mapper.signature normalize s - - let replace_string_literal_structure string_data structure = - let mapper = string_literal_mapper string_data in - mapper.Ast_mapper.structure mapper structure - - let replace_string_literal_signature string_data signature = - let mapper = string_literal_mapper string_data in - mapper.Ast_mapper.signature mapper signature -end - -module OcamlParser = Parser - -module Parser = struct - type mode = ParseForTypeChecker | Default - - type region_status = Report | Silent - - type t = { - mode: mode; - mutable scanner: Scanner.t; - mutable token: Token.t; - mutable start_pos: Lexing.position; - mutable end_pos: Lexing.position; - mutable prev_end_pos: Lexing.position; - mutable breadcrumbs: (Grammar.t * Lexing.position) list; - mutable errors: Reporting.parse_error list; - mutable diagnostics: Diagnostics.t list; - mutable comments: Comment.t list; - mutable regions: region_status ref list; - } - - let err ?start_pos ?end_pos p error = - let d = Diagnostics.make - ~filename:p.scanner.filename - ~start_pos:(match start_pos with | Some pos -> pos | None -> p.start_pos) - ~end_pos:(match end_pos with | Some pos -> pos | None -> p.end_pos) - error - in - try - if (!(List.hd p.regions) = Report) then ( - p.diagnostics <- d::p.diagnostics; - List.hd p.regions := Silent - ) - with Failure _ -> () - - let begin_region p = - p.regions <- ref Report :: p.regions - let end_region p = - try p.regions <- List.tl p.regions with Failure _ -> () - - (* Advance to the next non-comment token and store any encountered comment - * in the parser's state. Every comment contains the end position of it's - * previous token to facilite comment interleaving *) - let rec next ?prev_end_pos p = - let prev_end_pos = match prev_end_pos with Some pos -> pos | None -> p.end_pos in - let (start_pos, end_pos, token) = Scanner.scan p.scanner in - match token with - | Comment c -> - Comment.set_prev_tok_end_pos c p.end_pos; - p.comments <- c::p.comments; - p.prev_end_pos <- p.end_pos; - p.end_pos <- end_pos; - next ~prev_end_pos p - | _ -> - p.token <- token; - (* p.prevEndPos <- prevEndPos; *) - p.prev_end_pos <- prev_end_pos; - p.start_pos <- start_pos; - p.end_pos <- end_pos - - let check_progress ~prev_end_pos ~result p = - if p.end_pos == prev_end_pos - then None - else Some result - - let make ?(mode=ParseForTypeChecker) src filename = - let scanner = Scanner.make (Bytes.of_string src) filename in - let parser_state = { - mode; - scanner; - token = Token.Eof; - start_pos = Lexing.dummy_pos; - prev_end_pos = Lexing.dummy_pos; - end_pos = Lexing.dummy_pos; - breadcrumbs = []; - errors = []; - diagnostics = []; - comments = []; - regions = [ref Report]; - } in - parser_state.scanner.err <- (fun ~start_pos ~end_pos error -> - let diagnostic = Diagnostics.make - ~filename - ~start_pos - ~end_pos - error - in - parser_state.diagnostics <- diagnostic::parser_state.diagnostics - ); - next parser_state; - parser_state - - let leave_breadcrumb p circumstance = - let crumb = (circumstance, p.start_pos) in - p.breadcrumbs <- crumb::p.breadcrumbs - - let eat_breadcrumb p = - match p.breadcrumbs with - | [] -> () - | _::crumbs -> p.breadcrumbs <- crumbs - - let optional p token = - if p.token = token then - let () = next p in true - else - false - - let expect ?grammar token p = - if p.token = token then - next p - else - let error = Diagnostics.expected ?grammar p.prev_end_pos token in - err ~start_pos:p.prev_end_pos p error - - (* Don't use immutable copies here, it trashes certain heuristics - * in the ocaml compiler, resulting in massive slowdowns of the parser *) - let lookahead p callback = - let err = p.scanner.err in - let ch = p.scanner.ch in - let offset = p.scanner.offset in - let rd_offset = p.scanner.rd_offset in - let line_offset = p.scanner.line_offset in - let lnum = p.scanner.lnum in - let mode = p.scanner.mode in - let token = p.token in - let start_pos = p.start_pos in - let end_pos = p.end_pos in - let prev_end_pos = p.prev_end_pos in - let breadcrumbs = p.breadcrumbs in - let errors = p.errors in - let diagnostics = p.diagnostics in - let comments = p.comments in - - let res = callback p in - - p.scanner.err <- err; - p.scanner.ch <- ch; - p.scanner.offset <- offset; - p.scanner.rd_offset <- rd_offset; - p.scanner.line_offset <- line_offset; - p.scanner.lnum <- lnum; - p.scanner.mode <- mode; - p.token <- token; - p.start_pos <- start_pos; - p.end_pos <- end_pos; - p.prev_end_pos <- prev_end_pos; - p.breadcrumbs <- breadcrumbs; - p.errors <- errors; - p.diagnostics <- diagnostics; - p.comments <- comments; - - res -end - -module NapkinScript = struct - let mk_loc start_loc end_loc = Location.{ - loc_start = start_loc; - loc_end = end_loc; - loc_ghost = false; - } - - - module Recover = struct - type action = unit option (* None is abort, Some () is retry *) - - let default_expr () = - let id = Location.mknoloc "napkinscript.exprhole" in - Ast_helper.Exp.mk (Pexp_extension (id, PStr [])) - - let default_type () = - let id = Location.mknoloc "napkinscript.typehole" in - Ast_helper.Typ.extension (id, PStr []) - - let default_pattern () = - let id = Location.mknoloc "napkinscript.patternhole" in - Ast_helper.Pat.extension (id, PStr []) - (* Ast_helper.Pat.any () *) - - let default_module_expr () = Ast_helper.Mod.structure [] - let default_module_type () = Ast_helper.Mty.signature [] - - let recover_equal_greater p = - Parser.expect EqualGreater p; - match p.Parser.token with - | MinusGreater -> Parser.next p - | _ -> () - - let should_abort_list_parse p = - let rec check breadcrumbs = - match breadcrumbs with - | [] -> false - | (grammar, _)::rest -> - if Grammar.is_part_of_list grammar p.Parser.token then - true - else - check rest - in - check p.breadcrumbs - end - - module ErrorMessages = struct - let list_pattern_spread = "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." - - let record_pattern_spread = "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 record_pattern_underscore = "Record patterns only support one `_`, at the end." - [@@live] - - let array_pattern_spread = "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`." - - let array_expr_spread = "Arrays can't use the `...` spread currently. Please use `concat` or other Array helpers." - - let record_expr_spread = "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 list_expr_spread = "Lists can only have one `...` spread, and at the end. -Explanation: lists are singly-linked list, where a node contains a value and points to the next node. `list[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`." - - let variant_ident = "A polymorphic variant (e.g. #id) must start with an alphabetical letter." -end - - - let jsx_attr = (Location.mknoloc "JSX", Parsetree.PStr []) - let uncurry_attr = (Location.mknoloc "bs", Parsetree.PStr []) - let ternary_attr = (Location.mknoloc "res.ternary", Parsetree.PStr []) - let make_braces_attr loc = (Location.mkloc "res.braces" loc, Parsetree.PStr []) - - type typ_def_or_ext = - | TypeDef of {rec_flag: Asttypes.rec_flag; types: Parsetree.type_declaration list} - | TypeExt of Parsetree.type_extension - - type labelled_parameter = - | TermParameter of - {uncurried: bool; attrs: Parsetree.attributes; label: Asttypes.arg_label; expr: Parsetree.expression option; - pat: Parsetree.pattern; pos: Lexing.position} - | TypeParameter of {uncurried: bool; attrs: Parsetree.attributes; locs: string Location.loc list; pos: Lexing.position} - - type record_pattern_item = - | PatUnderscore - | PatField of (Ast_helper.lid * Parsetree.pattern) - - type context = - | OrdinaryExpr - | TernaryTrueBranchExpr - | WhenExpr - - let get_closing_token = function - | Token.Lparen -> Token.Rparen - | Lbrace -> Rbrace - | Lbracket -> Rbracket - | _ -> assert false - - let rec go_to_closing closing_token state = - match (state.Parser.token, closing_token) with - | (Rparen, Token.Rparen) | (Rbrace, Rbrace) | (Rbracket, Rbracket) -> - Parser.next state; - () - | (Token.Lbracket | Lparen | Lbrace) as t, _ -> - Parser.next state; - go_to_closing (get_closing_token t) state; - go_to_closing closing_token state - | ((Rparen | Token.Rbrace | Rbracket | Eof), _) -> - () (* TODO: how do report errors here? *) - | _ -> - Parser.next state; - go_to_closing closing_token state - - (* Madness *) - let is_es6_arrow_expression ~in_ternary p = - Parser.lookahead p (fun state -> - match state.Parser.token with - | Lident _ | List | Underscore -> - Parser.next state; - begin match state.Parser.token with - (* Don't think that this valid - * Imagine: let x = (a: int) - * This is a parenthesized expression with a type constraint, wait for - * the arrow *) - (* | Colon when not inTernary -> true *) - | EqualGreater -> true - | _ -> false - end - | Lparen -> - let prev_end_pos = state.prev_end_pos in - Parser.next state; - begin match state.token with - | Rparen -> - Parser.next state; - begin match state.Parser.token with - | Colon when not in_ternary -> true - | EqualGreater -> true - | _ -> false - end - | Dot (* uncurried *) -> true - | Tilde -> true - | Backtick -> false (* (` always indicates the start of an expr, can't be es6 parameter *) - | _ -> - go_to_closing Rparen state; - begin match state.Parser.token with - | EqualGreater -> true - (* | Lbrace TODO: detect missing =>, is this possible? *) - | Colon when not in_ternary -> true - | Rparen -> - (* imagine having something as : - * switch colour { - * | Red - * when l == l' - * || (&Clflags.classic && (l == Nolabel && !is_optional(l'))) => (t1, t2) - * We'll arrive at the outer rparen just before the =>. - * This is not an es6 arrow. - * *) - false - | _ -> - Parser.next state; - (* error recovery, peek at the next token, - * (elements, providerId] => { - * in the example above, we have an unbalanced ] here - *) - begin match state.Parser.token with - | EqualGreater when state.start_pos.pos_lnum == prev_end_pos.pos_lnum -> true - | _ -> false - end - end - end - | _ -> false) - - - let is_es6_arrow_functor p = - Parser.lookahead p (fun state -> - match state.Parser.token with - (* | Uident _ | Underscore -> *) - (* Parser.next state; *) - (* begin match state.Parser.token with *) - (* | EqualGreater -> true *) - (* | _ -> false *) - (* end *) - | Lparen -> - Parser.next state; - begin match state.token with - | Rparen -> - Parser.next state; - begin match state.token with - | Colon | EqualGreater -> true - | _ -> false - end - | _ -> - go_to_closing Rparen state; - begin match state.Parser.token with - | EqualGreater | Lbrace -> true - | Colon -> true - | _ -> false - end - end - | _ -> false - ) - - let is_es6_arrow_type p = - Parser.lookahead p (fun state -> - match state.Parser.token with - | Lparen -> - Parser.next state; - begin match state.Parser.token with - | Rparen -> - Parser.next state; - begin match state.Parser.token with - | EqualGreater -> true - | _ -> false - end - | Tilde | Dot -> true - | _ -> - go_to_closing Rparen state; - begin match state.Parser.token with - | EqualGreater -> true - | _ -> false - end - end - | Tilde -> true - | _ -> false - ) - - let build_longident words = match List.rev words with - | [] -> assert false - | hd::tl -> List.fold_left (fun p s -> Longident.Ldot (p, s)) (Lident hd) tl - - let make_infix_operator p token start_pos end_pos = - let stringified_token = - if token = Token.MinusGreater then "|." - else if token = Token.PlusPlus then "^" - else if token = Token.BangEqual then "<>" - else if token = Token.BangEqualEqual then "!=" - else if token = Token.Equal then ( - (* TODO: could have a totally different meaning like x->fooSet(y)*) - Parser.err ~start_pos ~end_pos p ( - Diagnostics.message "Did you mean `==` here?" - ); - "=" - ) else if token = Token.EqualEqual then "=" - else if token = Token.EqualEqualEqual then "==" - else Token.to_string token - in - let loc = mk_loc start_pos end_pos in - let operator = Location.mkloc - (Longident.Lident stringified_token) loc - in - Ast_helper.Exp.ident ~loc operator - - let negate_string s = - if String.length s > 0 && (s.[0] [@doesNotRaise]) = '-' - then (String.sub [@doesNotRaise]) s 1 (String.length s - 1) - else "-" ^ s - - let make_unary_expr start_pos token_end token operand = - match token, operand.Parsetree.pexp_desc with - | (Token.Plus | PlusDot), Pexp_constant((Pconst_integer _ | Pconst_float _)) -> - operand - | Minus, Pexp_constant(Pconst_integer (n,m)) -> - {operand with pexp_desc = Pexp_constant(Pconst_integer (negate_string n,m))} - | (Minus | MinusDot), Pexp_constant(Pconst_float (n,m)) -> - {operand with pexp_desc = Pexp_constant(Pconst_float (negate_string n,m))} - | (Token.Plus | PlusDot | Minus | MinusDot ), _ -> - let token_loc = mk_loc start_pos token_end in - let operator = "~" ^ Token.to_string token in - Ast_helper.Exp.apply - ~loc:(mk_loc start_pos operand.Parsetree.pexp_loc.loc_end) - (Ast_helper.Exp.ident ~loc:token_loc - (Location.mkloc (Longident.Lident operator) token_loc)) - [Nolabel, operand] - | Token.Bang, _ -> - let token_loc = mk_loc start_pos token_end in - Ast_helper.Exp.apply - ~loc:(mk_loc start_pos operand.Parsetree.pexp_loc.loc_end) - (Ast_helper.Exp.ident ~loc:token_loc - (Location.mkloc (Longident.Lident "not") token_loc)) - [Nolabel, operand] - | _ -> - operand - - let make_list_expression loc seq ext_opt = - let rec handle_seq = function - | [] -> - begin match ext_opt with - | Some ext -> ext - | None -> - let loc = {loc with Location.loc_ghost = true} in - let nil = Location.mkloc (Longident.Lident "[]") loc in - Ast_helper.Exp.construct ~loc nil None - end - | e1 :: el -> - let exp_el = handle_seq el in - let loc = mk_loc - e1.Parsetree.pexp_loc.Location.loc_start - exp_el.pexp_loc.loc_end - in - let arg = Ast_helper.Exp.tuple ~loc [e1; exp_el] in - Ast_helper.Exp.construct ~loc - (Location.mkloc (Longident.Lident "::") loc) - (Some arg) - in - let expr = handle_seq seq in - {expr with pexp_loc = loc} - - let make_list_pattern loc seq ext_opt = - let rec handle_seq = function - [] -> - let base_case = match ext_opt with - | Some ext -> - ext - | None -> - let loc = { loc with Location.loc_ghost = true} in - let nil = { Location.txt = Longident.Lident "[]"; loc } in - Ast_helper.Pat.construct ~loc nil None - in - base_case - | p1 :: pl -> - let pat_pl = handle_seq pl in - let loc = - mk_loc p1.Parsetree.ppat_loc.loc_start pat_pl.ppat_loc.loc_end in - let arg = Ast_helper.Pat.mk ~loc (Ppat_tuple [p1; pat_pl]) in - Ast_helper.Pat.mk ~loc (Ppat_construct(Location.mkloc (Longident.Lident "::") loc, Some arg)) - in - handle_seq seq - - - (* {"foo": bar} -> Js.t({. foo: bar}) - * {.. "foo": bar} -> Js.t({.. foo: bar}) - * {..} -> Js.t({..}) *) - let make_bs_obj_type ~attrs ~loc ~closed rows = - let obj = Ast_helper.Typ.object_ ~loc rows closed in - let js_dot_t_ctor = - Location.mkloc (Longident.Ldot (Longident.Lident "Js", "t")) loc - in - Ast_helper.Typ.constr ~loc ~attrs js_dot_t_ctor [obj] - - (* TODO: diagnostic reporting *) - let lident_of_path longident = - match Longident.flatten longident |> List.rev with - | [] -> "" - | ident::_ -> ident - - let make_newtypes ~attrs ~loc newtypes exp = - let expr = List.fold_right (fun newtype exp -> - Ast_helper.Exp.mk ~loc (Pexp_newtype (newtype, exp)) - ) newtypes exp - in {expr with pexp_attributes = attrs} - - (* locally abstract types syntax sugar - * Transforms - * let f: type t u v. = (foo : list) => ... - * into - * let f = (type t u v. foo : list) => ... - *) - let wrap_type_annotation ~loc newtypes core_type body = - let exp = make_newtypes ~attrs:[] ~loc newtypes - (Ast_helper.Exp.constraint_ ~loc body core_type) - in - let typ = Ast_helper.Typ.poly ~loc newtypes - (Ast_helper.Typ.varify_constructors newtypes core_type) - in - (exp, typ) - - (** - * 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 open Parsetree in - 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 = Location.mkloc (Longident.Lident hidden_var) id.loc in - let new_exp = Ast_helper.Exp.mk (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 = Ast_helper.Pat.mk (Ppat_var (Location.mkloc hidden_var loc)) ~loc in - Ast_helper.Exp.mk (Pexp_fun (Nolabel, None, pattern, exp_apply)) ~loc - | None -> - exp_apply - in - (args, wrap) - - let rec parse_lident p = - let recover_lident p = - if ( - Token.is_keyword p.Parser.token && - p.Parser.prev_end_pos.pos_lnum == p.start_pos.pos_lnum - ) - then ( - Parser.err p (Diagnostics.lident p.Parser.token); - Parser.next p; - None - ) else ( - let rec loop p = - if not (Recover.should_abort_list_parse p) - then begin - Parser.next p; - loop p - end - in - Parser.next p; - loop p; - match p.Parser.token with - | Lident _ -> Some () - | _ -> None - ) - in - let start_pos = p.Parser.start_pos in - match p.Parser.token with - | Lident ident -> - Parser.next p; - let loc = mk_loc start_pos p.prev_end_pos in - (ident, loc) - | List -> - Parser.next p; - let loc = mk_loc start_pos p.prev_end_pos in - ("list", loc) - | _ -> - begin match recover_lident p with - | Some () -> - parse_lident p - | None -> - ("_", mk_loc start_pos p.prev_end_pos) - end - - let parse_ident ~msg ~start_pos p = - match p.Parser.token with - | Lident ident - | Uident ident -> - Parser.next p; - let loc = mk_loc start_pos p.prev_end_pos in - (ident, loc) - | List -> - Parser.next p; - let loc = mk_loc start_pos p.prev_end_pos in - ("list", loc) - | _token -> - Parser.err p (Diagnostics.message msg); - Parser.next p; - ("_", mk_loc start_pos p.prev_end_pos) - - let parse_hash_ident ~start_pos p = - Parser.expect Hash p; - parse_ident ~start_pos ~msg:ErrorMessages.variant_ident p - - (* Ldot (Ldot (Lident "Foo", "Bar"), "baz") *) - let parse_value_path p = - let start_pos = p.Parser.start_pos in - let rec aux p path = - match p.Parser.token with - | List -> Longident.Ldot(path, "list") - | Lident ident -> Longident.Ldot(path, ident) - | Uident uident -> - Parser.next p; - Parser.expect Dot p; - aux p (Ldot (path, uident)) - | token -> - Parser.err p (Diagnostics.unexpected token p.breadcrumbs); - Longident.Lident "_" - in - let ident = match p.Parser.token with - | List -> Longident.Lident "list" - | Lident ident -> Longident.Lident ident - | Uident ident -> - Parser.next p; - Parser.expect Dot p; - aux p (Lident ident) - | token -> - Parser.err p (Diagnostics.unexpected token p.breadcrumbs); - Longident.Lident "_" - in - Parser.next p; - Location.mkloc ident (mk_loc start_pos p.prev_end_pos) - - let parse_value_path_tail p start_pos ident = - let rec loop p path = - match p.Parser.token with - | Lident ident -> - Parser.next p; - Location.mkloc (Longident.Ldot(path, ident)) (mk_loc start_pos p.prev_end_pos) - | List -> - Parser.next p; - Location.mkloc (Longident.Ldot(path, "list")) (mk_loc start_pos p.prev_end_pos) - | Uident ident -> - Parser.next p; - Parser.expect Dot p; - loop p (Longident.Ldot (path, ident)) - | token -> - Parser.err p (Diagnostics.unexpected token p.breadcrumbs); - Location.mknoloc path - in - loop p ident - - let parse_module_long_ident_tail ~lowercase p start_pos ident = - let rec loop p acc = - match p.Parser.token with - | List when lowercase -> - Parser.next p; - let lident = (Longident.Ldot (acc, "list")) in - Location.mkloc lident (mk_loc start_pos p.prev_end_pos) - | Lident ident when lowercase -> - Parser.next p; - let lident = (Longident.Ldot (acc, ident)) in - Location.mkloc lident (mk_loc start_pos p.prev_end_pos) - | Uident ident -> - Parser.next p; - let end_pos = p.prev_end_pos in - let lident = (Longident.Ldot (acc, ident)) in - begin match p.Parser.token with - | Dot -> - Parser.next p; - loop p lident - | _ -> Location.mkloc lident (mk_loc start_pos end_pos) - end - | t -> - Parser.err p (Diagnostics.uident t); - Location.mkloc acc (mk_loc start_pos p.prev_end_pos) - in - loop p ident - - (* Parses module identifiers: - Foo - Foo.Bar *) - let parse_module_long_ident ~lowercase p = - (* Parser.leaveBreadcrumb p Reporting.ModuleLongIdent; *) - let start_pos = p.Parser.start_pos in - let module_ident = match p.Parser.token with - | List when lowercase -> - let loc = mk_loc start_pos p.end_pos in - Parser.next p; - Location.mkloc (Longident.Lident "list") loc - | Lident ident when lowercase -> - let loc = mk_loc start_pos p.end_pos in - let lident = Longident.Lident ident in - Parser.next p; - Location.mkloc lident loc - | Uident ident -> - let lident = Longident.Lident ident in - let end_pos = p.end_pos in - Parser.next p; - begin match p.Parser.token with - | Dot -> - Parser.next p; - parse_module_long_ident_tail ~lowercase p start_pos lident - | _ -> Location.mkloc lident (mk_loc start_pos end_pos) - end - | t -> - Parser.err p (Diagnostics.uident t); - Location.mkloc (Longident.Lident "_") (mk_loc start_pos p.prev_end_pos) - in - (* Parser.eatBreadcrumb p; *) - module_ident - - (* `window.location` or `Math` or `Foo.Bar` *) - let parse_ident_path p = - let rec loop p acc = - match p.Parser.token with - | Uident ident | Lident ident -> - Parser.next p; - let lident = (Longident.Ldot (acc, ident)) in - begin match p.Parser.token with - | Dot -> - Parser.next p; - loop p lident - | _ -> lident - end - | _t -> acc - in - match p.Parser.token with - | Lident ident | Uident ident -> - Parser.next p; - begin match p.Parser.token with - | Dot -> - Parser.next p; - loop p (Longident.Lident ident) - | _ -> Longident.Lident ident - end - | _ -> - Longident.Lident "_" - - let verify_jsx_opening_closing_name p name_expr = - let closing = match p.Parser.token with - | Lident lident -> Parser.next p; Longident.Lident lident - | Uident _ -> - (parse_module_long_ident ~lowercase:false p).txt - | _ -> Longident.Lident "" - in - match name_expr.Parsetree.pexp_desc with - | Pexp_ident opening_ident -> - let opening = - let without_create_element = - Longident.flatten opening_ident.txt - |> List.filter (fun s -> s <> "createElement") - in - match (Longident.unflatten without_create_element) with - | Some li -> li - | None -> Longident.Lident "" - in - opening = closing - | _ -> assert false - - let string_of_pexp_ident name_expr = - match name_expr.Parsetree.pexp_desc with - | Pexp_ident opening_ident -> - Longident.flatten opening_ident.txt - |> List.filter (fun s -> s <> "createElement") - |> String.concat "." - | _ -> "" - - (* open-def ::= - * | open module-path - * | open! module-path *) - let parse_open_description ~attrs p = - Parser.leave_breadcrumb p Grammar.OpenDescription; - let start_pos = p.Parser.start_pos in - Parser.expect Open p; - let override = if Parser.optional p Token.Bang then - Asttypes.Override - else - Asttypes.Fresh - in - let modident = parse_module_long_ident ~lowercase:false p in - let loc = mk_loc start_pos p.prev_end_pos in - Parser.eat_breadcrumb p; - Ast_helper.Opn.mk ~loc ~attrs ~override modident - - let hex_value x = - match x with - | '0' .. '9' -> - (Char.code x) - 48 - | 'A' .. 'Z' -> - (Char.code x) - 55 - | 'a' .. 'z' -> - (Char.code x) - 97 - | _ -> 16 - - let parse_string_literal s = - let len = String.length s in - let b = Buffer.create (String.length s) in - - let rec loop i = - if i = len then - () - else - let c = String.unsafe_get s i in - match c with - | '\\' as c -> - let next_ix = i + 1 in - if next_ix < len then - let next_char = String.unsafe_get s next_ix in - begin match next_char with - | 'n' -> - Buffer.add_char b '\010'; - loop (next_ix + 1) - | 'r' -> - Buffer.add_char b '\013'; - loop (next_ix + 1) - | 'b' -> - Buffer.add_char b '\008'; - loop (next_ix + 1) - | 't' -> - Buffer.add_char b '\009'; - loop (next_ix + 1) - | '\\' as c -> - Buffer.add_char b c; - loop (next_ix + 1) - | ' ' as c -> - Buffer.add_char b c; - loop (next_ix + 1) - | '\'' as c -> - Buffer.add_char b c; - loop (next_ix + 1) - | '\"' as c -> - Buffer.add_char b c; - loop (next_ix + 1) - | '0' .. '9' -> - if next_ix + 2 < len then - let c0 = next_char in - let c1 = (String.unsafe_get s (next_ix + 1)) in - let c2 = (String.unsafe_get s (next_ix + 2)) in - let c = - 100 * (Char.code c0 - 48) + - 10 * (Char.code c1 - 48) + - (Char.code c2 - 48) - in - if (c < 0 || c > 255) then ( - Buffer.add_char b '\\'; - Buffer.add_char b c0; - Buffer.add_char b c1; - Buffer.add_char b c2; - loop (next_ix + 3) - ) else ( - Buffer.add_char b (Char.unsafe_chr c); - loop (next_ix + 3) - ) - else ( - Buffer.add_char b '\\'; - Buffer.add_char b next_char; - loop (next_ix + 1) - ) - | 'o' -> - if next_ix + 3 < len then - let c0 = (String.unsafe_get s (next_ix + 1)) in - let c1 = (String.unsafe_get s (next_ix + 2)) in - let c2 = (String.unsafe_get s (next_ix + 3)) in - let c = - 64 * (Char.code c0 - 48) + - 8 * (Char.code c1 - 48) + - (Char.code c2 - 48) - in - if (c < 0 || c > 255) then ( - Buffer.add_char b '\\'; - Buffer.add_char b '0'; - Buffer.add_char b c0; - Buffer.add_char b c1; - Buffer.add_char b c2; - loop (next_ix + 4) - ) else ( - Buffer.add_char b (Char.unsafe_chr c); - loop (next_ix + 4) - ) - else ( - Buffer.add_char b '\\'; - Buffer.add_char b next_char; - loop (next_ix + 1) - ) - | 'x' as c -> - if next_ix + 2 < len then - let c0 = (String.unsafe_get s (next_ix + 1)) in - let c1 = (String.unsafe_get s (next_ix + 2)) in - let c = (16 * (hex_value c0)) + (hex_value c1) in - if (c < 0 || c > 255) then ( - Buffer.add_char b '\\'; - Buffer.add_char b 'x'; - Buffer.add_char b c0; - Buffer.add_char b c1; - loop (next_ix + 3) - ) else ( - Buffer.add_char b (Char.unsafe_chr c); - loop (next_ix + 3) - ) - else ( - Buffer.add_char b '\\'; - Buffer.add_char b c; - loop (next_ix + 2) - ) - | _ -> - Buffer.add_char b c; - Buffer.add_char b next_char; - loop (next_ix + 1) - end - else ( - Buffer.add_char b c; - () - ) - | c -> - Buffer.add_char b c; - loop (i + 1) - in - loop 0; - Buffer.contents b - - let parse_template_string_literal s = - let len = String.length s in - let b = Buffer.create len in - - let rec loop i = - if i < len then - let c = String.unsafe_get s i in - match c with - | '\\' as c -> - if i + 1 < len then - let next_char = String.unsafe_get s (i + 1) in - begin match next_char with - | '\\' as c -> - Buffer.add_char b c; - loop (i + 2) - | '$' as c -> - Buffer.add_char b c; - loop (i + 2) - | '`' as c -> - Buffer.add_char b c; - loop (i + 2) - | c -> - Buffer.add_char b '\\'; - Buffer.add_char b c; - loop (i + 2) - end - else ( - Buffer.add_char b c - ) - - | c -> - Buffer.add_char b c; - loop (i + 1) - - else - () - in - loop 0; - Buffer.contents b - - (* constant ::= integer-literal *) - (* ∣ float-literal *) - (* ∣ string-literal *) - let parse_constant p = - let is_negative = match p.Parser.token with - | Token.Minus -> Parser.next p; true - | Plus -> Parser.next p; false - | _ -> false - in - let constant = match p.Parser.token with - | Int {i; suffix} -> - let int_txt = if is_negative then "-" ^ i else i in - Parsetree.Pconst_integer (int_txt, suffix) - | Float {f; suffix} -> - let float_txt = if is_negative then "-" ^ f else f in - Parsetree.Pconst_float (float_txt, suffix) - | String s -> - let txt = if p.mode = ParseForTypeChecker then - parse_string_literal s - else - s - in - Pconst_string(txt, None) - | Character c -> Pconst_char c - | token -> - Parser.err p (Diagnostics.unexpected token p.breadcrumbs); - Pconst_string("", None) - in - Parser.next p; - constant - - let parse_comma_delimited_region p ~grammar ~closing ~f = - Parser.leave_breadcrumb p grammar; - let rec loop nodes = - match f p with - | Some node -> - begin match p.Parser.token with - | Comma -> - Parser.next p; - loop (node::nodes) - | token when token = closing || token = Eof -> - List.rev (node::nodes) - | _ -> - if not (p.token = Eof || p.token = closing || Recover.should_abort_list_parse p) then - Parser.expect Comma p; - if p.token = Semicolon then Parser.next p; - loop (node::nodes) - end - | None -> - if p.token = Eof || p.token = closing || Recover.should_abort_list_parse p then - List.rev nodes - else ( - Parser.err p (Diagnostics.unexpected p.token p.breadcrumbs); - Parser.next p; - loop nodes - ); - in - let nodes = loop [] in - Parser.eat_breadcrumb p; - nodes - - let parse_comma_delimited_reversed_list p ~grammar ~closing ~f = - Parser.leave_breadcrumb p grammar; - let rec loop nodes = - match f p with - | Some node -> - begin match p.Parser.token with - | Comma -> - Parser.next p; - loop (node::nodes) - | token when token = closing || token = Eof -> - (node::nodes) - | _ -> - if not (p.token = Eof || p.token = closing || Recover.should_abort_list_parse p) then - Parser.expect Comma p; - if p.token = Semicolon then Parser.next p; - loop (node::nodes) - end - | None -> - if p.token = Eof || p.token = closing || Recover.should_abort_list_parse p then - nodes - else ( - Parser.err p (Diagnostics.unexpected p.token p.breadcrumbs); - Parser.next p; - loop nodes - ); - in - let nodes = loop [] in - Parser.eat_breadcrumb p; - nodes - - let parse_delimited_region p ~grammar ~closing ~f = - Parser.leave_breadcrumb p grammar; - let rec loop nodes = - match f p with - | Some node -> - loop (node::nodes) - | None -> - if ( - p.Parser.token = Token.Eof || - p.token = closing || - Recover.should_abort_list_parse p - ) then - List.rev nodes - else ( - Parser.err p (Diagnostics.unexpected p.token p.breadcrumbs); - Parser.next p; - loop nodes - ) - in - let nodes = loop [] in - Parser.eat_breadcrumb p; - nodes - - let parse_region p ~grammar ~f = - Parser.leave_breadcrumb p grammar; - let rec loop nodes = - match f p with - | Some node -> - loop (node::nodes) - | None -> - if p.Parser.token = Token.Eof || Recover.should_abort_list_parse p then - List.rev nodes - else ( - Parser.err p (Diagnostics.unexpected p.token p.breadcrumbs); - Parser.next p; - loop nodes - ) - in - let nodes = loop [] in - Parser.eat_breadcrumb p; - nodes - - (* let-binding ::= pattern = expr *) - (* ∣ value-name { parameter } [: typexpr] [:> typexpr] = expr *) - (* ∣ value-name : poly-typexpr = expr *) - - (* pattern ::= value-name *) - (* ∣ _ *) - (* ∣ constant *) - (* ∣ pattern as value-name *) - (* ∣ ( pattern ) *) - (* ∣ ( pattern : typexpr ) *) - (* ∣ pattern | pattern *) - (* ∣ constr pattern *) - (* ∣ #variant variant-pattern *) - (* ∣ ##type *) - (* ∣ / pattern { , pattern }+ / *) - (* ∣ { field [: typexpr] [= pattern] { ; field [: typexpr] [= pattern] } [; _ ] [ ; ] } *) - (* ∣ [ pattern { ; pattern } [ ; ] ] *) - (* ∣ pattern :: pattern *) - (* ∣ [| pattern { ; pattern } [ ; ] |] *) - (* ∣ char-literal .. char-literal *) - (* ∣ exception pattern *) - let rec parse_pattern ?(alias=true) ?(or_=true) p = - let start_pos = p.Parser.start_pos in - let attrs = parse_attributes p in - let pat = match p.Parser.token with - | (True | False) as token -> - let end_pos = p.end_pos in - Parser.next p; - let loc = mk_loc start_pos end_pos in - Ast_helper.Pat.construct ~loc - (Location.mkloc (Longident.Lident (Token.to_string token)) loc) None - | Int _ | String _ | Float _ | Character _ | Minus | Plus -> - let c = parse_constant p in - begin match p.token with - | DotDot -> - Parser.next p; - let c2 = parse_constant p in - Ast_helper.Pat.interval ~loc:(mk_loc start_pos p.prev_end_pos) c c2 - | _ -> - Ast_helper.Pat.constant ~loc:(mk_loc start_pos p.prev_end_pos) c - end - | Lparen -> - Parser.next p; - begin match p.token with - | Rparen -> - Parser.next p; - let loc = mk_loc start_pos p.prev_end_pos in - let lid = Location.mkloc (Longident.Lident "()") loc in - Ast_helper.Pat.construct ~loc lid None - | _ -> - let pat = parse_constrained_pattern p in - begin match p.token with - | Comma -> - Parser.next p; - parse_tuple_pattern ~attrs ~first:pat ~start_pos p - | _ -> - Parser.expect Rparen p; - let loc = mk_loc start_pos p.prev_end_pos in - {pat with ppat_loc = loc} - end - end - | Lbracket -> - parse_array_pattern ~attrs p - | Lbrace -> - parse_record_pattern ~attrs p - | Underscore -> - let end_pos = p.end_pos in - let loc = mk_loc start_pos end_pos in - Parser.next p; - Ast_helper.Pat.any ~loc ~attrs () - | Lident ident -> - let end_pos = p.end_pos in - let loc = mk_loc start_pos end_pos in - Parser.next p; - Ast_helper.Pat.var ~loc ~attrs (Location.mkloc ident loc) - | Uident _ -> - let constr = parse_module_long_ident ~lowercase:false p in - begin match p.Parser.token with - | Lparen -> - parse_constructor_pattern_args p constr start_pos attrs - | _ -> - Ast_helper.Pat.construct ~loc:constr.loc ~attrs constr None - end - | Hash -> - let (ident, loc) = parse_hash_ident ~start_pos p in - begin match p.Parser.token with - | Lparen -> - parse_variant_pattern_args p ident start_pos attrs - | _ -> - Ast_helper.Pat.variant ~loc ~attrs ident None - end - | HashHash -> - Parser.next p; - let ident = parse_value_path p in - let loc = mk_loc start_pos ident.loc.loc_end in - Ast_helper.Pat.type_ ~loc ~attrs ident - | Exception -> - Parser.next p; - let pat = parse_pattern ~alias:false ~or_:false p in - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Pat.exception_ ~loc ~attrs pat - | Lazy -> - Parser.next p; - let pat = parse_pattern ~alias:false ~or_:false p in - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Pat.lazy_ ~loc ~attrs pat - | List -> - Parser.next p; - begin match p.token with - | Lbracket -> - parse_list_pattern ~start_pos ~attrs p - | _ -> - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Pat.var ~loc ~attrs (Location.mkloc "list" loc) - end - | Module -> - parse_module_pattern ~attrs p - | Percent -> - let extension = parse_extension p in - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Pat.extension ~loc ~attrs extension - | token -> - Parser.err p (Diagnostics.unexpected token p.breadcrumbs); - begin match skip_tokens_and_maybe_retry p ~is_start_of_grammar:Grammar.is_atomic_pattern_start with - | None -> - Recover.default_pattern() - | Some () -> - parse_pattern p - end - in - let pat = if alias then parse_alias_pattern ~attrs pat p else pat in - if or_ then parse_or_pattern pat p else pat - - and skip_tokens_and_maybe_retry p ~is_start_of_grammar = - if Token.is_keyword p.Parser.token - && p.Parser.prev_end_pos.pos_lnum == p.start_pos.pos_lnum - then ( - Parser.next p; - None - ) else ( - if Recover.should_abort_list_parse p then - begin - if is_start_of_grammar p.Parser.token then - begin - Parser.next p; - Some () - end - else - None - end - else - begin - Parser.next p; - let rec loop p = - if not (Recover.should_abort_list_parse p) - then begin - Parser.next p; - loop p - end in - loop p; - if is_start_of_grammar p.Parser.token then - Some () - else - None - end - ) - - (* alias ::= pattern as lident *) - and parse_alias_pattern ~attrs pattern p = - match p.Parser.token with - | As -> - Parser.next p; - let (name, loc) = parse_lident p in - let name = Location.mkloc name loc in - Ast_helper.Pat.alias - ~loc:({pattern.ppat_loc with loc_end = p.prev_end_pos}) - ~attrs - pattern - name - | _ -> pattern - - (* or ::= pattern | pattern - * precedence: Red | Blue | Green is interpreted as (Red | Blue) | Green *) - and parse_or_pattern pattern1 p = - let rec loop pattern1 = - match p.Parser.token with - | Bar -> - Parser.next p; - let pattern2 = parse_pattern ~or_:false p in - let loc = { pattern1.Parsetree.ppat_loc with - loc_end = pattern2.ppat_loc.loc_end - } in - loop (Ast_helper.Pat.or_ ~loc pattern1 pattern2) - | _ -> pattern1 - in - loop pattern1 - - and parse_non_spread_pattern ~msg p = - let () = match p.Parser.token with - | DotDotDot -> - Parser.err p (Diagnostics.message msg); - Parser.next p; - | _ -> () - in - match p.Parser.token with - | token when Grammar.is_pattern_start token -> - let pat = parse_pattern p in - begin match p.Parser.token with - | Colon -> - Parser.next p; - let typ = parse_typ_expr p in - let loc = mk_loc pat.ppat_loc.loc_start typ.Parsetree.ptyp_loc.loc_end in - Some (Ast_helper.Pat.constraint_ ~loc pat typ) - | _ -> Some pat - end - | _ -> None - - and parse_constrained_pattern p = - let pat = parse_pattern p in - match p.Parser.token with - | Colon -> - Parser.next p; - let typ = parse_typ_expr p in - let loc = mk_loc pat.ppat_loc.loc_start typ.Parsetree.ptyp_loc.loc_end in - Ast_helper.Pat.constraint_ ~loc pat typ - | _ -> pat - - and parse_constrained_pattern_region p = - match p.Parser.token with - | token when Grammar.is_pattern_start token -> - Some (parse_constrained_pattern p) - | _ -> None - - (* field ::= - * | longident - * | longident : pattern - * | longident as lident - * - * row ::= - * | field , - * | field , _ - * | field , _, - *) - and parse_record_pattern_field p = - let start_pos = p.Parser.start_pos in - let label = parse_value_path p in - let pattern = match p.Parser.token with - | Colon -> - Parser.next p; - parse_pattern p - | _ -> - Ast_helper.Pat.var - ~loc:label.loc - (Location.mkloc (Longident.last label.txt) label.loc) - in - match p.token with - | As -> - Parser.next p; - let (name, loc) = parse_lident p in - let name = Location.mkloc name loc in - let alias_pattern = Ast_helper.Pat.alias - ~loc:(mk_loc start_pos p.prev_end_pos) - pattern - name - in - (Location.mkloc label.txt (mk_loc start_pos alias_pattern.ppat_loc.loc_end), alias_pattern) - | _ -> - (label, pattern) - - (* TODO: there are better representations than PatField|Underscore ? *) - and parse_record_pattern_item p = - match p.Parser.token with - | DotDotDot -> - Parser.next p; - Some (true, PatField (parse_record_pattern_field p)) - | Uident _ | Lident _ -> - Some (false, PatField (parse_record_pattern_field p)) - | Underscore -> - Parser.next p; - Some (false, PatUnderscore) - | _ -> - None - - and parse_record_pattern ~attrs p = - let start_pos = p.start_pos in - Parser.expect Lbrace p; - let raw_fields = - parse_comma_delimited_reversed_list p - ~grammar:PatternRecord - ~closing:Rbrace - ~f:parse_record_pattern_item - in - Parser.expect Rbrace p; - let (fields, closed_flag) = - let (raw_fields, flag) = match raw_fields with - | (_hasSpread, PatUnderscore)::rest -> - (rest, Asttypes.Open) - | raw_fields -> - (raw_fields, Asttypes.Closed) - in - List.fold_left (fun (fields, flag) curr -> - let (has_spread, field) = curr in - match field with - | PatField field -> - if has_spread then ( - let (_, pattern) = field in - Parser.err ~start_pos:pattern.Parsetree.ppat_loc.loc_start p (Diagnostics.message ErrorMessages.record_pattern_spread) - ); - (field::fields, flag) - | PatUnderscore -> - (fields, flag) - ) ([], flag) raw_fields - in - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Pat.record ~loc ~attrs fields closed_flag - - and parse_tuple_pattern ~attrs ~first ~start_pos p = - let patterns = - parse_comma_delimited_region p - ~grammar:Grammar.PatternList - ~closing:Rparen - ~f:parse_constrained_pattern_region - in - Parser.expect Rparen p; - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Pat.tuple ~loc ~attrs (first::patterns) - - and parse_pattern_region p = - match p.Parser.token with - | DotDotDot -> - Parser.next p; - Some (true, parse_constrained_pattern p) - | token when Grammar.is_pattern_start token -> - Some (false, parse_constrained_pattern p) - | _ -> None - - and parse_module_pattern ~attrs p = - let start_pos = p.Parser.start_pos in - Parser.expect Module p; - Parser.expect Lparen p; - let uident = match p.token with - | Uident uident -> - let loc = mk_loc p.start_pos p.end_pos in - Parser.next p; - Location.mkloc uident loc - | _ -> (* TODO: error recovery *) - Location.mknoloc "_" - in - begin match p.token with - | Colon -> - let colon_start = p.Parser.start_pos in - Parser.next p; - let package_typ_attrs = parse_attributes p in - let package_type = parse_package_type ~start_pos:colon_start ~attrs:package_typ_attrs p in - Parser.expect Rparen p; - let loc = mk_loc start_pos p.prev_end_pos in - let unpack = Ast_helper.Pat.unpack ~loc:uident.loc uident in - Ast_helper.Pat.constraint_ - ~loc - ~attrs - unpack - package_type - | _ -> - Parser.expect Rparen p; - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Pat.unpack ~loc ~attrs uident - end - - and parse_list_pattern ~start_pos ~attrs p = - Parser.expect Lbracket p; - let list_patterns = - parse_comma_delimited_reversed_list p - ~grammar:Grammar.PatternOcamlList - ~closing:Rbracket - ~f:parse_pattern_region - in - Parser.expect Rbracket p; - let loc = mk_loc start_pos p.prev_end_pos in - let filter_spread (has_spread, pattern) = - if has_spread then ( - Parser.err - ~start_pos:pattern.Parsetree.ppat_loc.loc_start - p - (Diagnostics.message ErrorMessages.list_pattern_spread); - pattern - ) else - pattern - in - match list_patterns with - | (true, pattern)::patterns -> - let patterns = patterns |> List.map filter_spread |> List.rev in - let pat = make_list_pattern loc patterns (Some pattern) in - {pat with ppat_loc = loc; ppat_attributes = attrs;} - | patterns -> - let patterns = patterns |> List.map filter_spread |> List.rev in - let pat = make_list_pattern loc patterns None in - {pat with ppat_loc = loc; ppat_attributes = attrs;} - - and parse_array_pattern ~attrs p = - let start_pos = p.start_pos in - Parser.expect Lbracket p; - let patterns = - parse_comma_delimited_region - p - ~grammar:Grammar.PatternList - ~closing:Rbracket - ~f:(parse_non_spread_pattern ~msg:ErrorMessages.array_pattern_spread) - in - Parser.expect Rbracket p; - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Pat.array ~loc ~attrs patterns - - and parse_constructor_pattern_args p constr start_pos attrs = - let lparen = p.start_pos in - Parser.expect Lparen p; - let args = parse_comma_delimited_region - p ~grammar:Grammar.PatternList ~closing:Rparen ~f:parse_constrained_pattern_region - in - Parser.expect Rparen p; - let args = match args with - | [] -> - let loc = mk_loc lparen p.prev_end_pos in - Some ( - Ast_helper.Pat.construct ~loc (Location.mkloc (Longident.Lident "()") loc) None - ) - | [{ppat_desc = Ppat_tuple _} as pat] as patterns -> - if p.mode = ParseForTypeChecker then - (* Some(1, 2) for type-checker *) - Some pat - else - (* Some((1, 2)) for printer *) - Some (Ast_helper.Pat.tuple ~loc:(mk_loc lparen p.end_pos) patterns) - | [pattern] -> Some pattern - | patterns -> - Some (Ast_helper.Pat.tuple ~loc:(mk_loc lparen p.end_pos) patterns) - in - Ast_helper.Pat.construct ~loc:(mk_loc start_pos p.prev_end_pos) ~attrs constr args - - and parse_variant_pattern_args p ident start_pos attrs = - let lparen = p.start_pos in - Parser.expect Lparen p; - let patterns = - parse_comma_delimited_region - p ~grammar:Grammar.PatternList ~closing:Rparen ~f:parse_constrained_pattern_region in - let args = - match patterns with - | [{ppat_desc = Ppat_tuple _} as pat] as patterns -> - if p.mode = ParseForTypeChecker then - (* #ident(1, 2) for type-checker *) - Some pat - else - (* #ident((1, 2)) for printer *) - Some (Ast_helper.Pat.tuple ~loc:(mk_loc lparen p.end_pos) patterns) - | [pattern] -> Some pattern - | patterns -> - Some (Ast_helper.Pat.tuple ~loc:(mk_loc lparen p.end_pos) patterns) - in - Parser.expect Rparen p; - Ast_helper.Pat.variant ~loc:(mk_loc start_pos p.prev_end_pos) ~attrs ident args - - and parse_expr ?(context=OrdinaryExpr) p = - let expr = parse_operand_expr ~context p in - let expr = parse_binary_expr ~context ~a:expr p 1 in - parse_ternary_expr expr p - - (* expr ? expr : expr *) - and parse_ternary_expr left_operand p = - match p.Parser.token with - | Question -> - Parser.leave_breadcrumb p Grammar.Ternary; - Parser.next p; - let true_branch = parse_expr ~context:TernaryTrueBranchExpr p in - Parser.expect Colon p; - let false_branch = parse_expr p in - Parser.eat_breadcrumb p; - let loc = {left_operand.Parsetree.pexp_loc with - loc_start = left_operand.pexp_loc.loc_start; - loc_end = false_branch.Parsetree.pexp_loc.loc_end; - } in - Ast_helper.Exp.ifthenelse - ~attrs:[ternary_attr] ~loc - left_operand true_branch (Some false_branch) - | _ -> - left_operand - - and parse_es6_arrow_expression ?parameters p = - let start_pos = p.Parser.start_pos in - Parser.leave_breadcrumb p Grammar.Es6ArrowExpr; - let parameters = match parameters with - | Some params -> params - | None -> parse_parameters p - in - let return_type = match p.Parser.token with - | Colon -> - Parser.next p; - Some (parse_typ_expr ~es6_arrow:false p) - | _ -> - None - in - Parser.expect EqualGreater p; - let body = - let expr = parse_expr p in - match return_type with - | Some typ -> - Ast_helper.Exp.constraint_ - ~loc:(mk_loc expr.pexp_loc.loc_start typ.Parsetree.ptyp_loc.loc_end) expr typ - | None -> expr - in - Parser.eat_breadcrumb p; - let end_pos = p.prev_end_pos in - let arrow_expr = - List.fold_right (fun parameter expr -> - match parameter with - | TermParameter {uncurried; attrs; label = lbl; expr = default_expr; pat; pos = start_pos} -> - let attrs = if uncurried then uncurry_attr::attrs else attrs in - Ast_helper.Exp.fun_ ~loc:(mk_loc start_pos end_pos) ~attrs lbl default_expr pat expr - | TypeParameter {uncurried; attrs; locs = newtypes; pos = start_pos} -> - let attrs = if uncurried then uncurry_attr::attrs else attrs in - make_newtypes ~attrs ~loc:(mk_loc start_pos end_pos) newtypes expr - ) parameters body - in - {arrow_expr with pexp_loc = {arrow_expr.pexp_loc with loc_start = start_pos}} - - (* - * uncurried_parameter ::= - * | . parameter - * - * parameter ::= - * | pattern - * | pattern : type - * | ~ labelName - * | ~ labelName as pattern - * | ~ labelName as pattern : type - * | ~ labelName = expr - * | ~ labelName as pattern = expr - * | ~ labelName as pattern : type = expr - * | ~ labelName = ? - * | ~ labelName as pattern = ? - * | ~ labelName as pattern : type = ? - * - * labelName ::= lident - *) - and parse_parameter p = - if ( - p.Parser.token = Token.Typ || - p.token = Tilde || - p.token = Dot || - Grammar.is_pattern_start p.token - ) then ( - let start_pos = p.Parser.start_pos in - let uncurried = Parser.optional p Token.Dot in - (* two scenarios: - * attrs ~lbl ... - * attrs pattern - * Attributes before a labelled arg, indicate that it's on the whole arrow expr - * Otherwise it's part of the pattern - * *) - let attrs = parse_attributes p in - if p.Parser.token = Typ then ( - Parser.next p; - let lidents = parse_lident_list p in - Some (TypeParameter {uncurried; attrs; locs = lidents; pos = start_pos}) - ) else ( - let (attrs, lbl, pat) = match p.Parser.token with - | Tilde -> - Parser.next p; - let (lbl_name, loc) = parse_lident p in - let prop_loc_attr = (Location.mkloc "res.namedArgLoc" loc, Parsetree.PStr []) in - begin match p.Parser.token with - | Comma | Equal | Rparen -> - let loc = mk_loc start_pos p.prev_end_pos in - ( - attrs, - Asttypes.Labelled lbl_name, - Ast_helper.Pat.var ~attrs:[prop_loc_attr] ~loc (Location.mkloc lbl_name loc) - ) - | Colon -> - let lbl_end = p.prev_end_pos in - Parser.next p; - let typ = parse_typ_expr p in - let loc = mk_loc start_pos lbl_end in - let pat = - let pat = Ast_helper.Pat.var ~loc (Location.mkloc lbl_name loc) in - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Pat.constraint_ ~attrs:[prop_loc_attr] ~loc pat typ in - (attrs, Asttypes.Labelled lbl_name, pat) - | As -> - Parser.next p; - let pat = - let pat = parse_constrained_pattern p in - {pat with ppat_attributes = prop_loc_attr::pat.ppat_attributes} - in - (attrs, Asttypes.Labelled lbl_name, pat) - | t -> - Parser.err p (Diagnostics.unexpected t p.breadcrumbs); - let loc = mk_loc start_pos p.prev_end_pos in - ( - attrs, - Asttypes.Labelled lbl_name, - Ast_helper.Pat.var ~loc (Location.mkloc lbl_name loc) - ) - end - | _ -> - let pattern = parse_constrained_pattern p in - let attrs = List.concat [attrs; pattern.ppat_attributes] in - ([], Asttypes.Nolabel, {pattern with ppat_attributes = attrs}) - in - match p.Parser.token with - | Equal -> - Parser.next p; - let lbl = match lbl with - | Asttypes.Labelled lbl_name -> Asttypes.Optional lbl_name - | Asttypes.Optional _ as lbl -> lbl - | Asttypes.Nolabel -> Asttypes.Nolabel - in - begin match p.Parser.token with - | Question -> - Parser.next p; - Some (TermParameter {uncurried; attrs; label = lbl; expr = None; pat; pos = start_pos}) - | _ -> - let expr = parse_constrained_or_coerced_expr p in - Some (TermParameter {uncurried; attrs; label = lbl; expr = Some expr; pat; pos = start_pos}) - end - | _ -> - Some (TermParameter {uncurried; attrs; label = lbl; expr = None; pat; pos = start_pos}) - ) - ) else None - - and parse_parameter_list p = - let parameters = - parse_comma_delimited_region - ~grammar:Grammar.ParameterList - ~f:parse_parameter - ~closing:Rparen - p - in - Parser.expect Rparen p; - parameters - - (* parameters ::= - * | _ - * | lident - * | () - * | (.) - * | ( parameter {, parameter} [,] ) - *) - and parse_parameters p = - let start_pos = p.Parser.start_pos in - match p.Parser.token with - | Lident ident -> - Parser.next p; - let loc = mk_loc start_pos p.Parser.prev_end_pos in - [TermParameter { - uncurried = false; - attrs = []; - label = Asttypes.Nolabel; - expr = None; - pat = Ast_helper.Pat.var ~loc (Location.mkloc ident loc); - pos = start_pos; - }] - | List -> - Parser.next p; - let loc = mk_loc start_pos p.Parser.prev_end_pos in - [TermParameter { - uncurried = false; - attrs = []; - label = Asttypes.Nolabel; - expr = None; - pat = Ast_helper.Pat.var ~loc (Location.mkloc "list" loc); - pos = start_pos; - }] - | Underscore -> - Parser.next p; - let loc = mk_loc start_pos p.Parser.prev_end_pos in - [TermParameter {uncurried = false; attrs = []; label = Asttypes.Nolabel; expr = None; pat = Ast_helper.Pat.any ~loc (); pos = start_pos}] - | Lparen -> - Parser.next p; - begin match p.Parser.token with - | Rparen -> - Parser.next p; - let loc = mk_loc start_pos p.Parser.prev_end_pos in - let unit_pattern = Ast_helper.Pat.construct - ~loc (Location.mkloc (Longident.Lident "()") loc) None - in - [TermParameter {uncurried = false; attrs = []; label = Asttypes.Nolabel; expr = None; pat = unit_pattern; pos = start_pos}] - | Dot -> - Parser.next p; - begin match p.token with - | Rparen -> - Parser.next p; - let loc = mk_loc start_pos p.Parser.prev_end_pos in - let unit_pattern = Ast_helper.Pat.construct - ~loc (Location.mkloc (Longident.Lident "()") loc) None - in - [TermParameter {uncurried = true; attrs = []; label = Asttypes.Nolabel; expr = None; pat = unit_pattern; pos = start_pos}] - | _ -> - begin match parse_parameter_list p with - | (TermParameter {attrs; label = lbl; expr = default_expr; pat = pattern; pos = start_pos})::rest -> - (TermParameter {uncurried = true; attrs; label = lbl; expr = default_expr; pat = pattern; pos = start_pos})::rest - | parameters -> parameters - end - end - | _ -> parse_parameter_list p - end - | token -> - Parser.err p (Diagnostics.unexpected token p.breadcrumbs); - [] - - and parse_coerced_expr ~(expr: Parsetree.expression) p = - Parser.expect ColonGreaterThan p; - let typ = parse_typ_expr p in - let loc = mk_loc expr.pexp_loc.loc_start p.prev_end_pos in - Ast_helper.Exp.coerce ~loc expr None typ - - and parse_constrained_or_coerced_expr p = - let expr = parse_expr p in - match p.Parser.token with - | ColonGreaterThan -> - parse_coerced_expr ~expr p - | Colon -> - Parser.next p; - begin match p.token with - | _ -> - let typ = parse_typ_expr p in - let loc = mk_loc expr.pexp_loc.loc_start typ.ptyp_loc.loc_end in - let expr = Ast_helper.Exp.constraint_ ~loc expr typ in - begin match p.token with - | ColonGreaterThan -> - parse_coerced_expr ~expr p - | _ -> - expr - end - end - | _ -> expr - - - and parse_constrained_expr_region p = - match p.Parser.token with - | token when Grammar.is_expr_start token -> - let expr = parse_expr p in - begin match p.Parser.token with - | Colon -> - Parser.next p; - let typ = parse_typ_expr p in - let loc = mk_loc expr.pexp_loc.loc_start typ.ptyp_loc.loc_end in - Some (Ast_helper.Exp.constraint_ ~loc expr typ) - | _ -> Some expr - end - | _ -> None - - (* Atomic expressions represent unambiguous expressions. - * This means that regardless of the context, these expressions - * are always interpreted correctly. *) - and parse_atomic_expr p = - Parser.leave_breadcrumb p Grammar.ExprOperand; - let start_pos = p.Parser.start_pos in - let expr = match p.Parser.token with - | (True | False) as token -> - Parser.next p; - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Exp.construct ~loc - (Location.mkloc (Longident.Lident (Token.to_string token)) loc) None - | Int _ | String _ | Float _ | Character _ -> - let c = parse_constant p in - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Exp.constant ~loc c - | Backtick -> - let expr = parse_template_expr p in - {expr with pexp_loc = mk_loc start_pos p.prev_end_pos} - | Uident _ | Lident _ -> - parse_value_or_constructor p - | Hash -> - parse_poly_variant_expr p - | Lparen -> - Parser.next p; - begin match p.Parser.token with - | Rparen -> - Parser.next p; - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Exp.construct - ~loc (Location.mkloc (Longident.Lident "()") loc) None - | _t -> - let expr = parse_constrained_or_coerced_expr p in - begin match p.token with - | Comma -> - Parser.next p; - parse_tuple_expr ~start_pos ~first:expr p - | _ -> - Parser.expect Rparen p; - expr - (* {expr with pexp_loc = mkLoc startPos p.prevEndPos} - * What does this location mean here? It means that when there's - * a parenthesized we keep the location here for whitespace interleaving. - * Without the closing paren in the location there will always be an extra - * line. For now we don't include it, because it does weird things - * with for comments. *) - end - end - | List -> - Parser.next p; - begin match p.token with - | Lbracket -> - parse_list_expr ~start_pos p - | _ -> - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Exp.ident ~loc (Location.mkloc (Longident.Lident "list") loc) - end - | Module -> - Parser.next p; - parse_first_class_module_expr ~start_pos p - | Lbracket -> - parse_array_exp p - | Lbrace -> - parse_braced_or_record_expr p - | LessThan -> - parse_jsx p - | Percent -> - let extension = parse_extension p in - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Exp.extension ~loc extension - | Underscore as token -> - (* This case is for error recovery. Not sure if it's the correct place *) - Parser.err p (Diagnostics.lident token); - Parser.next p; - Recover.default_expr () - | token -> - let err_pos = p.prev_end_pos in - begin match skip_tokens_and_maybe_retry p ~is_start_of_grammar:Grammar.is_atomic_expr_start with - | None -> - Parser.err ~start_pos:err_pos p (Diagnostics.unexpected token p.breadcrumbs); - Recover.default_expr () - | Some () -> parse_atomic_expr p - end - in - Parser.eat_breadcrumb p; - expr - - (* module(module-expr) - * module(module-expr : package-type) *) - and parse_first_class_module_expr ~start_pos p = - Parser.expect Lparen p; - - let mod_expr = parse_module_expr p in - let mod_end_loc = p.prev_end_pos in - begin match p.Parser.token with - | Colon -> - let colon_start = p.Parser.start_pos in - Parser.next p; - let attrs = parse_attributes p in - let package_type = parse_package_type ~start_pos:colon_start ~attrs p in - Parser.expect Rparen p; - let loc = mk_loc start_pos mod_end_loc in - let first_class_module = Ast_helper.Exp.pack ~loc mod_expr in - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Exp.constraint_ ~loc first_class_module package_type - | _ -> - Parser.expect Rparen p; - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Exp.pack ~loc mod_expr - end - - and parse_bracket_access p expr start_pos = - Parser.leave_breadcrumb p Grammar.ExprArrayAccess; - let lbracket = p.start_pos in - Parser.next p; - let string_start = p.start_pos in - match p.Parser.token with - | String s -> - Parser.next p; - let string_end = p.prev_end_pos in - Parser.expect Rbracket p; - let rbracket = p.prev_end_pos in - let e = - let ident_loc = mk_loc string_start string_end in - let loc = mk_loc lbracket rbracket in - Ast_helper.Exp.apply ~loc - (Ast_helper.Exp.ident ~loc (Location.mkloc (Longident.Lident "##") loc)) - [Nolabel, expr; Nolabel, (Ast_helper.Exp.ident ~loc:ident_loc (Location.mkloc (Longident.Lident s) ident_loc))] - in - let e = parse_primary_expr ~operand:e p in - let equal_start = p.start_pos in - begin match p.token with - | Equal -> - Parser.next p; - let equal_end = p.prev_end_pos in - let rhs_expr = parse_expr p in - let loc = mk_loc start_pos rhs_expr.pexp_loc.loc_end in - let operator_loc = mk_loc equal_start equal_end in - Ast_helper.Exp.apply ~loc - (Ast_helper.Exp.ident ~loc:operator_loc (Location.mkloc (Longident.Lident "#=") operator_loc)) - [Nolabel, e; Nolabel, rhs_expr] - | _ -> e - end - | _ -> - let access_expr = parse_constrained_or_coerced_expr p in - Parser.expect Rbracket p; - let rbracket = p.prev_end_pos in - let array_loc = mk_loc lbracket rbracket in - begin match p.token with - | Equal -> - Parser.leave_breadcrumb p ExprArrayMutation; - Parser.next p; - let rhs_expr = parse_expr p in - let array_set = Location.mkloc - (Longident.Ldot(Lident "Array", "set")) - array_loc - in - let end_pos = p.prev_end_pos in - let array_set = Ast_helper.Exp.apply - ~loc:(mk_loc start_pos end_pos) - (Ast_helper.Exp.ident ~loc:array_loc array_set) - [Nolabel, expr; Nolabel, access_expr; Nolabel, rhs_expr] - in - Parser.eat_breadcrumb p; - array_set - | _ -> - let end_pos = p.prev_end_pos in - let e = - Ast_helper.Exp.apply - ~loc:(mk_loc start_pos end_pos) - (Ast_helper.Exp.ident - ~loc:array_loc - (Location.mkloc (Longident.Ldot(Lident "Array", "get")) array_loc) - ) - [Nolabel, expr; Nolabel, access_expr] - in - Parser.eat_breadcrumb p; - parse_primary_expr ~operand:e p - end - - (* * A primary expression represents - * - atomic-expr - * - john.age - * - array[0] - * - applyFunctionTo(arg1, arg2) - * - * The "operand" represents the expression that is operated on - *) - and parse_primary_expr ~operand ?(no_call=false) p = - let start_pos = operand.pexp_loc.loc_start in - let rec loop p expr = - match p.Parser.token with - | Dot -> - Parser.next p; - let lident = parse_value_path p in - begin match p.Parser.token with - | Equal when no_call = false -> - Parser.leave_breadcrumb p Grammar.ExprSetField; - Parser.next p; - let target_expr = parse_expr p in - let loc = mk_loc start_pos p.prev_end_pos in - let setfield = Ast_helper.Exp.setfield ~loc expr lident target_expr in - Parser.eat_breadcrumb p; - setfield - | _ -> - let end_pos = p.prev_end_pos in - let loc = mk_loc start_pos end_pos in - loop p (Ast_helper.Exp.field ~loc expr lident) - end - | Lbracket when no_call = false && p.prev_end_pos.pos_lnum == p.start_pos.pos_lnum -> - parse_bracket_access p expr start_pos - | Lparen when no_call = false && p.prev_end_pos.pos_lnum == p.start_pos.pos_lnum -> - loop p (parse_call_expr p expr) - | Backtick when no_call = false && p.prev_end_pos.pos_lnum == p.start_pos.pos_lnum -> - begin match expr.pexp_desc with - | Pexp_ident {txt = Longident.Lident ident} -> - parse_template_expr ~prefix:ident p - | _ -> - Parser.err - ~start_pos:expr.pexp_loc.loc_start - ~end_pos:expr.pexp_loc.loc_end - p - (Diagnostics.message "Tagged template literals are currently restricted to identifiers like: json`null`."); - parse_template_expr p - end - | _ -> expr - in - loop p operand - - (* a unary expression is an expression with only one operand and - * unary operator. Examples: - * -1 - * !condition - * -. 1.6 - *) - and parse_unary_expr p = - let start_pos = p.Parser.start_pos in - match p.Parser.token with - | (Minus | MinusDot | Plus | PlusDot | Bang) as token -> - Parser.leave_breadcrumb p Grammar.ExprUnary; - let token_end = p.end_pos in - Parser.next p; - let operand = parse_unary_expr p in - let unary_expr = make_unary_expr start_pos token_end token operand in - Parser.eat_breadcrumb p; - unary_expr - | _ -> - parse_primary_expr ~operand:(parse_atomic_expr p) p - - (* Represents an "operand" in a binary expression. - * If you have `a + b`, `a` and `b` both represent - * the operands of the binary expression with opeartor `+` *) - and parse_operand_expr ~context p = - let start_pos = p.Parser.start_pos in - let attrs = parse_attributes p in - let expr = match p.Parser.token with - | Assert -> - Parser.next p; - let expr = parse_unary_expr p in - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Exp.assert_ ~loc expr - | Lazy -> - Parser.next p; - let expr = parse_unary_expr p in - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Exp.lazy_ ~loc expr - | Try -> - parse_try_expression p - | If -> - parse_if_expression p - | For -> - parse_for_expression p - | While -> - parse_while_expression p - | Switch -> - parse_switch_expression p - | _ -> - if (context != WhenExpr) && - is_es6_arrow_expression ~in_ternary:(context=TernaryTrueBranchExpr) p - then - parse_es6_arrow_expression p - else - parse_unary_expr p - in - (* let endPos = p.Parser.prevEndPos in *) - {expr with - pexp_attributes = List.concat[expr.Parsetree.pexp_attributes; attrs]; - (* pexp_loc = mkLoc startPos endPos *) - } - - (* a binary expression is an expression that combines two expressions with an - * operator. Examples: - * a + b - * f(x) |> g(y) - *) - and parse_binary_expr ?(context=OrdinaryExpr) ?a p prec = - let a = match a with - | Some e -> e - | None -> parse_operand_expr ~context p - in - let rec loop a = - let token = p.Parser.token in - let token_prec = - match token with - (* Can the minus be interpreted as a binary operator? Or is it a unary? - * let w = { - * x - * -10 - * } - * vs - * let w = { - * width - * - gap - * } - * - * First case is unary, second is a binary operator. - * See Scanner.isBinaryOp *) - | Minus | MinusDot | LessThan when not ( - Scanner.is_binary_op p.scanner.src p.start_pos.pos_cnum p.end_pos.pos_cnum - ) && p.start_pos.pos_lnum > p.prev_end_pos.pos_lnum -> -1 - | token -> Token.precedence token - in - if token_prec < prec then a - else begin - Parser.leave_breadcrumb p (Grammar.ExprBinaryAfterOp token); - let start_pos = p.start_pos in - Parser.next p; - let end_pos = p.prev_end_pos in - let b = parse_binary_expr ~context p (token_prec + 1) in - let loc = mk_loc a.Parsetree.pexp_loc.loc_start b.pexp_loc.loc_end in - let expr = Ast_helper.Exp.apply - ~loc - (make_infix_operator p token start_pos end_pos) - [Nolabel, a; Nolabel, b] - in - loop expr - end - in - loop a - - (* If we even need this, determines if < might be the start of jsx. Not 100% complete *) - (* and isStartOfJsx p = *) - (* Parser.lookahead p (fun p -> *) - (* match p.Parser.token with *) - (* | LessThan -> *) - (* Parser.next p; *) - (* begin match p.token with *) - (* | GreaterThan (* <> *) -> true *) - (* | Lident _ | Uident _ | List -> *) - (* ignore (parseJsxName p); *) - (* begin match p.token with *) - (* | GreaterThan (*
*) -> true *) - (* | Question (* true *) - (* | Lident _ | List -> *) - (* Parser.next p; *) - (* begin match p.token with *) - (* | Equal (* true *) - (* | _ -> false (* TODO *) *) - (* end *) - (* | Forwardslash (* *) - (* Parser.next p; *) - (* begin match p.token with *) - (* | GreaterThan (* *) -> true *) - (* | _ -> false *) - (* end *) - (* | _ -> *) - (* false *) - (* end *) - (* | _ -> false *) - (* end *) - (* | _ -> false *) - (* ) *) - - and parse_template_expr ?(prefix="") p = - let hidden_operator = - let op = Location.mknoloc (Longident.Lident "^") in - Ast_helper.Exp.ident op - in - let rec loop acc p = - let start_pos = p.Parser.start_pos in - match p.Parser.token with - | TemplateTail txt -> - Parser.next p; - let loc = mk_loc start_pos p.prev_end_pos in - if String.length txt > 0 then - let txt = if p.mode = ParseForTypeChecker then parse_template_string_literal txt else txt in - let str = Ast_helper.Exp.constant ~loc (Pconst_string(txt, Some prefix)) in - Ast_helper.Exp.apply ~loc hidden_operator - [Nolabel, acc; Nolabel, str] - else - acc - | TemplatePart txt -> - Parser.next p; - let loc = mk_loc start_pos p.prev_end_pos in - let expr = parse_expr_block p in - let full_loc = mk_loc start_pos p.prev_end_pos in - Scanner.set_template_mode p.scanner; - Parser.expect Rbrace p; - let txt = if p.mode = ParseForTypeChecker then parse_template_string_literal txt else txt in - let str = Ast_helper.Exp.constant ~loc (Pconst_string(txt, Some prefix)) in - let next = - let a = if String.length txt > 0 then - Ast_helper.Exp.apply ~loc:full_loc hidden_operator [Nolabel, acc; Nolabel, str] - else acc - in - Ast_helper.Exp.apply ~loc:full_loc hidden_operator - [Nolabel, a; Nolabel, expr] - in - loop next p - | token -> - Parser.err p (Diagnostics.unexpected token p.breadcrumbs); - acc - in - Scanner.set_template_mode p.scanner; - Parser.expect Backtick p; - let start_pos = p.Parser.start_pos in - match p.Parser.token with - | TemplateTail txt -> - let loc = mk_loc start_pos p.end_pos in - Parser.next p; - let txt = if p.mode = ParseForTypeChecker then parse_template_string_literal txt else txt in - Ast_helper.Exp.constant ~loc (Pconst_string(txt, Some prefix)) - | TemplatePart txt -> - let constant_loc = mk_loc start_pos p.end_pos in - Parser.next p; - let expr = parse_expr_block p in - let full_loc = mk_loc start_pos p.prev_end_pos in - Scanner.set_template_mode p.scanner; - Parser.expect Rbrace p; - let txt = if p.mode = ParseForTypeChecker then parse_template_string_literal txt else txt in - let str = Ast_helper.Exp.constant ~loc:constant_loc (Pconst_string(txt, Some prefix)) in - let next = - if String.length txt > 0 then - Ast_helper.Exp.apply ~loc:full_loc hidden_operator [Nolabel, str; Nolabel, expr] - else - expr - in - loop next p - | token -> - Parser.err p (Diagnostics.unexpected token p.breadcrumbs); - Ast_helper.Exp.constant (Pconst_string("", None)) - - (* Overparse: let f = a : int => a + 1, is it (a : int) => or (a): int => - * Also overparse constraints: - * let x = { - * let a = 1 - * a + pi: int - * } - * - * We want to give a nice error message in these cases - * *) - and over_parse_constrained_or_coerced_or_arrow_expression p expr = - match p.Parser.token with - | ColonGreaterThan -> - parse_coerced_expr ~expr p - | Colon -> - Parser.next p; - let typ = parse_typ_expr ~es6_arrow:false p in - begin match p.Parser.token with - | EqualGreater -> - Parser.next p; - let body = parse_expr p in - let pat = match expr.pexp_desc with - | Pexp_ident longident -> - Ast_helper.Pat.var ~loc:expr.pexp_loc - (Location.mkloc - (Longident.flatten longident.txt |> String.concat ".") - longident.loc) - (* TODO: can we convert more expressions to patterns?*) - | _ -> - Ast_helper.Pat.var ~loc:expr.pexp_loc (Location.mkloc "pattern" expr.pexp_loc) - in - let arrow1 = Ast_helper.Exp.fun_ - ~loc:(mk_loc expr.pexp_loc.loc_start body.pexp_loc.loc_end) - Asttypes.Nolabel - None - pat - (Ast_helper.Exp.constraint_ body typ) - in - let arrow2 = Ast_helper.Exp.fun_ - ~loc:(mk_loc expr.pexp_loc.loc_start body.pexp_loc.loc_end) - Asttypes.Nolabel - None - (Ast_helper.Pat.constraint_ pat typ) - body - in - let msg = - Doc.breakable_group ~force_break:true ( - Doc.concat [ - Doc.text "Did you mean to annotate the parameter type or the return type?"; - Doc.indent ( - Doc.concat [ - Doc.line; - Doc.text "1) "; - Printer.print_expression arrow1 CommentTable.empty; - Doc.line; - Doc.text "2) "; - Printer.print_expression arrow2 CommentTable.empty; - ] - ) - ] - ) |> Doc.to_string ~width:80 - in - Parser.err - ~start_pos:expr.pexp_loc.loc_start - ~end_pos:body.pexp_loc.loc_end - p - (Diagnostics.message msg); - arrow1 - | _ -> - let open Parsetree in - let loc = mk_loc expr.pexp_loc.loc_start typ.ptyp_loc.loc_end in - let expr = Ast_helper.Exp.constraint_ ~loc expr typ in - let () = Parser.err - ~start_pos:expr.pexp_loc.loc_start - ~end_pos:typ.ptyp_loc.loc_end - p - (Diagnostics.message - (Doc.breakable_group ~force_break:true (Doc.concat [ - Doc.text "Expressions with type constraints need to be wrapped in parens:"; - Doc.indent ( - Doc.concat [ - Doc.line; - Printer.add_parens (Printer.print_expression expr CommentTable.empty); - ] - ) - ]) |> Doc.to_string ~width:80 - )) - in - expr - end - | _ -> expr - - and parse_let_binding_body ~start_pos ~attrs p = - Parser.begin_region p; - Parser.leave_breadcrumb p Grammar.LetBinding; - let pat, exp = - let pat = parse_pattern p in - match p.Parser.token with - | Colon -> - Parser.next p; - begin match p.token with - | Typ -> (* locally abstract types *) - Parser.next p; - let newtypes = parse_lident_list p in - Parser.expect Dot p; - let typ = parse_typ_expr p in - Parser.expect Equal p; - let expr = parse_expr p in - let loc = mk_loc start_pos p.prev_end_pos in - let exp, poly = wrap_type_annotation ~loc newtypes typ expr in - let pat = Ast_helper.Pat.constraint_ ~loc pat poly in - (pat, exp) - | _ -> - let poly_type = parse_poly_type_expr p in - let loc = {pat.ppat_loc with loc_end = poly_type.Parsetree.ptyp_loc.loc_end} in - let pat = Ast_helper.Pat.constraint_ ~loc pat poly_type in - Parser.expect Token.Equal p; - let exp = parse_expr p in - let exp = over_parse_constrained_or_coerced_or_arrow_expression p exp in - (pat, exp) - end - | _ -> - Parser.expect Token.Equal p; - let exp = over_parse_constrained_or_coerced_or_arrow_expression p (parse_expr p) in - (pat, exp) - in - let loc = mk_loc start_pos p.prev_end_pos in - let vb = Ast_helper.Vb.mk ~loc ~attrs pat exp in - Parser.eat_breadcrumb p; - Parser.end_region p; - vb - - (* TODO: find a better way? Is it possible? - * let a = 1 - * @attr - * and b = 2 - * - * The problem is that without semi we need a lookahead to determine - * if the attr is on the letbinding or the start of a new thing - * - * let a = 1 - * @attr - * let b = 1 - * - * Here @attr should attach to something "new": `let b = 1` - * The parser state is forked, which is quite expensive… - *) - and parse_attributes_and_binding (p : Parser.t) = - let err = p.scanner.err in - let ch = p.scanner.ch in - let offset = p.scanner.offset in - let rd_offset = p.scanner.rd_offset in - let line_offset = p.scanner.line_offset in - let lnum = p.scanner.lnum in - let mode = p.scanner.mode in - let token = p.token in - let start_pos = p.start_pos in - let end_pos = p.end_pos in - let prev_end_pos = p.prev_end_pos in - let breadcrumbs = p.breadcrumbs in - let errors = p.errors in - let diagnostics = p.diagnostics in - let comments = p.comments in - - match p.Parser.token with - | At -> - let attrs = parse_attributes p in - begin match p.Parser.token with - | And -> - attrs - | _ -> - p.scanner.err <- err; - p.scanner.ch <- ch; - p.scanner.offset <- offset; - p.scanner.rd_offset <- rd_offset; - p.scanner.line_offset <- line_offset; - p.scanner.lnum <- lnum; - p.scanner.mode <- mode; - p.token <- token; - p.start_pos <- start_pos; - p.end_pos <- end_pos; - p.prev_end_pos <- prev_end_pos; - p.breadcrumbs <- breadcrumbs; - p.errors <- errors; - p.diagnostics <- diagnostics; - p.comments <- comments; - [] - end - | _ -> [] - - (* definition ::= let [rec] let-binding { and let-binding } *) - and parse_let_bindings ~attrs p = - let start_pos = p.Parser.start_pos in - Parser.optional p Let |> ignore; - let rec_flag = if Parser.optional p Token.Rec then - Asttypes.Recursive - else - Asttypes.Nonrecursive - in - let first = parse_let_binding_body ~start_pos ~attrs p in - - let rec loop p bindings = - let start_pos = p.Parser.start_pos in - let attrs = parse_attributes_and_binding p in - match p.Parser.token with - | And -> - Parser.next p; - let attrs = match p.token with - | Export -> - let export_loc = mk_loc p.start_pos p.end_pos in - Parser.next p; - let gentype_attr = (Location.mkloc "genType" export_loc, Parsetree.PStr []) in - gentype_attr::attrs - | _ -> attrs - in - ignore(Parser.optional p Let); (* overparse for fault tolerance *) - let let_binding = parse_let_binding_body ~start_pos ~attrs p in - loop p (let_binding::bindings) - | _ -> - List.rev bindings - in - (rec_flag, loop p [first]) - - (* - * div -> div - * Foo -> Foo.createElement - * Foo.Bar -> Foo.Bar.createElement - *) - and parse_jsx_name p = - let longident = match p.Parser.token with - | Lident ident -> - let ident_start = p.start_pos in - let ident_end = p.end_pos in - Parser.next p; - let loc = mk_loc ident_start ident_end in - Location.mkloc (Longident.Lident ident) loc - | Uident _ -> - let longident = parse_module_long_ident ~lowercase:false p in - Location.mkloc (Longident.Ldot (longident.txt, "createElement")) longident.loc - | _ -> - let msg = "A jsx name should start with a lowercase or uppercase identifier, like: div in
or Navbar in " - in - Parser.err p (Diagnostics.message msg); - Location.mknoloc (Longident.Lident "_") - in - Ast_helper.Exp.ident ~loc:longident.loc longident - - and parse_jsx_opening_or_self_closing_element ~start_pos p = - let jsx_start_pos = p.Parser.start_pos in - let name = parse_jsx_name p in - let jsx_props = parse_jsx_props p in - let children = match p.Parser.token with - | Forwardslash -> (* *) - let children_start_pos = p.Parser.start_pos in - Parser.next p; - let children_end_pos = p.Parser.start_pos in - Parser.expect GreaterThan p; - let loc = mk_loc children_start_pos children_end_pos in - make_list_expression loc [] None (* no children *) - | GreaterThan -> (* bar *) - let children_start_pos = p.Parser.start_pos in - Scanner.set_jsx_mode p.scanner; - Parser.next p; - let (spread, children) = parse_jsx_children p in - let children_end_pos = p.Parser.start_pos in - let () = match p.token with - | LessThanSlash -> Parser.next p - | LessThan -> Parser.next p; Parser.expect Forwardslash p - | token when Grammar.is_structure_item_start token -> () - | _ -> Parser.expect LessThanSlash p - in - begin match p.Parser.token with - | Lident _ | Uident _ when verify_jsx_opening_closing_name p name -> - Parser.expect GreaterThan p; - let loc = mk_loc children_start_pos children_end_pos in - ( match spread, children with - | true, child :: _ -> - child - | _ -> - make_list_expression loc children None - ) - | token -> - let () = if Grammar.is_structure_item_start token then ( - let closing = "" in - let msg = Diagnostics.message ("Missing " ^ closing) in - Parser.err ~start_pos ~end_pos:p.prev_end_pos p msg; - ) else ( - let opening = "" in - let msg = "Closing jsx name should be the same as the opening name. Did you mean " ^ opening ^ " ?" in - Parser.err ~start_pos ~end_pos:p.prev_end_pos p (Diagnostics.message msg); - Parser.expect GreaterThan p - ) - in - let loc = mk_loc children_start_pos children_end_pos in - ( match spread, children with - | true, child :: _ -> - child - | _ -> - make_list_expression loc children None - ) - end - | token -> - Parser.err p (Diagnostics.unexpected token p.breadcrumbs); - make_list_expression Location.none [] None - in - let jsx_end_pos = p.prev_end_pos in - let loc = mk_loc jsx_start_pos jsx_end_pos in - Ast_helper.Exp.apply - ~loc - name - (List.concat [jsx_props; [ - (Asttypes.Labelled "children", children); - (Asttypes.Nolabel, Ast_helper.Exp.construct (Location.mknoloc (Longident.Lident "()")) None) - ]]) - - (* - * jsx ::= - * | <> jsx-children - * | - * | jsx-children - * - * jsx-children ::= primary-expr* * => 0 or more - *) - and parse_jsx p = - Parser.leave_breadcrumb p Grammar.Jsx; - let start_pos = p.Parser.start_pos in - Parser.expect LessThan p; - let jsx_expr = match p.Parser.token with - | Lident _ | Uident _ -> - parse_jsx_opening_or_self_closing_element ~start_pos p - | GreaterThan -> (* fragment: <> foo *) - parse_jsx_fragment p - | _ -> - parse_jsx_name p - in - {jsx_expr with pexp_attributes = [jsx_attr]} - - (* - * jsx-fragment ::= - * | <> - * | <> jsx-children - *) - and parse_jsx_fragment p = - let children_start_pos = p.Parser.start_pos in - Scanner.set_jsx_mode p.scanner; - Parser.expect GreaterThan p; - let (_spread, children) = parse_jsx_children p in - let children_end_pos = p.Parser.start_pos in - Parser.expect LessThanSlash p; - Parser.expect GreaterThan p; - let loc = mk_loc children_start_pos children_end_pos in - make_list_expression loc children None - - - (* - * jsx-prop ::= - * | lident - * | ?lident - * | lident = jsx_expr - * | lident = ?jsx_expr - *) - and parse_jsx_prop p = - Parser.leave_breadcrumb p Grammar.JsxAttribute; - match p.Parser.token with - | Question | Lident _ -> - let optional = Parser.optional p Question in - let (name, loc) = parse_lident p in - let prop_loc_attr = (Location.mkloc "res.namedArgLoc" loc, Parsetree.PStr []) in - (* optional punning: *) - if optional then - Some ( - Asttypes.Optional name, - Ast_helper.Exp.ident ~attrs:[prop_loc_attr] - ~loc (Location.mkloc (Longident.Lident name) loc) - ) - else begin - match p.Parser.token with - | Equal -> - Parser.next p; - (* no punning *) - let optional = Parser.optional p Question in - let attr_expr = - let e = parse_primary_expr ~operand:(parse_atomic_expr p) p in - {e with pexp_attributes = prop_loc_attr::e.pexp_attributes} - in - let label = - if optional then Asttypes.Optional name else Asttypes.Labelled name - in - Some (label, attr_expr) - | _ -> - let attr_expr = - Ast_helper.Exp.ident ~loc ~attrs:[prop_loc_attr] - (Location.mknoloc (Longident.Lident name)) in - let label = - if optional then Asttypes.Optional name else Asttypes.Labelled name - in - Some (label, attr_expr) - end - | _ -> - None - - and parse_jsx_props p = - parse_region - ~grammar:Grammar.JsxAttribute - ~f:parse_jsx_prop - p - - and parse_jsx_children p = - let rec loop p children = - match p.Parser.token with - | Token.Eof | LessThanSlash -> - Scanner.pop_mode p.scanner Jsx; - List.rev children - | LessThan -> - (* Imagine:
< - * is `<` the start of a jsx-child?
- * reconsiderLessThan peeks at the next token and - * determines the correct token to disambiguate *) - let token = Scanner.reconsider_less_than p.scanner in - if token = LessThan then - let child = parse_primary_expr ~operand:(parse_atomic_expr p) ~no_call:true p in - loop p (child::children) - else (* LessThanSlash *) - let () = p.token <- token in - let () = Scanner.pop_mode p.scanner Jsx in - List.rev children - | token when Grammar.is_jsx_child_start token -> - let () = Scanner.pop_mode p.scanner Jsx in - let child = parse_primary_expr ~operand:(parse_atomic_expr p) ~no_call:true p in - loop p (child::children) - | _ -> - Scanner.pop_mode p.scanner Jsx; - List.rev children - in - match p.Parser.token with - | DotDotDot -> - Parser.next p; - (true, [parse_primary_expr ~operand:(parse_atomic_expr p) ~no_call:true p]) - | _ -> (false, loop p []) - - and parse_braced_or_record_expr p = - let start_pos = p.Parser.start_pos in - Parser.expect Lbrace p; - match p.Parser.token with - | Rbrace -> - Parser.err p (Diagnostics.unexpected Rbrace p.breadcrumbs); - Parser.next p; - let loc = mk_loc start_pos p.prev_end_pos in - let braces = make_braces_attr loc in - Ast_helper.Exp.construct ~attrs:[braces] ~loc - (Location.mkloc (Longident.Lident "()") loc) None - | DotDotDot -> - (* beginning of record spread, parse record *) - Parser.next p; - let spread_expr = parse_constrained_or_coerced_expr p in - Parser.expect Comma p; - let expr = parse_record_expr ~start_pos ~spread:(Some spread_expr) [] p in - Parser.expect Rbrace p; - expr - | String s -> - let field = - let loc = mk_loc p.start_pos p.end_pos in - Parser.next p; - Location.mkloc (Longident.Lident s) loc - in - begin match p.Parser.token with - | Colon -> - Parser.next p; - let field_expr = parse_expr p in - Parser.optional p Comma |> ignore; - let expr = parse_record_expr_with_string_keys ~start_pos (field, field_expr) p in - Parser.expect Rbrace p; - expr - | _ -> - let constant = Ast_helper.Exp.constant ~loc:field.loc (Parsetree.Pconst_string(s, None)) in - let a = parse_primary_expr ~operand:constant p in - let e = parse_binary_expr ~a p 1 in - let e = parse_ternary_expr e p in - begin match p.Parser.token with - | Semicolon -> - Parser.next p; - let expr = parse_expr_block ~first:e p in - Parser.expect Rbrace p; - let loc = mk_loc start_pos p.prev_end_pos in - let braces = make_braces_attr loc in - {expr with pexp_attributes = braces::expr.pexp_attributes} - | Rbrace -> - Parser.next p; - let loc = mk_loc start_pos p.prev_end_pos in - let braces = make_braces_attr loc in - {e with pexp_attributes = braces::e.pexp_attributes} - | _ -> - let expr = parse_expr_block ~first:e p in - Parser.expect Rbrace p; - let loc = mk_loc start_pos p.prev_end_pos in - let braces = make_braces_attr loc in - {expr with pexp_attributes = braces::expr.pexp_attributes} - end - end - | Uident _ | Lident _ -> - let value_or_constructor = parse_value_or_constructor p in - begin match value_or_constructor.pexp_desc with - | Pexp_ident path_ident -> - let ident_end_pos = p.prev_end_pos in - begin match p.Parser.token with - | Comma -> - Parser.next p; - let expr = parse_record_expr ~start_pos [(path_ident, value_or_constructor)] p in - Parser.expect Rbrace p; - expr - | Colon -> - Parser.next p; - let field_expr = parse_expr p in - begin match p.token with - | Rbrace -> - Parser.next p; - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Exp.record ~loc [(path_ident, field_expr)] None - | _ -> - Parser.expect Comma p; - let expr = parse_record_expr ~start_pos [(path_ident, field_expr)] p in - Parser.expect Rbrace p; - expr - end - (* error case *) - | Lident _ -> - if p.prev_end_pos.pos_lnum < p.start_pos.pos_lnum then ( - Parser.expect Comma p; - let expr = parse_record_expr ~start_pos [(path_ident, value_or_constructor)] p in - Parser.expect Rbrace p; - expr - ) else ( - Parser.expect Colon p; - let expr = parse_record_expr ~start_pos [(path_ident, value_or_constructor)] p in - Parser.expect Rbrace p; - expr - ) - | Semicolon -> - Parser.next p; - let expr = parse_expr_block ~first:(Ast_helper.Exp.ident path_ident) p in - Parser.expect Rbrace p; - let loc = mk_loc start_pos p.prev_end_pos in - let braces = make_braces_attr loc in - {expr with pexp_attributes = braces::expr.pexp_attributes} - | Rbrace -> - Parser.next p; - let expr = Ast_helper.Exp.ident ~loc:path_ident.loc path_ident in - let loc = mk_loc start_pos p.prev_end_pos in - let braces = make_braces_attr loc in - {expr with pexp_attributes = braces::expr.pexp_attributes} - | EqualGreater -> - let loc = mk_loc start_pos ident_end_pos in - let ident = Location.mkloc (Longident.last path_ident.txt) loc in - let a = parse_es6_arrow_expression - ~parameters:[TermParameter { - uncurried = false; - attrs = []; - label = Asttypes.Nolabel; - expr = None; - pat = Ast_helper.Pat.var ident; - pos = start_pos; - }] - p - in - let e = parse_binary_expr ~a p 1 in - let e = parse_ternary_expr e p in - begin match p.Parser.token with - | Semicolon -> - Parser.next p; - let expr = parse_expr_block ~first:e p in - Parser.expect Rbrace p; - let loc = mk_loc start_pos p.prev_end_pos in - let braces = make_braces_attr loc in - {expr with pexp_attributes = braces::expr.pexp_attributes} - | Rbrace -> - Parser.next p; - let loc = mk_loc start_pos p.prev_end_pos in - let braces = make_braces_attr loc in - {e with pexp_attributes = braces::e.pexp_attributes} - | _ -> - let expr = parse_expr_block ~first:e p in - Parser.expect Rbrace p; - let loc = mk_loc start_pos p.prev_end_pos in - let braces = make_braces_attr loc in - {expr with pexp_attributes = braces::expr.pexp_attributes} - end - | _ -> - Parser.leave_breadcrumb p Grammar.ExprBlock; - let a = parse_primary_expr ~operand:(Ast_helper.Exp.ident ~loc:path_ident.loc path_ident) p in - let e = parse_binary_expr ~a p 1 in - let e = parse_ternary_expr e p in - Parser.eat_breadcrumb p; - begin match p.Parser.token with - | Semicolon -> - Parser.next p; - let expr = parse_expr_block ~first:e p in - Parser.expect Rbrace p; - let loc = mk_loc start_pos p.prev_end_pos in - let braces = make_braces_attr loc in - {expr with pexp_attributes = braces::expr.pexp_attributes} - | Rbrace -> - Parser.next p; - let loc = mk_loc start_pos p.prev_end_pos in - let braces = make_braces_attr loc in - {e with pexp_attributes = braces::e.pexp_attributes} - | _ -> - let expr = parse_expr_block ~first:e p in - Parser.expect Rbrace p; - let loc = mk_loc start_pos p.prev_end_pos in - let braces = make_braces_attr loc in - {expr with pexp_attributes = braces::expr.pexp_attributes} - end - end - | _ -> - Parser.leave_breadcrumb p Grammar.ExprBlock; - let a = parse_primary_expr ~operand:value_or_constructor p in - let e = parse_binary_expr ~a p 1 in - let e = parse_ternary_expr e p in - Parser.eat_breadcrumb p; - begin match p.Parser.token with - | Semicolon -> - Parser.next p; - let expr = parse_expr_block ~first:e p in - Parser.expect Rbrace p; - let loc = mk_loc start_pos p.prev_end_pos in - let braces = make_braces_attr loc in - {expr with pexp_attributes = braces::expr.pexp_attributes} - | Rbrace -> - Parser.next p; - let loc = mk_loc start_pos p.prev_end_pos in - let braces = make_braces_attr loc in - {e with pexp_attributes = braces::e.pexp_attributes} - | _ -> - let expr = parse_expr_block ~first:e p in - Parser.expect Rbrace p; - let loc = mk_loc start_pos p.prev_end_pos in - let braces = make_braces_attr loc in - {expr with pexp_attributes = braces::expr.pexp_attributes} - end - end - | _ -> - let expr = parse_expr_block p in - Parser.expect Rbrace p; - let loc = mk_loc start_pos p.prev_end_pos in - let braces = make_braces_attr loc in - {expr with pexp_attributes = braces::expr.pexp_attributes} - - and parse_record_row_with_string_key p = - match p.Parser.token with - | String s -> - let loc = mk_loc p.start_pos p.end_pos in - Parser.next p; - let field = Location.mkloc (Longident.Lident s) loc in - begin match p.Parser.token with - | Colon -> - Parser.next p; - let field_expr = parse_expr p in - Some (field, field_expr) - | _ -> - Some (field, Ast_helper.Exp.ident ~loc:field.loc field) - end - | _ -> None - - and parse_record_row p = - let () = match p.Parser.token with - | Token.DotDotDot -> - Parser.err p (Diagnostics.message ErrorMessages.record_expr_spread); - Parser.next p; - | _ -> () - in - match p.Parser.token with - | Lident _ | Uident _ | List -> - let field = parse_value_path p in - begin match p.Parser.token with - | Colon -> - Parser.next p; - let field_expr = parse_expr p in - Some (field, field_expr) - | _ -> - Some (field, Ast_helper.Exp.ident ~loc:field.loc field) - end - | _ -> None - - and parse_record_expr_with_string_keys ~start_pos first_row p = - let rows = first_row::( - parse_comma_delimited_region ~grammar:Grammar.RecordRowsStringKey ~closing:Rbrace ~f:parse_record_row_with_string_key p - ) in - let loc = mk_loc start_pos p.end_pos in - let record_str_expr = Ast_helper.Str.eval ~loc ( - Ast_helper.Exp.record ~loc rows None - ) in - Ast_helper.Exp.extension ~loc - (Location.mkloc "obj" loc, Parsetree.PStr [record_str_expr]) - - and parse_record_expr ~start_pos ?(spread=None) rows p = - let exprs = - parse_comma_delimited_region - ~grammar:Grammar.RecordRows - ~closing:Rbrace - ~f:parse_record_row p - in - let rows = List.concat [rows; exprs] in - let () = match rows with - | [] -> - let msg = "Record spread needs at least one field that's updated" in - Parser.err p (Diagnostics.message msg); - | _rows -> () - in - let loc = mk_loc start_pos p.end_pos in - Ast_helper.Exp.record ~loc rows spread - - and parse_expr_block_item p = - let start_pos = p.Parser.start_pos in - let attrs = parse_attributes p in - match p.Parser.token with - | Module -> - Parser.next p; - begin match p.token with - | Lparen -> - parse_first_class_module_expr ~start_pos p - | _ -> - let name = match p.Parser.token with - | Uident ident -> - let loc = mk_loc p.start_pos p.end_pos in - Parser.next p; - Location.mkloc ident loc - | t -> - Parser.err p (Diagnostics.uident t); - Location.mknoloc "_" - in - let body = parse_module_binding_body p in - Parser.optional p Semicolon |> ignore; - let expr = parse_expr_block p in - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Exp.letmodule ~loc name body expr - end - | Exception -> - let extension_constructor = parse_exception_def ~attrs p in - Parser.optional p Semicolon |> ignore; - let block_expr = parse_expr_block p in - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Exp.letexception ~loc extension_constructor block_expr - | Open -> - let od = parse_open_description ~attrs p in - Parser.optional p Semicolon |> ignore; - let block_expr = parse_expr_block p in - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Exp.open_ ~loc od.popen_override od.popen_lid block_expr - | Let -> - let (rec_flag, let_bindings) = parse_let_bindings ~attrs p in - let next = match p.Parser.token with - | Semicolon -> - Parser.next p; - if Grammar.is_block_expr_start p.Parser.token then - parse_expr_block p - else - let loc = mk_loc p.start_pos p.end_pos in - Ast_helper.Exp.construct ~loc - (Location.mkloc (Longident.Lident "()") loc) None - | token when Grammar.is_block_expr_start token -> - parse_expr_block p - | _ -> - let loc = mk_loc p.start_pos p.end_pos in - Ast_helper.Exp.construct ~loc (Location.mkloc (Longident.Lident "()") loc) None - in - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Exp.let_ ~loc rec_flag let_bindings next - | _ -> - let e1 = - let expr = parse_expr p in - {expr with pexp_attributes = List.concat [attrs; expr.pexp_attributes]} - in - ignore (Parser.optional p Semicolon); - if Grammar.is_block_expr_start p.Parser.token then - let e2 = parse_expr_block p in - let loc = {e1.pexp_loc with loc_end = e2.pexp_loc.loc_end} in - Ast_helper.Exp.sequence ~loc e1 e2 - else e1 - - (* blockExpr ::= expr - * | expr ; - * | expr ; blockExpr - * | module ... ; blockExpr - * | open ... ; blockExpr - * | exception ... ; blockExpr - * | let ... - * | let ... ; - * | let ... ; blockExpr - * - * note: semi should be made optional - * a block of expression is always - *) - and parse_expr_block ?first p = - Parser.leave_breadcrumb p Grammar.ExprBlock; - let item = match first with - | Some e -> e - | None -> parse_expr_block_item p - in - let block_expr = match p.Parser.token with - | Semicolon -> - Parser.next p; - if Grammar.is_block_expr_start p.Parser.token then - let next = parse_expr_block_item p in - ignore(Parser.optional p Semicolon); - let loc = {item.pexp_loc with loc_end = next.pexp_loc.loc_end} in - Ast_helper.Exp.sequence ~loc item next - else - item - | token when Grammar.is_block_expr_start token -> - let next = parse_expr_block_item p in - ignore(Parser.optional p Semicolon); - let loc = {item.pexp_loc with loc_end = next.pexp_loc.loc_end} in - Ast_helper.Exp.sequence ~loc item next - | _ -> - item - in - Parser.eat_breadcrumb p; - over_parse_constrained_or_coerced_or_arrow_expression p block_expr - - and parse_try_expression p = - let start_pos = p.Parser.start_pos in - Parser.expect Try p; - let expr = parse_expr ~context:WhenExpr p in - Parser.expect Catch p; - Parser.expect Lbrace p; - let cases = parse_pattern_matching p in - Parser.expect Rbrace p; - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Exp.try_ ~loc expr cases - - and parse_if_expression p = - Parser.begin_region p; - Parser.leave_breadcrumb p Grammar.ExprIf; - let start_pos = p.Parser.start_pos in - Parser.expect If p; - Parser.leave_breadcrumb p Grammar.IfCondition; - (* doesn't make sense to try es6 arrow here? *) - let condition_expr = parse_expr ~context:WhenExpr p in - Parser.eat_breadcrumb p; - Parser.leave_breadcrumb p IfBranch; - Parser.expect Lbrace p; - let then_expr = parse_expr_block p in - Parser.expect Rbrace p; - Parser.eat_breadcrumb p; - let else_expr = match p.Parser.token with - | Else -> - Parser.end_region p; - Parser.leave_breadcrumb p Grammar.ElseBranch; - Parser.next p; - Parser.begin_region p; - let else_expr = match p.token with - | If -> - parse_if_expression p - | _ -> - Parser.expect Lbrace p; - let block_expr = parse_expr_block p in - Parser.expect Rbrace p; - block_expr - in - Parser.eat_breadcrumb p; - Parser.end_region p; - Some else_expr - | _ -> - Parser.end_region p; - None - in - let loc = mk_loc start_pos p.prev_end_pos in - Parser.eat_breadcrumb p; - Ast_helper.Exp.ifthenelse ~loc condition_expr then_expr else_expr - - and parse_for_rest has_opening_paren pattern start_pos p = - Parser.expect In p; - let e1 = parse_expr p in - let direction = match p.Parser.token with - | To -> Asttypes.Upto - | Downto -> Asttypes.Downto - | token -> - Parser.err p (Diagnostics.unexpected token p.breadcrumbs); - Asttypes.Upto - in - Parser.next p; - let e2 = parse_expr ~context:WhenExpr p in - if has_opening_paren then Parser.expect Rparen p; - Parser.expect Lbrace p; - let body_expr = parse_expr_block p in - Parser.expect Rbrace p; - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Exp.for_ ~loc pattern e1 e2 direction body_expr - - and parse_for_expression p = - let start_pos = p.Parser.start_pos in - Parser.expect For p; - match p.token with - | Lparen -> - let lparen = p.start_pos in - Parser.next p; - begin match p.token with - | Rparen -> - Parser.next p; - let unit_pattern = - let loc = mk_loc lparen p.prev_end_pos in - let lid = Location.mkloc (Longident.Lident "()") loc in - Ast_helper.Pat.construct lid None - in - parse_for_rest false (parse_alias_pattern ~attrs:[] unit_pattern p) start_pos p - | _ -> - let pat = parse_pattern p in - begin match p.token with - | Comma -> - Parser.next p; - let tuple_pattern = - parse_tuple_pattern ~attrs:[] ~start_pos:lparen ~first:pat p - in - let pattern = parse_alias_pattern ~attrs:[] tuple_pattern p in - parse_for_rest false pattern start_pos p - | _ -> - parse_for_rest true pat start_pos p - end - end - | _ -> - parse_for_rest false (parse_pattern p) start_pos p - - and parse_while_expression p = - let start_pos = p.Parser.start_pos in - Parser.expect While p; - let expr1 = parse_expr ~context:WhenExpr p in - Parser.expect Lbrace p; - let expr2 = parse_expr_block p in - Parser.expect Rbrace p; - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Exp.while_ ~loc expr1 expr2 - - and parse_pattern_match_case p = - Parser.begin_region p; - Parser.leave_breadcrumb p Grammar.PatternMatchCase; - match p.Parser.token with - | Token.Bar -> - Parser.next p; - let lhs = parse_pattern p in - let guard = match p.Parser.token with - | When -> - Parser.next p; - Some (parse_expr ~context:WhenExpr p) - | _ -> - None - in - let () = match p.token with - | EqualGreater -> Parser.next p - | _ -> Recover.recover_equal_greater p - in - let rhs = parse_expr_block p in - Parser.end_region p; - Parser.eat_breadcrumb p; - Some (Ast_helper.Exp.case lhs ?guard rhs) - | _ -> - Parser.end_region p; - None - - and parse_pattern_matching p = - Parser.leave_breadcrumb p Grammar.PatternMatching; - let cases = - parse_delimited_region - ~grammar:Grammar.PatternMatching - ~closing:Rbrace - ~f:parse_pattern_match_case - p - in - let () = match cases with - | [] -> Parser.err ~start_pos:p.prev_end_pos p ( - Diagnostics.message "Pattern matching needs at least one case" - ) - | _ -> () - in - cases - - and parse_switch_expression p = - let start_pos = p.Parser.start_pos in - Parser.expect Switch p; - let switch_expr = parse_expr ~context:WhenExpr p in - Parser.expect Lbrace p; - let cases = parse_pattern_matching p in - Parser.expect Rbrace p; - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Exp.match_ ~loc switch_expr cases - - (* - * argument ::= - * | _ (* syntax sugar *) - * | expr - * | expr : type - * | ~ label-name - * | ~ label-name - * | ~ label-name ? - * | ~ label-name = expr - * | ~ label-name = _ (* syntax sugar *) - * | ~ label-name = expr : type - * | ~ label-name = ? expr - * | ~ label-name = ? _ (* syntax sugar *) - * | ~ label-name = ? expr : type - * - * uncurried_argument ::= - * | . argument - *) - and parse_argument p = - if ( - p.Parser.token = Token.Tilde || - p.token = Dot || - p.token = Underscore || - Grammar.is_expr_start p.token - ) then ( - match p.Parser.token with - | Dot -> - let uncurried = true in - let start_pos = p.Parser.start_pos in - Parser.next(p); - begin match p.token with - (* apply(.) *) - | Rparen -> - let loc = mk_loc start_pos p.prev_end_pos in - let unit_expr = Ast_helper.Exp.construct ~loc - (Location.mkloc (Longident.Lident "()") loc) None - in - Some (uncurried, Asttypes.Nolabel, unit_expr) - | _ -> - parse_argument2 p ~uncurried - end - | _ -> - parse_argument2 p ~uncurried:false - ) else - None - - and parse_argument2 p ~uncurried = - match p.Parser.token with - (* foo(_), do not confuse with foo(_ => x), TODO: performance *) - | Underscore when not (is_es6_arrow_expression ~in_ternary:false p) -> - let loc = mk_loc p.start_pos p.end_pos in - Parser.next p; - let exp = Ast_helper.Exp.ident ~loc ( - Location.mkloc (Longident.Lident "_") loc - ) in - Some (uncurried, Asttypes.Nolabel, exp) - | Tilde -> - Parser.next p; - (* TODO: nesting of pattern matches not intuitive for error recovery *) - begin match p.Parser.token with - | Lident ident -> - let start_pos = p.start_pos in - Parser.next p; - let end_pos = p.prev_end_pos in - let loc = mk_loc start_pos end_pos in - let prop_loc_attr = (Location.mkloc "res.namedArgLoc" loc, Parsetree.PStr []) in - let ident_expr = Ast_helper.Exp.ident ~attrs:[prop_loc_attr] ~loc ( - Location.mkloc (Longident.Lident ident) loc - ) in - begin match p.Parser.token with - | Question -> - Parser.next p; - Some (uncurried, Asttypes.Optional ident, ident_expr) - | Equal -> - Parser.next p; - let label = match p.Parser.token with - | Question -> - Parser.next p; - Asttypes.Optional ident - | _ -> - Labelled ident - in - let expr = match p.Parser.token with - | Underscore when not (is_es6_arrow_expression ~in_ternary:false p) -> - let loc = mk_loc p.start_pos p.end_pos in - Parser.next p; - Ast_helper.Exp.ident ~loc ( - Location.mkloc (Longident.Lident "_") loc - ) - | _ -> - let expr = parse_constrained_or_coerced_expr p in - {expr with pexp_attributes = prop_loc_attr::expr.pexp_attributes} - in - Some (uncurried, label, expr) - | Colon -> - Parser.next p; - let typ = parse_typ_expr p in - let loc = mk_loc start_pos p.prev_end_pos in - let expr = Ast_helper.Exp.constraint_ ~attrs:[prop_loc_attr] ~loc ident_expr typ in - Some (uncurried, Labelled ident, expr) - | _ -> - Some (uncurried, Labelled ident, ident_expr) - end - | t -> - Parser.err p (Diagnostics.lident t); - Some (uncurried, Nolabel, Recover.default_expr ()) - end - | _ -> Some (uncurried, Nolabel, parse_constrained_or_coerced_expr p) - - and parse_call_expr p fun_expr = - Parser.expect Lparen p; - let start_pos = p.Parser.start_pos in - Parser.leave_breadcrumb p Grammar.ExprCall; - let args = - parse_comma_delimited_region - ~grammar:Grammar.ArgumentList - ~closing:Rparen - ~f:parse_argument p - in - Parser.expect Rparen p; - let args = match args with - | [] -> - let loc = mk_loc start_pos p.prev_end_pos in - (* No args -> unit sugar: `foo()` *) - [ false, - Asttypes.Nolabel, - Ast_helper.Exp.construct - ~loc (Location.mkloc (Longident.Lident "()") loc) None - ] - | args -> args - in - let loc = {fun_expr.pexp_loc with loc_end = p.prev_end_pos} in - let args = match args with - | (u, lbl, expr)::args -> - let group (grp, acc) (uncurried, lbl, expr) = - let (_u, grp) = grp in - if uncurried == true then - ((true, [lbl, expr]), ((_u, (List.rev grp))::acc)) - else - ((_u, ((lbl, expr)::grp)), acc) - in - let ((_u, grp), acc) = List.fold_left group((u, [lbl, expr]), []) args in - List.rev ((_u, (List.rev grp))::acc) - | [] -> [] - in - let apply = List.fold_left (fun call_body group -> - let (uncurried, args) = group in - let (args, wrap) = process_underscore_application args in - let exp = if uncurried then - let attrs = [uncurry_attr] in - Ast_helper.Exp.apply ~loc ~attrs call_body args - else - Ast_helper.Exp.apply ~loc call_body args - in - wrap exp - ) fun_expr args - in - Parser.eat_breadcrumb p; - apply - - and parse_value_or_constructor p = - let start_pos = p.Parser.start_pos in - let rec aux p acc = - match p.Parser.token with - | Uident ident -> - let end_pos_lident = p.end_pos in - Parser.next p; - begin match p.Parser.token with - | Dot -> - Parser.next p; - aux p (ident::acc) - | Lparen when p.prev_end_pos.pos_lnum == p.start_pos.pos_lnum -> - let lparen = p.start_pos in - let args = parse_constructor_args p in - let rparen = p.prev_end_pos in - let lident = build_longident (ident::acc) in - let tail = match args with - | [] -> None - | [{Parsetree.pexp_desc = Pexp_tuple _} as arg] as args -> - let loc = mk_loc lparen rparen in - if p.mode = ParseForTypeChecker then - (* Some(1, 2) for type-checker *) - Some arg - else - (* Some((1, 2)) for printer *) - Some (Ast_helper.Exp.tuple ~loc args) - | [arg] -> - Some arg - | args -> - let loc = mk_loc lparen rparen in - Some (Ast_helper.Exp.tuple ~loc args) - in - let loc = mk_loc start_pos p.prev_end_pos in - let ident_loc = mk_loc start_pos end_pos_lident in - Ast_helper.Exp.construct ~loc (Location.mkloc lident ident_loc) tail - | _ -> - let loc = mk_loc start_pos p.prev_end_pos in - let lident = build_longident (ident::acc) in - Ast_helper.Exp.construct ~loc (Location.mkloc lident loc) None - end - | Lident ident -> - Parser.next p; - let loc = mk_loc start_pos p.prev_end_pos in - let lident = build_longident (ident::acc) in - Ast_helper.Exp.ident ~loc (Location.mkloc lident loc) - | List -> - Parser.next p; - let loc = mk_loc start_pos p.prev_end_pos in - let lident = build_longident ("list"::acc) in - Ast_helper.Exp.ident ~loc (Location.mkloc lident loc) - | token -> - Parser.next p; - Parser.err p (Diagnostics.unexpected token p.breadcrumbs); - Recover.default_expr() - in - aux p [] - - and parse_poly_variant_expr p = - let start_pos = p.start_pos in - let (ident, _loc) = parse_hash_ident ~start_pos p in - begin match p.Parser.token with - | Lparen when p.prev_end_pos.pos_lnum == p.start_pos.pos_lnum -> - let lparen = p.start_pos in - let args = parse_constructor_args p in - let rparen = p.prev_end_pos in - let loc_paren = mk_loc lparen rparen in - let tail = match args with - | [] -> None - | [{Parsetree.pexp_desc = Pexp_tuple _} as expr ] as args -> - if p.mode = ParseForTypeChecker then - (* #a(1, 2) for type-checker *) - Some expr - else - (* #a((1, 2)) for type-checker *) - Some (Ast_helper.Exp.tuple ~loc:loc_paren args) - | [arg] -> Some arg - | args -> - (* #a((1, 2)) for printer *) - Some (Ast_helper.Exp.tuple ~loc:loc_paren args) - in - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Exp.variant ~loc ident tail - | _ -> - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Exp.variant ~loc ident None - end - - and parse_constructor_args p = - let lparen = p.Parser.start_pos in - Parser.expect Lparen p; - let args = - parse_comma_delimited_region - ~grammar:Grammar.ExprList ~f:parse_constrained_expr_region ~closing:Rparen p - in - Parser.expect Rparen p; - match args with - | [] -> - let loc = mk_loc lparen p.prev_end_pos in - [Ast_helper.Exp.construct - ~loc (Location.mkloc (Longident.Lident "()") loc) None] - | args -> args - - and parse_tuple_expr ~first ~start_pos p = - let exprs = - parse_comma_delimited_region - p ~grammar:Grammar.ExprList ~closing:Rparen ~f:parse_constrained_expr_region - in - Parser.expect Rparen p; - Ast_helper.Exp.tuple ~loc:(mk_loc start_pos p.prev_end_pos) (first::exprs) - - and parse_spread_expr_region p = - match p.Parser.token with - | DotDotDot -> - Parser.next p; - let expr = parse_constrained_or_coerced_expr p in - Some (true, expr) - | token when Grammar.is_expr_start token -> - Some (false, parse_constrained_or_coerced_expr p) - | _ -> None - - and parse_list_expr ~start_pos p = - Parser.expect Lbracket p; - let list_exprs = - parse_comma_delimited_reversed_list - p ~grammar:Grammar.ListExpr ~closing:Rbracket ~f:parse_spread_expr_region - in - Parser.expect Rbracket p; - let loc = mk_loc start_pos p.prev_end_pos in - match list_exprs with - | (true, expr)::exprs -> - let exprs = exprs |> List.map snd |> List.rev in - make_list_expression loc exprs (Some expr) - | exprs -> - let exprs = - exprs - |> List.map (fun (spread, expr) -> - if spread then - Parser.err p (Diagnostics.message ErrorMessages.list_expr_spread); - expr) - |> List.rev - in - make_list_expression loc exprs None - - (* Overparse ... and give a nice error message *) - and parse_non_spread_exp ~msg p = - let () = match p.Parser.token with - | DotDotDot -> - Parser.err p (Diagnostics.message msg); - Parser.next p; - | _ -> () - in - match p.Parser.token with - | token when Grammar.is_expr_start token -> - let expr = parse_expr p in - begin match p.Parser.token with - | Colon -> - Parser.next p; - let typ = parse_typ_expr p in - let loc = mk_loc expr.pexp_loc.loc_start typ.ptyp_loc.loc_end in - Some (Ast_helper.Exp.constraint_ ~loc expr typ) - | _ -> Some expr - end - | _ -> None - - and parse_array_exp p = - let start_pos = p.Parser.start_pos in - Parser.expect Lbracket p; - let exprs = - parse_comma_delimited_region - p - ~grammar:Grammar.ExprList - ~closing:Rbracket - ~f:(parse_non_spread_exp ~msg:ErrorMessages.array_expr_spread) - in - Parser.expect Rbracket p; - Ast_helper.Exp.array ~loc:(mk_loc start_pos p.prev_end_pos) exprs - - (* TODO: check attributes in the case of poly type vars, - * might be context dependend: parseFieldDeclaration (see ocaml) *) - and parse_poly_type_expr p = - let start_pos = p.Parser.start_pos in - match p.Parser.token with - | SingleQuote -> - let vars = parse_type_var_list p in - begin match vars with - | _v1::_v2::_ -> - Parser.expect Dot p; - let typ = parse_typ_expr p in - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Typ.poly ~loc vars typ - | [var] -> - begin match p.Parser.token with - | Dot -> - Parser.next p; - let typ = parse_typ_expr p in - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Typ.poly ~loc vars typ - | EqualGreater -> - Parser.next p; - let typ = Ast_helper.Typ.var ~loc:var.loc var.txt in - let return_type = parse_typ_expr ~alias:false p in - let loc = mk_loc typ.Parsetree.ptyp_loc.loc_start p.prev_end_pos in - Ast_helper.Typ.arrow ~loc Asttypes.Nolabel typ return_type - | _ -> - Ast_helper.Typ.var ~loc:var.loc var.txt - end - | _ -> assert false - end - | _ -> - parse_typ_expr p - - (* 'a 'b 'c *) - and parse_type_var_list p = - let rec loop p vars = - match p.Parser.token with - | SingleQuote -> - Parser.next p; - let (lident, loc) = parse_lident p in - let var = Location.mkloc lident loc in - loop p (var::vars) - | _ -> - List.rev vars - in - loop p [] - - and parse_lident_list p = - let rec loop p ls = - match p.Parser.token with - | Lident lident -> - let loc = mk_loc p.start_pos p.end_pos in - Parser.next p; - loop p ((Location.mkloc lident loc)::ls) - | _ -> - List.rev ls - in - loop p [] - - and parse_atomic_typ_expr ~attrs p = - Parser.leave_breadcrumb p Grammar.AtomicTypExpr; - let start_pos = p.Parser.start_pos in - let typ = match p.Parser.token with - | SingleQuote -> - Parser.next p; - let (ident, loc) = parse_lident p in - Ast_helper.Typ.var ~loc ~attrs ident - | Underscore -> - let end_pos = p.end_pos in - Parser.next p; - Ast_helper.Typ.any ~loc:(mk_loc start_pos end_pos) ~attrs () - | Lparen -> - Parser.next p; - begin match p.Parser.token with - | Rparen -> - Parser.next p; - let loc = mk_loc start_pos p.prev_end_pos in - let unit_constr = Location.mkloc (Longident.Lident "unit") loc in - Ast_helper.Typ.constr ~attrs unit_constr [] - | _ -> - let t = parse_typ_expr p in - begin match p.token with - | Comma -> - Parser.next p; - parse_tuple_type ~attrs ~first:t ~start_pos p - | _ -> - Parser.expect Rparen p; - {t with - ptyp_loc = mk_loc start_pos p.prev_end_pos; - ptyp_attributes = List.concat [attrs; t.ptyp_attributes]} - end - end - | Lbracket -> - parse_polymorphic_variant_type ~attrs p - | Uident _ | Lident _ | List -> - let constr = parse_value_path p in - let args = parse_type_constructor_args ~constr_name:constr p in - Ast_helper.Typ.constr ~loc:(mk_loc start_pos p.prev_end_pos) ~attrs constr args - | Module -> - Parser.next p; - Parser.expect Lparen p; - let package_type = parse_package_type ~start_pos ~attrs p in - Parser.expect Rparen p; - {package_type with ptyp_loc = mk_loc start_pos p.prev_end_pos} - | Percent -> - let extension = parse_extension p in - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Typ.extension ~attrs ~loc extension - | Lbrace -> - parse_bs_object_type ~attrs p - | token -> - begin match skip_tokens_and_maybe_retry p ~is_start_of_grammar:Grammar.is_atomic_typ_expr_start with - | Some () -> - parse_atomic_typ_expr ~attrs p - | None -> - Parser.err ~start_pos:p.prev_end_pos p (Diagnostics.unexpected token p.breadcrumbs); - Recover.default_type() - end - in - Parser.eat_breadcrumb p; - typ - - (* package-type ::= - | modtype-path - ∣ modtype-path with package-constraint { and package-constraint } - *) - and parse_package_type ~start_pos ~attrs p = - let mod_type_path = parse_module_long_ident ~lowercase:true p in - begin match p.Parser.token with - | With -> - Parser.next p; - let constraints = parse_package_constraints p in - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Typ.package ~loc ~attrs mod_type_path constraints - | _ -> - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Typ.package ~loc ~attrs mod_type_path [] - end - - (* package-constraint { and package-constraint } *) - and parse_package_constraints p = - let first = - Parser.expect Typ p; - let type_constr = parse_value_path p in - Parser.expect Equal p; - let typ = parse_typ_expr p in - (type_constr, typ) - in - let rest = parse_region - ~grammar:Grammar.PackageConstraint - ~f:parse_package_constraint - p - in - first::rest - - (* and type typeconstr = typexpr *) - and parse_package_constraint p = - match p.Parser.token with - | And -> - Parser.next p; - Parser.expect Typ p; - let type_constr = parse_value_path p in - Parser.expect Equal p; - let typ = parse_typ_expr p in - Some (type_constr, typ) - | _ -> None - - and parse_bs_object_type ~attrs p = - let start_pos = p.Parser.start_pos in - Parser.expect Lbrace p; - let closed_flag = match p.token with - | DotDot -> Parser.next p; Asttypes.Open - | Dot -> Parser.next p; Asttypes.Closed - | _ -> Asttypes.Closed - in - let fields = - parse_comma_delimited_region - ~grammar:Grammar.StringFieldDeclarations - ~closing:Rbrace - ~f:parse_string_field_declaration - p - in - Parser.expect Rbrace p; - let loc = mk_loc start_pos p.prev_end_pos in - make_bs_obj_type ~attrs ~loc ~closed:closed_flag fields - - (* TODO: check associativity in combination with attributes *) - and parse_type_alias p typ = - match p.Parser.token with - | As -> - Parser.next p; - Parser.expect SingleQuote p; - let (ident, _loc) = parse_lident p in - (* TODO: how do we parse attributes here? *) - Ast_helper.Typ.alias ~loc:(mk_loc typ.Parsetree.ptyp_loc.loc_start p.prev_end_pos) typ ident - | _ -> typ - - - (* type_parameter ::= - * | type_expr - * | ~ident: type_expr - * | ~ident: type_expr=? - * - * note: - * | attrs ~ident: type_expr -> attrs are on the arrow - * | attrs type_expr -> attrs are here part of the type_expr - * - * uncurried_type_parameter ::= - * | . type_parameter - *) - and parse_type_parameter p = - if ( - p.Parser.token = Token.Tilde || - p.token = Dot || - Grammar.is_typ_expr_start p.token - ) then ( - let start_pos = p.Parser.start_pos in - let uncurried = Parser.optional p Dot in - let attrs = parse_attributes p in - match p.Parser.token with - | Tilde -> - Parser.next p; - let (name, _loc) = parse_lident p in - Parser.expect ~grammar:Grammar.TypeExpression Colon p; - let typ = parse_typ_expr p in - begin match p.Parser.token with - | Equal -> - Parser.next p; - Parser.expect Question p; - Some (uncurried, attrs, Asttypes.Optional name, typ, start_pos) - | _ -> - Some (uncurried, attrs, Asttypes.Labelled name, typ, start_pos) - end - | Lident _ | List -> - let (name, loc) = parse_lident p in - begin match p.token with - | Colon -> - let () = - let error = Diagnostics.message - ("Parameter names start with a `~`, like: ~" ^ name) - in - Parser.err ~start_pos:loc.loc_start ~end_pos:loc.loc_end p error - in - Parser.next p; - let typ = parse_typ_expr p in - begin match p.Parser.token with - | Equal -> - Parser.next p; - Parser.expect Question p; - Some (uncurried, attrs, Asttypes.Optional name, typ, start_pos) - | _ -> - Some (uncurried, attrs, Asttypes.Labelled name, typ, start_pos) - end - | _ -> - let constr = Location.mkloc (Longident.Lident name) loc in - let args = parse_type_constructor_args ~constr_name:constr p in - let typ = Ast_helper.Typ.constr ~loc:(mk_loc start_pos p.prev_end_pos) ~attrs constr args - in - - let typ = parse_arrow_type_rest ~es6_arrow:true ~start_pos typ p in - let typ = parse_type_alias p typ in - Some (uncurried, [], Asttypes.Nolabel, typ, start_pos) - end - | _ -> - let typ = parse_typ_expr p in - let typ_with_attributes = {typ with ptyp_attributes = List.concat[attrs; typ.ptyp_attributes]} in - Some (uncurried, [], Asttypes.Nolabel, typ_with_attributes, start_pos) - ) else - None - - (* (int, ~x:string, float) *) - and parse_type_parameters p = - let start_pos = p.Parser.start_pos in - Parser.expect Lparen p; - match p.Parser.token with - | Rparen -> - Parser.next p; - let loc = mk_loc start_pos p.prev_end_pos in - let unit_constr = Location.mkloc (Longident.Lident "unit") loc in - let typ = Ast_helper.Typ.constr unit_constr [] in - [(false, [], Asttypes.Nolabel, typ, start_pos)] - | _ -> - let params = - parse_comma_delimited_region ~grammar:Grammar.TypeParameters ~closing:Rparen ~f:parse_type_parameter p - in - Parser.expect Rparen p; - params - - and parse_es6_arrow_type ~attrs p = - let start_pos = p.Parser.start_pos in - match p.Parser.token with - | Tilde -> - Parser.next p; - let (name, _loc) = parse_lident p in - Parser.expect ~grammar:Grammar.TypeExpression Colon p; - let typ = parse_typ_expr ~alias:false ~es6_arrow:false p in - let arg = match p.Parser.token with - | Equal -> - Parser.next p; - Parser.expect Question p; - Asttypes.Optional name - | _ -> - Asttypes.Labelled name - in - Parser.expect EqualGreater p; - let return_type = parse_typ_expr ~alias:false p in - Ast_helper.Typ.arrow ~attrs arg typ return_type - | _ -> - let parameters = parse_type_parameters p in - Parser.expect EqualGreater p; - let return_type = parse_typ_expr ~alias:false p in - let end_pos = p.prev_end_pos in - let typ = List.fold_right (fun (uncurried, attrs, arg_lbl, typ, start_pos) t -> - let attrs = if uncurried then uncurry_attr::attrs else attrs in - Ast_helper.Typ.arrow ~loc:(mk_loc start_pos end_pos) ~attrs arg_lbl typ t - ) parameters return_type - in - {typ with - ptyp_attributes = List.concat [typ.ptyp_attributes; attrs]; - ptyp_loc = mk_loc start_pos p.prev_end_pos} - - (* - * typexpr ::= - * | 'ident - * | _ - * | (typexpr) - * | typexpr => typexpr --> es6 arrow - * | (typexpr, typexpr) => typexpr --> es6 arrow - * | /typexpr, typexpr, typexpr/ --> tuple - * | typeconstr - * | typeconstr - * | typeconstr - * | typexpr as 'ident - * | %attr-id --> extension - * | %attr-id(payload) --> extension - * - * typeconstr ::= - * | lident - * | uident.lident - * | uident.uident.lident --> long module path - *) - and parse_typ_expr ?attrs ?(es6_arrow=true) ?(alias=true) p = - (* Parser.leaveBreadcrumb p Grammar.TypeExpression; *) - let start_pos = p.Parser.start_pos in - let attrs = match attrs with - | Some attrs -> - attrs - | None -> - parse_attributes p in - let typ = if es6_arrow && is_es6_arrow_type p then - parse_es6_arrow_type ~attrs p - else - let typ = parse_atomic_typ_expr ~attrs p in - parse_arrow_type_rest ~es6_arrow ~start_pos typ p - in - let typ = if alias then parse_type_alias p typ else typ in - (* Parser.eatBreadcrumb p; *) - typ - - and parse_arrow_type_rest ~es6_arrow ~start_pos typ p = - match p.Parser.token with - | (EqualGreater | MinusGreater) as token when es6_arrow == true -> - (* error recovery *) - if token = MinusGreater then ( - Parser.expect EqualGreater p; - ); - Parser.next p; - let return_type = parse_typ_expr ~alias:false p in - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Typ.arrow ~loc Asttypes.Nolabel typ return_type - | _ -> typ - - and parse_typ_expr_region p = - if Grammar.is_typ_expr_start p.Parser.token then - Some (parse_typ_expr p) - else - None - - and parse_tuple_type ~attrs ~first ~start_pos p = - let typexprs = - parse_comma_delimited_region - ~grammar:Grammar.TypExprList - ~closing:Rparen - ~f:parse_typ_expr_region - p - in - Parser.expect Rparen p; - let tuple_loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Typ.tuple ~attrs ~loc:tuple_loc (first::typexprs) - - and parse_type_constructor_arg_region p = - if Grammar.is_typ_expr_start p.Parser.token then - Some (parse_typ_expr p) - else if p.token = LessThan then ( - Parser.next p; - parse_type_constructor_arg_region p - ) else - None - - (* Js.Nullable.value<'a> *) - and parse_type_constructor_args ~constr_name p = - let opening = p.Parser.token in - let opening_start_pos = p.start_pos in - match opening with - | LessThan | Lparen -> - Scanner.set_diamond_mode p.scanner; - Parser.next p; - let type_args = - (* TODO: change Grammar.TypExprList to TypArgList!!! Why did I wrote this? *) - parse_comma_delimited_region - ~grammar:Grammar.TypExprList - ~closing:GreaterThan - ~f:parse_type_constructor_arg_region - p - in - let () = match p.token with - | Rparen when opening = Token.Lparen -> - let typ = Ast_helper.Typ.constr constr_name type_args in - let msg = - Doc.breakable_group ~force_break:true ( - Doc.concat [ - Doc.text "Type parameters require angle brackets:"; - Doc.indent ( - Doc.concat [ - Doc.line; - Printer.print_typ_expr typ CommentTable.empty; - ] - ) - ] - ) |> Doc.to_string ~width:80 - in - Parser.err ~start_pos:opening_start_pos p (Diagnostics.message msg); - Parser.next p - | _ -> - Parser.expect GreaterThan p - in - Scanner.pop_mode p.scanner Diamond; - type_args - | _ -> [] - - (* string-field-decl ::= - * | string: poly-typexpr - * | attributes string-field-decl *) - and parse_string_field_declaration p = - let attrs = parse_attributes p in - match p.Parser.token with - | String name -> - let name_start_pos = p.start_pos in - let name_end_pos = p.end_pos in - Parser.next p; - let field_name = Location.mkloc name (mk_loc name_start_pos name_end_pos) in - Parser.expect ~grammar:Grammar.TypeExpression Colon p; - let typ = parse_poly_type_expr p in - Some(Parsetree.Otag (field_name, attrs, typ)) - | _token -> - None - - (* field-decl ::= - * | [mutable] field-name : poly-typexpr - * | attributes field-decl *) - and parse_field_declaration p = - let start_pos = p.Parser.start_pos in - let attrs = parse_attributes p in - let mut = if Parser.optional p Token.Mutable then - Asttypes.Mutable - else - Asttypes.Immutable - in - let (lident, loc) = match p.token with - | List -> - let loc = mk_loc p.start_pos p.end_pos in - Parser.next p; - ("list", loc) - | _ -> parse_lident p - in - let name = Location.mkloc lident loc in - let typ = match p.Parser.token with - | Colon -> - Parser.next p; - parse_poly_type_expr p - | _ -> - Ast_helper.Typ.constr ~loc:name.loc {name with txt = Lident name.txt} [] - in - let loc = mk_loc start_pos typ.ptyp_loc.loc_end in - Ast_helper.Type.field ~attrs ~loc ~mut name typ - - - and parse_field_declaration_region p = - let start_pos = p.Parser.start_pos in - let attrs = parse_attributes p in - let mut = if Parser.optional p Token.Mutable then - Asttypes.Mutable - else - Asttypes.Immutable - in - match p.token with - | Lident _ | List -> - let (lident, loc) = match p.token with - | List -> - let loc = mk_loc p.start_pos p.end_pos in - Parser.next p; - ("list", loc) - | _ -> parse_lident p - in - let name = Location.mkloc lident loc in - let typ = match p.Parser.token with - | Colon -> - Parser.next p; - parse_poly_type_expr p - | _ -> - Ast_helper.Typ.constr ~loc:name.loc {name with txt = Lident name.txt} [] - in - let loc = mk_loc start_pos typ.ptyp_loc.loc_end in - Some(Ast_helper.Type.field ~attrs ~loc ~mut name typ) - | _ -> - None - - (* record-decl ::= - * | { field-decl } - * | { field-decl, field-decl } - * | { field-decl, field-decl, field-decl, } - *) - and parse_record_declaration p = - Parser.leave_breadcrumb p Grammar.RecordDecl; - Parser.expect Lbrace p; - let rows = - parse_comma_delimited_region - ~grammar:Grammar.RecordDecl - ~closing:Rbrace - ~f:parse_field_declaration_region - p - in - Parser.expect Rbrace p; - Parser.eat_breadcrumb p; - rows - - (* constr-args ::= - * | (typexpr) - * | (typexpr, typexpr) - * | (typexpr, typexpr, typexpr,) - * | (record-decl) - * - * TODO: should we overparse inline-records in every position? - * Give a good error message afterwards? - *) - and parse_constr_decl_args p = - let constr_args = match p.Parser.token with - | Lparen -> - Parser.next p; - (* TODO: this could use some cleanup/stratification *) - begin match p.Parser.token with - | Lbrace -> - let lbrace = p.start_pos in - Parser.next p; - let start_pos = p.Parser.start_pos in - begin match p.Parser.token with - | DotDot | Dot -> - let closed_flag = match p.token with - | DotDot -> Parser.next p; Asttypes.Open - | Dot -> Parser.next p; Asttypes.Closed - | _ -> Asttypes.Closed - in - let fields = - parse_comma_delimited_region - ~grammar:Grammar.StringFieldDeclarations - ~closing:Rbrace - ~f:parse_string_field_declaration - p - in - Parser.expect Rbrace p; - let loc = mk_loc start_pos p.prev_end_pos in - let typ = make_bs_obj_type ~attrs:[] ~loc ~closed:closed_flag fields in - Parser.optional p Comma |> ignore; - let more_args = - parse_comma_delimited_region - ~grammar:Grammar.TypExprList - ~closing:Rparen - ~f:parse_typ_expr_region - p - in - Parser.expect Rparen p; - Parsetree.Pcstr_tuple (typ::more_args) - | _ -> - let attrs = parse_attributes p in - begin match p.Parser.token with - | String _ -> - let closed_flag = Asttypes.Closed in - let fields = match attrs with - | [] -> - parse_comma_delimited_region - ~grammar:Grammar.StringFieldDeclarations - ~closing:Rbrace - ~f:parse_string_field_declaration - p - | attrs -> - let first = - Parser.leave_breadcrumb p Grammar.StringFieldDeclarations; - let field = match parse_string_field_declaration p with - | Some field -> field - | None -> assert false - in - (* parse comma after first *) - let () = match p.Parser.token with - | Rbrace | Eof -> () - | Comma -> Parser.next p - | _ -> Parser.expect Comma p - in - Parser.eat_breadcrumb p; - begin match field with - | Parsetree.Otag (label, _, ct) -> Parsetree.Otag (label, attrs, ct) - | Oinherit ct -> Oinherit ct - end - in - first::( - parse_comma_delimited_region - ~grammar:Grammar.StringFieldDeclarations - ~closing:Rbrace - ~f:parse_string_field_declaration - p - ) in - Parser.expect Rbrace p; - let loc = mk_loc start_pos p.prev_end_pos in - let typ = make_bs_obj_type ~attrs:[] ~loc ~closed:closed_flag fields in - Parser.optional p Comma |> ignore; - let more_args = - parse_comma_delimited_region - ~grammar:Grammar.TypExprList - ~closing:Rparen - ~f:parse_typ_expr_region p - in - Parser.expect Rparen p; - Parsetree.Pcstr_tuple (typ::more_args) - | _ -> - let fields = match attrs with - | [] -> - parse_comma_delimited_region - ~grammar:Grammar.FieldDeclarations - ~closing:Rbrace - ~f:parse_field_declaration_region - p - | attrs -> - let first = - let field = parse_field_declaration p in - Parser.expect Comma p; - {field with Parsetree.pld_attributes = attrs} - in - first::( - parse_comma_delimited_region - ~grammar:Grammar.FieldDeclarations - ~closing:Rbrace - ~f:parse_field_declaration_region - p - ) - in - let () = match fields with - | [] -> Parser.err ~start_pos:lbrace p ( - Diagnostics.message "An inline record declaration needs at least one field" - ) - | _ -> () - in - Parser.expect Rbrace p; - Parser.optional p Comma |> ignore; - Parser.expect Rparen p; - Parsetree.Pcstr_record fields - end - end - | _ -> - let args = - parse_comma_delimited_region - ~grammar:Grammar.TypExprList - ~closing:Rparen - ~f:parse_typ_expr_region - p - in - Parser.expect Rparen p; - Parsetree.Pcstr_tuple args - end - | _ -> Pcstr_tuple [] - in - let res = match p.Parser.token with - | Colon -> - Parser.next p; - Some (parse_typ_expr p) - | _ -> None - in - (constr_args, res) - - (* constr-decl ::= - * | constr-name - * | attrs constr-name - * | constr-name const-args - * | attrs constr-name const-args *) - and parse_type_constructor_declaration_with_bar p = - match p.Parser.token with - | Bar -> - let start_pos = p.Parser.start_pos in - Parser.next p; - Some (parse_type_constructor_declaration ~start_pos p) - | _ -> None - - and parse_type_constructor_declaration ~start_pos p = - Parser.leave_breadcrumb p Grammar.ConstructorDeclaration; - let attrs = parse_attributes p in - match p.Parser.token with - | Uident uident -> - let uident_loc = mk_loc p.start_pos p.end_pos in - Parser.next p; - let (args, res) = parse_constr_decl_args p in - Parser.eat_breadcrumb p; - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Type.constructor ~loc ~attrs ?res ~args (Location.mkloc uident uident_loc) - | t -> - Parser.err p (Diagnostics.uident t); - Ast_helper.Type.constructor (Location.mknoloc "_") - - (* [|] constr-decl { | constr-decl } *) - and parse_type_constructor_declarations ?first p = - let first_constr_decl = match first with - | None -> - let start_pos = p.Parser.start_pos in - ignore (Parser.optional p Token.Bar); - parse_type_constructor_declaration ~start_pos p - | Some first_constr_decl -> - first_constr_decl - in - first_constr_decl::( - parse_region - ~grammar:Grammar.ConstructorDeclaration - ~f:parse_type_constructor_declaration_with_bar - p - ) - - (* - * type-representation ::= - * ∣ = [ | ] constr-decl { | constr-decl } - * ∣ = private [ | ] constr-decl { | constr-decl } - * | = | - * ∣ = private | - * ∣ = record-decl - * ∣ = private record-decl - * | = .. - *) - and parse_type_representation p = - Parser.leave_breadcrumb p Grammar.TypeRepresentation; - (* = consumed *) - let private_flag = - if Parser.optional p Token.Private - then Asttypes.Private - else Asttypes.Public - in - let kind = match p.Parser.token with - | Bar | Uident _ -> - Parsetree.Ptype_variant (parse_type_constructor_declarations p) - | Lbrace -> - Parsetree.Ptype_record (parse_record_declaration p) - | DotDot -> - Parser.next p; - Ptype_open - | token -> - Parser.err p (Diagnostics.unexpected token p.breadcrumbs); - (* TODO: I have no idea if this is even remotely a good idea *) - Parsetree.Ptype_variant [] - in - Parser.eat_breadcrumb p; - (private_flag, kind) - - (* type-param ::= - * | variance 'lident - * | variance _ - * - * variance ::= - * | + - * | - - * | (* empty *) - *) - and parse_type_param p = - let variance = match p.Parser.token with - | Plus -> Parser.next p; Asttypes.Covariant - | Minus -> Parser.next p; Contravariant - | _ -> Invariant - in - match p.Parser.token with - | SingleQuote -> - Parser.next p; - let (ident, loc) = parse_lident p in - Some (Ast_helper.Typ.var ~loc ident, variance) - | Underscore -> - let loc = mk_loc p.start_pos p.end_pos in - Parser.next p; - Some (Ast_helper.Typ.any ~loc (), variance) - (* TODO: should we try parsing lident as 'ident ? *) - | _token -> - None - - (* type-params ::= - * | - * ∣ - * ∣ - * ∣ - * - * TODO: when we have pretty-printer show an error - * with the actual code corrected. *) - and parse_type_params ~parent p = - let opening = p.Parser.token in - match opening with - | LessThan | Lparen when p.start_pos.pos_lnum == p.prev_end_pos.pos_lnum -> - Scanner.set_diamond_mode p.scanner; - let opening_start_pos = p.start_pos in - Parser.leave_breadcrumb p Grammar.TypeParams; - Parser.next p; - let params = - parse_comma_delimited_region - ~grammar:Grammar.TypeParams - ~closing:GreaterThan - ~f:parse_type_param - p - in - let () = match p.token with - | Rparen when opening = Token.Lparen -> - let msg = - Doc.breakable_group ~force_break:true ( - Doc.concat [ - Doc.text "Type parameters require angle brackets:"; - Doc.indent ( - Doc.concat [ - Doc.line; - Doc.concat [ - Printer.print_longident parent.Location.txt; - Printer.print_type_params params CommentTable.empty; - ] - ] - ) - ] - ) |> Doc.to_string ~width:80 - in - Parser.err ~start_pos:opening_start_pos p (Diagnostics.message msg); - Parser.next p - | _ -> - Parser.expect GreaterThan p - in - Scanner.pop_mode p.scanner Diamond; - Parser.eat_breadcrumb p; - params - | _ -> [] - - (* type-constraint ::= constraint ' ident = typexpr *) - and parse_type_constraint p = - let start_pos = p.Parser.start_pos in - match p.Parser.token with - | Token.Constraint -> - Parser.next p; - Parser.expect SingleQuote p; - begin match p.Parser.token with - | Lident ident -> - let ident_loc = mk_loc start_pos p.end_pos in - Parser.next p; - Parser.expect Equal p; - let typ = parse_typ_expr p in - let loc = mk_loc start_pos p.prev_end_pos in - Some (Ast_helper.Typ.var ~loc:ident_loc ident, typ, loc) - | t -> - Parser.err p (Diagnostics.lident t); - let loc = mk_loc start_pos p.prev_end_pos in - Some (Ast_helper.Typ.any (), parse_typ_expr p, loc) - end - | _ -> None - - (* type-constraints ::= - * | (* empty *) - * | type-constraint - * | type-constraint type-constraint - * | type-constraint type-constraint type-constraint (* 0 or more *) - *) - and parse_type_constraints p = - parse_region - ~grammar:Grammar.TypeConstraint - ~f:parse_type_constraint - p - - and parse_type_equation_or_constr_decl p = - let uident_start_pos = p.Parser.start_pos in - match p.Parser.token with - | Uident uident -> - Parser.next p; - begin match p.Parser.token with - | Dot -> - Parser.next p; - let type_constr = - parse_value_path_tail p uident_start_pos (Longident.Lident uident) - in - let loc = mk_loc uident_start_pos p.prev_end_pos in - let typ = parse_type_alias p ( - Ast_helper.Typ.constr ~loc type_constr (parse_type_constructor_args ~constr_name:type_constr p) - ) in - begin match p.token with - | Equal -> - Parser.next p; - let (priv, kind) = parse_type_representation p in - (Some typ, priv, kind) - | EqualGreater -> - Parser.next p; - let return_type = parse_typ_expr ~alias:false p in - let loc = mk_loc uident_start_pos p.prev_end_pos in - let arrow_type = Ast_helper.Typ.arrow ~loc Asttypes.Nolabel typ return_type in - let typ = parse_type_alias p arrow_type in - (Some typ, Asttypes.Public, Parsetree.Ptype_abstract) - | _ -> (Some typ, Asttypes.Public, Parsetree.Ptype_abstract) - end - | _ -> - let uident_end_pos = p.end_pos in - let (args, res) = parse_constr_decl_args p in - let first = Some ( - let uident_loc = mk_loc uident_start_pos uident_end_pos in - Ast_helper.Type.constructor - ~loc:(mk_loc uident_start_pos p.prev_end_pos) - ?res - ~args - (Location.mkloc uident uident_loc) - ) in - (None, Asttypes.Public, Parsetree.Ptype_variant (parse_type_constructor_declarations p ?first)) - end - | t -> - Parser.err p (Diagnostics.uident t); - (* TODO: is this a good idea? *) - (None, Asttypes.Public, Parsetree.Ptype_abstract) - - and parse_record_or_bs_object_decl p = - let start_pos = p.Parser.start_pos in - Parser.expect Lbrace p; - match p.Parser.token with - | DotDot | Dot -> - let closed_flag = match p.token with - | DotDot -> Parser.next p; Asttypes.Open - | Dot -> Parser.next p; Asttypes.Closed - | _ -> Asttypes.Closed - in - let fields = - parse_comma_delimited_region - ~grammar:Grammar.StringFieldDeclarations - ~closing:Rbrace - ~f:parse_string_field_declaration - p - in - Parser.expect Rbrace p; - let loc = mk_loc start_pos p.prev_end_pos in - let typ = - make_bs_obj_type ~attrs:[] ~loc ~closed:closed_flag fields - |> parse_type_alias p - in - let typ = parse_arrow_type_rest ~es6_arrow:true ~start_pos typ p in - (Some typ, Asttypes.Public, Parsetree.Ptype_abstract) - | _ -> - let attrs = parse_attributes p in - begin match p.Parser.token with - | String _ -> - let closed_flag = Asttypes.Closed in - let fields = match attrs with - | [] -> - parse_comma_delimited_region - ~grammar:Grammar.StringFieldDeclarations - ~closing:Rbrace - ~f:parse_string_field_declaration - p - | attrs -> - let first = - Parser.leave_breadcrumb p Grammar.StringFieldDeclarations; - let field = match parse_string_field_declaration p with - | Some field -> field - | None -> assert false - in - (* parse comma after first *) - let () = match p.Parser.token with - | Rbrace | Eof -> () - | Comma -> Parser.next p - | _ -> Parser.expect Comma p - in - Parser.eat_breadcrumb p; - begin match field with - | Parsetree.Otag (label, _, ct) -> Parsetree.Otag (label, attrs, ct) - | Oinherit ct -> Oinherit ct - end - in - first::( - parse_comma_delimited_region - ~grammar:Grammar.StringFieldDeclarations - ~closing:Rbrace - ~f:parse_string_field_declaration - p - ) - in - Parser.expect Rbrace p; - let loc = mk_loc start_pos p.prev_end_pos in - let typ = - make_bs_obj_type ~attrs:[] ~loc ~closed:closed_flag fields |> parse_type_alias p - in - let typ = parse_arrow_type_rest ~es6_arrow:true ~start_pos typ p in - (Some typ, Asttypes.Public, Parsetree.Ptype_abstract) - | _ -> - Parser.leave_breadcrumb p Grammar.RecordDecl; - let fields = match attrs with - | [] -> - parse_comma_delimited_region - ~grammar:Grammar.FieldDeclarations - ~closing:Rbrace - ~f:parse_field_declaration_region - p - | attr::_ as attrs -> - let first = - let field = parse_field_declaration p in - Parser.optional p Comma |> ignore; - {field with - Parsetree.pld_attributes = attrs; - pld_loc = { - field.Parsetree.pld_loc with loc_start = - (attr |> fst).loc.loc_start - } - } - in - first::( - parse_comma_delimited_region - ~grammar:Grammar.FieldDeclarations - ~closing:Rbrace - ~f:parse_field_declaration_region - p - ) - in - let () = match fields with - | [] -> Parser.err ~start_pos p ( - Diagnostics.message "A record needs at least one field" - ) - | _ -> () - in - Parser.expect Rbrace p; - Parser.eat_breadcrumb p; - (None, Asttypes.Public, Parsetree.Ptype_record fields) - end - - and parse_private_eq_or_repr p = - Parser.expect Private p; - match p.Parser.token with - | Lbrace -> - let (manifest, _ ,kind) = parse_record_or_bs_object_decl p in - (manifest, Asttypes.Private, kind) - | Uident _ -> - let (manifest, _, kind) = parse_type_equation_or_constr_decl p in - (manifest, Asttypes.Private, kind) - | Bar | DotDot -> - let (_, kind) = parse_type_representation p in - (None, Asttypes.Private, kind) - | t when Grammar.is_typ_expr_start t -> - (Some (parse_typ_expr p), Asttypes.Private, Parsetree.Ptype_abstract) - | _ -> - let (_, kind) = parse_type_representation p in - (None, Asttypes.Private, kind) - - (* - polymorphic-variant-type ::= - | [ tag-spec-first { | tag-spec } ] - | [> [ tag-spec ] { | tag-spec } ] - | [< [|] tag-spec-full { | tag-spec-full } [ > { `tag-name }+ ] ] - - tag-spec-first ::= `tag-name [ of typexpr ] - | [ typexpr ] | tag-spec - - tag-spec ::= `tag-name [ of typexpr ] - | typexpr - - tag-spec-full ::= `tag-name [ of [&] typexpr { & typexpr } ] - | typexpr - *) - and parse_polymorphic_variant_type ~attrs p = - let start_pos = p.Parser.start_pos in - Parser.expect Lbracket p; - match p.token with - | GreaterThan -> - Parser.next p; - let row_fields = - begin match p.token with - | Rbracket -> - [] - | Bar -> - parse_tag_specs p - | _ -> - let row_field = parse_tag_spec p in - row_field :: parse_tag_specs p - end - in - let variant = - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Typ.variant ~attrs ~loc row_fields Open None in - Parser.expect Rbracket p; - variant - | LessThan -> - Parser.next p; - Parser.optional p Bar |> ignore; - let row_field = parse_tag_spec_full p in - let row_fields = parse_tag_spec_fulls p in - let tag_names = - if p.token == GreaterThan - then begin - Parser.next p; - let rec loop p = match p.Parser.token with - | Rbracket -> [] - | _ -> - let (ident, _loc) = parse_hash_ident ~start_pos:p.start_pos p in - ident :: loop p - in - loop p - end - else [] in - let variant = - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Typ.variant ~attrs ~loc (row_field :: row_fields) Closed (Some tag_names) in - Parser.expect Rbracket p; - variant - | _ -> - let row_fields1 = parse_tag_spec_first p in - let row_fields2 = parse_tag_specs p in - let variant = - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Typ.variant ~attrs ~loc (row_fields1 @ row_fields2) Closed None in - Parser.expect Rbracket p; - variant - - and parse_tag_spec_fulls p = - match p.Parser.token with - | Rbracket -> - [] - | GreaterThan -> - [] - | Bar -> - Parser.next p; - let row_field = parse_tag_spec_full p in - row_field ::parse_tag_spec_fulls p - | _ -> - [] - - and parse_tag_spec_full p = - let attrs = parse_attributes p in - match p.Parser.token with - | Hash -> - parse_polymorphic_variant_type_spec_hash ~attrs ~full:true p - | _ -> - let typ = parse_typ_expr ~attrs p in - Parsetree.Rinherit typ - - and parse_tag_specs p = - match p.Parser.token with - | Bar -> - Parser.next p; - let row_field = parse_tag_spec p in - row_field :: parse_tag_specs p - | _ -> - [] - - and parse_tag_spec p = - let attrs = parse_attributes p in - match p.Parser.token with - | Hash -> - parse_polymorphic_variant_type_spec_hash ~attrs ~full:false p - | _ -> - let typ = parse_typ_expr ~attrs p in - Parsetree.Rinherit typ - - and parse_tag_spec_first p = - let attrs = parse_attributes p in - match p.Parser.token with - | Bar -> - Parser.next p; - [parse_tag_spec p] - | Hash -> - [parse_polymorphic_variant_type_spec_hash ~attrs ~full:false p] - | _ -> - let typ = parse_typ_expr ~attrs p in - Parser.expect Bar p; - [Parsetree.Rinherit typ; parse_tag_spec p] - - and parse_polymorphic_variant_type_spec_hash ~attrs ~full p : Parsetree.row_field = - let start_pos = p.Parser.start_pos in - let (ident, loc) = parse_hash_ident ~start_pos p in - let rec loop p = - match p.Parser.token with - | Band when full -> - Parser.next p; - let row_field = parse_polymorphic_variant_type_args p in - row_field :: loop p - | _ -> - [] - in - let first_tuple, tag_contains_a_constant_empty_constructor = - match p.Parser.token with - | Band when full -> - Parser.next p; - [parse_polymorphic_variant_type_args p], true - | Lparen -> - [parse_polymorphic_variant_type_args p], false - | _ -> - [], true - in - let tuples = first_tuple @ loop p in - Parsetree.Rtag ( - Location.mkloc ident loc, - attrs, - tag_contains_a_constant_empty_constructor, - tuples - ) - - and parse_polymorphic_variant_type_args p = - let start_pos = p.Parser.start_pos in - Parser.expect Lparen p; - let args = parse_comma_delimited_region - ~grammar:Grammar.TypExprList - ~closing:Rparen - ~f:parse_typ_expr_region - p - in - Parser.expect Rparen p; - let attrs = [] in - let loc = mk_loc start_pos p.prev_end_pos in - match args with - | [{ptyp_desc = Ptyp_tuple _} as typ] as types -> - if p.mode = ParseForTypeChecker then - typ - else - Ast_helper.Typ.tuple ~loc ~attrs types - | [typ] -> typ - | types -> Ast_helper.Typ.tuple ~loc ~attrs types - - and parse_type_equation_and_representation p = - match p.Parser.token with - | Equal | Bar as token -> - if token = Bar then Parser.expect Equal p; - Parser.next p; - begin match p.Parser.token with - | Uident _ -> - parse_type_equation_or_constr_decl p - | Lbrace -> - parse_record_or_bs_object_decl p - | Private -> - parse_private_eq_or_repr p - | Bar | DotDot -> - let (priv, kind) = parse_type_representation p in - (None, priv, kind) - | _ -> - let manifest = Some (parse_typ_expr p) in - begin match p.Parser.token with - | Equal -> - Parser.next p; - let (priv, kind) = parse_type_representation p in - (manifest, priv, kind) - | _ -> - (manifest, Public, Parsetree.Ptype_abstract) - end - end - | _ -> (None, Public, Parsetree.Ptype_abstract) - - (* type-definition ::= type [rec] typedef { and typedef } - * typedef ::= typeconstr-name [type-params] type-information - * type-information ::= [type-equation] [type-representation] { type-constraint } - * type-equation ::= = typexpr *) - and parse_type_def ~attrs ~start_pos p = - Parser.leave_breadcrumb p Grammar.TypeDef; - (* let attrs = match attrs with | Some attrs -> attrs | None -> parseAttributes p in *) - Parser.leave_breadcrumb p Grammar.TypeConstrName; - let (name, loc) = parse_lident p in - let type_constr_name = Location.mkloc name loc in - Parser.eat_breadcrumb p; - let params = - let constr_name = Location.mkloc (Longident.Lident name) loc in - parse_type_params ~parent:constr_name p in - let type_def = - let (manifest, priv, kind) = parse_type_equation_and_representation p in - let cstrs = parse_type_constraints p in - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Type.mk - ~loc ~attrs ~priv ~kind ~params ~cstrs ?manifest type_constr_name - in - Parser.eat_breadcrumb p; - type_def - - and parse_type_extension ~params ~attrs ~name p = - Parser.expect PlusEqual p; - let priv = - if Parser.optional p Token.Private - then Asttypes.Private - else Asttypes.Public - in - let constr_start = p.Parser.start_pos in - Parser.optional p Bar |> ignore; - let first = - let (attrs, name, kind) = match p.Parser.token with - | Bar -> - Parser.next p; - parse_constr_def ~parse_attrs:true p - | _ -> - parse_constr_def ~parse_attrs:true p - in - let loc = mk_loc constr_start p.prev_end_pos in - Ast_helper.Te.constructor ~loc ~attrs name kind - in - let rec loop p cs = - match p.Parser.token with - | Bar -> - let start_pos = p.Parser.start_pos in - Parser.next p; - let (attrs, name, kind) = parse_constr_def ~parse_attrs:true p in - let ext_constr = - Ast_helper.Te.constructor ~attrs ~loc:(mk_loc start_pos p.prev_end_pos) name kind - in - loop p (ext_constr::cs) - | _ -> - List.rev cs - in - let constructors = loop p [first] in - Ast_helper.Te.mk ~attrs ~params ~priv name constructors - - and parse_type_definitions ~attrs ~name ~params ~start_pos p = - let type_def = - let (manifest, priv, kind) = parse_type_equation_and_representation p in - let cstrs = parse_type_constraints p in - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Type.mk - ~loc ~attrs ~priv ~kind ~params ~cstrs ?manifest - {name with txt = lident_of_path name.Location.txt} - in - let rec loop p defs = - let start_pos = p.Parser.start_pos in - let attrs = parse_attributes_and_binding p in - match p.Parser.token with - | And -> - Parser.next p; - let attrs = match p.token with - | Export -> - let export_loc = mk_loc p.start_pos p.end_pos in - Parser.next p; - let gentype_attr = (Location.mkloc "genType" export_loc, Parsetree.PStr []) in - gentype_attr::attrs - | _ -> attrs - in - let type_def = parse_type_def ~attrs ~start_pos p in - loop p (type_def::defs) - | _ -> - List.rev defs - in - loop p [type_def] - - (* TODO: decide if we really want type extensions (eg. type x += Blue) - * It adds quite a bit of complexity that can be avoided, - * implemented for now. Needed to get a feel for the complexities of - * this territory of the grammar *) - and parse_type_definition_or_extension ~attrs p = - let start_pos = p.Parser.start_pos in - Parser.expect Token.Typ p; - let rec_flag = match p.token with - | Rec -> Parser.next p; Asttypes.Recursive - | Lident "nonrec" -> - Parser.next p; - Asttypes.Nonrecursive - | _ -> Asttypes.Nonrecursive - in - let name = parse_value_path p in - let params = parse_type_params ~parent:name p in - match p.Parser.token with - | PlusEqual -> - TypeExt(parse_type_extension ~params ~attrs ~name p) - | _ -> - let type_defs = parse_type_definitions ~attrs ~name ~params ~start_pos p in - TypeDef {rec_flag; types = type_defs} - - and parse_primitive p = - match p.Parser.token with - | String s -> Parser.next p; Some s - | _ -> None - - and parse_primitives p = - match (parse_region ~grammar:Grammar.Primitive ~f:parse_primitive p) with - | [] -> - let msg = "An external definition should have at least one primitive. Example: \"setTimeout\"" in - Parser.err p (Diagnostics.message msg); - [] - | primitives -> primitives - - (* external value-name : typexp = external-declaration *) - and parse_external_def ~attrs p = - let start_pos = p.Parser.start_pos in - Parser.leave_breadcrumb p Grammar.External; - Parser.expect Token.External p; - let (name, loc) = parse_lident p in - let name = Location.mkloc name loc in - Parser.expect ~grammar:(Grammar.TypeExpression) Colon p; - let typ_expr = parse_typ_expr p in - Parser.expect Equal p; - let prim = parse_primitives p in - let loc = mk_loc start_pos p.prev_end_pos in - let vb = Ast_helper.Val.mk ~loc ~attrs ~prim name typ_expr in - Parser.eat_breadcrumb p; - vb - - (* constr-def ::= - * | constr-decl - * | constr-name = constr - * - * constr-decl ::= constr-name constr-args - * constr-name ::= uident - * constr ::= path-uident *) - and parse_constr_def ~parse_attrs p = - let attrs = if parse_attrs then parse_attributes p else [] in - let name = match p.Parser.token with - | Uident name -> - let loc = mk_loc p.start_pos p.end_pos in - Parser.next p; - Location.mkloc name loc - | t -> - Parser.err p (Diagnostics.uident t); - Location.mknoloc "_" - in - let kind = match p.Parser.token with - | Lparen -> - let (args, res) = parse_constr_decl_args p in - Parsetree.Pext_decl (args, res) - | Equal -> - Parser.next p; - let longident = parse_module_long_ident ~lowercase:false p in - Parsetree.Pext_rebind longident - | _ -> - Parsetree.Pext_decl (Pcstr_tuple [], None) - in - (attrs, name, kind) - - (* - * exception-definition ::= - * | exception constr-decl - * ∣ exception constr-name = constr - * - * constr-name ::= uident - * constr ::= long_uident *) - and parse_exception_def ~attrs p = - let start_pos = p.Parser.start_pos in - Parser.expect Token.Exception p; - let (_, name, kind) = parse_constr_def ~parse_attrs:false p in - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Te.constructor ~loc ~attrs name kind - - (* module structure on the file level *) - and parse_implementation p : Parsetree.structure = - parse_region p ~grammar:Grammar.Implementation ~f:parse_structure_item_region - [@@progress (Parser.next, Parser.expect, Parser.check_progress)] - - and parse_structure_item_region p = - let start_pos = p.Parser.start_pos in - let attrs = parse_attributes p in - match p.Parser.token with - | Open -> - let open_description = parse_open_description ~attrs p in - Parser.optional p Semicolon |> ignore; - let loc = mk_loc start_pos p.prev_end_pos in - Some (Ast_helper.Str.open_ ~loc open_description) - | Let -> - let (rec_flag, let_bindings) = parse_let_bindings ~attrs p in - Parser.optional p Semicolon |> ignore; - let loc = mk_loc start_pos p.prev_end_pos in - Some (Ast_helper.Str.value ~loc rec_flag let_bindings) - | Typ -> - Parser.begin_region p; - begin match parse_type_definition_or_extension ~attrs p with - | TypeDef {rec_flag; types} -> - Parser.optional p Semicolon |> ignore; - let loc = mk_loc start_pos p.prev_end_pos in - Parser.end_region p; - Some (Ast_helper.Str.type_ ~loc rec_flag types) - | TypeExt(ext) -> - Parser.optional p Semicolon |> ignore; - let loc = mk_loc start_pos p.prev_end_pos in - Parser.end_region p; - Some (Ast_helper.Str.type_extension ~loc ext) - end - | External -> - let external_def = parse_external_def ~attrs p in - Parser.optional p Semicolon |> ignore; - let loc = mk_loc start_pos p.prev_end_pos in - Some (Ast_helper.Str.primitive ~loc external_def) - | Import -> - let import_descr = parse_js_import ~start_pos ~attrs p in - Parser.optional p Semicolon |> ignore; - let loc = mk_loc start_pos p.prev_end_pos in - let structure_item = JsFfi.to_parsetree import_descr in - Some {structure_item with pstr_loc = loc} - | Exception -> - let exception_def = parse_exception_def ~attrs p in - Parser.optional p Semicolon |> ignore; - let loc = mk_loc start_pos p.prev_end_pos in - Some (Ast_helper.Str.exception_ ~loc exception_def) - | Include -> - let include_statement = parse_include_statement ~attrs p in - Parser.optional p Semicolon |> ignore; - let loc = mk_loc start_pos p.prev_end_pos in - Some (Ast_helper.Str.include_ ~loc include_statement) - | Export -> - let structure_item = parse_js_export ~attrs p in - Parser.optional p Semicolon |> ignore; - let loc = mk_loc start_pos p.prev_end_pos in - Some {structure_item with pstr_loc = loc} - | Module -> - let structure_item = parse_module_or_module_type_impl_or_pack_expr ~attrs p in - Parser.optional p Semicolon |> ignore; - let loc = mk_loc start_pos p.prev_end_pos in - Some {structure_item with pstr_loc = loc} - | AtAt -> - let attr = parse_standalone_attribute p in - Parser.optional p Semicolon |> ignore; - let loc = mk_loc start_pos p.prev_end_pos in - Some (Ast_helper.Str.attribute ~loc attr) - | PercentPercent -> - let extension = parse_extension ~module_language:true p in - Parser.optional p Semicolon |> ignore; - let loc = mk_loc start_pos p.prev_end_pos in - Some (Ast_helper.Str.extension ~attrs ~loc extension) - | token when Grammar.is_expr_start token -> - let prev_end_pos = p.Parser.end_pos in - let exp = parse_expr p in - Parser.optional p Semicolon |> ignore; - let loc = mk_loc start_pos p.prev_end_pos in - Parser.check_progress ~prev_end_pos ~result:(Ast_helper.Str.eval ~loc ~attrs exp) p - | _ -> None - - and parse_js_import ~start_pos ~attrs p = - Parser.expect Token.Import p; - let import_spec = match p.Parser.token with - | Token.Lident _ | Token.At -> - let decl = match parse_js_ffi_declaration p with - | Some decl -> decl - | None -> assert false - in - JsFfi.Default decl - | _ -> JsFfi.Spec(parse_js_ffi_declarations p) - in - let scope = parse_js_ffi_scope p in - let loc = mk_loc start_pos p.prev_end_pos in - JsFfi.import_descr ~attrs ~import_spec ~scope ~loc - - and parse_js_export ~attrs p = - let export_start = p.Parser.start_pos in - Parser.expect Token.Export p; - let export_loc = mk_loc export_start p.prev_end_pos in - let gentype_attr = (Location.mkloc "genType" export_loc, Parsetree.PStr []) in - let attrs = gentype_attr::attrs in - match p.Parser.token with - | Typ -> - begin match parse_type_definition_or_extension ~attrs p with - | TypeDef {rec_flag; types} -> - Ast_helper.Str.type_ rec_flag types - | TypeExt(ext) -> - Ast_helper.Str.type_extension ext - end - | (* Let *) _ -> - let (rec_flag, let_bindings) = parse_let_bindings ~attrs p in - Ast_helper.Str.value rec_flag let_bindings - - and parse_js_ffi_scope p = - match p.Parser.token with - | Token.Lident "from" -> - Parser.next p; - begin match p.token with - | String s -> Parser.next p; JsFfi.Module s - | Uident _ | Lident _ -> - let value = parse_ident_path p in - JsFfi.Scope value - | _ -> JsFfi.Global - end - | _ -> JsFfi.Global - - and parse_js_ffi_declarations p = - Parser.expect Token.Lbrace p; - let decls = parse_comma_delimited_region - ~grammar:Grammar.JsFfiImport - ~closing:Rbrace - ~f:parse_js_ffi_declaration - p - in - Parser.expect Rbrace p; - decls - - and parse_js_ffi_declaration p = - let start_pos = p.Parser.start_pos in - let attrs = parse_attributes p in - match p.Parser.token with - | Lident _ -> - let (ident, _) = parse_lident p in - let alias = match p.token with - | As -> - Parser.next p; - let (ident, _) = parse_lident p in - ident - | _ -> - ident - in - Parser.expect Token.Colon p; - let typ = parse_typ_expr p in - let loc = mk_loc start_pos p.prev_end_pos in - Some (JsFfi.decl ~loc ~alias ~attrs ~name:ident ~typ) - | _ -> None - - (* include-statement ::= include module-expr *) - and parse_include_statement ~attrs p = - let start_pos = p.Parser.start_pos in - Parser.expect Token.Include p; - let mod_expr = parse_module_expr p in - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Incl.mk ~loc ~attrs mod_expr - - and parse_atomic_module_expr p = - let start_pos = p.Parser.start_pos in - match p.Parser.token with - | Uident _ident -> - let longident = parse_module_long_ident ~lowercase:false p in - Ast_helper.Mod.ident ~loc:longident.loc longident - | Lbrace -> - Parser.next p; - let structure = Ast_helper.Mod.structure ( - parse_delimited_region - ~grammar:Grammar.Structure - ~closing:Rbrace - ~f:parse_structure_item_region - p - ) in - Parser.expect Rbrace p; - let end_pos = p.prev_end_pos in - {structure with pmod_loc = mk_loc start_pos end_pos} - | Lparen -> - Parser.next p; - let mod_expr = match p.token with - | Rparen -> - Ast_helper.Mod.structure ~loc:(mk_loc start_pos p.prev_end_pos) [] - | _ -> - parse_constrained_mod_expr p - in - Parser.expect Rparen p; - mod_expr - | Lident "unpack" -> (* TODO: should this be made a keyword?? *) - Parser.next p; - Parser.expect Lparen p; - let expr = parse_expr p in - begin match p.Parser.token with - | Colon -> - let colon_start = p.Parser.start_pos in - Parser.next p; - let attrs = parse_attributes p in - let package_type = parse_package_type ~start_pos:colon_start ~attrs p in - Parser.expect Rparen p; - let loc = mk_loc start_pos p.prev_end_pos in - let constraint_expr = Ast_helper.Exp.constraint_ - ~loc - expr package_type - in - Ast_helper.Mod.unpack ~loc constraint_expr - | _ -> - Parser.expect Rparen p; - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Mod.unpack ~loc expr - end - | Percent -> - let extension = parse_extension p in - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Mod.extension ~loc extension - | token -> - Parser.err p (Diagnostics.unexpected token p.breadcrumbs); - Recover.default_module_expr() - - and parse_primary_mod_expr p = - let start_pos = p.Parser.start_pos in - let mod_expr = parse_atomic_module_expr p in - let rec loop p mod_expr = - match p.Parser.token with - | Lparen when p.prev_end_pos.pos_lnum == p.start_pos.pos_lnum -> - loop p (parse_module_application p mod_expr) - | _ -> mod_expr - in - let mod_expr = loop p mod_expr in - {mod_expr with pmod_loc = mk_loc start_pos p.prev_end_pos} - - (* - * functor-arg ::= - * | uident : modtype - * | _ : modtype - * | modtype --> "punning" for _ : modtype - * | attributes functor-arg - *) - and parse_functor_arg p = - let start_pos = p.Parser.start_pos in - let attrs = parse_attributes p in - match p.Parser.token with - | Uident ident -> - Parser.next p; - let uident_end_pos = p.prev_end_pos in - begin match p.Parser.token with - | Colon -> - Parser.next p; - let module_type = parse_module_type p in - let loc = mk_loc start_pos uident_end_pos in - let arg_name = Location.mkloc ident loc in - Some (attrs, arg_name, Some module_type, start_pos) - | Dot -> - Parser.next p; - let module_type = - let module_long_ident = - parse_module_long_ident_tail ~lowercase:false p start_pos (Longident.Lident ident) in - Ast_helper.Mty.ident ~loc:module_long_ident.loc module_long_ident - in - let arg_name = Location.mknoloc "_" in - Some (attrs, arg_name, Some module_type, start_pos) - | _ -> - let loc = mk_loc start_pos uident_end_pos in - let mod_ident = Location.mkloc (Longident.Lident ident) loc in - let module_type = Ast_helper.Mty.ident ~loc mod_ident in - let arg_name = Location.mknoloc "_" in - Some (attrs, arg_name, Some module_type, start_pos) - end - | Underscore -> - Parser.next p; - let arg_name = Location.mkloc "_" (mk_loc start_pos p.prev_end_pos) in - Parser.expect Colon p; - let module_type = parse_module_type p in - Some (attrs, arg_name, Some module_type, start_pos) - | _ -> - None - - and parse_functor_args p = - let start_pos = p.Parser.start_pos in - Parser.expect Lparen p; - let args = - parse_comma_delimited_region - ~grammar:Grammar.FunctorArgs - ~closing:Rparen - ~f:parse_functor_arg - p - in - Parser.expect Rparen p; - match args with - | [] -> - [[], Location.mkloc "*" (mk_loc start_pos p.prev_end_pos), None, start_pos] - | args -> args - - and parse_functor_module_expr p = - let start_pos = p.Parser.start_pos in - let args = parse_functor_args p in - let return_type = match p.Parser.token with - | Colon -> - Parser.next p; - Some (parse_module_type ~es6_arrow:false p) - | _ -> None - in - Parser.expect EqualGreater p; - let rhs_module_expr = - let mod_expr = parse_module_expr p in - match return_type with - | Some mod_type -> - Ast_helper.Mod.constraint_ - ~loc:(mk_loc mod_expr.pmod_loc.loc_start mod_type.Parsetree.pmty_loc.loc_end) - mod_expr mod_type - | None -> mod_expr - in - let end_pos = p.prev_end_pos in - let mod_expr = List.fold_right (fun (attrs, name, module_type, start_pos) acc -> - Ast_helper.Mod.functor_ - ~loc:(mk_loc start_pos end_pos) - ~attrs - name module_type acc - ) args rhs_module_expr - in - {mod_expr with pmod_loc = mk_loc start_pos end_pos} - - (* module-expr ::= - * | module-path - * ∣ { structure-items } - * ∣ functorArgs => module-expr - * ∣ module-expr(module-expr) - * ∣ ( module-expr ) - * ∣ ( module-expr : module-type ) - * | extension - * | attributes module-expr *) - and parse_module_expr p = - let attrs = parse_attributes p in - let mod_expr = if is_es6_arrow_functor p then - parse_functor_module_expr p - else - parse_primary_mod_expr p - in - {mod_expr with pmod_attributes = List.concat [mod_expr.pmod_attributes; attrs]} - - and parse_constrained_mod_expr p = - let mod_expr = parse_module_expr p in - match p.Parser.token with - | Colon -> - Parser.next p; - let mod_type = parse_module_type p in - let loc = mk_loc mod_expr.pmod_loc.loc_start mod_type.pmty_loc.loc_end in - Ast_helper.Mod.constraint_ ~loc mod_expr mod_type - | _ -> mod_expr - - and parse_constrained_mod_expr_region p = - if Grammar.is_mod_expr_start p.Parser.token then - Some (parse_constrained_mod_expr p) - else - None - - and parse_module_application p mod_expr = - let start_pos = p.Parser.start_pos in - Parser.expect Lparen p; - let args = - parse_comma_delimited_region - ~grammar:Grammar.ModExprList - ~closing:Rparen - ~f:parse_constrained_mod_expr_region - p - in - Parser.expect Rparen p; - let args = match args with - | [] -> - let loc = mk_loc start_pos p.prev_end_pos in - [Ast_helper.Mod.structure ~loc []] - | args -> args - in - List.fold_left (fun mod_expr arg -> - Ast_helper.Mod.apply - ~loc:(mk_loc mod_expr.Parsetree.pmod_loc.loc_start arg.Parsetree.pmod_loc.loc_end) - mod_expr arg - ) mod_expr args - - and parse_module_or_module_type_impl_or_pack_expr ~attrs p = - let start_pos = p.Parser.start_pos in - Parser.expect Module p; - match p.Parser.token with - | Typ -> parse_module_type_impl ~attrs start_pos p - | Lparen -> - let expr = parse_first_class_module_expr ~start_pos p in - Ast_helper.Str.eval ~attrs expr - | _ -> parse_maybe_rec_module_binding ~attrs ~start_pos p - - and parse_module_type_impl ~attrs start_pos p = - Parser.expect Typ p; - let name_start = p.Parser.start_pos in - let name = match p.Parser.token with - | List -> - Parser.next p; - let loc = mk_loc name_start p.prev_end_pos in - Location.mkloc "list" loc - | Lident ident -> - Parser.next p; - let loc = mk_loc name_start p.prev_end_pos in - Location.mkloc ident loc - | Uident ident -> - Parser.next p; - let loc = mk_loc name_start p.prev_end_pos in - Location.mkloc ident loc - | t -> - Parser.err p (Diagnostics.uident t); - Location.mknoloc "_" - in - Parser.expect Equal p; - let module_type = parse_module_type p in - let module_type_declaration = - Ast_helper.Mtd.mk - ~attrs - ~loc:(mk_loc name_start p.prev_end_pos) - ~typ:module_type - name - in - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Str.modtype ~loc module_type_declaration - - (* definition ::= - ∣ module rec module-name : module-type = module-expr { and module-name - : module-type = module-expr } *) - and parse_maybe_rec_module_binding ~attrs ~start_pos p = - match p.Parser.token with - | Token.Rec -> - Parser.next p; - Ast_helper.Str.rec_module (parse_module_bindings ~start_pos ~attrs p) - | _ -> - Ast_helper.Str.module_ (parse_module_binding ~attrs ~start_pos:p.Parser.start_pos p) - - and parse_module_binding ~attrs ~start_pos p = - let name = match p.Parser.token with - | Uident ident -> - let start_pos = p.Parser.start_pos in - Parser.next p; - let loc = mk_loc start_pos p.prev_end_pos in - Location.mkloc ident loc - | t -> - Parser.err p (Diagnostics.uident t); - Location.mknoloc "_" - in - let body = parse_module_binding_body p in - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Mb.mk ~attrs ~loc name body - - and parse_module_binding_body p = - (* TODO: make required with good error message when rec module binding *) - let return_mod_type = match p.Parser.token with - | Colon -> - Parser.next p; - Some (parse_module_type p) - | _ -> None - in - Parser.expect Equal p; - let mod_expr = parse_module_expr p in - match return_mod_type with - | Some mod_type -> - Ast_helper.Mod.constraint_ - ~loc:(mk_loc mod_type.pmty_loc.loc_start mod_expr.pmod_loc.loc_end) - mod_expr mod_type - | None -> mod_expr - - - (* module-name : module-type = module-expr - * { and module-name : module-type = module-expr } *) - and parse_module_bindings ~attrs ~start_pos p = - let rec loop p acc = - let start_pos = p.Parser.start_pos in - let attrs = parse_attributes_and_binding p in - match p.Parser.token with - | And -> - Parser.next p; - ignore(Parser.optional p Module); (* over-parse for fault-tolerance *) - let mod_binding = parse_module_binding ~attrs ~start_pos p in - loop p (mod_binding::acc) - | _ -> List.rev acc - in - let first = parse_module_binding ~attrs ~start_pos p in - loop p [first] - - and parse_atomic_module_type p = - let start_pos = p.Parser.start_pos in - let module_type = match p.Parser.token with - | Uident _ | Lident _ | List -> - (* Ocaml allows module types to end with lowercase: module Foo : bar = { ... } - * lets go with uppercase terminal for now *) - let module_long_ident = parse_module_long_ident ~lowercase:true p in - Ast_helper.Mty.ident ~loc:module_long_ident.loc module_long_ident - | Lparen -> - Parser.next p; - let mty = parse_module_type p in - Parser.expect Rparen p; - {mty with pmty_loc = mk_loc start_pos p.prev_end_pos} - | Lbrace -> - Parser.next p; - let spec = - parse_delimited_region - ~grammar:Grammar.Signature - ~closing:Rbrace - ~f:parse_signature_item_region - p - in - Parser.expect Rbrace p; - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Mty.signature ~loc spec - | Module -> (* TODO: check if this is still atomic when implementing first class modules*) - parse_module_type_of p - | Percent -> - let extension = parse_extension p in - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Mty.extension ~loc extension - | token -> - Parser.err p (Diagnostics.unexpected token p.breadcrumbs); - Recover.default_module_type() - in - let module_type_loc = mk_loc start_pos p.prev_end_pos in - {module_type with pmty_loc = module_type_loc} - - and parse_functor_module_type p = - let start_pos = p.Parser.start_pos in - let args = parse_functor_args p in - Parser.expect EqualGreater p; - let rhs = parse_module_type p in - let end_pos = p.prev_end_pos in - let mod_type = List.fold_right (fun (attrs, name, module_type, start_pos) acc -> - Ast_helper.Mty.functor_ - ~loc:(mk_loc start_pos end_pos) - ~attrs - name module_type acc - ) args rhs - in - {mod_type with pmty_loc = mk_loc start_pos end_pos} - - (* Module types are the module-level equivalent of type expressions: they - * specify the general shape and type properties of modules. - * - * module-type ::= - * | modtype-path - * | { signature } - * | ( module-type ) --> parenthesized module-type - * | functor-args => module-type --> functor - * | module-type => module-type --> functor - * | module type of module-expr - * | attributes module-type - * | module-type with-mod-constraints - * | extension - *) - and parse_module_type ?(es6_arrow=true) ?(with_=true) p = - let attrs = parse_attributes p in - let modty = if es6_arrow && is_es6_arrow_functor p then - parse_functor_module_type p - else - let modty = parse_atomic_module_type p in - match p.Parser.token with - | EqualGreater when es6_arrow == true -> - Parser.next p; - let rhs = parse_module_type ~with_:false p in - let str = Location.mknoloc "_" in - let loc = mk_loc modty.pmty_loc.loc_start p.prev_end_pos in - Ast_helper.Mty.functor_ ~loc str (Some modty) rhs - | _ -> modty - in - let module_type = { modty with - pmty_attributes = List.concat [modty.pmty_attributes; attrs] - } in - if with_ then - parse_with_constraints module_type p - else module_type - - - and parse_with_constraints module_type p = - match p.Parser.token with - | With -> - Parser.next p; - let first = parse_with_constraint p in - let rec loop p acc = - match p.Parser.token with - | And -> - Parser.next p; - loop p ((parse_with_constraint p)::acc) - | _ -> - List.rev acc - in - let constraints = loop p [first] in - let loc = mk_loc module_type.pmty_loc.loc_start p.prev_end_pos in - Ast_helper.Mty.with_ ~loc module_type constraints - | _ -> - module_type - - (* mod-constraint ::= - * | type typeconstr type-equation type-constraints? - * ∣ type typeconstr-name := typexpr - * ∣ module module-path = extended-module-path - * ∣ module module-path := extended-module-path - * - * TODO: split this up into multiple functions, better errors *) - and parse_with_constraint p = - match p.Parser.token with - | Module -> - Parser.next p; - let module_path = parse_module_long_ident ~lowercase:false p in - begin match p.Parser.token with - | ColonEqual -> - Parser.next p; - let lident = parse_module_long_ident ~lowercase:false p in - Parsetree.Pwith_modsubst (module_path, lident) - | Equal -> - Parser.next p; - let lident = parse_module_long_ident ~lowercase:false p in - Parsetree.Pwith_module (module_path, lident) - | token -> - (* TODO: revisit *) - Parser.err p (Diagnostics.unexpected token p.breadcrumbs); - let lident = parse_module_long_ident ~lowercase:false p in - Parsetree.Pwith_modsubst (module_path, lident) - end - | Typ -> - Parser.next p; - let type_constr = parse_value_path p in - let params = parse_type_params ~parent:type_constr p in - begin match p.Parser.token with - | ColonEqual -> - Parser.next p; - let typ_expr = parse_typ_expr p in - Parsetree.Pwith_typesubst ( - type_constr, - Ast_helper.Type.mk - ~loc:type_constr.loc - ~params - ~manifest:typ_expr - (Location.mkloc (Longident.last type_constr.txt) type_constr.loc) - ) - | Equal -> - Parser.next p; - let typ_expr = parse_typ_expr p in - let type_constraints = parse_type_constraints p in - Parsetree.Pwith_type ( - type_constr, - Ast_helper.Type.mk - ~loc:type_constr.loc - ~params - ~manifest:typ_expr - ~cstrs:type_constraints - (Location.mkloc (Longident.last type_constr.txt) type_constr.loc) - ) - | token -> - (* TODO: revisit *) - Parser.err p (Diagnostics.unexpected token p.breadcrumbs); - let typ_expr = parse_typ_expr p in - let type_constraints = parse_type_constraints p in - Parsetree.Pwith_type ( - type_constr, - Ast_helper.Type.mk - ~loc:type_constr.loc - ~params - ~manifest:typ_expr - ~cstrs:type_constraints - (Location.mkloc (Longident.last type_constr.txt) type_constr.loc) - ) - end - | token -> - Parser.err p (Diagnostics.unexpected token p.breadcrumbs); - exit (-1) (* TODO: handle this case *) - - and parse_module_type_of p = - let start_pos = p.Parser.start_pos in - Parser.expect Module p; - Parser.expect Typ p; - Parser.expect Of p; - let module_expr = parse_module_expr p in - Ast_helper.Mty.typeof_ ~loc:(mk_loc start_pos p.prev_end_pos) module_expr - - (* module signature on the file level *) - and parse_specification p = - parse_region ~grammar:Grammar.Specification ~f:parse_signature_item_region p - [@@progress (Parser.next, Parser.expect, Parser.check_progress)] - - and parse_signature_item_region p = - let start_pos = p.Parser.start_pos in - let attrs = parse_attributes p in - match p.Parser.token with - | Let -> - Parser.begin_region p; - let value_desc = parse_sign_let_desc ~attrs p in - Parser.optional p Semicolon |> ignore; - let loc = mk_loc start_pos p.prev_end_pos in - Parser.end_region p; - Some (Ast_helper.Sig.value ~loc value_desc) - | Typ -> - Parser.begin_region p; - begin match parse_type_definition_or_extension ~attrs p with - | TypeDef {rec_flag; types} -> - Parser.optional p Semicolon |> ignore; - let loc = mk_loc start_pos p.prev_end_pos in - Parser.end_region p; - Some (Ast_helper.Sig.type_ ~loc rec_flag types) - | TypeExt(ext) -> - Parser.optional p Semicolon |> ignore; - let loc = mk_loc start_pos p.prev_end_pos in - Parser.end_region p; - Some (Ast_helper.Sig.type_extension ~loc ext) - end - | External -> - let external_def = parse_external_def ~attrs p in - Parser.optional p Semicolon |> ignore; - let loc = mk_loc start_pos p.prev_end_pos in - Some (Ast_helper.Sig.value ~loc external_def) - | Exception -> - let exception_def = parse_exception_def ~attrs p in - Parser.optional p Semicolon |> ignore; - let loc = mk_loc start_pos p.prev_end_pos in - Some (Ast_helper.Sig.exception_ ~loc exception_def) - | Open -> - let open_description = parse_open_description ~attrs p in - Parser.optional p Semicolon |> ignore; - let loc = mk_loc start_pos p.prev_end_pos in - Some (Ast_helper.Sig.open_ ~loc open_description) - | Include -> - Parser.next p; - let module_type = parse_module_type p in - let include_description = Ast_helper.Incl.mk - ~loc:(mk_loc start_pos p.prev_end_pos) - ~attrs - module_type - in - Parser.optional p Semicolon |> ignore; - let loc = mk_loc start_pos p.prev_end_pos in - Some (Ast_helper.Sig.include_ ~loc include_description) - | Module -> - Parser.next p; - begin match p.Parser.token with - | Uident _ -> - let mod_decl = parse_module_declaration_or_alias ~attrs p in - Parser.optional p Semicolon |> ignore; - let loc = mk_loc start_pos p.prev_end_pos in - Some (Ast_helper.Sig.module_ ~loc mod_decl) - | Rec -> - let rec_module = parse_rec_module_spec ~attrs ~start_pos p in - Parser.optional p Semicolon |> ignore; - let loc = mk_loc start_pos p.prev_end_pos in - Some (Ast_helper.Sig.rec_module ~loc rec_module) - | Typ -> - Some (parse_module_type_declaration ~attrs ~start_pos p) - | _t -> - let mod_decl = parse_module_declaration_or_alias ~attrs p in - Parser.optional p Semicolon |> ignore; - let loc = mk_loc start_pos p.prev_end_pos in - Some (Ast_helper.Sig.module_ ~loc mod_decl) - end - | AtAt -> - let attr = parse_standalone_attribute p in - Parser.optional p Semicolon |> ignore; - let loc = mk_loc start_pos p.prev_end_pos in - Some (Ast_helper.Sig.attribute ~loc attr) - | PercentPercent -> - let extension = parse_extension ~module_language:true p in - Parser.optional p Semicolon |> ignore; - let loc = mk_loc start_pos p.prev_end_pos in - Some (Ast_helper.Sig.extension ~attrs ~loc extension) - | Import -> - Parser.next p; - parse_signature_item_region p - | _ -> - None - - (* module rec module-name : module-type { and module-name: module-type } *) - and parse_rec_module_spec ~attrs ~start_pos p = - Parser.expect Rec p; - let rec loop p spec = - let start_pos = p.Parser.start_pos in - let attrs = parse_attributes_and_binding p in - match p.Parser.token with - | And -> - (* TODO: give a good error message when with constraint, no parens - * and ASet: (Set.S with type elt = A.t) - * and BTree: (Btree.S with type elt = A.t) - * Without parens, the `and` signals the start of another - * `with-constraint` - *) - Parser.expect And p; - let decl = parse_rec_module_declaration ~attrs ~start_pos p in - loop p (decl::spec) - | _ -> - List.rev spec - in - let first = parse_rec_module_declaration ~attrs ~start_pos p in - loop p [first] - - (* module-name : module-type *) - and parse_rec_module_declaration ~attrs ~start_pos p = - let name = match p.Parser.token with - | Uident mod_name -> - let loc = mk_loc p.start_pos p.end_pos in - Parser.next p; - Location.mkloc mod_name loc - | t -> - Parser.err p (Diagnostics.uident t); - Location.mknoloc "_" - in - Parser.expect Colon p; - let mod_type = parse_module_type p in - Ast_helper.Md.mk ~loc:(mk_loc start_pos p.prev_end_pos) ~attrs name mod_type - - and parse_module_declaration_or_alias ~attrs p = - let start_pos = p.Parser.start_pos in - let module_name = match p.Parser.token with - | Uident ident -> - let loc = mk_loc p.Parser.start_pos p.end_pos in - Parser.next p; - Location.mkloc ident loc - | t -> - Parser.err p (Diagnostics.uident t); - Location.mknoloc "_" - in - let body = match p.Parser.token with - | Colon -> - Parser.next p; - parse_module_type p - | Equal -> - Parser.next p; - let lident = parse_module_long_ident ~lowercase:false p in - Ast_helper.Mty.alias lident - | token -> - Parser.err p (Diagnostics.unexpected token p.breadcrumbs); - Recover.default_module_type() - in - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Md.mk ~loc ~attrs module_name body - - and parse_module_type_declaration ~attrs ~start_pos p = - Parser.expect Typ p; - let module_name = match p.Parser.token with - | Uident ident -> - let loc = mk_loc p.start_pos p.end_pos in - Parser.next p; - Location.mkloc ident loc - | Lident ident -> - let loc = mk_loc p.start_pos p.end_pos in - Parser.next p; - Location.mkloc ident loc - | t -> - Parser.err p (Diagnostics.uident t); - Location.mknoloc "_" - in - let typ = match p.Parser.token with - | Equal -> - Parser.next p; - Some (parse_module_type p) - | _ -> None - in - let module_decl = Ast_helper.Mtd.mk ~attrs ?typ module_name in - Ast_helper.Sig.modtype ~loc:(mk_loc start_pos p.prev_end_pos) module_decl - - and parse_sign_let_desc ~attrs p = - let start_pos = p.Parser.start_pos in - Parser.expect Let p; - let (name, loc) = parse_lident p in - let name = Location.mkloc name loc in - Parser.expect Colon p; - let typ_expr = parse_poly_type_expr p in - let loc = mk_loc start_pos p.prev_end_pos in - Ast_helper.Val.mk ~loc ~attrs name typ_expr - -(* attr-id ::= lowercase-ident - ∣ capitalized-ident - ∣ attr-id . attr-id *) - and parse_attribute_id p = - let start_pos = p.Parser.start_pos in - let rec loop p acc = - match p.Parser.token with - | Lident ident | Uident ident -> - Parser.next p; - let id = acc ^ ident in - begin match p.Parser.token with - | Dot -> Parser.next p; loop p (id ^ ".") - | _ -> id - end - | token when Token.is_keyword token -> - Parser.next p; - let id = acc ^ (Token.to_string token) in - begin match p.Parser.token with - | Dot -> Parser.next p; loop p (id ^ ".") - | _ -> id - end - | token -> - Parser.err p (Diagnostics.unexpected token p.breadcrumbs); - acc - in - let id = loop p "" in - let end_pos = p.prev_end_pos in - Location.mkloc id (mk_loc start_pos end_pos) - - (* - * payload ::= empty - * | ( structure-item ) - * - * TODO: what about multiple structure items? - * @attr({let x = 1; let x = 2}) - * - * Also what about type-expressions and specifications? - * @attr(:myType) ??? - *) - and parse_payload p = - match p.Parser.token with - | Lparen when p.start_pos.pos_cnum = p.prev_end_pos.pos_cnum -> - Parser.next p; - begin match p.token with - | Colon -> - Parser.next p; - let typ = parse_typ_expr p in - Parser.expect Rparen p; - Parsetree.PTyp typ - | _ -> - let items = parse_delimited_region - ~grammar:Grammar.Structure - ~closing:Rparen - ~f:parse_structure_item_region - p - in - Parser.expect Rparen p; - Parsetree.PStr items - end - | _ -> Parsetree.PStr [] - - (* type attribute = string loc * payload *) - and parse_attribute p = - match p.Parser.token with - | At -> - Parser.next p; - let attr_id = parse_attribute_id p in - let payload = parse_payload p in - Some(attr_id, payload) - | _ -> None - - and parse_attributes p = - parse_region p - ~grammar:Grammar.Attribute - ~f:parse_attribute - - (* - * standalone-attribute ::= - * | @@ atribute-id - * | @@ attribute-id ( structure-item ) - *) - and parse_standalone_attribute p = - Parser.expect AtAt p; - let attr_id = parse_attribute_id p in - let payload = parse_payload p in - (attr_id, payload) - - (* extension ::= % attr-id attr-payload - * | %% attr-id( - * expr ::= ... - * ∣ extension - * - * typexpr ::= ... - * ∣ extension - * - * pattern ::= ... - * ∣ extension - * - * module-expr ::= ... - * ∣ extension - * - * module-type ::= ... - * ∣ extension - * - * class-expr ::= ... - * ∣ extension - * - * class-type ::= ... - * ∣ extension - * - * - * item extension nodes usable in structures and signature - * - * item-extension ::= %% attr-id - * | %% attr-id(structure-item) - * - * attr-payload ::= structure-item - * - * ~moduleLanguage represents whether we're on the module level or not - *) - and parse_extension ?(module_language=false) p = - if module_language then - Parser.expect PercentPercent p - else - Parser.expect Percent p; - let attr_id = parse_attribute_id p in - let payload = parse_payload p in - (attr_id, payload) -end - -module OutcomePrinter: sig - open Format - open Outcometree - - val out_value : (formatter -> out_value -> unit) ref [@@live] - val out_type : (formatter -> out_type -> unit) ref [@@live] - val out_class_type : (formatter -> out_class_type -> unit) ref [@@live] - val out_module_type : (formatter -> out_module_type -> unit) ref [@@live] - val out_sig_item : (formatter -> out_sig_item -> unit) ref [@@live] - val out_signature : (formatter -> out_sig_item list -> unit) ref [@@live] - val out_type_extension : (formatter -> out_type_extension -> unit) ref [@@live] - val out_phrase : (formatter -> out_phrase -> unit) ref [@@live] - - val parenthesized_ident : string -> bool [@@live] -end = struct - (* Napkin doesn't have parenthesized identifiers. - * We don't support custom operators. *) - let parenthesized_ident _name = true - - (* TODO: better allocation strategy for the buffer *) - let escape_string_contents s = - let len = String.length s in - let b = Buffer.create len in - for i = 0 to len - 1 do - let c = (String.get [@doesNotRaise]) s i in - if c = '\008' then ( - Buffer.add_char b '\\'; - Buffer.add_char b 'b'; - ) else if c = '\009' then ( - Buffer.add_char b '\\'; - Buffer.add_char b 't'; - ) else if c = '\010' then ( - Buffer.add_char b '\\'; - Buffer.add_char b 'n'; - ) else if c = '\013' then ( - Buffer.add_char b '\\'; - Buffer.add_char b 'r'; - ) else if c = '\034' then ( - Buffer.add_char b '\\'; - Buffer.add_char b '"'; - ) else if c = '\092' then ( - Buffer.add_char b '\\'; - Buffer.add_char b '\\'; - ) else ( - Buffer.add_char b c; - ); - done; - Buffer.contents b - - (* let rec print_ident fmt ident = match ident with - | Outcometree.Oide_ident s -> Format.pp_print_string fmt s - | Oide_dot (id, s) -> - print_ident fmt id; - Format.pp_print_char fmt '.'; - Format.pp_print_string fmt s - | Oide_apply (id1, id2) -> - print_ident fmt id1; - Format.pp_print_char fmt '('; - print_ident fmt id2; - Format.pp_print_char fmt ')' *) - - let rec print_out_ident_doc (ident : Outcometree.out_ident) = - match ident with - | Oide_ident s -> Doc.text s - | Oide_dot (ident, s) -> Doc.concat [ - print_out_ident_doc ident; - Doc.dot; - Doc.text s; - ] - | Oide_apply (call, arg) ->Doc.concat [ - print_out_ident_doc call; - Doc.lparen; - print_out_ident_doc arg; - Doc.rparen; - ] - - let print_out_attribute_doc (out_attribute: Outcometree.out_attribute) = - Doc.concat [ - Doc.text "@"; - Doc.text out_attribute.oattr_name; - ] - - let print_out_attributes_doc (attrs: Outcometree.out_attribute list) = - match attrs with - | [] -> Doc.nil - | attrs -> - Doc.concat [ - Doc.group ( - Doc.join ~sep:Doc.line (List.map print_out_attribute_doc attrs) - ); - Doc.line; - ] - - let rec collect_arrow_args (out_type: Outcometree.out_type) args = - match out_type with - | Otyp_arrow (label, arg_type, return_type) -> - let arg = (label, arg_type) in - collect_arrow_args return_type (arg::args) - | _ as return_type -> - (List.rev args, return_type) - - let rec collect_functor_args (out_module_type: Outcometree.out_module_type) args = - match out_module_type with - | Omty_functor (lbl, opt_mod_type, return_mod_type) -> - let arg = (lbl, opt_mod_type) in - collect_functor_args return_mod_type (arg::args) - | _ -> - (List.rev args, out_module_type) - - let rec print_out_type_doc (out_type: Outcometree.out_type) = - match out_type with - | Otyp_abstract | Otyp_variant _ (* don't support poly-variants atm *) | Otyp_open -> Doc.nil - | Otyp_alias (typ, alias_txt) -> - Doc.concat [ - print_out_type_doc typ; - Doc.text " as '"; - Doc.text alias_txt - ] - | Otyp_constr (out_ident, []) -> - print_out_ident_doc out_ident - | Otyp_manifest (typ1, typ2) -> - Doc.concat [ - print_out_type_doc typ1; - Doc.text " = "; - print_out_type_doc typ2; - ] - | Otyp_record record -> - print_record_declaration_doc ~inline:true record - | Otyp_stuff txt -> Doc.text txt - | Otyp_var (ng, s) -> Doc.concat [ - Doc.text ("'" ^ (if ng then "_" else "")); - Doc.text s - ] - | Otyp_object (fields, rest) -> print_object_fields fields rest - | Otyp_class _ -> Doc.nil - | Otyp_attribute (typ, attribute) -> - Doc.group ( - Doc.concat [ - print_out_attribute_doc attribute; - Doc.line; - print_out_type_doc typ; - ] - ) - (* example: Red | Blue | Green | CustomColour(float, float, float) *) - | Otyp_sum constructors -> - print_out_constructors_doc constructors - - (* example: {"name": string, "age": int} *) - | Otyp_constr ( - (Oide_dot ((Oide_ident "Js"), "t")), - [Otyp_object (fields, rest)] - ) -> print_object_fields fields rest - - (* example: node *) - | Otyp_constr (out_ident, args) -> - let args_doc = match args with - | [] -> Doc.nil - | args -> - Doc.concat [ - Doc.less_than; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) ( - List.map print_out_type_doc args - ) - ] - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.greater_than; - ] - in - Doc.group ( - Doc.concat [ - print_out_ident_doc out_ident; - args_doc; - ] - ) - | Otyp_tuple tuple_args -> - Doc.group ( - Doc.concat [ - Doc.lparen; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) ( - List.map print_out_type_doc tuple_args - ) - ] - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.rparen; - ] - ) - | Otyp_poly (vars, out_type) -> - Doc.group ( - Doc.concat [ - Doc.join ~sep:Doc.space ( - List.map (fun var -> Doc.text ("'" ^ var)) vars - ); - print_out_type_doc out_type; - ] - ) - | Otyp_arrow _ as typ -> - let (typ_args, typ) = collect_arrow_args typ [] in - let args = Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) ( - List.map (fun (lbl, typ) -> - if lbl = "" then - print_out_type_doc typ - else - Doc.group ( - Doc.concat [ - Doc.text ("~" ^ lbl ^ ": "); - print_out_type_doc typ - ] - ) - ) typ_args - ) in - let args_doc = - let needs_parens = match typ_args with - | [_, (Otyp_tuple _ | Otyp_arrow _)] -> true - (* single argument should not be wrapped *) - | ["", _] -> false - | _ -> true - in - if needs_parens then - Doc.group ( - Doc.concat [ - Doc.lparen; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - args; - ] - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.rparen; - ] - ) - else args - in - Doc.concat [ - args_doc; - Doc.text " => "; - print_out_type_doc typ; - ] - | Otyp_module (_modName, _stringList, _outTypes) -> - Doc.nil - - and print_object_fields fields rest = - let dots = match rest with - | Some non_gen -> Doc.text ((if non_gen then "_" else "") ^ "..") - | None -> Doc.nil - in - Doc.group ( - Doc.concat [ - Doc.lbrace; - dots; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) ( - List.map (fun (lbl, out_type) -> Doc.group ( - Doc.concat [ - Doc.text ("\"" ^ lbl ^ "\": "); - print_out_type_doc out_type; - ] - )) fields - ) - ] - ); - Doc.soft_line; - Doc.trailing_comma; - Doc.rbrace; - ] - ) - - - and print_out_constructors_doc constructors = - Doc.group ( - Doc.indent ( - Doc.concat [ - Doc.line; - Doc.join ~sep:Doc.line ( - List.mapi (fun i constructor -> - Doc.concat [ - if i > 0 then Doc.text "| " else Doc.if_breaks (Doc.text "| ") Doc.nil; - print_out_constructor_doc constructor; - ] - ) constructors - ) - ] - ) - ) - - and print_out_constructor_doc (name, args, gadt) = - let gadt_doc = match gadt with - | Some out_type -> - Doc.concat [ - Doc.text ": "; - print_out_type_doc out_type - ] - | None -> Doc.nil - in - let args_doc = match args with - | [] -> Doc.nil - | [Otyp_record record] -> - (* inline records - * | Root({ - * mutable value: 'value, - * mutable updatedTime: float, - * }) - *) - Doc.concat [ - Doc.lparen; - Doc.indent ( - print_record_declaration_doc ~inline:true record; - ); - Doc.rparen; - ] - | _types -> - Doc.indent ( - Doc.concat [ - Doc.lparen; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) ( - List.map print_out_type_doc args - ) - ] - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.rparen; - ] - ) - in - Doc.group ( - Doc.concat [ - Doc.text name; - args_doc; - gadt_doc - ] - ) - - and print_record_decl_row_doc (name, mut, arg) = - Doc.group ( - Doc.concat [ - if mut then Doc.text "mutable " else Doc.nil; - Doc.text name; - Doc.text ": "; - print_out_type_doc arg; - ] - ) - - and print_record_declaration_doc ~inline rows = - let content = Doc.concat [ - Doc.lbrace; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) ( - List.map print_record_decl_row_doc rows - ) - ] - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.rbrace; - ] in - if not inline then - Doc.group content - else content - - let print_out_type fmt out_type = - Format.pp_print_string fmt - (Doc.to_string ~width:80 (print_out_type_doc out_type)) - - let print_type_parameter_doc (typ, (co, cn)) = - Doc.concat [ - if not cn then Doc.text "+" else if not co then Doc.text "-" else Doc.nil; - if typ = "_" then Doc.text "_" else Doc.text ("'" ^ typ) - ] - - - let rec print_out_sig_item_doc (out_sig_item : Outcometree.out_sig_item) = - match out_sig_item with - | Osig_class _ | Osig_class_type _ -> Doc.nil - | Osig_ellipsis -> Doc.dotdotdot - | Osig_value value_decl -> - Doc.group ( - Doc.concat [ - print_out_attributes_doc value_decl.oval_attributes; - Doc.text ( - match value_decl.oval_prims with | [] -> "let " | _ -> "external " - ); - Doc.text value_decl.oval_name; - Doc.text ":"; - Doc.space; - print_out_type_doc value_decl.oval_type; - match value_decl.oval_prims with - | [] -> Doc.nil - | primitives -> Doc.indent ( - Doc.concat [ - Doc.text " ="; - Doc.line; - Doc.group ( - Doc.join ~sep:Doc.line (List.map (fun prim -> Doc.text ("\"" ^ prim ^ "\"")) primitives) - ) - ] - ) - ] - ) - | Osig_typext (out_extension_constructor, _outExtStatus) -> - print_out_extension_constructor_doc out_extension_constructor - | Osig_modtype (mod_name, Omty_signature []) -> - Doc.concat [ - Doc.text "module type "; - Doc.text mod_name; - ] - | Osig_modtype (mod_name, out_module_type) -> - Doc.group ( - Doc.concat [ - Doc.text "module type "; - Doc.text mod_name; - Doc.text " = "; - print_out_module_type_doc out_module_type; - ] - ) - | Osig_module (mod_name, Omty_alias ident, _) -> - Doc.group ( - Doc.concat [ - Doc.text "module "; - Doc.text mod_name; - Doc.text " ="; - Doc.line; - print_out_ident_doc ident; - ] - ) - | Osig_module (mod_name, out_mod_type, out_rec_status) -> - Doc.group ( - Doc.concat [ - Doc.text ( - match out_rec_status with - | Orec_not -> "module " - | Orec_first -> "module rec " - | Orec_next -> "and" - ); - Doc.text mod_name; - Doc.text " = "; - print_out_module_type_doc out_mod_type; - ] - ) - | Osig_type (out_type_decl, out_rec_status) -> - (* TODO: manifest ? *) - let attrs = match out_type_decl.otype_immediate, out_type_decl.otype_unboxed with - | false, false -> Doc.nil - | true, false -> - Doc.concat [Doc.text "@immediate"; Doc.line] - | false, true -> - Doc.concat [Doc.text "@unboxed"; Doc.line] - | true, true -> - Doc.concat [Doc.text "@immediate @unboxed"; Doc.line] - in - let kw = Doc.text ( - match out_rec_status with - | Orec_not -> "type " - | Orec_first -> "type rec " - | Orec_next -> "and " - ) in - let type_params = match out_type_decl.otype_params with - | [] -> Doc.nil - | _params -> Doc.group ( - Doc.concat [ - Doc.less_than; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) ( - List.map print_type_parameter_doc out_type_decl.otype_params - ) - ] - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.greater_than; - ] - ) - in - let private_doc = match out_type_decl.otype_private with - | Asttypes.Private -> Doc.text "private " - | Public -> Doc.nil - in - let kind = match out_type_decl.otype_type with - | Otyp_open -> Doc.concat [ - Doc.text " = "; - private_doc; - Doc.text ".."; - ] - | Otyp_abstract -> Doc.nil - | Otyp_record record -> Doc.concat [ - Doc.text " = "; - private_doc; - print_record_declaration_doc ~inline:false record; - ] - | typ -> Doc.concat [ - Doc.text " = "; - print_out_type_doc typ - ] - in - let constraints = match out_type_decl.otype_cstrs with - | [] -> Doc.nil - | _ -> Doc.group ( - Doc.concat [ - Doc.line; - Doc.indent ( - Doc.concat [ - Doc.hard_line; - Doc.join ~sep:Doc.line (List.map (fun (typ1, typ2) -> - Doc.group ( - Doc.concat [ - Doc.text "constraint "; - print_out_type_doc typ1; - Doc.text " ="; - Doc.indent ( - Doc.concat [ - Doc.line; - print_out_type_doc typ2; - ] - ) - ] - ) - ) out_type_decl.otype_cstrs) - ] - ) - ] - ) in - Doc.group ( - Doc.concat [ - attrs; - Doc.group ( - Doc.concat [ - attrs; - kw; - Doc.text out_type_decl.otype_name; - type_params; - kind - ] - ); - constraints - ] - ) - - and print_out_module_type_doc (out_mod_type : Outcometree.out_module_type) = - match out_mod_type with - | Omty_abstract -> Doc.nil - | Omty_ident ident -> print_out_ident_doc ident - (* example: module Increment = (M: X_int) => X_int *) - | Omty_functor _ -> - let (args, return_mod_type) = collect_functor_args out_mod_type [] in - let args_doc = match args with - | [_, None] -> Doc.text "()" - | args -> - Doc.group ( - Doc.concat [ - Doc.lparen; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) ( - List.map (fun (lbl, opt_mod_type) -> Doc.group ( - Doc.concat [ - Doc.text lbl; - match opt_mod_type with - | None -> Doc.nil - | Some mod_type -> Doc.concat [ - Doc.text ": "; - print_out_module_type_doc mod_type; - ] - ] - )) args - ) - ] - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.rparen; - ] - ) - in - Doc.group ( - Doc.concat [ - args_doc; - Doc.text " => "; - print_out_module_type_doc return_mod_type - ] - ) - | Omty_signature [] -> Doc.nil - | Omty_signature signature -> - Doc.breakable_group ~force_break:true ( - Doc.concat [ - Doc.lbrace; - Doc.indent ( - Doc.concat [ - Doc.line; - print_out_signature_doc signature; - ] - ); - Doc.soft_line; - Doc.rbrace; - ] - ) - | Omty_alias _ident -> Doc.nil - - and print_out_signature_doc (signature : Outcometree.out_sig_item list) = - let rec loop signature acc = - match signature with - | [] -> List.rev acc - | Outcometree.Osig_typext(ext, Oext_first) :: items -> - (* Gather together the extension constructors *) - let rec gather_extensions acc items = - match items with - Outcometree.Osig_typext(ext, Oext_next) :: items -> - gather_extensions - ((ext.oext_name, ext.oext_args, ext.oext_ret_type) :: acc) - items - | _ -> (List.rev acc, items) - in - let exts, items = - gather_extensions - [(ext.oext_name, ext.oext_args, ext.oext_ret_type)] - items - in - let te = - { Outcometree.otyext_name = ext.oext_type_name; - otyext_params = ext.oext_type_params; - otyext_constructors = exts; - otyext_private = ext.oext_private } - in - let doc = print_out_type_extension_doc te in - loop items (doc::acc) - | item::items -> - let doc = print_out_sig_item_doc item in - loop items (doc::acc) - in - match loop signature [] with - | [doc] -> doc - | docs -> - Doc.breakable_group ~force_break:true ( - Doc.join ~sep:Doc.line docs - ) - - and print_out_extension_constructor_doc (out_ext : Outcometree.out_extension_constructor) = - let type_params = match out_ext.oext_type_params with - | [] -> Doc.nil - | params -> - Doc.group( - Doc.concat [ - Doc.less_than; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) (List.map - (fun ty -> Doc.text (if ty = "_" then ty else "'" ^ ty)) - params - - ) - ] - ); - Doc.soft_line; - Doc.greater_than; - ] - ) - - in - Doc.group ( - Doc.concat [ - Doc.text "type "; - Doc.text out_ext.oext_type_name; - type_params; - Doc.text " +="; - Doc.line; - if out_ext.oext_private = Asttypes.Private then - Doc.text "private " - else - Doc.nil; - print_out_constructor_doc - (out_ext.oext_name, out_ext.oext_args, out_ext.oext_ret_type) - ] - ) - - and print_out_type_extension_doc (type_extension : Outcometree.out_type_extension) = - let type_params = match type_extension.otyext_params with - | [] -> Doc.nil - | params -> - Doc.group( - Doc.concat [ - Doc.less_than; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) (List.map - (fun ty -> Doc.text (if ty = "_" then ty else "'" ^ ty)) - params - - ) - ] - ); - Doc.soft_line; - Doc.greater_than; - ] - ) - - in - Doc.group ( - Doc.concat [ - Doc.text "type "; - Doc.text type_extension.otyext_name; - type_params; - Doc.text " +="; - if type_extension.otyext_private = Asttypes.Private then - Doc.text "private " - else - Doc.nil; - print_out_constructors_doc type_extension.otyext_constructors; - ] - ) - - let print_out_sig_item fmt out_sig_item = - Format.pp_print_string fmt - (Doc.to_string ~width:80 (print_out_sig_item_doc out_sig_item)) - - let print_out_signature fmt signature = - Format.pp_print_string fmt - (Doc.to_string ~width:80 (print_out_signature_doc signature)) - - let valid_float_lexeme s = - let l = String.length s in - let rec loop i = - if i >= l then s ^ "." else - match (s.[i] [@doesNotRaise]) with - | '0' .. '9' | '-' -> loop (i+1) - | _ -> s - in loop 0 - - let float_repres f = - match classify_float f with - | FP_nan -> "nan" - | FP_infinite -> - if f < 0.0 then "neg_infinity" else "infinity" - | _ -> - let float_val = - let s1 = Printf.sprintf "%.12g" f in - if f = (float_of_string [@doesNotRaise]) s1 then s1 else - let s2 = Printf.sprintf "%.15g" f in - if f = (float_of_string [@doesNotRaise]) s2 then s2 else - Printf.sprintf "%.18g" f - in valid_float_lexeme float_val - - let rec print_out_value_doc (out_value : Outcometree.out_value) = - match out_value with - | Oval_array out_values -> - Doc.group ( - Doc.concat [ - Doc.lbracket; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) ( - List.map print_out_value_doc out_values - ) - ] - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.rbracket; - ] - ) - | Oval_char c -> Doc.text ("'" ^ (Char.escaped c) ^ "'") - | Oval_constr (out_ident, out_values) -> - Doc.group ( - Doc.concat [ - print_out_ident_doc out_ident; - Doc.lparen; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) ( - List.map print_out_value_doc out_values - ) - ] - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.rparen; - ] - ) - | Oval_ellipsis -> Doc.text "..." - | Oval_int i -> Doc.text (Format.sprintf "%i" i) - | Oval_int32 i -> Doc.text (Format.sprintf "%lil" i) - | Oval_int64 i -> Doc.text (Format.sprintf "%LiL" i) - | Oval_nativeint i -> Doc.text (Format.sprintf "%nin" i) - | Oval_float f -> Doc.text (float_repres f) - | Oval_list out_values -> - Doc.group ( - Doc.concat [ - Doc.text "list["; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) ( - List.map print_out_value_doc out_values - ) - ] - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.rbracket; - ] - ) - | Oval_printer fn -> - let fmt = Format.str_formatter in - fn fmt; - let str = Format.flush_str_formatter () in - Doc.text str - | Oval_record rows -> - Doc.group ( - Doc.concat [ - Doc.lparen; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) ( - List.map (fun (out_ident, out_value) -> Doc.group ( - Doc.concat [ - print_out_ident_doc out_ident; - Doc.text ": "; - print_out_value_doc out_value; - ] - ) - ) rows - ); - ] - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.rparen; - ] - ) - | Oval_string (txt, _sizeToPrint, _kind) -> - Doc.text (escape_string_contents txt) - | Oval_stuff txt -> Doc.text txt - | Oval_tuple out_values -> - Doc.group ( - Doc.concat [ - Doc.lparen; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) ( - List.map print_out_value_doc out_values - ) - ] - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.rparen; - ] - ) - (* Not supported by NapkinScript *) - | Oval_variant _ -> Doc.nil - - let print_out_exception_doc exc out_value = - match exc with - | Sys.Break -> Doc.text "Interrupted." - | Out_of_memory -> Doc.text "Out of memory during evaluation." - | Stack_overflow -> - Doc.text "Stack overflow during evaluation (looping recursion?)." - | _ -> - Doc.group ( - Doc.indent( - Doc.concat [ - Doc.text "Exception:"; - Doc.line; - print_out_value_doc out_value; - ] - ) - ) - - let print_out_phrase_signature signature = - let rec loop signature acc = - match signature with - | [] -> List.rev acc - | (Outcometree.Osig_typext(ext, Oext_first), None)::signature -> - (* Gather together extension constructors *) - let rec gather_extensions acc items = - match items with - | (Outcometree.Osig_typext(ext, Oext_next), None)::items -> - gather_extensions - ((ext.oext_name, ext.oext_args, ext.oext_ret_type)::acc) - items - | _ -> (List.rev acc, items) - in - let exts, signature = - gather_extensions - [(ext.oext_name, ext.oext_args, ext.oext_ret_type)] - signature - in - let te = - { Outcometree.otyext_name = ext.oext_type_name; - otyext_params = ext.oext_type_params; - otyext_constructors = exts; - otyext_private = ext.oext_private } - in - let doc = print_out_type_extension_doc te in - loop signature (doc::acc) - | (sig_item, opt_out_value)::signature -> - let doc = match opt_out_value with - | None -> - print_out_sig_item_doc sig_item - | Some out_value -> - Doc.group ( - Doc.concat [ - print_out_sig_item_doc sig_item; - Doc.text " = "; - print_out_value_doc out_value; - ] - ) - in - loop signature (doc::acc) - in - Doc.breakable_group ~force_break:true ( - Doc.join ~sep:Doc.line (loop signature []) - ) - - let print_out_phrase_doc (out_phrase : Outcometree.out_phrase) = - match out_phrase with - | Ophr_eval (out_value, out_type) -> - Doc.group ( - Doc.concat [ - Doc.text "- : "; - print_out_type_doc out_type; - Doc.text " ="; - Doc.indent ( - Doc.concat [ - Doc.line; - print_out_value_doc out_value; - ] - ) - ] - ) - | Ophr_signature [] -> Doc.nil - | Ophr_signature signature -> print_out_phrase_signature signature - | Ophr_exception (exc, out_value) -> - print_out_exception_doc exc out_value - - let print_out_phase fmt out_phrase = - Format.pp_print_string fmt - (Doc.to_string ~width:80 (print_out_phrase_doc out_phrase)) - - let print_out_module_type fmt out_module_type = - Format.pp_print_string fmt - (Doc.to_string ~width:80 (print_out_module_type_doc out_module_type)) - - let print_out_type_extension fmt type_extension = - Format.pp_print_string fmt - (Doc.to_string ~width:80 (print_out_type_extension_doc type_extension)) - - let print_out_value fmt out_value = - Format.pp_print_string fmt - (Doc.to_string ~width:80 (print_out_value_doc out_value)) - - (* Not supported in Napkin *) - let print_out_class_type _fmt _ = () - - let out_value = ref print_out_value - let out_type = ref print_out_type - let out_module_type = ref print_out_module_type - let out_sig_item = ref print_out_sig_item - let out_signature = ref print_out_signature - let out_type_extension = ref print_out_type_extension - let out_phrase = ref print_out_phase [@live] - let out_class_type = ref print_out_class_type -end - -module Repl = struct - let parse_toplevel_phrase filename = - let src = IO.read_file filename in - let p = Parser.make src filename in - Parsetree.Ptop_def (NapkinScript.parse_implementation p) - - let type_and_print_outcome filename = - Compmisc.init_path false; - let env = Compmisc.initial_env () in - try - let sstr = match parse_toplevel_phrase filename with - | Parsetree.Ptop_def sstr -> sstr - | _ -> assert false - in - let (_str, signature, _newenv) = Typemod.type_toplevel_phrase env sstr in - let out_sig_items = Printtyp.tree_of_signature signature in - let fmt = Format.str_formatter in - !OutcomePrinter.out_signature fmt out_sig_items; - let result = Format.flush_str_formatter () in - print_string result - with - | Typetexp.Error (_, _, err) -> - let fmt = Format.str_formatter in - Typetexp.report_error env fmt err; - let result = Format.flush_str_formatter () in - let () = print_endline result in - () - | _ -> print_endline "catch all" -end - -(* command line flags *) -module Clflags: sig - val recover: bool ref - val print: string ref - val width: int ref - val origin: string ref - val files: string list ref - val interface: bool ref - val report: string ref - - val parse: unit -> unit - val outcome: bool ref -end = struct - let recover = ref false - let width = ref 100 - - let files = ref [] - let add_filename filename = files := filename::(!files) - - let print = ref "" - let outcome = ref false - let origin = ref "" - let interface = ref false - let report = ref "pretty" - - let usage = "Usage: napkinscript \nOptions are:" - - let spec = [ - ("-recover", Arg.Unit (fun () -> recover := true), "Emit partial ast"); - ("-print", Arg.String (fun txt -> print := txt), "Print either binary, ocaml or ast"); - ("-parse", Arg.String (fun txt -> origin := txt), "Parse ocaml or napkinscript"); - ("-outcome", Arg.Bool (fun print_outcome_tree -> outcome := print_outcome_tree), "print outcometree"); - ("-width", Arg.Int (fun w -> width := w), "Specify the line length that the printer will wrap on" ); - ("-interface", Arg.Unit (fun () -> interface := true), "Parse as interface"); - ("-report", Arg.String (fun txt -> report := txt), "Stylize errors and messages using color and context. Accepts `Pretty` and `Plain`. Default `Plain`") - ] - - let parse () = Arg.parse spec add_filename usage -end - -module Driver: sig - val process_file: - is_interface: bool - -> width: int - -> recover: bool - -> origin:string - -> target:string - -> report:string - -> string - -> unit -end = struct - type 'a file_kind = - | Structure: Parsetree.structure file_kind - | Signature: Parsetree.signature file_kind - - let parse_napkin (type a) (kind : a file_kind) p : a = - match kind with - | Structure -> NapkinScript.parse_implementation p - | Signature -> NapkinScript.parse_specification p - - let extract_ocaml_string_data filename = - let lexbuf = if String.length filename > 0 then - IO.read_file filename |> Lexing.from_string - else - Lexing.from_channel stdin - in - let string_locs = ref [] in - let rec next () = - let token = Lexer.token_with_comments lexbuf in - match token with - | OcamlParser.STRING (_txt, None) -> - let open Location in - let loc = { - loc_start = lexbuf.lex_start_p; - loc_end = lexbuf.Lexing.lex_curr_p; - loc_ghost = false; - } in - let len = loc.loc_end.pos_cnum - loc.loc_start.pos_cnum in - let txt = Bytes.to_string ( - (Bytes.sub [@doesNotRaise]) lexbuf.Lexing.lex_buffer loc.loc_start.pos_cnum len - ) in - string_locs := (txt, loc)::(!string_locs); - next(); - | OcamlParser.EOF -> () - | _ -> next() - in - next(); - List.rev !string_locs - - let parse_ocaml (type a) (kind : a file_kind) filename : a = - let lexbuf = if String.length filename > 0 then - IO.read_file filename |> Lexing.from_string - else - Lexing.from_channel stdin - in - let string_data = extract_ocaml_string_data filename in - match kind with - | Structure -> - Parse.implementation lexbuf - |> ParsetreeCompatibility.replace_string_literal_structure string_data - |> ParsetreeCompatibility.structure - | Signature -> - Parse.interface lexbuf - |> ParsetreeCompatibility.replace_string_literal_signature string_data - |> ParsetreeCompatibility.signature - - let parse_napkin_file ~destination kind filename = - let src = if String.length filename > 0 then - IO.read_file filename - else - IO.read_stdin () - in - let p = - let mode = match destination with - | "napkinscript" | "ns" | "sexp" -> Parser.Default - | _ -> Parser.ParseForTypeChecker - in - Parser.make ~mode src filename in - let ast = parse_napkin kind p in - let report = match p.diagnostics with - | [] -> None - | diagnostics -> Some(diagnostics) - in - (ast, report, p) - - let parse_ocaml_file kind filename = - let ast = parse_ocaml kind filename in - let lexbuf2 = if String.length filename > 0 then - IO.read_file filename |> Lexing.from_string - else - Lexing.from_channel stdin - in - let comments = - let rec next (prev_tok_end_pos : Lexing.position) comments lb = - let token = Lexer.token_with_comments lb in - match token with - | OcamlParser.EOF -> comments - | OcamlParser.COMMENT (txt, loc) -> - let comment = Comment.from_ocaml_comment - ~loc - ~prev_tok_end_pos - ~txt - in - next loc.Location.loc_end (comment::comments) lb - | _ -> - next lb.Lexing.lex_curr_p comments lb - in - let cmts = next lexbuf2.Lexing.lex_start_p [] lexbuf2 in - cmts - in - let p = Parser.make "" filename in - p.comments <- comments; - (ast, None, p) - - let reason_filename = ref "" - let comment_data = ref [] - let string_data = ref [] - - let parse_reason_binary_from_stdin (type a) (kind : a file_kind) filename :a = - let chan, close = - match String.length filename == 0 with - | true -> stdin, (fun _ -> ()) - | false -> - let file_chan = open_in_bin filename in - seek_in file_chan 0; - file_chan, close_in_noerr - in - let ic = chan in - let magic = match kind with - | Structure -> Config.ast_impl_magic_number - | Signature -> Config.ast_intf_magic_number - in - let buffer = (really_input_string [@doesNotRaise]) ic (String.length magic) in - assert(buffer = magic); - let filename = input_value ic in - reason_filename := filename; - let ast = input_value ic in - close chan; - - let src = - if String.length filename > 0 then IO.read_file filename - else IO.read_stdin () - in - - let scanner = Scanner.make (Bytes.of_string src) filename in - - let rec next prev_end_pos scanner = - let (start_pos, end_pos, token) = Scanner.scan scanner in - match token with - | Eof -> () - | Comment c -> - Comment.set_prev_tok_end_pos c prev_end_pos; - comment_data := c::(!comment_data); - next end_pos scanner - | String _ -> - let loc = {Location.loc_start = start_pos; loc_end = end_pos; loc_ghost = false} in - let len = end_pos.pos_cnum - start_pos.pos_cnum in - let txt = (String.sub [@doesNotRaise]) src start_pos.pos_cnum len in - string_data := (txt, loc)::(!string_data); - next end_pos scanner - | _ -> - next end_pos scanner - in - - next Lexing.dummy_pos scanner; - - match kind with - | Structure -> - ast - |> ParsetreeCompatibility.replace_string_literal_structure !string_data - |> ParsetreeCompatibility.normalize_reason_arity_structure ~for_printer:true - |> ParsetreeCompatibility.structure - | Signature -> - ast - |> ParsetreeCompatibility.replace_string_literal_signature !string_data - |> ParsetreeCompatibility.normalize_reason_arity_signature ~for_printer:true - |> ParsetreeCompatibility.signature - - let is_reason_doc_comment (comment: Comment.t) = - let content = Comment.txt comment in - let len = String.length content in - if len = 0 then true - else if len >= 2 && (String.unsafe_get content 0 = '*' && String.unsafe_get content 1 = '*') then false - else if len >= 1 && (String.unsafe_get content 0 = '*') then true - else false - - - let parse_reason_binary kind filename = - let ast = parse_reason_binary_from_stdin kind filename in - let p = Parser.make "" !reason_filename in - p.comments <- List.filter (fun c -> not (is_reason_doc_comment c)) !comment_data; - (ast, None, p) - - let parse_implementation ~origin ~destination filename = - match origin with - | "ml" | "ocaml" -> - parse_ocaml_file Structure filename - | "reasonBinary" -> - parse_reason_binary Structure filename - | _ -> - parse_napkin_file ~destination Structure filename - - let parse_interface ~destination ~origin filename = - match origin with - | "ml" | "ocaml" -> - parse_ocaml_file Signature filename - | "reasonBinary" -> - parse_reason_binary Signature filename - | _ -> - parse_napkin_file ~destination Signature filename - - let process ~report_style parse_fn print_fn recover filename = - let (ast, report, parser_state) = parse_fn filename in - match report with - | Some report when recover = true -> - print_fn ast parser_state; - prerr_string ( - Diagnostics.string_of_report - ~style:(Diagnostics.parse_report_style report_style) - report (Bytes.to_string parser_state.Parser.scanner.src) - ); - | Some report -> - prerr_string ( - Diagnostics.string_of_report - ~style:(Diagnostics.parse_report_style report_style) - report (Bytes.to_string parser_state.Parser.scanner.src) - ); - exit 1 - | None -> - print_fn ast parser_state - - type action = - | ProcessImplementation - | ProcessInterface - - let print_implementation ~target ~width filename ast _parserState = - match target with - | "ml" | "ocaml" -> - Pprintast.structure Format.std_formatter ast - | "ns" | "napkinscript" -> - Printer.print_implementation ~width ast (List.rev _parserState.Parser.comments) - | "ast" -> - Printast.implementation Format.std_formatter ast - | "sexp" -> - ast |> SexpAst.implementation |> Sexp.to_string |> print_string - | _ -> (* default binary *) - output_string stdout Config.ast_impl_magic_number; - output_value stdout filename; - output_value stdout ast - - let print_interface ~target ~width filename ast _parserState = - match target with - | "ml" | "ocaml" -> Pprintast.signature Format.std_formatter ast - | "ns" | "napkinscript" -> - Printer.print_interface ~width ast (List.rev _parserState.Parser.comments) - | "ast" -> Printast.interface Format.std_formatter ast - | "sexp" -> - ast |> SexpAst.interface |> Sexp.to_string |> print_string - | _ -> (* default binary *) - output_string stdout Config.ast_intf_magic_number; - output_value stdout filename; - output_value stdout ast - - let process_file ~is_interface ~width ~recover ~origin ~target ~report filename = - try - let len = String.length filename in - let action = - if is_interface || len > 0 && (String.get [@doesNotRaise]) filename (len - 1) = 'i' then - ProcessInterface - else ProcessImplementation - in - match action with - | ProcessImplementation -> - process - ~report_style:report - (parse_implementation ~origin ~destination:target) - (print_implementation ~target ~width filename) recover filename - | ProcessInterface -> - process - ~report_style:report - (parse_interface ~origin ~destination:target) - (print_interface ~target ~width filename) recover filename - with - | Failure txt -> - prerr_string txt; - prerr_newline(); - exit 1 - | _ -> exit 1 -end - -let () = - Clflags.parse (); - if !Clflags.outcome then ( - Repl.type_and_print_outcome (List.hd !Clflags.files) - ) else ( - let () = match !Clflags.files with - | (_file::_) as files -> - List.iter (fun filename -> - Driver.process_file - ~is_interface:!Clflags.interface - ~width:!Clflags.width - ~recover:!Clflags.recover - ~target:!Clflags.print - ~origin:!Clflags.origin - ~report:!Clflags.report - filename - ) files; - | [] -> - Driver.process_file - ~is_interface:!Clflags.interface - ~width:!Clflags.width - ~recover:!Clflags.recover - ~target:!Clflags.print - ~origin:!Clflags.origin - ~report:!Clflags.report - "" - in - exit 0 - ) diff --git a/jscomp/syntax/benchmarks/data/PrinterNapkin.ml b/jscomp/syntax/benchmarks/data/PrinterNapkin.ml deleted file mode 100644 index fa3b217ea2..0000000000 --- a/jscomp/syntax/benchmarks/data/PrinterNapkin.ml +++ /dev/null @@ -1,3501 +0,0 @@ -module Printer = { - type rec printer = { - src: bytes, - comments: CommentAst.t, - } - - let rec collect_patterns_from_list_construct = (acc, pattern) => - { - open Parsetree - switch pattern.ppat_desc { - | Ppat_construct( - {txt: Longident.Lident("::")}, - Some({ppat_desc: Ppat_tuple(list(pat, rest))}), - ) => - collectPatternsFromListConstruct(list(pat, ...acc), rest) - | _ => /List.rev(acc), pattern/ - } - } - - let addParens = doc => - Doc.group( - Doc.concat(list( - Doc.lparen, - Doc.indent(Doc.concat(list(Doc.softLine, doc))), - Doc.softLine, - Doc.rparen, - )), - ) - - let addBraces = doc => - Doc.group(Doc.concat(list(Doc.lbrace, doc, Doc.rbrace))) - - let interleaveWhitespace = ( - ~forceBreak=false, - rows: list, - ) => { - let rec loop = (prevLoc, acc, rows) => - switch rows { - | list() => Doc.concat(List.rev(acc)) - | list(/loc, doc/, ...rest) => - if ( - loc.Location.loc_start.pos_lnum - - prevLoc.Location.loc_end.pos_lnum > 1 - ) { - loop(loc, list(doc, Doc.line, Doc.line, ...acc), rest) - } else { - loop(loc, list(doc, Doc.line, ...acc), rest) - } - } - - switch rows { - | list() => Doc.nil - | list(/firstLoc, firstDoc/, ...rest) => - let forceBreak = - forceBreak || - switch List.rev(rest) { - | list(/lastLoc, _/, ..._) => - firstLoc.loc_start.pos_lnum !== lastLoc.loc_end.pos_lnum - | _ => false - } - - Doc.breakableGroup(~forceBreak, loop(firstLoc, list(firstDoc), rest)) - } - } - - let printLongident = l => - switch l { - | Longident.Lident(lident) => Doc.text(lident) - | Longident.Ldot(lident, txt) as l => - let txts = Longident.flatten(l) - Doc.join(~sep=Doc.dot, List.map(Doc.text, txts)) - | _ => failwith("unsupported ident") - } - - let escapeStringContents = s => { - let len = String.length(s) - let b = Buffer.create(len) - for i in 0 to len - 1 { - let c = String.get(s, i) - if c == '\b' { - Buffer.add_char(b, '\\') - Buffer.add_char(b, 'b') - } else if c == '\t' { - Buffer.add_char(b, '\\') - Buffer.add_char(b, 't') - } else if c == '\n' { - Buffer.add_char(b, '\\') - Buffer.add_char(b, 'n') - } else if c == '\r' { - Buffer.add_char(b, '\\') - Buffer.add_char(b, 'r') - } else if c == '"' { - Buffer.add_char(b, '\\') - Buffer.add_char(b, '"') - } else if c == '\\' { - Buffer.add_char(b, '\\') - Buffer.add_char(b, '\\') - } else { - Buffer.add_char(b, c) - } - } - Buffer.contents(b) - } - - let print_constant = c => - switch c { - | Parsetree.Pconst_integer(s, _) => Doc.text(s) - | Pconst_string(s, _) => Doc.text("\"" ++ escape_string_contents(s) ++ "\"") - | Pconst_float(s, _) => Doc.text(s) - | Pconst_char(c) => Doc.text("'" ++ Char.escaped(c) ++ "'") - } - - let rec print_structure = (s: Parsetree.structure) => - interleave_whitespace( - List.map(si => /si.Parsetree.pstr_loc, print_structure_item(si)/, s), - ) - - and print_structure_item = (si: Parsetree.structure_item) => - switch si.pstr_desc { - | Pstr_value(rec_flag, value_bindings) => - let rec_flag = switch rec_flag { - | Asttypes.Nonrecursive => Doc.nil - | Asttypes.Recursive => Doc.text("rec ") - } - - print_value_bindings(~rec_flag, value_bindings) - | Pstr_type(recFlag, type_declarations) => - let recFlag = switch recFlag { - | Asttypes.Nonrecursive => Doc.nil - | Asttypes.Recursive => Doc.text("rec ") - } - - print_type_declarations(~rec_flag, type_declarations) - | Pstr_primitive(valueDescription) => - printValueDescription(valueDescription) - | Pstr_eval(expr, attrs) => - let needsParens = switch expr { - | { - pexp_attributes: list(/{txt: "res.ternary"}, _/), - pexp_desc: Pexp_ifthenelse(_), - } => - false - | _ when ParsetreeViewer.has_attributes(expr.pexp_attributes) => true - | _ => false - } - - let expr_doc = { - let doc = print_expression(expr) - if needs_parens { - add_parens(doc) - } else { - doc - } - } - - Doc.concat(list(print_attributes(attrs), expr_doc)) - | Pstr_attribute(attr) => - Doc.concat(list(Doc.text("@"), print_attribute(attr))) - | Pstr_extension(extension, attrs) => - Doc.concat(list( - print_attributes(attrs), - Doc.concat(list(Doc.text("%"), print_extension(extension))), - )) - | Pstr_include(include_declaration) => - print_include_declaration(include_declaration) - | Pstr_open(open_description) => print_open_description(open_description) - | Pstr_modtype(mod_type_decl) => print_module_type_declaration(mod_type_decl) - | Pstr_module(module_binding) => - print_module_binding(~is_rec=false, 0, module_binding) - | Pstr_recmodule(module_bindings) => - Doc.join( - ~sep=Doc.line, - List.mapi( - (i, mb) => print_module_binding(~is_rec=true, i, mb), - module_bindings, - ), - ) - | Pstr_exception(extension_constructor) => - print_exception_def(extension_constructor) - | Pstr_typext(type_extension) => print_type_extension(type_extension) - | Pstr_class(_) | Pstr_class_type(_) => Doc.nil - } - - and print_type_extension = (te: Parsetree.type_extension) => { - let prefix = Doc.text("type ") - let name = print_longident(te.ptyext_path.txt) - let type_params = switch te.ptyext_params { - | list() => Doc.nil - | typeParams => - Doc.group( - Doc.concat(list( - Doc.less_than, - Doc.indent( - Doc.concat(list( - Doc.soft_line, - Doc.join( - ~sep=Doc.concat(list(Doc.comma, Doc.line)), - List.map(print_type_param, type_params), - ), - )), - ), - Doc.trailing_comma, - Doc.soft_line, - Doc.greater_than, - )), - ) - } - - let extension_constructors = { - let ecs = te.ptyext_constructors - let force_break = switch /ecs, List.rev(ecs)/ { - | /list(first, ..._), list(last, ..._)/ => - first.pext_loc.loc_start.pos_lnum > - te.ptyext_path.loc.loc_end.pos_lnum || - first.pext_loc.loc_start.pos_lnum < last.pext_loc.loc_end.pos_lnum - | _ => false - } - - let privateFlag = switch te.ptyext_private { - | Asttypes.Private => Doc.concat(list(Doc.text("private"), Doc.line)) - | Public => Doc.nil - } - - Doc.breakable_group( - ~force_break, - Doc.indent( - Doc.concat(list( - Doc.line, - private_flag, - Doc.join(~sep=Doc.line, List.mapi(print_extension_constructor, ecs)), - )), - ), - ) - } - - Doc.group( - Doc.concat(list( - print_attributes(~loc=te.ptyext_path.loc, te.ptyext_attributes), - prefix, - name, - type_params, - Doc.text(" +="), - extension_constructors, - )), - ) - } - - and print_module_binding = (~is_rec, i, module_binding) => { - let prefix = if i == 0 { - Doc.concat(list( - Doc.text("module "), - if is_rec { - Doc.text("rec ") - } else { - Doc.nil - }, - )) - } else { - Doc.text("and ") - } - - let /mod_expr_doc, mod_constraint_doc/ = switch module_binding.pmb_expr { - | {pmod_desc: Pmod_constraint(modExpr, modType)} => - / - printModExpr(modExpr), - Doc.concat(list(Doc.text(": "), printModType(mod_type))), - / - | mod_expr => /print_mod_expr(mod_expr), Doc.nil/ - } - - Doc.concat(list( - print_attributes( - ~loc=module_binding.pmb_name.loc, - module_binding.pmb_attributes, - ), - prefix, - Doc.text(module_binding.pmb_name.Location.txt), - mod_constraint_doc, - Doc.text(" = "), - mod_expr_doc, - )) - } - - and printModuleTypeDeclaration = ( - modTypeDecl: Parsetree.module_type_declaration, - ) => - Doc.concat(list( - print_attributes(mod_type_decl.pmtd_attributes), - Doc.text("module type "), - Doc.text(mod_type_decl.pmtd_name.txt), - switch mod_type_decl.pmtd_type { - | None => Doc.nil - | Some(mod_type) => - Doc.concat(list(Doc.text(" = "), print_mod_type(mod_type))) - }, - )) - - and print_mod_type = mod_type => { - let mod_type_doc = switch mod_type.pmty_desc { - | Parsetree.Pmty_ident({txt: longident, loc}) => - Doc.concat(list( - print_attributes(~loc, mod_type.pmty_attributes), - print_longident(longident), - )) - | Pmty_signature(signature) => - let signature_doc = Doc.breakable_group( - ~force_break=true, - Doc.concat(list( - Doc.lbrace, - Doc.indent(Doc.concat(list(Doc.line, print_signature(signature)))), - Doc.line, - Doc.rbrace, - )), - ) - Doc.concat(list(print_attributes(mod_type.pmty_attributes), signature_doc)) - | Pmty_functor(_) => - let /parameters, return_type/ = ParsetreeViewer.functor_type(mod_type) - let parameters_doc = switch parameters { - | list() => Doc.nil - | list(/attrs, {Location.txt: "_"}, Some(mod_type)/) => - let attrs = switch attrs { - | list() => Doc.nil - | attrs => - Doc.concat(list( - Doc.join(~sep=Doc.line, List.map(print_attribute, attrs)), - Doc.line, - )) - } - Doc.concat(list(attrs, print_mod_type(mod_type))) - | params => - Doc.group( - Doc.concat(list( - Doc.lparen, - Doc.indent( - Doc.concat(list( - Doc.soft_line, - Doc.join( - ~sep=Doc.concat(list(Doc.comma, Doc.line)), - List.map( - (/attrs, lbl, mod_type/) => { - let attrs = switch attrs { - | list() => Doc.nil - | attrs => - Doc.concat(list( - Doc.join( - ~sep=Doc.line, - List.map(print_attribute, attrs), - ), - Doc.line, - )) - } - Doc.concat(list( - attrs, - if lbl.Location.txt == "_" { - Doc.nil - } else { - Doc.text(lbl.txt) - }, - switch modType { - | None => Doc.nil - | Some(mod_type) => - Doc.concat(list( - if lbl.txt == "_" { - Doc.nil - } else { - Doc.text(": ") - }, - print_mod_type(mod_type), - )) - }, - )) - }, - params, - ), - ), - )), - ), - Doc.trailing_comma, - Doc.soft_line, - Doc.rparen, - )), - ) - } - - let return_doc = { - let doc = print_mod_type(return_type) - if Parens.mod_type_functor_return(return_type) { - add_parens(doc) - } else { - doc - } - } - - Doc.group( - Doc.concat(list( - parameters_doc, - Doc.group(Doc.concat(list(Doc.text(" =>"), Doc.line, return_doc))), - )), - ) - | Pmty_typeof(mod_expr) => - Doc.concat(list(Doc.text("module type of "), print_mod_expr(mod_expr))) - | Pmty_extension(extension) => print_extension(extension) - | Pmty_alias({txt: longident}) => - Doc.concat(list(Doc.text("module "), print_longident(longident))) - | Pmty_with(mod_type, with_constraints) => - let operand = { - let doc = print_mod_type(mod_type) - if Parens.mod_type_with_operand(mod_type) { - add_parens(doc) - } else { - doc - } - } - - Doc.group( - Doc.concat(list( - operand, - Doc.indent( - Doc.concat(list(Doc.line, print_with_constraints(with_constraints))), - ), - )), - ) - } - - let attrs_already_printed = switch mod_type.pmty_desc { - | (Pmty_functor(_) | Pmty_signature(_)) | Pmty_ident(_) => true - | _ => false - } - Doc.concat(list( - if attrs_already_printed { - Doc.nil - } else { - printAttributes(mod_type.pmty_attributes) - }, - mod_type_doc, - )) - } - - and print_with_constraints = with_constraints => { - let rows = List.mapi( - (i, with_constraint) => - Doc.group( - Doc.concat(list( - if i === 0 { - Doc.text("with ") - } else { - Doc.text("and ") - }, - printWithConstraint(with_constraint), - )), - ), - withConstraints, - ) - - Doc.join(~sep=Doc.line, rows) - } - - and print_with_constraint = (with_constraint: Parsetree.with_constraint) => - switch with_constraint { - | Pwith_type({txt: longident}, type_declaration) => - Doc.group( - print_type_declaration( - ~name=print_longident(longident), - ~equal_sign="=", - ~rec_flag=Doc.nil, - 0, - type_declaration, - ), - ) - | Pwith_module({txt: longident1}, {txt: longident2}) => - Doc.concat(list( - Doc.text("module "), - print_longident(longident1), - Doc.text(" ="), - Doc.indent(Doc.concat(list(Doc.line, print_longident(longident2)))), - )) - | Pwith_typesubst({txt: longident}, type_declaration) => - Doc.group( - print_type_declaration( - ~name=print_longident(longident), - ~equal_sign=":=", - ~rec_flag=Doc.nil, - 0, - type_declaration, - ), - ) - | Pwith_modsubst({txt: longident1}, {txt: longident2}) => - Doc.concat(list( - Doc.text("module "), - print_longident(longident1), - Doc.text(" :="), - Doc.indent(Doc.concat(list(Doc.line, print_longident(longident2)))), - )) - } - - and printSignature = signature => - interleaveWhitespace( - List.map( - si => /si.Parsetree.psig_loc, printSignatureItem(si)/, - signature, - ), - ) - - and printSignatureItem = (si: Parsetree.signature_item) => - switch si.psig_desc { - | Parsetree.Psig_value(value_description) => - printValueDescription(valueDescription) - | Psig_type(recFlag, typeDeclarations) => - let recFlag = switch recFlag { - | Asttypes.Nonrecursive => Doc.nil - | Asttypes.Recursive => Doc.text("rec ") - } - - printTypeDeclarations(~recFlag, typeDeclarations) - | Psig_typext(typeExtension) => printTypeExtension(typeExtension) - | Psig_exception(extensionConstructor) => - printExceptionDef(extensionConstructor) - | Psig_module(moduleDeclaration) => - printModuleDeclaration(moduleDeclaration) - | Psig_recmodule(moduleDeclarations) => - printRecModuleDeclarations(moduleDeclarations) - | Psig_modtype(modTypeDecl) => printModuleTypeDeclaration(modTypeDecl) - | Psig_open(openDescription) => printOpenDescription(openDescription) - | Psig_include(includeDescription) => - printIncludeDescription(includeDescription) - | Psig_attribute(attr) => - Doc.concat(list(Doc.text("@"), print_attribute(attr))) - | Psig_extension(extension, attrs) => - Doc.concat(list( - print_attributes(attrs), - Doc.concat(list(Doc.text("%"), print_extension(extension))), - )) - | Psig_class(_) | Psig_class_type(_) => Doc.nil - } - - and printRecModuleDeclarations = moduleDeclarations => - Doc.group( - Doc.join( - ~sep=Doc.line, - List.mapi( - (i, md: Parsetree.module_declaration) => { - let body = switch md.pmd_type.pmty_desc { - | Parsetree.Pmty_alias({txt: longident}) => - Doc.concat(list(Doc.text(" = "), print_longident(longident))) - | _ => - let needs_parens = switch md.pmd_type.pmty_desc { - | Pmty_with(_) => true - | _ => false - } - - let mod_type_doc = { - let doc = print_mod_type(md.pmd_type) - if needs_parens { - add_parens(doc) - } else { - doc - } - } - - Doc.concat(list(Doc.text(": "), mod_type_doc)) - } - - let prefix = if i < 1 { - "module rec " - } else { - "and " - } - Doc.concat(list( - printAttributes(~loc=md.pmd_name.loc, md.pmd_attributes), - Doc.text(prefix), - Doc.text(md.pmd_name.txt), - body, - )) - }, - moduleDeclarations, - ), - ), - ) - - and printModuleDeclaration = (md: Parsetree.module_declaration) => { - let body = switch md.pmd_type.pmty_desc { - | Parsetree.Pmty_alias({txt: longident}) => - Doc.concat(list(Doc.text(" = "), print_longident(longident))) - | _ => Doc.concat(list(Doc.text(": "), print_mod_type(md.pmd_type))) - } - - Doc.concat(list( - print_attributes(~loc=md.pmd_name.loc, md.pmd_attributes), - Doc.text("module "), - Doc.text(md.pmd_name.txt), - body, - )) - } - - and print_open_description = (open_description: Parsetree.open_description) => - Doc.concat(list( - print_attributes(open_description.popen_attributes), - Doc.text("open"), - switch open_description.popen_override { - | Asttypes.Fresh => Doc.space - | Asttypes.Override => Doc.text("! ") - }, - printLongident(open_description.popen_lid.txt), - )) - - and print_include_description = ( - include_description: Parsetree.include_description, - ) => - Doc.concat(list( - print_attributes(include_description.pincl_attributes), - Doc.text("include "), - print_mod_type(include_description.pincl_mod), - )) - - and print_include_declaration = ( - include_declaration: Parsetree.include_declaration, - ) => - Doc.concat(list( - print_attributes(include_declaration.pincl_attributes), - Doc.text("include "), - print_mod_expr(include_declaration.pincl_mod), - )) - - and print_value_bindings = (~rec_flag, vbs: list) => { - let rows = List.mapi( - (i, vb) => { - let doc = print_value_binding(~rec_flag, i, vb) - /vb.Parsetree.pvb_loc, doc/ - }, - vbs, - ) - - interleave_whitespace(rows) - } - - and print_value_description = value_description => { - let is_external = switch value_description.pval_prim { - | list() => false - | _ => true - } - - Doc.group( - Doc.concat(list( - Doc.text( - if is_external { - "external " - } else { - "let " - }, - ), - Doc.text(value_description.pval_name.txt), - Doc.text(": "), - printTypExpr(value_description.pval_type), - if isExternal { - Doc.group( - Doc.concat(list( - Doc.text(" ="), - Doc.indent( - Doc.concat(list( - Doc.line, - Doc.join( - ~sep=Doc.line, - List.map( - s => - Doc.concat(list( - Doc.text("\""), - Doc.text(s), - Doc.text("\""), - )), - value_description.pval_prim, - ), - ), - )), - ), - )), - ) - } else { - Doc.nil - }, - )), - ) - } - - and print_type_declarations = (~rec_flag, type_declarations) => { - let rows = List.mapi( - (i, td) => { - let doc = print_type_declaration( - ~name=Doc.text(td.Parsetree.ptype_name.txt), - ~equal_sign="=", - ~rec_flag, - i, - td, - ) - - /td.Parsetree.ptype_loc, doc/ - }, - type_declarations, - ) - interleave_whitespace(rows) - } - - and print_type_declaration = ( - ~name, - ~equal_sign, - ~rec_flag, - i, - td: Parsetree.type_declaration, - ) => { - let attrs = print_attributes(~loc=td.ptype_loc, td.ptype_attributes) - let prefix = if i > 0 { - Doc.text("and ") - } else { - Doc.concat(list(Doc.text("type "), rec_flag)) - } - - let type_name = name - let type_params = switch td.ptype_params { - | list() => Doc.nil - | typeParams => - Doc.group( - Doc.concat(list( - Doc.less_than, - Doc.indent( - Doc.concat(list( - Doc.soft_line, - Doc.join( - ~sep=Doc.concat(list(Doc.comma, Doc.line)), - List.map(print_type_param, type_params), - ), - )), - ), - Doc.trailing_comma, - Doc.soft_line, - Doc.greater_than, - )), - ) - } - - let manifest_and_kind = switch td.ptype_kind { - | Ptype_abstract => - switch td.ptype_manifest { - | None => Doc.nil - | Some(typ) => - Doc.concat(list( - Doc.concat(list(Doc.space, Doc.text(equal_sign), Doc.space)), - print_private_flag(td.ptype_private), - print_typ_expr(typ), - )) - } - | Ptype_open => - Doc.concat(list( - Doc.concat(list(Doc.space, Doc.text(equal_sign), Doc.space)), - print_private_flag(td.ptype_private), - Doc.text(".."), - )) - | Ptype_record(lds) => - let manifest = switch td.ptype_manifest { - | None => Doc.nil - | Some(typ) => - Doc.concat(list( - Doc.concat(list(Doc.space, Doc.text(equal_sign), Doc.space)), - print_typ_expr(typ), - )) - } - - Doc.concat(list( - manifest, - Doc.concat(list(Doc.space, Doc.text(equal_sign), Doc.space)), - print_private_flag(td.ptype_private), - print_record_declaration(lds), - )) - | Ptype_variant(cds) => - let manifest = switch td.ptype_manifest { - | None => Doc.nil - | Some(typ) => - Doc.concat(list( - Doc.concat(list(Doc.space, Doc.text(equal_sign), Doc.space)), - print_typ_expr(typ), - )) - } - - Doc.concat(list( - manifest, - Doc.concat(list(Doc.space, Doc.text(equal_sign))), - print_constructor_declarations(~private_flag=td.ptype_private, cds), - )) - } - - let constraints = printTypeDefinitionConstraints(td.ptype_cstrs) - Doc.group( - Doc.concat(list( - attrs, - prefix, - type_name, - type_params, - manifest_and_kind, - constraints, - )), - ) - } - - and print_type_definition_constraints = cstrs => - switch cstrs { - | list() => Doc.nil - | cstrs => - Doc.indent( - Doc.group( - Doc.concat(list( - Doc.line, - Doc.group( - Doc.join( - ~sep=Doc.line, - List.map(print_type_definition_constraint, cstrs), - ), - ), - )), - ), - ) - } - - and print_type_definition_constraint = ( - /typ1, typ2, _loc/: /Parsetree.core_type, Parsetree.core_type, Location.t/, - ) => - Doc.concat(list( - Doc.text("constraint "), - print_typ_expr(typ1), - Doc.text(" = "), - print_typ_expr(typ2), - )) - - and print_private_flag = (flag: Asttypes.private_flag) => - switch flag { - | Private => Doc.text("private ") - | Public => Doc.nil - } - - and print_type_param = (param: /Parsetree.core_type, Asttypes.variance/) => { - let /typ, variance/ = param - let printed_variance = switch variance { - | Covariant => Doc.text("+") - | Contravariant => Doc.text("-") - | Invariant => Doc.nil - } - - Doc.concat(list(printed_variance, print_typ_expr(typ))) - } - - and print_record_declaration = (lds: list) => { - let force_break = switch /lds, List.rev(lds)/ { - | /list(first, ..._), list(last, ..._)/ => - first.pld_loc.loc_start.pos_lnum < last.pld_loc.loc_end.pos_lnum - | _ => false - } - - Doc.breakableGroup( - ~force_break, - Doc.concat(list( - Doc.lbrace, - Doc.indent( - Doc.concat(list( - Doc.soft_line, - Doc.join( - ~sep=Doc.concat(list(Doc.comma, Doc.line)), - List.map(print_label_declaration, lds), - ), - )), - ), - Doc.trailing_comma, - Doc.soft_line, - Doc.rbrace, - )), - ) - } - - and print_constructor_declarations = ( - ~private_flag, - cds: list, - ) => { - let force_break = switch /cds, List.rev(cds)/ { - | /list(first, ..._), list(last, ..._)/ => - first.pcd_loc.loc_start.pos_lnum < last.pcd_loc.loc_end.pos_lnum - | _ => false - } - - let private_flag = switch private_flag { - | Asttypes.Private => Doc.concat(list(Doc.text("private"), Doc.line)) - | Public => Doc.nil - } - - Doc.breakable_group( - ~force_break, - Doc.indent( - Doc.concat(list( - Doc.line, - private_flag, - Doc.join(~sep=Doc.line, List.mapi(print_constructor_declaration, cds)), - )), - ), - ) - } - - and print_constructor_declaration = ( - i, - cd: Parsetree.constructor_declaration, - ) => { - let attrs = print_attributes(cd.pcd_attributes) - let bar = if i > 0 { - Doc.text("| ") - } else { - Doc.ifBreaks(Doc.text("| "), Doc.nil) - } - - let constr_name = Doc.text(cd.pcd_name.txt) - let constr_args = print_constructor_arguments(cd.pcd_args) - let gadt = switch cd.pcd_res { - | None => Doc.nil - | Some(typ) => - Doc.indent(Doc.concat(list(Doc.text(": "), print_typ_expr(typ)))) - } - - Doc.concat(list( - bar, - Doc.group(Doc.concat(list(attrs, constr_name, constr_args, gadt))), - )) - } - - and print_constructor_arguments = (cd_args: Parsetree.constructor_arguments) => - switch cd_args { - | Pcstr_tuple(list()) => Doc.nil - | Pcstr_tuple(types) => - Doc.group( - Doc.indent( - Doc.concat(list( - Doc.lparen, - Doc.indent( - Doc.concat(list( - Doc.soft_line, - Doc.join( - ~sep=Doc.concat(list(Doc.comma, Doc.line)), - List.map(print_typ_expr, types), - ), - )), - ), - Doc.trailing_comma, - Doc.soft_line, - Doc.rparen, - )), - ), - ) - | Pcstr_record(lds) => - Doc.indent( - Doc.concat(list( - Doc.lparen, - Doc.lbrace, - Doc.indent( - Doc.concat(list( - Doc.soft_line, - Doc.join( - ~sep=Doc.concat(list(Doc.comma, Doc.line)), - List.map(print_label_declaration, lds), - ), - )), - ), - Doc.trailing_comma, - Doc.soft_line, - Doc.rbrace, - Doc.rparen, - )), - ) - } - - and print_label_declaration = (ld: Parsetree.label_declaration) => { - let attrs = print_attributes(~loc=ld.pld_name.loc, ld.pld_attributes) - let mutable_flag = switch ld.pld_mutable { - | Mutable => Doc.text("mutable ") - | Immutable => Doc.nil - } - - let name = Doc.text(ld.pld_name.txt) - Doc.group( - Doc.concat(list( - attrs, - mutable_flag, - name, - Doc.text(": "), - print_typ_expr(ld.pld_type), - )), - ) - } - - and print_typ_expr = (typ_expr: Parsetree.core_type) => { - let rendered_type = switch typ_expr.ptyp_desc { - | Ptyp_any => Doc.text("_") - | Ptyp_var(var) => Doc.text("'" ++ var) - | Ptyp_extension(extension) => print_extension(extension) - | Ptyp_alias(typ, alias) => - let typ = { - let needs_parens = switch typ.ptyp_desc { - | Ptyp_arrow(_) => true - | _ => false - } - - let doc = print_typ_expr(typ) - if needs_parens { - Doc.concat(list(Doc.lparen, doc, Doc.rparen)) - } else { - doc - } - } - - Doc.concat(list(typ, Doc.text(" as "), Doc.text("'" ++ alias))) - | Ptyp_constr( - {txt: Longident.Ldot(Longident.Lident("Js"), "t")}, - list(typ), - ) => - let bsObject = printTypExpr(typ) - switch typExpr.ptyp_attributes { - | list() => bsObject - | attrs => - Doc.concat(list( - Doc.group(Doc.join(~sep=Doc.line, List.map(printAttribute, attrs))), - Doc.space, - printTypExpr(typ), - )) - } - | Ptyp_constr( - longidentLoc, - list({ptyp_desc: Parsetree.Ptyp_tuple(tuple)}), - ) => - let constrName = printLongident(longidentLoc.txt) - Doc.group( - Doc.concat(list( - constrName, - Doc.lessThan, - printTupleType(~inline=true, tuple), - Doc.greaterThan, - )), - ) - | Ptyp_constr(longidentLoc, constrArgs) => - let constrName = printLongident(longidentLoc.txt) - switch constrArgs { - | list() => constrName - | list({ - Parsetree.ptyp_desc: - Ptyp_constr( - {txt: Longident.Ldot(Longident.Lident("Js"), "t")}, - list({ptyp_desc: Ptyp_object(fields, openFlag)}), - ), - }) => - Doc.concat(list( - constr_name, - Doc.less_than, - print_bs_object_sugar(~inline=true, fields, open_flag), - Doc.greater_than, - )) - | args => - Doc.group( - Doc.concat(list( - constr_name, - Doc.less_than, - Doc.indent( - Doc.concat(list( - Doc.soft_line, - Doc.join( - ~sep=Doc.concat(list(Doc.comma, Doc.line)), - List.map(print_typ_expr, constr_args), - ), - )), - ), - Doc.trailing_comma, - Doc.soft_line, - Doc.greater_than, - )), - ) - } - | Ptyp_arrow(_) => - let /attrs_before, args, return_type/ = ParsetreeViewer.arrow_type(typ_expr) - let return_type_needs_parens = switch return_type.ptyp_desc { - | Ptyp_alias(_) => true - | _ => false - } - - let return_doc = { - let doc = print_typ_expr(return_type) - if return_type_needs_parens { - Doc.concat(list(Doc.lparen, doc, Doc.rparen)) - } else { - doc - } - } - - let /is_uncurried, attrs/ = ParsetreeViewer.process_uncurried_attribute( - attrs_before, - ) - switch args { - | list() => Doc.nil - | list(/list(), Nolabel, n/) when !is_uncurried => - let has_attrs_before = !(attrs == list()) - let attrs = if has_attrs_before { - Doc.concat(list( - Doc.join(~sep=Doc.line, List.map(print_attribute, attrs_before)), - Doc.space, - )) - } else { - Doc.nil - } - - Doc.group( - Doc.concat(list( - Doc.group(attrs), - Doc.group( - if has_attrs_before { - Doc.concat(list( - Doc.lparen, - Doc.indent( - Doc.concat(list( - Doc.soft_line, - print_typ_expr(n), - Doc.text(" => "), - return_doc, - )), - ), - Doc.soft_line, - Doc.rparen, - )) - } else { - Doc.concat(list(print_typ_expr(n), Doc.text(" => "), return_doc)) - }, - ), - )), - ) - | args => - let attrs = switch attrs { - | list() => Doc.nil - | attrs => - Doc.concat(list( - Doc.join(~sep=Doc.line, List.map(print_attribute, attrs)), - Doc.space, - )) - } - - let renderedArgs = Doc.concat(list( - attrs, - Doc.text("("), - Doc.indent( - Doc.concat(list( - Doc.soft_line, - if is_uncurried { - Doc.concat(list(Doc.dot, Doc.space)) - } else { - Doc.nil - }, - Doc.join( - ~sep=Doc.concat(list(Doc.comma, Doc.line)), - List.map(print_type_parameter, args), - ), - )), - ), - Doc.trailing_comma, - Doc.soft_line, - Doc.text(")"), - )) - Doc.group(Doc.concat(list(rendered_args, Doc.text(" => "), return_doc))) - } - | Ptyp_tuple(types) => print_tuple_type(~inline=false, types) - | Ptyp_object(fields, open_flag) => - print_bs_object_sugar(~inline=false, fields, open_flag) - | Ptyp_poly(string_locs, typ) => - Doc.concat(list( - Doc.join( - ~sep=Doc.space, - List.map(({Location.txt: txt}) => Doc.text("'" ++ txt), string_locs), - ), - Doc.dot, - Doc.space, - print_typ_expr(typ), - )) - | Ptyp_package(packageType) => - printPackageType(~printModuleKeywordAndParens=true, package_type) - | Ptyp_class(_) => failwith("classes are not supported in types") - | Ptyp_variant(_) => - failwith("Polymorphic variants currently not supported") - } - - let should_print_its_own_attributes = switch typ_expr.ptyp_desc { - | Ptyp_arrow(_) - | Ptyp_constr({txt: Longident.Ldot(Longident.Lident("Js"), "t")}, _) => - true - | _ => false - } - - switch typExpr.ptyp_attributes { - | list(_, ..._) as attrs when !shouldPrintItsOwnAttributes => - Doc.group(Doc.concat(list(printAttributes(attrs), renderedType))) - | _ => renderedType - } - } - - and printBsObjectSugar = (~inline, fields, openFlag) => { - let flag = switch openFlag { - | Asttypes.Closed => Doc.nil - | Open => Doc.dotdot - } - - let doc = Doc.concat(list( - Doc.lbrace, - flag, - Doc.indent( - Doc.concat(list( - Doc.softLine, - Doc.join( - ~sep=Doc.concat(list(Doc.comma, Doc.line)), - List.map(printObjectField, fields), - ), - )), - ), - Doc.trailingComma, - Doc.softLine, - Doc.rbrace, - )) - if inline { - doc - } else { - Doc.group(doc) - } - } - - and printTupleType = (~inline, types: list) => { - let tuple = Doc.concat(list( - Doc.text("/"), - Doc.indent( - Doc.concat(list( - Doc.soft_line, - Doc.join( - ~sep=Doc.concat(list(Doc.comma, Doc.line)), - List.map(print_typ_expr, types), - ), - )), - ), - Doc.soft_line, - Doc.text("/"), - )) - - if inline === false { - Doc.group(tuple) - } else { - tuple - } - } - - and print_object_field = (field: Parsetree.object_field) => - switch field { - | Otag(label_loc, attrs, typ) => - Doc.concat(list( - Doc.text("\"" ++ label_loc.txt ++ "\""), - Doc.text(": "), - print_typ_expr(typ), - )) - | _ => Doc.nil - } - - and print_type_parameter = (/attrs, lbl, typ/) => { - let /is_uncurried, attrs/ = ParsetreeViewer.process_uncurried_attribute(attrs) - let uncurried = if is_uncurried { - Doc.concat(list(Doc.dot, Doc.space)) - } else { - Doc.nil - } - let attrs = switch attrs { - | list() => Doc.nil - | attrs => - Doc.concat(list( - Doc.join(~sep=Doc.line, List.map(print_attribute, attrs)), - Doc.line, - )) - } - let label = switch lbl { - | Asttypes.Nolabel => Doc.nil - | Labelled(lbl) => Doc.text("~" ++ lbl ++ ": ") - | Optional(lbl) => Doc.text("~" ++ lbl ++ ": ") - } - - let optional_indicator = switch lbl { - | Asttypes.Nolabel | Labelled(_) => Doc.nil - | Optional(lbl) => Doc.text("=?") - } - - Doc.group( - Doc.concat(list( - uncurried, - attrs, - label, - print_typ_expr(typ), - optional_indicator, - )), - ) - } - - and print_value_binding = (~rec_flag, i, vb) => { - let is_ghost = ParsetreeViewer.is_ghost_unit_binding(i, vb) - let header = if is_ghost { - Doc.nil - } else if i === 0 { - Doc.concat(list(Doc.text("let "), rec_flag)) - } else { - Doc.text("and ") - } - - let printed_expr = { - let expr_doc = print_expression(vb.pvb_expr) - let needs_parens = switch vb.pvb_expr.pexp_desc { - | Pexp_constraint( - {pexp_desc: Pexp_pack(_)}, - {ptyp_desc: Ptyp_package(_)}, - ) => - false - | Pexp_constraint(_) => true - | _ => false - } - - if needsParens { - addParens(exprDoc) - } else { - exprDoc - } - } - - if is_ghost { - printed_expr - } else { - let should_indent = - ParsetreeViewer.is_binary_expression(vb.pvb_expr) || - switch vb.pvb_expr { - | { - pexp_attributes: list(/{Location.txt: "res.ternary"}, _/), - pexp_desc: Pexp_ifthenelse(ifExpr, _, _), - } => - ParsetreeViewer.isBinaryExpression(ifExpr) || - ParsetreeViewer.hasAttributes(ifExpr.pexp_attributes) - | {pexp_desc: Pexp_newtype(_)} => false - | e => - ParsetreeViewer.hasAttributes(e.pexp_attributes) || - ParsetreeViewer.isArrayAccess(e) - } - - Doc.concat(list( - printAttributes(~loc=vb.pvb_loc, vb.pvb_attributes), - header, - printPattern(vb.pvb_pat), - Doc.text(" ="), - if shouldIndent { - Doc.indent(Doc.concat(list(Doc.line, printed_expr))) - } else { - Doc.concat(list(Doc.space, printed_expr)) - }, - )) - } - } - - and printPackageType = ( - ~printModuleKeywordAndParens, - packageType: Parsetree.package_type, - ) => { - let doc = switch packageType { - | /longidentLoc, list()/ => - Doc.group(Doc.concat(list(print_longident(longident_loc.txt)))) - | /longidentLoc, package_constraints/ => - Doc.group( - Doc.concat(list( - print_longident(longident_loc.txt), - print_package_constraints(package_constraints), - Doc.soft_line, - )), - ) - } - - if printModuleKeywordAndParens { - Doc.concat(list(Doc.text("module("), doc, Doc.rparen)) - } else { - doc - } - } - - and printPackageConstraints = packageConstraints => - Doc.concat(list( - Doc.text(" with"), - Doc.indent( - Doc.concat(list( - Doc.line, - Doc.join( - ~sep=Doc.line, - List.mapi(print_packageconstraint, package_constraints), - ), - )), - ), - )) - - and print_packageconstraint = (i, /longident_loc, typ/) => { - let prefix = if i === 0 { - Doc.text("type ") - } else { - Doc.text("and type ") - } - Doc.concat(list( - prefix, - print_longident(longident_loc.Location.txt), - Doc.text(" = "), - print_typ_expr(typ), - )) - } - - and printExtension = (/stringLoc, payload/) => { - let extName = Doc.text("%" ++ string_loc.Location.txt) - switch payload { - | PStr(list({pstr_desc: Pstr_eval(expr, attrs)})) => - let expr_doc = print_expression(expr) - let needs_parens = switch attrs { - | list() => false - | _ => true - } - Doc.group( - Doc.concat(list( - ext_name, - add_parens( - Doc.concat(list( - print_attributes(attrs), - if needs_parens { - addParens(expr_doc) - } else { - expr_doc - }, - )), - ), - )), - ) - | _ => ext_name - } - } - - and print_pattern = (p: Parsetree.pattern) => { - let pattern_without_attributes = switch p.ppat_desc { - | Ppat_any => Doc.text("_") - | Ppat_var(string_loc) => Doc.text(string_loc.txt) - | Ppat_constant(c) => print_constant(c) - | Ppat_tuple(patterns) => - Doc.group( - Doc.concat(list( - Doc.text("/"), - Doc.indent( - Doc.concat(list( - Doc.soft_line, - Doc.join( - ~sep=Doc.concat(list(Doc.text(","), Doc.line)), - List.map(print_pattern, patterns), - ), - )), - ), - Doc.soft_line, - Doc.text("/"), - )), - ) - | Ppat_array(patterns) => - Doc.group( - Doc.concat(list( - Doc.text("["), - Doc.indent( - Doc.concat(list( - Doc.soft_line, - Doc.join( - ~sep=Doc.concat(list(Doc.text(","), Doc.line)), - List.map(print_pattern, patterns), - ), - )), - ), - Doc.if_breaks(Doc.text(","), Doc.nil), - Doc.soft_line, - Doc.text("]"), - )), - ) - | Ppat_construct({txt: Longident.Lident("[]")}, _) => Doc.text("list()") - | Ppat_construct({txt: Longident.Lident("::")}, _) => - let /patterns, tail/ = collectPatternsFromListConstruct(list(), p) - let shouldHug = switch /patterns, tail/ { - | / - list(pat), - {ppat_desc: Ppat_construct({txt: Longident.Lident("[]")}, _)} - / when ParsetreeViewer.isHuggablePattern(pat) => - true - | _ => false - } - - let children = Doc.concat(list( - if shouldHug { - Doc.nil - } else { - Doc.softLine - }, - Doc.join( - ~sep=Doc.concat(list(Doc.text(","), Doc.line)), - List.map(printPattern, patterns), - ), - switch tail.Parsetree.ppat_desc { - | Ppat_construct({txt: Longident.Lident("[]")}, _) => Doc.nil - | _ => - Doc.concat(list( - Doc.text(","), - Doc.line, - Doc.text("..."), - printPattern(tail), - )) - }, - )) - Doc.group( - Doc.concat(list( - Doc.text("list("), - if shouldHug { - children - } else { - Doc.concat(list( - Doc.indent(children), - Doc.ifBreaks(Doc.text(","), Doc.nil), - Doc.softLine, - )) - }, - Doc.text(")"), - )), - ) - | Ppat_construct(constrName, constructorArgs) => - let constrName = printLongident(constrName.txt) - switch constructorArgs { - | None => constrName - | Some(args) => - let args = switch args.ppat_desc { - | Ppat_construct({txt: Longident.Lident("()")}, None) => list(Doc.nil) - | Ppat_tuple(patterns) => List.map(printPattern, patterns) - | _ => list(printPattern(args)) - } - - Doc.group( - Doc.concat(list( - constrName, - Doc.text("("), - Doc.indent( - Doc.concat(list( - Doc.softLine, - Doc.join(~sep=Doc.concat(list(Doc.text(","), Doc.line)), args), - )), - ), - Doc.ifBreaks(Doc.text(","), Doc.nil), - Doc.softLine, - Doc.text(")"), - )), - ) - } - | Ppat_record(rows, openFlag) => - Doc.group( - Doc.concat(list( - Doc.text("{"), - Doc.indent( - Doc.concat(list( - Doc.softLine, - Doc.join( - ~sep=Doc.concat(list(Doc.text(","), Doc.line)), - List.map(printPatternRecordRow, rows), - ), - switch openFlag { - | Open => Doc.concat(list(Doc.text(","), Doc.line, Doc.text("_"))) - | Closed => Doc.nil - }, - )), - ), - Doc.ifBreaks(Doc.text(","), Doc.nil), - Doc.softLine, - Doc.text("}"), - )), - ) - | Ppat_exception(p) => - let needsParens = switch p.ppat_desc { - | Ppat_or(_, _) | Ppat_alias(_, _) => true - | _ => false - } - - let pat = { - let p = printPattern(p) - if needsParens { - Doc.concat(list(Doc.text("("), p, Doc.text(")"))) - } else { - p - } - } - - Doc.group(Doc.concat(list(Doc.text("exception"), Doc.line, pat))) - | Ppat_or(p1, p2) => - let p1 = { - let p = printPattern(p1) - switch p1.ppat_desc { - | Ppat_or(_, _) => Doc.concat(list(Doc.text("("), p, Doc.text(")"))) - | _ => p - } - } - - let p2 = { - let p = printPattern(p2) - switch p2.ppat_desc { - | Ppat_or(_, _) => Doc.concat(list(Doc.text("("), p, Doc.text(")"))) - | _ => p - } - } - - Doc.group(Doc.concat(list(p1, Doc.line, Doc.text("| "), p2))) - | Ppat_extension(ext) => printExtension(ext) - | Ppat_lazy(p) => - let needsParens = switch p.ppat_desc { - | Ppat_or(_, _) | Ppat_alias(_, _) => true - | _ => false - } - - let pat = { - let p = printPattern(p) - if needsParens { - Doc.concat(list(Doc.text("("), p, Doc.text(")"))) - } else { - p - } - } - - Doc.concat(list(Doc.text("lazy "), pat)) - | Ppat_alias(p, aliasLoc) => - let needsParens = switch p.ppat_desc { - | Ppat_or(_, _) | Ppat_alias(_, _) => true - | _ => false - } - - let renderedPattern = { - let p = printPattern(p) - if needsParens { - Doc.concat(list(Doc.text("("), p, Doc.text(")"))) - } else { - p - } - } - - Doc.concat(list( - renderedPattern, - Doc.text(" as "), - Doc.text(aliasLoc.txt), - )) - | Ppat_constraint( - {ppat_desc: Ppat_unpack(stringLoc)}, - {ptyp_desc: Ptyp_package(packageType)}, - ) => - Doc.concat(list( - Doc.text("module("), - Doc.text(stringLoc.txt), - Doc.text(": "), - printPackageType(~printModuleKeywordAndParens=false, packageType), - Doc.rparen, - )) - | Ppat_constraint(pattern, typ) => - Doc.concat(list(printPattern(pattern), Doc.text(": "), printTypExpr(typ))) - | Ppat_unpack(stringLoc) => - Doc.concat(list(Doc.text("module("), Doc.text(stringLoc.txt), Doc.rparen)) - | _ => failwith("unsupported pattern") - } - - switch p.ppat_attributes { - | list() => patternWithoutAttributes - | attrs => - Doc.group( - Doc.concat(list(printAttributes(attrs), patternWithoutAttributes)), - ) - } - } - - and printPatternRecordRow = row => - switch row { - | / - {Location.txt: Longident.Lident(ident)}, - {Parsetree.ppat_desc: Ppat_var({txt, _})} - / when ident == txt => - Doc.text(ident) - | /longident, pattern/ => - Doc.group( - Doc.concat(list( - printLongident(longident.txt), - Doc.text(": "), - Doc.indent(Doc.concat(list(Doc.softLine, printPattern(pattern)))), - )), - ) - } - - and printExpression = (e: Parsetree.expression) => { - let printedExpression = switch e.pexp_desc { - | Parsetree.Pexp_constant(c) => printConstant(c) - | Pexp_construct(_) - when ParsetreeViewer.hasJsxAttribute(e.pexp_attributes) => - printJsxFragment(e) - | Pexp_construct({txt: Longident.Lident("()")}, _) => Doc.text("()") - | Pexp_construct({txt: Longident.Lident("[]")}, _) => Doc.text("list()") - | Pexp_construct({txt: Longident.Lident("::")}, _) => - let /expressions, spread/ = ParsetreeViewer.collectListExpressions(e) - let spreadDoc = switch spread { - | Some(expr) => - Doc.concat(list( - Doc.text(","), - Doc.line, - Doc.dotdotdot, - printExpression(expr), - )) - | None => Doc.nil - } - - Doc.group( - Doc.concat(list( - Doc.text("list("), - Doc.indent( - Doc.concat(list( - Doc.softLine, - Doc.join( - ~sep=Doc.concat(list(Doc.text(","), Doc.line)), - List.map(printExpression, expressions), - ), - spreadDoc, - )), - ), - Doc.trailingComma, - Doc.softLine, - Doc.rparen, - )), - ) - | Pexp_construct(longidentLoc, args) => - let constr = printLongident(longidentLoc.txt) - let args = switch args { - | None => Doc.nil - | Some({pexp_desc: Pexp_construct({txt: Longident.Lident("()")}, _)}) => - Doc.text("()") - | Some({pexp_desc: Pexp_tuple(args)}) => - Doc.concat(list( - Doc.lparen, - Doc.indent( - Doc.concat(list( - Doc.softLine, - Doc.join( - ~sep=Doc.concat(list(Doc.comma, Doc.line)), - List.map(printExpression, args), - ), - )), - ), - Doc.trailingComma, - Doc.softLine, - Doc.rparen, - )) - | Some(arg) => - let argDoc = printExpression(arg) - let shouldHug = ParsetreeViewer.isHuggableExpression(arg) - Doc.concat(list( - Doc.lparen, - if shouldHug { - argDoc - } else { - Doc.concat(list( - Doc.indent(Doc.concat(list(Doc.softLine, argDoc))), - Doc.trailingComma, - Doc.softLine, - )) - }, - Doc.rparen, - )) - } - - Doc.group(Doc.concat(list(constr, args))) - | Pexp_ident(longidentLoc) => printLongident(longidentLoc.txt) - | Pexp_tuple(exprs) => - Doc.group( - Doc.concat(list( - Doc.text("/"), - Doc.indent( - Doc.concat(list( - Doc.softLine, - Doc.join( - ~sep=Doc.concat(list(Doc.text(","), Doc.line)), - List.map(printExpression, exprs), - ), - )), - ), - Doc.ifBreaks(Doc.text(","), Doc.nil), - Doc.softLine, - Doc.text("/"), - )), - ) - | Pexp_array(list()) => Doc.text("[]") - | Pexp_array(exprs) => - Doc.group( - Doc.concat(list( - Doc.lbracket, - Doc.indent( - Doc.concat(list( - Doc.softLine, - Doc.join( - ~sep=Doc.concat(list(Doc.text(","), Doc.line)), - List.map(printExpression, exprs), - ), - )), - ), - Doc.trailingComma, - Doc.softLine, - Doc.rbracket, - )), - ) - | Pexp_record(rows, spreadExpr) => - let spread = switch spreadExpr { - | None => Doc.nil - | Some(expr) => - Doc.concat(list( - Doc.dotdotdot, - printExpression(expr), - Doc.comma, - Doc.line, - )) - } - - let forceBreak = - e.pexp_loc.loc_start.pos_lnum < e.pexp_loc.loc_end.pos_lnum - - Doc.breakableGroup( - ~forceBreak, - Doc.concat(list( - Doc.lbrace, - Doc.indent( - Doc.concat(list( - Doc.softLine, - spread, - Doc.join( - ~sep=Doc.concat(list(Doc.text(","), Doc.line)), - List.map(printRecordRow, rows), - ), - )), - ), - Doc.trailingComma, - Doc.softLine, - Doc.rbrace, - )), - ) - | Pexp_extension(extension) => - switch extension { - | / - {txt: "obj"}, - PStr( - list({ - pstr_loc: loc, - pstr_desc: Pstr_eval({pexp_desc: Pexp_record(rows, _)}, list()), - }), - ) - / => - let forceBreak = loc.loc_start.pos_lnum < loc.loc_end.pos_lnum - - Doc.breakableGroup( - ~forceBreak, - Doc.concat(list( - Doc.lbrace, - Doc.indent( - Doc.concat(list( - Doc.softLine, - Doc.join( - ~sep=Doc.concat(list(Doc.text(","), Doc.line)), - List.map(printBsObjectRow, rows), - ), - )), - ), - Doc.trailingComma, - Doc.softLine, - Doc.rbrace, - )), - ) - | extension => printExtension(extension) - } - | Pexp_apply(_) => - if ParsetreeViewer.isUnaryExpression(e) { - printUnaryExpression(e) - } else if ParsetreeViewer.isBinaryExpression(e) { - printBinaryExpression(e) - } else { - printPexpApply(e) - } - | Pexp_unreachable => Doc.dot - | Pexp_field(expr, longidentLoc) => - let lhs = { - let doc = printExpression(expr) - if Parens.fieldExpr(expr) { - addParens(doc) - } else { - doc - } - } - - Doc.concat(list(lhs, Doc.dot, printLongident(longidentLoc.txt))) - | Pexp_setfield(expr1, longidentLoc, expr2) => - printSetFieldExpr(e.pexp_attributes, expr1, longidentLoc, expr2) - | Pexp_ifthenelse(ifExpr, thenExpr, elseExpr) => - if ParsetreeViewer.isTernaryExpr(e) { - let /parts, alternate/ = ParsetreeViewer.collectTernaryParts(e) - let ternaryDoc = switch parts { - | list(/condition1, consequent1/, ...rest) => - Doc.group( - Doc.concat(list( - printTernaryOperand(condition1), - Doc.indent( - Doc.concat(list( - Doc.line, - Doc.indent( - Doc.concat(list( - Doc.text("? "), - printTernaryOperand(consequent1), - )), - ), - Doc.concat( - List.map( - (/condition, consequent/) => - Doc.concat(list( - Doc.line, - Doc.text(": "), - printTernaryOperand(condition), - Doc.line, - Doc.text("? "), - printTernaryOperand(consequent), - )), - rest, - ), - ), - Doc.line, - Doc.text(": "), - Doc.indent(printTernaryOperand(alternate)), - )), - ), - )), - ) - | _ => Doc.nil - } - - let attrs = ParsetreeViewer.filterTernaryAttributes(e.pexp_attributes) - let needsParens = switch attrs { - | list() => false - | _ => true - } - Doc.concat(list( - printAttributes(attrs), - if needsParens { - addParens(ternaryDoc) - } else { - ternaryDoc - }, - )) - } else { - let /ifs, elseExpr/ = ParsetreeViewer.collectIfExpressions(e) - let ifDocs = Doc.join( - ~sep=Doc.space, - List.mapi( - (i, /ifExpr, thenExpr/) => { - let ifTxt = if i > 0 { - Doc.text("else if ") - } else { - Doc.text("if ") - } - let condition = printExpression(ifExpr) - Doc.concat(list( - ifTxt, - Doc.group(Doc.ifBreaks(addParens(condition), condition)), - Doc.space, - printExpressionBlock(~braces=true, thenExpr), - )) - }, - ifs, - ), - ) - let elseDoc = switch elseExpr { - | None => Doc.nil - | Some(expr) => - Doc.concat(list( - Doc.text(" else "), - printExpressionBlock(~braces=true, expr), - )) - } - - Doc.concat(list(printAttributes(e.pexp_attributes), ifDocs, elseDoc)) - } - | Pexp_while(expr1, expr2) => - let condition = printExpression(expr1) - Doc.breakableGroup( - ~forceBreak=true, - Doc.concat(list( - Doc.text("while "), - Doc.group(Doc.ifBreaks(addParens(condition), condition)), - Doc.space, - printExpressionBlock(~braces=true, expr2), - )), - ) - | Pexp_for(pattern, fromExpr, toExpr, directionFlag, body) => - Doc.breakableGroup( - ~forceBreak=true, - Doc.concat(list( - Doc.text("for "), - printPattern(pattern), - Doc.text(" in "), - printExpression(fromExpr), - printDirectionFlag(directionFlag), - printExpression(toExpr), - Doc.space, - printExpressionBlock(~braces=true, body), - )), - ) - | Pexp_constraint( - {pexp_desc: Pexp_pack(modExpr)}, - {ptyp_desc: Ptyp_package(packageType)}, - ) => - Doc.group( - Doc.concat(list( - Doc.text("module("), - Doc.indent( - Doc.concat(list( - Doc.softLine, - printModExpr(modExpr), - Doc.text(": "), - printPackageType(~printModuleKeywordAndParens=false, packageType), - )), - ), - Doc.softLine, - Doc.rparen, - )), - ) - | Pexp_constraint(expr, typ) => - Doc.concat(list(printExpression(expr), Doc.text(": "), printTypExpr(typ))) - | Pexp_letmodule({txt: modName}, modExpr, expr) => - printExpressionBlock(~braces=true, e) - | Pexp_letexception(extensionConstructor, expr) => - printExpressionBlock(~braces=true, e) - | Pexp_assert(expr) => - let rhs = { - let doc = printExpression(expr) - if Parens.lazyOrAssertExprRhs(expr) { - addParens(doc) - } else { - doc - } - } - - Doc.concat(list(Doc.text("assert "), rhs)) - | Pexp_lazy(expr) => - let rhs = { - let doc = printExpression(expr) - if Parens.lazyOrAssertExprRhs(expr) { - addParens(doc) - } else { - doc - } - } - - Doc.concat(list(Doc.text("lazy "), rhs)) - | Pexp_open(overrideFlag, longidentLoc, expr) => - printExpressionBlock(~braces=true, e) - | Pexp_pack(modExpr) => - Doc.group( - Doc.concat(list( - Doc.text("module("), - Doc.indent(Doc.concat(list(Doc.softLine, printModExpr(modExpr)))), - Doc.softLine, - Doc.rparen, - )), - ) - | Pexp_sequence(_) => printExpressionBlock(~braces=true, e) - | Pexp_let(_) => printExpressionBlock(~braces=true, e) - | Pexp_fun(_) | Pexp_newtype(_) => - let /attrsOnArrow, parameters, returnExpr/ = ParsetreeViewer.funExpr(e) - let /uncurried, attrs/ = ParsetreeViewer.processUncurriedAttribute( - attrsOnArrow, - ) - - let /returnExpr, typConstraint/ = switch returnExpr.pexp_desc { - | Pexp_constraint(expr, typ) => /expr, Some(typ)/ - | _ => /returnExpr, None/ - } - - let parametersDoc = printExprFunParameters( - ~inCallback=false, - ~uncurried, - parameters, - ) - let returnExprDoc = { - let shouldInline = switch returnExpr.pexp_desc { - | ((Pexp_array(_) | Pexp_tuple(_)) | Pexp_construct(_, Some(_))) - | Pexp_record(_) => - true - | _ => false - } - - let shouldIndent = switch returnExpr.pexp_desc { - | ((Pexp_sequence(_) | Pexp_let(_)) | Pexp_letmodule(_)) - | Pexp_letexception(_) => - false - | _ => true - } - - let returnDoc = printExpression(returnExpr) - if shouldInline { - Doc.concat(list(Doc.space, returnDoc)) - } else { - Doc.group( - if shouldIndent { - Doc.indent(Doc.concat(list(Doc.line, returnDoc))) - } else { - Doc.concat(list(Doc.space, returnDoc)) - }, - ) - } - } - - let typConstraintDoc = switch typConstraint { - | Some(typ) => Doc.concat(list(Doc.text(": "), printTypExpr(typ))) - | _ => Doc.nil - } - - let attrs = switch attrs { - | list() => Doc.nil - | attrs => - Doc.concat(list( - Doc.join(~sep=Doc.line, List.map(printAttribute, attrs)), - Doc.space, - )) - } - - Doc.group( - Doc.concat(list( - attrs, - parametersDoc, - typConstraintDoc, - Doc.text(" =>"), - returnExprDoc, - )), - ) - | Pexp_try(expr, cases) => - Doc.concat(list( - Doc.text("try "), - printExpression(expr), - Doc.text(" catch "), - printCases(cases), - )) - | Pexp_match(expr, cases) => - Doc.concat(list( - Doc.text("switch "), - printExpression(expr), - Doc.space, - printCases(cases), - )) - | _ => failwith("expression not yet implemented in printer") - } - - let shouldPrintItsOwnAttributes = switch e.pexp_desc { - | (((Pexp_apply(_) | Pexp_fun(_)) | Pexp_newtype(_)) | Pexp_setfield(_)) - | Pexp_ifthenelse(_) => - true - | Pexp_construct(_) - when ParsetreeViewer.hasJsxAttribute(e.pexp_attributes) => - true - | _ => false - } - - switch e.pexp_attributes { - | list() => printedExpression - | attrs when !shouldPrintItsOwnAttributes => - Doc.group(Doc.concat(list(printAttributes(attrs), printedExpression))) - | _ => printedExpression - } - } - - and printPexpFun = (~inCallback, e) => { - let /attrsOnArrow, parameters, returnExpr/ = ParsetreeViewer.funExpr(e) - let /uncurried, attrs/ = ParsetreeViewer.processUncurriedAttribute( - attrsOnArrow, - ) - - let /returnExpr, typConstraint/ = switch returnExpr.pexp_desc { - | Pexp_constraint(expr, typ) => /expr, Some(typ)/ - | _ => /returnExpr, None/ - } - - let parametersDoc = printExprFunParameters( - ~inCallback, - ~uncurried, - parameters, - ) - let returnShouldIndent = switch returnExpr.pexp_desc { - | ((Pexp_sequence(_) | Pexp_let(_)) | Pexp_letmodule(_)) - | Pexp_letexception(_) => - false - | _ => true - } - - let returnExprDoc = { - let shouldInline = switch returnExpr.pexp_desc { - | ((Pexp_array(_) | Pexp_tuple(_)) | Pexp_construct(_, Some(_))) - | Pexp_record(_) => - true - | _ => false - } - - let returnDoc = printExpression(returnExpr) - if shouldInline { - Doc.concat(list(Doc.space, returnDoc)) - } else { - Doc.group( - if returnShouldIndent { - Doc.concat(list( - Doc.indent(Doc.concat(list(Doc.line, returnDoc))), - if inCallback { - Doc.softLine - } else { - Doc.nil - }, - )) - } else { - Doc.concat(list(Doc.space, returnDoc)) - }, - ) - } - } - - let typConstraintDoc = switch typConstraint { - | Some(typ) => Doc.concat(list(Doc.text(": "), printTypExpr(typ))) - | _ => Doc.nil - } - - let attrs = switch attrs { - | list() => Doc.nil - | attrs => - Doc.concat(list( - Doc.join(~sep=Doc.line, List.map(printAttribute, attrs)), - Doc.space, - )) - } - - Doc.group( - Doc.concat(list( - attrs, - parametersDoc, - typConstraintDoc, - Doc.text(" =>"), - returnExprDoc, - )), - ) - } - - and printTernaryOperand = expr => { - let doc = printExpression(expr) - if Parens.ternaryOperand(expr) { - addParens(doc) - } else { - doc - } - } - - and printSetFieldExpr = (attrs, lhs, longidentLoc, rhs) => { - let rhsDoc = { - let doc = printExpression(rhs) - if Parens.setFieldExprRhs(rhs) { - addParens(doc) - } else { - doc - } - } - - let lhsDoc = { - let doc = printExpression(lhs) - if Parens.fieldExpr(lhs) { - addParens(doc) - } else { - doc - } - } - - let shouldIndent = ParsetreeViewer.isBinaryExpression(rhs) - let doc = Doc.concat(list( - lhsDoc, - Doc.dot, - printLongident(longidentLoc.txt), - Doc.text(" ="), - if shouldIndent { - Doc.group(Doc.indent(Doc.concat(list(Doc.line, rhsDoc)))) - } else { - Doc.concat(list(Doc.space, rhsDoc)) - }, - )) - switch attrs { - | list() => doc - | attrs => Doc.group(Doc.concat(list(printAttributes(attrs), doc))) - } - } - - and printUnaryExpression = expr => { - let printUnaryOperator = op => - Doc.text( - switch op { - | "~+" => "+" - | "~+." => "+." - | "~-" => "-" - | "~-." => "-." - | "not" => "!" - | "!" => "&" - | _ => assert false - }, - ) - switch expr.pexp_desc { - | Pexp_apply( - {pexp_desc: Pexp_ident({txt: Longident.Lident(operator)})}, - list(/Nolabel, operand/), - ) => - let printedOperand = { - let doc = printExpression(operand) - if Parens.unaryExprOperand(operand) { - addParens(doc) - } else { - doc - } - } - - Doc.concat(list(printUnaryOperator(operator), printedOperand)) - | _ => assert false - } - } - - and printBinaryExpression = (expr: Parsetree.expression) => { - let printBinaryOperator = (~inlineRhs, operator) => { - let operatorTxt = switch operator { - | "|." => "->" - | "^" => "++" - | "=" => "==" - | "==" => "===" - | "<>" => "!=" - | "!=" => "!==" - | txt => txt - } - - let spacingBeforeOperator = if operator == "|." { - Doc.softLine - } else if operator == "|>" { - Doc.line - } else { - Doc.space - } - - let spacingAfterOperator = if operator == "|." { - Doc.nil - } else if operator == "|>" { - Doc.space - } else if inlineRhs { - Doc.space - } else { - Doc.line - } - - Doc.concat(list( - spacingBeforeOperator, - Doc.text(operatorTxt), - spacingAfterOperator, - )) - } - - let printOperand = (~isLhs, expr, parentOperator) => { - let rec flatten = (~isLhs, expr, parentOperator) => - if ParsetreeViewer.isBinaryExpression(expr) { - switch expr { - | { - pexp_desc: - Pexp_apply( - {pexp_desc: Pexp_ident({txt: Longident.Lident(operator)})}, - list(/_, left/, /_, right/), - ), - } => - if ( - ParsetreeViewer.flattenableOperators(parentOperator, operator) && - !ParsetreeViewer.hasAttributes(expr.pexp_attributes) - ) { - let leftPrinted = flatten(~isLhs=true, left, operator) - let rightPrinted = { - let / - _, - rightAttrs - / = ParsetreeViewer.partitionPrinteableAttributes( - right.pexp_attributes, - ) - - let doc = printExpression({ - ...right, - pexp_attributes: rightAttrs, - }) - let doc = if Parens.flattenOperandRhs(parentOperator, right) { - Doc.concat(list(Doc.lparen, doc, Doc.rparen)) - } else { - doc - } - - let printeableAttrs = ParsetreeViewer.filterPrinteableAttributes( - right.pexp_attributes, - ) - - Doc.concat(list(printAttributes(printeableAttrs), doc)) - } - - Doc.concat(list( - leftPrinted, - printBinaryOperator(~inlineRhs=false, operator), - rightPrinted, - )) - } else { - let doc = printExpression({...expr, pexp_attributes: list()}) - let doc = if ( - Parens.subBinaryExprOperand(parentOperator, operator) || - ((expr.pexp_attributes != list()) && - (ParsetreeViewer.isBinaryExpression(expr) || - ParsetreeViewer.isTernaryExpr(expr))) - ) { - Doc.concat(list(Doc.lparen, doc, Doc.rparen)) - } else { - doc - } - Doc.concat(list(printAttributes(expr.pexp_attributes), doc)) - } - | _ => assert false - } - } else { - switch expr.pexp_desc { - | Pexp_setfield(lhs, field, rhs) => - let doc = printSetFieldExpr(expr.pexp_attributes, lhs, field, rhs) - if isLhs { - addParens(doc) - } else { - doc - } - | Pexp_apply( - {pexp_desc: Pexp_ident({txt: Longident.Lident("#=")})}, - list(/Nolabel, lhs/, /Nolabel, rhs/), - ) => - let rhsDoc = printExpression(rhs) - let lhsDoc = printExpression(lhs) - - let shouldIndent = ParsetreeViewer.isBinaryExpression(rhs) - let doc = Doc.group( - Doc.concat(list( - lhsDoc, - Doc.text(" ="), - if shouldIndent { - Doc.group(Doc.indent(Doc.concat(list(Doc.line, rhsDoc)))) - } else { - Doc.concat(list(Doc.space, rhsDoc)) - }, - )), - ) - let doc = switch expr.pexp_attributes { - | list() => doc - | attrs => Doc.group(Doc.concat(list(printAttributes(attrs), doc))) - } - - if isLhs { - addParens(doc) - } else { - doc - } - | _ => - let doc = printExpression(expr) - if Parens.binaryExprOperand(~isLhs, expr, parentOperator) { - addParens(doc) - } else { - doc - } - } - } - - flatten(~isLhs, expr, parentOperator) - } - - switch expr.pexp_desc { - | Pexp_apply( - {pexp_desc: Pexp_ident({txt: Longident.Lident(("|." | "|>") as op)})}, - list(/Nolabel, lhs/, /Nolabel, rhs/), - ) - when !( - ParsetreeViewer.isBinaryExpression(lhs) || - ParsetreeViewer.isBinaryExpression(rhs) - ) => - let lhsDoc = printOperand(~isLhs=true, lhs, op) - let rhsDoc = printOperand(~isLhs=false, rhs, op) - Doc.concat(list( - lhsDoc, - switch op { - | "|." => Doc.text("->") - | "|>" => Doc.text(" |> ") - | _ => assert false - }, - rhsDoc, - )) - | Pexp_apply( - {pexp_desc: Pexp_ident({txt: Longident.Lident(operator)})}, - list(/Nolabel, lhs/, /Nolabel, rhs/), - ) => - let right = { - let operatorWithRhs = Doc.concat(list( - printBinaryOperator( - ~inlineRhs=ParsetreeViewer.shouldInlineRhsBinaryExpr(rhs), - operator, - ), - printOperand(~isLhs=false, rhs, operator), - )) - if ParsetreeViewer.shouldIndentBinaryExpr(expr) { - Doc.group(Doc.indent(operatorWithRhs)) - } else { - operatorWithRhs - } - } - - let doc = Doc.group( - Doc.concat(list(printOperand(~isLhs=true, lhs, operator), right)), - ) - Doc.concat(list( - printAttributes(expr.pexp_attributes), - if Parens.binaryExpr(expr) { - addParens(doc) - } else { - doc - }, - )) - | _ => Doc.nil - } - } - - and printPexpApply = expr => - switch expr.pexp_desc { - | Pexp_apply( - {pexp_desc: Pexp_ident({txt: Longident.Lident("##")})}, - list(/Nolabel, parentExpr/, /Nolabel, memberExpr/), - ) => - let member = { - let memberDoc = printExpression(memberExpr) - Doc.concat(list(Doc.text("\""), memberDoc, Doc.text("\""))) - } - - Doc.group( - Doc.concat(list( - printAttributes(expr.pexp_attributes), - printExpression(parentExpr), - Doc.lbracket, - member, - Doc.rbracket, - )), - ) - | Pexp_apply( - {pexp_desc: Pexp_ident({txt: Longident.Lident("#=")})}, - list(/Nolabel, lhs/, /Nolabel, rhs/), - ) => - let rhsDoc = printExpression(rhs) - - let shouldIndent = ParsetreeViewer.isBinaryExpression(rhs) - let doc = Doc.group( - Doc.concat(list( - printExpression(lhs), - Doc.text(" ="), - if shouldIndent { - Doc.group(Doc.indent(Doc.concat(list(Doc.line, rhsDoc)))) - } else { - Doc.concat(list(Doc.space, rhsDoc)) - }, - )), - ) - switch expr.pexp_attributes { - | list() => doc - | attrs => Doc.group(Doc.concat(list(printAttributes(attrs), doc))) - } - | Pexp_apply( - {pexp_desc: Pexp_ident({txt: Longident.Ldot(Lident("Array"), "get")})}, - list(/Nolabel, parentExpr/, /Nolabel, memberExpr/), - ) => - let member = { - let memberDoc = printExpression(memberExpr) - let shouldInline = switch memberExpr.pexp_desc { - | Pexp_constant(_) | Pexp_ident(_) => true - | _ => false - } - - if shouldInline { - memberDoc - } else { - Doc.concat(list( - Doc.indent(Doc.concat(list(Doc.softLine, memberDoc))), - Doc.softLine, - )) - } - } - - Doc.group( - Doc.concat(list( - printAttributes(expr.pexp_attributes), - printExpression(parentExpr), - Doc.lbracket, - member, - Doc.rbracket, - )), - ) - | Pexp_apply({pexp_desc: Pexp_ident({txt: lident})}, args) - when ParsetreeViewer.isJsxExpression(expr) => - printJsxExpression(lident, args) - | Pexp_apply(callExpr, args) => - let /uncurried, attrs/ = ParsetreeViewer.processUncurriedAttribute( - expr.pexp_attributes, - ) - - let callExprDoc = printExpression(callExpr) - if ParsetreeViewer.requiresSpecialCallbackPrinting(args) { - let argsDoc = printArgumentsWithCallback(~uncurried, args) - Doc.concat(list(printAttributes(attrs), callExprDoc, argsDoc)) - } else { - let argsDoc = printArguments(~uncurried, args) - Doc.concat(list(printAttributes(attrs), callExprDoc, argsDoc)) - } - | _ => assert false - } - - and printJsxExpression = (lident, args) => { - let name = printJsxName(lident) - let /formattedProps, children/ = formatJsxProps(args) - - let isSelfClosing = switch children { - | list() => true - | _ => false - } - Doc.group( - Doc.concat(list( - Doc.group( - Doc.concat(list( - Doc.lessThan, - name, - formattedProps, - if isSelfClosing { - Doc.concat(list(Doc.line, Doc.text("/>"))) - } else { - Doc.nil - }, - )), - ), - if isSelfClosing { - Doc.nil - } else { - Doc.concat(list( - Doc.greaterThan, - Doc.indent(Doc.concat(list(Doc.line, printJsxChildren(children)))), - Doc.line, - Doc.text(" { - let opening = Doc.text("<>") - let closing = Doc.text("") - let /children, _/ = ParsetreeViewer.collectListExpressions(expr) - Doc.group( - Doc.concat(list( - opening, - switch children { - | list() => Doc.nil - | children => - Doc.indent(Doc.concat(list(Doc.line, printJsxChildren(children)))) - }, - Doc.line, - closing, - )), - ) - } - - and printJsxChildren = (children: list) => - Doc.group( - Doc.join( - ~sep=Doc.line, - List.map( - expr => { - let exprDoc = printExpression(expr) - if Parens.jsxChildExpr(expr) { - addBraces(exprDoc) - } else { - exprDoc - } - }, - children, - ), - ), - ) - - and formatJsxProps = args => { - let rec loop = (props, args) => - switch args { - | list() => /Doc.nil, list()/ - | list( - /Asttypes.Labelled("children"), children/, - / - Asttypes.Nolabel, - { - Parsetree.pexp_desc: - Pexp_construct({txt: Longident.Lident("()")}, None), - } - /, - ) => - let formattedProps = Doc.indent( - switch props { - | list() => Doc.nil - | props => - Doc.concat(list( - Doc.line, - Doc.group(Doc.join(~sep=Doc.line, props |> List.rev)), - )) - }, - ) - let /children, _/ = ParsetreeViewer.collectListExpressions(children) - /formattedProps, children/ - | list(arg, ...args) => - let propDoc = formatJsxProp(arg) - loop(list(propDoc, ...props), args) - } - - loop(list(), args) - } - - and formatJsxProp = arg => - switch arg { - | / - (Asttypes.Labelled(lblTxt) | Optional(lblTxt)) as lbl, - { - Parsetree.pexp_attributes: list(), - pexp_desc: Pexp_ident({txt: Longident.Lident(ident)}), - } - / when lblTxt == ident => - switch lbl { - | Nolabel => Doc.nil - | Labelled(lbl) => Doc.text(lbl) - | Optional(lbl) => Doc.text("?" ++ lbl) - } - | /lbl, expr/ => - let lblDoc = switch lbl { - | Asttypes.Labelled(lbl) => Doc.text(lbl ++ "=") - | Asttypes.Optional(lbl) => Doc.text(lbl ++ "=?") - | Nolabel => Doc.nil - } - - let exprDoc = printExpression(expr) - Doc.concat(list( - lblDoc, - if Parens.jsxPropExpr(expr) { - addBraces(exprDoc) - } else { - exprDoc - }, - )) - } - - and printJsxName = lident => { - let rec flatten = (acc, lident) => - switch lident { - | Longident.Lident(txt) => list(txt, ...acc) - | Ldot(lident, txt) => - let acc = if txt == "create_element" { - acc - } else { - list(txt, ...acc) - } - flatten(acc, lident) - | _ => acc - } - - switch lident { - | Longident.Lident(txt) => Doc.text(txt) - | _ as lident => - let segments = flatten(list(), lident) - Doc.join(~sep=Doc.dot, List.map(Doc.text, segments)) - } - } - - and printArgumentsWithCallback = (~uncurried, args) => { - let rec loop = (acc, args) => - switch args { - | list() => /Doc.nil, Doc.nil/ - | list(/_lbl, expr/) => - let callback = printPexpFun(~inCallback=true, expr) - /Doc.concat(List.rev(acc)), callback/ - | list(arg, ...args) => - let argDoc = printArgument(arg) - loop(list(Doc.line, Doc.comma, argDoc, ...acc), args) - } - - let /printedArgs, callback/ = loop(list(), args) - - let fitsOnOneLine = Doc.concat(list( - if uncurried { - Doc.text("(.") - } else { - Doc.lparen - }, - Doc.concat(list(printedArgs, callback)), - Doc.rparen, - )) - - let arugmentsFitOnOneLine = Doc.concat(list( - if uncurried { - Doc.text("(.") - } else { - Doc.lparen - }, - Doc.concat(list( - Doc.softLine, - printedArgs, - Doc.breakableGroup(~forceBreak=true, callback), - )), - Doc.softLine, - Doc.rparen, - )) - - let breakAllArgs = printArguments(~uncurried, args) - Doc.customLayout(list(fitsOnOneLine, arugmentsFitOnOneLine, breakAllArgs)) - } - - and printArguments = ( - ~uncurried, - args: list, - ) => - switch args { - | list(/ - Nolabel, - {pexp_desc: Pexp_construct({txt: Longident.Lident("()")}, _)} - /) => - if uncurried { - Doc.text("(.)") - } else { - Doc.text("()") - } - | list(/Nolabel, arg/) when ParsetreeViewer.isHuggableExpression(arg) => - Doc.concat(list( - if uncurried { - Doc.text("(.") - } else { - Doc.lparen - }, - printExpression(arg), - Doc.rparen, - )) - | args => - Doc.group( - Doc.concat(list( - if uncurried { - Doc.text("(.") - } else { - Doc.lparen - }, - Doc.indent( - Doc.concat(list( - if uncurried { - Doc.line - } else { - Doc.softLine - }, - Doc.join( - ~sep=Doc.concat(list(Doc.comma, Doc.line)), - List.map(printArgument, args), - ), - )), - ), - Doc.trailingComma, - Doc.softLine, - Doc.rparen, - )), - ) - } - - and printArgument = ( - /argLbl, arg/: /Asttypes.arg_label, Parsetree.expression/, - ) => - switch /argLbl, arg/ { - | / - Asttypes.Labelled(lbl), - {pexp_desc: Pexp_ident({txt: Longident.Lident(name)})} - / when lbl == name => - Doc.text("~" ++ lbl) - | / - Asttypes.Optional(lbl), - {pexp_desc: Pexp_ident({txt: Longident.Lident(name)})} - / when lbl == name => - Doc.text("~" ++ lbl ++ "?") - | /lbl, expr/ => - let printedLbl = switch argLbl { - | Asttypes.Nolabel => Doc.nil - | Asttypes.Labelled(lbl) => Doc.text("~" ++ lbl ++ "=") - | Asttypes.Optional(lbl) => Doc.text("~" ++ lbl ++ "=?") - } - - let printedExpr = printExpression(expr) - Doc.concat(list(printedLbl, printedExpr)) - } - - and printCases = (cases: list) => - Doc.breakableGroup( - ~forceBreak=true, - Doc.concat(list( - Doc.lbrace, - Doc.concat(list( - Doc.line, - Doc.join(~sep=Doc.line, List.map(printCase, cases)), - )), - Doc.line, - Doc.rbrace, - )), - ) - - and printCase = (case: Parsetree.case) => { - let rhs = switch case.pc_rhs.pexp_desc { - | (((Pexp_let(_) | Pexp_letmodule(_)) | Pexp_letexception(_)) - | Pexp_open(_)) - | Pexp_sequence(_) => - printExpressionBlock(~braces=false, case.pc_rhs) - | _ => printExpression(case.pc_rhs) - } - - let guard = switch case.pc_guard { - | None => Doc.nil - | Some(expr) => - Doc.group( - Doc.concat(list(Doc.line, Doc.text("when "), printExpression(expr))), - ) - } - - Doc.group( - Doc.concat(list( - Doc.text("| "), - Doc.indent( - Doc.concat(list( - printPattern(case.pc_lhs), - guard, - Doc.text(" =>"), - Doc.line, - rhs, - )), - ), - )), - ) - } - - and printExprFunParameters = (~inCallback, ~uncurried, parameters) => - switch parameters { - | list(/list(), Asttypes.Nolabel, None, {Parsetree.ppat_desc: Ppat_any}/) - when !uncurried => - Doc.text("_") - | list(/ - list(), - Asttypes.Nolabel, - None, - {Parsetree.ppat_desc: Ppat_var(stringLoc)} - /) when !uncurried => - Doc.text(stringLoc.txt) - | list(/ - list(), - Nolabel, - None, - {ppat_desc: Ppat_construct({txt: Longident.Lident("()")}, None)} - /) when !uncurried => - Doc.text("()") - | parameters => - let lparen = if uncurried { - Doc.text("(. ") - } else { - Doc.lparen - } - let shouldHug = ParsetreeViewer.parametersShouldHug(parameters) - let printedParamaters = Doc.concat(list( - if shouldHug || inCallback { - Doc.nil - } else { - Doc.softLine - }, - Doc.join( - ~sep=Doc.concat(list( - Doc.comma, - if inCallback { - Doc.space - } else { - Doc.line - }, - )), - List.map(printExpFunParameter, parameters), - ), - )) - Doc.group( - Doc.concat(list( - lparen, - if shouldHug || inCallback { - printedParamaters - } else { - Doc.indent(printedParamaters) - }, - if shouldHug || inCallback { - Doc.nil - } else { - Doc.concat(list(Doc.trailingComma, Doc.softLine)) - }, - Doc.rparen, - )), - ) - } - - and printExpFunParameter = (/attrs, lbl, defaultExpr, pattern/) => { - let /isUncurried, attrs/ = ParsetreeViewer.processUncurriedAttribute(attrs) - let uncurried = if isUncurried { - Doc.concat(list(Doc.dot, Doc.space)) - } else { - Doc.nil - } - let attrs = switch attrs { - | list() => Doc.nil - | attrs => - Doc.concat(list( - Doc.join(~sep=Doc.line, List.map(printAttribute, attrs)), - Doc.line, - )) - } - - let defaultExprDoc = switch defaultExpr { - | Some(expr) => Doc.concat(list(Doc.text("="), printExpression(expr))) - | None => Doc.nil - } - - let labelWithPattern = switch /lbl, pattern/ { - | /Asttypes.Nolabel, pattern/ => printPattern(pattern) - | /Asttypes.Labelled(lbl) | Optional(lbl), {ppat_desc: Ppat_var(stringLoc)}/ - when lbl == stringLoc.txt => - Doc.concat(list(Doc.text("~"), Doc.text(lbl))) - | /Asttypes.Labelled(lbl) | Optional(lbl), pattern/ => - Doc.concat(list( - Doc.text("~"), - Doc.text(lbl), - Doc.text(" as "), - printPattern(pattern), - )) - } - - let optionalLabelSuffix = switch /lbl, defaultExpr/ { - | /Asttypes.Optional(_), None/ => Doc.text("=?") - | _ => Doc.nil - } - - Doc.group( - Doc.concat(list( - uncurried, - attrs, - labelWithPattern, - defaultExprDoc, - optionalLabelSuffix, - )), - ) - } - - and printExpressionBlock = (~braces, expr) => { - let rec collectRows = (acc, expr) => - switch expr.Parsetree.pexp_desc { - | Parsetree.Pexp_letmodule({txt: modName, loc: modLoc}, modExpr, expr) => - let letModuleDoc = Doc.concat(list( - Doc.text("module "), - Doc.text(modName), - Doc.text(" = "), - printModExpr(modExpr), - )) - let loc = {...modLoc, loc_end: modExpr.pmod_loc.loc_end} - collectRows(list(/loc, letModuleDoc/, ...acc), expr) - | Pexp_letexception(extensionConstructor, expr) => - let letExceptionDoc = printExceptionDef(extensionConstructor) - let loc = extensionConstructor.pext_loc - collectRows(list(/loc, letExceptionDoc/, ...acc), expr) - | Pexp_open(overrideFlag, longidentLoc, expr) => - let openDoc = Doc.concat(list( - Doc.text("open"), - printOverrideFlag(overrideFlag), - Doc.space, - printLongident(longidentLoc.txt), - )) - let loc = longidentLoc.loc - collectRows(list(/loc, openDoc/, ...acc), expr) - | Pexp_sequence(expr1, expr2) => - let exprDoc = { - let doc = printExpression(expr1) - if Parens.blockExpr(expr1) { - addParens(doc) - } else { - doc - } - } - - let loc = expr1.pexp_loc - collectRows(list(/loc, exprDoc/, ...acc), expr2) - | Pexp_let(recFlag, valueBindings, expr) => - let recFlag = switch recFlag { - | Asttypes.Nonrecursive => Doc.nil - | Asttypes.Recursive => Doc.text("rec ") - } - - let letDoc = printValueBindings(~recFlag, valueBindings) - let loc = switch /valueBindings, List.rev(valueBindings)/ { - | /list({pvb_loc: firstLoc}, ..._), list({pvb_loc: lastLoc}, ..._)/ => - {...firstLoc, loc_end: lastLoc.loc_end} - | _ => Location.none - } - - collectRows(list(/loc, letDoc/, ...acc), expr) - | _ => - let exprDoc = { - let doc = printExpression(expr) - if Parens.blockExpr(expr) { - addParens(doc) - } else { - doc - } - } - - List.rev(list(/expr.pexp_loc, exprDoc/, ...acc)) - } - - let block = - collectRows(list(), expr) |> interleaveWhitespace(~forceBreak=true) - Doc.breakableGroup( - ~forceBreak=true, - if braces { - Doc.concat(list( - Doc.lbrace, - Doc.indent(Doc.concat(list(Doc.line, block))), - Doc.line, - Doc.rbrace, - )) - } else { - block - }, - ) - } - - and printOverrideFlag = overrideFlag => - switch overrideFlag { - | Asttypes.Override => Doc.text("!") - | Fresh => Doc.nil - } - - and printDirectionFlag = flag => - switch flag { - | Asttypes.Downto => Doc.text(" downto ") - | Asttypes.Upto => Doc.text(" to ") - } - - and printRecordRow = (/lbl, expr/) => - Doc.concat(list( - printLongident(lbl.txt), - Doc.text(": "), - printExpression(expr), - )) - - and printBsObjectRow = (/lbl, expr/) => - Doc.concat(list( - Doc.text("\""), - printLongident(lbl.txt), - Doc.text("\""), - Doc.text(": "), - printExpression(expr), - )) - - and printAttributes = (~loc=?, attrs: Parsetree.attributes) => - switch attrs { - | list() => Doc.nil - | attrs => - let lineBreak = switch loc { - | None => Doc.line - | Some(loc) => - switch List.rev(attrs) { - | list(/{loc: firstLoc}, _/, ..._) - when loc.loc_start.pos_lnum > firstLoc.loc_end.pos_lnum => - Doc.literalLine - | _ => Doc.line - } - } - - Doc.concat(list( - Doc.group(Doc.join(~sep=Doc.line, List.map(printAttribute, attrs))), - lineBreak, - )) - } - - and printAttribute = (/id, payload/: Parsetree.attribute) => { - let attrName = Doc.text("@" ++ id.txt) - switch payload { - | PStr(list({pstr_desc: Pstr_eval(expr, attrs)})) => - let exprDoc = printExpression(expr) - let needsParens = switch attrs { - | list() => false - | _ => true - } - Doc.group( - Doc.concat(list( - attrName, - addParens( - Doc.concat(list( - printAttributes(attrs), - if needsParens { - addParens(exprDoc) - } else { - exprDoc - }, - )), - ), - )), - ) - | _ => attrName - } - } - - and printModExpr = modExpr => - switch modExpr.pmod_desc { - | Pmod_ident(longidentLoc) => printLongident(longidentLoc.txt) - | Pmod_structure(structure) => - Doc.breakableGroup( - ~forceBreak=true, - Doc.concat(list( - Doc.lbrace, - Doc.indent(Doc.concat(list(Doc.softLine, printStructure(structure)))), - Doc.softLine, - Doc.rbrace, - )), - ) - | Pmod_unpack(expr) => - let shouldHug = switch expr.pexp_desc { - | Pexp_let(_) => true - | Pexp_constraint( - {pexp_desc: Pexp_let(_)}, - {ptyp_desc: Ptyp_package(packageType)}, - ) => - true - | _ => false - } - - let /expr, moduleConstraint/ = switch expr.pexp_desc { - | Pexp_constraint(expr, {ptyp_desc: Ptyp_package(packageType)}) => - let typeDoc = Doc.group( - Doc.concat(list( - Doc.text(":"), - Doc.indent( - Doc.concat(list( - Doc.line, - printPackageType( - ~printModuleKeywordAndParens=false, - packageType, - ), - )), - ), - )), - ) - /expr, typeDoc/ - | _ => /expr, Doc.nil/ - } - - let unpackDoc = Doc.group( - Doc.concat(list(printExpression(expr), moduleConstraint)), - ) - Doc.group( - Doc.concat(list( - Doc.text("unpack("), - if shouldHug { - unpackDoc - } else { - Doc.concat(list( - Doc.indent(Doc.concat(list(Doc.softLine, unpackDoc))), - Doc.softLine, - )) - }, - Doc.rparen, - )), - ) - | Pmod_extension(extension) => printExtension(extension) - | Pmod_apply(_) => - let /args, callExpr/ = ParsetreeViewer.modExprApply(modExpr) - let isUnitSugar = switch args { - | list({pmod_desc: Pmod_structure(list())}) => true - | _ => false - } - - let shouldHug = switch args { - | list({pmod_desc: Pmod_structure(_)}) => true - | _ => false - } - - Doc.group( - Doc.concat(list( - printModExpr(callExpr), - if isUnitSugar { - printModApplyArg(List.hd(args)) - } else { - Doc.concat(list( - Doc.lparen, - if shouldHug { - printModApplyArg(List.hd(args)) - } else { - Doc.indent( - Doc.concat(list( - Doc.softLine, - Doc.join( - ~sep=Doc.concat(list(Doc.comma, Doc.line)), - List.map(printModApplyArg, args), - ), - )), - ) - }, - if !shouldHug { - Doc.concat(list(Doc.trailingComma, Doc.softLine)) - } else { - Doc.nil - }, - Doc.rparen, - )) - }, - )), - ) - | Pmod_constraint(modExpr, modType) => - Doc.concat(list( - printModExpr(modExpr), - Doc.text(": "), - printModType(modType), - )) - | Pmod_functor(_) => printModFunctor(modExpr) - } - - and printModFunctor = modExpr => { - let /parameters, returnModExpr/ = ParsetreeViewer.modExprFunctor(modExpr) - - let /returnConstraint, returnModExpr/ = switch returnModExpr.pmod_desc { - | Pmod_constraint(modExpr, modType) => - let constraintDoc = { - let doc = printModType(modType) - if Parens.modExprFunctorConstraint(modType) { - addParens(doc) - } else { - doc - } - } - - let modConstraint = Doc.concat(list(Doc.text(": "), constraintDoc)) - /modConstraint, printModExpr(modExpr)/ - | _ => /Doc.nil, printModExpr(returnModExpr)/ - } - - let parametersDoc = switch parameters { - | list(/attrs, {txt: "*"}, None/) => - let attrs = switch attrs { - | list() => Doc.nil - | attrs => - Doc.concat(list( - Doc.join(~sep=Doc.line, List.map(printAttribute, attrs)), - Doc.line, - )) - } - Doc.group(Doc.concat(list(attrs, Doc.text("()")))) - | list(/list(), {txt: lbl}, None/) => Doc.text(lbl) - | parameters => - Doc.group( - Doc.concat(list( - Doc.lparen, - Doc.indent( - Doc.concat(list( - Doc.softLine, - Doc.join( - ~sep=Doc.concat(list(Doc.comma, Doc.line)), - List.map(printModFunctorParam, parameters), - ), - )), - ), - Doc.trailingComma, - Doc.softLine, - Doc.rparen, - )), - ) - } - - Doc.group( - Doc.concat(list( - parametersDoc, - returnConstraint, - Doc.text(" => "), - returnModExpr, - )), - ) - } - - and printModFunctorParam = (/attrs, lbl, optModType/) => { - let attrs = switch attrs { - | list() => Doc.nil - | attrs => - Doc.concat(list( - Doc.join(~sep=Doc.line, List.map(printAttribute, attrs)), - Doc.line, - )) - } - Doc.group( - Doc.concat(list( - attrs, - Doc.text(lbl.txt), - switch optModType { - | None => Doc.nil - | Some(modType) => - Doc.concat(list(Doc.text(": "), printModType(modType))) - }, - )), - ) - } - - and printModApplyArg = modExpr => - switch modExpr.pmod_desc { - | Pmod_structure(list()) => Doc.text("()") - | _ => printModExpr(modExpr) - } - - and printExceptionDef = (constr: Parsetree.extension_constructor) => { - let kind = switch constr.pext_kind { - | Pext_rebind({txt: longident}) => - Doc.indent( - Doc.concat(list(Doc.text(" ="), Doc.line, printLongident(longident))), - ) - | Pext_decl(Pcstr_tuple(list()), None) => Doc.nil - | Pext_decl(args, gadt) => - let gadtDoc = switch gadt { - | Some(typ) => Doc.concat(list(Doc.text(": "), printTypExpr(typ))) - | None => Doc.nil - } - - Doc.concat(list(printConstructorArguments(args), gadtDoc)) - } - - Doc.group( - Doc.concat(list( - printAttributes(constr.pext_attributes), - Doc.text("exception "), - Doc.text(constr.pext_name.txt), - kind, - )), - ) - } - - and printExtensionConstructor = ( - i, - constr: Parsetree.extension_constructor, - ) => { - let attrs = printAttributes(constr.pext_attributes) - let bar = if i > 0 { - Doc.text("| ") - } else { - Doc.ifBreaks(Doc.text("| "), Doc.nil) - } - - let kind = switch constr.pext_kind { - | Pext_rebind({txt: longident}) => - Doc.indent( - Doc.concat(list(Doc.text(" ="), Doc.line, printLongident(longident))), - ) - | Pext_decl(Pcstr_tuple(list()), None) => Doc.nil - | Pext_decl(args, gadt) => - let gadtDoc = switch gadt { - | Some(typ) => Doc.concat(list(Doc.text(": "), printTypExpr(typ))) - | None => Doc.nil - } - - Doc.concat(list(printConstructorArguments(args), gadtDoc)) - } - - Doc.concat(list( - bar, - Doc.group(Doc.concat(list(attrs, Doc.text(constr.pext_name.txt), kind))), - )) - } - - let printImplementation = (s: Parsetree.structure, comments, src) => { - let t = CommentAst.initStructure(s, comments) - - let stringDoc = Doc.toString(~width=80, printStructure(s)) - print_endline(stringDoc) - print_newline() - } - - let printInterface = (s: Parsetree.signature) => { - let stringDoc = Doc.toString(~width=80, printSignature(s)) - print_endline(stringDoc) - print_newline() - } -} - - - diff --git a/jscomp/syntax/benchmarks/data/PrinterOcaml.ml b/jscomp/syntax/benchmarks/data/PrinterOcaml.ml deleted file mode 100644 index 9e3f5041cb..0000000000 --- a/jscomp/syntax/benchmarks/data/PrinterOcaml.ml +++ /dev/null @@ -1,3228 +0,0 @@ -module Printer = struct - type printer = { - src: bytes; - comments: CommentAst.t; - } - - - (* TODO: should this go inside a ast utility module? *) - let rec collect_patterns_from_list_construct acc pattern = - let open Parsetree in - match pattern.ppat_desc with - | Ppat_construct( - {txt = Longident.Lident "::"}, - Some {ppat_desc=Ppat_tuple (pat::rest::[])} - ) -> - collect_patterns_from_list_construct (pat::acc) rest - | _ -> List.rev acc, pattern - - let add_parens doc = - Doc.group ( - Doc.concat [ - Doc.lparen; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - doc - ] - ); - Doc.soft_line; - Doc.rparen; - ] - ) - - let add_braces doc = - Doc.group ( - Doc.concat [ - Doc.lbrace; - doc; - Doc.rbrace; - ] - ) - - (* This could be done in one pass by collecting locations as we go? *) - let interleave_whitespace ?(force_break=false) (rows: (Location.t * Doc.t) list) = - let rec loop prev_loc acc rows = - match rows with - | [] -> Doc.concat (List.rev acc) - | (loc, doc)::rest -> - if loc.Location.loc_start.pos_lnum - prev_loc.Location.loc_end.pos_lnum > 1 then - loop loc (doc::Doc.line::Doc.line::acc) rest - else - loop loc (doc::Doc.line::acc) rest - in - match rows with - | [] -> Doc.nil - | (first_loc, first_doc)::rest -> - (* TODO: perf, reversing the list twice! *) - let force_break = force_break || (match List.rev rest with - | (last_loc, _)::_ -> - first_loc.loc_start.pos_lnum != last_loc.loc_end.pos_lnum - | _ -> false) - in - Doc.breakable_group ~force_break ( - loop first_loc [first_doc] rest - ) - - let print_longident l = match l with - | Longident.Lident lident -> Doc.text lident - | Longident.Ldot (lident, txt) as l -> - let txts = Longident.flatten l in - Doc.join ~sep:Doc.dot (List.map Doc.text txts) - | _ -> failwith "unsupported ident" - - (* TODO: better allocation strategy for the buffer *) - let escape_string_contents s = - let len = String.length s in - let b = Buffer.create len in - for i = 0 to len - 1 do - let c = String.get s i in - if c = '\008' then ( - Buffer.add_char b '\\'; - Buffer.add_char b 'b'; - ) else if c = '\009' then ( - Buffer.add_char b '\\'; - Buffer.add_char b 't'; - ) else if c = '\010' then ( - Buffer.add_char b '\\'; - Buffer.add_char b 'n'; - ) else if c = '\013' then ( - Buffer.add_char b '\\'; - Buffer.add_char b 'r'; - ) else if c = '\034' then ( - Buffer.add_char b '\\'; - Buffer.add_char b '"'; - ) else if c = '\092' then ( - Buffer.add_char b '\\'; - Buffer.add_char b '\\'; - )else ( - Buffer.add_char b c; - ); - done; - Buffer.contents b - - let print_constant c = match c with - | Parsetree.Pconst_integer (s, _) -> Doc.text s - | Pconst_string (s, _) -> Doc.text ("\"" ^ (escape_string_contents s) ^ "\"") - | Pconst_float (s, _) -> Doc.text s - | Pconst_char c -> Doc.text ("'" ^ (Char.escaped c) ^ "'") - - let rec print_structure (s : Parsetree.structure) = - interleave_whitespace ( - List.map (fun si -> (si.Parsetree.pstr_loc, print_structure_item si)) s - ) - - and print_structure_item (si: Parsetree.structure_item) = - match si.pstr_desc with - | Pstr_value(rec_flag, value_bindings) -> - let rec_flag = match rec_flag with - | Asttypes.Nonrecursive -> Doc.nil - | Asttypes.Recursive -> Doc.text "rec " - in - print_value_bindings ~rec_flag value_bindings - | Pstr_type(rec_flag, type_declarations) -> - let rec_flag = match rec_flag with - | Asttypes.Nonrecursive -> Doc.nil - | Asttypes.Recursive -> Doc.text "rec " - in - print_type_declarations ~rec_flag type_declarations - | Pstr_primitive value_description -> - print_value_description value_description - | Pstr_eval (expr, attrs) -> - let needs_parens = match expr with - | {pexp_attributes=[({txt="res.ternary"},_)]; pexp_desc = Pexp_ifthenelse _} -> false - | _ when ParsetreeViewer.has_attributes expr.pexp_attributes -> true - | _ -> false - in - let expr_doc = - let doc = print_expression expr in - if needs_parens then add_parens doc else doc - in - Doc.concat [ - print_attributes attrs; - expr_doc; - ] - | Pstr_attribute attr -> Doc.concat [Doc.text "@"; print_attribute attr] - | Pstr_extension (extension, attrs) -> Doc.concat [ - print_attributes attrs; - Doc.concat [Doc.text "%";print_extension extension]; - ] - | Pstr_include include_declaration -> - print_include_declaration include_declaration - | Pstr_open open_description -> - print_open_description open_description - | Pstr_modtype mod_type_decl -> - print_module_type_declaration mod_type_decl - | Pstr_module module_binding -> - print_module_binding ~is_rec:false 0 module_binding - | Pstr_recmodule module_bindings -> - Doc.join ~sep:Doc.line (List.mapi (fun i mb -> - print_module_binding ~is_rec:true i mb - ) module_bindings) - | Pstr_exception extension_constructor -> - print_exception_def extension_constructor; - | Pstr_typext type_extension -> - print_type_extension type_extension - | Pstr_class _ | Pstr_class_type _ -> Doc.nil - - and print_type_extension (te : Parsetree.type_extension) = - let prefix = Doc.text "type " in - let name = print_longident te.ptyext_path.txt in - let type_params = match te.ptyext_params with - | [] -> Doc.nil - | type_params -> Doc.group ( - Doc.concat [ - Doc.less_than; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) ( - List.map print_type_param type_params - ) - ] - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.greater_than; - ] - ) - in - let extension_constructors = - let ecs = te.ptyext_constructors in - let force_break = - match (ecs, List.rev ecs) with - | (first::_, last::_) -> - first.pext_loc.loc_start.pos_lnum > te.ptyext_path.loc.loc_end.pos_lnum || - first.pext_loc.loc_start.pos_lnum < last.pext_loc.loc_end.pos_lnum - | _ -> false - in - let private_flag = match te.ptyext_private with - | Asttypes.Private -> Doc.concat [ - Doc.text "private"; - Doc.line; - ] - | Public -> Doc.nil - in - Doc.breakable_group ~force_break ( - Doc.indent ( - Doc.concat [ - Doc.line; - private_flag; - Doc.join ~sep:Doc.line ( - List.mapi print_extension_constructor ecs - ) - ] - ) - ) - in - Doc.group ( - Doc.concat [ - print_attributes ~loc: te.ptyext_path.loc te.ptyext_attributes; - prefix; - name; - type_params; - Doc.text " +="; - extension_constructors; - ] - ) - - and print_module_binding ~is_rec i module_binding = - let prefix = if i = 0 then - Doc.concat [ - Doc.text "module "; - if is_rec then Doc.text "rec " else Doc.nil; - ] - else - Doc.text "and " - in - let (mod_expr_doc, mod_constraint_doc) = - match module_binding.pmb_expr with - | {pmod_desc = Pmod_constraint (mod_expr, mod_type)} -> - ( - print_mod_expr mod_expr, - Doc.concat [ - Doc.text ": "; - print_mod_type mod_type - ] - ) - | mod_expr -> - (print_mod_expr mod_expr, Doc.nil) - in - Doc.concat [ - print_attributes ~loc:module_binding.pmb_name.loc module_binding.pmb_attributes; - prefix; - Doc.text module_binding.pmb_name.Location.txt; - mod_constraint_doc; - Doc.text " = "; - mod_expr_doc; - ] - - and print_module_type_declaration (mod_type_decl : Parsetree.module_type_declaration) = - Doc.concat [ - print_attributes mod_type_decl.pmtd_attributes; - Doc.text "module type "; - Doc.text mod_type_decl.pmtd_name.txt; - (match mod_type_decl.pmtd_type with - | None -> Doc.nil - | Some mod_type -> Doc.concat [ - Doc.text " = "; - print_mod_type mod_type; - ]); - ] - - and print_mod_type mod_type = - let mod_type_doc = match mod_type.pmty_desc with - | Parsetree.Pmty_ident {txt = longident; loc} -> - Doc.concat [ - print_attributes ~loc mod_type.pmty_attributes; - print_longident longident - ] - | Pmty_signature signature -> - let signature_doc = Doc.breakable_group ~force_break:true ( - Doc.concat [ - Doc.lbrace; - Doc.indent ( - Doc.concat [ - Doc.line; - print_signature signature; - ] - ); - Doc.line; - Doc.rbrace; - ] - ) in - Doc.concat [ - print_attributes mod_type.pmty_attributes; - signature_doc - ] - | Pmty_functor _ -> - let (parameters, return_type) = ParsetreeViewer.functor_type mod_type in - let parameters_doc = match parameters with - | [] -> Doc.nil - | [attrs, {Location.txt = "_"}, Some mod_type] -> - let attrs = match attrs with - | [] -> Doc.nil - | attrs -> Doc.concat [ - Doc.join ~sep:Doc.line (List.map print_attribute attrs); - Doc.line; - ] in - Doc.concat [ - attrs; - print_mod_type mod_type - ] - | params -> - Doc.group ( - Doc.concat [ - Doc.lparen; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) ( - List.map (fun (attrs, lbl, mod_type) -> - let attrs = match attrs with - | [] -> Doc.nil - | attrs -> Doc.concat [ - Doc.join ~sep:Doc.line (List.map print_attribute attrs); - Doc.line; - ] in - Doc.concat [ - attrs; - if lbl.Location.txt = "_" then Doc.nil else Doc.text lbl.txt; - (match mod_type with - | None -> Doc.nil - | Some mod_type -> Doc.concat [ - if lbl.txt = "_" then Doc.nil else Doc.text ": "; - print_mod_type mod_type; - ]); - ] - ) params - ); - ] - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.rparen; - ] - ) - in - let return_doc = - let doc = print_mod_type return_type in - if Parens.mod_type_functor_return return_type then add_parens doc else doc - in - Doc.group ( - Doc.concat [ - parameters_doc; - Doc.group ( - Doc.concat [ - Doc.text " =>"; - Doc.line; - return_doc; - ] - ) - ] - ) - | Pmty_typeof mod_expr -> Doc.concat [ - Doc.text "module type of "; - print_mod_expr mod_expr; - ] - | Pmty_extension extension -> print_extension extension - | Pmty_alias {txt = longident} -> Doc.concat [ - Doc.text "module "; - print_longident longident; - ] - | Pmty_with (mod_type, with_constraints) -> - let operand = - let doc = print_mod_type mod_type in - if Parens.mod_type_with_operand mod_type then add_parens doc else doc - in - Doc.group ( - Doc.concat [ - operand; - Doc.indent ( - Doc.concat [ - Doc.line; - print_with_constraints with_constraints; - ] - ) - ] - ) - in - let attrs_already_printed = match mod_type.pmty_desc with - | Pmty_functor _ | Pmty_signature _ | Pmty_ident _ -> true - | _ -> false in - Doc.concat [ - if attrs_already_printed then Doc.nil else print_attributes mod_type.pmty_attributes; - mod_type_doc; - ] - - and print_with_constraints with_constraints = - let rows =List.mapi (fun i with_constraint -> - Doc.group ( - Doc.concat [ - if i == 0 then Doc.text "with " else Doc.text "and "; - print_with_constraint with_constraint; - ] - ) - ) with_constraints - in - Doc.join ~sep:Doc.line rows - - and print_with_constraint (with_constraint : Parsetree.with_constraint) = - match with_constraint with - (* with type X.t = ... *) - | Pwith_type ({txt = longident}, type_declaration) -> - Doc.group (print_type_declaration - ~name:(print_longident longident) - ~equal_sign:"=" - ~rec_flag:Doc.nil - 0 - type_declaration) - (* with module X.Y = Z *) - | Pwith_module ({txt = longident1}, {txt = longident2}) -> - Doc.concat [ - Doc.text "module "; - print_longident longident1; - Doc.text " ="; - Doc.indent ( - Doc.concat [ - Doc.line; - print_longident longident2; - ] - ) - ] - (* with type X.t := ..., same format as [Pwith_type] *) - | Pwith_typesubst ({txt = longident}, type_declaration) -> - Doc.group(print_type_declaration - ~name:(print_longident longident) - ~equal_sign:":=" - ~rec_flag:Doc.nil - 0 - type_declaration) - | Pwith_modsubst ({txt = longident1}, {txt = longident2}) -> - Doc.concat [ - Doc.text "module "; - print_longident longident1; - Doc.text " :="; - Doc.indent ( - Doc.concat [ - Doc.line; - print_longident longident2; - ] - ) - ] - - and print_signature signature = - interleave_whitespace ( - List.map (fun si -> (si.Parsetree.psig_loc, print_signature_item si)) signature - ) - - and print_signature_item (si : Parsetree.signature_item) = - match si.psig_desc with - | Parsetree.Psig_value value_description -> - print_value_description value_description - | Psig_type (rec_flag, type_declarations) -> - let rec_flag = match rec_flag with - | Asttypes.Nonrecursive -> Doc.nil - | Asttypes.Recursive -> Doc.text "rec " - in - print_type_declarations ~rec_flag type_declarations - | Psig_typext type_extension -> - print_type_extension type_extension - | Psig_exception extension_constructor -> - print_exception_def extension_constructor - | Psig_module module_declaration -> - print_module_declaration module_declaration - | Psig_recmodule module_declarations -> - print_rec_module_declarations module_declarations - | Psig_modtype mod_type_decl -> - print_module_type_declaration mod_type_decl - | Psig_open open_description -> - print_open_description open_description - | Psig_include include_description -> - print_include_description include_description - | Psig_attribute attr -> Doc.concat [Doc.text "@"; print_attribute attr] - | Psig_extension (extension, attrs) -> Doc.concat [ - print_attributes attrs; - Doc.concat [Doc.text "%";print_extension extension]; - ] - | Psig_class _ | Psig_class_type _ -> Doc.nil - - and print_rec_module_declarations module_declarations = - Doc.group ( - Doc.join ~sep:Doc.line ( - List.mapi (fun i (md: Parsetree.module_declaration) -> - let body = match md.pmd_type.pmty_desc with - | Parsetree.Pmty_alias {txt = longident } -> - Doc.concat [Doc.text " = "; print_longident longident] - | _ -> - let needs_parens = match md.pmd_type.pmty_desc with - | Pmty_with _ -> true - | _ -> false - in - let mod_type_doc = - let doc = print_mod_type md.pmd_type in - if needs_parens then add_parens doc else doc - in - Doc.concat [Doc.text ": "; mod_type_doc] - in - let prefix = if i < 1 then "module rec " else "and " in - Doc.concat [ - print_attributes ~loc:md.pmd_name.loc md.pmd_attributes; - Doc.text prefix; - Doc.text md.pmd_name.txt; - body - ] - ) module_declarations - ) - ) - - and print_module_declaration (md: Parsetree.module_declaration) = - let body = match md.pmd_type.pmty_desc with - | Parsetree.Pmty_alias {txt = longident } -> - Doc.concat [Doc.text " = "; print_longident longident] - | _ -> Doc.concat [Doc.text ": "; print_mod_type md.pmd_type] - in - Doc.concat [ - print_attributes ~loc:md.pmd_name.loc md.pmd_attributes; - Doc.text "module "; - Doc.text md.pmd_name.txt; - body - ] - - and print_open_description (open_description : Parsetree.open_description) = - Doc.concat [ - print_attributes open_description.popen_attributes; - Doc.text "open"; - (match open_description.popen_override with - | Asttypes.Fresh -> Doc.space - | Asttypes.Override -> Doc.text "! "); - print_longident open_description.popen_lid.txt - ] - - and print_include_description (include_description: Parsetree.include_description) = - Doc.concat [ - print_attributes include_description.pincl_attributes; - Doc.text "include "; - print_mod_type include_description.pincl_mod; - ] - - and print_include_declaration (include_declaration : Parsetree.include_declaration) = - Doc.concat [ - print_attributes include_declaration.pincl_attributes; - Doc.text "include "; - print_mod_expr include_declaration.pincl_mod; - ] - - - and print_value_bindings ~rec_flag (vbs: Parsetree.value_binding list) = - let rows = List.mapi (fun i vb -> - let doc = print_value_binding ~rec_flag i vb in - (vb.Parsetree.pvb_loc, doc) - ) vbs - in - interleave_whitespace rows - - (* - * type value_description = { - * pval_name : string Asttypes.loc; - * pval_type : Parsetree.core_type; - * pval_prim : string list; - * pval_attributes : Parsetree.attributes; - * pval_loc : Location.t; - * } - *) - and print_value_description value_description = - let is_external = - match value_description.pval_prim with | [] -> false | _ -> true - in - Doc.group ( - Doc.concat [ - Doc.text (if is_external then "external " else "let "); - Doc.text value_description.pval_name.txt; - Doc.text ": "; - print_typ_expr value_description.pval_type; - if is_external then - Doc.group ( - Doc.concat [ - Doc.text " ="; - Doc.indent( - Doc.concat [ - Doc.line; - Doc.join ~sep:Doc.line ( - List.map(fun s -> Doc.concat [ - Doc.text "\""; - Doc.text s; - Doc.text "\""; - ]) - value_description.pval_prim - ); - ] - ) - ] - ) - else Doc.nil - ] - ) - - and print_type_declarations ~rec_flag type_declarations = - let rows = List.mapi (fun i td -> - let doc = print_type_declaration - ~name:(Doc.text td.Parsetree.ptype_name.txt) - ~equal_sign:"=" - ~rec_flag - i td - in - (td.Parsetree.ptype_loc, doc) - ) type_declarations in - interleave_whitespace rows - - (* - * 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 = - * | 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 print_type_declaration ~name ~equal_sign ~rec_flag i (td: Parsetree.type_declaration) = - let attrs = print_attributes ~loc:td.ptype_loc td.ptype_attributes in - let prefix = if i > 0 then - Doc.text "and " - else - Doc.concat [Doc.text "type "; rec_flag] - in - let type_name = name in - let type_params = match td.ptype_params with - | [] -> Doc.nil - | type_params -> Doc.group ( - Doc.concat [ - Doc.less_than; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) ( - List.map print_type_param type_params - ) - ] - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.greater_than; - ] - ) - in - let manifest_and_kind = match td.ptype_kind with - | Ptype_abstract -> - begin match td.ptype_manifest with - | None -> Doc.nil - | Some(typ) -> - Doc.concat [ - Doc.concat [Doc.space; Doc.text equal_sign; Doc.space]; - print_private_flag td.ptype_private; - print_typ_expr typ; - ] - end - | Ptype_open -> Doc.concat [ - Doc.concat [Doc.space; Doc.text equal_sign; Doc.space]; - print_private_flag td.ptype_private; - Doc.text ".."; - ] - | Ptype_record(lds) -> - let manifest = match td.ptype_manifest with - | None -> Doc.nil - | Some(typ) -> Doc.concat [ - Doc.concat [Doc.space; Doc.text equal_sign; Doc.space]; - print_typ_expr typ; - ] - in - Doc.concat [ - manifest; - Doc.concat [Doc.space; Doc.text equal_sign; Doc.space]; - print_private_flag td.ptype_private; - print_record_declaration lds; - ] - | Ptype_variant(cds) -> - let manifest = match td.ptype_manifest with - | None -> Doc.nil - | Some(typ) -> Doc.concat [ - Doc.concat [Doc.space; Doc.text equal_sign; Doc.space]; - print_typ_expr typ; - ] - in - Doc.concat [ - manifest; - Doc.concat [Doc.space; Doc.text equal_sign]; - print_constructor_declarations ~private_flag:td.ptype_private cds; - ] - in - let constraints = print_type_definition_constraints td.ptype_cstrs in - Doc.group ( - Doc.concat [ - attrs; - prefix; - type_name; - type_params; - manifest_and_kind; - constraints; - ] - ) - - and print_type_definition_constraints cstrs = - match cstrs with - | [] -> Doc.nil - | cstrs -> Doc.indent ( - Doc.group ( - Doc.concat [ - Doc.line; - Doc.group( - Doc.join ~sep:Doc.line ( - List.map print_type_definition_constraint cstrs - ) - ) - ] - ) - ) - - and print_type_definition_constraint ((typ1, typ2, _loc ): Parsetree.core_type * Parsetree.core_type * Location.t) = - Doc.concat [ - Doc.text "constraint "; - print_typ_expr typ1; - Doc.text " = "; - print_typ_expr typ2; - ] - - and print_private_flag (flag : Asttypes.private_flag) = match flag with - | Private -> Doc.text "private " - | Public -> Doc.nil - - and print_type_param (param : (Parsetree.core_type * Asttypes.variance)) = - let (typ, variance) = param in - let printed_variance = match variance with - | Covariant -> Doc.text "+" - | Contravariant -> Doc.text "-" - | Invariant -> Doc.nil - in - Doc.concat [ - printed_variance; - print_typ_expr typ - ] - - and print_record_declaration (lds: Parsetree.label_declaration list) = - let force_break = match (lds, List.rev lds) with - | (first::_, last::_) -> - first.pld_loc.loc_start.pos_lnum < last.pld_loc.loc_end.pos_lnum - | _ -> false - in - Doc.breakable_group ~force_break ( - Doc.concat [ - Doc.lbrace; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) - (List.map print_label_declaration lds) - ] - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.rbrace; - ] - ) - - and print_constructor_declarations ~private_flag (cds: Parsetree.constructor_declaration list) = - let force_break = match (cds, List.rev cds) with - | (first::_, last::_) -> - first.pcd_loc.loc_start.pos_lnum < last.pcd_loc.loc_end.pos_lnum - | _ -> false - in - let private_flag = match private_flag with - | Asttypes.Private -> Doc.concat [ - Doc.text "private"; - Doc.line; - ] - | Public -> Doc.nil - in - Doc.breakable_group ~force_break ( - Doc.indent ( - Doc.concat [ - Doc.line; - private_flag; - Doc.join ~sep:Doc.line ( - List.mapi print_constructor_declaration cds - ) - ] - ) - ) - - (* - * { - * 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 print_constructor_declaration i (cd : Parsetree.constructor_declaration) = - let attrs = print_attributes cd.pcd_attributes in - let bar = if i > 0 then Doc.text "| " - else Doc.if_breaks (Doc.text "| ") Doc.nil - in - let constr_name = Doc.text cd.pcd_name.txt in - let constr_args = print_constructor_arguments cd.pcd_args in - let gadt = match cd.pcd_res with - | None -> Doc.nil - | Some(typ) -> Doc.indent ( - Doc.concat [ - Doc.text ": "; - print_typ_expr typ; - ] - ) - in - Doc.concat [ - bar; - Doc.group ( - Doc.concat [ - attrs; (* TODO: fix parsing of attributes, so when can print them above the bar? *) - constr_name; - constr_args; - gadt; - ] - ) - ] - - and print_constructor_arguments (cd_args : Parsetree.constructor_arguments) = - match cd_args with - | Pcstr_tuple [] -> Doc.nil - | Pcstr_tuple types -> Doc.group ( - Doc.indent ( - Doc.concat [ - Doc.lparen; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) ( - List.map print_typ_expr types - ) - ] - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.rparen; - ] - ) - ) - | Pcstr_record lds -> - Doc.indent ( - Doc.concat [ - Doc.lparen; - (* manually inline the printRecordDeclaration, gives better layout *) - Doc.lbrace; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) - (List.map print_label_declaration lds) - ] - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.rbrace; - Doc.rparen; - ] - ) - - - and print_label_declaration (ld : Parsetree.label_declaration) = - let attrs = print_attributes ~loc:ld.pld_name.loc ld.pld_attributes in - let mutable_flag = match ld.pld_mutable with - | Mutable -> Doc.text "mutable " - | Immutable -> Doc.nil - in - let name = Doc.text ld.pld_name.txt in - Doc.group ( - Doc.concat [ - attrs; - mutable_flag; - name; - Doc.text ": "; - print_typ_expr ld.pld_type; - ] - ) - - and print_typ_expr (typ_expr : Parsetree.core_type) = - let rendered_type = match typ_expr.ptyp_desc with - | Ptyp_any -> Doc.text "_" - | Ptyp_var var -> Doc.text ("'" ^ var) - | Ptyp_extension(extension) -> - print_extension extension - | Ptyp_alias(typ, alias) -> - let typ = - (* Technically type t = (string, float) => unit as 'x, doesn't require - * parens around the arrow expression. This is very confusing though. - * Is the "as" part of "unit" or "(string, float) => unit". By printing - * parens we guide the user towards its meaning.*) - let needs_parens = match typ.ptyp_desc with - | Ptyp_arrow _ -> true - | _ -> false - in - let doc = print_typ_expr typ in - if needs_parens then - Doc.concat [Doc.lparen; doc; Doc.rparen] - else - doc - in - Doc.concat [typ; Doc.text " as "; Doc.text ("'" ^ alias)] - | Ptyp_constr({txt = Longident.Ldot(Longident.Lident "Js", "t")}, [typ]) -> - let bs_object = print_typ_expr typ in - begin match typ_expr.ptyp_attributes with - | [] -> bs_object - | attrs -> - Doc.concat [ - Doc.group ( - Doc.join ~sep:Doc.line (List.map print_attribute attrs) - ); - Doc.space; - print_typ_expr typ; - ] - end - | Ptyp_constr(longident_loc, [{ ptyp_desc = Parsetree.Ptyp_tuple tuple }]) -> - let constr_name = print_longident longident_loc.txt in - Doc.group( - Doc.concat([ - constr_name; - Doc.less_than; - print_tuple_type ~inline:true tuple; - Doc.greater_than; - ]) - ) - | Ptyp_constr(longident_loc, constr_args) -> - let constr_name = print_longident longident_loc.txt in - begin match constr_args with - | [] -> constr_name - | [{ - Parsetree.ptyp_desc = - Ptyp_constr({txt = Longident.Ldot(Longident.Lident "Js", "t")}, - [{ptyp_desc = Ptyp_object (fields, open_flag)}]) - }] -> - Doc.concat([ - constr_name; - Doc.less_than; - print_bs_object_sugar ~inline:true fields open_flag; - Doc.greater_than; - ]) - | args -> Doc.group( - Doc.concat([ - constr_name; - Doc.less_than; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) ( - List.map print_typ_expr constr_args - ) - ] - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.greater_than; - ]) - ) - end - | Ptyp_arrow _ -> - let (attrs_before, args, return_type) = ParsetreeViewer.arrow_type typ_expr in - let return_type_needs_parens = match return_type.ptyp_desc with - | Ptyp_alias _ -> true - | _ -> false - in - let return_doc = - let doc = print_typ_expr return_type in - if return_type_needs_parens then - Doc.concat [Doc.lparen; doc; Doc.rparen] - else doc - in - let (is_uncurried, attrs) = ParsetreeViewer.process_uncurried_attribute attrs_before in - begin match args with - | [] -> Doc.nil - | [([], Nolabel, n)] when not is_uncurried -> - let has_attrs_before = not (attrs = []) in - let attrs = if has_attrs_before then - Doc.concat [ - Doc.join ~sep:Doc.line (List.map print_attribute attrs_before); - Doc.space; - ] - else Doc.nil - in - Doc.group ( - Doc.concat [ - Doc.group attrs; - Doc.group ( - if has_attrs_before then - Doc.concat [ - Doc.lparen; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - print_typ_expr n; - Doc.text " => "; - return_doc; - ] - ); - Doc.soft_line; - Doc.rparen - ] - else - Doc.concat [ - print_typ_expr n; - Doc.text " => "; - return_doc; - ] - ) - ] - ) - | args -> - let attrs = match attrs with - | [] -> Doc.nil - | attrs -> Doc.concat [ - Doc.join ~sep:Doc.line (List.map print_attribute attrs); - Doc.space; - ] - in - let rendered_args = Doc.concat [ - attrs; - Doc.text "("; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - if is_uncurried then Doc.concat [Doc.dot; Doc.space] else Doc.nil; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) ( - List.map print_type_parameter args - ) - ] - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.text ")"; - ] in - Doc.group ( - Doc.concat [ - rendered_args; - Doc.text " => "; - return_doc; - ] - ) - end - | Ptyp_tuple types -> print_tuple_type ~inline:false types - | Ptyp_object (fields, open_flag) -> - print_bs_object_sugar ~inline:false fields open_flag - | Ptyp_poly(string_locs, typ) -> - Doc.concat [ - Doc.join ~sep:Doc.space (List.map (fun {Location.txt} -> - Doc.text ("'" ^ txt)) string_locs); - Doc.dot; - Doc.space; - print_typ_expr typ - ] - | Ptyp_package package_type -> - print_package_type ~print_module_keyword_and_parens:true package_type - | Ptyp_class _ -> failwith "classes are not supported in types" - | Ptyp_variant _ -> failwith "Polymorphic variants currently not supported" - in - let should_print_its_own_attributes = match typ_expr.ptyp_desc with - | Ptyp_arrow _ (* es6 arrow types print their own attributes *) - | Ptyp_constr({txt = Longident.Ldot(Longident.Lident "Js", "t")}, _) -> true - | _ -> false - in - begin match typ_expr.ptyp_attributes with - | _::_ as attrs when not should_print_its_own_attributes -> - Doc.group ( - Doc.concat [ - print_attributes attrs; - rendered_type; - ] - ) - | _ -> rendered_type - end - - and print_bs_object_sugar ~inline fields open_flag = - let flag = match open_flag with - | Asttypes.Closed -> Doc.nil - | Open -> Doc.dotdot - in - let doc = Doc.concat [ - Doc.lbrace; - flag; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) ( - List.map print_object_field fields - ) - ] - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.rbrace; - ] in - if inline then doc else Doc.group doc - - - and print_tuple_type ~inline (types: Parsetree.core_type list) = - let tuple = Doc.concat([ - Doc.text "/"; - Doc.indent ( - Doc.concat([ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) ( - List.map print_typ_expr types - ) - ]) - ); - (* Doc.trailingComma; *) (* Trailing comma not supported in tuples right now‚ͬ†*) - Doc.soft_line; - Doc.text "/"; - ]) - in - if inline == false then Doc.group(tuple) else tuple - - and print_object_field (field : Parsetree.object_field) = - match field with - | Otag (label_loc, attrs, typ) -> - Doc.concat [ - Doc.text ("\"" ^ label_loc.txt ^ "\""); - Doc.text ": "; - print_typ_expr typ; - ] - | _ -> Doc.nil - - (* es6 arrow type arg - * type t = (~foo: string, ~bar: float=?, unit) => unit - * i.e. ~foo: string, ~bar: float *) - and print_type_parameter (attrs, lbl, typ) = - let (is_uncurried, attrs) = ParsetreeViewer.process_uncurried_attribute attrs in - let uncurried = if is_uncurried then Doc.concat [Doc.dot; Doc.space] else Doc.nil in - let attrs = match attrs with - | [] -> Doc.nil - | attrs -> Doc.concat [ - Doc.join ~sep:Doc.line (List.map print_attribute attrs); - Doc.line; - ] in - let label = match lbl with - | Asttypes.Nolabel -> Doc.nil - | Labelled lbl -> Doc.text ("~" ^ lbl ^ ": ") - | Optional lbl -> Doc.text ("~" ^ lbl ^ ": ") - in - let optional_indicator = match lbl with - | Asttypes.Nolabel - | Labelled _ -> Doc.nil - | Optional lbl -> Doc.text "=?" - in - Doc.group ( - Doc.concat [ - uncurried; - attrs; - label; - print_typ_expr typ; - optional_indicator; - ] - ) - - - (* - * { - * pvb_pat: pattern; - * pvb_expr: expression; - * pvb_attributes: attributes; - * pvb_loc: Location.t; - * } - *) - and print_value_binding ~rec_flag i vb = - let is_ghost = ParsetreeViewer.is_ghost_unit_binding i vb in - let header = if is_ghost then Doc.nil else - if i == 0 then Doc.concat [Doc.text "let "; rec_flag] - else Doc.text "and " - in - let printed_expr = - let expr_doc = print_expression vb.pvb_expr in - let needs_parens = match vb.pvb_expr.pexp_desc with - | Pexp_constraint( - {pexp_desc = Pexp_pack _}, - {ptyp_desc = Ptyp_package _} - ) -> false - | Pexp_constraint _ -> true - | _ -> false - in - if needs_parens then add_parens expr_doc else expr_doc - in - if is_ghost then - printed_expr - else - let should_indent = - ParsetreeViewer.is_binary_expression vb.pvb_expr || - (match vb.pvb_expr with - | { - pexp_attributes = [({Location.txt="res.ternary"}, _)]; - pexp_desc = Pexp_ifthenelse (if_expr, _, _) - } -> - ParsetreeViewer.is_binary_expression if_expr || ParsetreeViewer.has_attributes if_expr.pexp_attributes - | { pexp_desc = Pexp_newtype _} -> false - | e -> - ParsetreeViewer.has_attributes e.pexp_attributes || - ParsetreeViewer.is_array_access e - ) - in - Doc.concat [ - print_attributes ~loc:vb.pvb_loc vb.pvb_attributes; - header; - print_pattern vb.pvb_pat; - Doc.text " ="; - if should_indent then - Doc.indent ( - Doc.concat [ - Doc.line; - printed_expr; - ] - ) - else - Doc.concat [ - Doc.space; - printed_expr; - ] - ] - - and print_package_type ~print_module_keyword_and_parens (package_type: Parsetree.package_type) = - let doc = match package_type with - | (longident_loc, []) -> Doc.group( - Doc.concat [ - print_longident longident_loc.txt; - ] - ) - | (longident_loc, package_constraints) -> Doc.group( - Doc.concat [ - print_longident longident_loc.txt; - print_package_constraints package_constraints; - Doc.soft_line; - ] - ) - in - if print_module_keyword_and_parens then - Doc.concat[ - Doc.text "module("; - doc; - Doc.rparen - ] - else - doc - - - - - and print_package_constraints package_constraints = - Doc.concat [ - Doc.text " with"; - Doc.indent ( - Doc.concat [ - Doc.line; - Doc.join ~sep:Doc.line ( - List.mapi print_packageconstraint package_constraints - ) - ] - ) - ] - - and print_packageconstraint i (longident_loc, typ) = - let prefix = if i == 0 then Doc.text "type " else Doc.text "and type " in - Doc.concat [ - prefix; - print_longident longident_loc.Location.txt; - Doc.text " = "; - print_typ_expr typ - ] - - and print_extension (string_loc, payload) = - let ext_name = Doc.text ("%" ^ string_loc.Location.txt) in - match payload with - | PStr [{pstr_desc = Pstr_eval (expr, attrs)}] -> - let expr_doc = print_expression expr in - let needs_parens = match attrs with | [] -> false | _ -> true in - Doc.group ( - Doc.concat [ - ext_name; - add_parens ( - Doc.concat [ - print_attributes attrs; - if needs_parens then add_parens expr_doc else expr_doc; - ] - ) - ] - ) - | _ -> ext_name - - and print_pattern (p : Parsetree.pattern) = - let pattern_without_attributes = match p.ppat_desc with - | Ppat_any -> Doc.text "_" - | Ppat_var string_loc -> Doc.text (string_loc.txt) - | Ppat_constant c -> print_constant c - | Ppat_tuple patterns -> - Doc.group( - Doc.concat([ - Doc.text "/"; - Doc.indent ( - Doc.concat([ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.text ","; Doc.line]) - (List.map print_pattern patterns) - ]) - ); - (* Doc.ifBreaks (Doc.text ",") Doc.nil; *) - Doc.soft_line; - Doc.text "/"; - ]) - ) - | Ppat_array patterns -> - Doc.group( - Doc.concat([ - Doc.text "["; - Doc.indent ( - Doc.concat([ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.text ","; Doc.line]) - (List.map print_pattern patterns) - ]) - ); - Doc.if_breaks (Doc.text ",") Doc.nil; - Doc.soft_line; - Doc.text "]"; - ]) - ) - | Ppat_construct({txt = Longident.Lident "[]"}, _) -> - Doc.text "list()" - | Ppat_construct({txt = Longident.Lident "::"}, _) -> - let (patterns, tail) = collect_patterns_from_list_construct [] p in - let should_hug = match (patterns, tail) with - | ([pat], - {ppat_desc = Ppat_construct({txt = Longident.Lident "[]"}, _)}) when ParsetreeViewer.is_huggable_pattern pat -> true - | _ -> false - in - let children = Doc.concat([ - if should_hug then Doc.nil else Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.text ","; Doc.line]) - (List.map print_pattern patterns); - begin match tail.Parsetree.ppat_desc with - | Ppat_construct({txt = Longident.Lident "[]"}, _) -> Doc.nil - | _ -> Doc.concat([Doc.text ","; Doc.line; Doc.text "..."; print_pattern tail]) - end; - ]) in - Doc.group( - Doc.concat([ - Doc.text "list("; - if should_hug then children else Doc.concat [ - Doc.indent children; - Doc.if_breaks (Doc.text ",") Doc.nil; - Doc.soft_line; - ]; - Doc.text ")"; - ]) - ) - | Ppat_construct(constr_name, constructor_args) -> - let constr_name = print_longident constr_name.txt in - begin match constructor_args with - | None -> constr_name - | Some(args) -> - let args = match args.ppat_desc with - | Ppat_construct({txt = Longident.Lident "()"}, None) -> [Doc.nil] - | Ppat_tuple(patterns) -> List.map print_pattern patterns - | _ -> [print_pattern args] - in - Doc.group( - Doc.concat([ - constr_name; - Doc.text "("; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.text ","; Doc.line]) - args - ] - ); - Doc.if_breaks (Doc.text ",") Doc.nil; - Doc.soft_line; - Doc.text ")"; - ]) - ) - end - | Ppat_record(rows, open_flag) -> - Doc.group( - Doc.concat([ - Doc.text "{"; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.text ","; Doc.line]) - (List.map print_pattern_record_row rows); - begin match open_flag with - | Open -> Doc.concat [Doc.text ","; Doc.line; Doc.text "_"] - | Closed -> Doc.nil - end; - ] - ); - Doc.if_breaks (Doc.text ",") Doc.nil; - Doc.soft_line; - Doc.text "}"; - ]) - ) - - | Ppat_exception p -> - let needs_parens = match p.ppat_desc with - | Ppat_or (_, _) | Ppat_alias (_, _) -> true - | _ -> false - in - let pat = - let p = print_pattern p in - if needs_parens then - Doc.concat [Doc.text "("; p; Doc.text ")"] - else - p - in - Doc.group ( - Doc.concat [ Doc.text "exception"; Doc.line; pat ] - ) - | Ppat_or (p1, p2) -> - let p1 = - let p = print_pattern p1 in - match p1.ppat_desc with - | Ppat_or (_, _) -> Doc.concat [Doc.text "("; p; Doc.text ")"] - | _ -> p - in - let p2 = - let p = print_pattern p2 in - match p2.ppat_desc with - | Ppat_or (_, _) -> Doc.concat [Doc.text "("; p; Doc.text ")"] - | _ -> p - in - Doc.group( - Doc.concat([p1; Doc.line; Doc.text "| "; p2]) - ) - | Ppat_extension ext -> - print_extension ext - | Ppat_lazy p -> - let needs_parens = match p.ppat_desc with - | Ppat_or (_, _) | Ppat_alias (_, _) -> true - | _ -> false - in - let pat = - let p = print_pattern p in - if needs_parens then - Doc.concat [Doc.text "("; p; Doc.text ")"] - else - p - in - Doc.concat [Doc.text "lazy "; pat] - | Ppat_alias (p, alias_loc) -> - let needs_parens = match p.ppat_desc with - | Ppat_or (_, _) | Ppat_alias (_, _) -> true - | _ -> false - in - let rendered_pattern = - let p = print_pattern p in - if needs_parens then - Doc.concat [Doc.text "("; p; Doc.text ")"] - else - p - in - Doc.concat([ - rendered_pattern; - Doc.text " as "; - Doc.text alias_loc.txt - ]) - - (* Note: module(P : S) is represented as *) - (* Ppat_constraint(Ppat_unpack, Ptyp_package) *) - | Ppat_constraint ({ppat_desc = Ppat_unpack string_loc}, {ptyp_desc = Ptyp_package package_type}) -> - Doc.concat [ - Doc.text "module("; - Doc.text string_loc.txt; - Doc.text ": "; - print_package_type ~print_module_keyword_and_parens:false package_type; - Doc.rparen; - ] - | Ppat_constraint (pattern, typ) -> - Doc.concat [ - print_pattern pattern; - Doc.text ": "; - print_typ_expr typ; - ] - - (* Note: module(P : S) is represented as *) - (* Ppat_constraint(Ppat_unpack, Ptyp_package) *) - | Ppat_unpack string_loc -> - Doc.concat [ - Doc.text "module("; - Doc.text string_loc.txt; - Doc.rparen; - ] - | _ -> failwith "unsupported pattern" - in - begin match p.ppat_attributes with - | [] -> pattern_without_attributes - | attrs -> - Doc.group ( - Doc.concat [ - print_attributes attrs; - pattern_without_attributes; - ] - ) - end - - and print_pattern_record_row row = - match row with - (* punned {x}*) - | ({Location.txt=Longident.Lident ident}, - {Parsetree.ppat_desc=Ppat_var {txt;_}}) when ident = txt -> - Doc.text ident - | (longident, pattern) -> - Doc.group ( - Doc.concat([ - print_longident longident.txt; - Doc.text ": "; - Doc.indent( - Doc.concat [ - Doc.soft_line; - print_pattern pattern; - ] - ) - ]) - ) - - and print_expression (e : Parsetree.expression) = - let printed_expression = match e.pexp_desc with - | Parsetree.Pexp_constant c -> print_constant c - | Pexp_construct _ when ParsetreeViewer.has_jsx_attribute e.pexp_attributes -> - print_jsx_fragment e - | Pexp_construct ({txt = Longident.Lident "()"}, _) -> Doc.text "()" - | Pexp_construct ({txt = Longident.Lident "[]"}, _) -> Doc.text "list()" - | Pexp_construct ({txt = Longident.Lident "::"}, _) -> - let (expressions, spread) = ParsetreeViewer.collect_list_expressions e in - let spread_doc = match spread with - | Some(expr) -> Doc.concat [ - Doc.text ","; - Doc.line; - Doc.dotdotdot; - print_expression expr - ] - | None -> Doc.nil - in - Doc.group( - Doc.concat([ - Doc.text "list("; - Doc.indent ( - Doc.concat([ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.text ","; Doc.line]) - (List.map print_expression expressions); - spread_doc; - ]) - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.rparen; - ]) - ) - | Pexp_construct (longident_loc, args) -> - let constr = print_longident longident_loc.txt in - let args = match args with - | None -> Doc.nil - | Some({pexp_desc = Pexp_construct ({txt = Longident.Lident "()"}, _)}) -> - Doc.text "()" - | Some({pexp_desc = Pexp_tuple args }) -> - Doc.concat [ - Doc.lparen; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) ( - List.map print_expression args - ) - ] - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.rparen; - ] - | Some(arg) -> - let arg_doc = print_expression arg in - let should_hug = ParsetreeViewer.is_huggable_expression arg in - Doc.concat [ - Doc.lparen; - if should_hug then arg_doc - else Doc.concat [ - Doc.indent ( - Doc.concat [ - Doc.soft_line; - arg_doc; - ] - ); - Doc.trailing_comma; - Doc.soft_line; - ]; - Doc.rparen; - ] - in - Doc.group(Doc.concat [constr; args]) - | Pexp_ident(longident_loc) -> - print_longident longident_loc.txt - | Pexp_tuple exprs -> - Doc.group( - Doc.concat([ - Doc.text "/"; - Doc.indent ( - Doc.concat([ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.text ","; Doc.line]) - (List.map print_expression exprs) - ]) - ); - Doc.if_breaks (Doc.text ",") Doc.nil; - Doc.soft_line; - Doc.text "/"; - ]) - ) - | Pexp_array [] -> Doc.text "[]" - | Pexp_array exprs -> - Doc.group( - Doc.concat([ - Doc.lbracket; - Doc.indent ( - Doc.concat([ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.text ","; Doc.line]) - (List.map print_expression exprs) - ]) - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.rbracket; - ]) - ) - | Pexp_record (rows, spread_expr) -> - let spread = match spread_expr with - | None -> Doc.nil - | Some expr -> Doc.concat [ - Doc.dotdotdot; - print_expression expr; - Doc.comma; - Doc.line; - ] - in - (* If the record is written over multiple lines, break automatically - * `let x = {a: 1, b: 3}` -> same line, break when line-width exceeded - * `let x = { - * a: 1, - * b: 2, - * }` -> record is written on multiple lines, break the group *) - let force_break = - e.pexp_loc.loc_start.pos_lnum < e.pexp_loc.loc_end.pos_lnum - in - Doc.breakable_group ~force_break ( - Doc.concat([ - Doc.lbrace; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - spread; - Doc.join ~sep:(Doc.concat [Doc.text ","; Doc.line]) - (List.map print_record_row rows) - ] - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.rbrace; - ]) - ) - | Pexp_extension extension -> - begin match extension with - | ( - {txt = "obj"}, - PStr [{ - pstr_loc = loc; - pstr_desc = Pstr_eval({pexp_desc = Pexp_record (rows, _)}, []) - }] - ) -> - (* If the object is written over multiple lines, break automatically - * `let x = {"a": 1, "b": 3}` -> same line, break when line-width exceeded - * `let x = { - * "a": 1, - * "b": 2, - * }` -> object is written on multiple lines, break the group *) - let force_break = - loc.loc_start.pos_lnum < loc.loc_end.pos_lnum - in - Doc.breakable_group ~force_break ( - Doc.concat([ - Doc.lbrace; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.text ","; Doc.line]) - (List.map print_bs_object_row rows) - ] - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.rbrace; - ]) - ) - | extension -> - print_extension extension - end - | Pexp_apply _ -> - if ParsetreeViewer.is_unary_expression e then - print_unary_expression e - else if ParsetreeViewer.is_binary_expression e then - print_binary_expression e - else - print_pexp_apply e - | Pexp_unreachable -> Doc.dot - | Pexp_field (expr, longident_loc) -> - let lhs = - let doc = print_expression expr in - if Parens.field_expr expr then add_parens doc else doc - in - Doc.concat [ - lhs; - Doc.dot; - print_longident longident_loc.txt; - ] - | Pexp_setfield (expr1, longident_loc, expr2) -> - print_set_field_expr e.pexp_attributes expr1 longident_loc expr2 - | Pexp_ifthenelse (if_expr, then_expr, else_expr) -> - if ParsetreeViewer.is_ternary_expr e then - let (parts, alternate) = ParsetreeViewer.collect_ternary_parts e in - let ternary_doc = match parts with - | (condition1, consequent1)::rest -> - Doc.group (Doc.concat [ - print_ternary_operand condition1; - Doc.indent ( - Doc.concat [ - Doc.line; - Doc.indent (Doc.concat [Doc.text "? "; print_ternary_operand consequent1]); - Doc.concat ( - List.map (fun (condition, consequent) -> - Doc.concat [ - Doc.line; - Doc.text ": "; - print_ternary_operand condition; - Doc.line; - Doc.text "? "; - print_ternary_operand consequent; - ] - ) rest - ); - Doc.line; - Doc.text ": "; - Doc.indent (print_ternary_operand alternate); - ] - ) - ]) - | _ -> Doc.nil - in - let attrs = ParsetreeViewer.filter_ternary_attributes e.pexp_attributes in - let needs_parens = match attrs with | [] -> false | _ -> true in - Doc.concat [ - print_attributes attrs; - if needs_parens then add_parens ternary_doc else ternary_doc; - ] - else - let (ifs, else_expr) = ParsetreeViewer.collect_if_expressions e in - let if_docs = Doc.join ~sep:Doc.space ( - List.mapi (fun i (if_expr, then_expr) -> - let if_txt = if i > 0 then Doc.text "else if " else Doc.text "if " in - let condition = print_expression if_expr in - Doc.concat [ - if_txt; - Doc.group ( - Doc.if_breaks (add_parens condition) condition; - ); - Doc.space; - print_expression_block ~braces:true then_expr; - ] - ) ifs - ) in - let else_doc = match else_expr with - | None -> Doc.nil - | Some expr -> Doc.concat [ - Doc.text " else "; - print_expression_block ~braces:true expr; - ] - in - Doc.concat [ - print_attributes e.pexp_attributes; - if_docs; - else_doc; - ] - | Pexp_while (expr1, expr2) -> - let condition = print_expression expr1 in - Doc.breakable_group ~force_break:true ( - Doc.concat [ - Doc.text "while "; - Doc.group ( - Doc.if_breaks (add_parens condition) condition - ); - Doc.space; - print_expression_block ~braces:true expr2; - ] - ) - | Pexp_for (pattern, from_expr, to_expr, direction_flag, body) -> - Doc.breakable_group ~force_break:true ( - Doc.concat [ - Doc.text "for "; - print_pattern pattern; - Doc.text " in "; - print_expression from_expr; - print_direction_flag direction_flag; - print_expression to_expr; - Doc.space; - print_expression_block ~braces:true body; - ] - ) - | Pexp_constraint( - {pexp_desc = Pexp_pack mod_expr}, - {ptyp_desc = Ptyp_package package_type} - ) -> - Doc.group ( - Doc.concat [ - Doc.text "module("; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - print_mod_expr mod_expr; - Doc.text ": "; - print_package_type ~print_module_keyword_and_parens:false package_type; - ] - ); - Doc.soft_line; - Doc.rparen; - ] - ) - - | Pexp_constraint (expr, typ) -> - Doc.concat [ - print_expression expr; - Doc.text ": "; - print_typ_expr typ; - ] - | Pexp_letmodule ({txt = mod_name}, mod_expr, expr) -> - print_expression_block ~braces:true e - - | Pexp_letexception (extension_constructor, expr) -> - print_expression_block ~braces:true e - | Pexp_assert expr -> - let rhs = - let doc = print_expression expr in - if Parens.lazy_or_assert_expr_rhs expr then add_parens doc else doc - in - Doc.concat [ - Doc.text "assert "; - rhs; - ] - | Pexp_lazy expr -> - let rhs = - let doc = print_expression expr in - if Parens.lazy_or_assert_expr_rhs expr then add_parens doc else doc - in - Doc.concat [ - Doc.text "lazy "; - rhs; - ] - | Pexp_open (override_flag, longident_loc, expr) -> - print_expression_block ~braces:true e - | Pexp_pack (mod_expr) -> - Doc.group (Doc.concat [ - Doc.text "module("; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - print_mod_expr mod_expr; - ] - ); - Doc.soft_line; - Doc.rparen; - ]) - | Pexp_sequence _ -> - print_expression_block ~braces:true e - | Pexp_let _ -> - print_expression_block ~braces:true e - | Pexp_fun _ | Pexp_newtype _ -> - let (attrs_on_arrow, parameters, return_expr) = ParsetreeViewer.fun_expr e in - let (uncurried, attrs) = - ParsetreeViewer.process_uncurried_attribute attrs_on_arrow - in - let (return_expr, typ_constraint) = match return_expr.pexp_desc with - | Pexp_constraint (expr, typ) -> (expr, Some typ) - | _ -> (return_expr, None) - in - let parameters_doc = print_expr_fun_parameters ~in_callback:false ~uncurried parameters in - let return_expr_doc = - let should_inline = match return_expr.pexp_desc with - | Pexp_array _ - | Pexp_tuple _ - | Pexp_construct (_, Some _) - | Pexp_record _ -> true - | _ -> false - in - let should_indent = match return_expr.pexp_desc with - | Pexp_sequence _ | Pexp_let _ | Pexp_letmodule _ | Pexp_letexception _ -> false - | _ -> true - in - let return_doc = print_expression return_expr in - if should_inline then Doc.concat [ - Doc.space; - return_doc; - ] else - Doc.group ( - if should_indent then - Doc.indent ( - Doc.concat [ - Doc.line; - return_doc; - ] - ) - else - Doc.concat [ - Doc.space; - return_doc - ] - ) - in - let typ_constraint_doc = match typ_constraint with - | Some(typ) -> Doc.concat [Doc.text ": "; print_typ_expr typ] - | _ -> Doc.nil - in - let attrs = match attrs with - | [] -> Doc.nil - | attrs -> Doc.concat [ - Doc.join ~sep:Doc.line (List.map print_attribute attrs); - Doc.space; - ] - in - Doc.group ( - Doc.concat [ - attrs; - parameters_doc; - typ_constraint_doc; - Doc.text " =>"; - return_expr_doc; - ] - ) - | Pexp_try (expr, cases) -> - Doc.concat [ - Doc.text "try "; - print_expression expr; - Doc.text " catch "; - print_cases cases; - ] - | Pexp_match (expr, cases) -> - Doc.concat [ - Doc.text "switch "; - print_expression expr; - Doc.space; - print_cases cases; - ] - | _ -> failwith "expression not yet implemented in printer" - in - let should_print_its_own_attributes = match e.pexp_desc with - | Pexp_apply _ - | Pexp_fun _ - | Pexp_newtype _ - | Pexp_setfield _ - | Pexp_ifthenelse _ -> true - | Pexp_construct _ when ParsetreeViewer.has_jsx_attribute e.pexp_attributes -> true - | _ -> false - in - begin match e.pexp_attributes with - | [] -> printed_expression - | attrs when not should_print_its_own_attributes -> - Doc.group ( - Doc.concat [ - print_attributes attrs; - printed_expression; - ] - ) - | _ -> printed_expression - end - - and print_pexp_fun ~in_callback e = - let (attrs_on_arrow, parameters, return_expr) = ParsetreeViewer.fun_expr e in - let (uncurried, attrs) = - ParsetreeViewer.process_uncurried_attribute attrs_on_arrow - in - let (return_expr, typ_constraint) = match return_expr.pexp_desc with - | Pexp_constraint (expr, typ) -> (expr, Some typ) - | _ -> (return_expr, None) - in - let parameters_doc = print_expr_fun_parameters ~in_callback ~uncurried parameters in - let return_should_indent = match return_expr.pexp_desc with - | Pexp_sequence _ | Pexp_let _ | Pexp_letmodule _ | Pexp_letexception _ -> false - | _ -> true - in - let return_expr_doc = - let should_inline = match return_expr.pexp_desc with - | Pexp_array _ - | Pexp_tuple _ - | Pexp_construct (_, Some _) - | Pexp_record _ -> true - | _ -> false - in - let return_doc = print_expression return_expr in - if should_inline then Doc.concat [ - Doc.space; - return_doc; - ] else - Doc.group ( - if return_should_indent then - Doc.concat [ - Doc.indent ( - Doc.concat [ - Doc.line; - return_doc; - ] - ); - if in_callback then Doc.soft_line else Doc.nil; - ] - else - Doc.concat [ - Doc.space; - return_doc; - ] - ) - in - let typ_constraint_doc = match typ_constraint with - | Some(typ) -> Doc.concat [Doc.text ": "; print_typ_expr typ] - | _ -> Doc.nil - in - let attrs = match attrs with - | [] -> Doc.nil - | attrs -> Doc.concat [ - Doc.join ~sep:Doc.line (List.map print_attribute attrs); - Doc.space; - ] - in - Doc.group ( - Doc.concat [ - attrs; - parameters_doc; - typ_constraint_doc; - Doc.text " =>"; - return_expr_doc; - ] - ) - - and print_ternary_operand expr = - let doc = print_expression expr in - if Parens.ternary_operand expr then add_parens doc else doc - - and print_set_field_expr attrs lhs longident_loc rhs = - let rhs_doc = - let doc = print_expression rhs in - if Parens.set_field_expr_rhs rhs then add_parens doc else doc - in - let lhs_doc = - let doc = print_expression lhs in - if Parens.field_expr lhs then add_parens doc else doc - in - let should_indent = ParsetreeViewer.is_binary_expression rhs in - let doc = Doc.concat [ - lhs_doc; - Doc.dot; - print_longident longident_loc.txt; - Doc.text " ="; - if should_indent then Doc.group ( - Doc.indent ( - (Doc.concat [Doc.line; rhs_doc]) - ) - ) else - Doc.concat [Doc.space; rhs_doc] - ] in - match attrs with - | [] -> doc - | attrs -> - Doc.group ( - Doc.concat [ - print_attributes attrs; - doc - ] - ) - - and print_unary_expression expr = - let print_unary_operator op = Doc.text ( - match op with - | "~+" -> "+" - | "~+." -> "+." - | "~-" -> "-" - | "~-." -> "-." - | "not" -> "!" - | "!" -> "&" - | _ -> assert false - ) in - match expr.pexp_desc with - | Pexp_apply ( - {pexp_desc = Pexp_ident {txt = Longident.Lident operator}}, - [Nolabel, operand] - ) -> - let printed_operand = - let doc = print_expression operand in - if Parens.unary_expr_operand operand then add_parens doc else doc - in - Doc.concat [ - print_unary_operator operator; - printed_operand; - ] - | _ -> assert false - - and print_binary_expression (expr : Parsetree.expression) = - let print_binary_operator ~inline_rhs operator = - let operator_txt = match operator with - | "|." -> "->" - | "^" -> "++" - | "=" -> "==" - | "==" -> "===" - | "<>" -> "!=" - | "!=" -> "!==" - | txt -> txt - in - let spacing_before_operator = - if operator = "|." then Doc.soft_line - else if operator = "|>" then Doc.line - else Doc.space; - in - let spacing_after_operator = - if operator = "|." then Doc.nil - else if operator = "|>" then Doc.space - else if inline_rhs then Doc.space else Doc.line - in - Doc.concat [ - spacing_before_operator; - Doc.text operator_txt; - spacing_after_operator; - ] - in - let print_operand ~is_lhs expr parent_operator = - let rec flatten ~is_lhs expr parent_operator = - if ParsetreeViewer.is_binary_expression expr then - begin match expr with - | {pexp_desc = Pexp_apply ( - {pexp_desc = Pexp_ident {txt = Longident.Lident operator}}, - [_, left; _, right] - )} -> - if ParsetreeViewer.flattenable_operators parent_operator operator && - not (ParsetreeViewer.has_attributes expr.pexp_attributes) then - let left_printed = flatten ~is_lhs:true left operator in - let right_printed = - let (_, right_attrs) = - ParsetreeViewer.partition_printeable_attributes right.pexp_attributes - in - let doc = - print_expression {right with pexp_attributes = right_attrs } in - let doc = if Parens.flatten_operand_rhs parent_operator right then - Doc.concat [Doc.lparen; doc; Doc.rparen] - else - doc - in - let printeable_attrs = - ParsetreeViewer.filter_printeable_attributes right.pexp_attributes - in - Doc.concat [print_attributes printeable_attrs; doc] - in - Doc.concat [ - left_printed; - print_binary_operator ~inline_rhs:false operator; - right_printed; - ] - else - let doc = print_expression {expr with pexp_attributes = []} in - let doc = if Parens.sub_binary_expr_operand parent_operator operator || - (expr.pexp_attributes <> [] && - (ParsetreeViewer.is_binary_expression expr || - ParsetreeViewer.is_ternary_expr expr)) then - Doc.concat [Doc.lparen; doc; Doc.rparen] - else doc - in Doc.concat [ - print_attributes expr.pexp_attributes; - doc - ] - | _ -> assert false - end - else - begin match expr.pexp_desc with - | Pexp_setfield (lhs, field, rhs) -> - let doc = print_set_field_expr expr.pexp_attributes lhs field rhs in - if is_lhs then add_parens doc else doc - | Pexp_apply( - {pexp_desc = Pexp_ident {txt = Longident.Lident "#="}}, - [(Nolabel, lhs); (Nolabel, rhs)] - ) -> - let rhs_doc = print_expression rhs in - let lhs_doc = print_expression lhs in - (* TODO: unify indentation of "=" *) - let should_indent = ParsetreeViewer.is_binary_expression rhs in - let doc = Doc.group( - Doc.concat [ - lhs_doc; - Doc.text " ="; - if should_indent then Doc.group ( - Doc.indent (Doc.concat [Doc.line; rhs_doc]) - ) else - Doc.concat [Doc.space; rhs_doc] - ] - ) in - let doc = match expr.pexp_attributes with - | [] -> doc - | attrs -> - Doc.group ( - Doc.concat [ - print_attributes attrs; - doc - ] - ) - in - if is_lhs then add_parens doc else doc - | _ -> - let doc = print_expression expr in - if Parens.binary_expr_operand ~is_lhs expr parent_operator then - add_parens doc - else doc - end - in - flatten ~is_lhs expr parent_operator - in - match expr.pexp_desc with - | Pexp_apply ( - {pexp_desc = Pexp_ident {txt = Longident.Lident (("|." | "|>") as op)}}, - [Nolabel, lhs; Nolabel, rhs] - ) when not ( - ParsetreeViewer.is_binary_expression lhs || - ParsetreeViewer.is_binary_expression rhs - ) -> - let lhs_doc = print_operand ~is_lhs:true lhs op in - let rhs_doc = print_operand ~is_lhs:false rhs op in - Doc.concat [ - lhs_doc; - (match op with - | "|." -> Doc.text "->" - | "|>" -> Doc.text " |> " - | _ -> assert false); - rhs_doc; - ] - | Pexp_apply ( - {pexp_desc = Pexp_ident {txt = Longident.Lident operator}}, - [Nolabel, lhs; Nolabel, rhs] - ) -> - let right = - let operator_with_rhs = Doc.concat [ - print_binary_operator - ~inline_rhs:(ParsetreeViewer.should_inline_rhs_binary_expr rhs) operator; - print_operand ~is_lhs:false rhs operator; - ] in - if ParsetreeViewer.should_indent_binary_expr expr then - Doc.group (Doc.indent operator_with_rhs) - else operator_with_rhs - in - let doc = Doc.group ( - Doc.concat [ - print_operand ~is_lhs:true lhs operator; - right - ] - ) in - Doc.concat [ - print_attributes expr.pexp_attributes; - if Parens.binary_expr expr then add_parens doc else doc - ] - | _ -> Doc.nil - - (* callExpr(arg1, arg2)*) - and print_pexp_apply expr = - match expr.pexp_desc with - | Pexp_apply ( - {pexp_desc = Pexp_ident {txt = Longident.Lident "##"}}, - [Nolabel, parent_expr; Nolabel, member_expr] - ) -> - let member = - let member_doc = print_expression member_expr in - Doc.concat [Doc.text "\""; member_doc; Doc.text "\""] - in - Doc.group (Doc.concat [ - print_attributes expr.pexp_attributes; - print_expression parent_expr; - Doc.lbracket; - member; - Doc.rbracket; - ]) - | Pexp_apply ( - {pexp_desc = Pexp_ident {txt = Longident.Lident "#="}}, - [Nolabel, lhs; Nolabel, rhs] - ) -> - let rhs_doc = print_expression rhs in - (* TODO: unify indentation of "=" *) - let should_indent = ParsetreeViewer.is_binary_expression rhs in - let doc = Doc.group( - Doc.concat [ - print_expression lhs; - Doc.text " ="; - if should_indent then Doc.group ( - Doc.indent ( - (Doc.concat [Doc.line; rhs_doc]) - ) - ) else - Doc.concat [Doc.space; rhs_doc] - ] - ) in - begin match expr.pexp_attributes with - | [] -> doc - | attrs -> - Doc.group ( - Doc.concat [ - print_attributes attrs; - doc - ] - ) - end - | Pexp_apply ( - {pexp_desc = Pexp_ident {txt = Longident.Ldot (Lident "Array", "get")}}, - [Nolabel, parent_expr; Nolabel, member_expr] - ) -> - let member = - let member_doc = print_expression member_expr in - let should_inline = match member_expr.pexp_desc with - | Pexp_constant _ | Pexp_ident _ -> true - | _ -> false - in - if should_inline then member_doc else ( - Doc.concat [ - Doc.indent ( - Doc.concat [ - Doc.soft_line; - member_doc; - ] - ); - Doc.soft_line - ] - ) - in - Doc.group (Doc.concat [ - print_attributes expr.pexp_attributes; - print_expression parent_expr; - Doc.lbracket; - member; - Doc.rbracket; - ]) - (* TODO: cleanup, are those branches even remotely performant? *) - | Pexp_apply ( - {pexp_desc = Pexp_ident {txt = lident}}, - args - ) when ParsetreeViewer.is_jsx_expression expr -> - print_jsx_expression lident args - | Pexp_apply (call_expr, args) -> - let (uncurried, attrs) = - ParsetreeViewer.process_uncurried_attribute expr.pexp_attributes - in - let call_expr_doc = print_expression call_expr in - if ParsetreeViewer.requires_special_callback_printing args then - let args_doc = print_arguments_with_callback ~uncurried args in - Doc.concat [ - print_attributes attrs; - call_expr_doc; - args_doc; - ] - else - let args_doc = print_arguments ~uncurried args in - Doc.concat [ - print_attributes attrs; - call_expr_doc; - args_doc; - ] - | _ -> assert false - - and print_jsx_expression lident args = - let name = print_jsx_name lident in - let (formatted_props, children) = format_jsx_props args in - (*
*) - let is_self_closing = match children with | [] -> true | _ -> false in - Doc.group ( - Doc.concat [ - Doc.group ( - Doc.concat [ - Doc.less_than; - name; - formatted_props; - if is_self_closing then Doc.concat [Doc.line; Doc.text "/>"] else Doc.nil - ] - ); - if is_self_closing then Doc.nil - else - Doc.concat [ - Doc.greater_than; - Doc.indent ( - Doc.concat [ - Doc.line; - print_jsx_children children; - ] - ); - Doc.line; - Doc.text "" in - let closing = Doc.text "" in - let (children, _) = ParsetreeViewer.collect_list_expressions expr in - Doc.group ( - Doc.concat [ - opening; - begin match children with - | [] -> Doc.nil - | children -> - Doc.indent ( - Doc.concat [ - Doc.line; - print_jsx_children children; - ] - ) - end; - Doc.line; - closing; - ] - ) - - and print_jsx_children (children: Parsetree.expression list) = - Doc.group ( - Doc.join ~sep:Doc.line ( - List.map (fun expr -> - let expr_doc = print_expression expr in - if Parens.jsx_child_expr expr then add_braces expr_doc else expr_doc - ) children - ) - ) - - and format_jsx_props args = - let rec loop props args = - match args with - | [] -> (Doc.nil, []) - | [ - (Asttypes.Labelled "children", children); - ( - Asttypes.Nolabel, - {Parsetree.pexp_desc = Pexp_construct ({txt = Longident.Lident "()"}, None)} - ) - ] -> - let formatted_props = Doc.indent ( - match props with - | [] -> Doc.nil - | props -> - Doc.concat [ - Doc.line; - Doc.group ( - Doc.join ~sep:Doc.line (props |> List.rev) - ) - ] - ) in - let (children, _) = ParsetreeViewer.collect_list_expressions children in - (formatted_props, children) - | arg::args -> - let prop_doc = format_jsx_prop arg in - loop (prop_doc::props) args - in - loop [] args - - and format_jsx_prop arg = - match arg with - | ( - (Asttypes.Labelled lbl_txt | Optional lbl_txt) as lbl, - { - Parsetree.pexp_attributes = []; - pexp_desc = Pexp_ident {txt = Longident.Lident ident} - } - ) when lbl_txt = ident (* jsx punning *) -> - - begin match lbl with - | Nolabel -> Doc.nil - | Labelled lbl -> Doc.text lbl - | Optional lbl -> Doc.text ("?" ^ lbl) - end - | (lbl, expr) -> - let lbl_doc = match lbl with - | Asttypes.Labelled lbl -> Doc.text (lbl ^ "=") - | Asttypes.Optional lbl -> Doc.text (lbl ^ "=?") - | Nolabel -> Doc.nil - in - let expr_doc = print_expression expr in - Doc.concat [ - lbl_doc; - if Parens.jsx_prop_expr expr then add_braces expr_doc else expr_doc; - ] - - (* div -> div. - * Navabar.createElement -> Navbar - * Staff.Users.createElement -> Staff.Users *) - and print_jsx_name lident = - let rec flatten acc lident = match lident with - | Longident.Lident txt -> txt::acc - | Ldot (lident, txt) -> - let acc = if txt = "createElement" then acc else txt::acc in - flatten acc lident - | _ -> acc - in - match lident with - | Longident.Lident txt -> Doc.text txt - | _ as lident -> - let segments = flatten [] lident in - Doc.join ~sep:Doc.dot (List.map Doc.text segments) - - and print_arguments_with_callback ~uncurried args = - let rec loop acc args = match args with - | [] -> (Doc.nil, Doc.nil) - | [_lbl, expr] -> - let callback = print_pexp_fun ~in_callback:true expr in - (Doc.concat (List.rev acc), callback) - | arg::args -> - let arg_doc = print_argument arg in - loop (Doc.line::Doc.comma::arg_doc::acc) args - in - let (printed_args, callback) = loop [] args in - - (* Thing.map(foo,(arg1, arg2) => MyModuleBlah.toList(argument)) *) - let fits_on_one_line = Doc.concat [ - if uncurried then Doc.text "(." else Doc.lparen; - Doc.concat [ - printed_args; - callback; - ]; - Doc.rparen; - ] in - - (* Thing.map(longArgumet, veryLooooongArgument, (arg1, arg2) => - * MyModuleBlah.toList(argument) - * ) - *) - let arugments_fit_on_one_line = - Doc.concat [ - if uncurried then Doc.text "(." else Doc.lparen; - Doc.concat [ - Doc.soft_line; - printed_args; - Doc.breakable_group ~force_break:true callback; - ]; - Doc.soft_line; - Doc.rparen; - ] - in - - (* Thing.map( - * arg1, - * arg2, - * arg3, - * (param1, parm2) => doStuff(param1, parm2) - * ) - *) - let break_all_args = print_arguments ~uncurried args in - Doc.custom_layout [ - fits_on_one_line; - arugments_fit_on_one_line; - break_all_args; - ] - - and print_arguments ~uncurried (args : (Asttypes.arg_label * Parsetree.expression) list) = - match args with - | [Nolabel, {pexp_desc = Pexp_construct ({txt = Longident.Lident "()"}, _)}] -> - if uncurried then Doc.text "(.)" else Doc.text "()" - | [(Nolabel, arg)] when ParsetreeViewer.is_huggable_expression arg -> - Doc.concat [ - if uncurried then Doc.text "(." else Doc.lparen; - print_expression arg; - Doc.rparen; - ] - | args -> Doc.group ( - Doc.concat [ - if uncurried then Doc.text "(." else Doc.lparen; - Doc.indent ( - Doc.concat [ - if uncurried then Doc.line else Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) ( - List.map print_argument args - ) - ] - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.rparen; - ] - ) - -(* - * argument ::= - * | _ (* syntax sugar *) - * | expr - * | expr : type - * | ~ label-name - * | ~ label-name - * | ~ label-name ? - * | ~ label-name = expr - * | ~ label-name = _ (* syntax sugar *) - * | ~ label-name = expr : type - * | ~ label-name = ? expr - * | ~ label-name = ? _ (* syntax sugar *) - * | ~ label-name = ? expr : type *) - and print_argument ((arg_lbl, arg) : Asttypes.arg_label * Parsetree.expression) = - match (arg_lbl, arg) with - (* ~a (punned)*) - | ( - (Asttypes.Labelled lbl), - {pexp_desc=Pexp_ident {txt =Longident.Lident name}} - ) when lbl = name -> - Doc.text ("~" ^ lbl) - (* ~a? (optional lbl punned)*) - | ( - (Asttypes.Optional lbl), - {pexp_desc=Pexp_ident {txt =Longident.Lident name}} - ) when lbl = name -> - Doc.text ("~" ^ lbl ^ "?") - | (lbl, expr) -> - let printed_lbl = match arg_lbl with - | Asttypes.Nolabel -> Doc.nil - | Asttypes.Labelled lbl -> Doc.text ("~" ^ lbl ^ "=") - | Asttypes.Optional lbl -> Doc.text ("~" ^ lbl ^ "=?") - in - let printed_expr = print_expression expr in - Doc.concat [ - printed_lbl; - printed_expr; - ] - - and print_cases (cases: Parsetree.case list) = - Doc.breakable_group ~force_break:true ( - Doc.concat [ - Doc.lbrace; - Doc.concat [ - Doc.line; - Doc.join ~sep:Doc.line ( - List.map print_case cases - ) - ]; - Doc.line; - Doc.rbrace; - ] - ) - - and print_case (case: Parsetree.case) = - let rhs = match case.pc_rhs.pexp_desc with - | Pexp_let _ - | Pexp_letmodule _ - | Pexp_letexception _ - | Pexp_open _ - | Pexp_sequence _ -> - print_expression_block ~braces:false case.pc_rhs - | _ -> print_expression case.pc_rhs - in - let guard = match case.pc_guard with - | None -> Doc.nil - | Some expr -> Doc.group ( - Doc.concat [ - Doc.line; - Doc.text "when "; - print_expression expr; - ] - ) - in - Doc.group ( - Doc.concat [ - Doc.text "| "; - Doc.indent ( - Doc.concat [ - print_pattern case.pc_lhs; - guard; - Doc.text " =>"; - Doc.line; - rhs; - ] - ); - ] - ) - - and print_expr_fun_parameters ~in_callback ~uncurried parameters = - match parameters with - (* let f = _ => () *) - | [([], Asttypes.Nolabel, None, {Parsetree.ppat_desc = Ppat_any})] when not uncurried -> - Doc.text "_" - (* let f = a => () *) - | [([], Asttypes.Nolabel, None, {Parsetree.ppat_desc = Ppat_var string_loc})] when not uncurried -> - Doc.text string_loc.txt - (* let f = () => () *) - | [([], Nolabel, None, {ppat_desc = Ppat_construct({txt = Longident.Lident "()"}, None)})] when not uncurried -> - Doc.text "()" - (* let f = (~greeting, ~from as hometown, ~x=?) => () *) - | parameters -> - let lparen = if uncurried then Doc.text "(. " else Doc.lparen in - let should_hug = ParsetreeViewer.parameters_should_hug parameters in - let printed_paramaters = Doc.concat [ - if should_hug || in_callback then Doc.nil else Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; if in_callback then Doc.space else Doc.line]) - (List.map print_exp_fun_parameter parameters) - ] in - Doc.group ( - Doc.concat [ - lparen; - if should_hug || in_callback then printed_paramaters else Doc.indent (printed_paramaters); - if should_hug || in_callback then Doc.nil else Doc.concat [Doc.trailing_comma; Doc.soft_line]; - Doc.rparen; - ] - ) - - and print_exp_fun_parameter (attrs, lbl, default_expr, pattern) = - let (is_uncurried, attrs) = ParsetreeViewer.process_uncurried_attribute attrs in - let uncurried = if is_uncurried then Doc.concat [Doc.dot; Doc.space] else Doc.nil in - let attrs = match attrs with - | [] -> Doc.nil - | attrs -> Doc.concat [ - Doc.join ~sep:Doc.line (List.map print_attribute attrs); - Doc.line; - ] in - (* =defaultValue *) - let default_expr_doc = match default_expr with - | Some expr -> Doc.concat [ - Doc.text "="; - print_expression expr - ] - | None -> Doc.nil - in - (* ~from as hometown - * ~from -> punning *) - let label_with_pattern = match (lbl, pattern) with - | (Asttypes.Nolabel, pattern) -> print_pattern pattern - | ( - (Asttypes.Labelled lbl | Optional lbl), - {ppat_desc = Ppat_var string_loc} - ) when lbl = string_loc.txt -> - Doc.concat [ - Doc.text "~"; - Doc.text lbl; - ] - | ((Asttypes.Labelled lbl | Optional lbl), pattern) -> - Doc.concat [ - Doc.text "~"; - Doc.text lbl; - Doc.text " as "; - print_pattern pattern; - ] - in - let optional_label_suffix = match (lbl, default_expr) with - | (Asttypes.Optional _, None) -> Doc.text "=?" - | _ -> Doc.nil - in - Doc.group ( - Doc.concat [ - uncurried; - attrs; - label_with_pattern; - default_expr_doc; - optional_label_suffix; - ] - ) - - (* - * let x = { - * module Foo = Bar - * exception Exit - * open Belt - * let a = 1 - * let b = 2 - * sideEffect() - * a + b - * } - * What is an expr-block ? Everything between { ... } - *) - and print_expression_block ~braces expr = - let rec collect_rows acc expr = match expr.Parsetree.pexp_desc with - | Parsetree.Pexp_letmodule ({txt = mod_name; loc = mod_loc}, mod_expr, expr) -> - let let_module_doc = Doc.concat [ - Doc.text "module "; - Doc.text mod_name; - Doc.text " = "; - print_mod_expr mod_expr; - ] in - let loc = {mod_loc with loc_end = mod_expr.pmod_loc.loc_end} in - collect_rows ((loc, let_module_doc)::acc) expr - | Pexp_letexception (extension_constructor, expr) -> - let let_exception_doc = print_exception_def extension_constructor in - let loc = extension_constructor.pext_loc in - collect_rows ((loc, let_exception_doc)::acc) expr - | Pexp_open (override_flag, longident_loc, expr) -> - let open_doc = Doc.concat [ - Doc.text "open"; - print_override_flag override_flag; - Doc.space; - print_longident longident_loc.txt; - ] in - let loc = longident_loc.loc in - collect_rows ((loc, open_doc)::acc) expr - | Pexp_sequence (expr1, expr2) -> - let expr_doc = - let doc = print_expression expr1 in - if Parens.block_expr expr1 then add_parens doc else doc - in - let loc = expr1.pexp_loc in - collect_rows ((loc, expr_doc)::acc) expr2 - | Pexp_let (rec_flag, value_bindings, expr) -> - let rec_flag = match rec_flag with - | Asttypes.Nonrecursive -> Doc.nil - | Asttypes.Recursive -> Doc.text "rec " - in - let let_doc = print_value_bindings ~rec_flag value_bindings in - let loc = match (value_bindings, List.rev value_bindings) with - | ({pvb_loc = first_loc}::_,{pvb_loc = last_loc}::_) -> - {first_loc with loc_end = last_loc.loc_end} - | _ -> Location.none - in - collect_rows((loc, let_doc)::acc) expr - | _ -> - let expr_doc = - let doc = print_expression expr in - if Parens.block_expr expr then add_parens doc else doc - in - List.rev ((expr.pexp_loc, expr_doc)::acc) - in - let block = collect_rows [] expr |> interleave_whitespace ~force_break:true in - Doc.breakable_group ~force_break:true ( - if braces then - Doc.concat [ - Doc.lbrace; - Doc.indent ( - Doc.concat [ - Doc.line; - block; - ] - ); - Doc.line; - Doc.rbrace; - ] - else block - ) - - and print_override_flag override_flag = match override_flag with - | Asttypes.Override -> Doc.text "!" - | Fresh -> Doc.nil - - and print_direction_flag flag = match flag with - | Asttypes.Downto -> Doc.text " downto " - | Asttypes.Upto -> Doc.text " to " - - and print_record_row (lbl, expr) = - Doc.concat [ - print_longident lbl.txt; - Doc.text ": "; - print_expression expr; - ] - - and print_bs_object_row (lbl, expr) = - Doc.concat [ - Doc.text "\""; - print_longident lbl.txt; - Doc.text "\""; - Doc.text ": "; - print_expression expr; - ] - (* The optional loc indicates whether we need to print the attributes in - * relation to some location. In practise this means the following: - * `@attr type t = string` -> on the same line, print on the same line - * `@attr - * type t = string` -> attr is on prev line, print the attributes - * with a line break between, we respect the users' original layout *) - and print_attributes ?loc (attrs: Parsetree.attributes) = - match attrs with - | [] -> Doc.nil - | attrs -> - let line_break = match loc with - | None -> Doc.line - | Some loc -> begin match List.rev attrs with - | ({loc = first_loc}, _)::_ when loc.loc_start.pos_lnum > first_loc.loc_end.pos_lnum -> - Doc.literal_line; - | _ -> Doc.line - end - in - Doc.concat [ - Doc.group (Doc.join ~sep:Doc.line (List.map print_attribute attrs)); - line_break; - ] - - and print_attribute ((id, payload) : Parsetree.attribute) = - let attr_name = Doc.text ("@" ^ id.txt) in - match payload with - | PStr [{pstr_desc = Pstr_eval (expr, attrs)}] -> - let expr_doc = print_expression expr in - let needs_parens = match attrs with | [] -> false | _ -> true in - Doc.group ( - Doc.concat [ - attr_name; - add_parens ( - Doc.concat [ - print_attributes attrs; - if needs_parens then add_parens expr_doc else expr_doc; - ] - ) - ] - ) - | _ -> attr_name - - - and print_mod_expr mod_expr = - match mod_expr.pmod_desc with - | Pmod_ident longident_loc -> - print_longident longident_loc.txt - | Pmod_structure structure -> - Doc.breakable_group ~force_break:true ( - Doc.concat [ - Doc.lbrace; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - print_structure structure; - ]; - ); - Doc.soft_line; - Doc.rbrace; - ] - ) - | Pmod_unpack expr -> - let should_hug = match expr.pexp_desc with - | Pexp_let _ -> true - | Pexp_constraint ( - {pexp_desc = Pexp_let _ }, - {ptyp_desc = Ptyp_package package_type} - ) -> true - | _ -> false - in - let (expr, module_constraint) = match expr.pexp_desc with - | Pexp_constraint ( - expr, - {ptyp_desc = Ptyp_package package_type} - ) -> - let type_doc = Doc.group (Doc.concat [ - Doc.text ":"; - Doc.indent ( - Doc.concat [ - Doc.line; - print_package_type ~print_module_keyword_and_parens:false package_type - ] - ) - ]) in - (expr, type_doc) - | _ -> (expr, Doc.nil) - in - let unpack_doc = Doc.group(Doc.concat [ - print_expression expr; - module_constraint; - ]) in - Doc.group ( - Doc.concat [ - Doc.text "unpack("; - if should_hug then unpack_doc - else - Doc.concat [ - Doc.indent ( - Doc.concat [ - Doc.soft_line; - unpack_doc; - ] - ); - Doc.soft_line; - ]; - Doc.rparen; - ] - ) - | Pmod_extension extension -> - print_extension extension - | Pmod_apply _ -> - let (args, call_expr) = ParsetreeViewer.mod_expr_apply mod_expr in - let is_unit_sugar = match args with - | [{pmod_desc = Pmod_structure []}] -> true - | _ -> false - in - let should_hug = match args with - | [{pmod_desc = Pmod_structure _}] -> true - | _ -> false - in - Doc.group ( - Doc.concat [ - print_mod_expr call_expr; - if is_unit_sugar then - print_mod_apply_arg (List.hd args) - else - Doc.concat [ - Doc.lparen; - if should_hug then - print_mod_apply_arg (List.hd args) - else - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) ( - List.map print_mod_apply_arg args - ) - ] - ); - if not should_hug then - Doc.concat [ - Doc.trailing_comma; - Doc.soft_line; - ] - else Doc.nil; - Doc.rparen; - ] - ] - ) - | Pmod_constraint (mod_expr, mod_type) -> - Doc.concat [ - print_mod_expr mod_expr; - Doc.text ": "; - print_mod_type mod_type; - ] - | Pmod_functor _ -> - print_mod_functor mod_expr - - and print_mod_functor mod_expr = - let (parameters, return_mod_expr) = ParsetreeViewer.mod_expr_functor mod_expr in - (* let shouldInline = match returnModExpr.pmod_desc with *) - (* | Pmod_structure _ | Pmod_ident _ -> true *) - (* | Pmod_constraint ({pmod_desc = Pmod_structure _}, _) -> true *) - (* | _ -> false *) - (* in *) - let (return_constraint, return_mod_expr) = match return_mod_expr.pmod_desc with - | Pmod_constraint (mod_expr, mod_type) -> - let constraint_doc = - let doc = print_mod_type mod_type in - if Parens.mod_expr_functor_constraint mod_type then add_parens doc else doc - in - let mod_constraint = Doc.concat [ - Doc.text ": "; - constraint_doc; - ] in - (mod_constraint, print_mod_expr mod_expr) - | _ -> (Doc.nil, print_mod_expr return_mod_expr) - in - let parameters_doc = match parameters with - | [(attrs, {txt = "*"}, None)] -> - let attrs = match attrs with - | [] -> Doc.nil - | attrs -> Doc.concat [ - Doc.join ~sep:Doc.line (List.map print_attribute attrs); - Doc.line; - ] in - Doc.group (Doc.concat [ - attrs; - Doc.text "()" - ]) - | [([], {txt = lbl}, None)] -> Doc.text lbl - | parameters -> - Doc.group ( - Doc.concat [ - Doc.lparen; - Doc.indent ( - Doc.concat [ - Doc.soft_line; - Doc.join ~sep:(Doc.concat [Doc.comma; Doc.line]) ( - List.map print_mod_functor_param parameters - ) - ] - ); - Doc.trailing_comma; - Doc.soft_line; - Doc.rparen; - ] - ) - in - Doc.group ( - Doc.concat [ - parameters_doc; - return_constraint; - Doc.text " => "; - return_mod_expr - - ] - ) - - and print_mod_functor_param (attrs, lbl, opt_mod_type) = - let attrs = match attrs with - | [] -> Doc.nil - | attrs -> Doc.concat [ - Doc.join ~sep:Doc.line (List.map print_attribute attrs); - Doc.line; - ] in - Doc.group ( - Doc.concat [ - attrs; - Doc.text lbl.txt; - (match opt_mod_type with - | None -> Doc.nil - | Some mod_type -> - Doc.concat [ - Doc.text ": "; - print_mod_type mod_type - ]); - ] - ) - - and print_mod_apply_arg mod_expr = - match mod_expr.pmod_desc with - | Pmod_structure [] -> Doc.text "()" - | _ -> print_mod_expr mod_expr - - - and print_exception_def (constr : Parsetree.extension_constructor) = - let kind = match constr.pext_kind with - | Pext_rebind {txt = longident} -> Doc.indent ( - Doc.concat [ - Doc.text " ="; - Doc.line; - print_longident longident; - ] - ) - | Pext_decl (Pcstr_tuple [], None) -> Doc.nil - | Pext_decl (args, gadt) -> - let gadt_doc = match gadt with - | Some typ -> Doc.concat [ - Doc.text ": "; - print_typ_expr typ; - ] - | None -> Doc.nil - in - Doc.concat [ - print_constructor_arguments args; - gadt_doc - ] - in - Doc.group ( - Doc.concat [ - print_attributes constr.pext_attributes; - Doc.text "exception "; - Doc.text constr.pext_name.txt; - kind - ] - ) - - and print_extension_constructor i (constr : Parsetree.extension_constructor) = - let attrs = print_attributes constr.pext_attributes in - let bar = if i > 0 then Doc.text "| " - else Doc.if_breaks (Doc.text "| ") Doc.nil - in - let kind = match constr.pext_kind with - | Pext_rebind {txt = longident} -> Doc.indent ( - Doc.concat [ - Doc.text " ="; - Doc.line; - print_longident longident; - ] - ) - | Pext_decl (Pcstr_tuple [], None) -> Doc.nil - | Pext_decl (args, gadt) -> - let gadt_doc = match gadt with - | Some typ -> Doc.concat [ - Doc.text ": "; - print_typ_expr typ; - ] - | None -> Doc.nil - in - Doc.concat [ - print_constructor_arguments args; - gadt_doc - ] - in - Doc.concat [ - bar; - Doc.group ( - Doc.concat [ - attrs; - Doc.text constr.pext_name.txt; - kind; - ] - ) - ] - - let print_implementation (s: Parsetree.structure) comments src = - let t = CommentAst.init_structure s comments in - - let string_doc = Doc.to_string ~width:80 (print_structure s) in - print_endline string_doc; - print_newline() - - let print_interface (s: Parsetree.signature) = - let string_doc = Doc.to_string ~width:80 (print_signature s) in - print_endline string_doc; - print_newline() -end - diff --git a/jscomp/syntax/benchmarks/data/RedBlackTree.ml b/jscomp/syntax/benchmarks/data/RedBlackTree.ml deleted file mode 100644 index 9d3dcd567b..0000000000 --- a/jscomp/syntax/benchmarks/data/RedBlackTree.ml +++ /dev/null @@ -1,498 +0,0 @@ -type nonrec node_color = - | Red - | Black -type 'value node = - { - mutable left: 'value node option ; - mutable right: 'value node option ; - mutable parent: 'value node option ; - mutable sum: float ; - mutable color: node_color ; - mutable height: float ; - mutable value: 'value } -type nonrec 'value t = - { - mutable size: int ; - mutable root: 'value node option ; - compare: (('value -> 'value -> int)[@bs ]) } -let create_node ~color ~value ~height = - { left = None; right = None; parent = None; sum = 0.; height; value; color - } -external cast_not_option : 'a option -> 'a = "%identity" -let update_sum node = - let left_sum = match node.left with | None -> 0. | Some left -> left.sum in - let right_sum = match node.right with | None -> 0. | Some right -> right.sum in - node.sum <- ((left_sum +. right_sum) +. node.height) -let rec update_sum_recursive rbt node = - update_sum node; - (match node.parent with - | None -> () - | Some parent -> rbt |. (update_sum_recursive parent)) -let grand_parent_of node = - match node.parent with | None -> None | Some ref_ -> ref_.parent -let is_left node = - match node.parent with - | None -> false - | Some parent -> (Some node) == parent.left -let left_or_right_set ~node x value = - ((if is_left node then x.left <- value else x.right <- value)[@res.ternary ]) -let sibling_of node = - if is_left node - then (cast_not_option node.parent).right - else (cast_not_option node.parent).left -let uncle_of node = - match grand_parent_of node with - | None -> None - | Some grand_parent_of_node -> - if is_left (cast_not_option node.parent) - then grand_parent_of_node.right - else grand_parent_of_node.left -let rec find_node rbt node value = - match node with - | None -> None - | Some node -> - let cmp = ((rbt.compare value node.value)[@bs ]) in - if cmp == 0 - then Some node - else - if cmp < 0 - then find_node rbt node.left value - else find_node rbt node.right value -let has rbt value = (find_node rbt rbt.root value) != None -let rec peek_min_node node = - match node with - | None -> None - | Some node -> - ((if node.left == None then Some node else node.left |. peek_min_node) - [@res.ternary ]) -let rec peek_max_node node = - match node with - | None -> None - | Some node -> - ((if node.right == None then Some node else node.right |. peek_max_node) - [@res.ternary ]) -let rotate_left rbt node = - let parent = node.parent in - let right = node.right in - (match parent with - | Some parent -> parent |. (left_or_right_set ~node right) - | None -> rbt.root <- right); - node.parent <- right; - (let right = right |. cast_not_option in - let right_left = right.left in - node.right <- right_left; - (match right_left with - | Some right_left -> right_left.parent <- (Some node) - | None -> ()); - right.parent <- parent; - right.left <- (Some node); - update_sum node; - update_sum right) -let rotate_right rbt node = - let parent = node.parent in - let left = node.left in - (match parent with - | Some parent -> parent |. (left_or_right_set ~node left) - | None -> rbt.root <- left); - node.parent <- left; - (let left = left |. cast_not_option in - let left_right = left.right in - node.left <- left_right; - (match left_right with - | Some left_right -> left_right.parent <- (Some node) - | None -> ()); - left.parent <- parent; - left.right <- (Some node); - update_sum node; - update_sum left) -let rec find_insert rbt node node_to_insert value = - match node with - | None -> None - | Some node -> - let cmp = ((rbt.compare value node.value)[@bs ]) in - if cmp == 0 - then Some node - else - if cmp < 0 - then - (if node.left != None - then rbt |. (find_insert node.left node_to_insert value) - else - (node_to_insert.parent <- (Some node); - node.left <- (Some node_to_insert); - None)) - else - if node.right != None - then rbt |. (find_insert node.right node_to_insert value) - else - (node_to_insert.parent <- (Some node); - node.right <- (Some node_to_insert); - None) -let rec _addLoop rbt current_node = - if (Some current_node) == rbt.root - then current_node.color <- Black - else - if (current_node.parent |. cast_not_option).color == Black - then () - else - if - (let uncle = uncle_of current_node in - (uncle != None) && ((uncle |. cast_not_option).color == Red)) - then - ((current_node.parent |. cast_not_option).color <- Black; - ((uncle_of current_node) |. cast_not_option).color <- Black; - ((grand_parent_of current_node) |. cast_not_option).color <- Red; - _addLoop rbt ((grand_parent_of current_node) |. cast_not_option)) - else - (let current_node = - if - (not (is_left current_node)) && - (is_left (current_node.parent |. cast_not_option)) - then - (rotate_left rbt (current_node.parent |. cast_not_option); - current_node.left |. cast_not_option) - else - if - (is_left current_node) && - (not (is_left (current_node.parent |. cast_not_option))) - then - (rotate_right rbt (current_node.parent |. cast_not_option); - current_node.right |. cast_not_option) - else current_node in - (current_node.parent |. cast_not_option).color <- Black; - ((grand_parent_of current_node) |. cast_not_option).color <- Red; - if is_left current_node - then rotate_right rbt ((grand_parent_of current_node) |. cast_not_option) - else rotate_left rbt ((grand_parent_of current_node) |. cast_not_option)) -let add rbt value ~height = - rbt.size <- (rbt.size + 1); - (let node_to_insert = create_node ~value ~color:Red ~height in - let inserted = - if rbt.root == None - then (rbt.root <- (Some node_to_insert); true) - else - (let found_node = find_insert rbt rbt.root node_to_insert value in - found_node == None) in - if inserted - then - (rbt |. (update_sum_recursive node_to_insert); - _addLoop rbt node_to_insert; - Some node_to_insert) - else None) -let remove_node rbt node = - let node_to_remove = - match ((node.left), (node.right)) with - | (Some _, Some _) -> - let successor = (peek_min_node node.right) |. cast_not_option in - (node.value <- (successor.value); - node.height <- (successor.height); - successor) - | _ -> node in - let successor = - match node_to_remove.left with | None -> node_to_remove.right | left -> left in - let (successor, is_leaf) = - match successor with - | None -> - let leaf = create_node ~value:([%raw "0"]) ~color:Black ~height:0. in - let is_leaf = ((fun x -> x == leaf)[@bs ]) in (leaf, is_leaf) - | Some successor -> (successor, (((fun _ -> false))[@bs ])) in - let node_parent = node_to_remove.parent in - successor.parent <- node_parent; - (match node_parent with - | None -> () - | Some parent -> - parent |. (left_or_right_set ~node:node_to_remove (Some successor))); - rbt |. (update_sum_recursive successor); - if node_to_remove.color == Black - then - (if successor.color == Red - then - (successor.color <- Black; - if successor.parent == None then rbt.root <- (Some successor)) - else - (let break = ref false in - let successor_ref = ref successor in - while not break.contents do - let successor = successor_ref.contents in - match successor.parent with - | None -> (rbt.root <- (Some successor); break.contents <- true) - | Some successor_parent -> - let sibling = sibling_of successor in - (if - (sibling != None) && - ((sibling |. cast_not_option).color == Red) - then - (successor_parent.color <- Red; - (sibling |. cast_not_option).color <- Black; - if is_left successor - then rotate_left rbt successor_parent - else rotate_right rbt successor_parent); - (let sibling = sibling_of successor in - let sibling_n_n = sibling |. cast_not_option in - if - (successor_parent.color == Black) && - ((sibling == None) || - (((sibling_n_n.color == Black) && - ((sibling_n_n.left == None) || - ((sibling_n_n.left |. cast_not_option).color == - Black))) - && - ((sibling_n_n.right == None) || - ((sibling_n_n.right |. cast_not_option).color == - Black)))) - then - (if sibling != None then sibling_n_n.color <- Red; - successor_ref.contents <- successor_parent) - else - if - (successor_parent.color == Red) && - ((sibling == None) || - (((sibling_n_n.color == Black) && - ((sibling_n_n.left == None) || - ((sibling_n_n.left |. cast_not_option).color == - Black))) - && - ((sibling_n_n.right == None) || - ((sibling_n_n.right |. cast_not_option).color == - Black)))) - then - (if sibling != None then sibling_n_n.color <- Red; - successor_parent.color <- Black; - break.contents <- true) - else - if - (sibling != None) && - ((sibling |. cast_not_option).color == Black) - then - (let sibling = sibling |. cast_not_option in - if - (((is_left successor) && - ((sibling.right == None) || - ((sibling.right |. cast_not_option).color == - Black))) - && (sibling.left != None)) - && ((sibling.left |. cast_not_option).color == Red) - then - (sibling.color <- Red; - (sibling.left |. cast_not_option).color <- Black; - rotate_right rbt sibling) - else - if - (((not (is_left successor)) && - ((sibling.left == None) || - ((sibling.left |. cast_not_option).color == - Black))) - && (sibling.right != None)) - && - ((sibling.right |. cast_not_option).color == Red) - then - (sibling.color <- Red; - (sibling.right |. cast_not_option).color <- Black; - rotate_left rbt sibling); - break.contents <- true) - else - (let sibling = sibling_of successor in - let sibling = sibling |. cast_not_option in - sibling.color <- (successor_parent.color); - if is_left successor - then - ((sibling.right |. cast_not_option).color <- Black; - rotate_right rbt successor_parent) - else - ((sibling.left |. cast_not_option).color <- Black; - rotate_left rbt successor_parent)))) - done)); - if ((is_leaf successor)[@bs ]) - then - (if rbt.root == (Some successor) then rbt.root <- None; - (match successor.parent with - | None -> () - | Some parent -> parent |. (left_or_right_set ~node:successor None))) -let remove rbt value = - match find_node rbt rbt.root value with - | Some node -> (rbt |. (remove_node node); rbt.size <- (rbt.size - 1); true) - | None -> false -let rec find_node_through_callback rbt node cb = - match node with - | None -> None - | Some node -> - let cmp = ((cb node)[@bs ]) in - if cmp == 0 - then Some node - else - if cmp < 0 - then find_node_through_callback rbt node.left cb - else find_node_through_callback rbt node.right cb -let remove_through_callback rbt cb = - match find_node_through_callback rbt rbt.root cb with - | Some node -> (rbt |. (remove_node node); rbt.size <- (rbt.size - 1); true) - | None -> false -let make ~compare = { size = 0; root = None; compare } -let make_with array ~compare = - let rbt = make ~compare in - array |. - (Js.Array2.for_each - (fun (value, height) -> (add rbt value ~height) |. ignore)); - rbt -let rec height_of_interval rbt node lhs rhs = - match node with - | None -> 0. - | Some n -> - if (lhs == None) && (rhs == None) - then n.sum - else - if - (lhs != None) && - (((rbt.compare n.value (lhs |. cast_not_option))[@bs ]) < 0) - then rbt |. (height_of_interval n.right lhs rhs) - else - if - (rhs != None) && - (((rbt.compare n.value (rhs |. cast_not_option))[@bs ]) > 0) - then rbt |. (height_of_interval n.left lhs rhs) - else - (n.height +. (rbt |. (height_of_interval n.left lhs None))) +. - (rbt |. (height_of_interval n.right None rhs)) -let height_of_interval rbt lhs rhs = height_of_interval rbt rbt.root lhs rhs -let rec first_visible_node node top = - match node with - | None -> None - | Some node -> - if node.sum <= top - then None - else - (let node_height = node.height in - let sum_left = - match node.left with | None -> 0.0 | Some left -> left.sum in - if sum_left > top - then first_visible_node node.left top - else - if (sum_left +. node_height) > top - then Some node - else - (let offset = sum_left +. node_height in - first_visible_node node.right (top -. offset))) -let last_visible_node node top = - match first_visible_node node top with - | None -> node |. peek_max_node - | first -> first -let first_visible_value rbt ~top = - match first_visible_node rbt.root top with - | None -> None - | Some node -> Some (node.value) -let rec leftmost node = - match node.left with | None -> node | Some node -> node |. leftmost -let rec first_right_parent node = - match node.parent with - | None -> None - | Some parent -> - ((if is_left node then Some parent else parent |. first_right_parent) - [@res.ternary ]) -let next_node node = - match node.right with - | None -> node |. first_right_parent - | Some right -> Some (right |. leftmost) -let rec sum_left_spine node ~from_right_child = - let left_spine = - match node.left with - | None -> node.height - | Some left -> ((if from_right_child then node.height +. left.sum else 0.0) - [@res.ternary ]) in - match node.parent with - | None -> left_spine - | Some parent -> - left_spine +. - (parent |. - (sum_left_spine ~from_right_child:(parent.right == (Some node)))) -let get_y node = (node |. (sum_left_spine ~from_right_child:true)) -. node.height -let rec iterate ~inclusive first_node last_node ~callback = - match first_node with - | None -> () - | Some node -> - (if inclusive then ((callback node)[@bs ]); - if first_node != last_node - then - (if not inclusive then ((callback node)[@bs ]); - iterate ~inclusive (node |. next_node) last_node ~callback)) -let rec iterate_with_y ?y ~inclusive first_node last_node ~callback = - match first_node with - | None -> () - | Some node -> - let y = match y with | None -> node |. get_y | Some y -> y in - (if inclusive then ((callback node y)[@bs ]); - if first_node != last_node - then - (if not inclusive then ((callback node y)[@bs ]); - iterate_with_y ~y:(y +. node.height) ~inclusive (node |. next_node) - last_node ~callback)) -let rec update_sum node ~delta = - match node with - | None -> () - | Some node -> - (node.sum <- (node.sum +. delta); node.parent |. (update_sum ~delta)) -let update_height node ~height = - let delta = height -. node.height in - node.height <- height; (Some node) |. (update_sum ~delta) -type nonrec 'value old_new_visible = - { - mutable old: 'value array ; - mutable new_: 'value array } -let get_anchor_delta rbt ~anchor = - match anchor with - | None -> 0.0 - | Some (value, y) -> - (match rbt |. (find_node rbt.root value) with - | Some node -> y -. (node |. get_y) - | None -> 0.0) -let on_changed_visible ?(anchor= None) rbt ~old_new_visible ~top:top_ - ~bottom:bottom_ ~appear ~remained ~disappear = - let old = old_new_visible.new_ in - let new_ = old_new_visible.old in - (new_ |. - (Js.Array2.remove_count_in_place ~pos:0 ~count:(new_ |. Js.Array2.length))) - |. ignore; - old_new_visible.old <- old; - old_new_visible.new_ <- new_; - (let anchor_delta = rbt |. (get_anchor_delta ~anchor) in - let top = top_ -. anchor_delta in - let top = ((if top < 0.0 then 0.0 else top)[@res.ternary ]) in - let bottom = bottom_ -. anchor_delta in - let first = first_visible_node rbt.root top in - let last = last_visible_node rbt.root bottom in - let old_len = old |. Js.Array2.length in - let old_iter = ref 0 in - iterate_with_y ~inclusive:true first last - ((fun node -> - fun y_ -> - let y = y_ +. anchor_delta in - if y >= 0.0 - then - (while - (old_iter.contents < old_len) && - (((rbt.compare (Js.Array2.unsafe_get old old_iter.contents) - node.value) - [@bs ]) < 0) - do - (((disappear (Js.Array2.unsafe_get old old_iter.contents)) - [@bs ]); - old_iter.contents <- (old_iter.contents + 1)) - done; - (new_ |. (Js.Array2.push node.value)) |. ignore; - if old_iter.contents < old_len - then - (let cmp = - ((rbt.compare (Js.Array2.unsafe_get old old_iter.contents) - node.value) - [@bs ]) in - if cmp = 0 - then - (((remained node y) - [@bs ]); - old_iter.contents <- (old_iter.contents + 1)) - else ((appear node y)[@bs ])) - else ((appear node y)[@bs ])))[@bs ]); - while old_iter.contents < old_len do - (((disappear (Js.Array2.unsafe_get old old_iter.contents)) - [@bs ]); - old_iter.contents <- (old_iter.contents + 1)) - done) diff --git a/jscomp/syntax/cli/res_cli.ml b/jscomp/syntax/cli/res_cli.ml index 7f981f22f5..649d76cc04 100644 --- a/jscomp/syntax/cli/res_cli.ml +++ b/jscomp/syntax/cli/res_cli.ml @@ -235,7 +235,7 @@ module CliArgProcessor = struct let print_engine = match target with | "binary" -> Res_driver_binary.print_engine - | "ml" -> Res_driver_ml_parser.print_engine + | "ml" -> Res_driver_ml_printer.print_engine | "ast" -> Res_ast_debugger.print_engine | "sexp" -> Res_ast_debugger.sexp_print_engine | "comments" -> Res_ast_debugger.comments_print_engine diff --git a/jscomp/syntax/src/res_comment.ml b/jscomp/syntax/src/res_comment.ml index d4e7bd0a42..f03209f829 100644 --- a/jscomp/syntax/src/res_comment.ml +++ b/jscomp/syntax/src/res_comment.ml @@ -47,9 +47,6 @@ let make_multi_line_comment ~loc ~doc_comment ~standalone txt = prev_tok_end_pos = Lexing.dummy_pos; } -let from_ocaml_comment ~loc ~txt ~prev_tok_end_pos = - {txt; loc; style = MultiLine; prev_tok_end_pos} - let trim_spaces s = let len = String.length s in if len = 0 then s diff --git a/jscomp/syntax/src/res_comment.mli b/jscomp/syntax/src/res_comment.mli index 7cf10edd47..ce788ddb6c 100644 --- a/jscomp/syntax/src/res_comment.mli +++ b/jscomp/syntax/src/res_comment.mli @@ -17,6 +17,4 @@ val is_single_line_comment : t -> bool val make_single_line_comment : loc:Location.t -> string -> t val make_multi_line_comment : loc:Location.t -> doc_comment:bool -> standalone:bool -> string -> t -val from_ocaml_comment : - loc:Location.t -> txt:string -> prev_tok_end_pos:Lexing.position -> t val trim_spaces : string -> string diff --git a/jscomp/syntax/src/res_driver_ml_parser.ml b/jscomp/syntax/src/res_driver_ml_parser.ml deleted file mode 100644 index 6eced790f4..0000000000 --- a/jscomp/syntax/src/res_driver_ml_parser.ml +++ /dev/null @@ -1,53 +0,0 @@ -module OcamlParser = Parser -module IO = Res_io - -let extract_ocaml_concrete_syntax filename = - let lexbuf = - if String.length filename > 0 then - IO.read_file ~filename |> Lexing.from_string - else Lexing.from_channel stdin - in - let string_locs = ref [] in - let comment_data = ref [] in - let rec next (prev_tok_end_pos : Lexing.position) () = - let token = Lexer.token_with_comments lexbuf in - match token with - | OcamlParser.COMMENT (txt, loc) -> - let comment = - Res_comment.from_ocaml_comment ~loc ~prev_tok_end_pos ~txt - in - comment_data := comment :: !comment_data; - next loc.Location.loc_end () - | OcamlParser.STRING (_txt, None) -> - let open Location in - let loc = - { - loc_start = lexbuf.lex_start_p; - loc_end = lexbuf.Lexing.lex_curr_p; - loc_ghost = false; - } - in - let len = loc.loc_end.pos_cnum - loc.loc_start.pos_cnum in - let txt = - Bytes.to_string - ((Bytes.sub [@doesNotRaise]) lexbuf.Lexing.lex_buffer - loc.loc_start.pos_cnum len) - in - string_locs := (txt, loc) :: !string_locs; - next lexbuf.Lexing.lex_curr_p () - | OcamlParser.EOF -> () - | _ -> next lexbuf.Lexing.lex_curr_p () - in - next lexbuf.Lexing.lex_start_p (); - (List.rev !string_locs, List.rev !comment_data) - -let print_engine = - Res_driver. - { - print_implementation = - (fun ~width:_ ~filename:_ ~comments:_ structure -> - Pprintast.structure Format.std_formatter structure); - print_interface = - (fun ~width:_ ~filename:_ ~comments:_ signature -> - Pprintast.signature Format.std_formatter signature); - } diff --git a/jscomp/syntax/src/res_driver_ml_parser.mli b/jscomp/syntax/src/res_driver_ml_parser.mli deleted file mode 100644 index 53d298c99f..0000000000 --- a/jscomp/syntax/src/res_driver_ml_parser.mli +++ /dev/null @@ -1,8 +0,0 @@ -(* This module represents a general interface to parse marshalled reason ast *) - -(* extracts comments and the original string data from an ocaml file *) -val extract_ocaml_concrete_syntax : - string -> (string * Location.t) list * Res_comment.t list -[@@live] - -val print_engine : Res_driver.print_engine diff --git a/jscomp/syntax/src/res_driver_ml_printer.ml b/jscomp/syntax/src/res_driver_ml_printer.ml new file mode 100644 index 0000000000..651ab05840 --- /dev/null +++ b/jscomp/syntax/src/res_driver_ml_printer.ml @@ -0,0 +1,10 @@ +let print_engine = + Res_driver. + { + print_implementation = + (fun ~width:_ ~filename:_ ~comments:_ structure -> + Pprintast.structure Format.std_formatter structure); + print_interface = + (fun ~width:_ ~filename:_ ~comments:_ signature -> + Pprintast.signature Format.std_formatter signature); + } diff --git a/jscomp/syntax/src/res_driver_ml_printer.mli b/jscomp/syntax/src/res_driver_ml_printer.mli new file mode 100644 index 0000000000..46358ea375 --- /dev/null +++ b/jscomp/syntax/src/res_driver_ml_printer.mli @@ -0,0 +1 @@ +val print_engine : Res_driver.print_engine diff --git a/jscomp/syntax/src/res_multi_printer.ml b/jscomp/syntax/src/res_multi_printer.ml index 5f04aa065c..3a9c108d5a 100644 --- a/jscomp/syntax/src/res_multi_printer.ml +++ b/jscomp/syntax/src/res_multi_printer.ml @@ -88,13 +88,12 @@ let print_res ~ignore_parse_errors ~is_interface ~filename = [@@raises exit] (* print the given file named input to from "language" to res, general interface exposed by the compiler *) -let print ?(ignore_parse_errors = false) language ~input = +let print ?(ignore_parse_errors = false) input = let is_interface = let len = String.length input in len > 0 && String.unsafe_get input (len - 1) = 'i' in - match language with - | `res -> print_res ~ignore_parse_errors ~is_interface ~filename:input + print_res ~ignore_parse_errors ~is_interface ~filename:input [@@raises exit] (* suppress unused optional arg *) diff --git a/jscomp/syntax/src/res_multi_printer.mli b/jscomp/syntax/src/res_multi_printer.mli index 178e799d5b..bcfa6ce75b 100644 --- a/jscomp/syntax/src/res_multi_printer.mli +++ b/jscomp/syntax/src/res_multi_printer.mli @@ -1,3 +1,3 @@ -(* Interface to print source code from different languages to res. +(* Interface to print source code to res. * Takes a filename called "input" and returns the corresponding formatted res syntax *) -val print : ?ignore_parse_errors:bool -> [`res] -> input:string -> string +val print : ?ignore_parse_errors:bool -> string -> string diff --git a/jscomp/syntax/testrunner/res_test.ml b/jscomp/syntax/testrunner/res_test.ml index e800b5666b..79e3931e03 100644 --- a/jscomp/syntax/testrunner/res_test.ml +++ b/jscomp/syntax/testrunner/res_test.ml @@ -5,7 +5,7 @@ let data_dir = "jscomp/syntax/tests" (* test printing of .res file*) let () = let filename = Filename.concat data_dir "api/resSyntax.res" in - let pretty_source = Res_multi_printer.print `res ~input:filename in + let pretty_source = Res_multi_printer.print filename in assert ( pretty_source = {|// test file @@ -20,7 +20,7 @@ if true { (* test printing of .resi file*) let () = let filename = Filename.concat data_dir "api/resiSyntax.resi" in - let pretty_source = Res_multi_printer.print `res ~input:filename in + let pretty_source = Res_multi_printer.print filename in assert (pretty_source = {|// test interface file let x: int