diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6576fa694d..0d7849d927 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -148,7 +148,8 @@ Follow these steps to upgrade the vendored Flow parser within Melange: ```shell $ cp \ ${FLOW_SRC}/src/parser/*.ml{,i} \ - ${FLOW_SRC}/src/hack_forked/utils/third_party/flow_{set,map}.ml \ + ${FLOW_SRC}/src/hack_forked/utils/collections/third-party/flow_{set,map}.ml \ + ${FLOW_SRC}/src/third-party/sedlex/flow_sedlexing.ml{,i} \ ${MELANGE_SRC}/jscomp/js_parser ``` @@ -159,6 +160,7 @@ $ cp \ For `.ml` files: ```ocaml +(* (executable (name x) (libraries compiler-libs.common)) *) let () = let ast = Pparse.read_ast Structure Sys.argv.(1) in Format.printf "%a" Pprintast.structure ast @@ -167,6 +169,7 @@ let () = For `.mli` files: ```ocaml +(* (executable (name x) (libraries compiler-libs.common)) *) let () = let ast = Pparse.read_ast Signature Sys.argv.(1) in Format.printf "%a" Pprintast.signature ast diff --git a/Changes.md b/Changes.md index f2db05d080..2fa7aa7626 100644 --- a/Changes.md +++ b/Changes.md @@ -3,6 +3,9 @@ Unreleased - Support `Sys.opaque_identity` to turn off optimizations ([#1276](https://github.com/melange-re/melange/pull/1276)) +- Upgrade the Melange JS parser to [Flow + v0.266.0](https://github.com/facebook/flow/releases/tag/v0.266.0) + ([#1380](https://github.com/melange-re/melange/pull/1380)) 5.1.0-53 2025-03-23 --------------- diff --git a/jscomp/js_parser/comment_attachment.ml b/jscomp/js_parser/comment_attachment.ml index 8debd8378f..da9e72fd4e 100644 --- a/jscomp/js_parser/comment_attachment.ml +++ b/jscomp/js_parser/comment_attachment.ml @@ -539,6 +539,8 @@ let statement_add_comments DeclareModule { s with DeclareModule.comments = merge_comments comments } | DeclareModuleExports ({ DeclareModuleExports.comments; _ } as s) -> DeclareModuleExports { s with DeclareModuleExports.comments = merge_comments comments } + | DeclareNamespace ({ DeclareNamespace.comments; _ } as s) -> + DeclareNamespace { s with DeclareNamespace.comments = merge_comments comments } | DeclareTypeAlias ({ TypeAlias.comments; _ } as s) -> DeclareTypeAlias { s with TypeAlias.comments = merge_comments comments } | DeclareOpaqueType ({ OpaqueType.comments; _ } as s) -> @@ -571,6 +573,8 @@ let statement_add_comments InterfaceDeclaration { s with Interface.comments = merge_comments comments } | Labeled ({ Labeled.comments; _ } as s) -> Labeled { s with Labeled.comments = merge_comments comments } + | Match ({ Match.comments; _ } as s) -> + Match { s with Match.comments = merge_comments comments } | Return ({ Return.comments; _ } as s) -> Return { s with Return.comments = merge_comments comments } | Switch ({ Switch.comments; _ } as s) -> @@ -741,6 +745,16 @@ let object_pattern_property_comment_bounds loc property = ignore (collector#pattern_object_p property); collect_without_trailing_line_comment collector +let match_expression_case_comment_bounds (loc, case) = + let collector = new comment_bounds_collector ~loc in + ignore (collector#match_case ~on_case_body:collector#expression (loc, case)); + collector#comment_bounds + +let match_statement_case_comment_bounds (loc, case) = + let collector = new comment_bounds_collector ~loc in + ignore (collector#match_case ~on_case_body:collector#statement (loc, case)); + collector#comment_bounds + let switch_case_comment_bounds (loc, case) = let collector = new comment_bounds_collector ~loc in ignore (collector#switch_case (loc, case)); diff --git a/jscomp/js_parser/declaration_parser.ml b/jscomp/js_parser/declaration_parser.ml index 0decf677c6..c194fd829f 100644 --- a/jscomp/js_parser/declaration_parser.ml +++ b/jscomp/js_parser/declaration_parser.ml @@ -5,75 +5,14 @@ * LICENSE file in the root directory of this source tree. *) -module Ast = Flow_ast open Token open Parser_common open Parser_env open Flow_ast open Comment_attachment -module type DECLARATION = sig - val async : env -> bool * Loc.t Comment.t list - - val generator : env -> bool * Loc.t Comment.t list - - val variance : env -> parse_readonly:bool -> bool -> bool -> Loc.t Variance.t option - - val function_params : await:bool -> yield:bool -> env -> (Loc.t, Loc.t) Ast.Function.Params.t - - val function_body : - env -> - async:bool -> - generator:bool -> - expression:bool -> - simple_params:bool -> - (Loc.t, Loc.t) Function.body * bool - - val check_unique_formal_parameters : env -> (Loc.t, Loc.t) Ast.Function.Params.t -> unit - - val check_unique_component_formal_parameters : - env -> (Loc.t, Loc.t) Ast.Statement.ComponentDeclaration.Params.t -> unit - - val strict_function_post_check : - env -> - contains_use_strict:bool -> - (Loc.t, Loc.t) Identifier.t option -> - (Loc.t, Loc.t) Ast.Function.Params.t -> - unit - - val strict_component_post_check : - env -> - contains_use_strict:bool -> - (Loc.t, Loc.t) Identifier.t -> - (Loc.t, Loc.t) Ast.Statement.ComponentDeclaration.Params.t -> - unit - - val let_ : - env -> - (Loc.t, Loc.t) Statement.VariableDeclaration.Declarator.t list - * Loc.t Ast.Comment.t list - * (Loc.t * Parse_error.t) list - - val const : - env -> - (Loc.t, Loc.t) Statement.VariableDeclaration.Declarator.t list - * Loc.t Ast.Comment.t list - * (Loc.t * Parse_error.t) list - - val var : - env -> - (Loc.t, Loc.t) Statement.VariableDeclaration.Declarator.t list - * Loc.t Ast.Comment.t list - * (Loc.t * Parse_error.t) list - - val _function : env -> (Loc.t, Loc.t) Statement.t - - val enum_declaration : ?leading:Loc.t Comment.t list -> env -> (Loc.t, Loc.t) Statement.t - - val component : env -> (Loc.t, Loc.t) Statement.t -end - -module Declaration (Parse : Parser_common.PARSER) (Type : Type_parser.TYPE) : DECLARATION = struct +module Declaration (Parse : Parser_common.PARSER) (Type : Parser_common.TYPE) : + Parser_common.DECLARATION = struct module Enum = Enum_parser.Enum (Parse) let check_param = @@ -371,12 +310,22 @@ module Declaration (Parse : Parser_common.PARSER) (Type : Type_parser.TYPE) : DE let _function = with_loc (fun env -> let (async, leading_async) = async env in - let (sig_loc, (generator, tparams, id, params, return, predicate, leading)) = + let (sig_loc, (generator, effect_, tparams, id, params, return, predicate, leading)) = with_loc (fun env -> let leading_function = Peek.comments env in - Expect.token env T_FUNCTION; - let (generator, leading_generator) = generator env in + let (effect_, (generator, leading_generator)) = + match Peek.token env with + | T_FUNCTION -> + Eat.token env; + (Function.Arbitrary, generator env) + | T_IDENTIFIER { raw = "hook"; _ } when not async -> + Eat.token env; + (Function.Hook, (false, [])) + | t -> + Expect.error env t; + (Function.Arbitrary, generator env) + in let leading = List.concat [leading_async; leading_function; leading_generator] in let (tparams, id) = match (in_export_default env, Peek.token env) with @@ -423,7 +372,7 @@ module Declaration (Parse : Parser_common.PARSER) (Type : Type_parser.TYPE) : DE | None -> (return_annotation_remove_trailing env return, predicate) | Some _ -> (return, predicate_remove_trailing env predicate) in - (generator, tparams, id, params, return, predicate, leading)) + (generator, effect_, tparams, id, params, return, predicate, leading)) env in let simple_params = is_simple_parameter_list params in @@ -437,6 +386,7 @@ module Declaration (Parse : Parser_common.PARSER) (Type : Type_parser.TYPE) : DE params; body; generator; + effect_; async; predicate; return; @@ -567,6 +517,13 @@ module Declaration (Parse : Parser_common.PARSER) (Type : Type_parser.TYPE) : DE let name = Statement.ComponentDeclaration.Param.Identifier (identifier_name env) in Expect.identifier env "as"; (name, Parse.pattern env Parse_error.StrictParamName, false) + | (T_LCURLY, _) -> + error env Parse_error.InvalidComponentParamName; + let fake_name_loc = Peek.loc env in + let fallback_ident = (fake_name_loc, { Ast.Identifier.name = ""; comments = None }) in + let name = Statement.ComponentDeclaration.Param.Identifier fallback_ident in + let local = Parse.pattern env Parse_error.StrictParamName in + (name, local, false) | (_, _) -> let id = Parse.identifier_with_type env Parse_error.StrictParamName in (match id with @@ -592,6 +549,7 @@ module Declaration (Parse : Parser_common.PARSER) (Type : Type_parser.TYPE) : DE let rest = rest_param env t |> Option.map (fun (loc, id, comments) -> + if Peek.token env = T_COMMA then Eat.token env; (loc, { Statement.ComponentDeclaration.RestParam.argument = id; comments }) ) in diff --git a/jscomp/js_parser/declaration_parser.mli b/jscomp/js_parser/declaration_parser.mli new file mode 100644 index 0000000000..cd6fe0f434 --- /dev/null +++ b/jscomp/js_parser/declaration_parser.mli @@ -0,0 +1,8 @@ +(* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + *) + +module Declaration (_ : Parser_common.PARSER) (_ : Parser_common.TYPE) : Parser_common.DECLARATION diff --git a/jscomp/js_parser/enum_common.ml b/jscomp/js_parser/enum_common.ml index a94594dc66..ea0a3bd573 100644 --- a/jscomp/js_parser/enum_common.ml +++ b/jscomp/js_parser/enum_common.ml @@ -4,27 +4,31 @@ type explicit_type = | String | Symbol | BigInt [@@deriving ord] -let rec compare_explicit_type : - explicit_type -> explicit_type -> int = - (( - fun lhs -> - fun rhs -> - match (lhs, rhs) with - | (Boolean, Boolean) -> 0 - | (Number, Number) -> 0 - | (String, String) -> 0 - | (Symbol, Symbol) -> 0 - | (BigInt, BigInt) -> 0 - | _ -> - let to_int = - function - | Boolean -> 0 - | Number -> 1 - | String -> 2 - | Symbol -> 3 - | BigInt -> 4 in - compare (to_int lhs) (to_int rhs)) - [@ocaml.warning "-A"])[@@ocaml.warning "-39"] +include + struct + let _ = fun (_ : explicit_type) -> () + let rec compare_explicit_type : + explicit_type -> explicit_type -> int = + (( + fun lhs rhs -> + match (lhs, rhs) with + | (Boolean, Boolean) -> 0 + | (Number, Number) -> 0 + | (String, String) -> 0 + | (Symbol, Symbol) -> 0 + | (BigInt, BigInt) -> 0 + | _ -> + let to_int = + function + | Boolean -> 0 + | Number -> 1 + | String -> 2 + | Symbol -> 3 + | BigInt -> 4 in + compare (to_int lhs) (to_int rhs)) + [@ocaml.warning "-39"][@ocaml.warning "-A"])[@@ocaml.warning "-39"] + let _ = compare_explicit_type + end[@@ocaml.doc "@inline"][@@merlin.hide ] let string_of_explicit_type = function | Boolean -> "boolean" diff --git a/jscomp/js_parser/enum_parser.ml b/jscomp/js_parser/enum_parser.ml index eb32d0cd59..e2a9a5db77 100644 --- a/jscomp/js_parser/enum_parser.ml +++ b/jscomp/js_parser/enum_parser.ml @@ -64,24 +64,37 @@ end = struct true | _ -> false + let number_init env loc ~neg ~leading ~kind ~raw = + let value = Parse.number env kind raw in + let (value, raw) = + if neg then + (-.value, "-" ^ raw) + else + (value, raw) + in + let trailing = Eat.trailing_comments env in + if end_of_member_init env then + NumberInit + ( loc, + { + NumberLiteral.value; + raw; + comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing (); + } + ) + else + InvalidInit loc + let member_init env = let loc = Peek.loc env in let leading = Peek.comments env in match Peek.token env with - | T_NUMBER { kind; raw } -> - let value = Parse.number env kind raw in - let trailing = Eat.trailing_comments env in - if end_of_member_init env then - NumberInit - ( loc, - { - NumberLiteral.value; - raw; - comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing (); - } - ) - else - InvalidInit loc + | T_MINUS -> + Eat.token env; + (match Peek.token env with + | T_NUMBER { kind; raw } -> number_init env loc ~neg:true ~leading ~kind ~raw + | _ -> InvalidInit loc) + | T_NUMBER { kind; raw } -> number_init env loc ~neg:false ~leading ~kind ~raw | T_STRING (loc, value, raw, octal) -> if octal then strict_error env Parse_error.StrictOctalLiteral; Eat.token env; @@ -404,6 +417,7 @@ end = struct | None -> let bools_len = List.length members.boolean_members in let nums_len = List.length members.number_members in + let bigints_len = List.length members.bigint_members in let strs_len = List.length members.string_members in let defaulted_len = List.length members.defaulted_members in let empty () = @@ -416,9 +430,9 @@ end = struct } in begin - match (bools_len, nums_len, strs_len, defaulted_len) with - | (0, 0, 0, 0) -> empty () - | (0, 0, _, _) -> + match (bools_len, nums_len, bigints_len, strs_len, defaulted_len) with + | (0, 0, 0, 0, 0) -> empty () + | (0, 0, 0, _, _) -> string_body ~env ~enum_name @@ -427,7 +441,7 @@ end = struct members.string_members members.defaulted_members comments - | (_, 0, 0, _) when bools_len >= defaulted_len -> + | (_, 0, 0, 0, _) when bools_len >= defaulted_len -> List.iter (fun (loc, { DefaultedMember.id = (_, { Identifier.name = member_name; _ }) }) -> error_at @@ -441,7 +455,7 @@ end = struct has_unknown_members; comments; } - | (0, _, 0, _) when nums_len >= defaulted_len -> + | (0, _, 0, 0, _) when nums_len >= defaulted_len -> List.iter (fun (loc, { DefaultedMember.id = (_, { Identifier.name = member_name; _ }) }) -> error_at @@ -455,6 +469,20 @@ end = struct has_unknown_members; comments; } + | (0, 0, _, 0, _) when bigints_len >= defaulted_len -> + List.iter + (fun (loc, { DefaultedMember.id = (_, { Identifier.name = member_name; _ }) }) -> + error_at + env + (loc, Parse_error.EnumNumberMemberNotInitialized { enum_name; member_name })) + members.defaulted_members; + BigIntBody + { + BigIntBody.members = members.bigint_members; + explicit_type = false; + has_unknown_members; + comments; + } | _ -> error_at env (name_loc, Parse_error.EnumInconsistentMemberValues { enum_name }); empty () diff --git a/jscomp/js_parser/expression_parser.ml b/jscomp/js_parser/expression_parser.ml index 479b00f915..6f3f642a7e 100644 --- a/jscomp/js_parser/expression_parser.ml +++ b/jscomp/js_parser/expression_parser.ml @@ -5,39 +5,17 @@ * LICENSE file in the root directory of this source tree. *) -module Ast = Flow_ast open Token open Parser_env open Flow_ast open Parser_common open Comment_attachment -module type EXPRESSION = sig - val assignment : env -> (Loc.t, Loc.t) Expression.t - - val assignment_cover : env -> pattern_cover - - val conditional : env -> (Loc.t, Loc.t) Expression.t - - val is_assignable_lhs : (Loc.t, Loc.t) Expression.t -> bool - - val left_hand_side : env -> (Loc.t, Loc.t) Expression.t - - val number : env -> number_type -> string -> float - - val bigint : env -> bigint_type -> string -> int64 option - - val sequence : - env -> start_loc:Loc.t -> (Loc.t, Loc.t) Expression.t list -> (Loc.t, Loc.t) Expression.t - - val call_type_args : env -> (Loc.t, Loc.t) Expression.CallTypeArgs.t option -end - module Expression (Parse : PARSER) - (Type : Type_parser.TYPE) - (Declaration : Declaration_parser.DECLARATION) - (Pattern_cover : Pattern_cover.COVER) : EXPRESSION = struct + (Type : Parser_common.TYPE) + (Declaration : Parser_common.DECLARATION) + (Pattern_cover : Parser_common.COVER) : Parser_common.EXPRESSION = struct type op_precedence = | Left_assoc of int | Right_assoc of int @@ -88,6 +66,7 @@ module Expression | (_, Object _) -> true | (_, ArrowFunction _) + | (_, AsConstExpression _) | (_, AsExpression _) | (_, Assignment _) | (_, Binary _) @@ -104,6 +83,7 @@ module Expression | (_, NumberLiteral _) | (_, BigIntLiteral _) | (_, RegExpLiteral _) + | (_, Match _) | (_, ModuleRefLiteral _) | (_, Logical _) | (_, New _) @@ -115,7 +95,7 @@ module Expression | (_, TemplateLiteral _) | (_, This _) | (_, TypeCast _) - | (_, TSTypeCast _) + | (_, TSSatisfies _) | (_, Unary _) | (_, Update _) | (_, Yield _) -> @@ -306,6 +286,7 @@ module Expression true | (_, Array _) | (_, ArrowFunction _) + | (_, AsConstExpression _) | (_, AsExpression _) | (_, Assignment _) | (_, Binary _) @@ -324,6 +305,7 @@ module Expression | (_, RegExpLiteral _) | (_, ModuleRefLiteral _) | (_, Logical _) + | (_, Match _) | (_, New _) | (_, Object _) | (_, OptionalCall _) @@ -334,7 +316,7 @@ module Expression | (_, TemplateLiteral _) | (_, This _) | (_, TypeCast _) - | (_, TSTypeCast _) + | (_, TSSatisfies _) | (_, Unary _) | (_, Update _) | (_, Yield _) -> @@ -556,10 +538,10 @@ module Expression let loc = Loc.btwn expr_loc annot_loc in Cover_expr ( loc, - Expression.TSTypeCast + Expression.TSSatisfies { - Expression.TSTypeCast.expression = expr; - kind = Expression.TSTypeCast.Satisfies annot; + Expression.TSSatisfies.expression = expr; + annot = (annot_loc, annot); comments = None; } ) @@ -568,12 +550,8 @@ module Expression Eat.token env; Cover_expr ( loc, - Expression.TSTypeCast - { - Expression.TSTypeCast.expression = expr; - kind = Expression.TSTypeCast.AsConst; - comments = None; - } + Expression.AsConstExpression + { Expression.AsConstExpression.expression = expr; comments = None } ) ) else let ((annot_loc, _) as annot) = Type._type env in @@ -1210,6 +1188,7 @@ module Expression params; body; generator; + effect_ = Function.Arbitrary; async; predicate; return; @@ -1298,7 +1277,8 @@ module Expression Expression.ModuleRefLiteral { Ast.ModuleRefLiteral.value; - require_out = loc; + require_loc = loc; + def_loc_opt = None; prefix_len; legacy_interop = false; raw; @@ -1309,7 +1289,8 @@ module Expression Expression.ModuleRefLiteral { Ast.ModuleRefLiteral.value; - require_out = loc; + require_loc = loc; + def_loc_opt = None; prefix_len; legacy_interop = true; raw; @@ -1350,6 +1331,37 @@ module Expression let (loc, template) = template_literal env part in Cover_expr (loc, Expression.TemplateLiteral template) | T_CLASS -> Cover_expr (Parse.class_expression env) + (* `match (` *) + | T_MATCH + when (parse_options env).pattern_matching + && (not (Peek.ith_is_line_terminator ~i:1 env)) + && Peek.ith_token ~i:1 env = T_LPAREN -> + let leading = Peek.comments env in + let match_keyword_loc = Peek.loc env in + (* Consume `match` as an identifier, in case it's a call expression. *) + let id = Parse.identifier env in + (* Allows trailing comma. *) + let args = arguments env in + (* `match () {` *) + if (not (Peek.is_line_terminator env)) && Peek.token env = T_LCURLY then + let arg = Parser_common.reparse_arguments_as_match_argument env args in + Cover_expr (match_expression ~match_keyword_loc ~leading ~arg env) + else + (* It's actually a call expression of the form `match(...)` *) + let callee = (match_keyword_loc, Expression.Identifier id) in + let (args_loc, _) = args in + let loc = Loc.btwn match_keyword_loc args_loc in + let comments = Flow_ast_utils.mk_comments_opt ~leading () in + let call = + Expression.Call { Expression.Call.callee; targs = None; arguments = args; comments } + in + (* Could have a chained call after this. *) + call_cover + ~allow_optional_chain:true + ~in_optional_chain:false + env + match_keyword_loc + (Cover_expr (loc, call)) | T_IDENTIFIER { raw = "abstract"; _ } when Peek.ith_token ~i:1 env = T_CLASS -> Cover_expr (Parse.class_expression env) | _ when Peek.is_identifier env -> @@ -1372,6 +1384,54 @@ module Expression and primary env = as_expression env (primary_cover env) + and match_expression env ~match_keyword_loc ~leading ~arg = + let case env = + let leading = Peek.comments env in + let pattern = Parse.match_pattern env in + let guard = + if Eat.maybe env T_IF then ( + Expect.token env T_LPAREN; + let test = Parse.expression env in + Expect.token env T_RPAREN; + Some test + ) else + None + in + (* Continue parsing colon until hermes-parser is also updated. *) + if not @@ Eat.maybe env T_COLON then Expect.token env T_ARROW; + let body = assignment env in + (match Peek.token env with + | T_EOF + | T_RCURLY -> + () + | _ -> Expect.token env T_COMMA); + let trailing = Eat.trailing_comments env in + let comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () in + { Match.Case.pattern; body; guard; comments } + in + let rec case_list env acc = + match Peek.token env with + | T_EOF + | T_RCURLY -> + List.rev acc + | _ -> case_list env (with_loc case env :: acc) + in + with_loc + ~start_loc:match_keyword_loc + (fun env -> + Expect.token env T_LCURLY; + let cases = case_list env [] in + Expect.token env T_RCURLY; + let trailing = Eat.trailing_comments env in + Expression.Match + { + Match.arg; + cases; + match_keyword_loc; + comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing (); + }) + env + and template_literal = let rec template_parts env quasis expressions = let expr = Parse.expression env in @@ -1489,6 +1549,10 @@ module Expression Array { e with Array.comments = merge_comments_with_internal comments } | ArrowFunction ({ Function.comments; _ } as e) -> ArrowFunction { e with Function.comments = merge_comments comments } + | AsExpression ({ AsExpression.comments; _ } as e) -> + AsExpression { e with AsExpression.comments = merge_comments comments } + | AsConstExpression ({ AsConstExpression.comments; _ } as e) -> + AsConstExpression { e with AsConstExpression.comments = merge_comments comments } | Assignment ({ Assignment.comments; _ } as e) -> Assignment { e with Assignment.comments = merge_comments comments } | Binary ({ Binary.comments; _ } as e) -> @@ -1519,6 +1583,8 @@ module Expression BigIntLiteral { e with BigIntLiteral.comments = merge_comments comments } | RegExpLiteral ({ RegExpLiteral.comments; _ } as e) -> RegExpLiteral { e with RegExpLiteral.comments = merge_comments comments } + | Match ({ Match.comments; _ } as e) -> + Match { e with Match.comments = merge_comments comments } | ModuleRefLiteral ({ ModuleRefLiteral.comments; _ } as e) -> ModuleRefLiteral { e with ModuleRefLiteral.comments = merge_comments comments } | Logical ({ Logical.comments; _ } as e) -> @@ -1551,6 +1617,8 @@ module Expression | TemplateLiteral ({ TemplateLiteral.comments; _ } as e) -> TemplateLiteral { e with TemplateLiteral.comments = merge_comments comments } | This { This.comments; _ } -> This { This.comments = merge_comments comments } + | TSSatisfies ({ TSSatisfies.comments; _ } as e) -> + TSSatisfies { e with TSSatisfies.comments = merge_comments comments } | TypeCast ({ TypeCast.comments; _ } as e) -> TypeCast { e with TypeCast.comments = merge_comments comments } | Unary ({ Unary.comments; _ } as e) -> @@ -1559,8 +1627,6 @@ module Expression Update { e with Update.comments = merge_comments comments } | Yield ({ Yield.comments; _ } as e) -> Yield { e with Yield.comments = merge_comments comments } - (* TODO: Delete once all expressions support comment attachment *) - | _ -> expression ) and array_initializer = @@ -1653,7 +1719,7 @@ module Expression let filtered_flags = Buffer.create (String.length raw_flags) in String.iter (function - | ('d' | 'g' | 'i' | 'm' | 's' | 'u' | 'y') as c -> Buffer.add_char filtered_flags c + | ('d' | 'g' | 'i' | 'm' | 's' | 'u' | 'y' | 'v') as c -> Buffer.add_char filtered_flags c | _ -> ()) raw_flags; let flags = Buffer.contents filtered_flags in @@ -1809,6 +1875,7 @@ module Expression async; generator = false; (* arrow functions cannot be generators *) + effect_ = Function.Arbitrary; predicate; return; tparams; diff --git a/jscomp/js_parser/expression_parser.mli b/jscomp/js_parser/expression_parser.mli new file mode 100644 index 0000000000..331c7ab603 --- /dev/null +++ b/jscomp/js_parser/expression_parser.mli @@ -0,0 +1,12 @@ +(* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + *) + +module Expression + (_ : Parser_common.PARSER) + (_ : Parser_common.TYPE) + (_ : Parser_common.DECLARATION) + (_ : Parser_common.COVER) : Parser_common.EXPRESSION diff --git a/jscomp/js_parser/file_key.ml b/jscomp/js_parser/file_key.ml index fb51ba4117..a7997532c8 100644 --- a/jscomp/js_parser/file_key.ml +++ b/jscomp/js_parser/file_key.ml @@ -1,78 +1,116 @@ -(* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - *) - +[@@@ocaml.ppx.context + { + tool_name = "ppx_driver"; + include_dirs = []; + hidden_include_dirs = []; + load_path = ([], []); + open_modules = []; + for_package = None; + debug = false; + use_threads = false; + use_vmthreads = false; + recursive_types = false; + principal = false; + transparent_modules = false; + unboxed_types = false; + unsafe_string = false; + cookies = + [("library-name", "flow_parser"); ("sedlex.regexps", ([%regexps ]))] + }] type t = | LibFile of string | SourceFile of string | JsonFile of string - (* A resource that might get required, like .css, .jpg, etc. We don't parse - these, just check that they exist *) - | ResourceFile of string -[@@deriving show, eq] - -let to_string = function - | LibFile x - | SourceFile x - | JsonFile x - | ResourceFile x -> - x - -let to_path = function - | LibFile x - | SourceFile x - | JsonFile x - | ResourceFile x -> - Ok x - + | ResourceFile of string [@@deriving (show, eq)] +include + struct + let _ = fun (_ : t) -> () + let rec pp : + Format.formatter -> t -> unit + = + (( + fun fmt -> + function + | LibFile a0 -> + (Format.fprintf fmt + "(@[<2>File_key.LibFile@ "; + (Format.fprintf fmt "%S") a0; + Format.fprintf fmt "@])") + | SourceFile a0 -> + (Format.fprintf fmt + "(@[<2>File_key.SourceFile@ "; + (Format.fprintf fmt "%S") a0; + Format.fprintf fmt "@])") + | JsonFile a0 -> + (Format.fprintf fmt + "(@[<2>File_key.JsonFile@ "; + (Format.fprintf fmt "%S") a0; + Format.fprintf fmt "@])") + | ResourceFile a0 -> + (Format.fprintf fmt + "(@[<2>File_key.ResourceFile@ "; + (Format.fprintf fmt "%S") a0; + Format.fprintf fmt "@])")) + [@ocaml.warning "-39"][@ocaml.warning "-A"]) + and show : t -> string = + fun x -> Format.asprintf "%a" pp x[@@ocaml.warning + "-32"] + let _ = pp + and _ = show + let rec equal : t -> t -> bool = + (( + fun lhs rhs -> + match (lhs, rhs) with + | (LibFile lhs0, LibFile rhs0) -> + ((fun (a : string) b -> a = b)) lhs0 rhs0 + | (SourceFile lhs0, SourceFile rhs0) -> + ((fun (a : string) b -> a = b)) lhs0 rhs0 + | (JsonFile lhs0, JsonFile rhs0) -> + ((fun (a : string) b -> a = b)) lhs0 rhs0 + | (ResourceFile lhs0, ResourceFile rhs0) -> + ((fun (a : string) b -> a = b)) lhs0 rhs0 + | _ -> false) + [@ocaml.warning "-39"][@ocaml.warning "-A"])[@@ocaml.warning "-39"] + let _ = equal + end[@@ocaml.doc "@inline"][@@merlin.hide ] +let to_string = + function | LibFile x | SourceFile x | JsonFile x | ResourceFile x -> x +let to_path = + function | LibFile x | SourceFile x | JsonFile x | ResourceFile x -> Ok x let compare = - (* libs, then source and json files at the same priority since JSON files are - * basically source files. We don't actually read resource files so they come - * last *) - let order_of_filename = function + let order_of_filename = + function | LibFile _ -> 1 | SourceFile _ -> 2 | JsonFile _ -> 2 - | ResourceFile _ -> 3 - in + | ResourceFile _ -> 3 in fun a b -> - let k = order_of_filename a - order_of_filename b in - if k <> 0 then - k - else - String.compare (to_string a) (to_string b) - + let k = (order_of_filename a) - (order_of_filename b) in + if k <> 0 then k else String.compare (to_string a) (to_string b) let compare_opt a b = match (a, b) with - | (Some _, None) -> -1 + | (Some _, None) -> (-1) | (None, Some _) -> 1 | (None, None) -> 0 | (Some a, Some b) -> compare a b - -let is_lib_file = function +let is_lib_file = + function | LibFile _ -> true | SourceFile _ -> false | JsonFile _ -> false | ResourceFile _ -> false - -let map f = function +let map f = + function | LibFile filename -> LibFile (f filename) | SourceFile filename -> SourceFile (f filename) | JsonFile filename -> JsonFile (f filename) | ResourceFile filename -> ResourceFile (f filename) - -let exists f = function - | LibFile filename - | SourceFile filename - | JsonFile filename - | ResourceFile filename -> - f filename - -let check_suffix filename suffix = exists (fun fn -> Filename.check_suffix fn suffix) filename - -let chop_suffix filename suffix = map (fun fn -> Filename.chop_suffix fn suffix) filename - +let exists f = + function + | LibFile filename | SourceFile filename | JsonFile filename | ResourceFile + filename -> f filename +let check_suffix filename suffix = + exists (fun fn -> Filename.check_suffix fn suffix) filename +let chop_suffix filename suffix = + map (fun fn -> Filename.chop_suffix fn suffix) filename let with_suffix filename suffix = map (fun fn -> fn ^ suffix) filename diff --git a/jscomp/js_parser/flow_ast.ml b/jscomp/js_parser/flow_ast.ml index c40cd86590..44d0edc90d 100644 --- a/jscomp/js_parser/flow_ast.ml +++ b/jscomp/js_parser/flow_ast.ml @@ -1,2072 +1,64362 @@ -(* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - *) - -module rec Syntax : sig - type ('M, 'internal) t = { - leading: 'M Comment.t list; - trailing: 'M Comment.t list; - internal: 'internal; - } -end = - Syntax - -and Identifier : sig - type ('M, 'T) t = 'T * 'M t' - - and 'M t' = { - name: string; - comments: ('M, unit) Syntax.t option; - } -end = - Identifier - -and PrivateName : sig - type 'M t = 'M * 'M t' - - and 'M t' = { - name: string; - comments: ('M, unit) Syntax.t option; - } -end = - PrivateName - -and StringLiteral : sig - type 'M t = { - value: string; - raw: string; - comments: ('M, unit) Syntax.t option; - } -end = - StringLiteral - -and NumberLiteral : sig - type 'M t = { - value: float; - raw: string; - comments: ('M, unit) Syntax.t option; - } -end = - NumberLiteral - -and BigIntLiteral : sig - type 'M t = { - (* This will be None if we couldn't parse `raw`. That could be if the number is out of range or invalid (like a float) *) - value: int64 option; - raw: string; - comments: ('M, unit) Syntax.t option; - } -end = - BigIntLiteral - -and BooleanLiteral : sig - type 'M t = { - value: bool; - comments: ('M, unit) Syntax.t option; - } -end = - BooleanLiteral - -and RegExpLiteral : sig - type 'M t = { - pattern: string; - flags: string; - raw: string; - comments: ('M, unit) Syntax.t option; - } - [@@deriving show] -end = - RegExpLiteral - -and ModuleRefLiteral : sig - type ('M, 'T) t = { - value: string; - require_out: 'T; - prefix_len: int; - legacy_interop: bool; - raw: string; - comments: ('M, unit) Syntax.t option; - } - [@@deriving show] -end = - ModuleRefLiteral - -and Variance : sig - type 'M t = 'M * 'M t' - - and kind = - | Plus - | Minus - | Readonly - | In - | Out - | InOut - - and 'M t' = { - kind: kind; - comments: ('M, unit) Syntax.t option; - } -end = - Variance - -and ComputedKey : sig - type ('M, 'T) t = 'M * ('M, 'T) ComputedKey.t' - - and ('M, 'T) t' = { - expression: ('M, 'T) Expression.t; - comments: ('M, unit) Syntax.t option; - } -end = - ComputedKey - -and Variable : sig - type kind = - | Var - | Let - | Const - [@@deriving show] -end = - Variable - -and Type : sig - module Conditional : sig - type ('M, 'T) t = { - check_type: ('M, 'T) Type.t; - extends_type: ('M, 'T) Type.t; - true_type: ('M, 'T) Type.t; - false_type: ('M, 'T) Type.t; - comments: ('M, unit) Syntax.t option; - } - [@@deriving show] +module rec + Syntax:sig + type ('M, 'internal) t = + { + leading: 'M Comment.t list ; + trailing: 'M Comment.t list ; + internal: 'internal }[@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'internal -> unit) + -> + Format.formatter -> + ('M, 'internal) t -> unit + val show : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'internal -> unit) + -> ('M, 'internal) t -> string + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end = + struct + type ('M, 'internal) t = + { + leading: 'M Comment.t list ; + trailing: 'M Comment.t list ; + internal: 'internal }[@@deriving show] + include + struct + let _ = fun (_ : ('M, 'internal) t) -> () + let rec pp : + 'M 'internal . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'internal -> unit) + -> + Format.formatter -> + ('M, 'internal) t -> unit + = + ((let __1 = Comment.pp + and __0 = Comment.pp in + (( + fun poly_M poly_internal fmt x -> + Format.fprintf fmt "@[<2>{ "; + (((Format.fprintf fmt "@[%s =@ " + "Flow_ast.Syntax.leading"; + ((fun x -> + Format.fprintf fmt "@[<2>["; + ignore + (List.fold_left + (fun sep x -> + if sep + then + Format.fprintf fmt + ";@ "; + (__0 (fun fmt -> poly_M fmt) fmt) x; + true) false x); + Format.fprintf fmt "@,]@]")) + x.leading; + Format.fprintf fmt "@]"); + Format.fprintf fmt ";@ "; + Format.fprintf fmt "@[%s =@ " + "trailing"; + ((fun x -> + Format.fprintf fmt "@[<2>["; + ignore + (List.fold_left + (fun sep x -> + if sep + then + Format.fprintf fmt + ";@ "; + (__1 (fun fmt -> poly_M fmt) fmt) x; + true) false x); + Format.fprintf fmt "@,]@]")) + x.trailing; + Format.fprintf fmt "@]"); + Format.fprintf fmt ";@ "; + Format.fprintf fmt "@[%s =@ " + "internal"; + (poly_internal fmt) x.internal; + Format.fprintf fmt "@]"); + Format.fprintf fmt "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'internal . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'internal -> unit) + -> ('M, 'internal) t -> string + = + fun poly_M poly_internal x -> + Format.asprintf "%a" + ((pp poly_M) poly_internal) x[@@ocaml.warning "-32"] + let _ = pp + and _ = show + end[@@ocaml.doc "@inline"][@@merlin.hide ] end - - module Infer : sig - type ('M, 'T) t = { - tparam: ('M, 'T) Type.TypeParam.t; - comments: ('M, unit) Syntax.t option; - } - [@@deriving show] - end - - module Function : sig - module Param : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - name: ('M, 'T) Identifier.t option; - annot: ('M, 'T) Type.t; - optional: bool; - } - end - - module RestParam : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - argument: ('M, 'T) Param.t; - comments: ('M, unit) Syntax.t option; - } - end - - module ThisParam : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - annot: ('M, 'T) Type.annotation; - comments: ('M, unit) Syntax.t option; - } - end - - module Params : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - this_: ('M, 'T) ThisParam.t option; - params: ('M, 'T) Param.t list; - rest: ('M, 'T) RestParam.t option; - comments: ('M, 'M Comment.t list) Syntax.t option; - } - [@@deriving show] - end - - type ('M, 'T) t = { - tparams: ('M, 'T) Type.TypeParams.t option; - params: ('M, 'T) Params.t; - return: ('M, 'T) return_annotation; - comments: ('M, unit) Syntax.t option; - } - - and ('M, 'T) return_annotation = - | TypeAnnotation of ('M, 'T) Type.t - | TypeGuard of ('M, 'T) Type.TypeGuard.t - [@@deriving show] - end - - module Component : sig - module Param : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - name: ('M, 'T) Statement.ComponentDeclaration.Param.param_name; - annot: ('M, 'T) Type.annotation; - optional: bool; - } - [@@deriving show] - end - - module RestParam : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - argument: ('M, 'T) Identifier.t option; - annot: ('M, 'T) Type.t; - optional: bool; - comments: ('M, unit) Syntax.t option; - } - [@@deriving show] - end - - module Params : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - params: ('M, 'T) Param.t list; - rest: ('M, 'T) RestParam.t option; - comments: ('M, 'M Comment.t list) Syntax.t option; - } - [@@deriving show] - end - - type ('M, 'T) t = { - tparams: ('M, 'T) Type.TypeParams.t option; - params: ('M, 'T) Params.t; - renders: ('M, 'T) Type.component_renders_annotation; - comments: ('M, unit) Syntax.t option; - } - end - - module Generic : sig - module Identifier : sig - type ('M, 'T) t = - | Unqualified of ('M, 'T) Identifier.t - | Qualified of ('M, 'T) qualified - - and ('M, 'T) qualified = 'M * ('M, 'T) qualified' - - and ('M, 'T) qualified' = { - qualification: ('M, 'T) t; - id: ('M, 'T) Identifier.t; - } - end - - type ('M, 'T) t = { - id: ('M, 'T) Identifier.t; - targs: ('M, 'T) Type.TypeArgs.t option; - comments: ('M, unit) Syntax.t option; - } - end - - module IndexedAccess : sig - type ('M, 'T) t = { - _object: ('M, 'T) Type.t; - index: ('M, 'T) Type.t; - comments: ('M, unit) Syntax.t option; - } - end - - module OptionalIndexedAccess : sig - type ('M, 'T) t = { - indexed_access: ('M, 'T) IndexedAccess.t; - optional: bool; - } - end - - module Object : sig - module Property : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - key: ('M, 'T) Expression.Object.Property.key; - value: ('M, 'T) value; - optional: bool; - static: bool; - proto: bool; - _method: bool; - variance: 'M Variance.t option; - comments: ('M, unit) Syntax.t option; - } - - and ('M, 'T) value = - | Init of ('M, 'T) Type.t - | Get of ('M * ('M, 'T) Function.t) - | Set of ('M * ('M, 'T) Function.t) - end - - module SpreadProperty : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - argument: ('M, 'T) Type.t; - comments: ('M, unit) Syntax.t option; - } - end - - module Indexer : sig - type ('M, 'T) t' = { - id: ('M, 'M) Identifier.t option; - key: ('M, 'T) Type.t; - value: ('M, 'T) Type.t; - static: bool; - variance: 'M Variance.t option; - comments: ('M, unit) Syntax.t option; - } - - and ('M, 'T) t = 'M * ('M, 'T) t' [@@deriving show] - end - - module MappedType : sig - (* PlusOptional = +?, MinusOptional = -?, Optional = ?, NoOptionalFlag = blank *) - type optional_flag = - | PlusOptional - | MinusOptional - | Optional - | NoOptionalFlag - [@@deriving show] - - type ('M, 'T) t' = { - key_tparam: ('M, 'T) Type.TypeParam.t; - prop_type: ('M, 'T) Type.t; - source_type: ('M, 'T) Type.t; - variance: 'M Variance.t option; - optional: optional_flag; - comments: ('M, unit) Syntax.t option; - } - - and ('M, 'T) t = 'M * ('M, 'T) t' [@@deriving show] - end - - module CallProperty : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - value: 'M * ('M, 'T) Function.t; - static: bool; - comments: ('M, unit) Syntax.t option; - } - end - - module InternalSlot : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - id: ('M, 'M) Identifier.t; - value: ('M, 'T) Type.t; - optional: bool; - static: bool; - _method: bool; - comments: ('M, unit) Syntax.t option; - } - end - - type ('M, 'T) t = { - exact: bool; - (* Inexact indicates the presence of ... in the object. It is more - * easily understood if exact is read as "explicitly exact" and "inexact" - * is read as "explicitly inexact". - * - * This confusion will go away when we get rid of the exact flag in favor - * of inexact as part of the work to make object types exact by default. - * *) - inexact: bool; - properties: ('M, 'T) property list; - comments: ('M, 'M Comment.t list) Syntax.t option; - } - - and ('M, 'T) property = - | Property of ('M, 'T) Property.t - | SpreadProperty of ('M, 'T) SpreadProperty.t - | Indexer of ('M, 'T) Indexer.t - | CallProperty of ('M, 'T) CallProperty.t - | InternalSlot of ('M, 'T) InternalSlot.t - | MappedType of ('M, 'T) MappedType.t - [@@deriving show] - end - - module Interface : sig - type ('M, 'T) t = { - body: 'M * ('M, 'T) Object.t; - extends: ('M * ('M, 'T) Generic.t) list; - comments: ('M, unit) Syntax.t option; - } - end - - module Nullable : sig - type ('M, 'T) t = { - argument: ('M, 'T) Type.t; - comments: ('M, unit) Syntax.t option; - } - end - - module Typeof : sig - module Target : sig - type ('M, 'T) t = - | Unqualified of ('M, 'T) Identifier.t - | Qualified of ('M, 'T) qualified - - and ('M, 'T) qualified' = { - qualification: ('M, 'T) t; - id: ('M, 'T) Identifier.t; - } - - and ('M, 'T) qualified = 'T * ('M, 'T) qualified' [@@deriving show] - end - - type ('M, 'T) t = { - argument: ('M, 'T) Target.t; - targs: ('M, 'T) Type.TypeArgs.t option; - comments: ('M, unit) Syntax.t option; - } - end - - module Keyof : sig - type ('M, 'T) t = { - argument: ('M, 'T) Type.t; - comments: ('M, unit) Syntax.t option; - } - [@@deriving show] - end - - module Renders : sig - type variant = - | Normal - | Maybe - | Star - [@@deriving show] - - type ('M, 'T) t = { - operator_loc: 'M; - argument: ('M, 'T) Type.t; - comments: ('M, unit) Syntax.t option; - variant: variant; - } - [@@deriving show] - end - - module ReadOnly : sig - type ('M, 'T) t = { - argument: ('M, 'T) Type.t; - comments: ('M, unit) Syntax.t option; - } - [@@deriving show] - end - - module Tuple : sig - module LabeledElement : sig - type ('M, 'T) t = { - name: ('M, 'T) Identifier.t; - annot: ('M, 'T) Type.t; - variance: 'M Variance.t option; - optional: bool; - } - [@@deriving show] - end - - module SpreadElement : sig - type ('M, 'T) t = { - name: ('M, 'T) Identifier.t option; - annot: ('M, 'T) Type.t; - } - [@@deriving show] - end - - type ('M, 'T) element = 'M * ('M, 'T) element' [@@deriving show] - - and ('M, 'T) element' = - | UnlabeledElement of ('M, 'T) Type.t - | LabeledElement of ('M, 'T) LabeledElement.t - | SpreadElement of ('M, 'T) SpreadElement.t - [@@deriving show] - - and ('M, 'T) t = { - elements: ('M, 'T) element list; - comments: ('M, unit) Syntax.t option; - } - end - - module Array : sig - type ('M, 'T) t = { - argument: ('M, 'T) Type.t; - comments: ('M, unit) Syntax.t option; - } - end - - module Union : sig - type ('M, 'T) t = { - types: ('M, 'T) Type.t * ('M, 'T) Type.t * ('M, 'T) Type.t list; - comments: ('M, unit) Syntax.t option; - } - end - - module Intersection : sig - type ('M, 'T) t = { - types: ('M, 'T) Type.t * ('M, 'T) Type.t * ('M, 'T) Type.t list; - comments: ('M, unit) Syntax.t option; - } - end - - type ('M, 'T) t = 'T * ('M, 'T) t' - - (* Yes, we could add a little complexity here to show that Any and Void - * should never be declared nullable, but that check can happen later *) - and ('M, 'T) t' = - | Any of ('M, unit) Syntax.t option - | Mixed of ('M, unit) Syntax.t option - | Empty of ('M, unit) Syntax.t option - | Void of ('M, unit) Syntax.t option - | Null of ('M, unit) Syntax.t option - | Number of ('M, unit) Syntax.t option - | BigInt of ('M, unit) Syntax.t option - | String of ('M, unit) Syntax.t option - | Boolean of { - raw: [ `Boolean | `Bool ]; - comments: ('M, unit) Syntax.t option; - } - | Symbol of ('M, unit) Syntax.t option - | Exists of ('M, unit) Syntax.t option - | Nullable of ('M, 'T) Nullable.t - | Function of ('M, 'T) Function.t - | Component of ('M, 'T) Component.t - | Object of ('M, 'T) Object.t - | Interface of ('M, 'T) Interface.t - | Array of ('M, 'T) Array.t - | Conditional of ('M, 'T) Conditional.t - | Infer of ('M, 'T) Infer.t - | Generic of ('M, 'T) Generic.t - | IndexedAccess of ('M, 'T) IndexedAccess.t - | OptionalIndexedAccess of ('M, 'T) OptionalIndexedAccess.t - | Union of ('M, 'T) Union.t - | Intersection of ('M, 'T) Intersection.t - | Typeof of ('M, 'T) Typeof.t - | Keyof of ('M, 'T) Keyof.t - | Renders of ('M, 'T) Renders.t - | ReadOnly of ('M, 'T) ReadOnly.t - | Tuple of ('M, 'T) Tuple.t - | StringLiteral of 'M StringLiteral.t - | NumberLiteral of 'M NumberLiteral.t - | BigIntLiteral of 'M BigIntLiteral.t - | BooleanLiteral of 'M BooleanLiteral.t - | Unknown of ('M, unit) Syntax.t option - | Never of ('M, unit) Syntax.t option - | Undefined of ('M, unit) Syntax.t option - - (* Type.annotation is a concrete syntax node with a location that starts at - * the colon and ends after the type. For example, "var a: number", the - * identifier a would have a property annot which contains a - * Type.annotation with a location from column 6-14 *) - and ('M, 'T) annotation = 'M * ('M, 'T) t - - (* Same convention about the colon holds for type guards. *) - and ('M, 'T) type_guard_annotation = 'M * ('M, 'T) Type.TypeGuard.t - - and ('M, 'T) annotation_or_hint = - | Missing of 'T - | Available of ('M, 'T) Type.annotation - [@@deriving show] - - and ('M, 'T) component_renders_annotation = - | MissingRenders of 'T - | AvailableRenders of 'M * ('M, 'T) Type.Renders.t - [@@deriving show] - - module TypeParam : sig - type bound_kind = - | Colon - | Extends - [@@deriving show] - - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - name: ('M, 'M) Identifier.t; - bound: ('M, 'T) Type.annotation_or_hint; - bound_kind: bound_kind; - variance: 'M Variance.t option; - default: ('M, 'T) Type.t option; - } - end - - module TypeParams : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - params: ('M, 'T) TypeParam.t list; - comments: ('M, 'M Comment.t list) Syntax.t option; - } - end - - module TypeArgs : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - arguments: ('M, 'T) Type.t list; - comments: ('M, 'M Comment.t list) Syntax.t option; - } - end - - module Predicate : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - kind: ('M, 'T) kind; - comments: ('M, unit) Syntax.t option; - } - - and ('M, 'T) kind = - | Declared of ('M, 'T) Expression.t - | Inferred - [@@deriving show] - end - - module TypeGuard : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - asserts: bool; - guard: ('M, 'M) Identifier.t * ('M, 'T) Type.t option; - comments: ('M, 'M Comment.t list) Syntax.t option; - } - [@@deriving show] - end -end = - Type - -and Statement : sig - module Block : sig - type ('M, 'T) t = { - body: ('M, 'T) Statement.t list; - comments: ('M, 'M Comment.t list) Syntax.t option; - } - end - - module If : sig - module Alternate : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - body: ('M, 'T) Statement.t; - comments: ('M, unit) Syntax.t option; - } - end - - type ('M, 'T) t = { - test: ('M, 'T) Expression.t; - consequent: ('M, 'T) Statement.t; - alternate: ('M, 'T) Alternate.t option; - comments: ('M, unit) Syntax.t option; - } - end - - module Labeled : sig - type ('M, 'T) t = { - label: ('M, 'M) Identifier.t; - body: ('M, 'T) Statement.t; - comments: ('M, unit) Syntax.t option; - } - end - - module Break : sig - type 'M t = { - label: ('M, 'M) Identifier.t option; - comments: ('M, unit) Syntax.t option; - } - end - - module Continue : sig - type 'M t = { - label: ('M, 'M) Identifier.t option; - comments: ('M, unit) Syntax.t option; - } - end - - module Debugger : sig - type 'M t = { comments: ('M, unit) Syntax.t option } [@@deriving show] - end - - module With : sig - type ('M, 'T) t = { - _object: ('M, 'T) Expression.t; - body: ('M, 'T) Statement.t; - comments: ('M, unit) Syntax.t option; - } - end - - module TypeAlias : sig - type ('M, 'T) t = { - id: ('M, 'T) Identifier.t; - tparams: ('M, 'T) Type.TypeParams.t option; - right: ('M, 'T) Type.t; - comments: ('M, unit) Syntax.t option; - } - end - - module OpaqueType : sig - type ('M, 'T) t = { - id: ('M, 'T) Identifier.t; - tparams: ('M, 'T) Type.TypeParams.t option; - impltype: ('M, 'T) Type.t option; - supertype: ('M, 'T) Type.t option; - comments: ('M, unit) Syntax.t option; - } - end - - module Switch : sig - module Case : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - test: ('M, 'T) Expression.t option; - consequent: ('M, 'T) Statement.t list; - comments: ('M, unit) Syntax.t option; - } - end - - type ('M, 'T) t = { - discriminant: ('M, 'T) Expression.t; - cases: ('M, 'T) Case.t list; - comments: ('M, unit) Syntax.t option; - exhaustive_out: 'T; - } - end - - module Return : sig - type ('M, 'T) t = { - argument: ('M, 'T) Expression.t option; - comments: ('M, unit) Syntax.t option; - return_out: 'T; - } - end - - module Throw : sig - type ('M, 'T) t = { - argument: ('M, 'T) Expression.t; - comments: ('M, unit) Syntax.t option; - } - end - - module Try : sig - module CatchClause : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - param: ('M, 'T) Pattern.t option; - body: 'M * ('M, 'T) Block.t; - comments: ('M, unit) Syntax.t option; - } - end - - type ('M, 'T) t = { - block: 'M * ('M, 'T) Block.t; - handler: ('M, 'T) CatchClause.t option; - finalizer: ('M * ('M, 'T) Block.t) option; - comments: ('M, unit) Syntax.t option; - } - end - - module VariableDeclaration : sig - module Declarator : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - id: ('M, 'T) Pattern.t; - init: ('M, 'T) Expression.t option; - } - end - - type ('M, 'T) t = { - declarations: ('M, 'T) Declarator.t list; - kind: Variable.kind; - comments: ('M, unit) Syntax.t option; - } - [@@deriving show] - end - - module While : sig - type ('M, 'T) t = { - test: ('M, 'T) Expression.t; - body: ('M, 'T) Statement.t; - comments: ('M, unit) Syntax.t option; - } - end - - module DoWhile : sig - type ('M, 'T) t = { - body: ('M, 'T) Statement.t; - test: ('M, 'T) Expression.t; - comments: ('M, unit) Syntax.t option; - } - end - - module For : sig - type ('M, 'T) t = { - init: ('M, 'T) init option; - test: ('M, 'T) Expression.t option; - update: ('M, 'T) Expression.t option; - body: ('M, 'T) Statement.t; - comments: ('M, unit) Syntax.t option; - } - - and ('M, 'T) init = - | InitDeclaration of ('M * ('M, 'T) VariableDeclaration.t) - | InitExpression of ('M, 'T) Expression.t - end - - module ForIn : sig - type ('M, 'T) t = { - left: ('M, 'T) left; - right: ('M, 'T) Expression.t; - body: ('M, 'T) Statement.t; - each: bool; - comments: ('M, unit) Syntax.t option; - } - - and ('M, 'T) left = - | LeftDeclaration of ('M * ('M, 'T) VariableDeclaration.t) - | LeftPattern of ('M, 'T) Pattern.t - end - - module ForOf : sig - type ('M, 'T) t = { - left: ('M, 'T) left; - right: ('M, 'T) Expression.t; - body: ('M, 'T) Statement.t; - await: bool; - comments: ('M, unit) Syntax.t option; - } - - and ('M, 'T) left = - | LeftDeclaration of ('M * ('M, 'T) VariableDeclaration.t) - | LeftPattern of ('M, 'T) Pattern.t - end - - module EnumDeclaration : sig - module DefaultedMember : sig - type 'M t = 'M * 'M t' - - and 'M t' = { id: ('M, 'M) Identifier.t } [@@deriving show] - end - - module InitializedMember : sig - type ('I, 'M) t = 'M * ('I, 'M) t' - - and ('I, 'M) t' = { - id: ('M, 'M) Identifier.t; - init: 'M * 'I; - } - end - - module BooleanBody : sig - type 'M t = { - members: ('M BooleanLiteral.t, 'M) InitializedMember.t list; - explicit_type: bool; - has_unknown_members: bool; - comments: ('M, 'M Comment.t list) Syntax.t option; - } - end - - module NumberBody : sig - type 'M t = { - members: ('M NumberLiteral.t, 'M) InitializedMember.t list; - explicit_type: bool; - has_unknown_members: bool; - comments: ('M, 'M Comment.t list) Syntax.t option; - } - end - - module StringBody : sig - type 'M t = { - members: ('M StringLiteral.t, 'M) members; - explicit_type: bool; - has_unknown_members: bool; - comments: ('M, 'M Comment.t list) Syntax.t option; - } - - and ('I, 'M) members = - | Defaulted of 'M DefaultedMember.t list - | Initialized of ('I, 'M) InitializedMember.t list - end - - module SymbolBody : sig - type 'M t = { - members: 'M DefaultedMember.t list; - has_unknown_members: bool; - comments: ('M, 'M Comment.t list) Syntax.t option; - } - [@@deriving show] - end - - module BigIntBody : sig - type 'M t = { - members: ('M BigIntLiteral.t, 'M) InitializedMember.t list; - explicit_type: bool; - has_unknown_members: bool; - comments: ('M, 'M Comment.t list) Syntax.t option; - } - [@@deriving show] - end - - type ('M, 'T) t = { - id: ('M, 'T) Identifier.t; - body: 'M body; - comments: ('M, unit) Syntax.t option; - } - - and 'M body = 'M * 'M body' - - and 'M body' = - | BooleanBody of 'M BooleanBody.t - | NumberBody of 'M NumberBody.t - | StringBody of 'M StringBody.t - | SymbolBody of 'M SymbolBody.t - | BigIntBody of 'M BigIntBody.t - [@@deriving show] - end - - module ComponentDeclaration : sig - module RestParam : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - argument: ('M, 'T) Pattern.t; - comments: ('M, unit) Syntax.t option; - } - [@@deriving show] - end - - module Param : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - (* Name should only be an Identifier or StringLiteral. However, we allow parsing - it as an option to have better error messages. *) - name: ('M, 'T) param_name; - local: ('M, 'T) Pattern.t; - default: ('M, 'T) Expression.t option; - shorthand: bool; - } - - and ('M, 'T) param_name = - | Identifier of ('M, 'T) Identifier.t - | StringLiteral of ('M * 'M StringLiteral.t) - [@@deriving show] - end - - module Params : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - params: ('M, 'T) Param.t list; - rest: ('M, 'T) RestParam.t option; - comments: ('M, 'M Comment.t list) Syntax.t option; - } - [@@deriving show] - end - - type ('M, 'T) t = { - id: ('M, 'T) Identifier.t; - tparams: ('M, 'T) Type.TypeParams.t option; - params: ('M, 'T) Params.t; - renders: ('M, 'T) Type.component_renders_annotation; - body: 'M * ('M, 'T) Statement.Block.t; - comments: ('M, unit) Syntax.t option; - (* Location of the signature portion of a component, e.g. - * component Foo(): void {} - * ^^^^^^^^^^^^^^^^^^^^ - *) - sig_loc: 'M; - } - [@@deriving show] - end - - module Interface : sig - type ('M, 'T) t = { - id: ('M, 'T) Identifier.t; - tparams: ('M, 'T) Type.TypeParams.t option; - extends: ('M * ('M, 'T) Type.Generic.t) list; - body: 'M * ('M, 'T) Type.Object.t; - comments: ('M, unit) Syntax.t option; - } - end - - module DeclareClass : sig - type ('M, 'T) t = { - id: ('M, 'T) Identifier.t; - tparams: ('M, 'T) Type.TypeParams.t option; - body: 'M * ('M, 'T) Type.Object.t; - extends: ('M * ('M, 'T) Type.Generic.t) option; - mixins: ('M * ('M, 'T) Type.Generic.t) list; - implements: ('M, 'T) Class.Implements.t option; - comments: ('M, unit) Syntax.t option; - } - [@@deriving show] - end - - module DeclareComponent : sig - type ('M, 'T) t = { - id: ('M, 'T) Identifier.t; - tparams: ('M, 'T) Type.TypeParams.t option; - params: ('M, 'T) Type.Component.Params.t; - renders: ('M, 'T) Type.component_renders_annotation; - comments: ('M, unit) Syntax.t option; - } - [@@deriving show] - end - - module DeclareVariable : sig - type ('M, 'T) t = { - id: ('M, 'T) Identifier.t; - annot: ('M, 'T) Type.annotation; - kind: Variable.kind; - comments: ('M, unit) Syntax.t option; - } - end - - module DeclareFunction : sig - type ('M, 'T) t = { - id: ('M, 'T) Identifier.t; - annot: ('M, 'T) Type.annotation; - predicate: ('M, 'T) Type.Predicate.t option; - comments: ('M, unit) Syntax.t option; - } - end - - module DeclareModule : sig - type ('M, 'T) id = - | Identifier of ('M, 'T) Identifier.t - | Literal of ('T * 'M StringLiteral.t) - - and module_kind = - | CommonJS - | ES - - and ('M, 'T) t = { - id: ('M, 'T) id; - body: 'M * ('M, 'T) Block.t; - kind: module_kind; - comments: ('M, unit) Syntax.t option; - } - end - - module DeclareModuleExports : sig - type ('M, 'T) t = { - annot: ('M, 'T) Type.annotation; - comments: ('M, unit) Syntax.t option; - } - end - - module ExportNamedDeclaration : sig - module ExportSpecifier : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - local: ('M, 'T) Identifier.t; - exported: ('M, 'T) Identifier.t option; - } - end - - module ExportBatchSpecifier : sig - type ('M, 'T) t = 'M * ('M, 'T) Identifier.t option [@@deriving show] - end - - type ('M, 'T) t = { - declaration: ('M, 'T) Statement.t option; - specifiers: ('M, 'T) specifier option; - source: ('T * 'M StringLiteral.t) option; - export_kind: Statement.export_kind; - comments: ('M, unit) Syntax.t option; - } - - and ('M, 'T) specifier = - | ExportSpecifiers of ('M, 'T) ExportSpecifier.t list - | ExportBatchSpecifier of ('M, 'T) ExportBatchSpecifier.t - [@@deriving show] - end - - module ExportDefaultDeclaration : sig - type ('M, 'T) t = { - default: 'M; - declaration: ('M, 'T) declaration; - comments: ('M, unit) Syntax.t option; - } - - and ('M, 'T) declaration = - | Declaration of ('M, 'T) Statement.t - | Expression of ('M, 'T) Expression.t - end - - module DeclareExportDeclaration : sig - type ('M, 'T) declaration = - (* declare export var *) - | Variable of ('M * ('M, 'T) DeclareVariable.t) - (* declare export function *) - | Function of ('M * ('M, 'T) DeclareFunction.t) - (* declare export class *) - | Class of ('M * ('M, 'T) DeclareClass.t) - (* declare export component *) - | Component of ('M * ('M, 'T) DeclareComponent.t) - (* declare export default [type] - * this corresponds to things like - * export default 1+1; *) - | DefaultType of ('M, 'T) Type.t - (* declare export type *) - | NamedType of ('M * ('M, 'T) TypeAlias.t) - (* declare export opaque type *) - | NamedOpaqueType of ('M * ('M, 'T) OpaqueType.t) - (* declare export interface *) - | Interface of ('M * ('M, 'T) Interface.t) - (* declare export enum *) - | Enum of ('M * ('M, 'T) EnumDeclaration.t) - - and ('M, 'T) t = { - default: 'M option; - declaration: ('M, 'T) declaration option; - specifiers: ('M, 'T) ExportNamedDeclaration.specifier option; - source: ('T * 'M StringLiteral.t) option; - comments: ('M, unit) Syntax.t option; - } - end - - module ImportDeclaration : sig - type import_kind = - | ImportType - | ImportTypeof - | ImportValue - - and ('M, 'T) specifier = - | ImportNamedSpecifiers of ('M, 'T) named_specifier list - | ImportNamespaceSpecifier of ('M * ('M, 'T) Identifier.t) - - and ('M, 'T) named_specifier = { - kind: import_kind option; - local: ('M, 'T) Identifier.t option; - remote: ('M, 'T) Identifier.t; - (* Remote name's definition location. It will be populated only in typed AST. *) - remote_name_def_loc: 'M option; - } - - and ('M, 'T) default_identifier = { - identifier: ('M, 'T) Identifier.t; - (* Remote name's definition location. It will be populated only in typed AST. *) - remote_default_name_def_loc: 'M option; - } - - and ('M, 'T) t = { - import_kind: import_kind; - source: 'T * 'M StringLiteral.t; - default: ('M, 'T) default_identifier option; - specifiers: ('M, 'T) specifier option; - comments: ('M, unit) Syntax.t option; - } - end - - module Expression : sig - type ('M, 'T) t = { - expression: ('M, 'T) Expression.t; - directive: string option; - comments: ('M, unit) Syntax.t option; - } - end - - module Empty : sig - type 'M t = { comments: ('M, unit) Syntax.t option } [@@deriving show] - end - - type export_kind = - | ExportType - | ExportValue - - and ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = - | Block of ('M, 'T) Block.t - | Break of 'M Break.t - | ClassDeclaration of ('M, 'T) Class.t - | ComponentDeclaration of ('M, 'T) ComponentDeclaration.t - | Continue of 'M Continue.t - | Debugger of 'M Debugger.t - | DeclareClass of ('M, 'T) DeclareClass.t - | DeclareComponent of ('M, 'T) DeclareComponent.t - | DeclareEnum of ('M, 'T) EnumDeclaration.t - | DeclareExportDeclaration of ('M, 'T) DeclareExportDeclaration.t - | DeclareFunction of ('M, 'T) DeclareFunction.t - | DeclareInterface of ('M, 'T) Interface.t - | DeclareModule of ('M, 'T) DeclareModule.t - | DeclareModuleExports of ('M, 'T) DeclareModuleExports.t - | DeclareTypeAlias of ('M, 'T) TypeAlias.t - | DeclareOpaqueType of ('M, 'T) OpaqueType.t - | DeclareVariable of ('M, 'T) DeclareVariable.t - | DoWhile of ('M, 'T) DoWhile.t - | Empty of 'M Empty.t - | EnumDeclaration of ('M, 'T) EnumDeclaration.t - | ExportDefaultDeclaration of ('M, 'T) ExportDefaultDeclaration.t - | ExportNamedDeclaration of ('M, 'T) ExportNamedDeclaration.t - | Expression of ('M, 'T) Expression.t - | For of ('M, 'T) For.t - | ForIn of ('M, 'T) ForIn.t - | ForOf of ('M, 'T) ForOf.t - | FunctionDeclaration of ('M, 'T) Function.t - | If of ('M, 'T) If.t - | ImportDeclaration of ('M, 'T) ImportDeclaration.t - | InterfaceDeclaration of ('M, 'T) Interface.t - | Labeled of ('M, 'T) Labeled.t - | Return of ('M, 'T) Return.t - | Switch of ('M, 'T) Switch.t - | Throw of ('M, 'T) Throw.t - | Try of ('M, 'T) Try.t - | TypeAlias of ('M, 'T) TypeAlias.t - | OpaqueType of ('M, 'T) OpaqueType.t - | VariableDeclaration of ('M, 'T) VariableDeclaration.t - | While of ('M, 'T) While.t - | With of ('M, 'T) With.t -end = - Statement - -and Expression : sig - module CallTypeArg : sig - module Implicit : sig - type ('M, 'T) t = 'T * 'M t' - - and 'M t' = { comments: ('M, unit) Syntax.t option } [@@deriving show] - end - - type ('M, 'T) t = - | Explicit of ('M, 'T) Type.t - | Implicit of ('M, 'T) Implicit.t - end - - module CallTypeArgs : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - arguments: ('M, 'T) CallTypeArg.t list; - comments: ('M, 'M Comment.t list) Syntax.t option; - } - end - - module SpreadElement : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - argument: ('M, 'T) Expression.t; - comments: ('M, unit) Syntax.t option; - } - end - - module Array : sig - type ('M, 'T) element = - | Expression of ('M, 'T) Expression.t - | Spread of ('M, 'T) SpreadElement.t - | Hole of 'M - - type ('M, 'T) t = { - elements: ('M, 'T) element list; - comments: ('M, 'M Comment.t list) Syntax.t option; - } - end - - module TemplateLiteral : sig - module Element : sig - type value = { - raw: string; - cooked: string; - } - - and 'M t = 'M * t' - - and t' = { - value: value; - tail: bool; - } - end - - type ('M, 'T) t = { - quasis: 'M Element.t list; - expressions: ('M, 'T) Expression.t list; - comments: ('M, unit) Syntax.t option; - } - end - - module TaggedTemplate : sig - type ('M, 'T) t = { - tag: ('M, 'T) Expression.t; - quasi: 'M * ('M, 'T) TemplateLiteral.t; - comments: ('M, unit) Syntax.t option; - } - end - - module Object : sig - module Property : sig - type ('M, 'T) key = - | StringLiteral of ('T * 'M StringLiteral.t) - | NumberLiteral of ('T * 'M NumberLiteral.t) - | BigIntLiteral of ('T * 'M BigIntLiteral.t) - | Identifier of ('M, 'T) Identifier.t - | PrivateName of 'M PrivateName.t - | Computed of ('M, 'T) ComputedKey.t - - and ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = - | Init of { - key: ('M, 'T) key; - value: ('M, 'T) Expression.t; - shorthand: bool; - } - | Method of { - key: ('M, 'T) key; - value: 'M * ('M, 'T) Function.t; - } - | Get of { - key: ('M, 'T) key; - value: 'M * ('M, 'T) Function.t; - comments: ('M, unit) Syntax.t option; - } - | Set of { - key: ('M, 'T) key; - value: 'M * ('M, 'T) Function.t; - comments: ('M, unit) Syntax.t option; - } - end - - module SpreadProperty : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - argument: ('M, 'T) Expression.t; - comments: ('M, unit) Syntax.t option; - } - end - - type ('M, 'T) property = - | Property of ('M, 'T) Property.t - | SpreadProperty of ('M, 'T) SpreadProperty.t - - and ('M, 'T) t = { - properties: ('M, 'T) property list; - comments: ('M, 'M Comment.t list) Syntax.t option; - } - end - - module Sequence : sig - type ('M, 'T) t = { - expressions: ('M, 'T) Expression.t list; - comments: ('M, unit) Syntax.t option; - } - end - - module Unary : sig - type operator = - | Minus - | Plus - | Not - | BitNot - | Typeof - | Void - | Delete - | Await - - and ('M, 'T) t = { - operator: operator; - argument: ('M, 'T) Expression.t; - comments: ('M, unit) Syntax.t option; - } - end - - module Binary : sig - type operator = - | Equal - | NotEqual - | StrictEqual - | StrictNotEqual - | LessThan - | LessThanEqual - | GreaterThan - | GreaterThanEqual - | LShift - | RShift - | RShift3 - | Plus - | Minus - | Mult - | Exp - | Div - | Mod - | BitOr - | Xor - | BitAnd - | In - | Instanceof - - and ('M, 'T) t = { - operator: operator; - left: ('M, 'T) Expression.t; - right: ('M, 'T) Expression.t; - comments: ('M, unit) Syntax.t option; - } - end - - module Assignment : sig - type operator = - | PlusAssign - | MinusAssign - | MultAssign - | ExpAssign - | DivAssign - | ModAssign - | LShiftAssign - | RShiftAssign - | RShift3Assign - | BitOrAssign - | BitXorAssign - | BitAndAssign - | NullishAssign - | AndAssign - | OrAssign - - and ('M, 'T) t = { - operator: operator option; - left: ('M, 'T) Pattern.t; - right: ('M, 'T) Expression.t; - comments: ('M, unit) Syntax.t option; - } - end - - module Update : sig - type operator = - | Increment - | Decrement - - and ('M, 'T) t = { - operator: operator; - argument: ('M, 'T) Expression.t; - prefix: bool; - comments: ('M, unit) Syntax.t option; - } - end - - module Logical : sig - type operator = - | Or - | And - | NullishCoalesce - - and ('M, 'T) t = { - operator: operator; - left: ('M, 'T) Expression.t; - right: ('M, 'T) Expression.t; - comments: ('M, unit) Syntax.t option; - } - end - - module Conditional : sig - type ('M, 'T) t = { - test: ('M, 'T) Expression.t; - consequent: ('M, 'T) Expression.t; - alternate: ('M, 'T) Expression.t; - comments: ('M, unit) Syntax.t option; - } - end - - type ('M, 'T) expression_or_spread = - | Expression of ('M, 'T) Expression.t - | Spread of ('M, 'T) SpreadElement.t - - module ArgList : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - arguments: ('M, 'T) expression_or_spread list; - comments: ('M, 'M Comment.t list) Syntax.t option; - } - end - - module New : sig - type ('M, 'T) t = { - callee: ('M, 'T) Expression.t; - targs: ('M, 'T) Expression.CallTypeArgs.t option; - arguments: ('M, 'T) ArgList.t option; - comments: ('M, unit) Syntax.t option; - } - end - - module Call : sig - type ('M, 'T) t = { - callee: ('M, 'T) Expression.t; - targs: ('M, 'T) Expression.CallTypeArgs.t option; - arguments: ('M, 'T) ArgList.t; - comments: ('M, unit) Syntax.t option; - } - end - - module OptionalCall : sig - type ('M, 'T) t = { - call: ('M, 'T) Call.t; - filtered_out: 'T; - optional: bool; - } - end - - module Member : sig - type ('M, 'T) property = - | PropertyIdentifier of ('M, 'T) Identifier.t - | PropertyPrivateName of 'M PrivateName.t - | PropertyExpression of ('M, 'T) Expression.t - - and ('M, 'T) t = { - _object: ('M, 'T) Expression.t; - property: ('M, 'T) property; - comments: ('M, unit) Syntax.t option; - } - end - - module OptionalMember : sig - type ('M, 'T) t = { - member: ('M, 'T) Member.t; - filtered_out: 'T; - optional: bool; - } - end - - module Yield : sig - type ('M, 'T) t = { - argument: ('M, 'T) Expression.t option; - comments: ('M, unit) Syntax.t option; - delegate: bool; - result_out: 'T; - } - end - - module TypeCast : sig - type ('M, 'T) t = { - expression: ('M, 'T) Expression.t; - annot: ('M, 'T) Type.annotation; - comments: ('M, unit) Syntax.t option; - } - end - - module AsExpression : sig - type ('M, 'T) t = { - expression: ('M, 'T) Expression.t; - annot: ('M, 'T) Type.annotation; - comments: ('M, unit) Syntax.t option; - } - end - - module TSTypeCast : sig - type ('M, 'T) kind = - | AsConst - | Satisfies of ('M, 'T) Type.t - [@@deriving show] - - type ('M, 'T) t = { - expression: ('M, 'T) Expression.t; - kind: ('M, 'T) kind; - comments: ('M, unit) Syntax.t option; - } - end - - module MetaProperty : sig - type 'M t = { - meta: ('M, 'M) Identifier.t; - property: ('M, 'M) Identifier.t; - comments: ('M, unit) Syntax.t option; - } - end - - module This : sig - type 'M t = { comments: ('M, unit) Syntax.t option } [@@deriving show] - end - - module Super : sig - type 'M t = { comments: ('M, unit) Syntax.t option } [@@deriving show] - end - - module Import : sig - type ('M, 'T) t = { - argument: ('M, 'T) Expression.t; - comments: ('M, unit) Syntax.t option; - } - end - - type ('M, 'T) t = 'T * ('M, 'T) t' - - and ('M, 'T) t' = - | Array of ('M, 'T) Array.t - | ArrowFunction of ('M, 'T) Function.t - | AsExpression of ('M, 'T) AsExpression.t - | Assignment of ('M, 'T) Assignment.t - | Binary of ('M, 'T) Binary.t - | Call of ('M, 'T) Call.t - | Class of ('M, 'T) Class.t - | Conditional of ('M, 'T) Conditional.t - | Function of ('M, 'T) Function.t - | Identifier of ('M, 'T) Identifier.t - | Import of ('M, 'T) Import.t - | JSXElement of ('M, 'T) JSX.element - | JSXFragment of ('M, 'T) JSX.fragment - | StringLiteral of 'M StringLiteral.t - | BooleanLiteral of 'M BooleanLiteral.t - | NullLiteral of ('M, unit) Syntax.t option - | NumberLiteral of 'M NumberLiteral.t - | BigIntLiteral of 'M BigIntLiteral.t - | RegExpLiteral of 'M RegExpLiteral.t - | ModuleRefLiteral of ('M, 'T) ModuleRefLiteral.t - | Logical of ('M, 'T) Logical.t - | Member of ('M, 'T) Member.t - | MetaProperty of 'M MetaProperty.t - | New of ('M, 'T) New.t - | Object of ('M, 'T) Object.t - | OptionalCall of ('M, 'T) OptionalCall.t - | OptionalMember of ('M, 'T) OptionalMember.t - | Sequence of ('M, 'T) Sequence.t - | Super of 'M Super.t - | TaggedTemplate of ('M, 'T) TaggedTemplate.t - | TemplateLiteral of ('M, 'T) TemplateLiteral.t - | This of 'M This.t - | TypeCast of ('M, 'T) TypeCast.t - | TSTypeCast of ('M, 'T) TSTypeCast.t - | Unary of ('M, 'T) Unary.t - | Update of ('M, 'T) Update.t - | Yield of ('M, 'T) Yield.t -end = - Expression - -and JSX : sig - module Identifier : sig - type ('M, 'T) t = 'T * 'M t' - + and + Identifier:sig + type ('M, 'T) t = ('T * 'M t') + and 'M t' = + { + name: string ; + comments: ('M, unit) Syntax.t option }[@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t -> unit + val show : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t -> string + val pp_t' : + (Format.formatter -> + 'M -> unit) + -> + Format.formatter -> + 'M t' -> unit + val show_t' : + (Format.formatter -> + 'M -> unit) + -> 'M t' -> string + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end = + struct + type ('M, 'T) t = ('T * 'M t') and 'M t' = { - name: string; - comments: ('M, unit) Syntax.t option; - } - end - - module NamespacedName : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - namespace: ('M, 'T) Identifier.t; - name: ('M, 'T) Identifier.t; - } - end - - module ExpressionContainer : sig - type ('M, 'T) t = { - expression: ('M, 'T) expression; - comments: ('M, 'M Comment.t list) Syntax.t option; - } - - and ('M, 'T) expression = - | Expression of ('M, 'T) Expression.t - | EmptyExpression - end - - module Text : sig - type t = { - value: string; - raw: string; - } - end - - module Attribute : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) name = + name: string ; + comments: ('M, unit) Syntax.t option }[@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T) t) -> () + let _ = fun (_ : 'M t') -> () + let rec pp : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t -> unit + = + ((let __0 = pp_t' in + (( + fun poly_M poly_T fmt (a0, a1) -> + Format.fprintf fmt "(@["; + ((poly_T fmt) a0; + Format.fprintf fmt ",@ "; + (__0 (fun fmt -> poly_M fmt) fmt) a1); + Format.fprintf fmt "@])") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" ((pp poly_M) poly_T) x + [@@ocaml.warning "-32"] + and pp_t' : + 'M . + (Format.formatter -> + 'M -> unit) + -> + Format.formatter -> + 'M t' -> unit + = + ((let __0 = Syntax.pp in + (( + fun poly_M fmt x -> + Format.fprintf fmt "@[<2>{ "; + ((Format.fprintf fmt "@[%s =@ " + "Flow_ast.Identifier.name"; + (Format.fprintf fmt "%S") x.name; + Format.fprintf fmt "@]"); + Format.fprintf fmt ";@ "; + Format.fprintf fmt "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string fmt + "None" + | Some x -> + (Format.pp_print_string fmt + "(Some "; + (__0 (fun fmt -> poly_M fmt) + (fun fmt () -> + Format.pp_print_string + fmt "()") fmt) x; + Format.pp_print_string fmt ")"))) + x.comments; + Format.fprintf fmt "@]"); + Format.fprintf fmt "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_t' : + 'M . + (Format.formatter -> + 'M -> unit) + -> 'M t' -> string + = + fun poly_M x -> + Format.asprintf "%a" (pp_t' poly_M) x + [@@ocaml.warning "-32"] + let _ = pp + and _ = show + and _ = pp_t' + and _ = show_t' + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end and + PrivateName:sig + type 'M t = ('M * 'M t') + and 'M t' = + { + name: string ; + comments: ('M, unit) Syntax.t option }[@@deriving + show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter -> + 'M -> unit) + -> + Format.formatter -> + 'M t -> unit + val show : + (Format.formatter -> + 'M -> unit) + -> 'M t -> string + val pp_t' : + (Format.formatter -> + 'M -> unit) + -> + Format.formatter -> + 'M t' -> unit + val show_t' : + (Format.formatter -> + 'M -> unit) + -> 'M t' -> string + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end = + struct + type 'M t = ('M * 'M t') + and 'M t' = { + name: string ; + comments: ('M, unit) Syntax.t option }[@@deriving show] + include + struct + let _ = fun (_ : 'M t) -> () + let _ = fun (_ : 'M t') -> () + let rec pp : + 'M . + (Format.formatter -> + 'M -> unit) + -> + Format.formatter -> + 'M t -> unit + = + ((let __0 = pp_t' in + (( + fun poly_M fmt (a0, a1) -> + Format.fprintf fmt "(@["; + ((poly_M fmt) a0; + Format.fprintf fmt ",@ "; + (__0 (fun fmt -> poly_M fmt) fmt) a1); + Format.fprintf fmt "@])") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M . + (Format.formatter -> + 'M -> unit) + -> 'M t -> string + = + fun poly_M x -> + Format.asprintf "%a" (pp poly_M) x + [@@ocaml.warning "-32"] + and pp_t' : + 'M . + (Format.formatter -> + 'M -> unit) + -> + Format.formatter -> + 'M t' -> unit + = + ((let __0 = Syntax.pp in + (( + fun poly_M fmt x -> + Format.fprintf fmt "@[<2>{ "; + ((Format.fprintf fmt "@[%s =@ " + "Flow_ast.PrivateName.name"; + (Format.fprintf fmt "%S") + x.name; + Format.fprintf fmt "@]"); + Format.fprintf fmt ";@ "; + Format.fprintf fmt "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string fmt + "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__0 (fun fmt -> poly_M fmt) + (fun fmt () -> + Format.pp_print_string + fmt "()") fmt) x; + Format.pp_print_string + fmt ")"))) x.comments; + Format.fprintf fmt "@]"); + Format.fprintf fmt "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_t' : + 'M . + (Format.formatter -> + 'M -> unit) + -> 'M t' -> string + = + fun poly_M x -> + Format.asprintf "%a" (pp_t' poly_M) x + [@@ocaml.warning "-32"] + let _ = pp + and _ = show + and _ = pp_t' + and _ = show_t' + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end and + StringLiteral:sig + type 'M t = + { + value: string ; + raw: string ; + comments: ('M, unit) Syntax.t option }[@@deriving + show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter -> + 'M -> unit) + -> + Format.formatter -> + 'M t -> unit + val show : + (Format.formatter -> + 'M -> unit) + -> 'M t -> string + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end = + struct + type 'M t = + { + value: string ; + raw: string ; + comments: ('M, unit) Syntax.t option }[@@deriving show] + include + struct + let _ = fun (_ : 'M t) -> () + let rec pp : + 'M . + (Format.formatter -> + 'M -> unit) + -> + Format.formatter -> + 'M t -> unit + = + ((let __0 = Syntax.pp in + (( fun poly_M fmt x -> + Format.fprintf fmt "@[<2>{ "; + (((Format.fprintf fmt + "@[%s =@ " "Flow_ast.StringLiteral.value"; + (Format.fprintf fmt "%S") + x.value; + Format.fprintf fmt "@]"); + Format.fprintf fmt ";@ "; + Format.fprintf fmt + "@[%s =@ " "raw"; + (Format.fprintf fmt "%S") + x.raw; + Format.fprintf fmt "@]"); + Format.fprintf fmt ";@ "; + Format.fprintf fmt + "@[%s =@ " "comments"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__0 (fun fmt -> poly_M fmt) + (fun fmt () -> + Format.pp_print_string + fmt "()") fmt) x; + Format.pp_print_string + fmt ")"))) x.comments; + Format.fprintf fmt "@]"); + Format.fprintf fmt "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M . + (Format.formatter -> + 'M -> unit) + -> 'M t -> string + = + fun poly_M x -> + Format.asprintf "%a" (pp poly_M) x + [@@ocaml.warning "-32"] + let _ = pp + and _ = show + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end and + NumberLiteral:sig + type 'M t = + { + value: float ; + raw: string ; + comments: ('M, unit) Syntax.t option } + [@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter + -> 'M -> unit) + -> + Format.formatter + -> + 'M t -> unit + val show : + (Format.formatter + -> 'M -> unit) + -> + 'M t -> string + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end = + struct + type 'M t = + { + value: float ; + raw: string ; + comments: ('M, unit) Syntax.t option }[@@deriving show] + include + struct + let _ = fun (_ : 'M t) -> () + let rec pp : + 'M . + (Format.formatter -> + 'M -> unit) + -> + Format.formatter -> + 'M t -> unit + = + ((let __0 = Syntax.pp in + (( fun poly_M fmt x -> + Format.fprintf fmt + "@[<2>{ "; + (((Format.fprintf fmt + "@[%s =@ " + "Flow_ast.NumberLiteral.value"; + (Format.fprintf fmt + "%F") x.value; + Format.fprintf fmt + "@]"); + Format.fprintf fmt + ";@ "; + Format.fprintf fmt + "@[%s =@ " "raw"; + (Format.fprintf fmt + "%S") x.raw; + Format.fprintf fmt + "@]"); + Format.fprintf fmt + ";@ "; + Format.fprintf fmt + "@[%s =@ " "comments"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__0 (fun fmt -> poly_M fmt) + (fun fmt () -> + Format.pp_print_string + fmt "()") fmt) x; + Format.pp_print_string + fmt ")"))) x.comments; + Format.fprintf fmt + "@]"); + Format.fprintf fmt + "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M . + (Format.formatter -> + 'M -> unit) + -> 'M t -> string + = + fun poly_M x -> + Format.asprintf "%a" + (pp poly_M) x[@@ocaml.warning "-32"] + let _ = pp + and _ = show + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end and + BigIntLiteral:sig + type 'M t = + { + value: int64 option ; + raw: string ; + comments: ('M, unit) Syntax.t option } + [@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M t -> + unit + val show : + (Format.formatter + -> + 'M -> + unit) + -> + 'M t -> + string + end[@@ocaml.doc "@inline"][@@merlin.hide + ] + end = + struct + type 'M t = + { + value: int64 option ; + raw: string ; + comments: ('M, unit) Syntax.t option }[@@deriving + show] + include + struct + let _ = fun (_ : 'M t) -> () + let rec pp : + 'M . + (Format.formatter -> + 'M -> unit) + -> + Format.formatter -> + 'M t -> unit + = + ((let __0 = Syntax.pp in + (( fun poly_M fmt x -> + Format.fprintf fmt + "@[<2>{ "; + (((Format.fprintf + fmt "@[%s =@ " + "Flow_ast.BigIntLiteral.value"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (Format.fprintf + fmt "%LdL") x; + Format.pp_print_string + fmt ")"))) x.value; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "raw"; + (Format.fprintf + fmt "%S") x.raw; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "comments"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__0 (fun fmt -> poly_M fmt) + (fun fmt () -> + Format.pp_print_string + fmt "()") fmt) x; + Format.pp_print_string + fmt ")"))) x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf fmt + "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M . + (Format.formatter -> + 'M -> unit) + -> 'M t -> string + = + fun poly_M x -> + Format.asprintf "%a" + (pp poly_M) x[@@ocaml.warning "-32"] + let _ = pp + and _ = show + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end and + BooleanLiteral:sig + type 'M t = + { + value: bool ; + comments: + ('M, unit) Syntax.t option } + [@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M t -> + unit + val show : + (Format.formatter + -> + 'M -> + unit) + -> + 'M t -> + string + end[@@ocaml.doc "@inline"] + [@@merlin.hide ] + end = + struct + type 'M t = + { + value: bool ; + comments: ('M, unit) Syntax.t option } + [@@deriving show] + include + struct + let _ = fun (_ : 'M t) -> () + let rec pp : + 'M . + (Format.formatter + -> 'M -> unit) + -> + Format.formatter + -> 'M t -> unit + = + ((let __0 = Syntax.pp in + (( fun poly_M fmt x -> + Format.fprintf + fmt "@[<2>{ "; + ((Format.fprintf + fmt "@[%s =@ " + "Flow_ast.BooleanLiteral.value"; + (Format.fprintf + fmt "%B") x.value; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "comments"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__0 + (fun fmt -> poly_M fmt) + (fun fmt () -> + Format.pp_print_string + fmt "()") fmt) x; + Format.pp_print_string + fmt ")"))) x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M . + (Format.formatter + -> 'M -> unit) + -> 'M t -> string + = + fun poly_M x -> + Format.asprintf + "%a" (pp poly_M) x[@@ocaml.warning + "-32"] + let _ = pp + and _ = show + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end and + RegExpLiteral:sig + type 'M t = + { + pattern: string ; + flags: string ; + raw: string ; + comments: + ('M, unit) Syntax.t + option + }[@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M t -> + unit + val show : + (Format.formatter + -> + 'M -> + unit) + -> + 'M t -> + string + end[@@ocaml.doc "@inline"] + [@@merlin.hide ] + end = + struct + type 'M t = + { + pattern: string ; + flags: string ; + raw: string ; + comments: ('M, unit) Syntax.t option } + [@@deriving show] + include + struct + let _ = fun (_ : 'M t) -> () + let rec pp : + 'M . + (Format.formatter + -> + 'M -> unit) + -> + Format.formatter + -> + 'M t -> + unit + = + ((let __0 = Syntax.pp in + (( fun poly_M fmt x -> + Format.fprintf + fmt "@[<2>{ "; + ((((Format.fprintf + fmt "@[%s =@ " + "Flow_ast.RegExpLiteral.pattern"; + (Format.fprintf + fmt "%S") x.pattern; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "flags"; + (Format.fprintf + fmt "%S") x.flags; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "raw"; + (Format.fprintf + fmt "%S") x.raw; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "comments"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__0 + (fun fmt -> + poly_M fmt) + (fun fmt () -> + Format.pp_print_string + fmt "()") fmt) + x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M . + (Format.formatter + -> + 'M -> unit) + -> + 'M t -> + string + = + fun poly_M x -> + Format.asprintf + "%a" (pp poly_M) x[@@ocaml.warning + "-32"] + let _ = pp + and _ = show + end[@@ocaml.doc "@inline"][@@merlin.hide + ] + end and + ModuleRefLiteral:sig + type ('M, 'T) t = + { + value: string ; + require_loc: 'M ; + def_loc_opt: + 'M option ; + prefix_len: int ; + legacy_interop: + bool ; + raw: string ; + comments: + ('M, unit) + Syntax.t option + }[@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end[@@ocaml.doc + "@inline"] + [@@merlin.hide ] + end = + struct + type ('M, 'T) t = + { + value: string ; + require_loc: 'M ; + def_loc_opt: 'M option ; + prefix_len: int ; + legacy_interop: bool ; + raw: string ; + comments: ('M, unit) Syntax.t option } + [@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T) t) -> () + let rec pp : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + = + ((let __0 = Syntax.pp in + (( + fun poly_M poly_T fmt x -> + Format.fprintf + fmt "@[<2>{ "; + (((((((Format.fprintf + fmt "@[%s =@ " + "Flow_ast.ModuleRefLiteral.value"; + (Format.fprintf + fmt "%S") + x.value; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " + "require_loc"; + (poly_M fmt) + x.require_loc; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " + "def_loc_opt"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt + "(Some "; + (poly_M fmt) + x; + Format.pp_print_string + fmt ")"))) + x.def_loc_opt; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " + "prefix_len"; + (Format.fprintf + fmt "%d") + x.prefix_len; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " + "legacy_interop"; + (Format.fprintf + fmt "%B") + x.legacy_interop; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "raw"; + (Format.fprintf + fmt "%S") x.raw; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__0 + (fun fmt -> + poly_M fmt) + (fun fmt () + -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t -> + string + = + fun poly_M poly_T x -> + Format.asprintf + "%a" ((pp poly_M) poly_T) x + [@@ocaml.warning "-32"] + let _ = pp + and _ = show + end[@@ocaml.doc "@inline"][@@merlin.hide + ] + end and + Variance:sig + type 'M t = ('M * 'M t') + and kind = + | Plus + | Minus + | Readonly + | In + | Out + | InOut + and 'M t' = + { + kind: kind ; + comments: + ('M, unit) Syntax.t + option + }[@@deriving show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M t -> + unit + val show : + (Format.formatter + -> + 'M -> + unit) + -> + 'M t -> + string + val pp_kind : + Format.formatter + -> + kind -> + unit + val show_kind : + kind -> + string + val pp_t' : + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M t' -> + unit + val show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + 'M t' -> + string + end[@@ocaml.doc + "@inline"] + [@@merlin.hide ] + end = + struct + type 'M t = ('M * 'M t') + and kind = + | Plus + | Minus + | Readonly + | In + | Out + | InOut + and 'M t' = + { + kind: kind ; + comments: + ('M, unit) Syntax.t option } + [@@deriving show] + include + struct + let _ = fun (_ : 'M t) -> () + let _ = fun (_ : kind) -> () + let _ = fun (_ : 'M t') -> () + let rec pp : + 'M . + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M t -> + unit + = + ((let __0 = pp_t' in + (( + fun poly_M fmt + (a0, a1) -> + Format.fprintf + fmt "(@["; + ((poly_M fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt -> + poly_M fmt) + fmt) a1); + Format.fprintf + fmt "@])") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M . + (Format.formatter + -> + 'M -> + unit) + -> + 'M t -> + string + = + fun poly_M x -> + Format.asprintf + "%a" (pp poly_M) x + [@@ocaml.warning "-32"] + and pp_kind : + Format.formatter + -> + kind -> + unit + = + (( + fun fmt -> + function + | Plus -> + Format.pp_print_string + fmt + "Flow_ast.Variance.Plus" + | Minus -> + Format.pp_print_string + fmt + "Flow_ast.Variance.Minus" + | Readonly -> + Format.pp_print_string + fmt + "Flow_ast.Variance.Readonly" + | In -> + Format.pp_print_string + fmt + "Flow_ast.Variance.In" + | Out -> + Format.pp_print_string + fmt + "Flow_ast.Variance.Out" + | InOut -> + Format.pp_print_string + fmt + "Flow_ast.Variance.InOut") + [@ocaml.warning "-39"] + [@ocaml.warning "-A"]) + and show_kind : + kind -> + string + = + fun x -> + Format.asprintf + "%a" pp_kind x[@@ocaml.warning + "-32"] + and pp_t' : + 'M . + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M t' -> + unit + = + ((let __1 = Syntax.pp + and __0 = pp_kind in + (( + fun poly_M fmt x -> + Format.fprintf + fmt "@[<2>{ "; + ((Format.fprintf + fmt "@[%s =@ " + "Flow_ast.Variance.kind"; + (__0 fmt) x.kind; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_t' : + 'M . + (Format.formatter + -> + 'M -> + unit) + -> + 'M t' -> + string + = + fun poly_M x -> + Format.asprintf + "%a" (pp_t' poly_M) x + [@@ocaml.warning "-32"] + let _ = pp + and _ = show + and _ = pp_kind + and _ = show_kind + and _ = pp_t' + and _ = show_t' + end[@@ocaml.doc "@inline"] + [@@merlin.hide ] + end and + ComputedKey:sig + type ('M, + 'T) t = + ('M * ( + 'M, + 'T) + ComputedKey.t') + and ('M, + 'T) t' = + { + expression: + ('M, + 'T) + Expression.t + ; + comments: + ('M, + unit) + Syntax.t + option + }[@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val pp_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + val show_t' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + end[@@ocaml.doc + "@inline"] + [@@merlin.hide ] + end = + struct + type ('M, 'T) t = + ('M * ('M, 'T) + ComputedKey.t') + and ('M, 'T) t' = + { + expression: + ('M, 'T) Expression.t ; + comments: + ('M, unit) Syntax.t + option + }[@@deriving show] + include + struct + let _ = + fun (_ : ('M, 'T) t) + -> () + let _ = + fun (_ : ('M, 'T) t') + -> () + let rec pp : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + = + ((let __0 = + ComputedKey.pp_t' in + (( + fun poly_M + poly_T fmt + (a0, a1) -> + Format.fprintf + fmt "(@["; + ((poly_M fmt) + a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t -> + string + = + fun poly_M poly_T x -> + Format.asprintf + "%a" + ((pp poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_t' : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t' -> + unit + = + ((let __1 = Syntax.pp + and __0 = + Expression.pp in + (( + fun poly_M + poly_T fmt x + -> + Format.fprintf + fmt + "@[<2>{ "; + ((Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.ComputedKey.expression"; + (__0 + ( + fun fmt + -> + poly_M + fmt) + ( + fun fmt + -> + poly_T + fmt) fmt) + x.expression; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning "-39"]) + and show_t' : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t' -> + string + = + fun poly_M poly_T x -> + Format.asprintf + "%a" + ((pp_t' poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = pp + and _ = show + and _ = pp_t' + and _ = show_t' + end[@@ocaml.doc "@inline"] + [@@merlin.hide ] + end and + Variable:sig + type kind = + | Var + | Let + | Const + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val + pp_kind : + Format.formatter + -> + kind -> + unit + val + show_kind + : + kind -> + string + end[@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end = + struct + type kind = + | Var + | Let + | Const [@@deriving + show] + include + struct + let _ = + fun (_ : kind) -> + () + let rec pp_kind : + Format.formatter + -> + kind -> + unit + = + (( + fun fmt -> + function + | Var -> + Format.pp_print_string + fmt + "Flow_ast.Variable.Var" + | Let -> + Format.pp_print_string + fmt + "Flow_ast.Variable.Let" + | Const -> + Format.pp_print_string + fmt + "Flow_ast.Variable.Const") + [@ocaml.warning + "-39"][@ocaml.warning + "-A"]) + and show_kind : + kind -> + string + = + fun x -> + Format.asprintf + "%a" pp_kind + x[@@ocaml.warning + "-32"] + let _ = pp_kind + and _ = show_kind + end[@@ocaml.doc + "@inline"] + [@@merlin.hide ] + end and + Type:sig + module + Conditional : + sig + type ( + 'M, + 'T) t = + { + check_type: + ('M, + 'T) + Type.t ; + extends_type: + ('M, + 'T) + Type.t ; + true_type: + ('M, + 'T) + Type.t ; + false_type: + ('M, + 'T) + Type.t ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Infer + : + sig + type ( + 'M, + 'T) t = + { + tparam: + ('M, + 'T) + Type.TypeParam.t + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + Function : + sig + module + Param : + sig + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + name: + ('M, + 'T) + Identifier.t + option ; + annot: + ('M, + 'T) + Type.t ; + optional: + bool } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val pp_t' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + val + show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + RestParam : + sig + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + argument: + ('M, + 'T) + Param.t ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val pp_t' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + val + show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + ThisParam : + sig + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + annot: + ('M, + 'T) + Type.annotation + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val pp_t' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + val + show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + Params : + sig + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + this_: + ('M, + 'T) + ThisParam.t + option ; + params: + ('M, + 'T) + Param.t + list ; + rest: + ('M, + 'T) + RestParam.t + option ; + comments: + ('M, + 'M + Comment.t + list) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val pp_t' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + val + show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type ( + 'M, + 'T) t = + { + tparams: + ('M, + 'T) + Type.TypeParams.t + option ; + params: + ('M, + 'T) + Params.t ; + return: + ('M, + 'T) + return_annotation + ; + comments: + ('M, + unit) + Syntax.t + option ; + effect_: + Function.effect_ + } + and ( + 'M, + 'T) return_annotation = + | + TypeAnnotation + of ( + 'M, + 'T) + Type.t + | + TypeGuard + of ( + 'M, + 'T) + Type.TypeGuard.t + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val + pp_return_annotation + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + return_annotation + -> + unit + val + show_return_annotation + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + return_annotation + -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + Component : + sig + module + Param : + sig + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + name: + ('M, + 'T) + Statement.ComponentDeclaration.Param.param_name + ; + annot: + ('M, + 'T) + Type.annotation + ; + optional: + bool } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val pp_t' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + val + show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + RestParam : + sig + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + argument: + ('M, + 'T) + Identifier.t + option ; + annot: + ('M, + 'T) + Type.t ; + optional: + bool ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val pp_t' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + val + show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + Params : + sig + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + params: + ('M, + 'T) + Param.t + list ; + rest: + ('M, + 'T) + RestParam.t + option ; + comments: + ('M, + 'M + Comment.t + list) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val pp_t' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + val + show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type ( + 'M, + 'T) t = + { + tparams: + ('M, + 'T) + Type.TypeParams.t + option ; + params: + ('M, + 'T) + Params.t ; + renders: + ('M, + 'T) + Type.component_renders_annotation + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + Generic : + sig + module + Identifier + : + sig + type ( + 'M, + 'T) t = + | + Unqualified + of ( + 'M, + 'T) + Identifier.t + + | + Qualified + of ( + 'M, + 'T) + qualified + and ( + 'M, + 'T) qualified = + ('M * + ('M, + 'T) + qualified') + and ( + 'M, + 'T) qualified' = + { + qualification: + ('M, + 'T) t ; + id: + ('M, + 'T) + Identifier.t + } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val + pp_qualified + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + qualified + -> + unit + val + show_qualified + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + qualified + -> + string + val + pp_qualified' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + qualified' + -> + unit + val + show_qualified' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + qualified' + -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type ( + 'M, + 'T) t = + { + id: + ('M, + 'T) + Identifier.t + ; + targs: + ('M, + 'T) + Type.TypeArgs.t + option ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + IndexedAccess + : + sig + type ( + 'M, + 'T) t = + { + _object: + ('M, + 'T) + Type.t ; + index: + ('M, + 'T) + Type.t ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + OptionalIndexedAccess + : + sig + type ( + 'M, + 'T) t = + { + indexed_access: + ('M, + 'T) + IndexedAccess.t + ; + optional: + bool } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Object + : + sig + module + Property : + sig + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + key: + ('M, + 'T) + Expression.Object.Property.key + ; + value: + ('M, + 'T) value ; + optional: + bool ; + static: + bool ; + proto: + bool ; + _method: + bool ; + variance: + 'M + Variance.t + option ; + comments: + ('M, + unit) + Syntax.t + option } + and ( + 'M, + 'T) value = + | Init of + ('M, + 'T) + Type.t + | Get of + ('M * + ('M, + 'T) + Function.t) + + | Set of + ('M * + ('M, + 'T) + Function.t) + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val pp_t' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + val + show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + val + pp_value + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) value + -> + unit + val + show_value + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) value + -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + SpreadProperty + : + sig + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + argument: + ('M, + 'T) + Type.t ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val pp_t' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + val + show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + Indexer : + sig + type ( + 'M, + 'T) t' = + { + id: + ('M, + 'M) + Identifier.t + option ; + key: + ('M, + 'T) + Type.t ; + value: + ('M, + 'T) + Type.t ; + static: + bool ; + variance: + 'M + Variance.t + option ; + comments: + ('M, + unit) + Syntax.t + option } + and ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp_t' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + val + show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + MappedType + : + sig + type optional_flag = + | + PlusOptional + + | + MinusOptional + + | + Optional + + | + NoOptionalFlag + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val + pp_optional_flag + : + Format.formatter + -> + optional_flag + -> + unit + val + show_optional_flag + : + optional_flag + -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + type ( + 'M, + 'T) t' = + { + key_tparam: + ('M, + 'T) + Type.TypeParam.t + ; + prop_type: + ('M, + 'T) + Type.t ; + source_type: + ('M, + 'T) + Type.t ; + variance: + 'M + Variance.t + option ; + optional: + optional_flag + ; + comments: + ('M, + unit) + Syntax.t + option } + and ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp_t' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + val + show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + CallProperty + : + sig + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + value: + ('M * + ('M, + 'T) + Function.t) + ; + static: + bool ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val pp_t' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + val + show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + InternalSlot + : + sig + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + id: + ('M, + 'M) + Identifier.t + ; + value: + ('M, + 'T) + Type.t ; + optional: + bool ; + static: + bool ; + _method: + bool ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val pp_t' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + val + show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type ( + 'M, + 'T) t = + { + exact: + bool ; + inexact: + bool ; + properties: + ('M, + 'T) + property + list ; + comments: + ('M, + 'M + Comment.t + list) + Syntax.t + option } + and ( + 'M, + 'T) property = + | + Property + of ( + 'M, + 'T) + Property.t + + | + SpreadProperty + of ( + 'M, + 'T) + SpreadProperty.t + + | Indexer + of ( + 'M, + 'T) + Indexer.t + + | + CallProperty + of ( + 'M, + 'T) + CallProperty.t + + | + InternalSlot + of ( + 'M, + 'T) + InternalSlot.t + + | + MappedType + of ( + 'M, + 'T) + MappedType.t + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val + pp_property + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + property + -> + unit + val + show_property + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + property + -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + Interface : + sig + type ( + 'M, + 'T) t = + { + body: + ('M * + ('M, + 'T) + Object.t) ; + extends: + ('M * + ('M, + 'T) + Generic.t) + list ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + Nullable : + sig + type ( + 'M, + 'T) t = + { + argument: + ('M, + 'T) + Type.t ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Typeof + : + sig + module + Target : + sig + type ( + 'M, + 'T) t = + | + Unqualified + of ( + 'M, + 'T) + Identifier.t + + | + Qualified + of ( + 'M, + 'T) + qualified + and ( + 'M, + 'T) qualified' = + { + qualification: + ('M, + 'T) t ; + id: + ('M, + 'T) + Identifier.t + } + and ( + 'M, + 'T) qualified = + ('T * + ('M, + 'T) + qualified') + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val + pp_qualified' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + qualified' + -> + unit + val + show_qualified' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + qualified' + -> + string + val + pp_qualified + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + qualified + -> + unit + val + show_qualified + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + qualified + -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type ( + 'M, + 'T) t = + { + argument: + ('M, + 'T) + Target.t ; + targs: + ('M, + 'T) + Type.TypeArgs.t + option ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Keyof + : + sig + type ( + 'M, + 'T) t = + { + argument: + ('M, + 'T) + Type.t ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + Renders : + sig + type variant = + | Normal + + | Maybe + | Star + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val + pp_variant + : + Format.formatter + -> + variant + -> + unit + val + show_variant + : + variant + -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + type ( + 'M, + 'T) t = + { + operator_loc: + 'M ; + argument: + ('M, + 'T) + Type.t ; + comments: + ('M, + unit) + Syntax.t + option ; + variant: + variant } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + ReadOnly : + sig + type ( + 'M, + 'T) t = + { + argument: + ('M, + 'T) + Type.t ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Tuple + : + sig + module + LabeledElement + : + sig + type ( + 'M, + 'T) t = + { + name: + ('M, + 'T) + Identifier.t + ; + annot: + ('M, + 'T) + Type.t ; + variance: + 'M + Variance.t + option ; + optional: + bool } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + SpreadElement + : + sig + type ( + 'M, + 'T) t = + { + name: + ('M, + 'T) + Identifier.t + option ; + annot: + ('M, + 'T) + Type.t } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type ( + 'M, + 'T) element = + ('M * + ('M, + 'T) + element') + [@@deriving + show] + and ( + 'M, + 'T) element' = + | + UnlabeledElement + of ( + 'M, + 'T) + Type.t + | + LabeledElement + of ( + 'M, + 'T) + LabeledElement.t + + | + SpreadElement + of ( + 'M, + 'T) + SpreadElement.t + [@@deriving + show] + and ( + 'M, + 'T) t = + { + elements: + ('M, + 'T) + element + list ; + inexact: + bool ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val + pp_element + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + element + -> + unit + val + show_element + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + element + -> + string + val + pp_element' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + element' + -> + unit + val + show_element' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + element' + -> + string + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val + pp_element + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + element + -> + unit + val + show_element + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + element + -> + string + val + pp_element' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + element' + -> + unit + val + show_element' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + element' + -> + string + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val + pp_element + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + element + -> + unit + val + show_element + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + element + -> + string + val + pp_element' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + element' + -> + unit + val + show_element' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + element' + -> + string + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Array + : + sig + type ( + 'M, + 'T) t = + { + argument: + ('M, + 'T) + Type.t ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Union + : + sig + type ( + 'M, + 'T) t = + { + types: + (('M, + 'T) + Type.t * + ('M, + 'T) + Type.t * + ('M, + 'T) + Type.t + list) ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + Intersection + : + sig + type ( + 'M, + 'T) t = + { + types: + (('M, + 'T) + Type.t * + ('M, + 'T) + Type.t * + ('M, + 'T) + Type.t + list) ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type ( + 'M, + 'T) t = + ('T * ( + 'M, + 'T) t') + and ( + 'M, + 'T) t' = + | Any of + ('M, + unit) + Syntax.t + option + | Mixed of + ('M, + unit) + Syntax.t + option + | Empty of + ('M, + unit) + Syntax.t + option + | Void of + ('M, + unit) + Syntax.t + option + | Null of + ('M, + unit) + Syntax.t + option + | Number of + ('M, + unit) + Syntax.t + option + | BigInt of + ('M, + unit) + Syntax.t + option + | String of + ('M, + unit) + Syntax.t + option + | Boolean + of + { + raw: + [ + `Boolean + | `Bool ] ; + comments: + ('M, + unit) + Syntax.t + option } + + | Symbol of + ('M, + unit) + Syntax.t + option + | Exists of + ('M, + unit) + Syntax.t + option + | Nullable + of ( + 'M, + 'T) + Nullable.t + + | Function + of ( + 'M, + 'T) + Function.t + + | Component + of ( + 'M, + 'T) + Component.t + + | Object of + ('M, + 'T) + Object.t + | Interface + of ( + 'M, + 'T) + Interface.t + + | Array of + ('M, + 'T) Array.t + + | + Conditional + of ( + 'M, + 'T) + Conditional.t + + | Infer of + ('M, + 'T) Infer.t + + | Generic + of ( + 'M, + 'T) + Generic.t + | + IndexedAccess + of ( + 'M, + 'T) + IndexedAccess.t + + | + OptionalIndexedAccess + of ( + 'M, + 'T) + OptionalIndexedAccess.t + + | Union of + ('M, + 'T) Union.t + + | + Intersection + of ( + 'M, + 'T) + Intersection.t + + | Typeof of + ('M, + 'T) + Typeof.t + | Keyof of + ('M, + 'T) Keyof.t + + | Renders + of ( + 'M, + 'T) + Renders.t + | ReadOnly + of ( + 'M, + 'T) + ReadOnly.t + + | Tuple of + ('M, + 'T) Tuple.t + + | + StringLiteral + of 'M + StringLiteral.t + + | + NumberLiteral + of 'M + NumberLiteral.t + + | + BigIntLiteral + of 'M + BigIntLiteral.t + + | + BooleanLiteral + of 'M + BooleanLiteral.t + + | Unknown + of ( + 'M, + unit) + Syntax.t + option + | Never of + ('M, + unit) + Syntax.t + option + | Undefined + of ( + 'M, + unit) + Syntax.t + option + and ( + 'M, + 'T) annotation = + ('M * ( + 'M, + 'T) t) + and ( + 'M, + 'T) type_guard_annotation = + ('M * ( + 'M, + 'T) + Type.TypeGuard.t) + and ( + 'M, + 'T) annotation_or_hint = + | Missing + of 'T + | Available + of ( + 'M, + 'T) + Type.annotation + [@@deriving + show] + and ( + 'M, + 'T) component_renders_annotation = + | + MissingRenders + of 'T + | + AvailableRenders + of 'M * + ('M, + 'T) + Type.Renders.t + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val pp_t' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + val + show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + val + pp_annotation + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + annotation + -> + unit + val + show_annotation + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + annotation + -> + string + val + pp_type_guard_annotation + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + type_guard_annotation + -> + unit + val + show_type_guard_annotation + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + type_guard_annotation + -> + string + val + pp_annotation_or_hint + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + annotation_or_hint + -> + unit + val + show_annotation_or_hint + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + annotation_or_hint + -> + string + val + pp_component_renders_annotation + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + component_renders_annotation + -> + unit + val + show_component_renders_annotation + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + component_renders_annotation + -> + string + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val pp_t' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + val + show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + val + pp_annotation + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + annotation + -> + unit + val + show_annotation + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + annotation + -> + string + val + pp_type_guard_annotation + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + type_guard_annotation + -> + unit + val + show_type_guard_annotation + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + type_guard_annotation + -> + string + val + pp_annotation_or_hint + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + annotation_or_hint + -> + unit + val + show_annotation_or_hint + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + annotation_or_hint + -> + string + val + pp_component_renders_annotation + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + component_renders_annotation + -> + unit + val + show_component_renders_annotation + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + component_renders_annotation + -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + module + TypeParam : + sig + type bound_kind = + | Colon + | Extends + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val + pp_bound_kind + : + Format.formatter + -> + bound_kind + -> + unit + val + show_bound_kind + : + bound_kind + -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + module + ConstModifier + : + sig + type + 'M t = + ('M * + ('M, + unit) + Syntax.t + option) + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + 'M t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + name: + ('M, + 'M) + Identifier.t + ; + bound: + ('M, + 'T) + Type.annotation_or_hint + ; + bound_kind: + bound_kind + ; + variance: + 'M + Variance.t + option ; + default: + ('M, + 'T) + Type.t + option ; + const: + 'M + ConstModifier.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val pp_t' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + val + show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + TypeParams : + sig + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + params: + ('M, + 'T) + TypeParam.t + list ; + comments: + ('M, + 'M + Comment.t + list) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val pp_t' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + val + show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + TypeArgs : + sig + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + arguments: + ('M, + 'T) + Type.t + list ; + comments: + ('M, + 'M + Comment.t + list) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val pp_t' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + val + show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + Predicate : + sig + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + kind: + ('M, + 'T) kind ; + comments: + ('M, + unit) + Syntax.t + option } + and ( + 'M, + 'T) kind = + | + Declared + of ( + 'M, + 'T) + Expression.t + + | + Inferred + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val pp_t' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + val + show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + val + pp_kind : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) kind + -> + unit + val + show_kind + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) kind + -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + TypeGuard : + sig + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and kind = + | Default + + | Asserts + + | Implies + and ( + 'M, + 'T) t' = + { + kind: + kind ; + guard: + (('M, + 'M) + Identifier.t + * ( + 'M, + 'T) + Type.t + option) ; + comments: + ('M, + 'M + Comment.t + list) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val + pp_kind : + Format.formatter + -> + kind -> + unit + val + show_kind + : + kind -> + string + val pp_t' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + val + show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + end = + struct + module Conditional = + struct + type ( + 'M, + 'T) t = + { + check_type: + ('M, + 'T) + Type.t + ; + extends_type: + ('M, + 'T) + Type.t + ; + true_type: + ('M, + 'T) + Type.t + ; + false_type: + ('M, + 'T) + Type.t + ; + comments: + ('M, + unit) + Syntax.t + option + }[@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + (( + let __4 = + Syntax.pp + and __3 = + Type.pp + and __2 = + Type.pp + and __1 = + Type.pp + and __0 = + Type.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Type.Conditional.check_type"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.check_type; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "extends_type"; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.extends_type; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "true_type"; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.true_type; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "false_type"; + (__3 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.false_type; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__4 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = pp + and _ = + show + end[@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Infer = + struct + type ( + 'M, + 'T) t = + { + tparam: + ('M, + 'T) + Type.TypeParam.t + ; + comments: + ('M, + unit) + Syntax.t + option + }[@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + (( + let __1 = + Syntax.pp + and __0 = + Type.TypeParam.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Type.Infer.tparam"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.tparam; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = pp + and _ = + show + end[@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Function = + struct + module Param = + struct + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + name: + ('M, + 'T) + Identifier.t + option ; + annot: + ('M, + 'T) + Type.t ; + optional: + bool } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let _ = + fun + (_ : + ('M, + 'T) t') + -> () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __0 + = pp_t' in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + = + ((let __1 + = Type.pp + and __0 = + Identifier.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Type.Function.Param.name"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.name; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "annot"; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.annot; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "optional"; + (Format.fprintf + fmt "%B") + x.optional; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_t' + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + and _ = + pp_t' + and _ = + show_t' + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module RestParam = + struct + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + argument: + ('M, + 'T) + Param.t ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let _ = + fun + (_ : + ('M, + 'T) t') + -> () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __0 + = pp_t' in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + = + ((let __1 + = + Syntax.pp + and __0 = + Param.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Type.Function.RestParam.argument"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.argument; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_t' + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + and _ = + pp_t' + and _ = + show_t' + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module ThisParam = + struct + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + annot: + ('M, + 'T) + Type.annotation + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let _ = + fun + (_ : + ('M, + 'T) t') + -> () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __0 + = pp_t' in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + = + ((let __1 + = + Syntax.pp + and __0 = + Type.pp_annotation in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Type.Function.ThisParam.annot"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.annot; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_t' + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + and _ = + pp_t' + and _ = + show_t' + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Params = + struct + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + this_: + ('M, + 'T) + ThisParam.t + option ; + params: + ('M, + 'T) + Param.t + list ; + rest: + ('M, + 'T) + RestParam.t + option ; + comments: + ('M, + 'M + Comment.t + list) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let _ = + fun + (_ : + ('M, + 'T) t') + -> () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __0 + = pp_t' in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + = + ((let __4 + = + Syntax.pp + and __3 = + Comment.pp + and __2 = + RestParam.pp + and __1 = + Param.pp + and __0 = + ThisParam.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Type.Function.Params.this_"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.this_; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "params"; + ((fun x + -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]")) + x.params; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "rest"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.rest; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__4 + (fun fmt + -> + poly_M + fmt) + (fun fmt + x -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__3 + (fun fmt + -> + poly_M + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_t' + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + and _ = + pp_t' + and _ = + show_t' + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type ( + 'M, + 'T) t = + { + tparams: + ('M, + 'T) + Type.TypeParams.t + option + ; + params: + ('M, + 'T) + Params.t + ; + return: + ('M, + 'T) + return_annotation + ; + comments: + ('M, + unit) + Syntax.t + option + ; + effect_: + Function.effect_ + } + and ('M, + 'T) return_annotation = + | + TypeAnnotation + of ( + 'M, + 'T) Type.t + | TypeGuard + of ( + 'M, + 'T) + Type.TypeGuard.t + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let _ = + fun + (_ : + ('M, + 'T) + return_annotation) + -> () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + (( + let __4 = + Function.pp_effect_ + and __3 = + Syntax.pp + and __2 = + pp_return_annotation + and __1 = + Params.pp + and __0 = + Type.TypeParams.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Type.Function.tparams"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.tparams; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "params"; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.params; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "return"; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.return; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__3 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "effect_"; + (__4 fmt) + x.effect_; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_return_annotation + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + return_annotation + -> + unit + = + (( + let __1 = + Type.TypeGuard.pp + and __0 = + Type.pp in + (( + fun + poly_M + poly_T + fmt -> + function + | + TypeAnnotation + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Function.TypeAnnotation@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + TypeGuard + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Function.TypeGuard@ "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])")) + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_return_annotation + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + return_annotation + -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_return_annotation + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = pp + and _ = + show + and _ = + pp_return_annotation + and _ = + show_return_annotation + end[@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Component = + struct + module Param = + struct + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + name: + ('M, + 'T) + Statement.ComponentDeclaration.Param.param_name + ; + annot: + ('M, + 'T) + Type.annotation + ; + optional: + bool } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let _ = + fun + (_ : + ('M, + 'T) t') + -> () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __0 + = pp_t' in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + = + ((let __1 + = + Type.pp_annotation + and __0 = + Statement.ComponentDeclaration.Param.pp_param_name in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Type.Component.Param.name"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.name; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "annot"; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.annot; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "optional"; + (Format.fprintf + fmt "%B") + x.optional; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_t' + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + and _ = + pp_t' + and _ = + show_t' + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module RestParam = + struct + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + argument: + ('M, + 'T) + Identifier.t + option ; + annot: + ('M, + 'T) + Type.t ; + optional: + bool ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let _ = + fun + (_ : + ('M, + 'T) t') + -> () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __0 + = pp_t' in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + = + ((let __2 + = + Syntax.pp + and __1 = + Type.pp + and __0 = + Identifier.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Type.Component.RestParam.argument"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.argument; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "annot"; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.annot; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "optional"; + (Format.fprintf + fmt "%B") + x.optional; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_t' + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + and _ = + pp_t' + and _ = + show_t' + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Params = + struct + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + params: + ('M, + 'T) + Param.t + list ; + rest: + ('M, + 'T) + RestParam.t + option ; + comments: + ('M, + 'M + Comment.t + list) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let _ = + fun + (_ : + ('M, + 'T) t') + -> () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __0 + = pp_t' in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + = + ((let __3 + = + Syntax.pp + and __2 = + Comment.pp + and __1 = + RestParam.pp + and __0 = + Param.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Type.Component.Params.params"; + ((fun x + -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]")) + x.params; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "rest"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.rest; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__3 + (fun fmt + -> + poly_M + fmt) + (fun fmt + x -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__2 + (fun fmt + -> + poly_M + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_t' + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + and _ = + pp_t' + and _ = + show_t' + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type ( + 'M, + 'T) t = + { + tparams: + ('M, + 'T) + Type.TypeParams.t + option + ; + params: + ('M, + 'T) + Params.t + ; + renders: + ('M, + 'T) + Type.component_renders_annotation + ; + comments: + ('M, + unit) + Syntax.t + option + }[@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + (( + let __3 = + Syntax.pp + and __2 = + Type.pp_component_renders_annotation + and __1 = + Params.pp + and __0 = + Type.TypeParams.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Type.Component.tparams"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.tparams; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "params"; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.params; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "renders"; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.renders; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__3 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = pp + and _ = + show + end[@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Generic = + struct + module Identifier = + struct + type ( + 'M, + 'T) t = + | + Unqualified + of ( + 'M, + 'T) + Identifier.t + + | + Qualified + of ( + 'M, + 'T) + qualified + and ( + 'M, + 'T) qualified = + ('M * + ('M, + 'T) + qualified') + and ( + 'M, + 'T) qualified' = + { + qualification: + ('M, + 'T) t ; + id: + ('M, + 'T) + Identifier.t + } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let _ = + fun + (_ : + ('M, + 'T) + qualified) + -> () + let _ = + fun + (_ : + ('M, + 'T) + qualified') + -> () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __1 + = + pp_qualified + and __0 = + Identifier.pp in + (( + fun + poly_M + poly_T + fmt -> + function + | + Unqualified + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Generic.Identifier.Unqualified@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Qualified + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Generic.Identifier.Qualified@ "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])")) + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_qualified + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + qualified + -> + unit + = + ((let __0 + = + pp_qualified' in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_qualified + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + qualified + -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_qualified + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_qualified' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + qualified' + -> + unit + = + ((let __1 + = + Identifier.pp + and __0 = + pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Type.Generic.Identifier.qualification"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.qualification; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "id"; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.id; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_qualified' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + qualified' + -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_qualified' + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + and _ = + pp_qualified + and _ = + show_qualified + and _ = + pp_qualified' + and _ = + show_qualified' + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type ( + 'M, + 'T) t = + { + id: + ('M, + 'T) + Identifier.t + ; + targs: + ('M, + 'T) + Type.TypeArgs.t + option + ; + comments: + ('M, + unit) + Syntax.t + option + }[@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + (( + let __2 = + Syntax.pp + and __1 = + Type.TypeArgs.pp + and __0 = + Identifier.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Type.Generic.id"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.id; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "targs"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.targs; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = pp + and _ = + show + end[@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module IndexedAccess = + struct + type ( + 'M, + 'T) t = + { + _object: + ('M, + 'T) + Type.t + ; + index: + ('M, + 'T) + Type.t + ; + comments: + ('M, + unit) + Syntax.t + option + }[@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + (( + let __2 = + Syntax.pp + and __1 = + Type.pp + and __0 = + Type.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Type.IndexedAccess._object"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x._object; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "index"; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.index; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = pp + and _ = + show + end[@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module OptionalIndexedAccess = + struct + type ( + 'M, + 'T) t = + { + indexed_access: + ('M, + 'T) + IndexedAccess.t + ; + optional: + bool } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + (( + let __0 = + IndexedAccess.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Type.OptionalIndexedAccess.indexed_access"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.indexed_access; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "optional"; + (Format.fprintf + fmt "%B") + x.optional; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = pp + and _ = + show + end[@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Object = + struct + module Property = + struct + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + key: + ('M, + 'T) + Expression.Object.Property.key + ; + value: + ('M, + 'T) value ; + optional: + bool ; + static: + bool ; + proto: + bool ; + _method: + bool ; + variance: + 'M + Variance.t + option ; + comments: + ('M, + unit) + Syntax.t + option } + and ( + 'M, + 'T) value = + | Init of + ('M, + 'T) + Type.t + | Get of + ('M * + ('M, + 'T) + Function.t) + + | Set of + ('M * + ('M, + 'T) + Function.t) + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let _ = + fun + (_ : + ('M, + 'T) t') + -> () + let _ = + fun + (_ : + ('M, + 'T) value) + -> () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __0 + = pp_t' in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + = + ((let __3 + = + Syntax.pp + and __2 = + Variance.pp + and __1 = + pp_value + and __0 = + Expression.Object.Property.pp_key in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Type.Object.Property.key"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.key; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "value"; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.value; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "optional"; + (Format.fprintf + fmt "%B") + x.optional; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "static"; + (Format.fprintf + fmt "%B") + x.static; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "proto"; + (Format.fprintf + fmt "%B") + x.proto; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "_method"; + (Format.fprintf + fmt "%B") + x._method; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "variance"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.variance; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__3 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_t' + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_value + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) value + -> + unit + = + ((let __2 + = + Function.pp + and __1 = + Function.pp + and __0 = + Type.pp in + (( + fun + poly_M + poly_T + fmt -> + function + | + Init a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Object.Property.Init@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Get a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Object.Property.Get@ "; + ((fun + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])")) + a0; + Format.fprintf + fmt "@])") + | + Set a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Object.Property.Set@ "; + ((fun + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])")) + a0; + Format.fprintf + fmt "@])")) + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_value + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) value + -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_value + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + and _ = + pp_t' + and _ = + show_t' + and _ = + pp_value + and _ = + show_value + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module SpreadProperty = + struct + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + argument: + ('M, + 'T) + Type.t ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let _ = + fun + (_ : + ('M, + 'T) t') + -> () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __0 + = pp_t' in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + = + ((let __1 + = + Syntax.pp + and __0 = + Type.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Type.Object.SpreadProperty.argument"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.argument; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_t' + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + and _ = + pp_t' + and _ = + show_t' + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Indexer = + struct + type ( + 'M, + 'T) t' = + { + id: + ('M, + 'M) + Identifier.t + option ; + key: + ('M, + 'T) + Type.t ; + value: + ('M, + 'T) + Type.t ; + static: + bool ; + variance: + 'M + Variance.t + option ; + comments: + ('M, + unit) + Syntax.t + option } + and ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t') + -> () + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + = + ((let __4 + = + Syntax.pp + and __3 = + Variance.pp + and __2 = + Type.pp + and __1 = + Type.pp + and __0 = + Identifier.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Type.Object.Indexer.id"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_M + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.id; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "key"; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.key; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "value"; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.value; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "static"; + (Format.fprintf + fmt "%B") + x.static; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "variance"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__3 + (fun fmt + -> + poly_M + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.variance; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__4 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_t' + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __0 + = pp_t' in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp_t' + and _ = + show_t' + and _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module MappedType = + struct + type optional_flag = + | + PlusOptional + + | + MinusOptional + + | + Optional + + | + NoOptionalFlag + [@@deriving + show] + include + struct + let _ = + fun + (_ : + optional_flag) + -> () + let rec pp_optional_flag + : + Format.formatter + -> + optional_flag + -> + unit + = + (( + fun fmt + -> + function + | + PlusOptional + -> + Format.pp_print_string + fmt + "Flow_ast.Type.Object.MappedType.PlusOptional" + | + MinusOptional + -> + Format.pp_print_string + fmt + "Flow_ast.Type.Object.MappedType.MinusOptional" + | + Optional + -> + Format.pp_print_string + fmt + "Flow_ast.Type.Object.MappedType.Optional" + | + NoOptionalFlag + -> + Format.pp_print_string + fmt + "Flow_ast.Type.Object.MappedType.NoOptionalFlag") + [@ocaml.warning + "-39"] + [@ocaml.warning + "-A"]) + and show_optional_flag + : + optional_flag + -> + string + = + fun x -> + Format.asprintf + "%a" + pp_optional_flag + x + [@@ocaml.warning + "-32"] + let _ = + pp_optional_flag + and _ = + show_optional_flag + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + type ( + 'M, + 'T) t' = + { + key_tparam: + ('M, + 'T) + Type.TypeParam.t + ; + prop_type: + ('M, + 'T) + Type.t ; + source_type: + ('M, + 'T) + Type.t ; + variance: + 'M + Variance.t + option ; + optional: + optional_flag + ; + comments: + ('M, + unit) + Syntax.t + option } + and ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t') + -> () + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + = + ((let __5 + = + Syntax.pp + and __4 = + pp_optional_flag + and __3 = + Variance.pp + and __2 = + Type.pp + and __1 = + Type.pp + and __0 = + Type.TypeParam.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Type.Object.MappedType.key_tparam"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.key_tparam; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "prop_type"; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.prop_type; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "source_type"; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.source_type; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "variance"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__3 + (fun fmt + -> + poly_M + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.variance; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "optional"; + (__4 fmt) + x.optional; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__5 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_t' + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __0 + = pp_t' in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp_t' + and _ = + show_t' + and _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module CallProperty = + struct + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + value: + ('M * + ('M, + 'T) + Function.t) + ; + static: + bool ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let _ = + fun + (_ : + ('M, + 'T) t') + -> () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __0 + = pp_t' in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + = + ((let __1 + = + Syntax.pp + and __0 = + Function.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Type.Object.CallProperty.value"; + ((fun + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])")) + x.value; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "static"; + (Format.fprintf + fmt "%B") + x.static; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_t' + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + and _ = + pp_t' + and _ = + show_t' + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module InternalSlot = + struct + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + id: + ('M, + 'M) + Identifier.t + ; + value: + ('M, + 'T) + Type.t ; + optional: + bool ; + static: + bool ; + _method: + bool ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let _ = + fun + (_ : + ('M, + 'T) t') + -> () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __0 + = pp_t' in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + = + ((let __2 + = + Syntax.pp + and __1 = + Type.pp + and __0 = + Identifier.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Type.Object.InternalSlot.id"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_M + fmt) fmt) + x.id; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "value"; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.value; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "optional"; + (Format.fprintf + fmt "%B") + x.optional; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "static"; + (Format.fprintf + fmt "%B") + x.static; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "_method"; + (Format.fprintf + fmt "%B") + x._method; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_t' + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + and _ = + pp_t' + and _ = + show_t' + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type ( + 'M, + 'T) t = + { + exact: bool ; + inexact: + bool ; + properties: + ('M, + 'T) + property + list + ; + comments: + ('M, + 'M + Comment.t + list) + Syntax.t + option + } + and ('M, + 'T) property = + | Property + of ( + 'M, + 'T) + Property.t + | + SpreadProperty + of ( + 'M, + 'T) + SpreadProperty.t + + | Indexer of + ('M, + 'T) + Indexer.t + | + CallProperty + of ( + 'M, + 'T) + CallProperty.t + + | + InternalSlot + of ( + 'M, + 'T) + InternalSlot.t + + | MappedType + of ( + 'M, + 'T) + MappedType.t + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let _ = + fun + (_ : + ('M, + 'T) + property) + -> () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + (( + let __2 = + Syntax.pp + and __1 = + Comment.pp + and __0 = + pp_property in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Type.Object.exact"; + (Format.fprintf + fmt "%B") + x.exact; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "inexact"; + (Format.fprintf + fmt "%B") + x.inexact; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "properties"; + ((fun x + -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]")) + x.properties; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + x -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__1 + (fun fmt + -> + poly_M + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_property + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + property + -> + unit + = + (( + let __5 = + MappedType.pp + and __4 = + InternalSlot.pp + and __3 = + CallProperty.pp + and __2 = + Indexer.pp + and __1 = + SpreadProperty.pp + and __0 = + Property.pp in + (( + fun + poly_M + poly_T + fmt -> + function + | + Property + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Object.Property@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + SpreadProperty + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Object.SpreadProperty@ "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Indexer + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Object.Indexer@ "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + CallProperty + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Object.CallProperty@ "; + (__3 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + InternalSlot + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Object.InternalSlot@ "; + (__4 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + MappedType + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Object.MappedType@ "; + (__5 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])")) + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_property + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + property + -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_property + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = pp + and _ = + show + and _ = + pp_property + and _ = + show_property + end[@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Interface = + struct + type ( + 'M, + 'T) t = + { + body: + ('M * ( + 'M, + 'T) + Object.t) + ; + extends: + ('M * ( + 'M, + 'T) + Generic.t) + list + ; + comments: + ('M, + unit) + Syntax.t + option + }[@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + (( + let __2 = + Syntax.pp + and __1 = + Generic.pp + and __0 = + Object.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Type.Interface.body"; + ((fun + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])")) + x.body; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "extends"; + ((fun x + -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + ((fun + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])")) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]")) + x.extends; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = pp + and _ = + show + end[@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Nullable = + struct + type ( + 'M, + 'T) t = + { + argument: + ('M, + 'T) + Type.t + ; + comments: + ('M, + unit) + Syntax.t + option + }[@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + (( + let __1 = + Syntax.pp + and __0 = + Type.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Type.Nullable.argument"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.argument; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = pp + and _ = + show + end[@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Typeof = + struct + module Target = + struct + type ( + 'M, + 'T) t = + | + Unqualified + of ( + 'M, + 'T) + Identifier.t + + | + Qualified + of ( + 'M, + 'T) + qualified + and ( + 'M, + 'T) qualified' = + { + qualification: + ('M, + 'T) t ; + id: + ('M, + 'T) + Identifier.t + } + and ( + 'M, + 'T) qualified = + ('T * + ('M, + 'T) + qualified') + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let _ = + fun + (_ : + ('M, + 'T) + qualified') + -> () + let _ = + fun + (_ : + ('M, + 'T) + qualified) + -> () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __1 + = + pp_qualified + and __0 = + Identifier.pp in + (( + fun + poly_M + poly_T + fmt -> + function + | + Unqualified + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Typeof.Target.Unqualified@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Qualified + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Typeof.Target.Qualified@ "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])")) + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_qualified' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + qualified' + -> + unit + = + ((let __1 + = + Identifier.pp + and __0 = + pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Type.Typeof.Target.qualification"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.qualification; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "id"; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.id; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_qualified' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + qualified' + -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_qualified' + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_qualified + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + qualified + -> + unit + = + ((let __0 + = + pp_qualified' in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_T + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_qualified + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + qualified + -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_qualified + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + and _ = + pp_qualified' + and _ = + show_qualified' + and _ = + pp_qualified + and _ = + show_qualified + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type ( + 'M, + 'T) t = + { + argument: + ('M, + 'T) + Target.t + ; + targs: + ('M, + 'T) + Type.TypeArgs.t + option + ; + comments: + ('M, + unit) + Syntax.t + option + }[@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + (( + let __2 = + Syntax.pp + and __1 = + Type.TypeArgs.pp + and __0 = + Target.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Type.Typeof.argument"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.argument; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "targs"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.targs; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = pp + and _ = + show + end[@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Keyof = + struct + type ( + 'M, + 'T) t = + { + argument: + ('M, + 'T) + Type.t + ; + comments: + ('M, + unit) + Syntax.t + option + }[@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + (( + let __1 = + Syntax.pp + and __0 = + Type.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Type.Keyof.argument"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.argument; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = pp + and _ = + show + end[@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Renders = + struct + type variant = + | Normal + | Maybe + | Star + [@@deriving + show] + include + struct + let _ = + fun + (_ : + variant) + -> () + let rec pp_variant + : + Format.formatter + -> + variant + -> + unit + = + (( + + fun fmt + -> + function + | + Normal -> + Format.pp_print_string + fmt + "Flow_ast.Type.Renders.Normal" + | + Maybe -> + Format.pp_print_string + fmt + "Flow_ast.Type.Renders.Maybe" + | + Star -> + Format.pp_print_string + fmt + "Flow_ast.Type.Renders.Star") + [@ocaml.warning + "-39"] + [@ocaml.warning + "-A"]) + and show_variant + : + variant + -> + string + = + fun x -> + Format.asprintf + "%a" + pp_variant + x + [@@ocaml.warning + "-32"] + let _ = + pp_variant + and _ = + show_variant + end[@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + type ( + 'M, + 'T) t = + { + operator_loc: + 'M ; + argument: + ('M, + 'T) + Type.t + ; + comments: + ('M, + unit) + Syntax.t + option + ; + variant: + variant } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + (( + let __2 = + pp_variant + and __1 = + Syntax.pp + and __0 = + Type.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Type.Renders.operator_loc"; + (poly_M + fmt) + x.operator_loc; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "argument"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.argument; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "variant"; + (__2 fmt) + x.variant; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = pp + and _ = + show + end[@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module ReadOnly = + struct + type ( + 'M, + 'T) t = + { + argument: + ('M, + 'T) + Type.t + ; + comments: + ('M, + unit) + Syntax.t + option + }[@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + (( + let __1 = + Syntax.pp + and __0 = + Type.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Type.ReadOnly.argument"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.argument; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = pp + and _ = + show + end[@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Tuple = + struct + module LabeledElement = + struct + type ( + 'M, + 'T) t = + { + name: + ('M, + 'T) + Identifier.t + ; + annot: + ('M, + 'T) + Type.t ; + variance: + 'M + Variance.t + option ; + optional: + bool } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __2 + = + Variance.pp + and __1 = + Type.pp + and __0 = + Identifier.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Type.Tuple.LabeledElement.name"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.name; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "annot"; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.annot; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "variance"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.variance; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "optional"; + (Format.fprintf + fmt "%B") + x.optional; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module SpreadElement = + struct + type ( + 'M, + 'T) t = + { + name: + ('M, + 'T) + Identifier.t + option ; + annot: + ('M, + 'T) + Type.t } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __1 + = Type.pp + and __0 = + Identifier.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Type.Tuple.SpreadElement.name"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.name; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "annot"; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.annot; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type ( + 'M, + 'T) element = + ('M * ( + 'M, + 'T) + element') + [@@deriving + show] + and ('M, + 'T) element' = + | + UnlabeledElement + of ( + 'M, + 'T) Type.t + | + LabeledElement + of ( + 'M, + 'T) + LabeledElement.t + + | + SpreadElement + of ( + 'M, + 'T) + SpreadElement.t + [@@deriving + show] + and ('M, + 'T) t = + { + elements: + ('M, + 'T) + element + list + ; + inexact: + bool ; + comments: + ('M, + unit) + Syntax.t + option + }[@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) + element) + -> () + let _ = + fun + (_ : + ('M, + 'T) + element') + -> () + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp_element + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + element + -> + unit + = + (( + let __0 = + pp_element' in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_element + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + element + -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_element + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_element' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + element' + -> + unit + = + (( + let __2 = + SpreadElement.pp + and __1 = + LabeledElement.pp + and __0 = + Type.pp in + (( + fun + poly_M + poly_T + fmt -> + function + | + UnlabeledElement + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Tuple.UnlabeledElement@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + LabeledElement + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Tuple.LabeledElement@ "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + SpreadElement + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Tuple.SpreadElement@ "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])")) + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_element' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + element' + -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_element' + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + (( + let __1 = + Syntax.pp + and __0 = + pp_element in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Type.Tuple.elements"; + ((fun x + -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]")) + x.elements; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "inexact"; + (Format.fprintf + fmt "%B") + x.inexact; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp_element + and _ = + show_element + and _ = + pp_element' + and _ = + show_element' + and _ = pp + and _ = + show + let rec pp_element + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + element + -> + unit + = + (( + let __0 = + pp_element' in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_element + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + element + -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_element + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_element' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + element' + -> + unit + = + (( + let __2 = + SpreadElement.pp + and __1 = + LabeledElement.pp + and __0 = + Type.pp in + (( + fun + poly_M + poly_T + fmt -> + function + | + UnlabeledElement + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Tuple.UnlabeledElement@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + LabeledElement + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Tuple.LabeledElement@ "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + SpreadElement + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Tuple.SpreadElement@ "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])")) + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_element' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + element' + -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_element' + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + (( + let __1 = + Syntax.pp + and __0 = + pp_element in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Type.Tuple.elements"; + ((fun x + -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]")) + x.elements; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "inexact"; + (Format.fprintf + fmt "%B") + x.inexact; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp_element + and _ = + show_element + and _ = + pp_element' + and _ = + show_element' + and _ = pp + and _ = + show + let rec pp_element + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + element + -> + unit + = + (( + let __0 = + pp_element' in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_element + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + element + -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_element + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_element' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + element' + -> + unit + = + (( + let __2 = + SpreadElement.pp + and __1 = + LabeledElement.pp + and __0 = + Type.pp in + (( + fun + poly_M + poly_T + fmt -> + function + | + UnlabeledElement + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Tuple.UnlabeledElement@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + LabeledElement + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Tuple.LabeledElement@ "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + SpreadElement + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Tuple.SpreadElement@ "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])")) + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_element' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + element' + -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_element' + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + (( + let __1 = + Syntax.pp + and __0 = + pp_element in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Type.Tuple.elements"; + ((fun x + -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]")) + x.elements; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "inexact"; + (Format.fprintf + fmt "%B") + x.inexact; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp_element + and _ = + show_element + and _ = + pp_element' + and _ = + show_element' + and _ = pp + and _ = + show + end[@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Array = + struct + type ( + 'M, + 'T) t = + { + argument: + ('M, + 'T) + Type.t + ; + comments: + ('M, + unit) + Syntax.t + option + }[@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + (( + let __1 = + Syntax.pp + and __0 = + Type.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Type.Array.argument"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.argument; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = pp + and _ = + show + end[@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Union = + struct + type ( + 'M, + 'T) t = + { + types: + (('M, + 'T) + Type.t * + ('M, + 'T) + Type.t * + ('M, + 'T) + Type.t + list) + ; + comments: + ('M, + unit) + Syntax.t + option + }[@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + (( + let __3 = + Syntax.pp + and __2 = + Type.pp + and __1 = + Type.pp + and __0 = + Type.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Type.Union.types"; + ((fun + (a0, a1, + a2) -> + Format.fprintf + fmt "(@["; + ( + ( + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt ",@ "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt ",@ "; + ((fun x + -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]")) + a2); + Format.fprintf + fmt "@])")) + x.types; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__3 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = pp + and _ = + show + end[@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Intersection = + struct + type ( + 'M, + 'T) t = + { + types: + (('M, + 'T) + Type.t * + ('M, + 'T) + Type.t * + ('M, + 'T) + Type.t + list) + ; + comments: + ('M, + unit) + Syntax.t + option + }[@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + (( + let __3 = + Syntax.pp + and __2 = + Type.pp + and __1 = + Type.pp + and __0 = + Type.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Type.Intersection.types"; + ((fun + (a0, a1, + a2) -> + Format.fprintf + fmt "(@["; + ( + ( + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt ",@ "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt ",@ "; + ((fun x + -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]")) + a2); + Format.fprintf + fmt "@])")) + x.types; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__3 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = pp + and _ = + show + end[@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type ('M, + 'T) t = + ('T * ('M, + 'T) t') + and ('M, 'T) t' = + | Any of ( + 'M, unit) + Syntax.t option + + | Mixed of ( + 'M, unit) + Syntax.t option + + | Empty of ( + 'M, unit) + Syntax.t option + + | Void of ( + 'M, unit) + Syntax.t option + + | Null of ( + 'M, unit) + Syntax.t option + + | Number of ( + 'M, unit) + Syntax.t option + + | BigInt of ( + 'M, unit) + Syntax.t option + + | String of ( + 'M, unit) + Syntax.t option + + | Boolean of + { + raw: + [ `Boolean + | `Bool ] ; + comments: + ('M, unit) + Syntax.t + option + } + + | Symbol of ( + 'M, unit) + Syntax.t option + + | Exists of ( + 'M, unit) + Syntax.t option + + | Nullable of + ('M, 'T) + Nullable.t + | Function of + ('M, 'T) + Function.t + | Component of + ('M, 'T) + Component.t + | Object of ( + 'M, 'T) Object.t + + | Interface of + ('M, 'T) + Interface.t + | Array of ( + 'M, 'T) Array.t + + | Conditional of + ('M, 'T) + Conditional.t + | Infer of ( + 'M, 'T) Infer.t + + | Generic of + ('M, 'T) + Generic.t + | IndexedAccess + of ('M, + 'T) + IndexedAccess.t + + | + OptionalIndexedAccess + of ('M, + 'T) + OptionalIndexedAccess.t + + | Union of ( + 'M, 'T) Union.t + + | Intersection + of ('M, + 'T) + Intersection.t + | Typeof of ( + 'M, 'T) Typeof.t + + | Keyof of ( + 'M, 'T) Keyof.t + + | Renders of + ('M, 'T) + Renders.t + | ReadOnly of + ('M, 'T) + ReadOnly.t + | Tuple of ( + 'M, 'T) Tuple.t + + | StringLiteral + of 'M + StringLiteral.t + + | NumberLiteral + of 'M + NumberLiteral.t + + | BigIntLiteral + of 'M + BigIntLiteral.t + + | BooleanLiteral + of 'M + BooleanLiteral.t + + | Unknown of + ('M, unit) + Syntax.t option + + | Never of ( + 'M, unit) + Syntax.t option + + | Undefined of + ('M, unit) + Syntax.t option + and ('M, + 'T) annotation = + ('M * ('M, + 'T) t) + and ('M, + 'T) type_guard_annotation = + ('M * ('M, + 'T) + Type.TypeGuard.t) + and ('M, + 'T) annotation_or_hint = + | Missing of 'T + + | Available of + ('M, 'T) + Type.annotation + [@@deriving + show] + and ('M, + 'T) component_renders_annotation = + | MissingRenders + of 'T + | + AvailableRenders + of 'M * ( + 'M, 'T) + Type.Renders.t + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) + -> () + let _ = + fun + (_ : + ('M, + 'T) t') + -> () + let _ = + fun + (_ : + ('M, + 'T) + annotation) + -> () + let _ = + fun + (_ : + ('M, + 'T) + type_guard_annotation) + -> () + let _ = + fun + (_ : + ('M, + 'T) + annotation_or_hint) + -> () + let _ = + fun + (_ : + ('M, + 'T) + component_renders_annotation) + -> () + let rec pp : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __0 = + pp_t' in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_T + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_t' : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + = + ((let __35 = + Syntax.pp + and __34 = + Syntax.pp + and __33 = + Syntax.pp + and __32 = + BooleanLiteral.pp + and __31 = + BigIntLiteral.pp + and __30 = + NumberLiteral.pp + and __29 = + StringLiteral.pp + and __28 = + Tuple.pp + and __27 = + ReadOnly.pp + and __26 = + Renders.pp + and __25 = + Keyof.pp + and __24 = + Typeof.pp + and __23 = + Intersection.pp + and __22 = + Union.pp + and __21 = + OptionalIndexedAccess.pp + and __20 = + IndexedAccess.pp + and __19 = + Generic.pp + and __18 = + Infer.pp + and __17 = + Conditional.pp + and __16 = + Array.pp + and __15 = + Interface.pp + and __14 = + Object.pp + and __13 = + Component.pp + and __12 = + Function.pp + and __11 = + Nullable.pp + and __10 = + Syntax.pp + and __9 = + Syntax.pp + and __8 = + Syntax.pp + and __7 = + Syntax.pp + and __6 = + Syntax.pp + and __5 = + Syntax.pp + and __4 = + Syntax.pp + and __3 = + Syntax.pp + and __2 = + Syntax.pp + and __1 = + Syntax.pp + and __0 = + Syntax.pp in + (( + fun + poly_M + poly_T + fmt -> + function + | + Any a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Any@ "; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + a0; + Format.fprintf + fmt "@])") + | + Mixed a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Mixed@ "; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + a0; + Format.fprintf + fmt "@])") + | + Empty a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Empty@ "; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + a0; + Format.fprintf + fmt "@])") + | + Void a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Void@ "; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__3 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + a0; + Format.fprintf + fmt "@])") + | + Null a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Null@ "; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__4 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + a0; + Format.fprintf + fmt "@])") + | + Number a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Number@ "; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__5 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + a0; + Format.fprintf + fmt "@])") + | + BigInt a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.BigInt@ "; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__6 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + a0; + Format.fprintf + fmt "@])") + | + String a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.String@ "; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__7 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + a0; + Format.fprintf + fmt "@])") + | + Boolean + { + raw = + araw; + comments + = + acomments + } -> + (Format.fprintf + fmt + "@[<2>Flow_ast.Type.Boolean {@,"; + (( + Format.fprintf + fmt + "@[%s =@ " + "raw"; + ((function + | `Boolean + -> + Format.pp_print_string + fmt + "`Boolean" + | `Bool + -> + Format.pp_print_string + fmt + "`Bool")) + araw; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__8 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + acomments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt "@]}") + | + Symbol a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Symbol@ "; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__9 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + a0; + Format.fprintf + fmt "@])") + | + Exists a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Exists@ "; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__10 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + a0; + Format.fprintf + fmt "@])") + | + Nullable + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Nullable@ "; + (__11 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Function + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Function@ "; + (__12 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Component + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Component@ "; + (__13 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Object a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Object@ "; + (__14 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Interface + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Interface@ "; + (__15 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Array a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Array@ "; + (__16 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Conditional + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Conditional@ "; + (__17 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Infer a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Infer@ "; + (__18 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Generic + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Generic@ "; + (__19 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + IndexedAccess + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.IndexedAccess@ "; + (__20 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + OptionalIndexedAccess + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.OptionalIndexedAccess@ "; + (__21 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Union a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Union@ "; + (__22 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Intersection + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Intersection@ "; + (__23 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Typeof a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Typeof@ "; + (__24 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Keyof a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Keyof@ "; + (__25 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Renders + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Renders@ "; + (__26 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + ReadOnly + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.ReadOnly@ "; + (__27 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Tuple a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Tuple@ "; + (__28 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + StringLiteral + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.StringLiteral@ "; + (__29 + (fun fmt + -> + poly_M + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + NumberLiteral + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.NumberLiteral@ "; + (__30 + (fun fmt + -> + poly_M + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + BigIntLiteral + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.BigIntLiteral@ "; + (__31 + (fun fmt + -> + poly_M + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + BooleanLiteral + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.BooleanLiteral@ "; + (__32 + (fun fmt + -> + poly_M + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Unknown + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Unknown@ "; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__33 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + a0; + Format.fprintf + fmt "@])") + | + Never a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Never@ "; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__34 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + a0; + Format.fprintf + fmt "@])") + | + Undefined + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Undefined@ "; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__35 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + a0; + Format.fprintf + fmt "@])")) + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_t' : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + = + fun poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_t' + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_annotation + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + annotation + -> + unit + = + ((let __0 = + pp in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_annotation + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + annotation + -> + string + = + fun poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_annotation + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_type_guard_annotation + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + type_guard_annotation + -> + unit + = + ((let __0 = + Type.TypeGuard.pp in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_type_guard_annotation + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + type_guard_annotation + -> + string + = + fun poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_type_guard_annotation + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_annotation_or_hint + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + annotation_or_hint + -> + unit + = + ((let __0 = + Type.pp_annotation in + (( + fun + poly_M + poly_T + fmt -> + function + | + Missing + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Missing@ "; + (poly_T + fmt) a0; + Format.fprintf + fmt "@])") + | + Available + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Available@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])")) + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_annotation_or_hint + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + annotation_or_hint + -> + string + = + fun poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_annotation_or_hint + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_component_renders_annotation + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + component_renders_annotation + -> + unit + = + ((let __0 = + Type.Renders.pp in + (( + fun + poly_M + poly_T + fmt -> + function + | + MissingRenders + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.MissingRenders@ "; + (poly_T + fmt) a0; + Format.fprintf + fmt "@])") + | + AvailableRenders + (a0, a1) + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.AvailableRenders (@,"; + ((poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt + "@,))@]")) + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_component_renders_annotation + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + component_renders_annotation + -> + string + = + fun poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_component_renders_annotation + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = pp + and _ = show + and _ = pp_t' + and _ = + show_t' + and _ = + pp_annotation + and _ = + show_annotation + and _ = + pp_type_guard_annotation + and _ = + show_type_guard_annotation + and _ = + pp_annotation_or_hint + and _ = + show_annotation_or_hint + and _ = + pp_component_renders_annotation + and _ = + show_component_renders_annotation + let rec pp : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __0 = + pp_t' in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_T + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_t' : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + = + ((let __35 = + Syntax.pp + and __34 = + Syntax.pp + and __33 = + Syntax.pp + and __32 = + BooleanLiteral.pp + and __31 = + BigIntLiteral.pp + and __30 = + NumberLiteral.pp + and __29 = + StringLiteral.pp + and __28 = + Tuple.pp + and __27 = + ReadOnly.pp + and __26 = + Renders.pp + and __25 = + Keyof.pp + and __24 = + Typeof.pp + and __23 = + Intersection.pp + and __22 = + Union.pp + and __21 = + OptionalIndexedAccess.pp + and __20 = + IndexedAccess.pp + and __19 = + Generic.pp + and __18 = + Infer.pp + and __17 = + Conditional.pp + and __16 = + Array.pp + and __15 = + Interface.pp + and __14 = + Object.pp + and __13 = + Component.pp + and __12 = + Function.pp + and __11 = + Nullable.pp + and __10 = + Syntax.pp + and __9 = + Syntax.pp + and __8 = + Syntax.pp + and __7 = + Syntax.pp + and __6 = + Syntax.pp + and __5 = + Syntax.pp + and __4 = + Syntax.pp + and __3 = + Syntax.pp + and __2 = + Syntax.pp + and __1 = + Syntax.pp + and __0 = + Syntax.pp in + (( + fun + poly_M + poly_T + fmt -> + function + | + Any a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Any@ "; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + a0; + Format.fprintf + fmt "@])") + | + Mixed a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Mixed@ "; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + a0; + Format.fprintf + fmt "@])") + | + Empty a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Empty@ "; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + a0; + Format.fprintf + fmt "@])") + | + Void a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Void@ "; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__3 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + a0; + Format.fprintf + fmt "@])") + | + Null a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Null@ "; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__4 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + a0; + Format.fprintf + fmt "@])") + | + Number a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Number@ "; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__5 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + a0; + Format.fprintf + fmt "@])") + | + BigInt a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.BigInt@ "; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__6 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + a0; + Format.fprintf + fmt "@])") + | + String a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.String@ "; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__7 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + a0; + Format.fprintf + fmt "@])") + | + Boolean + { + raw = + araw; + comments + = + acomments + } -> + (Format.fprintf + fmt + "@[<2>Flow_ast.Type.Boolean {@,"; + (( + Format.fprintf + fmt + "@[%s =@ " + "raw"; + ((function + | `Boolean + -> + Format.pp_print_string + fmt + "`Boolean" + | `Bool + -> + Format.pp_print_string + fmt + "`Bool")) + araw; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__8 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + acomments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt "@]}") + | + Symbol a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Symbol@ "; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__9 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + a0; + Format.fprintf + fmt "@])") + | + Exists a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Exists@ "; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__10 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + a0; + Format.fprintf + fmt "@])") + | + Nullable + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Nullable@ "; + (__11 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Function + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Function@ "; + (__12 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Component + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Component@ "; + (__13 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Object a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Object@ "; + (__14 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Interface + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Interface@ "; + (__15 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Array a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Array@ "; + (__16 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Conditional + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Conditional@ "; + (__17 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Infer a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Infer@ "; + (__18 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Generic + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Generic@ "; + (__19 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + IndexedAccess + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.IndexedAccess@ "; + (__20 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + OptionalIndexedAccess + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.OptionalIndexedAccess@ "; + (__21 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Union a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Union@ "; + (__22 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Intersection + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Intersection@ "; + (__23 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Typeof a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Typeof@ "; + (__24 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Keyof a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Keyof@ "; + (__25 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Renders + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Renders@ "; + (__26 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + ReadOnly + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.ReadOnly@ "; + (__27 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Tuple a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Tuple@ "; + (__28 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + StringLiteral + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.StringLiteral@ "; + (__29 + (fun fmt + -> + poly_M + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + NumberLiteral + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.NumberLiteral@ "; + (__30 + (fun fmt + -> + poly_M + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + BigIntLiteral + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.BigIntLiteral@ "; + (__31 + (fun fmt + -> + poly_M + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + BooleanLiteral + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.BooleanLiteral@ "; + (__32 + (fun fmt + -> + poly_M + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Unknown + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Unknown@ "; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__33 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + a0; + Format.fprintf + fmt "@])") + | + Never a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Never@ "; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__34 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + a0; + Format.fprintf + fmt "@])") + | + Undefined + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Undefined@ "; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__35 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + a0; + Format.fprintf + fmt "@])")) + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_t' : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + = + fun poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_t' + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_annotation + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + annotation + -> + unit + = + ((let __0 = + pp in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_annotation + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + annotation + -> + string + = + fun poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_annotation + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_type_guard_annotation + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + type_guard_annotation + -> + unit + = + ((let __0 = + Type.TypeGuard.pp in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_type_guard_annotation + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + type_guard_annotation + -> + string + = + fun poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_type_guard_annotation + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_annotation_or_hint + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + annotation_or_hint + -> + unit + = + ((let __0 = + Type.pp_annotation in + (( + fun + poly_M + poly_T + fmt -> + function + | + Missing + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Missing@ "; + (poly_T + fmt) a0; + Format.fprintf + fmt "@])") + | + Available + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Available@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])")) + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_annotation_or_hint + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + annotation_or_hint + -> + string + = + fun poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_annotation_or_hint + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_component_renders_annotation + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + component_renders_annotation + -> + unit + = + ((let __0 = + Type.Renders.pp in + (( + fun + poly_M + poly_T + fmt -> + function + | + MissingRenders + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.MissingRenders@ "; + (poly_T + fmt) a0; + Format.fprintf + fmt "@])") + | + AvailableRenders + (a0, a1) + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.AvailableRenders (@,"; + ((poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt + "@,))@]")) + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_component_renders_annotation + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + component_renders_annotation + -> + string + = + fun poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_component_renders_annotation + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = pp + and _ = show + and _ = pp_t' + and _ = + show_t' + and _ = + pp_annotation + and _ = + show_annotation + and _ = + pp_type_guard_annotation + and _ = + show_type_guard_annotation + and _ = + pp_annotation_or_hint + and _ = + show_annotation_or_hint + and _ = + pp_component_renders_annotation + and _ = + show_component_renders_annotation + end[@@ocaml.doc + "@inline"] + [@@merlin.hide ] + module TypeParam = + struct + type bound_kind = + | Colon + | Extends + [@@deriving + show] + include + struct + let _ = + fun + (_ : + bound_kind) + -> () + let rec pp_bound_kind + : + Format.formatter + -> + bound_kind + -> + unit + = + (( + + fun fmt + -> + function + | + Colon -> + Format.pp_print_string + fmt + "Flow_ast.Type.TypeParam.Colon" + | + Extends + -> + Format.pp_print_string + fmt + "Flow_ast.Type.TypeParam.Extends") + [@ocaml.warning + "-39"] + [@ocaml.warning + "-A"]) + and show_bound_kind + : + bound_kind + -> + string + = + fun x -> + Format.asprintf + "%a" + pp_bound_kind + x + [@@ocaml.warning + "-32"] + let _ = + pp_bound_kind + and _ = + show_bound_kind + end[@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + module ConstModifier = + struct + type + 'M t = + ('M * + ('M, + unit) + Syntax.t + option) + [@@deriving + show] + include + struct + let _ = + fun + (_ : + 'M t) -> + () + let rec pp + : + 'M . + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M t -> + unit + = + ((let __0 + = + Syntax.pp in + (( + fun + poly_M + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M . + (Format.formatter + -> + 'M -> + unit) + -> + 'M t -> + string + = + fun + poly_M x + -> + Format.asprintf + "%a" + (pp + poly_M) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type ( + 'M, + 'T) t = + ('M * ( + 'M, + 'T) t') + and ('M, + 'T) t' = + { + name: + ('M, + 'M) + Identifier.t + ; + bound: + ('M, + 'T) + Type.annotation_or_hint + ; + bound_kind: + bound_kind ; + variance: + 'M + Variance.t + option + ; + default: + ('M, + 'T) + Type.t + option + ; + const: + 'M + ConstModifier.t + option + }[@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let _ = + fun + (_ : + ('M, + 'T) t') + -> () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + (( + let __0 = + pp_t' in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + = + (( + let __5 = + ConstModifier.pp + and __4 = + Type.pp + and __3 = + Variance.pp + and __2 = + pp_bound_kind + and __1 = + Type.pp_annotation_or_hint + and __0 = + Identifier.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Type.TypeParam.name"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_M + fmt) fmt) + x.name; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "bound"; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.bound; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "bound_kind"; + (__2 fmt) + x.bound_kind; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "variance"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__3 + (fun fmt + -> + poly_M + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.variance; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "default"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__4 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.default; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "const"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__5 + (fun fmt + -> + poly_M + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.const; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_t' + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = pp + and _ = + show + and _ = + pp_t' + and _ = + show_t' + end[@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module TypeParams = + struct + type ( + 'M, + 'T) t = + ('M * ( + 'M, + 'T) t') + and ('M, + 'T) t' = + { + params: + ('M, + 'T) + TypeParam.t + list + ; + comments: + ('M, + 'M + Comment.t + list) + Syntax.t + option + }[@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let _ = + fun + (_ : + ('M, + 'T) t') + -> () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + (( + let __0 = + pp_t' in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + = + (( + let __2 = + Syntax.pp + and __1 = + Comment.pp + and __0 = + TypeParam.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Type.TypeParams.params"; + ((fun x + -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]")) + x.params; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + x -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__1 + (fun fmt + -> + poly_M + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_t' + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = pp + and _ = + show + and _ = + pp_t' + and _ = + show_t' + end[@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module TypeArgs = + struct + type ( + 'M, + 'T) t = + ('M * ( + 'M, + 'T) t') + and ('M, + 'T) t' = + { + arguments: + ('M, + 'T) + Type.t + list + ; + comments: + ('M, + 'M + Comment.t + list) + Syntax.t + option + }[@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let _ = + fun + (_ : + ('M, + 'T) t') + -> () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + (( + let __0 = + pp_t' in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + = + (( + let __2 = + Syntax.pp + and __1 = + Comment.pp + and __0 = + Type.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Type.TypeArgs.arguments"; + ((fun x + -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]")) + x.arguments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + x -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__1 + (fun fmt + -> + poly_M + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_t' + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = pp + and _ = + show + and _ = + pp_t' + and _ = + show_t' + end[@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Predicate = + struct + type ( + 'M, + 'T) t = + ('M * ( + 'M, + 'T) t') + and ('M, + 'T) t' = + { + kind: + ('M, + 'T) kind + ; + comments: + ('M, + unit) + Syntax.t + option + } + and ('M, + 'T) kind = + | Declared + of ( + 'M, + 'T) + Expression.t + + | Inferred + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let _ = + fun + (_ : + ('M, + 'T) t') + -> () + let _ = + fun + (_ : + ('M, + 'T) kind) + -> () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + (( + let __0 = + pp_t' in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + = + (( + let __1 = + Syntax.pp + and __0 = + pp_kind in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Type.Predicate.kind"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.kind; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_t' + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_kind + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) kind + -> + unit + = + (( + let __0 = + Expression.pp in + (( + fun + poly_M + poly_T + fmt -> + function + | + Declared + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Type.Predicate.Declared@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Inferred + -> + Format.pp_print_string + fmt + "Flow_ast.Type.Predicate.Inferred") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_kind + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) kind + -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_kind + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = pp + and _ = + show + and _ = + pp_t' + and _ = + show_t' + and _ = + pp_kind + and _ = + show_kind + end[@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module TypeGuard = + struct + type ( + 'M, + 'T) t = + ('M * ( + 'M, + 'T) t') + and kind = + | Default + | Asserts + | Implies + and ('M, + 'T) t' = + { + kind: kind ; + guard: + (('M, + 'M) + Identifier.t + * ( + 'M, + 'T) + Type.t + option) + ; + comments: + ('M, + 'M + Comment.t + list) + Syntax.t + option + }[@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let _ = + fun + (_ : + kind) -> + () + let _ = + fun + (_ : + ('M, + 'T) t') + -> () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + (( + let __0 = + pp_t' in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_kind + : + Format.formatter + -> + kind -> + unit + = + (( + + fun fmt + -> + function + | + Default + -> + Format.pp_print_string + fmt + "Flow_ast.Type.TypeGuard.Default" + | + Asserts + -> + Format.pp_print_string + fmt + "Flow_ast.Type.TypeGuard.Asserts" + | + Implies + -> + Format.pp_print_string + fmt + "Flow_ast.Type.TypeGuard.Implies") + [@ocaml.warning + "-39"] + [@ocaml.warning + "-A"]) + and show_kind + : + kind -> + string + = + fun x -> + Format.asprintf + "%a" + pp_kind x + [@@ocaml.warning + "-32"] + and pp_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + = + (( + let __4 = + Syntax.pp + and __3 = + Comment.pp + and __2 = + Type.pp + and __1 = + Identifier.pp + and __0 = + pp_kind in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Type.TypeGuard.kind"; + (__0 fmt) + x.kind; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "guard"; + ((fun + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_M + fmt) fmt) + a0; + Format.fprintf + fmt ",@ "; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + a1); + Format.fprintf + fmt "@])")) + x.guard; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__4 + (fun fmt + -> + poly_M + fmt) + (fun fmt + x -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__3 + (fun fmt + -> + poly_M + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_t' + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = pp + and _ = + show + and _ = + pp_kind + and _ = + show_kind + and _ = + pp_t' + and _ = + show_t' + end[@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + end and + Statement: + sig + module Block + : + sig + type ( + 'M, + 'T) t = + { + body: + ('M, + 'T) + Statement.t + list ; + comments: + ('M, + 'M + Comment.t + list) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module If : + sig + module + Alternate : + sig + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + body: + ('M, + 'T) + Statement.t + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val pp_t' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + val + show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type ( + 'M, + 'T) t = + { + test: + ('M, + 'T) + Expression.t + ; + consequent: + ('M, + 'T) + Statement.t + ; + alternate: + ('M, + 'T) + Alternate.t + option ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + Labeled : + sig + type ( + 'M, + 'T) t = + { + label: + ('M, + 'M) + Identifier.t + ; + body: + ('M, + 'T) + Statement.t + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Break + : + sig + type + 'M t = + { + label: + ('M, + 'M) + Identifier.t + option ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + 'M t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + Continue : + sig + type + 'M t = + { + label: + ('M, + 'M) + Identifier.t + option ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + 'M t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + Debugger : + sig + type + 'M t = + { + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + 'M t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module With : + sig + type ( + 'M, + 'T) t = + { + _object: + ('M, + 'T) + Expression.t + ; + body: + ('M, + 'T) + Statement.t + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + TypeAlias : + sig + type ( + 'M, + 'T) t = + { + id: + ('M, + 'T) + Identifier.t + ; + tparams: + ('M, + 'T) + Type.TypeParams.t + option ; + right: + ('M, + 'T) + Type.t ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + OpaqueType : + sig + type ( + 'M, + 'T) t = + { + id: + ('M, + 'T) + Identifier.t + ; + tparams: + ('M, + 'T) + Type.TypeParams.t + option ; + impltype: + ('M, + 'T) + Type.t + option ; + supertype: + ('M, + 'T) + Type.t + option ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type ( + 'M, + 'T) match_statement = + ('M, + 'T, + ('M, + 'T) + Statement.t) + Match.t + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val + pp_match_statement + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + match_statement + -> + unit + val + show_match_statement + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + match_statement + -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + module Switch + : + sig + module Case + : + sig + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + test: + ('M, + 'T) + Expression.t + option ; + consequent: + ('M, + 'T) + Statement.t + list ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val pp_t' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + val + show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type ( + 'M, + 'T) t = + { + discriminant: + ('M, + 'T) + Expression.t + ; + cases: + ('M, + 'T) + Case.t + list ; + comments: + ('M, + unit) + Syntax.t + option ; + exhaustive_out: + 'T } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Return + : + sig + type ( + 'M, + 'T) t = + { + argument: + ('M, + 'T) + Expression.t + option ; + comments: + ('M, + unit) + Syntax.t + option ; + return_out: + 'T } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Throw + : + sig + type ( + 'M, + 'T) t = + { + argument: + ('M, + 'T) + Expression.t + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Try : + sig + module + CatchClause + : + sig + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + param: + ('M, + 'T) + Pattern.t + option ; + body: + ('M * + ('M, + 'T) + Block.t) ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val pp_t' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + val + show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type ( + 'M, + 'T) t = + { + block: + ('M * + ('M, + 'T) + Block.t) ; + handler: + ('M, + 'T) + CatchClause.t + option ; + finalizer: + ('M * + ('M, + 'T) + Block.t) + option ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + VariableDeclaration + : + sig + module + Declarator + : + sig + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + id: + ('M, + 'T) + Pattern.t ; + init: + ('M, + 'T) + Expression.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val pp_t' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + val + show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type ( + 'M, + 'T) t = + { + declarations: + ('M, + 'T) + Declarator.t + list ; + kind: + Variable.kind + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module While + : + sig + type ( + 'M, + 'T) t = + { + test: + ('M, + 'T) + Expression.t + ; + body: + ('M, + 'T) + Statement.t + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + DoWhile : + sig + type ( + 'M, + 'T) t = + { + body: + ('M, + 'T) + Statement.t + ; + test: + ('M, + 'T) + Expression.t + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module For : + sig + type ( + 'M, + 'T) t = + { + init: + ('M, + 'T) init + option ; + test: + ('M, + 'T) + Expression.t + option ; + update: + ('M, + 'T) + Expression.t + option ; + body: + ('M, + 'T) + Statement.t + ; + comments: + ('M, + unit) + Syntax.t + option } + and ( + 'M, + 'T) init = + | + InitDeclaration + of ('M * + ( + 'M, + 'T) + VariableDeclaration.t) + + | + InitExpression + of ( + 'M, + 'T) + Expression.t + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val + pp_init : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) init + -> + unit + val + show_init + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) init + -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module ForIn + : + sig + type ( + 'M, + 'T) t = + { + left: + ('M, + 'T) left ; + right: + ('M, + 'T) + Expression.t + ; + body: + ('M, + 'T) + Statement.t + ; + each: + bool ; + comments: + ('M, + unit) + Syntax.t + option } + and ( + 'M, + 'T) left = + | + LeftDeclaration + of ('M * + ( + 'M, + 'T) + VariableDeclaration.t) + + | + LeftPattern + of ( + 'M, + 'T) + Pattern.t + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val + pp_left : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) left + -> + unit + val + show_left + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) left + -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module ForOf + : + sig + type ( + 'M, + 'T) t = + { + left: + ('M, + 'T) left ; + right: + ('M, + 'T) + Expression.t + ; + body: + ('M, + 'T) + Statement.t + ; + await: + bool ; + comments: + ('M, + unit) + Syntax.t + option } + and ( + 'M, + 'T) left = + | + LeftDeclaration + of ('M * + ( + 'M, + 'T) + VariableDeclaration.t) + + | + LeftPattern + of ( + 'M, + 'T) + Pattern.t + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val + pp_left : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) left + -> + unit + val + show_left + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) left + -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + EnumDeclaration + : + sig + module + DefaultedMember + : + sig + type + 'M t = + ('M * 'M + t') + and + 'M t' = + { + id: + ('M, + 'M) + Identifier.t + } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + 'M t -> + string + val pp_t' + : + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M t' -> + unit + val + show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + 'M t' -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + InitializedMember + : + sig + type ( + 'I, + 'M) t = + ('M * + ('I, + 'M) t') + and ( + 'I, + 'M) t' = + { + id: + ('M, + 'M) + Identifier.t + ; + init: + ('M * 'I) } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'I -> + unit) + -> + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + ('I, + 'M) t -> + unit + val show + : + (Format.formatter + -> + 'I -> + unit) + -> + (Format.formatter + -> + 'M -> + unit) + -> + ('I, + 'M) t -> + string + val pp_t' + : + (Format.formatter + -> + 'I -> + unit) + -> + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + ('I, + 'M) t' -> + unit + val + show_t' : + (Format.formatter + -> + 'I -> + unit) + -> + (Format.formatter + -> + 'M -> + unit) + -> + ('I, + 'M) t' -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + BooleanBody + : + sig + type + 'M t = + { + members: + ('M + BooleanLiteral.t, + 'M) + InitializedMember.t + list ; + explicit_type: + bool ; + has_unknown_members: + bool ; + comments: + ('M, + 'M + Comment.t + list) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + 'M t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + NumberBody + : + sig + type + 'M t = + { + members: + ('M + NumberLiteral.t, + 'M) + InitializedMember.t + list ; + explicit_type: + bool ; + has_unknown_members: + bool ; + comments: + ('M, + 'M + Comment.t + list) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + 'M t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + StringBody + : + sig + type + 'M t = + { + members: + ('M + StringLiteral.t, + 'M) + members ; + explicit_type: + bool ; + has_unknown_members: + bool ; + comments: + ('M, + 'M + Comment.t + list) + Syntax.t + option } + and ( + 'I, + 'M) members = + | + Defaulted + of 'M + DefaultedMember.t + list + | + Initialized + of ( + 'I, + 'M) + InitializedMember.t + list + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + 'M t -> + string + val + pp_members + : + (Format.formatter + -> + 'I -> + unit) + -> + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + ('I, + 'M) + members + -> + unit + val + show_members + : + (Format.formatter + -> + 'I -> + unit) + -> + (Format.formatter + -> + 'M -> + unit) + -> + ('I, + 'M) + members + -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + SymbolBody + : + sig + type + 'M t = + { + members: + 'M + DefaultedMember.t + list ; + has_unknown_members: + bool ; + comments: + ('M, + 'M + Comment.t + list) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + 'M t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + BigIntBody + : + sig + type + 'M t = + { + members: + ('M + BigIntLiteral.t, + 'M) + InitializedMember.t + list ; + explicit_type: + bool ; + has_unknown_members: + bool ; + comments: + ('M, + 'M + Comment.t + list) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + 'M t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type ( + 'M, + 'T) t = + { + id: + ('M, + 'T) + Identifier.t + ; + body: + 'M body ; + comments: + ('M, + unit) + Syntax.t + option } + and + 'M body = + ('M * 'M + body') + and + 'M body' = + | + BooleanBody + of 'M + BooleanBody.t + + | + NumberBody + of 'M + NumberBody.t + + | + StringBody + of 'M + StringBody.t + + | + SymbolBody + of 'M + SymbolBody.t + + | + BigIntBody + of 'M + BigIntBody.t + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val + pp_body : + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M body + -> + unit + val + show_body + : + (Format.formatter + -> + 'M -> + unit) + -> + 'M body + -> + string + val + pp_body' + : + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M body' + -> + unit + val + show_body' + : + (Format.formatter + -> + 'M -> + unit) + -> + 'M body' + -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + ComponentDeclaration + : + sig + module + RestParam : + sig + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + argument: + ('M, + 'T) + Pattern.t ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val pp_t' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + val + show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + Param : + sig + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + name: + ('M, + 'T) + param_name + ; + local: + ('M, + 'T) + Pattern.t ; + default: + ('M, + 'T) + Expression.t + option ; + shorthand: + bool } + and ( + 'M, + 'T) param_name = + | + Identifier + of ( + 'M, + 'T) + Identifier.t + + | + StringLiteral + of ('M * + 'M + StringLiteral.t) + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val pp_t' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + val + show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + val + pp_param_name + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + param_name + -> + unit + val + show_param_name + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + param_name + -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + Params : + sig + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + params: + ('M, + 'T) + Param.t + list ; + rest: + ('M, + 'T) + RestParam.t + option ; + comments: + ('M, + 'M + Comment.t + list) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val pp_t' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + val + show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type ( + 'M, + 'T) t = + { + id: + ('M, + 'T) + Identifier.t + ; + tparams: + ('M, + 'T) + Type.TypeParams.t + option ; + params: + ('M, + 'T) + Params.t ; + renders: + ('M, + 'T) + Type.component_renders_annotation + ; + body: + ('M * + ('M, + 'T) + Statement.Block.t) + ; + comments: + ('M, + unit) + Syntax.t + option ; + sig_loc: + 'M } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + Interface : + sig + type ( + 'M, + 'T) t = + { + id: + ('M, + 'T) + Identifier.t + ; + tparams: + ('M, + 'T) + Type.TypeParams.t + option ; + extends: + ('M * + ('M, + 'T) + Type.Generic.t) + list ; + body: + ('M * + ('M, + 'T) + Type.Object.t) + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + DeclareClass + : + sig + type ( + 'M, + 'T) t = + { + id: + ('M, + 'T) + Identifier.t + ; + tparams: + ('M, + 'T) + Type.TypeParams.t + option ; + body: + ('M * + ('M, + 'T) + Type.Object.t) + ; + extends: + ('M * + ('M, + 'T) + Type.Generic.t) + option ; + mixins: + ('M * + ('M, + 'T) + Type.Generic.t) + list ; + implements: + ('M, + 'T) + Class.Implements.t + option ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + DeclareComponent + : + sig + type ( + 'M, + 'T) t = + { + id: + ('M, + 'T) + Identifier.t + ; + tparams: + ('M, + 'T) + Type.TypeParams.t + option ; + params: + ('M, + 'T) + Type.Component.Params.t + ; + renders: + ('M, + 'T) + Type.component_renders_annotation + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + DeclareVariable + : + sig + type ( + 'M, + 'T) t = + { + id: + ('M, + 'T) + Identifier.t + ; + annot: + ('M, + 'T) + Type.annotation + ; + kind: + Variable.kind + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + DeclareFunction + : + sig + type ( + 'M, + 'T) t = + { + id: + ('M, + 'T) + Identifier.t + ; + annot: + ('M, + 'T) + Type.annotation + ; + predicate: + ('M, + 'T) + Type.Predicate.t + option ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + DeclareModule + : + sig + type ( + 'M, + 'T) id = + | + Identifier + of ( + 'M, + 'T) + Identifier.t + + | Literal + of ('T * + 'M + StringLiteral.t) + + and ( + 'M, + 'T) t = + { + id: + ('M, + 'T) id ; + body: + ('M * + ('M, + 'T) + Block.t) ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp_id + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) id -> + unit + val + show_id : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) id -> + string + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + DeclareModuleExports + : + sig + type ( + 'M, + 'T) t = + { + annot: + ('M, + 'T) + Type.annotation + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + DeclareNamespace + : + sig + type ( + 'M, + 'T) id = + | Global + of ( + 'M, + 'M) + Identifier.t + + | Local + of ( + 'M, + 'T) + Identifier.t + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp_id + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) id -> + unit + val + show_id : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) id -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + type ( + 'M, + 'T) t = + { + id: + ('M, + 'T) id ; + body: + ('M * + ('M, + 'T) + Block.t) ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + ExportNamedDeclaration + : + sig + module + ExportSpecifier + : + sig + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + local: + ('M, + 'T) + Identifier.t + ; + exported: + ('M, + 'T) + Identifier.t + option ; + from_remote: + bool ; + imported_name_def_loc: + 'M option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val pp_t' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + val + show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + ExportBatchSpecifier + : + sig + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) + Identifier.t + option) + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type ( + 'M, + 'T) t = + { + declaration: + ('M, + 'T) + Statement.t + option ; + specifiers: + ('M, + 'T) + specifier + option ; + source: + ('T * 'M + StringLiteral.t) + option ; + export_kind: + Statement.export_kind + ; + comments: + ('M, + unit) + Syntax.t + option } + and ( + 'M, + 'T) specifier = + | + ExportSpecifiers + of ( + 'M, + 'T) + ExportSpecifier.t + list + | + ExportBatchSpecifier + of ( + 'M, + 'T) + ExportBatchSpecifier.t + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val + pp_specifier + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + specifier + -> + unit + val + show_specifier + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + specifier + -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + ExportDefaultDeclaration + : + sig + type ( + 'M, + 'T) t = + { + default: + 'T ; + declaration: + ('M, + 'T) + declaration + ; + comments: + ('M, + unit) + Syntax.t + option } + and ( + 'M, + 'T) declaration = + | + Declaration + of ( + 'M, + 'T) + Statement.t + + | + Expression + of ( + 'M, + 'T) + Expression.t + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val + pp_declaration + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + declaration + -> + unit + val + show_declaration + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + declaration + -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + DeclareExportDeclaration + : + sig + type ( + 'M, + 'T) declaration = + | + Variable + of ('M * + ( + 'M, + 'T) + DeclareVariable.t) + + | + Function + of ('M * + ( + 'M, + 'T) + DeclareFunction.t) + + | Class + of ('M * + ( + 'M, + 'T) + DeclareClass.t) + + | + Component + of ('M * + ( + 'M, + 'T) + DeclareComponent.t) + + | + DefaultType + of ( + 'M, + 'T) + Type.t + | + NamedType + of ('M * + ( + 'M, + 'T) + TypeAlias.t) + + | + NamedOpaqueType + of ('M * + ( + 'M, + 'T) + OpaqueType.t) + + | + Interface + of ('M * + ( + 'M, + 'T) + Interface.t) + + | Enum of + ('M * + ( + 'M, + 'T) + EnumDeclaration.t) + + and ( + 'M, + 'T) t = + { + default: + 'M option ; + declaration: + ('M, + 'T) + declaration + option ; + specifiers: + ('M, + 'T) + ExportNamedDeclaration.specifier + option ; + source: + ('T * 'M + StringLiteral.t) + option ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val + pp_declaration + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + declaration + -> + unit + val + show_declaration + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + declaration + -> + string + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + ImportDeclaration + : + sig + type import_kind = + | + ImportType + + | + ImportTypeof + + | + ImportValue + + and ( + 'M, + 'T) specifier = + | + ImportNamedSpecifiers + of ( + 'M, + 'T) + named_specifier + list + | + ImportNamespaceSpecifier + of ('M * + ( + 'M, + 'T) + Identifier.t) + + and ( + 'M, + 'T) named_specifier = + { + kind: + import_kind + option ; + local: + ('M, + 'T) + Identifier.t + option ; + remote: + ('M, + 'T) + Identifier.t + ; + remote_name_def_loc: + 'M option } + and ( + 'M, + 'T) default_identifier = + { + identifier: + ('M, + 'T) + Identifier.t + ; + remote_default_name_def_loc: + 'M option } + and ( + 'M, + 'T) t = + { + import_kind: + import_kind + ; + source: + ('T * 'M + StringLiteral.t) + ; + default: + ('M, + 'T) + default_identifier + option ; + specifiers: + ('M, + 'T) + specifier + option ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val + pp_import_kind + : + Format.formatter + -> + import_kind + -> + unit + val + show_import_kind + : + import_kind + -> + string + val + pp_specifier + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + specifier + -> + unit + val + show_specifier + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + specifier + -> + string + val + pp_named_specifier + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + named_specifier + -> + unit + val + show_named_specifier + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + named_specifier + -> + string + val + pp_default_identifier + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + default_identifier + -> + unit + val + show_default_identifier + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + default_identifier + -> + string + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + Expression : + sig + type ( + 'M, + 'T) t = + { + expression: + ('M, + 'T) + Expression.t + ; + directive: + string + option ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Empty + : + sig + type + 'M t = + { + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + 'M t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type export_kind = + | + ExportType + + | + ExportValue + and ( + 'M, + 'T) t = + ('M * ( + 'M, + 'T) t') + and ( + 'M, + 'T) t' = + | Block of + ('M, + 'T) Block.t + + | Break of + 'M Break.t + + | + ClassDeclaration + of ( + 'M, + 'T) Class.t + + | + ComponentDeclaration + of ( + 'M, + 'T) + ComponentDeclaration.t + + | Continue + of 'M + Continue.t + + | Debugger + of 'M + Debugger.t + + | + DeclareClass + of ( + 'M, + 'T) + DeclareClass.t + + | + DeclareComponent + of ( + 'M, + 'T) + DeclareComponent.t + + | + DeclareEnum + of ( + 'M, + 'T) + EnumDeclaration.t + + | + DeclareExportDeclaration + of ( + 'M, + 'T) + DeclareExportDeclaration.t + + | + DeclareFunction + of ( + 'M, + 'T) + DeclareFunction.t + + | + DeclareInterface + of ( + 'M, + 'T) + Interface.t + + | + DeclareModule + of ( + 'M, + 'T) + DeclareModule.t + + | + DeclareModuleExports + of ( + 'M, + 'T) + DeclareModuleExports.t + + | + DeclareNamespace + of ( + 'M, + 'T) + DeclareNamespace.t + + | + DeclareTypeAlias + of ( + 'M, + 'T) + TypeAlias.t + + | + DeclareOpaqueType + of ( + 'M, + 'T) + OpaqueType.t + + | + DeclareVariable + of ( + 'M, + 'T) + DeclareVariable.t + + | DoWhile + of ( + 'M, + 'T) + DoWhile.t + | Empty of + 'M Empty.t + + | + EnumDeclaration + of ( + 'M, + 'T) + EnumDeclaration.t + + | + ExportDefaultDeclaration + of ( + 'M, + 'T) + ExportDefaultDeclaration.t + + | + ExportNamedDeclaration + of ( + 'M, + 'T) + ExportNamedDeclaration.t + + | + Expression + of ( + 'M, + 'T) + Expression.t + + | For of + ('M, + 'T) For.t + | ForIn of + ('M, + 'T) ForIn.t + + | ForOf of + ('M, + 'T) ForOf.t + + | + FunctionDeclaration + of ( + 'M, + 'T) + Function.t + + | If of + ('M, + 'T) If.t + | + ImportDeclaration + of ( + 'M, + 'T) + ImportDeclaration.t + + | + InterfaceDeclaration + of ( + 'M, + 'T) + Interface.t + + | Labeled + of ( + 'M, + 'T) + Labeled.t + | Match of + ('M, + 'T) + match_statement + + | Return of + ('M, + 'T) + Return.t + | Switch of + ('M, + 'T) + Switch.t + | Throw of + ('M, + 'T) Throw.t + + | Try of + ('M, + 'T) Try.t + | TypeAlias + of ( + 'M, + 'T) + TypeAlias.t + + | + OpaqueType + of ( + 'M, + 'T) + OpaqueType.t + + | + VariableDeclaration + of ( + 'M, + 'T) + VariableDeclaration.t + + | While of + ('M, + 'T) While.t + + | With of + ('M, + 'T) With.t + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val + pp_export_kind + : + Format.formatter + -> + export_kind + -> + unit + val + show_export_kind + : + export_kind + -> + string + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val pp_t' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + val + show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end = + struct + module Block = + struct + type ( + 'M, + 'T) t = + { + body: + ('M, + 'T) + Statement.t + list ; + comments: + ('M, + 'M + Comment.t + list) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __2 + = + Syntax.pp + and __1 = + Comment.pp + and __0 = + Statement.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.Block.body"; + ((fun x + -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]")) + x.body; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + x -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__1 + (fun fmt + -> + poly_M + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module If = + struct + module Alternate = + struct + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + body: + ('M, + 'T) + Statement.t + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let _ = + fun + (_ : + ('M, + 'T) t') + -> () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __0 + = pp_t' in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + = + ((let __1 + = + Syntax.pp + and __0 = + Statement.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.If.Alternate.body"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.body; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_t' + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + and _ = + pp_t' + and _ = + show_t' + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type ( + 'M, + 'T) t = + { + test: + ('M, + 'T) + Expression.t + ; + consequent: + ('M, + 'T) + Statement.t + ; + alternate: + ('M, + 'T) + Alternate.t + option ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __3 + = + Syntax.pp + and __2 = + Alternate.pp + and __1 = + Statement.pp + and __0 = + Expression.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.If.test"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.test; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "consequent"; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.consequent; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "alternate"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.alternate; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__3 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Labeled = + struct + type ( + 'M, + 'T) t = + { + label: + ('M, + 'M) + Identifier.t + ; + body: + ('M, + 'T) + Statement.t + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __2 + = + Syntax.pp + and __1 = + Statement.pp + and __0 = + Identifier.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.Labeled.label"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_M + fmt) fmt) + x.label; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "body"; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.body; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Break = + struct + type + 'M t = + { + label: + ('M, + 'M) + Identifier.t + option ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + 'M t) -> + () + let rec pp + : + 'M . + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M t -> + unit + = + ((let __1 + = + Syntax.pp + and __0 = + Identifier.pp in + (( + fun + poly_M + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.Break.label"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_M + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.label; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M . + (Format.formatter + -> + 'M -> + unit) + -> + 'M t -> + string + = + fun + poly_M x + -> + Format.asprintf + "%a" + (pp + poly_M) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Continue = + struct + type + 'M t = + { + label: + ('M, + 'M) + Identifier.t + option ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + 'M t) -> + () + let rec pp + : + 'M . + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M t -> + unit + = + ((let __1 + = + Syntax.pp + and __0 = + Identifier.pp in + (( + fun + poly_M + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.Continue.label"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_M + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.label; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M . + (Format.formatter + -> + 'M -> + unit) + -> + 'M t -> + string + = + fun + poly_M x + -> + Format.asprintf + "%a" + (pp + poly_M) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Debugger = + struct + type + 'M t = + { + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + 'M t) -> + () + let rec pp + : + 'M . + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M t -> + unit + = + ((let __0 + = + Syntax.pp in + (( + fun + poly_M + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.Debugger.comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M . + (Format.formatter + -> + 'M -> + unit) + -> + 'M t -> + string + = + fun + poly_M x + -> + Format.asprintf + "%a" + (pp + poly_M) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module With = + struct + type ( + 'M, + 'T) t = + { + _object: + ('M, + 'T) + Expression.t + ; + body: + ('M, + 'T) + Statement.t + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __2 + = + Syntax.pp + and __1 = + Statement.pp + and __0 = + Expression.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.With._object"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x._object; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "body"; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.body; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module TypeAlias = + struct + type ( + 'M, + 'T) t = + { + id: + ('M, + 'T) + Identifier.t + ; + tparams: + ('M, + 'T) + Type.TypeParams.t + option ; + right: + ('M, + 'T) + Type.t ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __3 + = + Syntax.pp + and __2 = + Type.pp + and __1 = + Type.TypeParams.pp + and __0 = + Identifier.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.TypeAlias.id"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.id; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "tparams"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.tparams; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "right"; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.right; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__3 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module OpaqueType = + struct + type ( + 'M, + 'T) t = + { + id: + ('M, + 'T) + Identifier.t + ; + tparams: + ('M, + 'T) + Type.TypeParams.t + option ; + impltype: + ('M, + 'T) + Type.t + option ; + supertype: + ('M, + 'T) + Type.t + option ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __4 + = + Syntax.pp + and __3 = + Type.pp + and __2 = + Type.pp + and __1 = + Type.TypeParams.pp + and __0 = + Identifier.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.OpaqueType.id"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.id; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "tparams"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.tparams; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "impltype"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.impltype; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "supertype"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__3 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.supertype; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__4 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type ( + 'M, + 'T) match_statement = + ('M, + 'T, + ('M, + 'T) + Statement.t) + Match.t + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) + match_statement) + -> () + let rec pp_match_statement + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + match_statement + -> + unit + = + ((let __1 + = + Match.pp + and __0 = + Statement.pp in + (( + fun + poly_M + poly_T + fmt -> + __1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) + (fun fmt + -> + __0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + fmt) + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_match_statement + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + match_statement + -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_match_statement + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp_match_statement + and _ = + show_match_statement + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + module Switch = + struct + module Case = + struct + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + test: + ('M, + 'T) + Expression.t + option ; + consequent: + ('M, + 'T) + Statement.t + list ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let _ = + fun + (_ : + ('M, + 'T) t') + -> () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __0 + = pp_t' in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + = + ((let __2 + = + Syntax.pp + and __1 = + Statement.pp + and __0 = + Expression.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.Switch.Case.test"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.test; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "consequent"; + ((fun x + -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]")) + x.consequent; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_t' + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + and _ = + pp_t' + and _ = + show_t' + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type ( + 'M, + 'T) t = + { + discriminant: + ('M, + 'T) + Expression.t + ; + cases: + ('M, + 'T) + Case.t + list ; + comments: + ('M, + unit) + Syntax.t + option ; + exhaustive_out: + 'T } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __2 + = + Syntax.pp + and __1 = + Case.pp + and __0 = + Expression.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.Switch.discriminant"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.discriminant; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "cases"; + ((fun x + -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]")) + x.cases; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "exhaustive_out"; + (poly_T + fmt) + x.exhaustive_out; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Return = + struct + type ( + 'M, + 'T) t = + { + argument: + ('M, + 'T) + Expression.t + option ; + comments: + ('M, + unit) + Syntax.t + option ; + return_out: + 'T } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __1 + = + Syntax.pp + and __0 = + Expression.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.Return.argument"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.argument; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "return_out"; + (poly_T + fmt) + x.return_out; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Throw = + struct + type ( + 'M, + 'T) t = + { + argument: + ('M, + 'T) + Expression.t + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __1 + = + Syntax.pp + and __0 = + Expression.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.Throw.argument"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.argument; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Try = + struct + module CatchClause = + struct + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + param: + ('M, + 'T) + Pattern.t + option ; + body: + ('M * + ('M, + 'T) + Block.t) ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let _ = + fun + (_ : + ('M, + 'T) t') + -> () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __0 + = pp_t' in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + = + ((let __2 + = + Syntax.pp + and __1 = + Block.pp + and __0 = + Pattern.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.Try.CatchClause.param"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.param; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "body"; + ((fun + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])")) + x.body; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_t' + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + and _ = + pp_t' + and _ = + show_t' + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type ( + 'M, + 'T) t = + { + block: + ('M * + ('M, + 'T) + Block.t) ; + handler: + ('M, + 'T) + CatchClause.t + option ; + finalizer: + ('M * + ('M, + 'T) + Block.t) + option ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __3 + = + Syntax.pp + and __2 = + Block.pp + and __1 = + CatchClause.pp + and __0 = + Block.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.Try.block"; + ((fun + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])")) + x.block; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "handler"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.handler; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "finalizer"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + ((fun + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])")) + x; + Format.pp_print_string + fmt ")"))) + x.finalizer; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__3 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module VariableDeclaration = + struct + module Declarator = + struct + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + id: + ('M, + 'T) + Pattern.t ; + init: + ('M, + 'T) + Expression.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let _ = + fun + (_ : + ('M, + 'T) t') + -> () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __0 + = pp_t' in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + = + ((let __1 + = + Expression.pp + and __0 = + Pattern.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.VariableDeclaration.Declarator.id"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.id; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "init"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.init; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_t' + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + and _ = + pp_t' + and _ = + show_t' + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type ( + 'M, + 'T) t = + { + declarations: + ('M, + 'T) + Declarator.t + list ; + kind: + Variable.kind + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __2 + = + Syntax.pp + and __1 = + Variable.pp_kind + and __0 = + Declarator.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.VariableDeclaration.declarations"; + ((fun x + -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]")) + x.declarations; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "kind"; + (__1 fmt) + x.kind; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module While = + struct + type ( + 'M, + 'T) t = + { + test: + ('M, + 'T) + Expression.t + ; + body: + ('M, + 'T) + Statement.t + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __2 + = + Syntax.pp + and __1 = + Statement.pp + and __0 = + Expression.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.While.test"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.test; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "body"; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.body; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module DoWhile = + struct + type ( + 'M, + 'T) t = + { + body: + ('M, + 'T) + Statement.t + ; + test: + ('M, + 'T) + Expression.t + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __2 + = + Syntax.pp + and __1 = + Expression.pp + and __0 = + Statement.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.DoWhile.body"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.body; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "test"; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.test; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module For = + struct + type ( + 'M, + 'T) t = + { + init: + ('M, + 'T) init + option ; + test: + ('M, + 'T) + Expression.t + option ; + update: + ('M, + 'T) + Expression.t + option ; + body: + ('M, + 'T) + Statement.t + ; + comments: + ('M, + unit) + Syntax.t + option } + and ( + 'M, + 'T) init = + | + InitDeclaration + of ('M * + ('M, + 'T) + VariableDeclaration.t) + + | + InitExpression + of ( + 'M, + 'T) + Expression.t + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let _ = + fun + (_ : + ('M, + 'T) init) + -> () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __4 + = + Syntax.pp + and __3 = + Statement.pp + and __2 = + Expression.pp + and __1 = + Expression.pp + and __0 = + pp_init in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.For.init"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.init; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "test"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.test; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "update"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.update; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "body"; + (__3 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.body; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__4 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_init + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) init + -> + unit + = + ((let __1 + = + Expression.pp + and __0 = + VariableDeclaration.pp in + (( + fun + poly_M + poly_T + fmt -> + function + | + InitDeclaration + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.For.InitDeclaration@ "; + ((fun + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])")) + a0; + Format.fprintf + fmt "@])") + | + InitExpression + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.For.InitExpression@ "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])")) + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_init + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) init + -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_init + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + and _ = + pp_init + and _ = + show_init + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module ForIn = + struct + type ( + 'M, + 'T) t = + { + left: + ('M, + 'T) left ; + right: + ('M, + 'T) + Expression.t + ; + body: + ('M, + 'T) + Statement.t + ; + each: + bool ; + comments: + ('M, + unit) + Syntax.t + option } + and ( + 'M, + 'T) left = + | + LeftDeclaration + of ('M * + ('M, + 'T) + VariableDeclaration.t) + + | + LeftPattern + of ( + 'M, + 'T) + Pattern.t + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let _ = + fun + (_ : + ('M, + 'T) left) + -> () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __3 + = + Syntax.pp + and __2 = + Statement.pp + and __1 = + Expression.pp + and __0 = + pp_left in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.ForIn.left"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.left; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "right"; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.right; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "body"; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.body; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "each"; + (Format.fprintf + fmt "%B") + x.each; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__3 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_left + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) left + -> + unit + = + ((let __1 + = + Pattern.pp + and __0 = + VariableDeclaration.pp in + (( + fun + poly_M + poly_T + fmt -> + function + | + LeftDeclaration + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.ForIn.LeftDeclaration@ "; + ((fun + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])")) + a0; + Format.fprintf + fmt "@])") + | + LeftPattern + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.ForIn.LeftPattern@ "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])")) + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_left + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) left + -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_left + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + and _ = + pp_left + and _ = + show_left + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module ForOf = + struct + type ( + 'M, + 'T) t = + { + left: + ('M, + 'T) left ; + right: + ('M, + 'T) + Expression.t + ; + body: + ('M, + 'T) + Statement.t + ; + await: + bool ; + comments: + ('M, + unit) + Syntax.t + option } + and ( + 'M, + 'T) left = + | + LeftDeclaration + of ('M * + ('M, + 'T) + VariableDeclaration.t) + + | + LeftPattern + of ( + 'M, + 'T) + Pattern.t + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let _ = + fun + (_ : + ('M, + 'T) left) + -> () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __3 + = + Syntax.pp + and __2 = + Statement.pp + and __1 = + Expression.pp + and __0 = + pp_left in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.ForOf.left"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.left; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "right"; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.right; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "body"; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.body; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "await"; + (Format.fprintf + fmt "%B") + x.await; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__3 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_left + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) left + -> + unit + = + ((let __1 + = + Pattern.pp + and __0 = + VariableDeclaration.pp in + (( + fun + poly_M + poly_T + fmt -> + function + | + LeftDeclaration + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.ForOf.LeftDeclaration@ "; + ((fun + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])")) + a0; + Format.fprintf + fmt "@])") + | + LeftPattern + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.ForOf.LeftPattern@ "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])")) + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_left + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) left + -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_left + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + and _ = + pp_left + and _ = + show_left + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module EnumDeclaration = + struct + module DefaultedMember = + struct + type + 'M t = + ('M * 'M + t') + and + 'M t' = + { + id: + ('M, + 'M) + Identifier.t + } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + 'M t) -> + () + let _ = + fun + (_ : + 'M t') -> + () + let rec pp + : + 'M . + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M t -> + unit + = + ((let __0 + = pp_t' in + (( + fun + poly_M + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M . + (Format.formatter + -> + 'M -> + unit) + -> + 'M t -> + string + = + fun + poly_M x + -> + Format.asprintf + "%a" + (pp + poly_M) x + [@@ocaml.warning + "-32"] + and pp_t' + : + 'M . + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M t' -> + unit + = + ((let __0 + = + Identifier.pp in + (( + fun + poly_M + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.EnumDeclaration.DefaultedMember.id"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_M + fmt) fmt) + x.id; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_t' + : + 'M . + (Format.formatter + -> + 'M -> + unit) + -> + 'M t' -> + string + = + fun + poly_M x + -> + Format.asprintf + "%a" + (pp_t' + poly_M) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + and _ = + pp_t' + and _ = + show_t' + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module InitializedMember = + struct + type ( + 'I, + 'M) t = + ('M * + ('I, + 'M) t') + and ( + 'I, + 'M) t' = + { + id: + ('M, + 'M) + Identifier.t + ; + init: + ('M * 'I) } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('I, + 'M) t) -> + () + let _ = + fun + (_ : + ('I, + 'M) t') + -> () + let rec pp + : + 'I 'M . + (Format.formatter + -> + 'I -> + unit) + -> + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + ('I, + 'M) t -> + unit + = + ((let __0 + = pp_t' in + (( + fun + poly_I + poly_M + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_I + fmt) + (fun fmt + -> + poly_M + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'I 'M . + (Format.formatter + -> + 'I -> + unit) + -> + (Format.formatter + -> + 'M -> + unit) + -> + ('I, + 'M) t -> + string + = + fun + poly_I + poly_M x + -> + Format.asprintf + "%a" + ((pp + poly_I) + poly_M) x + [@@ocaml.warning + "-32"] + and pp_t' + : + 'I 'M . + (Format.formatter + -> + 'I -> + unit) + -> + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + ('I, + 'M) t' -> + unit + = + ((let __0 + = + Identifier.pp in + (( + fun + poly_I + poly_M + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.EnumDeclaration.InitializedMember.id"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_M + fmt) fmt) + x.id; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "init"; + ((fun + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (poly_I + fmt) a1); + Format.fprintf + fmt "@])")) + x.init; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_t' + : + 'I 'M . + (Format.formatter + -> + 'I -> + unit) + -> + (Format.formatter + -> + 'M -> + unit) + -> + ('I, + 'M) t' -> + string + = + fun + poly_I + poly_M x + -> + Format.asprintf + "%a" + ((pp_t' + poly_I) + poly_M) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + and _ = + pp_t' + and _ = + show_t' + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module BooleanBody = + struct + type + 'M t = + { + members: + ('M + BooleanLiteral.t, + 'M) + InitializedMember.t + list ; + explicit_type: + bool ; + has_unknown_members: + bool ; + comments: + ('M, + 'M + Comment.t + list) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + 'M t) -> + () + let rec pp + : + 'M . + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M t -> + unit + = + ((let __3 + = + Syntax.pp + and __2 = + Comment.pp + and __1 = + InitializedMember.pp + and __0 = + BooleanLiteral.pp in + (( + fun + poly_M + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.EnumDeclaration.BooleanBody.members"; + ((fun x + -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__1 + (fun fmt + -> + __0 + (fun fmt + -> + poly_M + fmt) fmt) + (fun fmt + -> + poly_M + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]")) + x.members; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "explicit_type"; + (Format.fprintf + fmt "%B") + x.explicit_type; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "has_unknown_members"; + (Format.fprintf + fmt "%B") + x.has_unknown_members; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__3 + (fun fmt + -> + poly_M + fmt) + (fun fmt + x -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__2 + (fun fmt + -> + poly_M + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M . + (Format.formatter + -> + 'M -> + unit) + -> + 'M t -> + string + = + fun + poly_M x + -> + Format.asprintf + "%a" + (pp + poly_M) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module NumberBody = + struct + type + 'M t = + { + members: + ('M + NumberLiteral.t, + 'M) + InitializedMember.t + list ; + explicit_type: + bool ; + has_unknown_members: + bool ; + comments: + ('M, + 'M + Comment.t + list) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + 'M t) -> + () + let rec pp + : + 'M . + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M t -> + unit + = + ((let __3 + = + Syntax.pp + and __2 = + Comment.pp + and __1 = + InitializedMember.pp + and __0 = + NumberLiteral.pp in + (( + fun + poly_M + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.EnumDeclaration.NumberBody.members"; + ((fun x + -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__1 + (fun fmt + -> + __0 + (fun fmt + -> + poly_M + fmt) fmt) + (fun fmt + -> + poly_M + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]")) + x.members; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "explicit_type"; + (Format.fprintf + fmt "%B") + x.explicit_type; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "has_unknown_members"; + (Format.fprintf + fmt "%B") + x.has_unknown_members; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__3 + (fun fmt + -> + poly_M + fmt) + (fun fmt + x -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__2 + (fun fmt + -> + poly_M + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M . + (Format.formatter + -> + 'M -> + unit) + -> + 'M t -> + string + = + fun + poly_M x + -> + Format.asprintf + "%a" + (pp + poly_M) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module StringBody = + struct + type + 'M t = + { + members: + ('M + StringLiteral.t, + 'M) + members ; + explicit_type: + bool ; + has_unknown_members: + bool ; + comments: + ('M, + 'M + Comment.t + list) + Syntax.t + option } + and ( + 'I, + 'M) members = + | + Defaulted + of 'M + DefaultedMember.t + list + | + Initialized + of ( + 'I, + 'M) + InitializedMember.t + list + [@@deriving + show] + include + struct + let _ = + fun + (_ : + 'M t) -> + () + let _ = + fun + (_ : + ('I, + 'M) + members) + -> () + let rec pp + : + 'M . + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M t -> + unit + = + ((let __3 + = + Syntax.pp + and __2 = + Comment.pp + and __1 = + pp_members + and __0 = + StringLiteral.pp in + (( + fun + poly_M + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.EnumDeclaration.StringBody.members"; + (__1 + (fun fmt + -> + __0 + (fun fmt + -> + poly_M + fmt) fmt) + (fun fmt + -> + poly_M + fmt) fmt) + x.members; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "explicit_type"; + (Format.fprintf + fmt "%B") + x.explicit_type; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "has_unknown_members"; + (Format.fprintf + fmt "%B") + x.has_unknown_members; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__3 + (fun fmt + -> + poly_M + fmt) + (fun fmt + x -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__2 + (fun fmt + -> + poly_M + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M . + (Format.formatter + -> + 'M -> + unit) + -> + 'M t -> + string + = + fun + poly_M x + -> + Format.asprintf + "%a" + (pp + poly_M) x + [@@ocaml.warning + "-32"] + and pp_members + : + 'I 'M . + (Format.formatter + -> + 'I -> + unit) + -> + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + ('I, + 'M) + members + -> + unit + = + ((let __1 + = + InitializedMember.pp + and __0 = + DefaultedMember.pp in + (( + fun + poly_I + poly_M + fmt -> + function + | + Defaulted + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.EnumDeclaration.StringBody.Defaulted@ "; + ((fun x + -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__0 + (fun fmt + -> + poly_M + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]")) + a0; + Format.fprintf + fmt "@])") + | + Initialized + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.EnumDeclaration.StringBody.Initialized@ "; + ((fun x + -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__1 + (fun fmt + -> + poly_I + fmt) + (fun fmt + -> + poly_M + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]")) + a0; + Format.fprintf + fmt "@])")) + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_members + : + 'I 'M . + (Format.formatter + -> + 'I -> + unit) + -> + (Format.formatter + -> + 'M -> + unit) + -> + ('I, + 'M) + members + -> + string + = + fun + poly_I + poly_M x + -> + Format.asprintf + "%a" + ((pp_members + poly_I) + poly_M) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + and _ = + pp_members + and _ = + show_members + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module SymbolBody = + struct + type + 'M t = + { + members: + 'M + DefaultedMember.t + list ; + has_unknown_members: + bool ; + comments: + ('M, + 'M + Comment.t + list) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + 'M t) -> + () + let rec pp + : + 'M . + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M t -> + unit + = + ((let __2 + = + Syntax.pp + and __1 = + Comment.pp + and __0 = + DefaultedMember.pp in + (( + fun + poly_M + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.EnumDeclaration.SymbolBody.members"; + ((fun x + -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__0 + (fun fmt + -> + poly_M + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]")) + x.members; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "has_unknown_members"; + (Format.fprintf + fmt "%B") + x.has_unknown_members; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + x -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__1 + (fun fmt + -> + poly_M + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M . + (Format.formatter + -> + 'M -> + unit) + -> + 'M t -> + string + = + fun + poly_M x + -> + Format.asprintf + "%a" + (pp + poly_M) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module BigIntBody = + struct + type + 'M t = + { + members: + ('M + BigIntLiteral.t, + 'M) + InitializedMember.t + list ; + explicit_type: + bool ; + has_unknown_members: + bool ; + comments: + ('M, + 'M + Comment.t + list) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + 'M t) -> + () + let rec pp + : + 'M . + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M t -> + unit + = + ((let __3 + = + Syntax.pp + and __2 = + Comment.pp + and __1 = + InitializedMember.pp + and __0 = + BigIntLiteral.pp in + (( + fun + poly_M + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.EnumDeclaration.BigIntBody.members"; + ((fun x + -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__1 + (fun fmt + -> + __0 + (fun fmt + -> + poly_M + fmt) fmt) + (fun fmt + -> + poly_M + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]")) + x.members; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "explicit_type"; + (Format.fprintf + fmt "%B") + x.explicit_type; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "has_unknown_members"; + (Format.fprintf + fmt "%B") + x.has_unknown_members; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__3 + (fun fmt + -> + poly_M + fmt) + (fun fmt + x -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__2 + (fun fmt + -> + poly_M + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M . + (Format.formatter + -> + 'M -> + unit) + -> + 'M t -> + string + = + fun + poly_M x + -> + Format.asprintf + "%a" + (pp + poly_M) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type ( + 'M, + 'T) t = + { + id: + ('M, + 'T) + Identifier.t + ; + body: + 'M body ; + comments: + ('M, + unit) + Syntax.t + option } + and + 'M body = + ('M * 'M + body') + and + 'M body' = + | + BooleanBody + of 'M + BooleanBody.t + + | + NumberBody + of 'M + NumberBody.t + + | + StringBody + of 'M + StringBody.t + + | + SymbolBody + of 'M + SymbolBody.t + + | + BigIntBody + of 'M + BigIntBody.t + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let _ = + fun + (_ : + 'M body) + -> () + let _ = + fun + (_ : + 'M body') + -> () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __2 + = + Syntax.pp + and __1 = + pp_body + and __0 = + Identifier.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.EnumDeclaration.id"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.id; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "body"; + (__1 + (fun fmt + -> + poly_M + fmt) fmt) + x.body; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_body + : + 'M . + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M body + -> + unit + = + ((let __0 + = + pp_body' in + (( + fun + poly_M + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_body + : + 'M . + (Format.formatter + -> + 'M -> + unit) + -> + 'M body + -> + string + = + fun + poly_M x + -> + Format.asprintf + "%a" + (pp_body + poly_M) x + [@@ocaml.warning + "-32"] + and pp_body' + : + 'M . + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M body' + -> + unit + = + ((let __4 + = + BigIntBody.pp + and __3 = + SymbolBody.pp + and __2 = + StringBody.pp + and __1 = + NumberBody.pp + and __0 = + BooleanBody.pp in + (( + fun + poly_M + fmt -> + function + | + BooleanBody + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.EnumDeclaration.BooleanBody@ "; + (__0 + (fun fmt + -> + poly_M + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + NumberBody + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.EnumDeclaration.NumberBody@ "; + (__1 + (fun fmt + -> + poly_M + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + StringBody + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.EnumDeclaration.StringBody@ "; + (__2 + (fun fmt + -> + poly_M + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + SymbolBody + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.EnumDeclaration.SymbolBody@ "; + (__3 + (fun fmt + -> + poly_M + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + BigIntBody + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.EnumDeclaration.BigIntBody@ "; + (__4 + (fun fmt + -> + poly_M + fmt) fmt) + a0; + Format.fprintf + fmt "@])")) + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_body' + : + 'M . + (Format.formatter + -> + 'M -> + unit) + -> + 'M body' + -> + string + = + fun + poly_M x + -> + Format.asprintf + "%a" + (pp_body' + poly_M) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + and _ = + pp_body + and _ = + show_body + and _ = + pp_body' + and _ = + show_body' + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module ComponentDeclaration = + struct + module RestParam = + struct + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + argument: + ('M, + 'T) + Pattern.t ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let _ = + fun + (_ : + ('M, + 'T) t') + -> () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __0 + = pp_t' in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + = + ((let __1 + = + Syntax.pp + and __0 = + Pattern.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.ComponentDeclaration.RestParam.argument"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.argument; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_t' + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + and _ = + pp_t' + and _ = + show_t' + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Param = + struct + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + name: + ('M, + 'T) + param_name + ; + local: + ('M, + 'T) + Pattern.t ; + default: + ('M, + 'T) + Expression.t + option ; + shorthand: + bool } + and ( + 'M, + 'T) param_name = + | + Identifier + of ( + 'M, + 'T) + Identifier.t + + | + StringLiteral + of ('M * + 'M + StringLiteral.t) + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let _ = + fun + (_ : + ('M, + 'T) t') + -> () + let _ = + fun + (_ : + ('M, + 'T) + param_name) + -> () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __0 + = pp_t' in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + = + ((let __2 + = + Expression.pp + and __1 = + Pattern.pp + and __0 = + pp_param_name in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.ComponentDeclaration.Param.name"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.name; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "local"; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.local; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "default"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.default; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "shorthand"; + (Format.fprintf + fmt "%B") + x.shorthand; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_t' + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_param_name + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + param_name + -> + unit + = + ((let __1 + = + StringLiteral.pp + and __0 = + Identifier.pp in + (( + fun + poly_M + poly_T + fmt -> + function + | + Identifier + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.ComponentDeclaration.Param.Identifier@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + StringLiteral + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.ComponentDeclaration.Param.StringLiteral@ "; + ((fun + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__1 + (fun fmt + -> + poly_M + fmt) fmt) + a1); + Format.fprintf + fmt "@])")) + a0; + Format.fprintf + fmt "@])")) + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_param_name + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + param_name + -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_param_name + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + and _ = + pp_t' + and _ = + show_t' + and _ = + pp_param_name + and _ = + show_param_name + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Params = + struct + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + params: + ('M, + 'T) + Param.t + list ; + rest: + ('M, + 'T) + RestParam.t + option ; + comments: + ('M, + 'M + Comment.t + list) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let _ = + fun + (_ : + ('M, + 'T) t') + -> () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __0 + = pp_t' in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + = + ((let __3 + = + Syntax.pp + and __2 = + Comment.pp + and __1 = + RestParam.pp + and __0 = + Param.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.ComponentDeclaration.Params.params"; + ((fun x + -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]")) + x.params; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "rest"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.rest; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__3 + (fun fmt + -> + poly_M + fmt) + (fun fmt + x -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__2 + (fun fmt + -> + poly_M + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_t' + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + and _ = + pp_t' + and _ = + show_t' + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type ( + 'M, + 'T) t = + { + id: + ('M, + 'T) + Identifier.t + ; + tparams: + ('M, + 'T) + Type.TypeParams.t + option ; + params: + ('M, + 'T) + Params.t ; + renders: + ('M, + 'T) + Type.component_renders_annotation + ; + body: + ('M * + ('M, + 'T) + Statement.Block.t) + ; + comments: + ('M, + unit) + Syntax.t + option ; + sig_loc: + 'M } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __5 + = + Syntax.pp + and __4 = + Statement.Block.pp + and __3 = + Type.pp_component_renders_annotation + and __2 = + Params.pp + and __1 = + Type.TypeParams.pp + and __0 = + Identifier.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.ComponentDeclaration.id"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.id; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "tparams"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.tparams; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "params"; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.params; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "renders"; + (__3 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.renders; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "body"; + ((fun + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__4 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])")) + x.body; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__5 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "sig_loc"; + (poly_M + fmt) + x.sig_loc; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Interface = + struct + type ( + 'M, + 'T) t = + { + id: + ('M, + 'T) + Identifier.t + ; + tparams: + ('M, + 'T) + Type.TypeParams.t + option ; + extends: + ('M * + ('M, + 'T) + Type.Generic.t) + list ; + body: + ('M * + ('M, + 'T) + Type.Object.t) + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __4 + = + Syntax.pp + and __3 = + Type.Object.pp + and __2 = + Type.Generic.pp + and __1 = + Type.TypeParams.pp + and __0 = + Identifier.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.Interface.id"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.id; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "tparams"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.tparams; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "extends"; + ((fun x + -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + ((fun + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])")) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]")) + x.extends; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "body"; + ((fun + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__3 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])")) + x.body; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__4 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module DeclareClass = + struct + type ( + 'M, + 'T) t = + { + id: + ('M, + 'T) + Identifier.t + ; + tparams: + ('M, + 'T) + Type.TypeParams.t + option ; + body: + ('M * + ('M, + 'T) + Type.Object.t) + ; + extends: + ('M * + ('M, + 'T) + Type.Generic.t) + option ; + mixins: + ('M * + ('M, + 'T) + Type.Generic.t) + list ; + implements: + ('M, + 'T) + Class.Implements.t + option ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __6 + = + Syntax.pp + and __5 = + Class.Implements.pp + and __4 = + Type.Generic.pp + and __3 = + Type.Generic.pp + and __2 = + Type.Object.pp + and __1 = + Type.TypeParams.pp + and __0 = + Identifier.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.DeclareClass.id"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.id; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "tparams"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.tparams; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "body"; + ((fun + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])")) + x.body; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "extends"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + ((fun + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__3 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])")) + x; + Format.pp_print_string + fmt ")"))) + x.extends; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "mixins"; + ((fun x + -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + ((fun + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__4 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])")) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]")) + x.mixins; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "implements"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__5 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.implements; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__6 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module DeclareComponent = + struct + type ( + 'M, + 'T) t = + { + id: + ('M, + 'T) + Identifier.t + ; + tparams: + ('M, + 'T) + Type.TypeParams.t + option ; + params: + ('M, + 'T) + Type.Component.Params.t + ; + renders: + ('M, + 'T) + Type.component_renders_annotation + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __4 + = + Syntax.pp + and __3 = + Type.pp_component_renders_annotation + and __2 = + Type.Component.Params.pp + and __1 = + Type.TypeParams.pp + and __0 = + Identifier.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.DeclareComponent.id"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.id; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "tparams"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.tparams; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "params"; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.params; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "renders"; + (__3 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.renders; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__4 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module DeclareVariable = + struct + type ( + 'M, + 'T) t = + { + id: + ('M, + 'T) + Identifier.t + ; + annot: + ('M, + 'T) + Type.annotation + ; + kind: + Variable.kind + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __3 + = + Syntax.pp + and __2 = + Variable.pp_kind + and __1 = + Type.pp_annotation + and __0 = + Identifier.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.DeclareVariable.id"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.id; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "annot"; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.annot; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "kind"; + (__2 fmt) + x.kind; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__3 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module DeclareFunction = + struct + type ( + 'M, + 'T) t = + { + id: + ('M, + 'T) + Identifier.t + ; + annot: + ('M, + 'T) + Type.annotation + ; + predicate: + ('M, + 'T) + Type.Predicate.t + option ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __3 + = + Syntax.pp + and __2 = + Type.Predicate.pp + and __1 = + Type.pp_annotation + and __0 = + Identifier.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.DeclareFunction.id"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.id; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "annot"; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.annot; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "predicate"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.predicate; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__3 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module DeclareModule = + struct + type ( + 'M, + 'T) id = + | + Identifier + of ( + 'M, + 'T) + Identifier.t + + | Literal + of ('T * + 'M + StringLiteral.t) + + and ( + 'M, + 'T) t = + { + id: + ('M, + 'T) id ; + body: + ('M * + ('M, + 'T) + Block.t) ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) id) + -> () + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp_id + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) id -> + unit + = + ((let __1 + = + StringLiteral.pp + and __0 = + Identifier.pp in + (( + fun + poly_M + poly_T + fmt -> + function + | + Identifier + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.DeclareModule.Identifier@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Literal + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.DeclareModule.Literal@ "; + ((fun + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_T + fmt) a0; + Format.fprintf + fmt ",@ "; + (__1 + (fun fmt + -> + poly_M + fmt) fmt) + a1); + Format.fprintf + fmt "@])")) + a0; + Format.fprintf + fmt "@])")) + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_id + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) id -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_id + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __2 + = + Syntax.pp + and __1 = + Block.pp + and __0 = + pp_id in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.DeclareModule.id"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.id; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "body"; + ((fun + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])")) + x.body; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp_id + and _ = + show_id + and _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module DeclareModuleExports = + struct + type ( + 'M, + 'T) t = + { + annot: + ('M, + 'T) + Type.annotation + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __1 + = + Syntax.pp + and __0 = + Type.pp_annotation in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.DeclareModuleExports.annot"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.annot; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module DeclareNamespace = + struct + type ( + 'M, + 'T) id = + | Global + of ( + 'M, + 'M) + Identifier.t + + | Local + of ( + 'M, + 'T) + Identifier.t + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) id) + -> () + let rec pp_id + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) id -> + unit + = + ((let __1 + = + Identifier.pp + and __0 = + Identifier.pp in + (( + fun + poly_M + poly_T + fmt -> + function + | + Global a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.DeclareNamespace.Global@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_M + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Local a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.DeclareNamespace.Local@ "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])")) + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_id + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) id -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_id + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp_id + and _ = + show_id + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + type ( + 'M, + 'T) t = + { + id: + ('M, + 'T) id ; + body: + ('M * + ('M, + 'T) + Block.t) ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __2 + = + Syntax.pp + and __1 = + Block.pp + and __0 = + pp_id in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.DeclareNamespace.id"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.id; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "body"; + ((fun + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])")) + x.body; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module ExportNamedDeclaration = + struct + module ExportSpecifier = + struct + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + local: + ('M, + 'T) + Identifier.t + ; + exported: + ('M, + 'T) + Identifier.t + option ; + from_remote: + bool ; + imported_name_def_loc: + 'M option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let _ = + fun + (_ : + ('M, + 'T) t') + -> () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __0 + = pp_t' in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + = + ((let __1 + = + Identifier.pp + and __0 = + Identifier.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.ExportNamedDeclaration.ExportSpecifier.local"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.local; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "exported"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.exported; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "from_remote"; + (Format.fprintf + fmt "%B") + x.from_remote; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "imported_name_def_loc"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (poly_M + fmt) x; + Format.pp_print_string + fmt ")"))) + x.imported_name_def_loc; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_t' + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + and _ = + pp_t' + and _ = + show_t' + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module ExportBatchSpecifier = + struct + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) + Identifier.t + option) + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __0 + = + Identifier.pp in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type ( + 'M, + 'T) t = + { + declaration: + ('M, + 'T) + Statement.t + option ; + specifiers: + ('M, + 'T) + specifier + option ; + source: + ('T * 'M + StringLiteral.t) + option ; + export_kind: + Statement.export_kind + ; + comments: + ('M, + unit) + Syntax.t + option } + and ( + 'M, + 'T) specifier = + | + ExportSpecifiers + of ( + 'M, + 'T) + ExportSpecifier.t + list + | + ExportBatchSpecifier + of ( + 'M, + 'T) + ExportBatchSpecifier.t + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let _ = + fun + (_ : + ('M, + 'T) + specifier) + -> () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __4 + = + Syntax.pp + and __3 = + Statement.pp_export_kind + and __2 = + StringLiteral.pp + and __1 = + pp_specifier + and __0 = + Statement.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.ExportNamedDeclaration.declaration"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.declaration; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "specifiers"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.specifiers; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "source"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + ((fun + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_T + fmt) a0; + Format.fprintf + fmt ",@ "; + (__2 + (fun fmt + -> + poly_M + fmt) fmt) + a1); + Format.fprintf + fmt "@])")) + x; + Format.pp_print_string + fmt ")"))) + x.source; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "export_kind"; + (__3 fmt) + x.export_kind; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__4 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_specifier + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + specifier + -> + unit + = + ((let __1 + = + ExportBatchSpecifier.pp + and __0 = + ExportSpecifier.pp in + (( + fun + poly_M + poly_T + fmt -> + function + | + ExportSpecifiers + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.ExportNamedDeclaration.ExportSpecifiers@ "; + ((fun x + -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]")) + a0; + Format.fprintf + fmt "@])") + | + ExportBatchSpecifier + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.ExportNamedDeclaration.ExportBatchSpecifier@ "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])")) + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_specifier + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + specifier + -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_specifier + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + and _ = + pp_specifier + and _ = + show_specifier + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module ExportDefaultDeclaration = + struct + type ( + 'M, + 'T) t = + { + default: + 'T ; + declaration: + ('M, + 'T) + declaration + ; + comments: + ('M, + unit) + Syntax.t + option } + and ( + 'M, + 'T) declaration = + | + Declaration + of ( + 'M, + 'T) + Statement.t + + | + Expression + of ( + 'M, + 'T) + Expression.t + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let _ = + fun + (_ : + ('M, + 'T) + declaration) + -> () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __1 + = + Syntax.pp + and __0 = + pp_declaration in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.ExportDefaultDeclaration.default"; + (poly_T + fmt) + x.default; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "declaration"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.declaration; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_declaration + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + declaration + -> + unit + = + ((let __1 + = + Expression.pp + and __0 = + Statement.pp in + (( + fun + poly_M + poly_T + fmt -> + function + | + Declaration + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.ExportDefaultDeclaration.Declaration@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Expression + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.ExportDefaultDeclaration.Expression@ "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])")) + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_declaration + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + declaration + -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_declaration + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + and _ = + pp_declaration + and _ = + show_declaration + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module DeclareExportDeclaration = + struct + type ( + 'M, + 'T) declaration = + | + Variable + of ('M * + ('M, + 'T) + DeclareVariable.t) + + | + Function + of ('M * + ('M, + 'T) + DeclareFunction.t) + + | Class + of ('M * + ('M, + 'T) + DeclareClass.t) + + | + Component + of ('M * + ('M, + 'T) + DeclareComponent.t) + + | + DefaultType + of ( + 'M, + 'T) + Type.t + | + NamedType + of ('M * + ('M, + 'T) + TypeAlias.t) + + | + NamedOpaqueType + of ('M * + ('M, + 'T) + OpaqueType.t) + + | + Interface + of ('M * + ('M, + 'T) + Interface.t) + + | Enum of + ('M * + ('M, + 'T) + EnumDeclaration.t) + + and ( + 'M, + 'T) t = + { + default: + 'M option ; + declaration: + ('M, + 'T) + declaration + option ; + specifiers: + ('M, + 'T) + ExportNamedDeclaration.specifier + option ; + source: + ('T * 'M + StringLiteral.t) + option ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) + declaration) + -> () + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp_declaration + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + declaration + -> + unit + = + ((let __8 + = + EnumDeclaration.pp + and __7 = + Interface.pp + and __6 = + OpaqueType.pp + and __5 = + TypeAlias.pp + and __4 = + Type.pp + and __3 = + DeclareComponent.pp + and __2 = + DeclareClass.pp + and __1 = + DeclareFunction.pp + and __0 = + DeclareVariable.pp in + (( + fun + poly_M + poly_T + fmt -> + function + | + Variable + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.DeclareExportDeclaration.Variable@ "; + ((fun + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])")) + a0; + Format.fprintf + fmt "@])") + | + Function + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.DeclareExportDeclaration.Function@ "; + ((fun + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])")) + a0; + Format.fprintf + fmt "@])") + | + Class a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.DeclareExportDeclaration.Class@ "; + ((fun + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])")) + a0; + Format.fprintf + fmt "@])") + | + Component + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.DeclareExportDeclaration.Component@ "; + ((fun + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__3 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])")) + a0; + Format.fprintf + fmt "@])") + | + DefaultType + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.DeclareExportDeclaration.DefaultType@ "; + (__4 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + NamedType + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.DeclareExportDeclaration.NamedType@ "; + ((fun + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__5 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])")) + a0; + Format.fprintf + fmt "@])") + | + NamedOpaqueType + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.DeclareExportDeclaration.NamedOpaqueType@ "; + ((fun + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__6 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])")) + a0; + Format.fprintf + fmt "@])") + | + Interface + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.DeclareExportDeclaration.Interface@ "; + ((fun + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__7 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])")) + a0; + Format.fprintf + fmt "@])") + | + Enum a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.DeclareExportDeclaration.Enum@ "; + ((fun + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__8 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])")) + a0; + Format.fprintf + fmt "@])")) + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_declaration + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + declaration + -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_declaration + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __3 + = + Syntax.pp + and __2 = + StringLiteral.pp + and __1 = + ExportNamedDeclaration.pp_specifier + and __0 = + pp_declaration in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.DeclareExportDeclaration.default"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (poly_M + fmt) x; + Format.pp_print_string + fmt ")"))) + x.default; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "declaration"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.declaration; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "specifiers"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.specifiers; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "source"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + ((fun + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_T + fmt) a0; + Format.fprintf + fmt ",@ "; + (__2 + (fun fmt + -> + poly_M + fmt) fmt) + a1); + Format.fprintf + fmt "@])")) + x; + Format.pp_print_string + fmt ")"))) + x.source; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__3 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp_declaration + and _ = + show_declaration + and _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module ImportDeclaration = + struct + type import_kind = + | + ImportType + + | + ImportTypeof + + | + ImportValue + + and ( + 'M, + 'T) specifier = + | + ImportNamedSpecifiers + of ( + 'M, + 'T) + named_specifier + list + | + ImportNamespaceSpecifier + of ('M * + ('M, + 'T) + Identifier.t) + + and ( + 'M, + 'T) named_specifier = + { + kind: + import_kind + option ; + local: + ('M, + 'T) + Identifier.t + option ; + remote: + ('M, + 'T) + Identifier.t + ; + remote_name_def_loc: + 'M option } + and ( + 'M, + 'T) default_identifier = + { + identifier: + ('M, + 'T) + Identifier.t + ; + remote_default_name_def_loc: + 'M option } + and ( + 'M, + 'T) t = + { + import_kind: + import_kind + ; + source: + ('T * 'M + StringLiteral.t) + ; + default: + ('M, + 'T) + default_identifier + option ; + specifiers: + ('M, + 'T) + specifier + option ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + import_kind) + -> () + let _ = + fun + (_ : + ('M, + 'T) + specifier) + -> () + let _ = + fun + (_ : + ('M, + 'T) + named_specifier) + -> () + let _ = + fun + (_ : + ('M, + 'T) + default_identifier) + -> () + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp_import_kind + : + Format.formatter + -> + import_kind + -> + unit + = + (( + fun fmt + -> + function + | + ImportType + -> + Format.pp_print_string + fmt + "Flow_ast.Statement.ImportDeclaration.ImportType" + | + ImportTypeof + -> + Format.pp_print_string + fmt + "Flow_ast.Statement.ImportDeclaration.ImportTypeof" + | + ImportValue + -> + Format.pp_print_string + fmt + "Flow_ast.Statement.ImportDeclaration.ImportValue") + [@ocaml.warning + "-39"] + [@ocaml.warning + "-A"]) + and show_import_kind + : + import_kind + -> + string + = + fun x -> + Format.asprintf + "%a" + pp_import_kind + x + [@@ocaml.warning + "-32"] + and pp_specifier + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + specifier + -> + unit + = + ((let __1 + = + Identifier.pp + and __0 = + pp_named_specifier in + (( + fun + poly_M + poly_T + fmt -> + function + | + ImportNamedSpecifiers + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.ImportDeclaration.ImportNamedSpecifiers@ "; + ((fun x + -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]")) + a0; + Format.fprintf + fmt "@])") + | + ImportNamespaceSpecifier + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.ImportDeclaration.ImportNamespaceSpecifier@ "; + ((fun + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])")) + a0; + Format.fprintf + fmt "@])")) + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_specifier + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + specifier + -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_specifier + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_named_specifier + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + named_specifier + -> + unit + = + ((let __2 + = + Identifier.pp + and __1 = + Identifier.pp + and __0 = + pp_import_kind in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.ImportDeclaration.kind"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__0 fmt) + x; + Format.pp_print_string + fmt ")"))) + x.kind; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "local"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.local; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "remote"; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.remote; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "remote_name_def_loc"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (poly_M + fmt) x; + Format.pp_print_string + fmt ")"))) + x.remote_name_def_loc; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_named_specifier + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + named_specifier + -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_named_specifier + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_default_identifier + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + default_identifier + -> + unit + = + ((let __0 + = + Identifier.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.ImportDeclaration.identifier"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.identifier; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "remote_default_name_def_loc"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (poly_M + fmt) x; + Format.pp_print_string + fmt ")"))) + x.remote_default_name_def_loc; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_default_identifier + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + default_identifier + -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_default_identifier + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __4 + = + Syntax.pp + and __3 = + pp_specifier + and __2 = + pp_default_identifier + and __1 = + StringLiteral.pp + and __0 = + pp_import_kind in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.ImportDeclaration.import_kind"; + (__0 fmt) + x.import_kind; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "source"; + ((fun + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_T + fmt) a0; + Format.fprintf + fmt ",@ "; + (__1 + (fun fmt + -> + poly_M + fmt) fmt) + a1); + Format.fprintf + fmt "@])")) + x.source; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "default"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.default; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "specifiers"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__3 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.specifiers; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__4 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp_import_kind + and _ = + show_import_kind + and _ = + pp_specifier + and _ = + show_specifier + and _ = + pp_named_specifier + and _ = + show_named_specifier + and _ = + pp_default_identifier + and _ = + show_default_identifier + and _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Expression = + struct + type ( + 'M, + 'T) t = + { + expression: + ('M, + 'T) + Expression.t + ; + directive: + string + option ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __1 + = + Syntax.pp + and __0 = + Expression.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.Expression.expression"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.expression; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "directive"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (Format.fprintf + fmt "%S") + x; + Format.pp_print_string + fmt ")"))) + x.directive; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Empty = + struct + type + 'M t = + { + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + 'M t) -> + () + let rec pp + : + 'M . + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M t -> + unit + = + ((let __0 + = + Syntax.pp in + (( + fun + poly_M + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Statement.Empty.comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M . + (Format.formatter + -> + 'M -> + unit) + -> + 'M t -> + string + = + fun + poly_M x + -> + Format.asprintf + "%a" + (pp + poly_M) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type export_kind = + | + ExportType + + | + ExportValue + and ( + 'M, + 'T) t = + ('M * ( + 'M, + 'T) t') + and ( + 'M, + 'T) t' = + | Block of + ('M, + 'T) Block.t + + | Break of + 'M Break.t + + | + ClassDeclaration + of ( + 'M, + 'T) Class.t + + | + ComponentDeclaration + of ( + 'M, + 'T) + ComponentDeclaration.t + + | Continue + of 'M + Continue.t + + | Debugger + of 'M + Debugger.t + + | + DeclareClass + of ( + 'M, + 'T) + DeclareClass.t + + | + DeclareComponent + of ( + 'M, + 'T) + DeclareComponent.t + + | + DeclareEnum + of ( + 'M, + 'T) + EnumDeclaration.t + + | + DeclareExportDeclaration + of ( + 'M, + 'T) + DeclareExportDeclaration.t + + | + DeclareFunction + of ( + 'M, + 'T) + DeclareFunction.t + + | + DeclareInterface + of ( + 'M, + 'T) + Interface.t + + | + DeclareModule + of ( + 'M, + 'T) + DeclareModule.t + + | + DeclareModuleExports + of ( + 'M, + 'T) + DeclareModuleExports.t + + | + DeclareNamespace + of ( + 'M, + 'T) + DeclareNamespace.t + + | + DeclareTypeAlias + of ( + 'M, + 'T) + TypeAlias.t + + | + DeclareOpaqueType + of ( + 'M, + 'T) + OpaqueType.t + + | + DeclareVariable + of ( + 'M, + 'T) + DeclareVariable.t + + | DoWhile + of ( + 'M, + 'T) + DoWhile.t + | Empty of + 'M Empty.t + + | + EnumDeclaration + of ( + 'M, + 'T) + EnumDeclaration.t + + | + ExportDefaultDeclaration + of ( + 'M, + 'T) + ExportDefaultDeclaration.t + + | + ExportNamedDeclaration + of ( + 'M, + 'T) + ExportNamedDeclaration.t + + | + Expression + of ( + 'M, + 'T) + Expression.t + + | For of + ('M, + 'T) For.t + | ForIn of + ('M, + 'T) ForIn.t + + | ForOf of + ('M, + 'T) ForOf.t + + | + FunctionDeclaration + of ( + 'M, + 'T) + Function.t + + | If of + ('M, + 'T) If.t + | + ImportDeclaration + of ( + 'M, + 'T) + ImportDeclaration.t + + | + InterfaceDeclaration + of ( + 'M, + 'T) + Interface.t + + | Labeled + of ( + 'M, + 'T) + Labeled.t + | Match of + ('M, + 'T) + match_statement + + | Return of + ('M, + 'T) + Return.t + | Switch of + ('M, + 'T) + Switch.t + | Throw of + ('M, + 'T) Throw.t + + | Try of + ('M, + 'T) Try.t + | TypeAlias + of ( + 'M, + 'T) + TypeAlias.t + + | + OpaqueType + of ( + 'M, + 'T) + OpaqueType.t + + | + VariableDeclaration + of ( + 'M, + 'T) + VariableDeclaration.t + + | While of + ('M, + 'T) While.t + + | With of + ('M, + 'T) With.t + [@@deriving + show] + include + struct + let _ = + fun + (_ : + export_kind) + -> () + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let _ = + fun + (_ : + ('M, + 'T) t') + -> () + let rec pp_export_kind + : + Format.formatter + -> + export_kind + -> + unit + = + (( + fun fmt + -> + function + | + ExportType + -> + Format.pp_print_string + fmt + "Flow_ast.Statement.ExportType" + | + ExportValue + -> + Format.pp_print_string + fmt + "Flow_ast.Statement.ExportValue") + [@ocaml.warning + "-39"] + [@ocaml.warning + "-A"]) + and show_export_kind + : + export_kind + -> + string + = + fun x -> + Format.asprintf + "%a" + pp_export_kind + x + [@@ocaml.warning + "-32"] + and pp : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __0 + = pp_t' in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + = + ((let __41 + = With.pp + and __40 + = + While.pp + and __39 + = + VariableDeclaration.pp + and __38 + = + OpaqueType.pp + and __37 + = + TypeAlias.pp + and __36 + = Try.pp + and __35 + = + Throw.pp + and __34 + = + Switch.pp + and __33 + = + Return.pp + and __32 + = + pp_match_statement + and __31 + = + Labeled.pp + and __30 + = + Interface.pp + and __29 + = + ImportDeclaration.pp + and __28 + = If.pp + and __27 + = + Function.pp + and __26 + = + ForOf.pp + and __25 + = + ForIn.pp + and __24 + = For.pp + and __23 + = + Expression.pp + and __22 + = + ExportNamedDeclaration.pp + and __21 + = + ExportDefaultDeclaration.pp + and __20 + = + EnumDeclaration.pp + and __19 + = + Empty.pp + and __18 + = + DoWhile.pp + and __17 + = + DeclareVariable.pp + and __16 + = + OpaqueType.pp + and __15 + = + TypeAlias.pp + and __14 + = + DeclareNamespace.pp + and __13 + = + DeclareModuleExports.pp + and __12 + = + DeclareModule.pp + and __11 + = + Interface.pp + and __10 + = + DeclareFunction.pp + and __9 = + DeclareExportDeclaration.pp + and __8 = + EnumDeclaration.pp + and __7 = + DeclareComponent.pp + and __6 = + DeclareClass.pp + and __5 = + Debugger.pp + and __4 = + Continue.pp + and __3 = + ComponentDeclaration.pp + and __2 = + Class.pp + and __1 = + Break.pp + and __0 = + Block.pp in + (( + fun + poly_M + poly_T + fmt -> + function + | + Block a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.Block@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Break a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.Break@ "; + (__1 + (fun fmt + -> + poly_M + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + ClassDeclaration + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.ClassDeclaration@ "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + ComponentDeclaration + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.ComponentDeclaration@ "; + (__3 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Continue + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.Continue@ "; + (__4 + (fun fmt + -> + poly_M + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Debugger + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.Debugger@ "; + (__5 + (fun fmt + -> + poly_M + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + DeclareClass + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.DeclareClass@ "; + (__6 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + DeclareComponent + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.DeclareComponent@ "; + (__7 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + DeclareEnum + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.DeclareEnum@ "; + (__8 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + DeclareExportDeclaration + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.DeclareExportDeclaration@ "; + (__9 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + DeclareFunction + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.DeclareFunction@ "; + (__10 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + DeclareInterface + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.DeclareInterface@ "; + (__11 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + DeclareModule + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.DeclareModule@ "; + (__12 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + DeclareModuleExports + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.DeclareModuleExports@ "; + (__13 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + DeclareNamespace + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.DeclareNamespace@ "; + (__14 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + DeclareTypeAlias + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.DeclareTypeAlias@ "; + (__15 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + DeclareOpaqueType + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.DeclareOpaqueType@ "; + (__16 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + DeclareVariable + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.DeclareVariable@ "; + (__17 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + DoWhile + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.DoWhile@ "; + (__18 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Empty a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.Empty@ "; + (__19 + (fun fmt + -> + poly_M + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + EnumDeclaration + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.EnumDeclaration@ "; + (__20 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + ExportDefaultDeclaration + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.ExportDefaultDeclaration@ "; + (__21 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + ExportNamedDeclaration + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.ExportNamedDeclaration@ "; + (__22 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Expression + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.Expression@ "; + (__23 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + For a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.For@ "; + (__24 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + ForIn a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.ForIn@ "; + (__25 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + ForOf a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.ForOf@ "; + (__26 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + FunctionDeclaration + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.FunctionDeclaration@ "; + (__27 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + If a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.If@ "; + (__28 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + ImportDeclaration + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.ImportDeclaration@ "; + (__29 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + InterfaceDeclaration + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.InterfaceDeclaration@ "; + (__30 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Labeled + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.Labeled@ "; + (__31 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Match a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.Match@ "; + (__32 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Return a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.Return@ "; + (__33 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Switch a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.Switch@ "; + (__34 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Throw a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.Throw@ "; + (__35 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Try a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.Try@ "; + (__36 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + TypeAlias + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.TypeAlias@ "; + (__37 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + OpaqueType + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.OpaqueType@ "; + (__38 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + VariableDeclaration + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.VariableDeclaration@ "; + (__39 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + While a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.While@ "; + (__40 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + With a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Statement.With@ "; + (__41 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])")) + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_t' + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp_export_kind + and _ = + show_export_kind + and _ = + pp + and _ = + show + and _ = + pp_t' + and _ = + show_t' + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end and + Expression: + sig + module + CallTypeArg + : + sig + module + Implicit + : + sig + type ( + 'M, + 'T) t = + ('T * 'M + t') + and + 'M t' = + { + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val pp_t' + : + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M t' -> + unit + val + show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + 'M t' -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type ( + 'M, + 'T) t = + | + Explicit + of ( + 'M, + 'T) + Type.t + | + Implicit + of ( + 'M, + 'T) + Implicit.t + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + CallTypeArgs + : + sig + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + arguments: + ('M, + 'T) + CallTypeArg.t + list ; + comments: + ('M, + 'M + Comment.t + list) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val pp_t' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + val + show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + SpreadElement + : + sig + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + argument: + ('M, + 'T) + Expression.t + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val pp_t' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + val + show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + Array : + sig + type ( + 'M, + 'T) element = + | + Expression + of ( + 'M, + 'T) + Expression.t + + | Spread + of ( + 'M, + 'T) + SpreadElement.t + + | Hole of + 'M + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val + pp_element + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + element + -> + unit + val + show_element + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + element + -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + type ( + 'M, + 'T) t = + { + elements: + ('M, + 'T) + element + list ; + comments: + ('M, + 'M + Comment.t + list) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + TemplateLiteral + : + sig + module + Element : + sig + type value = + { + raw: + string ; + cooked: + string } + and + 'M t = + ('M * t') + and t' = + { + value: + value ; + tail: + bool } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val + pp_value + : + Format.formatter + -> + value -> + unit + val + show_value + : + value -> + string + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + 'M t -> + string + val pp_t' + : + Format.formatter + -> + t' -> + unit + val + show_t' : + t' -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type ( + 'M, + 'T) t = + { + quasis: + 'M + Element.t + list ; + expressions: + ('M, + 'T) + Expression.t + list ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + TaggedTemplate + : + sig + type ( + 'M, + 'T) t = + { + tag: + ('M, + 'T) + Expression.t + ; + quasi: + ('M * + ('M, + 'T) + TemplateLiteral.t) + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + Object : + sig + module + Property + : + sig + type ( + 'M, + 'T) key = + | + StringLiteral + of ('T * + 'M + StringLiteral.t) + + | + NumberLiteral + of ('T * + 'M + NumberLiteral.t) + + | + BigIntLiteral + of ('T * + 'M + BigIntLiteral.t) + + | + Identifier + of ( + 'M, + 'T) + Identifier.t + + | + PrivateName + of 'M + PrivateName.t + + | + Computed + of ( + 'M, + 'T) + ComputedKey.t + + and ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + | Init of + { + key: + ('M, + 'T) key ; + value: + ('M, + 'T) + Expression.t + ; + shorthand: + bool } + | Method + of + { + key: + ('M, + 'T) key ; + value: + ('M * + ('M, + 'T) + Function.t) + } + | Get of + { + key: + ('M, + 'T) key ; + value: + ('M * + ('M, + 'T) + Function.t) + ; + comments: + ('M, + unit) + Syntax.t + option } + + | Set of + { + key: + ('M, + 'T) key ; + value: + ('M * + ('M, + 'T) + Function.t) + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val + pp_key : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) key + -> + unit + val + show_key + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) key + -> + string + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val pp_t' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + val + show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + SpreadProperty + : + sig + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + argument: + ('M, + 'T) + Expression.t + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val pp_t' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + val + show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type ( + 'M, + 'T) property = + | + Property + of ( + 'M, + 'T) + Property.t + + | + SpreadProperty + of ( + 'M, + 'T) + SpreadProperty.t + + and ( + 'M, + 'T) t = + { + properties: + ('M, + 'T) + property + list ; + comments: + ('M, + 'M + Comment.t + list) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val + pp_property + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + property + -> + unit + val + show_property + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + property + -> + string + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + Sequence + : + sig + type ( + 'M, + 'T) t = + { + expressions: + ('M, + 'T) + Expression.t + list ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + Unary : + sig + type operator = + | Minus + | Plus + | Not + | BitNot + + | Typeof + + | Void + | Delete + + | Await + and ( + 'M, + 'T) t = + { + operator: + operator ; + argument: + ('M, + 'T) + Expression.t + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val + pp_operator + : + Format.formatter + -> + operator + -> + unit + val + show_operator + : + operator + -> + string + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + Binary : + sig + type operator = + | Equal + | + NotEqual + + | + StrictEqual + + | + StrictNotEqual + + | + LessThan + + | + LessThanEqual + + | + GreaterThan + + | + GreaterThanEqual + + | LShift + + | RShift + + | RShift3 + + | Plus + | Minus + | Mult + | Exp + | Div + | Mod + | BitOr + | Xor + | BitAnd + + | In + | + Instanceof + + and ( + 'M, + 'T) t = + { + operator: + operator ; + left: + ('M, + 'T) + Expression.t + ; + right: + ('M, + 'T) + Expression.t + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val + pp_operator + : + Format.formatter + -> + operator + -> + unit + val + show_operator + : + operator + -> + string + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + Assignment + : + sig + type operator = + | + PlusAssign + + | + MinusAssign + + | + MultAssign + + | + ExpAssign + + | + DivAssign + + | + ModAssign + + | + LShiftAssign + + | + RShiftAssign + + | + RShift3Assign + + | + BitOrAssign + + | + BitXorAssign + + | + BitAndAssign + + | + NullishAssign + + | + AndAssign + + | + OrAssign + and ( + 'M, + 'T) t = + { + operator: + operator + option ; + left: + ('M, + 'T) + Pattern.t ; + right: + ('M, + 'T) + Expression.t + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val + pp_operator + : + Format.formatter + -> + operator + -> + unit + val + show_operator + : + operator + -> + string + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + Update : + sig + type operator = + | + Increment + + | + Decrement + and ( + 'M, + 'T) t = + { + operator: + operator ; + argument: + ('M, + 'T) + Expression.t + ; + prefix: + bool ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val + pp_operator + : + Format.formatter + -> + operator + -> + unit + val + show_operator + : + operator + -> + string + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + Logical : + sig + type operator = + | Or + | And + | + NullishCoalesce + + and ( + 'M, + 'T) t = + { + operator: + operator ; + left: + ('M, + 'T) + Expression.t + ; + right: + ('M, + 'T) + Expression.t + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val + pp_operator + : + Format.formatter + -> + operator + -> + unit + val + show_operator + : + operator + -> + string + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + Conditional + : + sig + type ( + 'M, + 'T) t = + { + test: + ('M, + 'T) + Expression.t + ; + consequent: + ('M, + 'T) + Expression.t + ; + alternate: + ('M, + 'T) + Expression.t + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type ( + 'M, + 'T) expression_or_spread = + | + Expression + of ( + 'M, + 'T) + Expression.t + + | Spread + of ( + 'M, + 'T) + SpreadElement.t + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val + pp_expression_or_spread + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + expression_or_spread + -> + unit + val + show_expression_or_spread + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + expression_or_spread + -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + module + ArgList : + sig + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + arguments: + ('M, + 'T) + expression_or_spread + list ; + comments: + ('M, + 'M + Comment.t + list) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val pp_t' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + val + show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + New : + sig + type ( + 'M, + 'T) t = + { + callee: + ('M, + 'T) + Expression.t + ; + targs: + ('M, + 'T) + Expression.CallTypeArgs.t + option ; + arguments: + ('M, + 'T) + ArgList.t + option ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + Call : + sig + type ( + 'M, + 'T) t = + { + callee: + ('M, + 'T) + Expression.t + ; + targs: + ('M, + 'T) + Expression.CallTypeArgs.t + option ; + arguments: + ('M, + 'T) + ArgList.t ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + OptionalCall + : + sig + type ( + 'M, + 'T) t = + { + call: + ('M, + 'T) + Call.t ; + filtered_out: + 'T ; + optional: + bool } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + Member : + sig + type ( + 'M, + 'T) property = + | + PropertyIdentifier + of ( + 'M, + 'T) + Identifier.t + + | + PropertyPrivateName + of 'M + PrivateName.t + + | + PropertyExpression + of ( + 'M, + 'T) + Expression.t + + and ( + 'M, + 'T) t = + { + _object: + ('M, + 'T) + Expression.t + ; + property: + ('M, + 'T) + property ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val + pp_property + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + property + -> + unit + val + show_property + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + property + -> + string + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + OptionalMember + : + sig + type ( + 'M, + 'T) t = + { + member: + ('M, + 'T) + Member.t ; + filtered_out: + 'T ; + optional: + bool } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + Yield : + sig + type ( + 'M, + 'T) t = + { + argument: + ('M, + 'T) + Expression.t + option ; + comments: + ('M, + unit) + Syntax.t + option ; + delegate: + bool ; + result_out: + 'T } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + TypeCast + : + sig + type ( + 'M, + 'T) t = + { + expression: + ('M, + 'T) + Expression.t + ; + annot: + ('M, + 'T) + Type.annotation + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + AsExpression + : + sig + type ( + 'M, + 'T) t = + { + expression: + ('M, + 'T) + Expression.t + ; + annot: + ('M, + 'T) + Type.annotation + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + AsConstExpression + : + sig + type ( + 'M, + 'T) t = + { + expression: + ('M, + 'T) + Expression.t + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + TSSatisfies + : + sig + type ( + 'M, + 'T) t = + { + expression: + ('M, + 'T) + Expression.t + ; + annot: + ('M, + 'T) + Type.annotation + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + MetaProperty + : + sig + type + 'M t = + { + meta: + ('M, + 'M) + Identifier.t + ; + property: + ('M, + 'M) + Identifier.t + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + 'M t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + This : + sig + type + 'M t = + { + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + 'M t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + Super : + sig + type + 'M t = + { + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + 'M t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module + Import : + sig + type ( + 'M, + 'T) t = + { + argument: + ('M, + 'T) + Expression.t + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type ( + 'M, + 'T) match_expression = + ('M, + 'T, + ('M, + 'T) + Expression.t) + Match.t + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val + pp_match_expression + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + match_expression + -> + unit + val + show_match_expression + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + match_expression + -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + type ( + 'M, + 'T) t = + ('T * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + | Array + of ( + 'M, + 'T) + Array.t + | + ArrowFunction + of ( + 'M, + 'T) + Function.t + + | + AsConstExpression + of ( + 'M, + 'T) + AsConstExpression.t + + | + AsExpression + of ( + 'M, + 'T) + AsExpression.t + + | + Assignment + of ( + 'M, + 'T) + Assignment.t + + | Binary + of ( + 'M, + 'T) + Binary.t + + | Call of + ('M, + 'T) + Call.t + | Class + of ( + 'M, + 'T) + Class.t + | + Conditional + of ( + 'M, + 'T) + Conditional.t + + | + Function + of ( + 'M, + 'T) + Function.t + + | + Identifier + of ( + 'M, + 'T) + Identifier.t + + | Import + of ( + 'M, + 'T) + Import.t + + | + JSXElement + of ( + 'M, + 'T) + JSX.element + + | + JSXFragment + of ( + 'M, + 'T) + JSX.fragment + + | + StringLiteral + of 'M + StringLiteral.t + + | + BooleanLiteral + of 'M + BooleanLiteral.t + + | + NullLiteral + of ( + 'M, + unit) + Syntax.t + option + | + NumberLiteral + of 'M + NumberLiteral.t + + | + BigIntLiteral + of 'M + BigIntLiteral.t + + | + RegExpLiteral + of 'M + RegExpLiteral.t + + | + ModuleRefLiteral + of ( + 'M, + 'T) + ModuleRefLiteral.t + + | Logical + of ( + 'M, + 'T) + Logical.t + + | Match + of ( + 'M, + 'T) + match_expression + + | Member + of ( + 'M, + 'T) + Member.t + + | + MetaProperty + of 'M + MetaProperty.t + + | New of + ('M, + 'T) New.t + + | Object + of ( + 'M, + 'T) + Object.t + + | + OptionalCall + of ( + 'M, + 'T) + OptionalCall.t + + | + OptionalMember + of ( + 'M, + 'T) + OptionalMember.t + + | + Sequence + of ( + 'M, + 'T) + Sequence.t + + | Super + of 'M + Super.t + | + TaggedTemplate + of ( + 'M, + 'T) + TaggedTemplate.t + + | + TemplateLiteral + of ( + 'M, + 'T) + TemplateLiteral.t + + | This of + 'M This.t + + | + TypeCast + of ( + 'M, + 'T) + TypeCast.t + + | + TSSatisfies + of ( + 'M, + 'T) + TSSatisfies.t + + | Unary + of ( + 'M, + 'T) + Unary.t + | Update + of ( + 'M, + 'T) + Update.t + + | Yield + of ( + 'M, + 'T) + Yield.t + [@@deriving + show] + include + sig + [@@@ocaml.warning + "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + val show + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + val pp_t' + : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + val + show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end = + struct + module CallTypeArg = + struct + module Implicit = + struct + type ( + 'M, + 'T) t = + ('T * 'M + t') + and + 'M t' = + { + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let _ = + fun + (_ : + 'M t') -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __0 + = pp_t' in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_T + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_t' + : + 'M . + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M t' -> + unit + = + ((let __0 + = + Syntax.pp in + (( + fun + poly_M + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Expression.CallTypeArg.Implicit.comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_t' + : + 'M . + (Format.formatter + -> + 'M -> + unit) + -> + 'M t' -> + string + = + fun + poly_M x + -> + Format.asprintf + "%a" + (pp_t' + poly_M) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + and _ = + pp_t' + and _ = + show_t' + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type ( + 'M, + 'T) t = + | + Explicit + of ( + 'M, + 'T) + Type.t + | + Implicit + of ( + 'M, + 'T) + Implicit.t + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __1 + = + Implicit.pp + and __0 = + Type.pp in + (( + fun + poly_M + poly_T + fmt -> + function + | + Explicit + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.CallTypeArg.Explicit@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Implicit + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.CallTypeArg.Implicit@ "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])")) + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module CallTypeArgs = + struct + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + arguments: + ('M, + 'T) + CallTypeArg.t + list ; + comments: + ('M, + 'M + Comment.t + list) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let _ = + fun + (_ : + ('M, + 'T) t') + -> () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __0 + = pp_t' in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + = + ((let __2 + = + Syntax.pp + and __1 = + Comment.pp + and __0 = + CallTypeArg.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Expression.CallTypeArgs.arguments"; + ((fun x + -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]")) + x.arguments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + x -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__1 + (fun fmt + -> + poly_M + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_t' + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + and _ = + pp_t' + and _ = + show_t' + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module SpreadElement = + struct + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + argument: + ('M, + 'T) + Expression.t + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let _ = + fun + (_ : + ('M, + 'T) t') + -> () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __0 + = pp_t' in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + = + ((let __1 + = + Syntax.pp + and __0 = + Expression.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Expression.SpreadElement.argument"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.argument; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_t' + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + and _ = + pp_t' + and _ = + show_t' + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Array = + struct + type ( + 'M, + 'T) element = + | + Expression + of ( + 'M, + 'T) + Expression.t + + | Spread + of ( + 'M, + 'T) + SpreadElement.t + + | Hole of + 'M + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) + element) + -> () + let rec pp_element + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + element + -> + unit + = + ((let __1 + = + SpreadElement.pp + and __0 = + Expression.pp in + (( + fun + poly_M + poly_T + fmt -> + function + | + Expression + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.Array.Expression@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Spread a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.Array.Spread@ "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Hole a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.Array.Hole@ "; + (poly_M + fmt) a0; + Format.fprintf + fmt "@])")) + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_element + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + element + -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_element + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp_element + and _ = + show_element + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + type ( + 'M, + 'T) t = + { + elements: + ('M, + 'T) + element + list ; + comments: + ('M, + 'M + Comment.t + list) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __2 + = + Syntax.pp + and __1 = + Comment.pp + and __0 = + pp_element in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Expression.Array.elements"; + ((fun x + -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]")) + x.elements; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + x -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__1 + (fun fmt + -> + poly_M + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module TemplateLiteral = + struct + module Element = + struct + type value = + { + raw: + string ; + cooked: + string } + and + 'M t = + ('M * t') + and t' = + { + value: + value ; + tail: + bool } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + value) -> + () + let _ = + fun + (_ : + 'M t) -> + () + let _ = + fun + (_ : t') + -> () + let rec pp_value + : + Format.formatter + -> + value -> + unit + = + (( + fun fmt x + -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Expression.TemplateLiteral.Element.raw"; + (Format.fprintf + fmt "%S") + x.raw; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "cooked"; + (Format.fprintf + fmt "%S") + x.cooked; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-39"] + [@ocaml.warning + "-A"]) + and show_value + : + value -> + string + = + fun x -> + Format.asprintf + "%a" + pp_value + x + [@@ocaml.warning + "-32"] + and pp : + 'M . + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M t -> + unit + = + ((let __0 + = pp_t' in + (( + fun + poly_M + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M . + (Format.formatter + -> + 'M -> + unit) + -> + 'M t -> + string + = + fun + poly_M x + -> + Format.asprintf + "%a" + (pp + poly_M) x + [@@ocaml.warning + "-32"] + and pp_t' + : + Format.formatter + -> + t' -> + unit + = + ((let __0 + = + pp_value in + (( + fun fmt x + -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Expression.TemplateLiteral.Element.value"; + (__0 fmt) + x.value; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "tail"; + (Format.fprintf + fmt "%B") + x.tail; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_t' + : + t' -> + string + = + fun x -> + Format.asprintf + "%a" + pp_t' x + [@@ocaml.warning + "-32"] + let _ = + pp_value + and _ = + show_value + and _ = + pp + and _ = + show + and _ = + pp_t' + and _ = + show_t' + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type ( + 'M, + 'T) t = + { + quasis: + 'M + Element.t + list ; + expressions: + ('M, + 'T) + Expression.t + list ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __2 + = + Syntax.pp + and __1 = + Expression.pp + and __0 = + Element.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Expression.TemplateLiteral.quasis"; + ((fun x + -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__0 + (fun fmt + -> + poly_M + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]")) + x.quasis; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "expressions"; + ((fun x + -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]")) + x.expressions; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module TaggedTemplate = + struct + type ( + 'M, + 'T) t = + { + tag: + ('M, + 'T) + Expression.t + ; + quasi: + ('M * + ('M, + 'T) + TemplateLiteral.t) + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __2 + = + Syntax.pp + and __1 = + TemplateLiteral.pp + and __0 = + Expression.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Expression.TaggedTemplate.tag"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.tag; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "quasi"; + ((fun + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])")) + x.quasi; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Object = + struct + module Property = + struct + type ( + 'M, + 'T) key = + | + StringLiteral + of ('T * + 'M + StringLiteral.t) + + | + NumberLiteral + of ('T * + 'M + NumberLiteral.t) + + | + BigIntLiteral + of ('T * + 'M + BigIntLiteral.t) + + | + Identifier + of ( + 'M, + 'T) + Identifier.t + + | + PrivateName + of 'M + PrivateName.t + + | + Computed + of ( + 'M, + 'T) + ComputedKey.t + + and ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + | Init of + { + key: + ('M, + 'T) key ; + value: + ('M, + 'T) + Expression.t + ; + shorthand: + bool } + | Method + of + { + key: + ('M, + 'T) key ; + value: + ('M * + ('M, + 'T) + Function.t) + } + | Get of + { + key: + ('M, + 'T) key ; + value: + ('M * + ('M, + 'T) + Function.t) + ; + comments: + ('M, + unit) + Syntax.t + option } + + | Set of + { + key: + ('M, + 'T) key ; + value: + ('M * + ('M, + 'T) + Function.t) + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) key) + -> () + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let _ = + fun + (_ : + ('M, + 'T) t') + -> () + let rec pp_key + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) key + -> + unit + = + ((let __5 + = + ComputedKey.pp + and __4 = + PrivateName.pp + and __3 = + Identifier.pp + and __2 = + BigIntLiteral.pp + and __1 = + NumberLiteral.pp + and __0 = + StringLiteral.pp in + (( + fun + poly_M + poly_T + fmt -> + function + | + StringLiteral + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.Object.Property.StringLiteral@ "; + ((fun + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_T + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) fmt) + a1); + Format.fprintf + fmt "@])")) + a0; + Format.fprintf + fmt "@])") + | + NumberLiteral + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.Object.Property.NumberLiteral@ "; + ((fun + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_T + fmt) a0; + Format.fprintf + fmt ",@ "; + (__1 + (fun fmt + -> + poly_M + fmt) fmt) + a1); + Format.fprintf + fmt "@])")) + a0; + Format.fprintf + fmt "@])") + | + BigIntLiteral + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.Object.Property.BigIntLiteral@ "; + ((fun + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_T + fmt) a0; + Format.fprintf + fmt ",@ "; + (__2 + (fun fmt + -> + poly_M + fmt) fmt) + a1); + Format.fprintf + fmt "@])")) + a0; + Format.fprintf + fmt "@])") + | + Identifier + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.Object.Property.Identifier@ "; + (__3 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + PrivateName + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.Object.Property.PrivateName@ "; + (__4 + (fun fmt + -> + poly_M + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Computed + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.Object.Property.Computed@ "; + (__5 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])")) + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_key + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) key + -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_key + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __0 + = pp_t' in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + = + ((let __9 + = + Syntax.pp + and __8 = + Function.pp + and __7 = + pp_key + and __6 = + Syntax.pp + and __5 = + Function.pp + and __4 = + pp_key + and __3 = + Function.pp + and __2 = + pp_key + and __1 = + Expression.pp + and __0 = + pp_key in + (( + fun + poly_M + poly_T + fmt -> + function + | + Init + { + key = + akey; + value = + avalue; + shorthand + = + ashorthand + } -> + (Format.fprintf + fmt + "@[<2>Flow_ast.Expression.Object.Property.Init {@,"; + (( + ( + Format.fprintf + fmt + "@[%s =@ " + "key"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + akey; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "value"; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + avalue; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "shorthand"; + (Format.fprintf + fmt "%B") + ashorthand; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt "@]}") + | + Method + { + key = + akey; + value = + avalue } + -> + (Format.fprintf + fmt + "@[<2>Flow_ast.Expression.Object.Property.Method {@,"; + (( + Format.fprintf + fmt + "@[%s =@ " + "key"; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + akey; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "value"; + ((fun + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__3 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])")) + avalue; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt "@]}") + | + Get + { + key = + akey; + value = + avalue; + comments + = + acomments + } -> + (Format.fprintf + fmt + "@[<2>Flow_ast.Expression.Object.Property.Get {@,"; + (( + ( + Format.fprintf + fmt + "@[%s =@ " + "key"; + (__4 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + akey; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "value"; + ((fun + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__5 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])")) + avalue; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__6 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + acomments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt "@]}") + | + Set + { + key = + akey; + value = + avalue; + comments + = + acomments + } -> + (Format.fprintf + fmt + "@[<2>Flow_ast.Expression.Object.Property.Set {@,"; + (( + ( + Format.fprintf + fmt + "@[%s =@ " + "key"; + (__7 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + akey; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "value"; + ((fun + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__8 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])")) + avalue; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__9 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + acomments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt "@]}")) + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_t' + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp_key + and _ = + show_key + and _ = + pp + and _ = + show + and _ = + pp_t' + and _ = + show_t' + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module SpreadProperty = + struct + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + argument: + ('M, + 'T) + Expression.t + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let _ = + fun + (_ : + ('M, + 'T) t') + -> () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __0 + = pp_t' in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + = + ((let __1 + = + Syntax.pp + and __0 = + Expression.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Expression.Object.SpreadProperty.argument"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.argument; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_t' + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + and _ = + pp_t' + and _ = + show_t' + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type ( + 'M, + 'T) property = + | + Property + of ( + 'M, + 'T) + Property.t + + | + SpreadProperty + of ( + 'M, + 'T) + SpreadProperty.t + + and ( + 'M, + 'T) t = + { + properties: + ('M, + 'T) + property + list ; + comments: + ('M, + 'M + Comment.t + list) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) + property) + -> () + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp_property + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + property + -> + unit + = + ((let __1 + = + SpreadProperty.pp + and __0 = + Property.pp in + (( + fun + poly_M + poly_T + fmt -> + function + | + Property + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.Object.Property@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + SpreadProperty + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.Object.SpreadProperty@ "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])")) + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_property + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + property + -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_property + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __2 + = + Syntax.pp + and __1 = + Comment.pp + and __0 = + pp_property in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Expression.Object.properties"; + ((fun x + -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]")) + x.properties; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + x -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__1 + (fun fmt + -> + poly_M + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp_property + and _ = + show_property + and _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Sequence = + struct + type ( + 'M, + 'T) t = + { + expressions: + ('M, + 'T) + Expression.t + list ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __1 + = + Syntax.pp + and __0 = + Expression.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Expression.Sequence.expressions"; + ((fun x + -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]")) + x.expressions; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Unary = + struct + type operator = + | Minus + | Plus + | Not + | BitNot + + | Typeof + + | Void + | Delete + + | Await + and ( + 'M, + 'T) t = + { + operator: + operator ; + argument: + ('M, + 'T) + Expression.t + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + operator) + -> () + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp_operator + : + Format.formatter + -> + operator + -> + unit + = + (( + fun fmt + -> + function + | + Minus -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Unary.Minus" + | + Plus -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Unary.Plus" + | + Not -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Unary.Not" + | + BitNot -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Unary.BitNot" + | + Typeof -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Unary.Typeof" + | + Void -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Unary.Void" + | + Delete -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Unary.Delete" + | + Await -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Unary.Await") + [@ocaml.warning + "-39"] + [@ocaml.warning + "-A"]) + and show_operator + : + operator + -> + string + = + fun x -> + Format.asprintf + "%a" + pp_operator + x + [@@ocaml.warning + "-32"] + and pp : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __2 + = + Syntax.pp + and __1 = + Expression.pp + and __0 = + pp_operator in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Expression.Unary.operator"; + (__0 fmt) + x.operator; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "argument"; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.argument; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp_operator + and _ = + show_operator + and _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Binary = + struct + type operator = + | Equal + | + NotEqual + + | + StrictEqual + + | + StrictNotEqual + + | + LessThan + + | + LessThanEqual + + | + GreaterThan + + | + GreaterThanEqual + + | LShift + + | RShift + + | RShift3 + + | Plus + | Minus + | Mult + | Exp + | Div + | Mod + | BitOr + | Xor + | BitAnd + + | In + | + Instanceof + + and ( + 'M, + 'T) t = + { + operator: + operator ; + left: + ('M, + 'T) + Expression.t + ; + right: + ('M, + 'T) + Expression.t + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + operator) + -> () + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp_operator + : + Format.formatter + -> + operator + -> + unit + = + (( + fun fmt + -> + function + | + Equal -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Binary.Equal" + | + NotEqual + -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Binary.NotEqual" + | + StrictEqual + -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Binary.StrictEqual" + | + StrictNotEqual + -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Binary.StrictNotEqual" + | + LessThan + -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Binary.LessThan" + | + LessThanEqual + -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Binary.LessThanEqual" + | + GreaterThan + -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Binary.GreaterThan" + | + GreaterThanEqual + -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Binary.GreaterThanEqual" + | + LShift -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Binary.LShift" + | + RShift -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Binary.RShift" + | + RShift3 + -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Binary.RShift3" + | + Plus -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Binary.Plus" + | + Minus -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Binary.Minus" + | + Mult -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Binary.Mult" + | + Exp -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Binary.Exp" + | + Div -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Binary.Div" + | + Mod -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Binary.Mod" + | + BitOr -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Binary.BitOr" + | + Xor -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Binary.Xor" + | + BitAnd -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Binary.BitAnd" + | + In -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Binary.In" + | + Instanceof + -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Binary.Instanceof") + [@ocaml.warning + "-39"] + [@ocaml.warning + "-A"]) + and show_operator + : + operator + -> + string + = + fun x -> + Format.asprintf + "%a" + pp_operator + x + [@@ocaml.warning + "-32"] + and pp : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __3 + = + Syntax.pp + and __2 = + Expression.pp + and __1 = + Expression.pp + and __0 = + pp_operator in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Expression.Binary.operator"; + (__0 fmt) + x.operator; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "left"; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.left; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "right"; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.right; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__3 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp_operator + and _ = + show_operator + and _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Assignment = + struct + type operator = + | + PlusAssign + + | + MinusAssign + + | + MultAssign + + | + ExpAssign + + | + DivAssign + + | + ModAssign + + | + LShiftAssign + + | + RShiftAssign + + | + RShift3Assign + + | + BitOrAssign + + | + BitXorAssign + + | + BitAndAssign + + | + NullishAssign + + | + AndAssign + + | + OrAssign + and ( + 'M, + 'T) t = + { + operator: + operator + option ; + left: + ('M, + 'T) + Pattern.t ; + right: + ('M, + 'T) + Expression.t + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + operator) + -> () + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp_operator + : + Format.formatter + -> + operator + -> + unit + = + (( + fun fmt + -> + function + | + PlusAssign + -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Assignment.PlusAssign" + | + MinusAssign + -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Assignment.MinusAssign" + | + MultAssign + -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Assignment.MultAssign" + | + ExpAssign + -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Assignment.ExpAssign" + | + DivAssign + -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Assignment.DivAssign" + | + ModAssign + -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Assignment.ModAssign" + | + LShiftAssign + -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Assignment.LShiftAssign" + | + RShiftAssign + -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Assignment.RShiftAssign" + | + RShift3Assign + -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Assignment.RShift3Assign" + | + BitOrAssign + -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Assignment.BitOrAssign" + | + BitXorAssign + -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Assignment.BitXorAssign" + | + BitAndAssign + -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Assignment.BitAndAssign" + | + NullishAssign + -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Assignment.NullishAssign" + | + AndAssign + -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Assignment.AndAssign" + | + OrAssign + -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Assignment.OrAssign") + [@ocaml.warning + "-39"] + [@ocaml.warning + "-A"]) + and show_operator + : + operator + -> + string + = + fun x -> + Format.asprintf + "%a" + pp_operator + x + [@@ocaml.warning + "-32"] + and pp : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __3 + = + Syntax.pp + and __2 = + Expression.pp + and __1 = + Pattern.pp + and __0 = + pp_operator in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Expression.Assignment.operator"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__0 fmt) + x; + Format.pp_print_string + fmt ")"))) + x.operator; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "left"; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.left; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "right"; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.right; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__3 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp_operator + and _ = + show_operator + and _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Update = + struct + type operator = + | + Increment + + | + Decrement + and ( + 'M, + 'T) t = + { + operator: + operator ; + argument: + ('M, + 'T) + Expression.t + ; + prefix: + bool ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + operator) + -> () + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp_operator + : + Format.formatter + -> + operator + -> + unit + = + (( + fun fmt + -> + function + | + Increment + -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Update.Increment" + | + Decrement + -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Update.Decrement") + [@ocaml.warning + "-39"] + [@ocaml.warning + "-A"]) + and show_operator + : + operator + -> + string + = + fun x -> + Format.asprintf + "%a" + pp_operator + x + [@@ocaml.warning + "-32"] + and pp : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __2 + = + Syntax.pp + and __1 = + Expression.pp + and __0 = + pp_operator in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Expression.Update.operator"; + (__0 fmt) + x.operator; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "argument"; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.argument; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "prefix"; + (Format.fprintf + fmt "%B") + x.prefix; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp_operator + and _ = + show_operator + and _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Logical = + struct + type operator = + | Or + | And + | + NullishCoalesce + + and ( + 'M, + 'T) t = + { + operator: + operator ; + left: + ('M, + 'T) + Expression.t + ; + right: + ('M, + 'T) + Expression.t + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + operator) + -> () + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp_operator + : + Format.formatter + -> + operator + -> + unit + = + (( + fun fmt + -> + function + | + Or -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Logical.Or" + | + And -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Logical.And" + | + NullishCoalesce + -> + Format.pp_print_string + fmt + "Flow_ast.Expression.Logical.NullishCoalesce") + [@ocaml.warning + "-39"] + [@ocaml.warning + "-A"]) + and show_operator + : + operator + -> + string + = + fun x -> + Format.asprintf + "%a" + pp_operator + x + [@@ocaml.warning + "-32"] + and pp : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __3 + = + Syntax.pp + and __2 = + Expression.pp + and __1 = + Expression.pp + and __0 = + pp_operator in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Expression.Logical.operator"; + (__0 fmt) + x.operator; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "left"; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.left; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "right"; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.right; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__3 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp_operator + and _ = + show_operator + and _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Conditional = + struct + type ( + 'M, + 'T) t = + { + test: + ('M, + 'T) + Expression.t + ; + consequent: + ('M, + 'T) + Expression.t + ; + alternate: + ('M, + 'T) + Expression.t + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __3 + = + Syntax.pp + and __2 = + Expression.pp + and __1 = + Expression.pp + and __0 = + Expression.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Expression.Conditional.test"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.test; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "consequent"; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.consequent; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "alternate"; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.alternate; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__3 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type ( + 'M, + 'T) expression_or_spread = + | + Expression + of ( + 'M, + 'T) + Expression.t + + | Spread + of ( + 'M, + 'T) + SpreadElement.t + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) + expression_or_spread) + -> () + let rec pp_expression_or_spread + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + expression_or_spread + -> + unit + = + ((let __1 + = + SpreadElement.pp + and __0 = + Expression.pp in + (( + fun + poly_M + poly_T + fmt -> + function + | + Expression + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.Expression@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Spread a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.Spread@ "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])")) + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_expression_or_spread + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + expression_or_spread + -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_expression_or_spread + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp_expression_or_spread + and _ = + show_expression_or_spread + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + module ArgList = + struct + type ( + 'M, + 'T) t = + ('M * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + { + arguments: + ('M, + 'T) + expression_or_spread + list ; + comments: + ('M, + 'M + Comment.t + list) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let _ = + fun + (_ : + ('M, + 'T) t') + -> () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __0 + = pp_t' in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + = + ((let __2 + = + Syntax.pp + and __1 = + Comment.pp + and __0 = + pp_expression_or_spread in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Expression.ArgList.arguments"; + ((fun x + -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]")) + x.arguments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + x -> + Format.fprintf + fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__1 + (fun fmt + -> + poly_M + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_t' + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + and _ = + pp_t' + and _ = + show_t' + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module New = + struct + type ( + 'M, + 'T) t = + { + callee: + ('M, + 'T) + Expression.t + ; + targs: + ('M, + 'T) + Expression.CallTypeArgs.t + option ; + arguments: + ('M, + 'T) + ArgList.t + option ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __3 + = + Syntax.pp + and __2 = + ArgList.pp + and __1 = + Expression.CallTypeArgs.pp + and __0 = + Expression.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Expression.New.callee"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.callee; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "targs"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.targs; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "arguments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.arguments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__3 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Call = + struct + type ( + 'M, + 'T) t = + { + callee: + ('M, + 'T) + Expression.t + ; + targs: + ('M, + 'T) + Expression.CallTypeArgs.t + option ; + arguments: + ('M, + 'T) + ArgList.t ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __3 + = + Syntax.pp + and __2 = + ArgList.pp + and __1 = + Expression.CallTypeArgs.pp + and __0 = + Expression.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Expression.Call.callee"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.callee; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "targs"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.targs; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "arguments"; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.arguments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__3 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module OptionalCall = + struct + type ( + 'M, + 'T) t = + { + call: + ('M, + 'T) + Call.t ; + filtered_out: + 'T ; + optional: + bool } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __0 + = Call.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Expression.OptionalCall.call"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.call; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "filtered_out"; + (poly_T + fmt) + x.filtered_out; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "optional"; + (Format.fprintf + fmt "%B") + x.optional; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Member = + struct + type ( + 'M, + 'T) property = + | + PropertyIdentifier + of ( + 'M, + 'T) + Identifier.t + + | + PropertyPrivateName + of 'M + PrivateName.t + + | + PropertyExpression + of ( + 'M, + 'T) + Expression.t + + and ( + 'M, + 'T) t = + { + _object: + ('M, + 'T) + Expression.t + ; + property: + ('M, + 'T) + property ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) + property) + -> () + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp_property + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + property + -> + unit + = + ((let __2 + = + Expression.pp + and __1 = + PrivateName.pp + and __0 = + Identifier.pp in + (( + fun + poly_M + poly_T + fmt -> + function + | + PropertyIdentifier + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.Member.PropertyIdentifier@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + PropertyPrivateName + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.Member.PropertyPrivateName@ "; + (__1 + (fun fmt + -> + poly_M + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + PropertyExpression + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.Member.PropertyExpression@ "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])")) + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_property + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + property + -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_property + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __2 + = + Syntax.pp + and __1 = + pp_property + and __0 = + Expression.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Expression.Member._object"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x._object; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "property"; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.property; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp_property + and _ = + show_property + and _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module OptionalMember = + struct + type ( + 'M, + 'T) t = + { + member: + ('M, + 'T) + Member.t ; + filtered_out: + 'T ; + optional: + bool } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __0 + = + Member.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Expression.OptionalMember.member"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.member; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "filtered_out"; + (poly_T + fmt) + x.filtered_out; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "optional"; + (Format.fprintf + fmt "%B") + x.optional; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Yield = + struct + type ( + 'M, + 'T) t = + { + argument: + ('M, + 'T) + Expression.t + option ; + comments: + ('M, + unit) + Syntax.t + option ; + delegate: + bool ; + result_out: + 'T } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __1 + = + Syntax.pp + and __0 = + Expression.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Expression.Yield.argument"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.argument; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "delegate"; + (Format.fprintf + fmt "%B") + x.delegate; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "result_out"; + (poly_T + fmt) + x.result_out; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module TypeCast = + struct + type ( + 'M, + 'T) t = + { + expression: + ('M, + 'T) + Expression.t + ; + annot: + ('M, + 'T) + Type.annotation + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __2 + = + Syntax.pp + and __1 = + Type.pp_annotation + and __0 = + Expression.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Expression.TypeCast.expression"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.expression; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "annot"; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.annot; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module AsExpression = + struct + type ( + 'M, + 'T) t = + { + expression: + ('M, + 'T) + Expression.t + ; + annot: + ('M, + 'T) + Type.annotation + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __2 + = + Syntax.pp + and __1 = + Type.pp_annotation + and __0 = + Expression.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Expression.AsExpression.expression"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.expression; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "annot"; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.annot; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module AsConstExpression = + struct + type ( + 'M, + 'T) t = + { + expression: + ('M, + 'T) + Expression.t + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __1 + = + Syntax.pp + and __0 = + Expression.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Expression.AsConstExpression.expression"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.expression; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module TSSatisfies = + struct + type ( + 'M, + 'T) t = + { + expression: + ('M, + 'T) + Expression.t + ; + annot: + ('M, + 'T) + Type.annotation + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __2 + = + Syntax.pp + and __1 = + Type.pp_annotation + and __0 = + Expression.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Expression.TSSatisfies.expression"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.expression; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "annot"; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.annot; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module MetaProperty = + struct + type + 'M t = + { + meta: + ('M, + 'M) + Identifier.t + ; + property: + ('M, + 'M) + Identifier.t + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + 'M t) -> + () + let rec pp + : + 'M . + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M t -> + unit + = + ((let __2 + = + Syntax.pp + and __1 = + Identifier.pp + and __0 = + Identifier.pp in + (( + fun + poly_M + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Expression.MetaProperty.meta"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_M + fmt) fmt) + x.meta; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "property"; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_M + fmt) fmt) + x.property; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M . + (Format.formatter + -> + 'M -> + unit) + -> + 'M t -> + string + = + fun + poly_M x + -> + Format.asprintf + "%a" + (pp + poly_M) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module This = + struct + type + 'M t = + { + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + 'M t) -> + () + let rec pp + : + 'M . + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M t -> + unit + = + ((let __0 + = + Syntax.pp in + (( + fun + poly_M + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Expression.This.comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M . + (Format.formatter + -> + 'M -> + unit) + -> + 'M t -> + string + = + fun + poly_M x + -> + Format.asprintf + "%a" + (pp + poly_M) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Super = + struct + type + 'M t = + { + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + 'M t) -> + () + let rec pp + : + 'M . + (Format.formatter + -> + 'M -> + unit) + -> + Format.formatter + -> + 'M t -> + unit + = + ((let __0 + = + Syntax.pp in + (( + fun + poly_M + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Expression.Super.comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M . + (Format.formatter + -> + 'M -> + unit) + -> + 'M t -> + string + = + fun + poly_M x + -> + Format.asprintf + "%a" + (pp + poly_M) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + module Import = + struct + type ( + 'M, + 'T) t = + { + argument: + ('M, + 'T) + Expression.t + ; + comments: + ('M, + unit) + Syntax.t + option } + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __1 + = + Syntax.pp + and __0 = + Expression.pp in + (( + fun + poly_M + poly_T + fmt x -> + Format.fprintf + fmt + "@[<2>{ "; + ( + ( + Format.fprintf + fmt + "@[%s =@ " + "Flow_ast.Expression.Import.argument"; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x.argument; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt + "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt + "@ }@]") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + type ( + 'M, + 'T) match_expression = + ('M, + 'T, + ('M, + 'T) + Expression.t) + Match.t + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) + match_expression) + -> () + let rec pp_match_expression + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) + match_expression + -> + unit + = + ((let __1 + = + Match.pp + and __0 = + Expression.pp in + (( + fun + poly_M + poly_T + fmt -> + __1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) + (fun fmt + -> + __0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + fmt) + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_match_expression + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) + match_expression + -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_match_expression + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp_match_expression + and _ = + show_match_expression + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + type ( + 'M, + 'T) t = + ('T * + ('M, + 'T) t') + and ( + 'M, + 'T) t' = + | Array + of ( + 'M, + 'T) + Array.t + | + ArrowFunction + of ( + 'M, + 'T) + Function.t + + | + AsConstExpression + of ( + 'M, + 'T) + AsConstExpression.t + + | + AsExpression + of ( + 'M, + 'T) + AsExpression.t + + | + Assignment + of ( + 'M, + 'T) + Assignment.t + + | Binary + of ( + 'M, + 'T) + Binary.t + + | Call of + ('M, + 'T) + Call.t + | Class + of ( + 'M, + 'T) + Class.t + | + Conditional + of ( + 'M, + 'T) + Conditional.t + + | + Function + of ( + 'M, + 'T) + Function.t + + | + Identifier + of ( + 'M, + 'T) + Identifier.t + + | Import + of ( + 'M, + 'T) + Import.t + + | + JSXElement + of ( + 'M, + 'T) + JSX.element + + | + JSXFragment + of ( + 'M, + 'T) + JSX.fragment + + | + StringLiteral + of 'M + StringLiteral.t + + | + BooleanLiteral + of 'M + BooleanLiteral.t + + | + NullLiteral + of ( + 'M, + unit) + Syntax.t + option + | + NumberLiteral + of 'M + NumberLiteral.t + + | + BigIntLiteral + of 'M + BigIntLiteral.t + + | + RegExpLiteral + of 'M + RegExpLiteral.t + + | + ModuleRefLiteral + of ( + 'M, + 'T) + ModuleRefLiteral.t + + | Logical + of ( + 'M, + 'T) + Logical.t + + | Match + of ( + 'M, + 'T) + match_expression + + | Member + of ( + 'M, + 'T) + Member.t + + | + MetaProperty + of 'M + MetaProperty.t + + | New of + ('M, + 'T) New.t + + | Object + of ( + 'M, + 'T) + Object.t + + | + OptionalCall + of ( + 'M, + 'T) + OptionalCall.t + + | + OptionalMember + of ( + 'M, + 'T) + OptionalMember.t + + | + Sequence + of ( + 'M, + 'T) + Sequence.t + + | Super + of 'M + Super.t + | + TaggedTemplate + of ( + 'M, + 'T) + TaggedTemplate.t + + | + TemplateLiteral + of ( + 'M, + 'T) + TemplateLiteral.t + + | This of + 'M This.t + + | + TypeCast + of ( + 'M, + 'T) + TypeCast.t + + | + TSSatisfies + of ( + 'M, + 'T) + TSSatisfies.t + + | Unary + of ( + 'M, + 'T) + Unary.t + | Update + of ( + 'M, + 'T) + Update.t + + | Yield + of ( + 'M, + 'T) + Yield.t + [@@deriving + show] + include + struct + let _ = + fun + (_ : + ('M, + 'T) t) -> + () + let _ = + fun + (_ : + ('M, + 'T) t') + -> () + let rec pp + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t -> + unit + = + ((let __0 + = pp_t' in + (( + fun + poly_M + poly_T + fmt + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ( + (poly_T + fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + and pp_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, + 'T) t' -> + unit + = + ((let __38 + = + Yield.pp + and __37 + = + Update.pp + and __36 + = + Unary.pp + and __35 + = + TSSatisfies.pp + and __34 + = + TypeCast.pp + and __33 + = This.pp + and __32 + = + TemplateLiteral.pp + and __31 + = + TaggedTemplate.pp + and __30 + = + Super.pp + and __29 + = + Sequence.pp + and __28 + = + OptionalMember.pp + and __27 + = + OptionalCall.pp + and __26 + = + Object.pp + and __25 + = New.pp + and __24 + = + MetaProperty.pp + and __23 + = + Member.pp + and __22 + = + pp_match_expression + and __21 + = + Logical.pp + and __20 + = + ModuleRefLiteral.pp + and __19 + = + RegExpLiteral.pp + and __18 + = + BigIntLiteral.pp + and __17 + = + NumberLiteral.pp + and __16 + = + Syntax.pp + and __15 + = + BooleanLiteral.pp + and __14 + = + StringLiteral.pp + and __13 + = + JSX.pp_fragment + and __12 + = + JSX.pp_element + and __11 + = + Import.pp + and __10 + = + Identifier.pp + and __9 = + Function.pp + and __8 = + Conditional.pp + and __7 = + Class.pp + and __6 = + Call.pp + and __5 = + Binary.pp + and __4 = + Assignment.pp + and __3 = + AsExpression.pp + and __2 = + AsConstExpression.pp + and __1 = + Function.pp + and __0 = + Array.pp in + (( + fun + poly_M + poly_T + fmt -> + function + | + Array a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.Array@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + ArrowFunction + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.ArrowFunction@ "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + AsConstExpression + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.AsConstExpression@ "; + (__2 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + AsExpression + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.AsExpression@ "; + (__3 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Assignment + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.Assignment@ "; + (__4 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Binary a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.Binary@ "; + (__5 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Call a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.Call@ "; + (__6 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Class a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.Class@ "; + (__7 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Conditional + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.Conditional@ "; + (__8 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Function + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.Function@ "; + (__9 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Identifier + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.Identifier@ "; + (__10 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Import a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.Import@ "; + (__11 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + JSXElement + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.JSXElement@ "; + (__12 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + JSXFragment + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.JSXFragment@ "; + (__13 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + StringLiteral + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.StringLiteral@ "; + (__14 + (fun fmt + -> + poly_M + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + BooleanLiteral + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.BooleanLiteral@ "; + (__15 + (fun fmt + -> + poly_M + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + NullLiteral + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.NullLiteral@ "; + ((function + | None -> + Format.pp_print_string + fmt + "None" + | Some x + -> + (Format.pp_print_string + fmt + "(Some "; + (__16 + (fun fmt + -> + poly_M + fmt) + (fun fmt + () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + a0; + Format.fprintf + fmt "@])") + | + NumberLiteral + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.NumberLiteral@ "; + (__17 + (fun fmt + -> + poly_M + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + BigIntLiteral + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.BigIntLiteral@ "; + (__18 + (fun fmt + -> + poly_M + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + RegExpLiteral + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.RegExpLiteral@ "; + (__19 + (fun fmt + -> + poly_M + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + ModuleRefLiteral + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.ModuleRefLiteral@ "; + (__20 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Logical + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.Logical@ "; + (__21 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Match a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.Match@ "; + (__22 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Member a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.Member@ "; + (__23 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + MetaProperty + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.MetaProperty@ "; + (__24 + (fun fmt + -> + poly_M + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + New a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.New@ "; + (__25 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Object a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.Object@ "; + (__26 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + OptionalCall + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.OptionalCall@ "; + (__27 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + OptionalMember + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.OptionalMember@ "; + (__28 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Sequence + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.Sequence@ "; + (__29 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Super a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.Super@ "; + (__30 + (fun fmt + -> + poly_M + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + TaggedTemplate + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.TaggedTemplate@ "; + (__31 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + TemplateLiteral + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.TemplateLiteral@ "; + (__32 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + This a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.This@ "; + (__33 + (fun fmt + -> + poly_M + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + TypeCast + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.TypeCast@ "; + (__34 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + TSSatisfies + a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.TSSatisfies@ "; + (__35 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Unary a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.Unary@ "; + (__36 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Update a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.Update@ "; + (__37 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | + Yield a0 + -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Expression.Yield@ "; + (__38 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + a0; + Format.fprintf + fmt "@])")) + [@ocaml.warning + "-A"])) + [@ocaml.warning + "-39"]) + and show_t' + : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, + 'T) t' -> + string + = + fun + poly_M + poly_T x + -> + Format.asprintf + "%a" + ((pp_t' + poly_M) + poly_T) x + [@@ocaml.warning + "-32"] + let _ = + pp + and _ = + show + and _ = + pp_t' + and _ = + show_t' + end + [@@ocaml.doc + "@inline"] + [@@merlin.hide + ] + end + and + JSX:sig + module Identifier : + sig + type ('M, 'T) t = ('T * 'M t') + and 'M t' = { + name: string ; + comments: ('M, unit) Syntax.t option }[@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t -> unit + val show : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t -> string + val pp_t' : + (Format.formatter -> + 'M -> unit) + -> + Format.formatter -> + 'M t' -> unit + val show_t' : + (Format.formatter -> + 'M -> unit) + -> 'M t' -> string + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + module NamespacedName : + sig + type ('M, 'T) t = ('M * ('M, 'T) t') + and ('M, 'T) t' = + { + namespace: ('M, 'T) Identifier.t ; + name: ('M, 'T) Identifier.t }[@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t -> unit + val show : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t -> string + val pp_t' : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t' -> unit + val show_t' : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t' -> string + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + module ExpressionContainer : + sig + type ('M, 'T) t = + { + expression: ('M, 'T) expression ; + comments: ('M, 'M Comment.t list) Syntax.t option } + and ('M, 'T) expression = + | Expression of ('M, 'T) Expression.t + | EmptyExpression [@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t -> unit + val show : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t -> string + val pp_expression : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) expression -> unit + val show_expression : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) expression -> string + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + module Text : + sig + type t = { + value: string ; + raw: string }[@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + Format.formatter -> + t -> unit + val show : t -> string + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + module Attribute : + sig + type ('M, 'T) t = ('M * ('M, 'T) t') + and ('M, 'T) name = + | Identifier of ('M, 'T) Identifier.t + | NamespacedName of ('M, 'T) NamespacedName.t + and ('M, 'T) value = + | StringLiteral of ('T * 'M StringLiteral.t) + | ExpressionContainer of ('T * ('M, 'T) ExpressionContainer.t) + and ('M, 'T) t' = + { + name: ('M, 'T) name ; + value: ('M, 'T) value option }[@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t -> unit + val show : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t -> string + val pp_name : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) name -> unit + val show_name : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) name -> string + val pp_value : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) value -> unit + val show_value : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) value -> string + val pp_t' : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t' -> unit + val show_t' : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t' -> string + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + module SpreadAttribute : + sig + type ('M, 'T) t = ('M * ('M, 'T) t') + and ('M, 'T) t' = + { + argument: ('M, 'T) Expression.t ; + comments: ('M, unit) Syntax.t option }[@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t -> unit + val show : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t -> string + val pp_t' : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t' -> unit + val show_t' : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t' -> string + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + module MemberExpression : + sig + type ('M, 'T) t = ('M * ('M, 'T) t') + and ('M, 'T) _object = + | Identifier of ('M, 'T) Identifier.t + | MemberExpression of ('M, 'T) t + and ('M, 'T) t' = + { + _object: ('M, 'T) _object ; + property: ('M, 'T) Identifier.t }[@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t -> unit + val show : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t -> string + val pp__object : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) _object -> unit + val show__object : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) _object -> string + val pp_t' : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t' -> unit + val show_t' : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t' -> string + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + type ('M, 'T) name = + | Identifier of ('M, 'T) Identifier.t + | NamespacedName of ('M, 'T) NamespacedName.t + | MemberExpression of ('M, 'T) MemberExpression.t [@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp_name : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) name -> unit + val show_name : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) name -> string + end[@@ocaml.doc "@inline"][@@merlin.hide ] + module Opening : + sig + type ('M, 'T) t = ('M * ('M, 'T) t') + and ('M, 'T) attribute = + | Attribute of ('M, 'T) Attribute.t + | SpreadAttribute of ('M, 'T) SpreadAttribute.t + and ('M, 'T) t' = + { + name: ('M, 'T) name ; + targs: ('M, 'T) Expression.CallTypeArgs.t option ; + self_closing: bool ; + attributes: ('M, 'T) attribute list }[@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t -> unit + val show : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t -> string + val pp_attribute : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) attribute -> unit + val show_attribute : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) attribute -> string + val pp_t' : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t' -> unit + val show_t' : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t' -> string + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + module Closing : + sig + type ('M, 'T) t = ('M * ('M, 'T) t') + and ('M, 'T) t' = { + name: ('M, 'T) name }[@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t -> unit + val show : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t -> string + val pp_t' : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t' -> unit + val show_t' : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t' -> string + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + module SpreadChild : + sig + type ('M, 'T) t = + { + expression: ('M, 'T) Expression.t ; + comments: ('M, unit) Syntax.t option }[@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t -> unit + val show : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t -> string + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + type ('M, 'T) child = ('T * ('M, 'T) child') + and ('M, 'T) child' = + | Element of ('M, 'T) element + | Fragment of ('M, 'T) fragment + | ExpressionContainer of ('M, 'T) ExpressionContainer.t + | SpreadChild of ('M, 'T) SpreadChild.t + | Text of Text.t + and ('M, 'T) element = + { + opening_element: ('M, 'T) Opening.t ; + closing_element: ('M, 'T) Closing.t option ; + children: ('M * ('M, 'T) child list) ; + comments: ('M, unit) Syntax.t option } + and ('M, 'T) fragment = + { + frag_opening_element: 'M ; + frag_closing_element: 'M ; + frag_children: ('M * ('M, 'T) child list) ; + frag_comments: ('M, unit) Syntax.t option }[@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp_child : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) child -> unit + val show_child : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) child -> string + val pp_child' : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) child' -> unit + val show_child' : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) child' -> string + val pp_element : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) element -> unit + val show_element : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) element -> string + val pp_fragment : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) fragment -> unit + val show_fragment : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) fragment -> string + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end = + struct + module Identifier = + struct + type ('M, 'T) t = ('T * 'M t') + and 'M t' = { + name: string ; + comments: ('M, unit) Syntax.t option }[@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T) t) -> () + let _ = fun (_ : 'M t') -> () + let rec pp : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t -> unit + = + ((let __0 = pp_t' in + (( + fun poly_M poly_T fmt (a0, a1) -> + Format.fprintf fmt "(@["; + ((poly_T fmt) a0; + Format.fprintf fmt ",@ "; + (__0 (fun fmt -> poly_M fmt) fmt) a1); + Format.fprintf fmt "@])") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp poly_M) poly_T) x[@@ocaml.warning "-32"] + and pp_t' : + 'M . + (Format.formatter -> + 'M -> unit) + -> + Format.formatter -> + 'M t' -> unit + = + ((let __0 = Syntax.pp in + (( + fun poly_M fmt x -> + Format.fprintf fmt "@[<2>{ "; + ((Format.fprintf fmt "@[%s =@ " + "Flow_ast.JSX.Identifier.name"; + (Format.fprintf fmt "%S") x.name; + Format.fprintf fmt "@]"); + Format.fprintf fmt ";@ "; + Format.fprintf fmt "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string fmt + "None" + | Some x -> + (Format.pp_print_string fmt + "(Some "; + (__0 (fun fmt -> poly_M fmt) + (fun fmt () -> + Format.pp_print_string + fmt "()") fmt) x; + Format.pp_print_string fmt + ")"))) x.comments; + Format.fprintf fmt "@]"); + Format.fprintf fmt "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_t' : + 'M . + (Format.formatter -> + 'M -> unit) + -> 'M t' -> string + = + fun poly_M x -> + Format.asprintf "%a" (pp_t' poly_M) x + [@@ocaml.warning "-32"] + let _ = pp + and _ = show + and _ = pp_t' + and _ = show_t' + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + module NamespacedName = + struct + type ('M, 'T) t = ('M * ('M, 'T) t') + and ('M, 'T) t' = + { + namespace: ('M, 'T) Identifier.t ; + name: ('M, 'T) Identifier.t }[@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T) t) -> () + let _ = fun (_ : ('M, 'T) t') -> () + let rec pp : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t -> unit + = + ((let __0 = pp_t' in + (( + fun poly_M poly_T fmt (a0, a1) -> + Format.fprintf fmt "(@["; + ((poly_M fmt) a0; + Format.fprintf fmt ",@ "; + (__0 (fun fmt -> poly_M fmt) (fun fmt -> poly_T fmt) + fmt) a1); + Format.fprintf fmt "@])") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp poly_M) poly_T) x[@@ocaml.warning "-32"] + and pp_t' : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t' -> unit + = + ((let __1 = Identifier.pp + and __0 = Identifier.pp in + (( + fun poly_M poly_T fmt x -> + Format.fprintf fmt "@[<2>{ "; + ((Format.fprintf fmt "@[%s =@ " + "Flow_ast.JSX.NamespacedName.namespace"; + (__0 (fun fmt -> poly_M fmt) (fun fmt -> poly_T fmt) + fmt) x.namespace; + Format.fprintf fmt "@]"); + Format.fprintf fmt ";@ "; + Format.fprintf fmt "@[%s =@ " + "name"; + (__1 (fun fmt -> poly_M fmt) (fun fmt -> poly_T fmt) + fmt) x.name; + Format.fprintf fmt "@]"); + Format.fprintf fmt "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_t' : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t' -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp_t' poly_M) poly_T) x[@@ocaml.warning "-32"] + let _ = pp + and _ = show + and _ = pp_t' + and _ = show_t' + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + module ExpressionContainer = + struct + type ('M, 'T) t = + { + expression: ('M, 'T) expression ; + comments: ('M, 'M Comment.t list) Syntax.t option } + and ('M, 'T) expression = + | Expression of ('M, 'T) Expression.t + | EmptyExpression [@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T) t) -> () + let _ = fun (_ : ('M, 'T) expression) -> () + let rec pp : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t -> unit + = + ((let __2 = Syntax.pp + and __1 = Comment.pp + and __0 = pp_expression in + (( + fun poly_M poly_T fmt x -> + Format.fprintf fmt "@[<2>{ "; + ((Format.fprintf fmt "@[%s =@ " + "Flow_ast.JSX.ExpressionContainer.expression"; + (__0 (fun fmt -> poly_M fmt) (fun fmt -> poly_T fmt) + fmt) x.expression; + Format.fprintf fmt "@]"); + Format.fprintf fmt ";@ "; + Format.fprintf fmt "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string fmt + "None" + | Some x -> + (Format.pp_print_string fmt + "(Some "; + (__2 (fun fmt -> poly_M fmt) + (fun fmt x -> + Format.fprintf fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__1 (fun fmt -> poly_M fmt) fmt) + x; + true) false x); + Format.fprintf fmt + "@,]@]") fmt) x; + Format.pp_print_string fmt + ")"))) x.comments; + Format.fprintf fmt "@]"); + Format.fprintf fmt "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp poly_M) poly_T) x[@@ocaml.warning "-32"] + and pp_expression : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) expression -> unit + = + ((let __0 = Expression.pp in + (( + fun poly_M poly_T fmt -> + function + | Expression a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.JSX.ExpressionContainer.Expression@ "; + (__0 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) a0; + Format.fprintf fmt "@])") + | EmptyExpression -> + Format.pp_print_string fmt + "Flow_ast.JSX.ExpressionContainer.EmptyExpression") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_expression : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) expression -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp_expression poly_M) poly_T) x[@@ocaml.warning "-32"] + let _ = pp + and _ = show + and _ = pp_expression + and _ = show_expression + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + module Text = + struct + type t = { + value: string ; + raw: string }[@@deriving show] + include + struct + let _ = fun (_ : t) -> () + let rec pp : + Format.formatter -> + t -> unit + = + (( + fun fmt x -> + Format.fprintf fmt "@[<2>{ "; + ((Format.fprintf fmt "@[%s =@ " + "Flow_ast.JSX.Text.value"; + (Format.fprintf fmt "%S") x.value; + Format.fprintf fmt "@]"); + Format.fprintf fmt ";@ "; + Format.fprintf fmt "@[%s =@ " "raw"; + (Format.fprintf fmt "%S") x.raw; + Format.fprintf fmt "@]"); + Format.fprintf fmt "@ }@]") + [@ocaml.warning "-39"][@ocaml.warning "-A"]) + and show : t -> string = + fun x -> Format.asprintf "%a" pp x + [@@ocaml.warning "-32"] + let _ = pp + and _ = show + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + module Attribute = + struct + type ('M, 'T) t = ('M * ('M, 'T) t') + and ('M, 'T) name = + | Identifier of ('M, 'T) Identifier.t + | NamespacedName of ('M, 'T) NamespacedName.t + and ('M, 'T) value = + | StringLiteral of ('T * 'M StringLiteral.t) + | ExpressionContainer of ('T * ('M, 'T) ExpressionContainer.t) + and ('M, 'T) t' = + { + name: ('M, 'T) name ; + value: ('M, 'T) value option }[@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T) t) -> () + let _ = fun (_ : ('M, 'T) name) -> () + let _ = fun (_ : ('M, 'T) value) -> () + let _ = fun (_ : ('M, 'T) t') -> () + let rec pp : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t -> unit + = + ((let __0 = pp_t' in + (( + fun poly_M poly_T fmt (a0, a1) -> + Format.fprintf fmt "(@["; + ((poly_M fmt) a0; + Format.fprintf fmt ",@ "; + (__0 (fun fmt -> poly_M fmt) (fun fmt -> poly_T fmt) + fmt) a1); + Format.fprintf fmt "@])") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp poly_M) poly_T) x[@@ocaml.warning "-32"] + and pp_name : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) name -> unit + = + ((let __1 = NamespacedName.pp + and __0 = Identifier.pp in + (( + fun poly_M poly_T fmt -> + function + | Identifier a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.JSX.Attribute.Identifier@ "; + (__0 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) a0; + Format.fprintf fmt "@])") + | NamespacedName a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.JSX.Attribute.NamespacedName@ "; + (__1 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) a0; + Format.fprintf fmt "@])")) + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_name : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) name -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp_name poly_M) poly_T) x[@@ocaml.warning "-32"] + and pp_value : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) value -> unit + = + ((let __1 = ExpressionContainer.pp + and __0 = StringLiteral.pp in + (( + fun poly_M poly_T fmt -> + function + | StringLiteral a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.JSX.Attribute.StringLiteral@ "; + ((fun (a0, a1) -> + Format.fprintf fmt "(@["; + ((poly_T fmt) a0; + Format.fprintf fmt ",@ "; + (__0 (fun fmt -> poly_M fmt) fmt) a1); + Format.fprintf fmt "@])")) + a0; + Format.fprintf fmt "@])") + | ExpressionContainer a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.JSX.Attribute.ExpressionContainer@ "; + ((fun (a0, a1) -> + Format.fprintf fmt "(@["; + ((poly_T fmt) a0; + Format.fprintf fmt ",@ "; + (__1 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) a1); + Format.fprintf fmt "@])")) + a0; + Format.fprintf fmt "@])")) + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_value : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) value -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp_value poly_M) poly_T) x[@@ocaml.warning "-32"] + and pp_t' : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t' -> unit + = + ((let __1 = pp_value + and __0 = pp_name in + (( + fun poly_M poly_T fmt x -> + Format.fprintf fmt "@[<2>{ "; + ((Format.fprintf fmt "@[%s =@ " + "Flow_ast.JSX.Attribute.name"; + (__0 (fun fmt -> poly_M fmt) (fun fmt -> poly_T fmt) + fmt) x.name; + Format.fprintf fmt "@]"); + Format.fprintf fmt ";@ "; + Format.fprintf fmt "@[%s =@ " + "value"; + ((function + | None -> + Format.pp_print_string fmt + "None" + | Some x -> + (Format.pp_print_string fmt + "(Some "; + (__1 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) x; + Format.pp_print_string fmt + ")"))) x.value; + Format.fprintf fmt "@]"); + Format.fprintf fmt "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_t' : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t' -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp_t' poly_M) poly_T) x[@@ocaml.warning "-32"] + let _ = pp + and _ = show + and _ = pp_name + and _ = show_name + and _ = pp_value + and _ = show_value + and _ = pp_t' + and _ = show_t' + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + module SpreadAttribute = + struct + type ('M, 'T) t = ('M * ('M, 'T) t') + and ('M, 'T) t' = + { + argument: ('M, 'T) Expression.t ; + comments: ('M, unit) Syntax.t option }[@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T) t) -> () + let _ = fun (_ : ('M, 'T) t') -> () + let rec pp : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t -> unit + = + ((let __0 = pp_t' in + (( + fun poly_M poly_T fmt (a0, a1) -> + Format.fprintf fmt "(@["; + ((poly_M fmt) a0; + Format.fprintf fmt ",@ "; + (__0 (fun fmt -> poly_M fmt) (fun fmt -> poly_T fmt) + fmt) a1); + Format.fprintf fmt "@])") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp poly_M) poly_T) x[@@ocaml.warning "-32"] + and pp_t' : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t' -> unit + = + ((let __1 = Syntax.pp + and __0 = Expression.pp in + (( + fun poly_M poly_T fmt x -> + Format.fprintf fmt "@[<2>{ "; + ((Format.fprintf fmt "@[%s =@ " + "Flow_ast.JSX.SpreadAttribute.argument"; + (__0 (fun fmt -> poly_M fmt) (fun fmt -> poly_T fmt) + fmt) x.argument; + Format.fprintf fmt "@]"); + Format.fprintf fmt ";@ "; + Format.fprintf fmt "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string fmt + "None" + | Some x -> + (Format.pp_print_string fmt + "(Some "; + (__1 (fun fmt -> poly_M fmt) + (fun fmt () -> + Format.pp_print_string + fmt "()") fmt) x; + Format.pp_print_string fmt + ")"))) x.comments; + Format.fprintf fmt "@]"); + Format.fprintf fmt "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_t' : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t' -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp_t' poly_M) poly_T) x[@@ocaml.warning "-32"] + let _ = pp + and _ = show + and _ = pp_t' + and _ = show_t' + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + module MemberExpression = + struct + type ('M, 'T) t = ('M * ('M, 'T) t') + and ('M, 'T) _object = + | Identifier of ('M, 'T) Identifier.t + | MemberExpression of ('M, 'T) t + and ('M, 'T) t' = + { + _object: ('M, 'T) _object ; + property: ('M, 'T) Identifier.t }[@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T) t) -> () + let _ = fun (_ : ('M, 'T) _object) -> () + let _ = fun (_ : ('M, 'T) t') -> () + let rec pp : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t -> unit + = + ((let __0 = pp_t' in + (( + fun poly_M poly_T fmt (a0, a1) -> + Format.fprintf fmt "(@["; + ((poly_M fmt) a0; + Format.fprintf fmt ",@ "; + (__0 (fun fmt -> poly_M fmt) (fun fmt -> poly_T fmt) + fmt) a1); + Format.fprintf fmt "@])") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp poly_M) poly_T) x[@@ocaml.warning "-32"] + and pp__object : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) _object -> unit + = + ((let __1 = pp + and __0 = Identifier.pp in + (( + fun poly_M poly_T fmt -> + function + | Identifier a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.JSX.MemberExpression.Identifier@ "; + (__0 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) a0; + Format.fprintf fmt "@])") + | MemberExpression a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.JSX.MemberExpression.MemberExpression@ "; + (__1 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) a0; + Format.fprintf fmt "@])")) + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show__object : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) _object -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp__object poly_M) poly_T) x[@@ocaml.warning "-32"] + and pp_t' : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t' -> unit + = + ((let __1 = Identifier.pp + and __0 = pp__object in + (( + fun poly_M poly_T fmt x -> + Format.fprintf fmt "@[<2>{ "; + ((Format.fprintf fmt "@[%s =@ " + "Flow_ast.JSX.MemberExpression._object"; + (__0 (fun fmt -> poly_M fmt) (fun fmt -> poly_T fmt) + fmt) x._object; + Format.fprintf fmt "@]"); + Format.fprintf fmt ";@ "; + Format.fprintf fmt "@[%s =@ " + "property"; + (__1 (fun fmt -> poly_M fmt) (fun fmt -> poly_T fmt) + fmt) x.property; + Format.fprintf fmt "@]"); + Format.fprintf fmt "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_t' : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t' -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp_t' poly_M) poly_T) x[@@ocaml.warning "-32"] + let _ = pp + and _ = show + and _ = pp__object + and _ = show__object + and _ = pp_t' + and _ = show_t' + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + type ('M, 'T) name = | Identifier of ('M, 'T) Identifier.t | NamespacedName of ('M, 'T) NamespacedName.t - - and ('M, 'T) value = - | StringLiteral of ('T * 'M StringLiteral.t) - | ExpressionContainer of ('T * ('M, 'T) ExpressionContainer.t) - - and ('M, 'T) t' = { - name: ('M, 'T) name; - value: ('M, 'T) value option; - } - end - - module SpreadAttribute : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - argument: ('M, 'T) Expression.t; - comments: ('M, unit) Syntax.t option; - } - end - - module MemberExpression : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) _object = - | Identifier of ('M, 'T) Identifier.t - | MemberExpression of ('M, 'T) t - - and ('M, 'T) t' = { - _object: ('M, 'T) _object; - property: ('M, 'T) Identifier.t; - } - end - - type ('M, 'T) name = - | Identifier of ('M, 'T) Identifier.t - | NamespacedName of ('M, 'T) NamespacedName.t - | MemberExpression of ('M, 'T) MemberExpression.t - - module Opening : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) attribute = - | Attribute of ('M, 'T) Attribute.t - | SpreadAttribute of ('M, 'T) SpreadAttribute.t - - and ('M, 'T) t' = { - name: ('M, 'T) name; - targs: ('M, 'T) Expression.CallTypeArgs.t option; - self_closing: bool; - attributes: ('M, 'T) attribute list; - } - end - - module Closing : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { name: ('M, 'T) name } [@@deriving show] - end - - module SpreadChild : sig - type ('M, 'T) t = { - expression: ('M, 'T) Expression.t; - comments: ('M, unit) Syntax.t option; - } - end - - type ('M, 'T) child = 'M * ('M, 'T) child' - - and ('M, 'T) child' = - | Element of ('M, 'T) element - | Fragment of ('M, 'T) fragment - | ExpressionContainer of ('M, 'T) ExpressionContainer.t - | SpreadChild of ('M, 'T) SpreadChild.t - | Text of Text.t - - and ('M, 'T) element = { - opening_element: ('M, 'T) Opening.t; - closing_element: ('M, 'T) Closing.t option; - children: 'M * ('M, 'T) child list; - comments: ('M, unit) Syntax.t option; - } - - and ('M, 'T) fragment = { - frag_opening_element: 'M; - frag_closing_element: 'M; - frag_children: 'M * ('M, 'T) child list; - frag_comments: ('M, unit) Syntax.t option; - } -end = - JSX - -and Pattern : sig - module RestElement : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - argument: ('M, 'T) Pattern.t; - comments: ('M, unit) Syntax.t option; - } - end - - module Object : sig - module Property : sig - type ('M, 'T) key = - | StringLiteral of ('M * 'M StringLiteral.t) - | NumberLiteral of ('M * 'M NumberLiteral.t) - | BigIntLiteral of ('M * 'M BigIntLiteral.t) - | Identifier of ('M, 'T) Identifier.t - | Computed of ('M, 'T) ComputedKey.t - - and ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - key: ('M, 'T) key; - pattern: ('M, 'T) Pattern.t; - default: ('M, 'T) Expression.t option; - shorthand: bool; - } - end - - type ('M, 'T) property = - | Property of ('M, 'T) Property.t - | RestElement of ('M, 'T) RestElement.t - - and ('M, 'T) t = { - properties: ('M, 'T) property list; - annot: ('M, 'T) Type.annotation_or_hint; - comments: ('M, 'M Comment.t list) Syntax.t option; - } - end - - module Array : sig - module Element : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - argument: ('M, 'T) Pattern.t; - default: ('M, 'T) Expression.t option; - } - end - - type ('M, 'T) element = - | Element of ('M, 'T) Element.t - | RestElement of ('M, 'T) RestElement.t - | Hole of 'M - - and ('M, 'T) t = { - elements: ('M, 'T) element list; - annot: ('M, 'T) Type.annotation_or_hint; - comments: ('M, 'M Comment.t list) Syntax.t option; - } - end - - module Identifier : sig - type ('M, 'T) t = { - name: ('M, 'T) Identifier.t; - annot: ('M, 'T) Type.annotation_or_hint; - optional: bool; - } - end - - type ('M, 'T) t = 'T * ('M, 'T) t' - - and ('M, 'T) t' = - | Object of ('M, 'T) Object.t - | Array of ('M, 'T) Array.t - | Identifier of ('M, 'T) Identifier.t - | Expression of ('M, 'T) Expression.t -end = - Pattern - -and Comment : sig - type 'M t = 'M * t' - - and kind = - | Block - | Line - - and t' = { - kind: kind; - text: string; - on_newline: bool; - } -end = - Comment - -and Class : sig - module Method : sig - type ('M, 'T) t = 'T * ('M, 'T) t' - - and kind = - | Constructor - | Method - | Get - | Set - - and ('M, 'T) t' = { - kind: kind; - key: ('M, 'T) Expression.Object.Property.key; - value: 'M * ('M, 'T) Function.t; - static: bool; - decorators: ('M, 'T) Class.Decorator.t list; - comments: ('M, unit) Syntax.t option; - } - end - - module Property : sig - type ('M, 'T) t = 'T * ('M, 'T) t' - - and ('M, 'T) t' = { - key: ('M, 'T) Expression.Object.Property.key; - value: ('M, 'T) value; - annot: ('M, 'T) Type.annotation_or_hint; - static: bool; - variance: 'M Variance.t option; - decorators: ('M, 'T) Class.Decorator.t list; - comments: ('M, unit) Syntax.t option; - } - - and ('M, 'T) value = - | Declared - | Uninitialized - | Initialized of ('M, 'T) Expression.t - end - - module PrivateField : sig - type ('M, 'T) t = 'T * ('M, 'T) t' - - and ('M, 'T) t' = { - key: 'M PrivateName.t; - value: ('M, 'T) Class.Property.value; - annot: ('M, 'T) Type.annotation_or_hint; - static: bool; - variance: 'M Variance.t option; - decorators: ('M, 'T) Class.Decorator.t list; - comments: ('M, unit) Syntax.t option; - } - end - - module Extends : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - expr: ('M, 'T) Expression.t; - targs: ('M, 'T) Type.TypeArgs.t option; - comments: ('M, unit) Syntax.t option; - } - end - - module Implements : sig - module Interface : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - id: ('M, 'T) Identifier.t; - targs: ('M, 'T) Type.TypeArgs.t option; - } - end - - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - interfaces: ('M, 'T) Interface.t list; - comments: ('M, unit) Syntax.t option; - } - end - - module Body : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - body: ('M, 'T) element list; - comments: ('M, unit) Syntax.t option; - } - + | MemberExpression of ('M, 'T) MemberExpression.t [@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T) name) -> () + let rec pp_name : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) name -> unit + = + ((let __2 = MemberExpression.pp + and __1 = NamespacedName.pp + and __0 = Identifier.pp in + (( + fun poly_M poly_T fmt -> + function + | Identifier a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.JSX.Identifier@ "; + (__0 (fun fmt -> poly_M fmt) (fun fmt -> poly_T fmt) + fmt) a0; + Format.fprintf fmt "@])") + | NamespacedName a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.JSX.NamespacedName@ "; + (__1 (fun fmt -> poly_M fmt) (fun fmt -> poly_T fmt) + fmt) a0; + Format.fprintf fmt "@])") + | MemberExpression a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.JSX.MemberExpression@ "; + (__2 (fun fmt -> poly_M fmt) (fun fmt -> poly_T fmt) + fmt) a0; + Format.fprintf fmt "@])")) + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_name : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) name -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp_name poly_M) poly_T) x[@@ocaml.warning "-32"] + let _ = pp_name + and _ = show_name + end[@@ocaml.doc "@inline"][@@merlin.hide ] + module Opening = + struct + type ('M, 'T) t = ('M * ('M, 'T) t') + and ('M, 'T) attribute = + | Attribute of ('M, 'T) Attribute.t + | SpreadAttribute of ('M, 'T) SpreadAttribute.t + and ('M, 'T) t' = + { + name: ('M, 'T) name ; + targs: ('M, 'T) Expression.CallTypeArgs.t option ; + self_closing: bool ; + attributes: ('M, 'T) attribute list }[@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T) t) -> () + let _ = fun (_ : ('M, 'T) attribute) -> () + let _ = fun (_ : ('M, 'T) t') -> () + let rec pp : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t -> unit + = + ((let __0 = pp_t' in + (( + fun poly_M poly_T fmt (a0, a1) -> + Format.fprintf fmt "(@["; + ((poly_M fmt) a0; + Format.fprintf fmt ",@ "; + (__0 (fun fmt -> poly_M fmt) (fun fmt -> poly_T fmt) + fmt) a1); + Format.fprintf fmt "@])") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp poly_M) poly_T) x[@@ocaml.warning "-32"] + and pp_attribute : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) attribute -> unit + = + ((let __1 = SpreadAttribute.pp + and __0 = Attribute.pp in + (( + fun poly_M poly_T fmt -> + function + | Attribute a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.JSX.Opening.Attribute@ "; + (__0 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) a0; + Format.fprintf fmt "@])") + | SpreadAttribute a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.JSX.Opening.SpreadAttribute@ "; + (__1 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) a0; + Format.fprintf fmt "@])")) + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_attribute : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) attribute -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp_attribute poly_M) poly_T) x[@@ocaml.warning "-32"] + and pp_t' : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t' -> unit + = + ((let __2 = pp_attribute + and __1 = Expression.CallTypeArgs.pp + and __0 = pp_name in + (( + fun poly_M poly_T fmt x -> + Format.fprintf fmt "@[<2>{ "; + ((((Format.fprintf fmt "@[%s =@ " + "Flow_ast.JSX.Opening.name"; + (__0 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) x.name; + Format.fprintf fmt "@]"); + Format.fprintf fmt ";@ "; + Format.fprintf fmt "@[%s =@ " + "targs"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__1 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) x; + Format.pp_print_string + fmt ")"))) x.targs; + Format.fprintf fmt "@]"); + Format.fprintf fmt ";@ "; + Format.fprintf fmt "@[%s =@ " + "self_closing"; + (Format.fprintf fmt "%B") + x.self_closing; + Format.fprintf fmt "@]"); + Format.fprintf fmt ";@ "; + Format.fprintf fmt "@[%s =@ " + "attributes"; + ((fun x -> + Format.fprintf fmt "@[<2>["; + ignore + (List.fold_left + (fun sep x -> + if sep + then + Format.fprintf fmt + ";@ "; + (__2 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) x; + true) false x); + Format.fprintf fmt "@,]@]")) + x.attributes; + Format.fprintf fmt "@]"); + Format.fprintf fmt "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_t' : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t' -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp_t' poly_M) poly_T) x[@@ocaml.warning "-32"] + let _ = pp + and _ = show + and _ = pp_attribute + and _ = show_attribute + and _ = pp_t' + and _ = show_t' + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + module Closing = + struct + type ('M, 'T) t = ('M * ('M, 'T) t') + and ('M, 'T) t' = { + name: ('M, 'T) name }[@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T) t) -> () + let _ = fun (_ : ('M, 'T) t') -> () + let rec pp : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t -> unit + = + ((let __0 = pp_t' in + (( + fun poly_M poly_T fmt (a0, a1) -> + Format.fprintf fmt "(@["; + ((poly_M fmt) a0; + Format.fprintf fmt ",@ "; + (__0 (fun fmt -> poly_M fmt) (fun fmt -> poly_T fmt) + fmt) a1); + Format.fprintf fmt "@])") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp poly_M) poly_T) x[@@ocaml.warning "-32"] + and pp_t' : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t' -> unit + = + ((let __0 = pp_name in + (( + fun poly_M poly_T fmt x -> + Format.fprintf fmt "@[<2>{ "; + (Format.fprintf fmt "@[%s =@ " + "Flow_ast.JSX.Closing.name"; + (__0 (fun fmt -> poly_M fmt) (fun fmt -> poly_T fmt) + fmt) x.name; + Format.fprintf fmt "@]"); + Format.fprintf fmt "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_t' : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t' -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp_t' poly_M) poly_T) x[@@ocaml.warning "-32"] + let _ = pp + and _ = show + and _ = pp_t' + and _ = show_t' + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + module SpreadChild = + struct + type ('M, 'T) t = + { + expression: ('M, 'T) Expression.t ; + comments: ('M, unit) Syntax.t option }[@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T) t) -> () + let rec pp : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t -> unit + = + ((let __1 = Syntax.pp + and __0 = Expression.pp in + (( + fun poly_M poly_T fmt x -> + Format.fprintf fmt "@[<2>{ "; + ((Format.fprintf fmt "@[%s =@ " + "Flow_ast.JSX.SpreadChild.expression"; + (__0 (fun fmt -> poly_M fmt) (fun fmt -> poly_T fmt) + fmt) x.expression; + Format.fprintf fmt "@]"); + Format.fprintf fmt ";@ "; + Format.fprintf fmt "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string fmt + "None" + | Some x -> + (Format.pp_print_string fmt + "(Some "; + (__1 (fun fmt -> poly_M fmt) + (fun fmt () -> + Format.pp_print_string + fmt "()") fmt) x; + Format.pp_print_string fmt + ")"))) x.comments; + Format.fprintf fmt "@]"); + Format.fprintf fmt "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp poly_M) poly_T) x[@@ocaml.warning "-32"] + let _ = pp + and _ = show + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + type ('M, 'T) child = ('T * ('M, 'T) child') + and ('M, 'T) child' = + | Element of ('M, 'T) element + | Fragment of ('M, 'T) fragment + | ExpressionContainer of ('M, 'T) ExpressionContainer.t + | SpreadChild of ('M, 'T) SpreadChild.t + | Text of Text.t and ('M, 'T) element = - | Method of ('M, 'T) Method.t - | Property of ('M, 'T) Property.t - | PrivateField of ('M, 'T) PrivateField.t - end - - module Decorator : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - expression: ('M, 'T) Expression.t; - comments: ('M, unit) Syntax.t option; - } - end - - type ('M, 'T) t = { - id: ('M, 'T) Identifier.t option; - body: ('M, 'T) Class.Body.t; - tparams: ('M, 'T) Type.TypeParams.t option; - extends: ('M, 'T) Extends.t option; - implements: ('M, 'T) Implements.t option; - class_decorators: ('M, 'T) Decorator.t list; - comments: ('M, unit) Syntax.t option; - } -end = - Class - -and Function : sig - module RestParam : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - argument: ('M, 'T) Pattern.t; - comments: ('M, unit) Syntax.t option; - } - end - - module Param : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - argument: ('M, 'T) Pattern.t; - default: ('M, 'T) Expression.t option; - } - end - - module ThisParam : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - annot: ('M, 'T) Type.annotation; - comments: ('M, unit) Syntax.t option; - } - end - - module Params : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - this_: ('M, 'T) ThisParam.t option; - params: ('M, 'T) Param.t list; - rest: ('M, 'T) RestParam.t option; - comments: ('M, 'M Comment.t list) Syntax.t option; - } - [@@deriving show] - end - - module ReturnAnnot : sig - type ('M, 'T) t = - | Missing of 'T - | Available of ('M, 'T) Type.annotation - | TypeGuard of ('M, 'T) Type.type_guard_annotation - [@@deriving show] - end - - type ('M, 'T) t = { - id: ('M, 'T) Identifier.t option; - params: ('M, 'T) Params.t; - body: ('M, 'T) body; - async: bool; - generator: bool; - predicate: ('M, 'T) Type.Predicate.t option; - return: ('M, 'T) ReturnAnnot.t; - tparams: ('M, 'T) Type.TypeParams.t option; - comments: ('M, unit) Syntax.t option; - (* Location of the signature portion of a function, e.g. - * function foo(): void {} - * ^^^^^^^^^^^^^^^^^^^^ - *) - sig_loc: 'M; - } - - and ('M, 'T) body = - | BodyBlock of ('M * ('M, 'T) Statement.Block.t) - | BodyExpression of ('M, 'T) Expression.t -end = - Function - -and Program : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - statements: ('M, 'T) Statement.t list; - interpreter: ('M * string) option; (** interpreter directive / shebang *) - comments: ('M, unit) Syntax.t option; - all_comments: 'M Comment.t list; - } -end = - Program + { + opening_element: ('M, 'T) Opening.t ; + closing_element: ('M, 'T) Closing.t option ; + children: ('M * ('M, 'T) child list) ; + comments: ('M, unit) Syntax.t option } + and ('M, 'T) fragment = + { + frag_opening_element: 'M ; + frag_closing_element: 'M ; + frag_children: ('M * ('M, 'T) child list) ; + frag_comments: ('M, unit) Syntax.t option }[@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T) child) -> () + let _ = fun (_ : ('M, 'T) child') -> () + let _ = fun (_ : ('M, 'T) element) -> () + let _ = fun (_ : ('M, 'T) fragment) -> () + let rec pp_child : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) child -> unit + = + ((let __0 = pp_child' in + (( + fun poly_M poly_T fmt (a0, a1) -> + Format.fprintf fmt "(@["; + ((poly_T fmt) a0; + Format.fprintf fmt ",@ "; + (__0 (fun fmt -> poly_M fmt) (fun fmt -> poly_T fmt) fmt) + a1); + Format.fprintf fmt "@])") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_child : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) child -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp_child poly_M) poly_T) x[@@ocaml.warning "-32"] + and pp_child' : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) child' -> unit + = + ((let __4 = Text.pp + and __3 = SpreadChild.pp + and __2 = ExpressionContainer.pp + and __1 = pp_fragment + and __0 = pp_element in + (( + fun poly_M poly_T fmt -> + function + | Element a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.JSX.Element@ "; + (__0 (fun fmt -> poly_M fmt) (fun fmt -> poly_T fmt) + fmt) a0; + Format.fprintf fmt "@])") + | Fragment a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.JSX.Fragment@ "; + (__1 (fun fmt -> poly_M fmt) (fun fmt -> poly_T fmt) + fmt) a0; + Format.fprintf fmt "@])") + | ExpressionContainer a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.JSX.ExpressionContainer@ "; + (__2 (fun fmt -> poly_M fmt) (fun fmt -> poly_T fmt) + fmt) a0; + Format.fprintf fmt "@])") + | SpreadChild a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.JSX.SpreadChild@ "; + (__3 (fun fmt -> poly_M fmt) (fun fmt -> poly_T fmt) + fmt) a0; + Format.fprintf fmt "@])") + | Text a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.JSX.Text@ "; + (__4 fmt) a0; + Format.fprintf fmt "@])")) + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_child' : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) child' -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp_child' poly_M) poly_T) x[@@ocaml.warning "-32"] + and pp_element : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) element -> unit + = + ((let __3 = Syntax.pp + and __2 = pp_child + and __1 = Closing.pp + and __0 = Opening.pp in + (( + fun poly_M poly_T fmt x -> + Format.fprintf fmt "@[<2>{ "; + ((((Format.fprintf fmt "@[%s =@ " + "Flow_ast.JSX.opening_element"; + (__0 (fun fmt -> poly_M fmt) (fun fmt -> poly_T fmt) + fmt) x.opening_element; + Format.fprintf fmt "@]"); + Format.fprintf fmt ";@ "; + Format.fprintf fmt "@[%s =@ " + "closing_element"; + ((function + | None -> + Format.pp_print_string fmt + "None" + | Some x -> + (Format.pp_print_string fmt + "(Some "; + (__1 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) x; + Format.pp_print_string fmt + ")"))) x.closing_element; + Format.fprintf fmt "@]"); + Format.fprintf fmt ";@ "; + Format.fprintf fmt "@[%s =@ " + "children"; + ((fun (a0, a1) -> + Format.fprintf fmt "(@["; + ((poly_M fmt) a0; + Format.fprintf fmt ",@ "; + ((fun x -> + Format.fprintf fmt "@[<2>["; + ignore + (List.fold_left + (fun sep x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__2 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) x; + true) false x); + Format.fprintf fmt "@,]@]")) + a1); + Format.fprintf fmt "@])")) + x.children; + Format.fprintf fmt "@]"); + Format.fprintf fmt ";@ "; + Format.fprintf fmt "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string fmt + "None" + | Some x -> + (Format.pp_print_string fmt + "(Some "; + (__3 (fun fmt -> poly_M fmt) + (fun fmt () -> + Format.pp_print_string + fmt "()") fmt) x; + Format.pp_print_string fmt ")"))) + x.comments; + Format.fprintf fmt "@]"); + Format.fprintf fmt "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_element : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) element -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp_element poly_M) poly_T) x[@@ocaml.warning "-32"] + and pp_fragment : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) fragment -> unit + = + ((let __1 = Syntax.pp + and __0 = pp_child in + (( + fun poly_M poly_T fmt x -> + Format.fprintf fmt "@[<2>{ "; + ((((Format.fprintf fmt "@[%s =@ " + "Flow_ast.JSX.frag_opening_element"; + (poly_M fmt) x.frag_opening_element; + Format.fprintf fmt "@]"); + Format.fprintf fmt ";@ "; + Format.fprintf fmt "@[%s =@ " + "frag_closing_element"; + (poly_M fmt) x.frag_closing_element; + Format.fprintf fmt "@]"); + Format.fprintf fmt ";@ "; + Format.fprintf fmt "@[%s =@ " + "frag_children"; + ((fun (a0, a1) -> + Format.fprintf fmt "(@["; + ((poly_M fmt) a0; + Format.fprintf fmt ",@ "; + ((fun x -> + Format.fprintf fmt "@[<2>["; + ignore + (List.fold_left + (fun sep x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__0 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) x; + true) false x); + Format.fprintf fmt "@,]@]")) + a1); + Format.fprintf fmt "@])")) + x.frag_children; + Format.fprintf fmt "@]"); + Format.fprintf fmt ";@ "; + Format.fprintf fmt "@[%s =@ " + "frag_comments"; + ((function + | None -> + Format.pp_print_string fmt + "None" + | Some x -> + (Format.pp_print_string fmt + "(Some "; + (__1 (fun fmt -> poly_M fmt) + (fun fmt () -> + Format.pp_print_string + fmt "()") fmt) x; + Format.pp_print_string fmt ")"))) + x.frag_comments; + Format.fprintf fmt "@]"); + Format.fprintf fmt "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_fragment : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) fragment -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp_fragment poly_M) poly_T) x[@@ocaml.warning "-32"] + let _ = pp_child + and _ = show_child + and _ = pp_child' + and _ = show_child' + and _ = pp_element + and _ = show_element + and _ = pp_fragment + and _ = show_fragment + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end and + Match:sig + module Case : + sig + type ('M, 'T, 'B) t = ('M * ('M, 'T, 'B) t') + and ('M, 'T, 'B) t' = + { + pattern: ('M, 'T) MatchPattern.t ; + body: 'B ; + guard: ('M, 'T) Expression.t option ; + comments: ('M, unit) Syntax.t option }[@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + (Format.formatter -> + 'B -> unit) + -> + Format.formatter -> + ('M, 'T, 'B) t -> unit + val show : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + (Format.formatter -> + 'B -> unit) + -> ('M, 'T, 'B) t -> string + val pp_t' : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + (Format.formatter -> + 'B -> unit) + -> + Format.formatter -> + ('M, 'T, 'B) t' -> unit + val show_t' : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + (Format.formatter -> + 'B -> unit) + -> + ('M, 'T, 'B) t' -> string + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + type ('M, 'T, 'B) t = + { + arg: ('M, 'T) Expression.t ; + cases: ('M, 'T, 'B) Case.t list ; + match_keyword_loc: 'T ; + comments: ('M, unit) Syntax.t option }[@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + (Format.formatter -> + 'B -> unit) + -> + Format.formatter -> + ('M, 'T, 'B) t -> unit + val show : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + (Format.formatter -> + 'B -> unit) + -> ('M, 'T, 'B) t -> string + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end = + struct + module Case = + struct + type ('M, 'T, 'B) t = ('M * ('M, 'T, 'B) t') + and ('M, 'T, 'B) t' = + { + pattern: ('M, 'T) MatchPattern.t ; + body: 'B ; + guard: ('M, 'T) Expression.t option ; + comments: ('M, unit) Syntax.t option }[@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T, 'B) t) -> () + let _ = fun (_ : ('M, 'T, 'B) t') -> () + let rec pp : + 'M 'T 'B . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + (Format.formatter -> + 'B -> unit) + -> + Format.formatter -> + ('M, 'T, 'B) t -> unit + = + ((let __0 = pp_t' in + (( + fun poly_M poly_T poly_B fmt (a0, a1) -> + Format.fprintf fmt "(@["; + ((poly_M fmt) a0; + Format.fprintf fmt ",@ "; + (__0 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) + (fun fmt -> poly_B fmt) fmt) a1); + Format.fprintf fmt "@])") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T 'B . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + (Format.formatter -> + 'B -> unit) + -> ('M, 'T, 'B) t -> string + = + fun poly_M poly_T poly_B x -> + Format.asprintf "%a" + (((pp poly_M) poly_T) poly_B) x[@@ocaml.warning "-32"] + and pp_t' : + 'M 'T 'B . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + (Format.formatter -> + 'B -> unit) + -> + Format.formatter -> + ('M, 'T, 'B) t' -> unit + = + ((let __2 = Syntax.pp + and __1 = Expression.pp + and __0 = MatchPattern.pp in + (( + fun poly_M poly_T poly_B fmt x -> + Format.fprintf fmt "@[<2>{ "; + ((((Format.fprintf fmt + "@[%s =@ " "Flow_ast.Match.Case.pattern"; + (__0 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) x.pattern; + Format.fprintf fmt "@]"); + Format.fprintf fmt ";@ "; + Format.fprintf fmt + "@[%s =@ " "body"; + (poly_B fmt) x.body; + Format.fprintf fmt "@]"); + Format.fprintf fmt ";@ "; + Format.fprintf fmt + "@[%s =@ " "guard"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__1 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) x; + Format.pp_print_string + fmt ")"))) x.guard; + Format.fprintf fmt "@]"); + Format.fprintf fmt ";@ "; + Format.fprintf fmt + "@[%s =@ " "comments"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__2 (fun fmt -> poly_M fmt) + (fun fmt () -> + Format.pp_print_string + fmt "()") fmt) x; + Format.pp_print_string + fmt ")"))) x.comments; + Format.fprintf fmt "@]"); + Format.fprintf fmt "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_t' : + 'M 'T 'B . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + (Format.formatter -> + 'B -> unit) + -> ('M, 'T, 'B) t' -> string + = + fun poly_M poly_T poly_B x -> + Format.asprintf "%a" + (((pp_t' poly_M) poly_T) poly_B) x[@@ocaml.warning + "-32"] + let _ = pp + and _ = show + and _ = pp_t' + and _ = show_t' + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + type ('M, 'T, 'B) t = + { + arg: ('M, 'T) Expression.t ; + cases: ('M, 'T, 'B) Case.t list ; + match_keyword_loc: 'T ; + comments: ('M, unit) Syntax.t option }[@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T, 'B) t) -> () + let rec pp : + 'M 'T 'B . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + (Format.formatter -> + 'B -> unit) + -> + Format.formatter -> + ('M, 'T, 'B) t -> unit + = + ((let __2 = Syntax.pp + and __1 = Case.pp + and __0 = Expression.pp in + (( + fun poly_M poly_T poly_B fmt x -> + Format.fprintf fmt "@[<2>{ "; + ((((Format.fprintf fmt "@[%s =@ " + "Flow_ast.Match.arg"; + (__0 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) x.arg; + Format.fprintf fmt "@]"); + Format.fprintf fmt ";@ "; + Format.fprintf fmt "@[%s =@ " + "cases"; + ((fun x -> + Format.fprintf fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__1 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) + (fun fmt -> poly_B fmt) fmt) x; + true) false x); + Format.fprintf fmt "@,]@]")) + x.cases; + Format.fprintf fmt "@]"); + Format.fprintf fmt ";@ "; + Format.fprintf fmt "@[%s =@ " + "match_keyword_loc"; + (poly_T fmt) x.match_keyword_loc; + Format.fprintf fmt "@]"); + Format.fprintf fmt ";@ "; + Format.fprintf fmt "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string fmt + "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__2 (fun fmt -> poly_M fmt) + (fun fmt () -> + Format.pp_print_string + fmt "()") fmt) x; + Format.pp_print_string + fmt ")"))) x.comments; + Format.fprintf fmt "@]"); + Format.fprintf fmt "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T 'B . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + (Format.formatter -> + 'B -> unit) + -> ('M, 'T, 'B) t -> string + = + fun poly_M poly_T poly_B x -> + Format.asprintf "%a" + (((pp poly_M) poly_T) poly_B) x[@@ocaml.warning "-32"] + let _ = pp + and _ = show + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end and + MatchPattern:sig + module UnaryPattern : + sig + type operator = + | Plus + | Minus + and 'M argument = + | NumberLiteral of 'M NumberLiteral.t + | BigIntLiteral of 'M BigIntLiteral.t + and 'M t = + { + operator: operator ; + argument: ('M * 'M argument) ; + comments: ('M, unit) Syntax.t option } + [@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp_operator : + Format.formatter -> + operator -> unit + val show_operator : + operator -> string + val pp_argument : + (Format.formatter -> + 'M -> unit) + -> + Format.formatter -> + 'M argument -> + unit + val show_argument : + (Format.formatter -> + 'M -> unit) + -> + 'M argument -> + string + val pp : + (Format.formatter -> + 'M -> unit) + -> + Format.formatter -> + 'M t -> unit + val show : + (Format.formatter -> + 'M -> unit) + -> 'M t -> string + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + module MemberPattern : + sig + type ('M, 'T) base = + | BaseIdentifier of ('M, 'T) Identifier.t + | BaseMember of ('M, 'T) t + and ('M, 'T) property = + | PropertyString of ('M * 'M StringLiteral.t) + + | PropertyNumber of ('M * 'M NumberLiteral.t) + + | PropertyBigInt of ('M * 'M BigIntLiteral.t) + + | PropertyIdentifier of ('M, 'T) Identifier.t + and ('M, 'T) t = ('T * ('M, 'T) t') + and ('M, 'T) t' = + { + base: ('M, 'T) base ; + property: ('M, 'T) property ; + comments: ('M, unit) Syntax.t option } + [@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp_base : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) base -> + unit + val show_base : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + ('M, 'T) base -> + string + val pp_property : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) property -> + unit + val show_property : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + ('M, 'T) property -> + string + val pp : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + val show : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + ('M, 'T) t -> + string + val pp_t' : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) t' -> + unit + val show_t' : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + ('M, 'T) t' -> + string + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + module BindingPattern : + sig + type ('M, 'T) t = + { + kind: Variable.kind ; + id: ('M, 'T) Identifier.t ; + comments: ('M, unit) Syntax.t option } + [@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + val show : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + ('M, 'T) t -> + string + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + module RestPattern : + sig + type ('M, 'T) t = ('M * ('M, 'T) t') + and ('M, 'T) t' = + { + argument: + ('M * ('M, 'T) BindingPattern.t) option ; + comments: ('M, unit) Syntax.t option } + [@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + val show : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + ('M, 'T) t -> + string + val pp_t' : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) t' -> + unit + val show_t' : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + ('M, 'T) t' -> + string + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + module ObjectPattern : + sig + module Property : + sig + type ('M, 'T) key = + | StringLiteral of ('M * 'M StringLiteral.t) + + | NumberLiteral of ('M * 'M NumberLiteral.t) + + | BigIntLiteral of ('M * 'M BigIntLiteral.t) + + | Identifier of ('M, 'T) Identifier.t + and ('M, 'T) property = + { + key: ('M, 'T) key ; + pattern: ('M, 'T) MatchPattern.t ; + shorthand: bool ; + comments: ('M, unit) Syntax.t option } + and ('M, 'T) t = ('M * ('M, 'T) t') + and ('M, 'T) t' = + | Valid of ('M, 'T) property + | InvalidShorthand of ('M, 'M) Identifier.t + [@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp_key : + (Format.formatter + -> 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) key -> + unit + val show_key : + (Format.formatter + -> 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + ('M, 'T) key -> + string + val pp_property : + (Format.formatter + -> 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) property -> + unit + val show_property : + (Format.formatter + -> 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + ('M, 'T) property -> + string + val pp : + (Format.formatter + -> 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + val show : + (Format.formatter + -> 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + ('M, 'T) t -> + string + val pp_t' : + (Format.formatter + -> 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) t' -> + unit + val show_t' : + (Format.formatter + -> 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + ('M, 'T) t' -> + string + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + type ('M, 'T) t = + { + properties: ('M, 'T) Property.t list ; + rest: ('M, 'T) RestPattern.t option ; + comments: + ('M, 'M Comment.t list) Syntax.t option } + [@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + val show : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + ('M, 'T) t -> + string + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + module ArrayPattern : + sig + module Element : + sig + type ('M, 'T) t = + { + index: 'M ; + pattern: ('M, 'T) MatchPattern.t }[@@deriving + show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter + -> 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + val show : + (Format.formatter + -> 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + ('M, 'T) t -> + string + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + type ('M, 'T) t = + { + elements: ('M, 'T) Element.t list ; + rest: ('M, 'T) RestPattern.t option ; + comments: + ('M, 'M Comment.t list) Syntax.t option } + [@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + val show : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + ('M, 'T) t -> + string + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + module OrPattern : + sig + type ('M, 'T) t = + { + patterns: ('M, 'T) MatchPattern.t list ; + comments: ('M, unit) Syntax.t option } + [@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + val show : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + ('M, 'T) t -> + string + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + module AsPattern : + sig + type ('M, 'T) target = + | Identifier of ('M, 'T) Identifier.t + | Binding of 'M * ('M, 'T) BindingPattern.t + and ('M, 'T) t = + { + pattern: ('M, 'T) MatchPattern.t ; + target: ('M, 'T) target ; + comments: ('M, unit) Syntax.t option } + [@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp_target : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) target -> + unit + val show_target : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + ('M, 'T) target -> + string + val pp : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + val show : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + ('M, 'T) t -> + string + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + type ('M, 'T) t = ('M * ('M, 'T) t') + and ('M, 'T) t' = + | WildcardPattern of ('M, unit) Syntax.t option + + | NumberPattern of 'M NumberLiteral.t + | BigIntPattern of 'M BigIntLiteral.t + | StringPattern of 'M StringLiteral.t + | BooleanPattern of 'M BooleanLiteral.t + | NullPattern of ('M, unit) Syntax.t option + | UnaryPattern of 'M UnaryPattern.t + | BindingPattern of ('M, 'T) BindingPattern.t + | IdentifierPattern of ('M, 'T) Identifier.t + | MemberPattern of ('M, 'T) MemberPattern.t + | ObjectPattern of ('M, 'T) ObjectPattern.t + | ArrayPattern of ('M, 'T) ArrayPattern.t + | OrPattern of ('M, 'T) OrPattern.t + | AsPattern of ('M, 'T) AsPattern.t [@@deriving + show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t -> + unit + val show : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + ('M, 'T) t -> + string + val pp_t' : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t' -> + unit + val show_t' : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + ('M, 'T) t' -> + string + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end = + struct + module UnaryPattern = + struct + type operator = + | Plus + | Minus + and 'M argument = + | NumberLiteral of 'M NumberLiteral.t + | BigIntLiteral of 'M BigIntLiteral.t + and 'M t = + { + operator: operator ; + argument: ('M * 'M argument) ; + comments: ('M, unit) Syntax.t option }[@@deriving show] + include + struct + let _ = fun (_ : operator) -> () + let _ = fun (_ : 'M argument) -> () + let _ = fun (_ : 'M t) -> () + let rec pp_operator : + Format.formatter -> + operator -> unit + = + (( fun fmt -> + function + | Plus -> + Format.pp_print_string + fmt + "Flow_ast.MatchPattern.UnaryPattern.Plus" + | Minus -> + Format.pp_print_string + fmt + "Flow_ast.MatchPattern.UnaryPattern.Minus") + [@ocaml.warning "-39"][@ocaml.warning "-A"]) + and show_operator : + operator -> string = + fun x -> + Format.asprintf "%a" + pp_operator x[@@ocaml.warning "-32"] + and pp_argument : + 'M . + (Format.formatter -> + 'M -> unit) + -> + Format.formatter -> + 'M argument -> unit + = + ((let __1 = BigIntLiteral.pp + and __0 = NumberLiteral.pp in + (( fun poly_M fmt -> + function + | NumberLiteral a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.MatchPattern.UnaryPattern.NumberLiteral@ "; + (__0 (fun fmt -> poly_M fmt) fmt) a0; + Format.fprintf fmt + "@])") + | BigIntLiteral a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.MatchPattern.UnaryPattern.BigIntLiteral@ "; + (__1 (fun fmt -> poly_M fmt) fmt) a0; + Format.fprintf fmt + "@])")) + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_argument : + 'M . + (Format.formatter -> + 'M -> unit) + -> 'M argument -> string + = + fun poly_M x -> + Format.asprintf "%a" + (pp_argument poly_M) x[@@ocaml.warning "-32"] + and pp : + 'M . + (Format.formatter -> + 'M -> unit) + -> + Format.formatter -> + 'M t -> unit + = + ((let __2 = Syntax.pp + and __1 = pp_argument + and __0 = pp_operator in + (( fun poly_M fmt x -> + Format.fprintf fmt + "@[<2>{ "; + (((Format.fprintf fmt + "@[%s =@ " + "Flow_ast.MatchPattern.UnaryPattern.operator"; + (__0 fmt) x.operator; + Format.fprintf fmt + "@]"); + Format.fprintf fmt + ";@ "; + Format.fprintf fmt + "@[%s =@ " "argument"; + ((fun (a0, a1) -> + Format.fprintf fmt + "(@["; + ((poly_M fmt) a0; + Format.fprintf + fmt ",@ "; + (__1 (fun fmt -> poly_M fmt) fmt) a1); + Format.fprintf fmt + "@])")) x.argument; + Format.fprintf fmt + "@]"); + Format.fprintf fmt + ";@ "; + Format.fprintf fmt + "@[%s =@ " "comments"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__2 (fun fmt -> poly_M fmt) + (fun fmt () -> + Format.pp_print_string + fmt "()") fmt) x; + Format.pp_print_string + fmt ")"))) x.comments; + Format.fprintf fmt "@]"); + Format.fprintf fmt + "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M . + (Format.formatter -> + 'M -> unit) + -> 'M t -> string + = + fun poly_M x -> + Format.asprintf "%a" + (pp poly_M) x[@@ocaml.warning "-32"] + let _ = pp_operator + and _ = show_operator + and _ = pp_argument + and _ = show_argument + and _ = pp + and _ = show + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + module MemberPattern = + struct + type ('M, 'T) base = + | BaseIdentifier of ('M, 'T) Identifier.t + | BaseMember of ('M, 'T) t + and ('M, 'T) property = + | PropertyString of ('M * 'M StringLiteral.t) + | PropertyNumber of ('M * 'M NumberLiteral.t) + | PropertyBigInt of ('M * 'M BigIntLiteral.t) + | PropertyIdentifier of ('M, 'T) Identifier.t + and ('M, 'T) t = ('T * ('M, 'T) t') + and ('M, 'T) t' = + { + base: ('M, 'T) base ; + property: ('M, 'T) property ; + comments: ('M, unit) Syntax.t option }[@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T) base) -> () + let _ = fun (_ : ('M, 'T) property) -> () + let _ = fun (_ : ('M, 'T) t) -> () + let _ = fun (_ : ('M, 'T) t') -> () + let rec pp_base : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) base -> unit + = + ((let __1 = pp + and __0 = Identifier.pp in + (( fun poly_M poly_T fmt -> + function + | BaseIdentifier a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.MatchPattern.MemberPattern.BaseIdentifier@ "; + (__0 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) a0; + Format.fprintf fmt + "@])") + | BaseMember a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.MatchPattern.MemberPattern.BaseMember@ "; + (__1 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) a0; + Format.fprintf fmt + "@])")) + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_base : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) base -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp_base poly_M) poly_T) x[@@ocaml.warning + "-32"] + and pp_property : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) property -> + unit + = + ((let __3 = Identifier.pp + and __2 = BigIntLiteral.pp + and __1 = NumberLiteral.pp + and __0 = StringLiteral.pp in + (( fun poly_M poly_T fmt -> + function + | PropertyString a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.MatchPattern.MemberPattern.PropertyString@ "; + ((fun (a0, a1) -> + Format.fprintf + fmt "(@["; + ((poly_M fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 (fun fmt -> poly_M fmt) fmt) + a1); + Format.fprintf + fmt "@])")) a0; + Format.fprintf fmt + "@])") + | PropertyNumber a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.MatchPattern.MemberPattern.PropertyNumber@ "; + ((fun (a0, a1) -> + Format.fprintf + fmt "(@["; + ((poly_M fmt) a0; + Format.fprintf + fmt ",@ "; + (__1 (fun fmt -> poly_M fmt) fmt) + a1); + Format.fprintf + fmt "@])")) a0; + Format.fprintf fmt + "@])") + | PropertyBigInt a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.MatchPattern.MemberPattern.PropertyBigInt@ "; + ((fun (a0, a1) -> + Format.fprintf + fmt "(@["; + ((poly_M fmt) a0; + Format.fprintf + fmt ",@ "; + (__2 (fun fmt -> poly_M fmt) fmt) + a1); + Format.fprintf + fmt "@])")) a0; + Format.fprintf fmt + "@])") + | PropertyIdentifier a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.MatchPattern.MemberPattern.PropertyIdentifier@ "; + (__3 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) a0; + Format.fprintf fmt + "@])")) + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_property : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + ('M, 'T) property -> + string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp_property poly_M) poly_T) x[@@ocaml.warning + "-32"] + and pp : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t -> unit + = + ((let __0 = pp_t' in + (( fun poly_M poly_T fmt (a0, a1) -> + Format.fprintf fmt "(@["; + ((poly_T fmt) a0; + Format.fprintf fmt + ",@ "; + (__0 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) a1); + Format.fprintf fmt "@])") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp poly_M) poly_T) x[@@ocaml.warning "-32"] + and pp_t' : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t' -> unit + = + ((let __2 = Syntax.pp + and __1 = pp_property + and __0 = pp_base in + (( fun poly_M poly_T fmt x -> + Format.fprintf fmt + "@[<2>{ "; + (((Format.fprintf fmt + "@[%s =@ " + "Flow_ast.MatchPattern.MemberPattern.base"; + (__0 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) x.base; + Format.fprintf fmt + "@]"); + Format.fprintf fmt + ";@ "; + Format.fprintf fmt + "@[%s =@ " "property"; + (__1 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) x.property; + Format.fprintf fmt + "@]"); + Format.fprintf fmt + ";@ "; + Format.fprintf fmt + "@[%s =@ " "comments"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__2 (fun fmt -> poly_M fmt) + (fun fmt () -> + Format.pp_print_string + fmt "()") fmt) x; + Format.pp_print_string + fmt ")"))) x.comments; + Format.fprintf fmt "@]"); + Format.fprintf fmt + "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_t' : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t' -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp_t' poly_M) poly_T) x[@@ocaml.warning "-32"] + let _ = pp_base + and _ = show_base + and _ = pp_property + and _ = show_property + and _ = pp + and _ = show + and _ = pp_t' + and _ = show_t' + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + module BindingPattern = + struct + type ('M, 'T) t = + { + kind: Variable.kind ; + id: ('M, 'T) Identifier.t ; + comments: ('M, unit) Syntax.t option }[@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T) t) -> () + let rec pp : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t -> unit + = + ((let __2 = Syntax.pp + and __1 = Identifier.pp + and __0 = Variable.pp_kind in + (( fun poly_M poly_T fmt x -> + Format.fprintf fmt + "@[<2>{ "; + (((Format.fprintf fmt + "@[%s =@ " + "Flow_ast.MatchPattern.BindingPattern.kind"; + (__0 fmt) x.kind; + Format.fprintf fmt + "@]"); + Format.fprintf fmt + ";@ "; + Format.fprintf fmt + "@[%s =@ " "id"; + (__1 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) x.id; + Format.fprintf fmt + "@]"); + Format.fprintf fmt + ";@ "; + Format.fprintf fmt + "@[%s =@ " "comments"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__2 (fun fmt -> poly_M fmt) + (fun fmt () -> + Format.pp_print_string + fmt "()") fmt) x; + Format.pp_print_string + fmt ")"))) x.comments; + Format.fprintf fmt "@]"); + Format.fprintf fmt + "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp poly_M) poly_T) x[@@ocaml.warning "-32"] + let _ = pp + and _ = show + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + module RestPattern = + struct + type ('M, 'T) t = ('M * ('M, 'T) t') + and ('M, 'T) t' = + { + argument: ('M * ('M, 'T) BindingPattern.t) option ; + comments: ('M, unit) Syntax.t option }[@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T) t) -> () + let _ = fun (_ : ('M, 'T) t') -> () + let rec pp : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t -> unit + = + ((let __0 = pp_t' in + (( fun poly_M poly_T fmt (a0, a1) -> + Format.fprintf fmt "(@["; + ((poly_M fmt) a0; + Format.fprintf fmt + ",@ "; + (__0 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) a1); + Format.fprintf fmt "@])") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp poly_M) poly_T) x[@@ocaml.warning "-32"] + and pp_t' : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t' -> unit + = + ((let __1 = Syntax.pp + and __0 = BindingPattern.pp in + (( fun poly_M poly_T fmt x -> + Format.fprintf fmt + "@[<2>{ "; + ((Format.fprintf fmt + "@[%s =@ " + "Flow_ast.MatchPattern.RestPattern.argument"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + ((fun (a0, a1) -> + Format.fprintf + fmt "(@["; + ((poly_M fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) + a1); + Format.fprintf + fmt "@])")) x; + Format.pp_print_string + fmt ")"))) x.argument; + Format.fprintf fmt + "@]"); + Format.fprintf fmt + ";@ "; + Format.fprintf fmt + "@[%s =@ " "comments"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__1 (fun fmt -> poly_M fmt) + (fun fmt () -> + Format.pp_print_string + fmt "()") fmt) x; + Format.pp_print_string + fmt ")"))) x.comments; + Format.fprintf fmt "@]"); + Format.fprintf fmt + "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_t' : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t' -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp_t' poly_M) poly_T) x[@@ocaml.warning "-32"] + let _ = pp + and _ = show + and _ = pp_t' + and _ = show_t' + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + module ObjectPattern = + struct + module Property = + struct + type ('M, 'T) key = + | StringLiteral of ('M * 'M StringLiteral.t) + | NumberLiteral of ('M * 'M NumberLiteral.t) + | BigIntLiteral of ('M * 'M BigIntLiteral.t) + | Identifier of ('M, 'T) Identifier.t + and ('M, 'T) property = + { + key: ('M, 'T) key ; + pattern: ('M, 'T) MatchPattern.t ; + shorthand: bool ; + comments: ('M, unit) Syntax.t option } + and ('M, 'T) t = ('M * ('M, 'T) t') + and ('M, 'T) t' = + | Valid of ('M, 'T) property + | InvalidShorthand of ('M, 'M) Identifier.t [@@deriving + show] + include + struct + let _ = fun (_ : ('M, 'T) key) -> () + let _ = fun (_ : ('M, 'T) property) -> () + let _ = fun (_ : ('M, 'T) t) -> () + let _ = fun (_ : ('M, 'T) t') -> () + let rec pp_key : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) key -> unit + = + ((let __3 = Identifier.pp + and __2 = BigIntLiteral.pp + and __1 = NumberLiteral.pp + and __0 = StringLiteral.pp in + (( fun poly_M poly_T fmt -> + function + | StringLiteral a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.MatchPattern.ObjectPattern.Property.StringLiteral@ "; + ((fun (a0, a1) -> + Format.fprintf + fmt "(@["; + ((poly_M fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 (fun fmt -> poly_M fmt) + fmt) a1); + Format.fprintf + fmt "@])")) a0; + Format.fprintf + fmt "@])") + | NumberLiteral a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.MatchPattern.ObjectPattern.Property.NumberLiteral@ "; + ((fun (a0, a1) -> + Format.fprintf + fmt "(@["; + ((poly_M fmt) a0; + Format.fprintf + fmt ",@ "; + (__1 (fun fmt -> poly_M fmt) + fmt) a1); + Format.fprintf + fmt "@])")) a0; + Format.fprintf + fmt "@])") + | BigIntLiteral a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.MatchPattern.ObjectPattern.Property.BigIntLiteral@ "; + ((fun (a0, a1) -> + Format.fprintf + fmt "(@["; + ((poly_M fmt) a0; + Format.fprintf + fmt ",@ "; + (__2 (fun fmt -> poly_M fmt) + fmt) a1); + Format.fprintf + fmt "@])")) a0; + Format.fprintf + fmt "@])") + | Identifier a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.MatchPattern.ObjectPattern.Property.Identifier@ "; + (__3 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) a0; + Format.fprintf + fmt "@])")) + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_key : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + ('M, 'T) key -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp_key poly_M) poly_T) x[@@ocaml.warning + "-32"] + and pp_property : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) property -> + unit + = + ((let __2 = Syntax.pp + and __1 = MatchPattern.pp + and __0 = pp_key in + (( fun poly_M poly_T fmt x -> + Format.fprintf fmt + "@[<2>{ "; + ((((Format.fprintf + fmt "@[%s =@ " + "Flow_ast.MatchPattern.ObjectPattern.Property.key"; + (__0 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) + x.key; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "pattern"; + (__1 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) + x.pattern; + Format.fprintf + fmt "@]"); + Format.fprintf fmt + ";@ "; + Format.fprintf fmt + "@[%s =@ " "shorthand"; + (Format.fprintf + fmt "%B") x.shorthand; + Format.fprintf fmt + "@]"); + Format.fprintf fmt + ";@ "; + Format.fprintf fmt + "@[%s =@ " "comments"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__2 (fun fmt -> poly_M fmt) + (fun fmt () -> + Format.pp_print_string + fmt "()") fmt) x; + Format.pp_print_string + fmt ")"))) x.comments; + Format.fprintf fmt + "@]"); + Format.fprintf fmt + "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_property : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + ('M, 'T) property -> + string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp_property poly_M) poly_T) x[@@ocaml.warning + "-32"] + and pp : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t -> unit + = + ((let __0 = pp_t' in + (( fun poly_M poly_T fmt (a0, a1) -> + Format.fprintf fmt + "(@["; + ((poly_M fmt) a0; + Format.fprintf fmt + ",@ "; + (__0 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) a1); + Format.fprintf fmt + "@])") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + ('M, 'T) t -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp poly_M) poly_T) x[@@ocaml.warning "-32"] + and pp_t' : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t' -> unit + = + ((let __1 = Identifier.pp + and __0 = pp_property in + (( fun poly_M poly_T fmt -> + function + | Valid a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.MatchPattern.ObjectPattern.Property.Valid@ "; + (__0 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) a0; + Format.fprintf + fmt "@])") + | InvalidShorthand a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.MatchPattern.ObjectPattern.Property.InvalidShorthand@ "; + (__1 (fun fmt -> poly_M fmt) + (fun fmt -> poly_M fmt) fmt) a0; + Format.fprintf + fmt "@])")) + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_t' : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + ('M, 'T) t' -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp_t' poly_M) poly_T) x[@@ocaml.warning + "-32"] + let _ = pp_key + and _ = show_key + and _ = pp_property + and _ = show_property + and _ = pp + and _ = show + and _ = pp_t' + and _ = show_t' + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + type ('M, 'T) t = + { + properties: ('M, 'T) Property.t list ; + rest: ('M, 'T) RestPattern.t option ; + comments: ('M, 'M Comment.t list) Syntax.t option } + [@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T) t) -> () + let rec pp : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t -> unit + = + ((let __3 = Syntax.pp + and __2 = Comment.pp + and __1 = RestPattern.pp + and __0 = Property.pp in + (( fun poly_M poly_T fmt x -> + Format.fprintf fmt + "@[<2>{ "; + (((Format.fprintf fmt + "@[%s =@ " + "Flow_ast.MatchPattern.ObjectPattern.properties"; + ((fun x -> + Format.fprintf + fmt "@[<2>["; + ignore + (List.fold_left + (fun sep x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__0 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) + x; + true) false x); + Format.fprintf + fmt "@,]@]")) x.properties; + Format.fprintf fmt + "@]"); + Format.fprintf fmt + ";@ "; + Format.fprintf fmt + "@[%s =@ " "rest"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__1 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) x; + Format.pp_print_string + fmt ")"))) x.rest; + Format.fprintf fmt + "@]"); + Format.fprintf fmt + ";@ "; + Format.fprintf fmt + "@[%s =@ " "comments"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__3 (fun fmt -> poly_M fmt) + (fun fmt x -> + Format.fprintf + fmt "@[<2>["; + ignore + (List.fold_left + (fun sep x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__2 + (fun fmt -> + poly_M fmt) fmt) + x; + true) false x); + Format.fprintf + fmt "@,]@]") fmt) x; + Format.pp_print_string + fmt ")"))) x.comments; + Format.fprintf fmt "@]"); + Format.fprintf fmt + "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp poly_M) poly_T) x[@@ocaml.warning "-32"] + let _ = pp + and _ = show + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + module ArrayPattern = + struct + module Element = + struct + type ('M, 'T) t = + { + index: 'M ; + pattern: ('M, 'T) MatchPattern.t }[@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T) t) -> () + let rec pp : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t -> unit + = + ((let __0 = MatchPattern.pp in + (( fun poly_M poly_T fmt x -> + Format.fprintf fmt + "@[<2>{ "; + ((Format.fprintf fmt + "@[%s =@ " + "Flow_ast.MatchPattern.ArrayPattern.Element.index"; + (poly_M fmt) x.index; + Format.fprintf fmt + "@]"); + Format.fprintf fmt + ";@ "; + Format.fprintf fmt + "@[%s =@ " "pattern"; + (__0 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) + x.pattern; + Format.fprintf fmt + "@]"); + Format.fprintf fmt + "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + ('M, 'T) t -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp poly_M) poly_T) x[@@ocaml.warning "-32"] + let _ = pp + and _ = show + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + type ('M, 'T) t = + { + elements: ('M, 'T) Element.t list ; + rest: ('M, 'T) RestPattern.t option ; + comments: ('M, 'M Comment.t list) Syntax.t option } + [@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T) t) -> () + let rec pp : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t -> unit + = + ((let __3 = Syntax.pp + and __2 = Comment.pp + and __1 = RestPattern.pp + and __0 = Element.pp in + (( fun poly_M poly_T fmt x -> + Format.fprintf fmt + "@[<2>{ "; + (((Format.fprintf fmt + "@[%s =@ " + "Flow_ast.MatchPattern.ArrayPattern.elements"; + ((fun x -> + Format.fprintf + fmt "@[<2>["; + ignore + (List.fold_left + (fun sep x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__0 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) + x; + true) false x); + Format.fprintf + fmt "@,]@]")) x.elements; + Format.fprintf fmt + "@]"); + Format.fprintf fmt + ";@ "; + Format.fprintf fmt + "@[%s =@ " "rest"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__1 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) x; + Format.pp_print_string + fmt ")"))) x.rest; + Format.fprintf fmt + "@]"); + Format.fprintf fmt + ";@ "; + Format.fprintf fmt + "@[%s =@ " "comments"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__3 (fun fmt -> poly_M fmt) + (fun fmt x -> + Format.fprintf + fmt "@[<2>["; + ignore + (List.fold_left + (fun sep x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__2 + (fun fmt -> + poly_M fmt) fmt) + x; + true) false x); + Format.fprintf + fmt "@,]@]") fmt) x; + Format.pp_print_string + fmt ")"))) x.comments; + Format.fprintf fmt "@]"); + Format.fprintf fmt + "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp poly_M) poly_T) x[@@ocaml.warning "-32"] + let _ = pp + and _ = show + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + module OrPattern = + struct + type ('M, 'T) t = + { + patterns: ('M, 'T) MatchPattern.t list ; + comments: ('M, unit) Syntax.t option }[@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T) t) -> () + let rec pp : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t -> unit + = + ((let __1 = Syntax.pp + and __0 = MatchPattern.pp in + (( fun poly_M poly_T fmt x -> + Format.fprintf fmt + "@[<2>{ "; + ((Format.fprintf fmt + "@[%s =@ " + "Flow_ast.MatchPattern.OrPattern.patterns"; + ((fun x -> + Format.fprintf fmt + "@[<2>["; + ignore + (List.fold_left + (fun sep x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__0 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) + x; + true) false x); + Format.fprintf fmt + "@,]@]")) x.patterns; + Format.fprintf fmt + "@]"); + Format.fprintf fmt + ";@ "; + Format.fprintf fmt + "@[%s =@ " "comments"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__1 (fun fmt -> poly_M fmt) + (fun fmt () -> + Format.pp_print_string + fmt "()") fmt) x; + Format.pp_print_string + fmt ")"))) x.comments; + Format.fprintf fmt "@]"); + Format.fprintf fmt + "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp poly_M) poly_T) x[@@ocaml.warning "-32"] + let _ = pp + and _ = show + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + module AsPattern = + struct + type ('M, 'T) target = + | Identifier of ('M, 'T) Identifier.t + | Binding of 'M * ('M, 'T) BindingPattern.t + and ('M, 'T) t = + { + pattern: ('M, 'T) MatchPattern.t ; + target: ('M, 'T) target ; + comments: ('M, unit) Syntax.t option }[@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T) target) -> () + let _ = fun (_ : ('M, 'T) t) -> () + let rec pp_target : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) target -> unit + = + ((let __1 = BindingPattern.pp + and __0 = Identifier.pp in + (( fun poly_M poly_T fmt -> + function + | Identifier a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.MatchPattern.AsPattern.Identifier@ "; + (__0 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) a0; + Format.fprintf fmt + "@])") + | Binding (a0, a1) -> + (Format.fprintf fmt + "(@[<2>Flow_ast.MatchPattern.AsPattern.Binding (@,"; + ((poly_M fmt) a0; + Format.fprintf fmt + ",@ "; + (__1 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) a1); + Format.fprintf fmt + "@,))@]")) + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_target : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + ('M, 'T) target -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp_target poly_M) poly_T) x[@@ocaml.warning + "-32"] + and pp : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t -> unit + = + ((let __2 = Syntax.pp + and __1 = pp_target + and __0 = MatchPattern.pp in + (( fun poly_M poly_T fmt x -> + Format.fprintf fmt + "@[<2>{ "; + (((Format.fprintf fmt + "@[%s =@ " + "Flow_ast.MatchPattern.AsPattern.pattern"; + (__0 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) x.pattern; + Format.fprintf fmt + "@]"); + Format.fprintf fmt + ";@ "; + Format.fprintf fmt + "@[%s =@ " "target"; + (__1 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) x.target; + Format.fprintf fmt + "@]"); + Format.fprintf fmt + ";@ "; + Format.fprintf fmt + "@[%s =@ " "comments"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__2 (fun fmt -> poly_M fmt) + (fun fmt () -> + Format.pp_print_string + fmt "()") fmt) x; + Format.pp_print_string + fmt ")"))) x.comments; + Format.fprintf fmt "@]"); + Format.fprintf fmt + "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp poly_M) poly_T) x[@@ocaml.warning "-32"] + let _ = pp_target + and _ = show_target + and _ = pp + and _ = show + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + type ('M, 'T) t = ('M * ('M, 'T) t') + and ('M, 'T) t' = + | WildcardPattern of ('M, unit) Syntax.t option + | NumberPattern of 'M NumberLiteral.t + | BigIntPattern of 'M BigIntLiteral.t + | StringPattern of 'M StringLiteral.t + | BooleanPattern of 'M BooleanLiteral.t + | NullPattern of ('M, unit) Syntax.t option + | UnaryPattern of 'M UnaryPattern.t + | BindingPattern of ('M, 'T) BindingPattern.t + | IdentifierPattern of ('M, 'T) Identifier.t + | MemberPattern of ('M, 'T) MemberPattern.t + | ObjectPattern of ('M, 'T) ObjectPattern.t + | ArrayPattern of ('M, 'T) ArrayPattern.t + | OrPattern of ('M, 'T) OrPattern.t + | AsPattern of ('M, 'T) AsPattern.t [@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T) t) -> () + let _ = fun (_ : ('M, 'T) t') -> () + let rec pp : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t -> unit + = + ((let __0 = pp_t' in + (( fun poly_M poly_T fmt (a0, a1) -> + Format.fprintf fmt "(@["; + ((poly_M fmt) a0; + Format.fprintf fmt ",@ "; + (__0 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) a1); + Format.fprintf fmt "@])") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp poly_M) poly_T) x[@@ocaml.warning "-32"] + and pp_t' : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t' -> unit + = + ((let __13 = AsPattern.pp + and __12 = OrPattern.pp + and __11 = ArrayPattern.pp + and __10 = ObjectPattern.pp + and __9 = MemberPattern.pp + and __8 = Identifier.pp + and __7 = BindingPattern.pp + and __6 = UnaryPattern.pp + and __5 = Syntax.pp + and __4 = BooleanLiteral.pp + and __3 = StringLiteral.pp + and __2 = BigIntLiteral.pp + and __1 = NumberLiteral.pp + and __0 = Syntax.pp in + (( fun poly_M poly_T fmt -> + function + | WildcardPattern a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.MatchPattern.WildcardPattern@ "; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__0 (fun fmt -> poly_M fmt) + (fun fmt () -> + Format.pp_print_string + fmt "()") fmt) x; + Format.pp_print_string + fmt ")"))) a0; + Format.fprintf fmt + "@])") + | NumberPattern a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.MatchPattern.NumberPattern@ "; + (__1 (fun fmt -> poly_M fmt) fmt) a0; + Format.fprintf fmt + "@])") + | BigIntPattern a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.MatchPattern.BigIntPattern@ "; + (__2 (fun fmt -> poly_M fmt) fmt) a0; + Format.fprintf fmt + "@])") + | StringPattern a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.MatchPattern.StringPattern@ "; + (__3 (fun fmt -> poly_M fmt) fmt) a0; + Format.fprintf fmt + "@])") + | BooleanPattern a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.MatchPattern.BooleanPattern@ "; + (__4 (fun fmt -> poly_M fmt) fmt) a0; + Format.fprintf fmt + "@])") + | NullPattern a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.MatchPattern.NullPattern@ "; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__5 (fun fmt -> poly_M fmt) + (fun fmt () -> + Format.pp_print_string + fmt "()") fmt) x; + Format.pp_print_string + fmt ")"))) a0; + Format.fprintf fmt + "@])") + | UnaryPattern a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.MatchPattern.UnaryPattern@ "; + (__6 (fun fmt -> poly_M fmt) fmt) a0; + Format.fprintf fmt + "@])") + | BindingPattern a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.MatchPattern.BindingPattern@ "; + (__7 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) a0; + Format.fprintf fmt + "@])") + | IdentifierPattern a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.MatchPattern.IdentifierPattern@ "; + (__8 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) a0; + Format.fprintf fmt + "@])") + | MemberPattern a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.MatchPattern.MemberPattern@ "; + (__9 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) a0; + Format.fprintf fmt + "@])") + | ObjectPattern a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.MatchPattern.ObjectPattern@ "; + (__10 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) a0; + Format.fprintf fmt + "@])") + | ArrayPattern a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.MatchPattern.ArrayPattern@ "; + (__11 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) a0; + Format.fprintf fmt + "@])") + | OrPattern a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.MatchPattern.OrPattern@ "; + (__12 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) a0; + Format.fprintf fmt + "@])") + | AsPattern a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.MatchPattern.AsPattern@ "; + (__13 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) a0; + Format.fprintf fmt + "@])")) + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_t' : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t' -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp_t' poly_M) poly_T) x[@@ocaml.warning "-32"] + let _ = pp + and _ = show + and _ = pp_t' + and _ = show_t' + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end and + Pattern:sig + module RestElement : + sig + type ('M, 'T) t = ('M * ('M, 'T) t') + and ('M, 'T) t' = + { + argument: ('M, 'T) Pattern.t ; + comments: ('M, unit) Syntax.t option } + [@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + val show : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + ('M, 'T) t -> + string + val pp_t' : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) t' -> + unit + val show_t' : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + ('M, 'T) t' -> + string + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + module Object : + sig + module Property : + sig + type ('M, 'T) key = + | StringLiteral of ('M * 'M StringLiteral.t) + + | NumberLiteral of ('M * 'M NumberLiteral.t) + + | BigIntLiteral of ('M * 'M BigIntLiteral.t) + + | Identifier of ('M, 'T) Identifier.t + | Computed of ('M, 'T) ComputedKey.t + and ('M, 'T) t = ('M * ('M, 'T) t') + and ('M, 'T) t' = + { + key: ('M, 'T) key ; + pattern: ('M, 'T) Pattern.t ; + default: ('M, 'T) Expression.t option ; + shorthand: bool }[@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp_key : + (Format.formatter + -> 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) key -> + unit + val show_key : + (Format.formatter + -> 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + ('M, 'T) key -> + string + val pp : + (Format.formatter + -> 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + val show : + (Format.formatter + -> 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + ('M, 'T) t -> + string + val pp_t' : + (Format.formatter + -> 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) t' -> + unit + val show_t' : + (Format.formatter + -> 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + ('M, 'T) t' -> + string + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + type ('M, 'T) property = + | Property of ('M, 'T) Property.t + | RestElement of ('M, 'T) RestElement.t + and ('M, 'T) t = + { + properties: ('M, 'T) property list ; + annot: ('M, 'T) Type.annotation_or_hint ; + comments: + ('M, 'M Comment.t list) Syntax.t option } + [@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp_property : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) property -> + unit + val show_property : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + ('M, 'T) property -> + string + val pp : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + val show : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + ('M, 'T) t -> + string + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + module Array : + sig + module Element : + sig + type ('M, 'T) t = ('M * ('M, 'T) t') + and ('M, 'T) t' = + { + argument: ('M, 'T) Pattern.t ; + default: ('M, 'T) Expression.t option } + [@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter + -> 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + val show : + (Format.formatter + -> 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + ('M, 'T) t -> + string + val pp_t' : + (Format.formatter + -> 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) t' -> + unit + val show_t' : + (Format.formatter + -> 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + ('M, 'T) t' -> + string + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + type ('M, 'T) element = + | Element of ('M, 'T) Element.t + | RestElement of ('M, 'T) RestElement.t + | Hole of 'M + and ('M, 'T) t = + { + elements: ('M, 'T) element list ; + annot: ('M, 'T) Type.annotation_or_hint ; + comments: + ('M, 'M Comment.t list) Syntax.t option } + [@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp_element : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) element -> + unit + val show_element : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + ('M, 'T) element -> + string + val pp : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + val show : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + ('M, 'T) t -> + string + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + module Identifier : + sig + type ('M, 'T) t = + { + name: ('M, 'T) Identifier.t ; + annot: ('M, 'T) Type.annotation_or_hint ; + optional: bool }[@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + val show : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + ('M, 'T) t -> + string + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + type ('M, 'T) t = ('T * ('M, 'T) t') + and ('M, 'T) t' = + | Object of ('M, 'T) Object.t + | Array of ('M, 'T) Array.t + | Identifier of ('M, 'T) Identifier.t + | Expression of ('M, 'T) Expression.t [@@deriving + show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t -> + unit + val show : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + ('M, 'T) t -> + string + val pp_t' : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t' -> + unit + val show_t' : + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + ('M, 'T) t' -> + string + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end = + struct + module RestElement = + struct + type ('M, 'T) t = ('M * ('M, 'T) t') + and ('M, 'T) t' = + { + argument: ('M, 'T) Pattern.t ; + comments: ('M, unit) Syntax.t option }[@@deriving + show] + include + struct + let _ = fun (_ : ('M, 'T) t) -> () + let _ = fun (_ : ('M, 'T) t') -> () + let rec pp : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t -> unit + = + ((let __0 = pp_t' in + (( fun poly_M poly_T fmt (a0, a1) -> + Format.fprintf fmt + "(@["; + ((poly_M fmt) a0; + Format.fprintf fmt + ",@ "; + (__0 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) a1); + Format.fprintf fmt + "@])") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + ('M, 'T) t -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp poly_M) poly_T) x[@@ocaml.warning + "-32"] + and pp_t' : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t' -> unit + = + ((let __1 = Syntax.pp + and __0 = Pattern.pp in + (( fun poly_M poly_T fmt x -> + Format.fprintf fmt + "@[<2>{ "; + ((Format.fprintf + fmt "@[%s =@ " + "Flow_ast.Pattern.RestElement.argument"; + (__0 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) + x.argument; + Format.fprintf + fmt "@]"); + Format.fprintf fmt + ";@ "; + Format.fprintf fmt + "@[%s =@ " "comments"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__1 (fun fmt -> poly_M fmt) + (fun fmt () -> + Format.pp_print_string + fmt "()") fmt) x; + Format.pp_print_string + fmt ")"))) x.comments; + Format.fprintf fmt + "@]"); + Format.fprintf fmt + "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_t' : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + ('M, 'T) t' -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp_t' poly_M) poly_T) x[@@ocaml.warning + "-32"] + let _ = pp + and _ = show + and _ = pp_t' + and _ = show_t' + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + module Object = + struct + module Property = + struct + type ('M, 'T) key = + | StringLiteral of ('M * 'M StringLiteral.t) + | NumberLiteral of ('M * 'M NumberLiteral.t) + | BigIntLiteral of ('M * 'M BigIntLiteral.t) + | Identifier of ('M, 'T) Identifier.t + | Computed of ('M, 'T) ComputedKey.t + and ('M, 'T) t = ('M * ('M, 'T) t') + and ('M, 'T) t' = + { + key: ('M, 'T) key ; + pattern: ('M, 'T) Pattern.t ; + default: ('M, 'T) Expression.t option ; + shorthand: bool }[@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T) key) -> () + let _ = fun (_ : ('M, 'T) t) -> () + let _ = fun (_ : ('M, 'T) t') -> () + let rec pp_key : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) key -> + unit + = + ((let __4 = ComputedKey.pp + and __3 = Identifier.pp + and __2 = BigIntLiteral.pp + and __1 = NumberLiteral.pp + and __0 = StringLiteral.pp in + (( + fun poly_M poly_T fmt -> + function + | StringLiteral a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Pattern.Object.Property.StringLiteral@ "; + ((fun (a0, a1) -> + Format.fprintf + fmt "(@["; + ((poly_M fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt -> poly_M fmt) + fmt) a1); + Format.fprintf + fmt "@])")) a0; + Format.fprintf + fmt "@])") + | NumberLiteral a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Pattern.Object.Property.NumberLiteral@ "; + ((fun (a0, a1) -> + Format.fprintf + fmt "(@["; + ((poly_M fmt) a0; + Format.fprintf + fmt ",@ "; + (__1 + (fun fmt -> poly_M fmt) + fmt) a1); + Format.fprintf + fmt "@])")) a0; + Format.fprintf + fmt "@])") + | BigIntLiteral a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Pattern.Object.Property.BigIntLiteral@ "; + ((fun (a0, a1) -> + Format.fprintf + fmt "(@["; + ((poly_M fmt) a0; + Format.fprintf + fmt ",@ "; + (__2 + (fun fmt -> poly_M fmt) + fmt) a1); + Format.fprintf + fmt "@])")) a0; + Format.fprintf + fmt "@])") + | Identifier a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Pattern.Object.Property.Identifier@ "; + (__3 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) + a0; + Format.fprintf + fmt "@])") + | Computed a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Pattern.Object.Property.Computed@ "; + (__4 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) + a0; + Format.fprintf + fmt "@])")) + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_key : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + ('M, 'T) key -> + string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp_key poly_M) poly_T) x[@@ocaml.warning + "-32"] + and pp : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + = + ((let __0 = pp_t' in + (( + fun poly_M poly_T fmt (a0, a1) -> + Format.fprintf + fmt "(@["; + ((poly_M fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) a1); + Format.fprintf + fmt "@])") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + ('M, 'T) t -> + string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp poly_M) poly_T) x[@@ocaml.warning + "-32"] + and pp_t' : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) t' -> + unit + = + ((let __2 = Expression.pp + and __1 = Pattern.pp + and __0 = pp_key in + (( + fun poly_M poly_T fmt x -> + Format.fprintf + fmt "@[<2>{ "; + ((((Format.fprintf + fmt "@[%s =@ " + "Flow_ast.Pattern.Object.Property.key"; + (__0 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) + x.key; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "pattern"; + (__1 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) + x.pattern; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "default"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__2 + (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) + fmt) x; + Format.pp_print_string + fmt ")"))) x.default; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "shorthand"; + (Format.fprintf + fmt "%B") x.shorthand; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_t' : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + ('M, 'T) t' -> + string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp_t' poly_M) poly_T) x[@@ocaml.warning + "-32"] + let _ = pp_key + and _ = show_key + and _ = pp + and _ = show + and _ = pp_t' + and _ = show_t' + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + type ('M, 'T) property = + | Property of ('M, 'T) Property.t + | RestElement of ('M, 'T) RestElement.t + and ('M, 'T) t = + { + properties: ('M, 'T) property list ; + annot: ('M, 'T) Type.annotation_or_hint ; + comments: ('M, 'M Comment.t list) Syntax.t option } + [@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T) property) -> () + let _ = fun (_ : ('M, 'T) t) -> () + let rec pp_property : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) property -> + unit + = + ((let __1 = RestElement.pp + and __0 = Property.pp in + (( fun poly_M poly_T fmt -> + function + | Property a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Pattern.Object.Property@ "; + (__0 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) a0; + Format.fprintf + fmt "@])") + | RestElement a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Pattern.Object.RestElement@ "; + (__1 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) a0; + Format.fprintf + fmt "@])")) + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_property : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + ('M, 'T) property -> + string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp_property poly_M) poly_T) x[@@ocaml.warning + "-32"] + and pp : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t -> unit + = + ((let __3 = Syntax.pp + and __2 = Comment.pp + and __1 = Type.pp_annotation_or_hint + and __0 = pp_property in + (( fun poly_M poly_T fmt x -> + Format.fprintf fmt + "@[<2>{ "; + (((Format.fprintf + fmt "@[%s =@ " + "Flow_ast.Pattern.Object.properties"; + ((fun x -> + Format.fprintf + fmt "@[<2>["; + ignore + (List.fold_left + (fun sep x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__0 + (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) + fmt) x; + true) false x); + Format.fprintf + fmt "@,]@]")) x.properties; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "annot"; + (__1 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) + x.annot; + Format.fprintf + fmt "@]"); + Format.fprintf fmt + ";@ "; + Format.fprintf fmt + "@[%s =@ " "comments"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__3 (fun fmt -> poly_M fmt) + (fun fmt x -> + Format.fprintf + fmt "@[<2>["; + ignore + (List.fold_left + (fun sep x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__2 + (fun fmt -> + poly_M fmt) + fmt) x; + true) false x); + Format.fprintf + fmt "@,]@]") fmt) x; + Format.pp_print_string + fmt ")"))) x.comments; + Format.fprintf fmt + "@]"); + Format.fprintf fmt + "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + ('M, 'T) t -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp poly_M) poly_T) x[@@ocaml.warning + "-32"] + let _ = pp_property + and _ = show_property + and _ = pp + and _ = show + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + module Array = + struct + module Element = + struct + type ('M, 'T) t = ('M * ('M, 'T) t') + and ('M, 'T) t' = + { + argument: ('M, 'T) Pattern.t ; + default: ('M, 'T) Expression.t option }[@@deriving + show] + include + struct + let _ = fun (_ : ('M, 'T) t) -> () + let _ = fun (_ : ('M, 'T) t') -> () + let rec pp : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + = + ((let __0 = pp_t' in + (( + fun poly_M poly_T fmt (a0, a1) -> + Format.fprintf + fmt "(@["; + ((poly_M fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) a1); + Format.fprintf + fmt "@])") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + ('M, 'T) t -> + string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp poly_M) poly_T) x[@@ocaml.warning + "-32"] + and pp_t' : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) t' -> + unit + = + ((let __1 = Expression.pp + and __0 = Pattern.pp in + (( + fun poly_M poly_T fmt x -> + Format.fprintf + fmt "@[<2>{ "; + ((Format.fprintf + fmt "@[%s =@ " + "Flow_ast.Pattern.Array.Element.argument"; + (__0 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) + x.argument; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "default"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__1 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) + fmt) x; + Format.pp_print_string + fmt ")"))) x.default; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_t' : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + ('M, 'T) t' -> + string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp_t' poly_M) poly_T) x[@@ocaml.warning + "-32"] + let _ = pp + and _ = show + and _ = pp_t' + and _ = show_t' + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + type ('M, 'T) element = + | Element of ('M, 'T) Element.t + | RestElement of ('M, 'T) RestElement.t + | Hole of 'M + and ('M, 'T) t = + { + elements: ('M, 'T) element list ; + annot: ('M, 'T) Type.annotation_or_hint ; + comments: ('M, 'M Comment.t list) Syntax.t option } + [@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T) element) -> () + let _ = fun (_ : ('M, 'T) t) -> () + let rec pp_element : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) element -> + unit + = + ((let __1 = RestElement.pp + and __0 = Element.pp in + (( fun poly_M poly_T fmt -> + function + | Element a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Pattern.Array.Element@ "; + (__0 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) a0; + Format.fprintf + fmt "@])") + | RestElement a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Pattern.Array.RestElement@ "; + (__1 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) a0; + Format.fprintf + fmt "@])") + | Hole a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Pattern.Array.Hole@ "; + (poly_M fmt) a0; + Format.fprintf + fmt "@])")) + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_element : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + ('M, 'T) element -> + string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp_element poly_M) poly_T) x[@@ocaml.warning + "-32"] + and pp : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t -> unit + = + ((let __3 = Syntax.pp + and __2 = Comment.pp + and __1 = Type.pp_annotation_or_hint + and __0 = pp_element in + (( fun poly_M poly_T fmt x -> + Format.fprintf fmt + "@[<2>{ "; + (((Format.fprintf + fmt "@[%s =@ " + "Flow_ast.Pattern.Array.elements"; + ((fun x -> + Format.fprintf + fmt "@[<2>["; + ignore + (List.fold_left + (fun sep x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__0 + (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) + fmt) x; + true) false x); + Format.fprintf + fmt "@,]@]")) x.elements; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "annot"; + (__1 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) + x.annot; + Format.fprintf + fmt "@]"); + Format.fprintf fmt + ";@ "; + Format.fprintf fmt + "@[%s =@ " "comments"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__3 (fun fmt -> poly_M fmt) + (fun fmt x -> + Format.fprintf + fmt "@[<2>["; + ignore + (List.fold_left + (fun sep x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__2 + (fun fmt -> + poly_M fmt) + fmt) x; + true) false x); + Format.fprintf + fmt "@,]@]") fmt) x; + Format.pp_print_string + fmt ")"))) x.comments; + Format.fprintf fmt + "@]"); + Format.fprintf fmt + "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + ('M, 'T) t -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp poly_M) poly_T) x[@@ocaml.warning + "-32"] + let _ = pp_element + and _ = show_element + and _ = pp + and _ = show + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + module Identifier = + struct + type ('M, 'T) t = + { + name: ('M, 'T) Identifier.t ; + annot: ('M, 'T) Type.annotation_or_hint ; + optional: bool }[@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T) t) -> () + let rec pp : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t -> unit + = + ((let __1 = Type.pp_annotation_or_hint + and __0 = Identifier.pp in + (( fun poly_M poly_T fmt x -> + Format.fprintf fmt + "@[<2>{ "; + (((Format.fprintf + fmt "@[%s =@ " + "Flow_ast.Pattern.Identifier.name"; + (__0 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) + x.name; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "annot"; + (__1 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) + x.annot; + Format.fprintf + fmt "@]"); + Format.fprintf fmt + ";@ "; + Format.fprintf fmt + "@[%s =@ " "optional"; + (Format.fprintf + fmt "%B") x.optional; + Format.fprintf fmt + "@]"); + Format.fprintf fmt + "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + ('M, 'T) t -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp poly_M) poly_T) x[@@ocaml.warning + "-32"] + let _ = pp + and _ = show + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + type ('M, 'T) t = ('T * ('M, 'T) t') + and ('M, 'T) t' = + | Object of ('M, 'T) Object.t + | Array of ('M, 'T) Array.t + | Identifier of ('M, 'T) Identifier.t + | Expression of ('M, 'T) Expression.t [@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T) t) -> () + let _ = fun (_ : ('M, 'T) t') -> () + let rec pp : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t -> unit + = + ((let __0 = pp_t' in + (( fun poly_M poly_T fmt (a0, a1) -> + Format.fprintf fmt + "(@["; + ((poly_T fmt) a0; + Format.fprintf fmt + ",@ "; + (__0 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) a1); + Format.fprintf fmt + "@])") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp poly_M) poly_T) x[@@ocaml.warning "-32"] + and pp_t' : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> + Format.formatter -> + ('M, 'T) t' -> unit + = + ((let __3 = Expression.pp + and __2 = Identifier.pp + and __1 = Array.pp + and __0 = Object.pp in + (( fun poly_M poly_T fmt -> + function + | Object a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.Pattern.Object@ "; + (__0 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) a0; + Format.fprintf fmt + "@])") + | Array a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.Pattern.Array@ "; + (__1 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) a0; + Format.fprintf fmt + "@])") + | Identifier a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.Pattern.Identifier@ "; + (__2 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) a0; + Format.fprintf fmt + "@])") + | Expression a0 -> + (Format.fprintf fmt + "(@[<2>Flow_ast.Pattern.Expression@ "; + (__3 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) fmt) a0; + Format.fprintf fmt + "@])")) + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_t' : + 'M 'T . + (Format.formatter -> + 'M -> unit) + -> + (Format.formatter -> + 'T -> unit) + -> ('M, 'T) t' -> string + = + fun poly_M poly_T x -> + Format.asprintf "%a" + ((pp_t' poly_M) poly_T) x[@@ocaml.warning "-32"] + let _ = pp + and _ = show + and _ = pp_t' + and _ = show_t' + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end and + Comment:sig + type 'M t = ('M * t') + and kind = + | Block + | Line + and t' = + { + kind: kind ; + text: string ; + on_newline: bool }[@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter + -> 'M -> unit) + -> + Format.formatter + -> + 'M t -> unit + val show : + (Format.formatter + -> 'M -> unit) + -> + 'M t -> string + val pp_kind : + Format.formatter + -> kind -> unit + val show_kind : + kind -> string + val pp_t' : + Format.formatter + -> t' -> unit + val show_t' : + t' -> string + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end = + struct + type 'M t = ('M * t') + and kind = + | Block + | Line + and t' = + { + kind: kind ; + text: string ; + on_newline: bool }[@@deriving show] + include + struct + let _ = fun (_ : 'M t) -> () + let _ = fun (_ : kind) -> () + let _ = fun (_ : t') -> () + let rec pp : + 'M . + (Format.formatter -> + 'M -> unit) + -> + Format.formatter -> + 'M t -> unit + = + ((let __0 = pp_t' in + ((fun poly_M fmt (a0, a1) -> + Format.fprintf fmt + "(@["; + ((poly_M fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 fmt) a1); + Format.fprintf fmt + "@])") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M . + (Format.formatter -> + 'M -> unit) + -> 'M t -> string + = + fun poly_M x -> + Format.asprintf "%a" + (pp poly_M) x[@@ocaml.warning "-32"] + and pp_kind : + Format.formatter -> + kind -> unit + = + ((fun fmt -> + function + | Block -> + Format.pp_print_string + fmt "Flow_ast.Comment.Block" + | Line -> + Format.pp_print_string + fmt "Flow_ast.Comment.Line") + [@ocaml.warning "-39"][@ocaml.warning "-A"]) + and show_kind : + kind -> string = + fun x -> + Format.asprintf "%a" + pp_kind x[@@ocaml.warning "-32"] + and pp_t' : + Format.formatter -> + t' -> unit + = + ((let __0 = pp_kind in + ((fun fmt x -> + Format.fprintf fmt + "@[<2>{ "; + (((Format.fprintf + fmt "@[%s =@ " + "Flow_ast.Comment.kind"; + (__0 fmt) x.kind; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "text"; + (Format.fprintf + fmt "%S") x.text; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "on_newline"; + (Format.fprintf + fmt "%B") x.on_newline; + Format.fprintf + fmt "@]"); + Format.fprintf fmt + "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_t' : t' -> string = + fun x -> + Format.asprintf "%a" + pp_t' x[@@ocaml.warning "-32"] + let _ = pp + and _ = show + and _ = pp_kind + and _ = show_kind + and _ = pp_t' + and _ = show_t' + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end and + Class:sig + module Method : + sig + type ('M, 'T) t = ('T * ('M, 'T) t') + and kind = + | Constructor + | Method + | Get + | Set + and ('M, 'T) t' = + { + kind: kind ; + key: + ('M, 'T) + Expression.Object.Property.key + ; + value: ('M * ('M, 'T) Function.t) ; + static: bool ; + decorators: + ('M, 'T) Class.Decorator.t list ; + comments: ('M, unit) Syntax.t option } + [@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + val show : + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t -> + string + val pp_kind : + Format.formatter + -> + kind -> + unit + val show_kind : + kind -> + string + val pp_t' : + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t' -> + unit + val show_t' : + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t' -> + string + end[@@ocaml.doc "@inline"][@@merlin.hide + ] + end + module Property : + sig + type ('M, 'T) t = ('T * ('M, 'T) t') + and ('M, 'T) t' = + { + key: + ('M, 'T) + Expression.Object.Property.key + ; + value: ('M, 'T) value ; + annot: + ('M, 'T) Type.annotation_or_hint ; + static: bool ; + variance: 'M Variance.t option ; + decorators: + ('M, 'T) Class.Decorator.t list ; + comments: ('M, unit) Syntax.t option } + and ('M, 'T) value = + | Declared + | Uninitialized + | Initialized of ('M, 'T) Expression.t + [@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + val show : + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t -> + string + val pp_t' : + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t' -> + unit + val show_t' : + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t' -> + string + val pp_value : + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) value -> + unit + val show_value : + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) value -> + string + end[@@ocaml.doc "@inline"][@@merlin.hide + ] + end + module PrivateField : + sig + type ('M, 'T) t = ('T * ('M, 'T) t') + and ('M, 'T) t' = + { + key: 'M PrivateName.t ; + value: ('M, 'T) Class.Property.value ; + annot: + ('M, 'T) Type.annotation_or_hint ; + static: bool ; + variance: 'M Variance.t option ; + decorators: + ('M, 'T) Class.Decorator.t list ; + comments: ('M, unit) Syntax.t option } + [@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + val show : + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t -> + string + val pp_t' : + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t' -> + unit + val show_t' : + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t' -> + string + end[@@ocaml.doc "@inline"][@@merlin.hide + ] + end + module Extends : + sig + type ('M, 'T) t = ('M * ('M, 'T) t') + and ('M, 'T) t' = + { + expr: ('M, 'T) Expression.t ; + targs: ('M, 'T) Type.TypeArgs.t option ; + comments: ('M, unit) Syntax.t option } + [@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + val show : + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t -> + string + val pp_t' : + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t' -> + unit + val show_t' : + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t' -> + string + end[@@ocaml.doc "@inline"][@@merlin.hide + ] + end + module Implements : + sig + module Interface : + sig + type ('M, 'T) t = ('M * ('M, 'T) t') + and ('M, 'T) t' = + { + id: ('M, 'T) Identifier.t ; + targs: + ('M, 'T) Type.TypeArgs.t option } + [@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + val show : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t -> + string + val pp_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t' -> + unit + val show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t' -> + string + end[@@ocaml.doc "@inline"][@@merlin.hide + ] + end + type ('M, 'T) t = ('M * ('M, 'T) t') + and ('M, 'T) t' = + { + interfaces: ('M, 'T) Interface.t list ; + comments: ('M, unit) Syntax.t option } + [@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + val show : + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t -> + string + val pp_t' : + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t' -> + unit + val show_t' : + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t' -> + string + end[@@ocaml.doc "@inline"][@@merlin.hide + ] + end + module Body : + sig + type ('M, 'T) t = ('M * ('M, 'T) t') + and ('M, 'T) t' = + { + body: ('M, 'T) element list ; + comments: ('M, unit) Syntax.t option } + and ('M, 'T) element = + | Method of ('M, 'T) Method.t + | Property of ('M, 'T) Property.t + | PrivateField of ('M, 'T) + PrivateField.t [@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + val show : + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t -> + string + val pp_t' : + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t' -> + unit + val show_t' : + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t' -> + string + val pp_element : + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) element -> + unit + val show_element : + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) element -> + string + end[@@ocaml.doc "@inline"][@@merlin.hide + ] + end + module Decorator : + sig + type ('M, 'T) t = ('M * ('M, 'T) t') + and ('M, 'T) t' = + { + expression: ('M, 'T) Expression.t ; + comments: ('M, unit) Syntax.t option } + [@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + val show : + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t -> + string + val pp_t' : + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t' -> + unit + val show_t' : + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t' -> + string + end[@@ocaml.doc "@inline"][@@merlin.hide + ] + end + type ('M, 'T) t = + { + id: ('M, 'T) Identifier.t option ; + body: ('M, 'T) Class.Body.t ; + tparams: + ('M, 'T) Type.TypeParams.t option ; + extends: ('M, 'T) Extends.t option ; + implements: ('M, 'T) Implements.t option ; + class_decorators: + ('M, 'T) Decorator.t list ; + comments: ('M, unit) Syntax.t option } + [@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + val show : + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> unit) + -> + ('M, 'T) t -> + string + end[@@ocaml.doc "@inline"][@@merlin.hide + ] + end = + struct + module Method = + struct + type ('M, 'T) t = ('T * ('M, 'T) t') + and kind = + | Constructor + | Method + | Get + | Set + and ('M, 'T) t' = + { + kind: kind ; + key: + ('M, 'T) Expression.Object.Property.key ; + value: ('M * ('M, 'T) Function.t) ; + static: bool ; + decorators: + ('M, 'T) Class.Decorator.t list ; + comments: ('M, unit) Syntax.t option } + [@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T) t) -> () + let _ = fun (_ : kind) -> () + let _ = fun (_ : ('M, 'T) t') -> () + let rec pp : + 'M 'T . + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + = + ((let __0 = pp_t' in + (( + fun poly_M poly_T fmt (a0, a1) + -> + Format.fprintf + fmt "(@["; + ((poly_T fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) + fmt) a1); + Format.fprintf + fmt "@])") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> unit) + -> + ('M, 'T) t -> + string + = + fun poly_M poly_T x -> + Format.asprintf + "%a" ((pp poly_M) poly_T) x + [@@ocaml.warning "-32"] + and pp_kind : + Format.formatter + -> kind -> unit + = + (( + fun fmt -> + function + | Constructor -> + Format.pp_print_string + fmt + "Flow_ast.Class.Method.Constructor" + | Method -> + Format.pp_print_string + fmt + "Flow_ast.Class.Method.Method" + | Get -> + Format.pp_print_string + fmt + "Flow_ast.Class.Method.Get" + | Set -> + Format.pp_print_string + fmt + "Flow_ast.Class.Method.Set") + [@ocaml.warning "-39"][@ocaml.warning + "-A"]) + and show_kind : + kind -> string = + fun x -> + Format.asprintf + "%a" pp_kind x[@@ocaml.warning + "-32"] + and pp_t' : + 'M 'T . + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) t' -> + unit + = + ((let __4 = Syntax.pp + and __3 = Class.Decorator.pp + and __2 = Function.pp + and __1 = + Expression.Object.Property.pp_key + and __0 = pp_kind in + (( + fun poly_M poly_T fmt x -> + Format.fprintf + fmt "@[<2>{ "; + ((((((Format.fprintf + fmt "@[%s =@ " + "Flow_ast.Class.Method.kind"; + (__0 fmt) x.kind; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "key"; + (__1 + (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) + fmt) x.key; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "value"; + ((fun (a0, a1) -> + Format.fprintf + fmt "(@["; + ((poly_M fmt) a0; + Format.fprintf + fmt ",@ "; + (__2 + (fun fmt -> + poly_M fmt) + (fun fmt -> + poly_T fmt) fmt) + a1); + Format.fprintf + fmt "@])")) + x.value; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "static"; + (Format.fprintf + fmt "%B") x.static; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " + "decorators"; + ((fun x -> + Format.fprintf + fmt "@[<2>["; + ignore + (List.fold_left + (fun sep x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__3 + (fun fmt -> + poly_M fmt) + (fun fmt -> + poly_T fmt) + fmt) x; + true) false x); + Format.fprintf + fmt "@,]@]")) + x.decorators; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "comments"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__4 + (fun fmt -> + poly_M fmt) + (fun fmt () -> + Format.pp_print_string + fmt "()") fmt) + x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_t' : + 'M 'T . + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> unit) + -> + ('M, 'T) t' -> + string + = + fun poly_M poly_T x -> + Format.asprintf + "%a" ((pp_t' poly_M) poly_T) x + [@@ocaml.warning "-32"] + let _ = pp + and _ = show + and _ = pp_kind + and _ = show_kind + and _ = pp_t' + and _ = show_t' + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + module Property = + struct + type ('M, 'T) t = ('T * ('M, 'T) t') + and ('M, 'T) t' = + { + key: + ('M, 'T) Expression.Object.Property.key ; + value: ('M, 'T) value ; + annot: ('M, 'T) Type.annotation_or_hint ; + static: bool ; + variance: 'M Variance.t option ; + decorators: + ('M, 'T) Class.Decorator.t list ; + comments: ('M, unit) Syntax.t option } + and ('M, 'T) value = + | Declared + | Uninitialized + | Initialized of ('M, 'T) Expression.t + [@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T) t) -> () + let _ = fun (_ : ('M, 'T) t') -> () + let _ = fun (_ : ('M, 'T) value) -> () + let rec pp : + 'M 'T . + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + = + ((let __0 = pp_t' in + (( + fun poly_M poly_T fmt (a0, a1) + -> + Format.fprintf + fmt "(@["; + ((poly_T fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) + fmt) a1); + Format.fprintf + fmt "@])") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> unit) + -> + ('M, 'T) t -> + string + = + fun poly_M poly_T x -> + Format.asprintf + "%a" ((pp poly_M) poly_T) x + [@@ocaml.warning "-32"] + and pp_t' : + 'M 'T . + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) t' -> + unit + = + ((let __5 = Syntax.pp + and __4 = Class.Decorator.pp + and __3 = Variance.pp + and __2 = Type.pp_annotation_or_hint + and __1 = pp_value + and __0 = + Expression.Object.Property.pp_key in + (( + fun poly_M poly_T fmt x -> + Format.fprintf + fmt "@[<2>{ "; + (((((((Format.fprintf + fmt "@[%s =@ " + "Flow_ast.Class.Property.key"; + (__0 + (fun fmt -> + poly_M fmt) + (fun fmt -> + poly_T fmt) fmt) + x.key; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "value"; + (__1 + (fun fmt -> + poly_M fmt) + (fun fmt -> + poly_T fmt) fmt) + x.value; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "annot"; + (__2 + (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) + fmt) x.annot; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "static"; + (Format.fprintf + fmt "%B") x.static; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "variance"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__3 + (fun fmt -> + poly_M fmt) + fmt) x; + Format.pp_print_string + fmt ")"))) + x.variance; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " + "decorators"; + ((fun x -> + Format.fprintf + fmt "@[<2>["; + ignore + (List.fold_left + (fun sep x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__4 + (fun fmt -> + poly_M fmt) + (fun fmt -> + poly_T fmt) + fmt) x; + true) false x); + Format.fprintf + fmt "@,]@]")) + x.decorators; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "comments"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__5 + (fun fmt -> + poly_M fmt) + (fun fmt () -> + Format.pp_print_string + fmt "()") fmt) + x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_t' : + 'M 'T . + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> unit) + -> + ('M, 'T) t' -> + string + = + fun poly_M poly_T x -> + Format.asprintf + "%a" ((pp_t' poly_M) poly_T) x + [@@ocaml.warning "-32"] + and pp_value : + 'M 'T . + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) value -> + unit + = + ((let __0 = Expression.pp in + (( + fun poly_M poly_T fmt -> + function + | Declared -> + Format.pp_print_string + fmt + "Flow_ast.Class.Property.Declared" + | Uninitialized -> + Format.pp_print_string + fmt + "Flow_ast.Class.Property.Uninitialized" + | Initialized a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Class.Property.Initialized@ "; + (__0 + (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) + fmt) a0; + Format.fprintf + fmt "@])")) + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_value : + 'M 'T . + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> unit) + -> + ('M, 'T) value -> + string + = + fun poly_M poly_T x -> + Format.asprintf + "%a" ((pp_value poly_M) poly_T) x + [@@ocaml.warning "-32"] + let _ = pp + and _ = show + and _ = pp_t' + and _ = show_t' + and _ = pp_value + and _ = show_value + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + module PrivateField = + struct + type ('M, 'T) t = ('T * ('M, 'T) t') + and ('M, 'T) t' = + { + key: 'M PrivateName.t ; + value: ('M, 'T) Class.Property.value ; + annot: ('M, 'T) Type.annotation_or_hint ; + static: bool ; + variance: 'M Variance.t option ; + decorators: + ('M, 'T) Class.Decorator.t list ; + comments: ('M, unit) Syntax.t option } + [@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T) t) -> () + let _ = fun (_ : ('M, 'T) t') -> () + let rec pp : + 'M 'T . + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + = + ((let __0 = pp_t' in + (( + fun poly_M poly_T fmt (a0, a1) + -> + Format.fprintf + fmt "(@["; + ((poly_T fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) + fmt) a1); + Format.fprintf + fmt "@])") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> unit) + -> + ('M, 'T) t -> + string + = + fun poly_M poly_T x -> + Format.asprintf + "%a" ((pp poly_M) poly_T) x + [@@ocaml.warning "-32"] + and pp_t' : + 'M 'T . + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) t' -> + unit + = + ((let __5 = Syntax.pp + and __4 = Class.Decorator.pp + and __3 = Variance.pp + and __2 = Type.pp_annotation_or_hint + and __1 = Class.Property.pp_value + and __0 = PrivateName.pp in + (( + fun poly_M poly_T fmt x -> + Format.fprintf + fmt "@[<2>{ "; + (((((((Format.fprintf + fmt "@[%s =@ " + "Flow_ast.Class.PrivateField.key"; + (__0 + (fun fmt -> + poly_M fmt) fmt) + x.key; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "value"; + (__1 + (fun fmt -> + poly_M fmt) + (fun fmt -> + poly_T fmt) fmt) + x.value; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "annot"; + (__2 + (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) + fmt) x.annot; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "static"; + (Format.fprintf + fmt "%B") x.static; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "variance"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__3 + (fun fmt -> + poly_M fmt) + fmt) x; + Format.pp_print_string + fmt ")"))) + x.variance; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " + "decorators"; + ((fun x -> + Format.fprintf + fmt "@[<2>["; + ignore + (List.fold_left + (fun sep x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__4 + (fun fmt -> + poly_M fmt) + (fun fmt -> + poly_T fmt) + fmt) x; + true) false x); + Format.fprintf + fmt "@,]@]")) + x.decorators; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "comments"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__5 + (fun fmt -> + poly_M fmt) + (fun fmt () -> + Format.pp_print_string + fmt "()") fmt) + x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_t' : + 'M 'T . + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> unit) + -> + ('M, 'T) t' -> + string + = + fun poly_M poly_T x -> + Format.asprintf + "%a" ((pp_t' poly_M) poly_T) x + [@@ocaml.warning "-32"] + let _ = pp + and _ = show + and _ = pp_t' + and _ = show_t' + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + module Extends = + struct + type ('M, 'T) t = ('M * ('M, 'T) t') + and ('M, 'T) t' = + { + expr: ('M, 'T) Expression.t ; + targs: ('M, 'T) Type.TypeArgs.t option ; + comments: ('M, unit) Syntax.t option } + [@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T) t) -> () + let _ = fun (_ : ('M, 'T) t') -> () + let rec pp : + 'M 'T . + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + = + ((let __0 = pp_t' in + (( + fun poly_M poly_T fmt (a0, a1) + -> + Format.fprintf + fmt "(@["; + ((poly_M fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) + fmt) a1); + Format.fprintf + fmt "@])") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> unit) + -> + ('M, 'T) t -> + string + = + fun poly_M poly_T x -> + Format.asprintf + "%a" ((pp poly_M) poly_T) x + [@@ocaml.warning "-32"] + and pp_t' : + 'M 'T . + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) t' -> + unit + = + ((let __2 = Syntax.pp + and __1 = Type.TypeArgs.pp + and __0 = Expression.pp in + (( + fun poly_M poly_T fmt x -> + Format.fprintf + fmt "@[<2>{ "; + (((Format.fprintf + fmt "@[%s =@ " + "Flow_ast.Class.Extends.expr"; + (__0 + (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) + fmt) x.expr; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "targs"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__1 + (fun fmt -> + poly_M fmt) + (fun fmt -> + poly_T fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.targs; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "comments"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__2 + (fun fmt -> + poly_M fmt) + (fun fmt () -> + Format.pp_print_string + fmt "()") fmt) + x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_t' : + 'M 'T . + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> unit) + -> + ('M, 'T) t' -> + string + = + fun poly_M poly_T x -> + Format.asprintf + "%a" ((pp_t' poly_M) poly_T) x + [@@ocaml.warning "-32"] + let _ = pp + and _ = show + and _ = pp_t' + and _ = show_t' + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + module Implements = + struct + module Interface = + struct + type ('M, 'T) t = ('M * ('M, 'T) t') + and ('M, 'T) t' = + { + id: ('M, 'T) Identifier.t ; + targs: ('M, 'T) Type.TypeArgs.t option } + [@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T) t) -> () + let _ = fun (_ : ('M, 'T) t') -> () + let rec pp : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + = + ((let __0 = pp_t' in + (( + fun poly_M poly_T fmt + (a0, a1) -> + Format.fprintf + fmt "(@["; + ((poly_M fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) + fmt) a1); + Format.fprintf + fmt "@])") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t -> + string + = + fun poly_M poly_T x -> + Format.asprintf + "%a" ((pp poly_M) poly_T) x + [@@ocaml.warning "-32"] + and pp_t' : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t' -> + unit + = + ((let __1 = Type.TypeArgs.pp + and __0 = Identifier.pp in + (( + fun poly_M poly_T fmt x -> + Format.fprintf + fmt "@[<2>{ "; + ((Format.fprintf + fmt "@[%s =@ " + "Flow_ast.Class.Implements.Interface.id"; + (__0 + (fun fmt -> + poly_M fmt) + (fun fmt -> + poly_T fmt) fmt) + x.id; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "targs"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__1 + (fun fmt -> + poly_M fmt) + (fun fmt -> + poly_T fmt) + fmt) x; + Format.pp_print_string + fmt ")"))) + x.targs; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_t' : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t' -> + string + = + fun poly_M poly_T x -> + Format.asprintf + "%a" ((pp_t' poly_M) poly_T) x + [@@ocaml.warning "-32"] + let _ = pp + and _ = show + and _ = pp_t' + and _ = show_t' + end[@@ocaml.doc "@inline"][@@merlin.hide + ] + end + type ('M, 'T) t = ('M * ('M, 'T) t') + and ('M, 'T) t' = + { + interfaces: ('M, 'T) Interface.t list ; + comments: ('M, unit) Syntax.t option } + [@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T) t) -> () + let _ = fun (_ : ('M, 'T) t') -> () + let rec pp : + 'M 'T . + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + = + ((let __0 = pp_t' in + (( + fun poly_M poly_T fmt (a0, a1) + -> + Format.fprintf + fmt "(@["; + ((poly_M fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) + fmt) a1); + Format.fprintf + fmt "@])") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> unit) + -> + ('M, 'T) t -> + string + = + fun poly_M poly_T x -> + Format.asprintf + "%a" ((pp poly_M) poly_T) x + [@@ocaml.warning "-32"] + and pp_t' : + 'M 'T . + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) t' -> + unit + = + ((let __1 = Syntax.pp + and __0 = Interface.pp in + (( + fun poly_M poly_T fmt x -> + Format.fprintf + fmt "@[<2>{ "; + ((Format.fprintf + fmt "@[%s =@ " + "Flow_ast.Class.Implements.interfaces"; + ((fun x -> + Format.fprintf + fmt "@[<2>["; + ignore + (List.fold_left + (fun sep x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__0 + (fun fmt -> + poly_M fmt) + (fun fmt -> + poly_T fmt) + fmt) x; + true) false x); + Format.fprintf + fmt "@,]@]")) + x.interfaces; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "comments"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__1 + (fun fmt -> + poly_M fmt) + (fun fmt () -> + Format.pp_print_string + fmt "()") fmt) + x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_t' : + 'M 'T . + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> unit) + -> + ('M, 'T) t' -> + string + = + fun poly_M poly_T x -> + Format.asprintf + "%a" ((pp_t' poly_M) poly_T) x + [@@ocaml.warning "-32"] + let _ = pp + and _ = show + and _ = pp_t' + and _ = show_t' + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + module Body = + struct + type ('M, 'T) t = ('M * ('M, 'T) t') + and ('M, 'T) t' = + { + body: ('M, 'T) element list ; + comments: ('M, unit) Syntax.t option } + and ('M, 'T) element = + | Method of ('M, 'T) Method.t + | Property of ('M, 'T) Property.t + | PrivateField of ('M, 'T) PrivateField.t + [@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T) t) -> () + let _ = fun (_ : ('M, 'T) t') -> () + let _ = fun (_ : ('M, 'T) element) -> () + let rec pp : + 'M 'T . + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + = + ((let __0 = pp_t' in + (( + fun poly_M poly_T fmt (a0, a1) + -> + Format.fprintf + fmt "(@["; + ((poly_M fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) + fmt) a1); + Format.fprintf + fmt "@])") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> unit) + -> + ('M, 'T) t -> + string + = + fun poly_M poly_T x -> + Format.asprintf + "%a" ((pp poly_M) poly_T) x + [@@ocaml.warning "-32"] + and pp_t' : + 'M 'T . + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) t' -> + unit + = + ((let __1 = Syntax.pp + and __0 = pp_element in + (( + fun poly_M poly_T fmt x -> + Format.fprintf + fmt "@[<2>{ "; + ((Format.fprintf + fmt "@[%s =@ " + "Flow_ast.Class.Body.body"; + ((fun x -> + Format.fprintf + fmt "@[<2>["; + ignore + (List.fold_left + (fun sep x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__0 + (fun fmt -> + poly_M fmt) + (fun fmt -> + poly_T fmt) + fmt) x; + true) false x); + Format.fprintf + fmt "@,]@]")) + x.body; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "comments"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__1 + (fun fmt -> + poly_M fmt) + (fun fmt () -> + Format.pp_print_string + fmt "()") fmt) + x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_t' : + 'M 'T . + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> unit) + -> + ('M, 'T) t' -> + string + = + fun poly_M poly_T x -> + Format.asprintf + "%a" ((pp_t' poly_M) poly_T) x + [@@ocaml.warning "-32"] + and pp_element : + 'M 'T . + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) element -> + unit + = + ((let __2 = PrivateField.pp + and __1 = Property.pp + and __0 = Method.pp in + (( + fun poly_M poly_T fmt -> + function + | Method a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Class.Body.Method@ "; + (__0 + (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) + fmt) a0; + Format.fprintf + fmt "@])") + | Property a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Class.Body.Property@ "; + (__1 + (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) + fmt) a0; + Format.fprintf + fmt "@])") + | PrivateField a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Class.Body.PrivateField@ "; + (__2 + (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) + fmt) a0; + Format.fprintf + fmt "@])")) + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_element : + 'M 'T . + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> unit) + -> + ('M, 'T) element -> + string + = + fun poly_M poly_T x -> + Format.asprintf + "%a" ((pp_element poly_M) poly_T) + x[@@ocaml.warning "-32"] + let _ = pp + and _ = show + and _ = pp_t' + and _ = show_t' + and _ = pp_element + and _ = show_element + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + module Decorator = + struct + type ('M, 'T) t = ('M * ('M, 'T) t') + and ('M, 'T) t' = + { + expression: ('M, 'T) Expression.t ; + comments: ('M, unit) Syntax.t option } + [@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T) t) -> () + let _ = fun (_ : ('M, 'T) t') -> () + let rec pp : + 'M 'T . + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + = + ((let __0 = pp_t' in + (( + fun poly_M poly_T fmt (a0, a1) + -> + Format.fprintf + fmt "(@["; + ((poly_M fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) + fmt) a1); + Format.fprintf + fmt "@])") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> unit) + -> + ('M, 'T) t -> + string + = + fun poly_M poly_T x -> + Format.asprintf + "%a" ((pp poly_M) poly_T) x + [@@ocaml.warning "-32"] + and pp_t' : + 'M 'T . + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) t' -> + unit + = + ((let __1 = Syntax.pp + and __0 = Expression.pp in + (( + fun poly_M poly_T fmt x -> + Format.fprintf + fmt "@[<2>{ "; + ((Format.fprintf + fmt "@[%s =@ " + "Flow_ast.Class.Decorator.expression"; + (__0 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) + fmt) x.expression; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "comments"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__1 + (fun fmt -> + poly_M fmt) + (fun fmt () -> + Format.pp_print_string + fmt "()") fmt) + x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_t' : + 'M 'T . + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> unit) + -> + ('M, 'T) t' -> + string + = + fun poly_M poly_T x -> + Format.asprintf + "%a" ((pp_t' poly_M) poly_T) x + [@@ocaml.warning "-32"] + let _ = pp + and _ = show + and _ = pp_t' + and _ = show_t' + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end + type ('M, 'T) t = + { + id: ('M, 'T) Identifier.t option ; + body: ('M, 'T) Class.Body.t ; + tparams: ('M, 'T) Type.TypeParams.t option ; + extends: ('M, 'T) Extends.t option ; + implements: ('M, 'T) Implements.t option ; + class_decorators: ('M, 'T) Decorator.t list ; + comments: ('M, unit) Syntax.t option } + [@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T) t) -> () + let rec pp : + 'M 'T . + (Format.formatter + -> 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + = + ((let __6 = Syntax.pp + and __5 = Decorator.pp + and __4 = Implements.pp + and __3 = Extends.pp + and __2 = Type.TypeParams.pp + and __1 = Class.Body.pp + and __0 = Identifier.pp in + (( + fun poly_M poly_T fmt x -> + Format.fprintf + fmt "@[<2>{ "; + (((((((Format.fprintf + fmt "@[%s =@ " + "Flow_ast.Class.id"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__0 + (fun fmt -> + poly_M fmt) + (fun fmt -> + poly_T fmt) + fmt) x; + Format.pp_print_string + fmt ")"))) + x.id; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "body"; + (__1 (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) + fmt) x.body; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "tparams"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__2 + (fun fmt -> + poly_M fmt) + (fun fmt -> + poly_T fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) x.tparams; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "extends"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__3 + (fun fmt -> + poly_M fmt) + (fun fmt -> + poly_T fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) x.extends; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "implements"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__4 + (fun fmt -> + poly_M fmt) + (fun fmt -> + poly_T fmt) fmt) x; + Format.pp_print_string + fmt ")"))) + x.implements; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " + "class_decorators"; + ((fun x -> + Format.fprintf + fmt "@[<2>["; + ignore + (List.fold_left + (fun sep x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__5 + (fun fmt -> + poly_M fmt) + (fun fmt -> + poly_T fmt) + fmt) x; + true) false x); + Format.fprintf + fmt "@,]@]")) + x.class_decorators; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "comments"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__6 + (fun fmt -> poly_M fmt) + (fun fmt () -> + Format.pp_print_string + fmt "()") fmt) x; + Format.pp_print_string + fmt ")"))) x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter + -> 'M -> unit) + -> + (Format.formatter + -> 'T -> unit) + -> + ('M, 'T) t -> + string + = + fun poly_M poly_T x -> + Format.asprintf + "%a" ((pp poly_M) poly_T) x[@@ocaml.warning + "-32"] + let _ = pp + and _ = show + end[@@ocaml.doc "@inline"][@@merlin.hide ] + end and + Function:sig + module RestParam : + sig + type ('M, 'T) t = + ('M * ('M, 'T) t') + and ('M, 'T) t' = + { + argument: ('M, 'T) Pattern.t ; + comments: + ('M, unit) Syntax.t option } + [@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + val show : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t -> + string + val pp_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t' -> + unit + val show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t' -> + string + end[@@ocaml.doc "@inline"] + [@@merlin.hide ] + end + module Param : + sig + type ('M, 'T) t = + ('M * ('M, 'T) t') + and ('M, 'T) t' = + { + argument: ('M, 'T) Pattern.t ; + default: + ('M, 'T) Expression.t option } + [@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + val show : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t -> + string + val pp_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t' -> + unit + val show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t' -> + string + end[@@ocaml.doc "@inline"] + [@@merlin.hide ] + end + module ThisParam : + sig + type ('M, 'T) t = + ('M * ('M, 'T) t') + and ('M, 'T) t' = + { + annot: + ('M, 'T) Type.annotation ; + comments: + ('M, unit) Syntax.t option } + [@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + val show : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t -> + string + val pp_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t' -> + unit + val show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t' -> + string + end[@@ocaml.doc "@inline"] + [@@merlin.hide ] + end + module Params : + sig + type ('M, 'T) t = + ('M * ('M, 'T) t') + and ('M, 'T) t' = + { + this_: + ('M, 'T) ThisParam.t option ; + params: ('M, 'T) Param.t list ; + rest: + ('M, 'T) RestParam.t option ; + comments: + ('M, 'M Comment.t list) + Syntax.t option + }[@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + val show : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t -> + string + val pp_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t' -> + unit + val show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t' -> + string + end[@@ocaml.doc "@inline"] + [@@merlin.hide ] + end + module ReturnAnnot : + sig + type ('M, 'T) t = + | Missing of 'T + | Available of ('M, 'T) + Type.annotation + | TypeGuard of ('M, 'T) + Type.type_guard_annotation + [@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + val show : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t -> + string + end[@@ocaml.doc "@inline"] + [@@merlin.hide ] + end + type effect_ = + | Hook + | Arbitrary + | Idempotent + | Parametric of int [@@deriving + show] + include + sig + [@@@ocaml.warning "-32"] + val pp_effect_ : + Format.formatter + -> + effect_ -> + unit + val show_effect_ : + effect_ -> + string + end[@@ocaml.doc "@inline"] + [@@merlin.hide ] + type ('M, 'T) t = + { + id: ('M, 'T) Identifier.t option ; + params: ('M, 'T) Params.t ; + body: ('M, 'T) body ; + async: bool ; + generator: bool ; + effect_: effect_ ; + predicate: + ('M, 'T) Type.Predicate.t + option + ; + return: ('M, 'T) ReturnAnnot.t ; + tparams: + ('M, 'T) Type.TypeParams.t + option + ; + comments: + ('M, unit) Syntax.t option ; + sig_loc: 'M } + and ('M, 'T) body = + | BodyBlock of ('M * ('M, + 'T) Statement.Block.t) + | BodyExpression of ('M, + 'T) Expression.t [@@deriving + show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + val show : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t -> + string + val pp_body : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) body -> + unit + val show_body : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) body -> + string + end[@@ocaml.doc "@inline"] + [@@merlin.hide ] + end = + struct + module RestParam = + struct + type ('M, 'T) t = ('M * ('M, 'T) t') + and ('M, 'T) t' = + { + argument: ('M, 'T) Pattern.t ; + comments: ('M, unit) Syntax.t option } + [@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T) t) -> () + let _ = fun (_ : ('M, 'T) t') -> () + let rec pp : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + = + ((let __0 = pp_t' in + (( + fun poly_M poly_T fmt + (a0, a1) -> + Format.fprintf + fmt "(@["; + ((poly_M fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt -> + poly_M fmt) + (fun fmt -> + poly_T fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t -> + string + = + fun poly_M poly_T x -> + Format.asprintf + "%a" ((pp poly_M) poly_T) x + [@@ocaml.warning "-32"] + and pp_t' : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t' -> + unit + = + ((let __1 = Syntax.pp + and __0 = Pattern.pp in + (( + fun poly_M poly_T fmt x -> + Format.fprintf + fmt "@[<2>{ "; + ((Format.fprintf + fmt "@[%s =@ " + "Flow_ast.Function.RestParam.argument"; + (__0 + (fun fmt -> + poly_M fmt) + (fun fmt -> + poly_T fmt) fmt) + x.argument; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__1 + (fun fmt -> + poly_M fmt) + (fun fmt () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_t' : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t' -> + string + = + fun poly_M poly_T x -> + Format.asprintf + "%a" ((pp_t' poly_M) poly_T) + x[@@ocaml.warning "-32"] + let _ = pp + and _ = show + and _ = pp_t' + and _ = show_t' + end[@@ocaml.doc "@inline"][@@merlin.hide + ] + end + module Param = + struct + type ('M, 'T) t = ('M * ('M, 'T) t') + and ('M, 'T) t' = + { + argument: ('M, 'T) Pattern.t ; + default: ('M, 'T) Expression.t option } + [@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T) t) -> () + let _ = fun (_ : ('M, 'T) t') -> () + let rec pp : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + = + ((let __0 = pp_t' in + (( + fun poly_M poly_T fmt + (a0, a1) -> + Format.fprintf + fmt "(@["; + ((poly_M fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt -> + poly_M fmt) + (fun fmt -> + poly_T fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t -> + string + = + fun poly_M poly_T x -> + Format.asprintf + "%a" ((pp poly_M) poly_T) x + [@@ocaml.warning "-32"] + and pp_t' : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t' -> + unit + = + ((let __1 = Expression.pp + and __0 = Pattern.pp in + (( + fun poly_M poly_T fmt x -> + Format.fprintf + fmt "@[<2>{ "; + ((Format.fprintf + fmt "@[%s =@ " + "Flow_ast.Function.Param.argument"; + (__0 + (fun fmt -> + poly_M fmt) + (fun fmt -> + poly_T fmt) fmt) + x.argument; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " + "default"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__1 + (fun fmt -> + poly_M fmt) + (fun fmt -> + poly_T fmt) + fmt) x; + Format.pp_print_string + fmt ")"))) + x.default; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_t' : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t' -> + string + = + fun poly_M poly_T x -> + Format.asprintf + "%a" ((pp_t' poly_M) poly_T) + x[@@ocaml.warning "-32"] + let _ = pp + and _ = show + and _ = pp_t' + and _ = show_t' + end[@@ocaml.doc "@inline"][@@merlin.hide + ] + end + module ThisParam = + struct + type ('M, 'T) t = ('M * ('M, 'T) t') + and ('M, 'T) t' = + { + annot: ('M, 'T) Type.annotation ; + comments: ('M, unit) Syntax.t option } + [@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T) t) -> () + let _ = fun (_ : ('M, 'T) t') -> () + let rec pp : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + = + ((let __0 = pp_t' in + (( + fun poly_M poly_T fmt + (a0, a1) -> + Format.fprintf + fmt "(@["; + ((poly_M fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt -> + poly_M fmt) + (fun fmt -> + poly_T fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t -> + string + = + fun poly_M poly_T x -> + Format.asprintf + "%a" ((pp poly_M) poly_T) x + [@@ocaml.warning "-32"] + and pp_t' : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t' -> + unit + = + ((let __1 = Syntax.pp + and __0 = Type.pp_annotation in + (( + fun poly_M poly_T fmt x -> + Format.fprintf + fmt "@[<2>{ "; + ((Format.fprintf + fmt "@[%s =@ " + "Flow_ast.Function.ThisParam.annot"; + (__0 + (fun fmt -> + poly_M fmt) + (fun fmt -> + poly_T fmt) fmt) + x.annot; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__1 + (fun fmt -> + poly_M fmt) + (fun fmt () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_t' : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t' -> + string + = + fun poly_M poly_T x -> + Format.asprintf + "%a" ((pp_t' poly_M) poly_T) + x[@@ocaml.warning "-32"] + let _ = pp + and _ = show + and _ = pp_t' + and _ = show_t' + end[@@ocaml.doc "@inline"][@@merlin.hide + ] + end + module Params = + struct + type ('M, 'T) t = ('M * ('M, 'T) t') + and ('M, 'T) t' = + { + this_: ('M, 'T) ThisParam.t option ; + params: ('M, 'T) Param.t list ; + rest: ('M, 'T) RestParam.t option ; + comments: + ('M, 'M Comment.t list) Syntax.t + option + }[@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T) t) -> () + let _ = fun (_ : ('M, 'T) t') -> () + let rec pp : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + = + ((let __0 = pp_t' in + (( + fun poly_M poly_T fmt + (a0, a1) -> + Format.fprintf + fmt "(@["; + ((poly_M fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt -> + poly_M fmt) + (fun fmt -> + poly_T fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t -> + string + = + fun poly_M poly_T x -> + Format.asprintf + "%a" ((pp poly_M) poly_T) x + [@@ocaml.warning "-32"] + and pp_t' : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t' -> + unit + = + ((let __4 = Syntax.pp + and __3 = Comment.pp + and __2 = RestParam.pp + and __1 = Param.pp + and __0 = ThisParam.pp in + (( + fun poly_M poly_T fmt x -> + Format.fprintf + fmt "@[<2>{ "; + ((((Format.fprintf + fmt "@[%s =@ " + "Flow_ast.Function.Params.this_"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__0 + (fun fmt -> + poly_M + fmt) + (fun fmt -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.this_; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " + "params"; + ((fun x -> + Format.fprintf + fmt "@[<2>["; + ignore + (List.fold_left + (fun sep x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__1 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt "@,]@]")) + x.params; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "rest"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__2 + (fun fmt -> + poly_M fmt) + (fun fmt -> + poly_T fmt) + fmt) x; + Format.pp_print_string + fmt ")"))) + x.rest; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__4 + (fun fmt -> + poly_M fmt) + (fun fmt x -> + Format.fprintf + fmt + "@[<2>["; + ignore + ( + List.fold_left + (fun sep + x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__3 + (fun fmt + -> + poly_M + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt + "@,]@]") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_t' : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t' -> + string + = + fun poly_M poly_T x -> + Format.asprintf + "%a" ((pp_t' poly_M) poly_T) + x[@@ocaml.warning "-32"] + let _ = pp + and _ = show + and _ = pp_t' + and _ = show_t' + end[@@ocaml.doc "@inline"][@@merlin.hide + ] + end + module ReturnAnnot = + struct + type ('M, 'T) t = + | Missing of 'T + | Available of ('M, 'T) + Type.annotation + | TypeGuard of ('M, 'T) + Type.type_guard_annotation [@@deriving + show] + include + struct + let _ = fun (_ : ('M, 'T) t) -> () + let rec pp : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + = + ((let __1 = + Type.pp_type_guard_annotation + and __0 = Type.pp_annotation in + (( + fun poly_M poly_T fmt -> + function + | Missing a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Function.ReturnAnnot.Missing@ "; + (poly_T fmt) a0; + Format.fprintf + fmt "@])") + | Available a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Function.ReturnAnnot.Available@ "; + (__0 + (fun fmt -> + poly_M fmt) + (fun fmt -> + poly_T fmt) + fmt) a0; + Format.fprintf + fmt "@])") + | TypeGuard a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Function.ReturnAnnot.TypeGuard@ "; + (__1 + (fun fmt -> + poly_M fmt) + (fun fmt -> + poly_T fmt) + fmt) a0; + Format.fprintf + fmt "@])")) + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t -> + string + = + fun poly_M poly_T x -> + Format.asprintf + "%a" ((pp poly_M) poly_T) x + [@@ocaml.warning "-32"] + let _ = pp + and _ = show + end[@@ocaml.doc "@inline"][@@merlin.hide + ] + end + type effect_ = + | Hook + | Arbitrary + | Idempotent + | Parametric of int [@@deriving show] + include + struct + let _ = fun (_ : effect_) -> () + let rec pp_effect_ : + Format.formatter + -> + effect_ -> + unit + = + (( + fun fmt -> + function + | Hook -> + Format.pp_print_string + fmt + "Flow_ast.Function.Hook" + | Arbitrary -> + Format.pp_print_string + fmt + "Flow_ast.Function.Arbitrary" + | Idempotent -> + Format.pp_print_string + fmt + "Flow_ast.Function.Idempotent" + | Parametric a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Function.Parametric@ "; + (Format.fprintf + fmt "%d") a0; + Format.fprintf + fmt "@])")) + [@ocaml.warning "-39"][@ocaml.warning + "-A"]) + and show_effect_ : + effect_ -> + string + = + fun x -> + Format.asprintf + "%a" pp_effect_ x[@@ocaml.warning + "-32"] + let _ = pp_effect_ + and _ = show_effect_ + end[@@ocaml.doc "@inline"][@@merlin.hide + ] + type ('M, 'T) t = + { + id: ('M, 'T) Identifier.t option ; + params: ('M, 'T) Params.t ; + body: ('M, 'T) body ; + async: bool ; + generator: bool ; + effect_: effect_ ; + predicate: + ('M, 'T) Type.Predicate.t option ; + return: ('M, 'T) ReturnAnnot.t ; + tparams: + ('M, 'T) Type.TypeParams.t option ; + comments: ('M, unit) Syntax.t option ; + sig_loc: 'M } + and ('M, 'T) body = + | BodyBlock of ('M * ('M, 'T) + Statement.Block.t) + | BodyExpression of ('M, 'T) Expression.t + [@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T) t) -> () + let _ = fun (_ : ('M, 'T) body) -> () + let rec pp : + 'M 'T . + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + = + ((let __7 = Syntax.pp + and __6 = Type.TypeParams.pp + and __5 = ReturnAnnot.pp + and __4 = Type.Predicate.pp + and __3 = pp_effect_ + and __2 = pp_body + and __1 = Params.pp + and __0 = Identifier.pp in + (( + fun poly_M poly_T fmt x -> + Format.fprintf + fmt "@[<2>{ "; + (((((((((((Format.fprintf + fmt "@[%s =@ " + "Flow_ast.Function.id"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt + "(Some "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + Format.pp_print_string + fmt ")"))) + x.id; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " + "params"; + (__1 + (fun fmt -> + poly_M fmt) + (fun fmt -> + poly_T fmt) + fmt) x.params; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " + "body"; + (__2 + (fun fmt -> + poly_M fmt) + (fun fmt -> + poly_T fmt) + fmt) x.body; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " + "async"; + (Format.fprintf + fmt "%B") + x.async; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " + "generator"; + (Format.fprintf + fmt "%B") + x.generator; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " + "effect_"; + (__3 fmt) x.effect_; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " + "predicate"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__4 + (fun fmt -> + poly_M fmt) + (fun fmt -> + poly_T fmt) + fmt) x; + Format.pp_print_string + fmt ")"))) + x.predicate; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "return"; + (__5 + (fun fmt -> poly_M fmt) + (fun fmt -> poly_T fmt) + fmt) x.return; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "tparams"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__6 + (fun fmt -> + poly_M fmt) + (fun fmt -> + poly_T fmt) + fmt) x; + Format.pp_print_string + fmt ")"))) + x.tparams; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "comments"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__7 + (fun fmt -> + poly_M fmt) + (fun fmt () -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " "sig_loc"; + (poly_M fmt) x.sig_loc; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t -> + string + = + fun poly_M poly_T x -> + Format.asprintf + "%a" ((pp poly_M) poly_T) x + [@@ocaml.warning "-32"] + and pp_body : + 'M 'T . + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) body -> + unit + = + ((let __1 = Expression.pp + and __0 = Statement.Block.pp in + (( + fun poly_M poly_T fmt -> + function + | BodyBlock a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Function.BodyBlock@ "; + ((fun (a0, a1) -> + Format.fprintf + fmt "(@["; + ((poly_M fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt -> + poly_M fmt) + (fun fmt -> + poly_T fmt) + fmt) a1); + Format.fprintf + fmt "@])")) a0; + Format.fprintf + fmt "@])") + | BodyExpression a0 -> + (Format.fprintf + fmt + "(@[<2>Flow_ast.Function.BodyExpression@ "; + (__1 + (fun fmt -> + poly_M fmt) + (fun fmt -> + poly_T fmt) fmt) + a0; + Format.fprintf + fmt "@])")) + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_body : + 'M 'T . + (Format.formatter + -> + 'M -> unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) body -> + string + = + fun poly_M poly_T x -> + Format.asprintf + "%a" ((pp_body poly_M) poly_T) x + [@@ocaml.warning "-32"] + let _ = pp + and _ = show + and _ = pp_body + and _ = show_body + end[@@ocaml.doc "@inline"][@@merlin.hide + ] + end and + Program:sig + type ('M, 'T) t = + ('M * ('M, 'T) t') + and ('M, 'T) t' = + { + statements: + ('M, 'T) Statement.t list ; + interpreter: + ('M * string) option + [@ocaml.doc + " interpreter directive / shebang "]; + comments: + ('M, unit) Syntax.t option ; + all_comments: + 'M Comment.t list } + [@@deriving show] + include + sig + [@@@ocaml.warning "-32"] + val pp : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + val show : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t -> + string + val pp_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t' -> + unit + val show_t' : + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t' -> + string + end[@@ocaml.doc "@inline"] + [@@merlin.hide ] + end = + struct + type ('M, 'T) t = ('M * ('M, 'T) t') + and ('M, 'T) t' = + { + statements: + ('M, 'T) Statement.t list ; + interpreter: ('M * string) option + [@ocaml.doc + " interpreter directive / shebang "]; + comments: ('M, unit) Syntax.t option ; + all_comments: 'M Comment.t list } + [@@deriving show] + include + struct + let _ = fun (_ : ('M, 'T) t) -> () + let _ = + fun (_ : ('M, 'T) t') -> () + let rec pp : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t -> + unit + = + ((let __0 = pp_t' in + (( + fun poly_M poly_T fmt + (a0, a1) -> + Format.fprintf + fmt "(@["; + ((poly_M fmt) a0; + Format.fprintf + fmt ",@ "; + (__0 + (fun fmt -> + poly_M fmt) + (fun fmt -> + poly_T fmt) fmt) + a1); + Format.fprintf + fmt "@])") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t -> + string + = + fun poly_M poly_T x -> + Format.asprintf + "%a" ((pp poly_M) poly_T) x + [@@ocaml.warning "-32"] + and pp_t' : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + Format.formatter + -> + ('M, 'T) t' -> + unit + = + ((let __2 = Comment.pp + and __1 = Syntax.pp + and __0 = Statement.pp in + (( + fun poly_M poly_T fmt x -> + Format.fprintf + fmt "@[<2>{ "; + ((((Format.fprintf + fmt "@[%s =@ " + "Flow_ast.Program.statements"; + ((fun x -> + Format.fprintf + fmt "@[<2>["; + ignore + (List.fold_left + (fun sep x + -> + if sep + then + Format.fprintf + fmt ";@ "; + (__0 + (fun fmt + -> + poly_M + fmt) + (fun fmt + -> + poly_T + fmt) fmt) + x; + true) + false x); + Format.fprintf + fmt "@,]@]")) + x.statements; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " + "interpreter"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + ((fun + (a0, a1) + -> + Format.fprintf + fmt "(@["; + ((poly_M + fmt) a0; + Format.fprintf + fmt ",@ "; + (Format.fprintf + fmt "%S") + a1); + Format.fprintf + fmt "@])")) + x; + Format.pp_print_string + fmt ")"))) + x.interpreter; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " + "comments"; + ((function + | None -> + Format.pp_print_string + fmt "None" + | Some x -> + (Format.pp_print_string + fmt "(Some "; + (__1 + (fun fmt -> + poly_M + fmt) + (fun fmt () + -> + Format.pp_print_string + fmt "()") + fmt) x; + Format.pp_print_string + fmt ")"))) + x.comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt ";@ "; + Format.fprintf + fmt "@[%s =@ " + "all_comments"; + ((fun x -> + Format.fprintf + fmt "@[<2>["; + ignore + (List.fold_left + (fun sep x -> + if sep + then + Format.fprintf + fmt ";@ "; + (__2 + (fun fmt + -> + poly_M + fmt) fmt) + x; + true) false + x); + Format.fprintf + fmt "@,]@]")) + x.all_comments; + Format.fprintf + fmt "@]"); + Format.fprintf + fmt "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show_t' : + 'M 'T . + (Format.formatter + -> + 'M -> + unit) + -> + (Format.formatter + -> + 'T -> + unit) + -> + ('M, 'T) t' -> + string + = + fun poly_M poly_T x -> + Format.asprintf + "%a" ((pp_t' poly_M) poly_T) + x[@@ocaml.warning "-32"] + let _ = pp + and _ = show + and _ = pp_t' + and _ = show_t' + end[@@ocaml.doc "@inline"][@@merlin.hide + ] + end diff --git a/jscomp/js_parser/flow_ast_mapper.ml b/jscomp/js_parser/flow_ast_mapper.ml index d6996c1e47..9f41b73c55 100644 --- a/jscomp/js_parser/flow_ast_mapper.ml +++ b/jscomp/js_parser/flow_ast_mapper.ml @@ -131,6 +131,8 @@ class ['loc] mapper = id_loc this#declare_module_exports loc annot stmt (fun annot -> (loc, DeclareModuleExports annot) ) + | (loc, DeclareNamespace n) -> + id_loc this#declare_namespace loc n stmt (fun n -> (loc, DeclareNamespace n)) | (loc, DeclareOpaqueType otype) -> id_loc this#opaque_type loc otype stmt (fun otype -> (loc, DeclareOpaqueType otype)) | (loc, DeclareTypeAlias stuff) -> @@ -170,6 +172,7 @@ class ['loc] mapper = ) | (loc, Labeled label) -> id_loc this#labeled_statement loc label stmt (fun label -> (loc, Labeled label)) + | (loc, Match x) -> id_loc this#match_statement loc x stmt (fun x -> (loc, Match x)) | (loc, OpaqueType otype) -> id_loc this#opaque_type loc otype stmt (fun otype -> (loc, OpaqueType otype)) | (loc, Return ret) -> id_loc this#return loc ret stmt (fun ret -> (loc, Return ret)) @@ -209,6 +212,8 @@ class ['loc] mapper = | (loc, Array x) -> id_loc this#array loc x expr (fun x -> (loc, Array x)) | (loc, ArrowFunction x) -> id_loc this#arrow_function loc x expr (fun x -> (loc, ArrowFunction x)) + | (loc, AsConstExpression x) -> + id_loc this#as_const_expression loc x expr (fun x -> (loc, AsConstExpression x)) | (loc, AsExpression x) -> id_loc this#as_expression loc x expr (fun x -> (loc, AsExpression x)) | (loc, Assignment x) -> id_loc this#assignment loc x expr (fun x -> (loc, Assignment x)) @@ -235,6 +240,7 @@ class ['loc] mapper = | (loc, ModuleRefLiteral x) -> id_loc this#module_ref_literal loc x expr (fun x -> (loc, ModuleRefLiteral x)) | (loc, Logical x) -> id_loc this#logical loc x expr (fun x -> (loc, Logical x)) + | (loc, Match x) -> id_loc this#match_expression loc x expr (fun x -> (loc, Match x)) | (loc, Member x) -> id_loc this#member loc x expr (fun x -> (loc, Member x)) | (loc, MetaProperty x) -> id_loc this#meta_property loc x expr (fun x -> (loc, MetaProperty x)) @@ -251,7 +257,7 @@ class ['loc] mapper = id_loc this#template_literal loc x expr (fun x -> (loc, TemplateLiteral x)) | (loc, This x) -> id_loc this#this_expression loc x expr (fun x -> (loc, This x)) | (loc, TypeCast x) -> id_loc this#type_cast loc x expr (fun x -> (loc, TypeCast x)) - | (loc, TSTypeCast x) -> id_loc this#ts_type_cast loc x expr (fun x -> (loc, TSTypeCast x)) + | (loc, TSSatisfies x) -> id_loc this#ts_satisfies loc x expr (fun x -> (loc, TSSatisfies x)) | (loc, Unary x) -> id_loc this#unary_expression loc x expr (fun x -> (loc, Unary x)) | (loc, Update x) -> id_loc this#update_expression loc x expr (fun x -> (loc, Update x)) | (loc, Yield x) -> id_loc this#yield loc x expr (fun x -> (loc, Yield x)) @@ -275,6 +281,16 @@ class ['loc] mapper = method arrow_function loc (expr : ('loc, 'loc) Ast.Function.t) = this#function_ loc expr + method as_const_expression _loc (expr : ('loc, 'loc) Ast.Expression.AsConstExpression.t) = + let open Ast.Expression.AsConstExpression in + let { expression; comments } = expr in + let expression' = this#expression expression in + let comments' = this#syntax_opt comments in + if expression' == expression && comments' == comments then + expr + else + { expression = expression'; comments = comments' } + method as_expression _loc (expr : ('loc, 'loc) Ast.Expression.AsExpression.t) = let open Ast.Expression.AsExpression in let { expression; annot; comments } = expr in @@ -902,13 +918,13 @@ class ['loc] mapper = method declare_module _loc (m : ('loc, 'loc) Ast.Statement.DeclareModule.t) = let open Ast.Statement.DeclareModule in - let { id; body; kind; comments } = m in + let { id; body; comments } = m in let body' = map_loc this#block body in let comments' = this#syntax_opt comments in if body' == body && comments == comments' then m else - { id; body = body'; kind; comments = comments' } + { id; body = body'; comments = comments' } method declare_module_exports _loc (exports : ('loc, 'loc) Ast.Statement.DeclareModuleExports.t) = @@ -921,6 +937,31 @@ class ['loc] mapper = else { annot = annot'; comments = comments' } + method declare_namespace _loc (m : ('loc, 'loc) Ast.Statement.DeclareNamespace.t) = + let open Ast.Statement.DeclareNamespace in + let { id; body; comments } = m in + let id' = + match id with + | Global g_id -> + let g_id' = this#identifier g_id in + if g_id == g_id' then + id + else + Global g_id' + | Local p_id -> + let p_id' = this#pattern_identifier ~kind:Ast.Variable.Const p_id in + if p_id == p_id' then + id + else + Local p_id' + in + let body' = map_loc this#block body in + let comments' = this#syntax_opt comments in + if id' == id && body' == body && comments == comments' then + m + else + { id = id'; body = body'; comments = comments' } + method declare_type_alias loc (decl : ('loc, 'loc) Ast.Statement.TypeAlias.t) = this#type_alias loc decl @@ -1135,13 +1176,13 @@ class ['loc] mapper = method export_named_declaration_specifier (spec : ('loc, 'loc) Ast.Statement.ExportNamedDeclaration.ExportSpecifier.t) = let open Ast.Statement.ExportNamedDeclaration.ExportSpecifier in - let (loc, { local; exported }) = spec in + let (loc, { local; exported; from_remote; imported_name_def_loc }) = spec in let local' = this#identifier local in let exported' = map_opt this#identifier exported in if local == local' && exported == exported' then spec else - (loc, { local = local'; exported = exported' }) + (loc, { local = local'; exported = exported'; from_remote; imported_name_def_loc }) method export_batch_specifier (spec : ('loc, 'loc) Ast.Statement.ExportNamedDeclaration.ExportBatchSpecifier.t) = @@ -1316,6 +1357,7 @@ class ['loc] mapper = return; tparams; comments = func_comments; + effect_; } = ft in @@ -1345,6 +1387,7 @@ class ['loc] mapper = return = return'; tparams = tparams'; comments = func_comments'; + effect_; } method label_identifier (ident : ('loc, 'loc) Ast.Identifier.t) = this#identifier ident @@ -1518,6 +1561,14 @@ class ['loc] mapper = method variance_opt (opt : 'loc Ast.Variance.t option) = map_opt this#variance opt + method tparam_const_modifier (c : 'loc Ast.Type.TypeParam.ConstModifier.t) = + let (loc, comments) = c in + let comments' = this#syntax_opt comments in + if comments == comments' then + c + else + (loc, comments') + method type_args (targs : ('loc, 'loc) Ast.Type.TypeArgs.t) = let open Ast.Type.TypeArgs in let (loc, { arguments; comments }) = targs in @@ -1540,15 +1591,31 @@ class ['loc] mapper = method type_param (tparam : ('loc, 'loc) Ast.Type.TypeParam.t) = let open Ast.Type.TypeParam in - let (loc, { name; bound; bound_kind; variance; default }) = tparam in + let (loc, { name; bound; bound_kind; variance; default; const }) = tparam in let bound' = this#type_annotation_hint bound in let variance' = this#variance_opt variance in let default' = map_opt this#type_ default in + let const' = map_opt this#tparam_const_modifier const in let name' = this#binding_type_identifier name in - if name' == name && bound' == bound && variance' == variance && default' == default then + if + name' == name + && bound' == bound + && variance' == variance + && default' == default + && const' == const + then tparam else - (loc, { name = name'; bound = bound'; bound_kind; variance = variance'; default = default' }) + ( loc, + { + name = name'; + bound = bound'; + bound_kind; + variance = variance'; + default = default'; + const = const'; + } + ) method generic_type _loc (gt : ('loc, 'loc) Ast.Type.Generic.t) = let open Ast.Type.Generic in @@ -1630,12 +1697,12 @@ class ['loc] mapper = method module_ref_literal _loc (lit : ('loc, 'loc) Ast.ModuleRefLiteral.t) = let open Ast.ModuleRefLiteral in - let { value; require_out; prefix_len; legacy_interop; raw; comments } = lit in + let { value; require_loc; def_loc_opt; prefix_len; legacy_interop; raw; comments } = lit in let comments' = this#syntax_opt comments in if comments == comments' then lit else - { value; require_out; prefix_len; legacy_interop; raw; comments } + { value; require_loc; def_loc_opt; prefix_len; legacy_interop; raw; comments } method nullable_type (t : ('loc, 'loc) Ast.Type.Nullable.t) = let open Ast.Type.Nullable in @@ -1745,13 +1812,13 @@ class ['loc] mapper = method tuple_type (t : ('loc, 'loc) Ast.Type.Tuple.t) = let open Ast.Type.Tuple in - let { elements; comments } = t in + let { elements; inexact; comments } = t in let elements' = map_list this#tuple_element elements in let comments' = this#syntax_opt comments in if elements == elements' && comments == comments' then t else - { elements = elements'; comments = comments' } + { elements = elements'; inexact; comments = comments' } method tuple_element (el : ('loc, 'loc) Ast.Type.Tuple.element) = let open Ast.Type.Tuple in @@ -1900,10 +1967,11 @@ class ['loc] mapper = this#function_expression_or_method loc stmt (** previously, we conflated [function_expression] and [class_method]. callers should be - updated to override those individually. *) + updated to override those individually. + + DEPRECATED: use either function_expression or class_method *) method function_expression_or_method loc (stmt : ('loc, 'loc) Ast.Function.t) = this#function_ loc stmt - (* [@@alert deprecated "Use either function_expression or class_method"] *) (* Internal helper for function declarations, function expressions and arrow functions *) method function_ _loc (expr : ('loc, 'loc) Ast.Function.t) = @@ -1914,6 +1982,7 @@ class ['loc] mapper = body; async; generator; + effect_; predicate; return; tparams; @@ -1947,6 +2016,7 @@ class ['loc] mapper = body = body'; async; generator; + effect_; predicate = predicate'; tparams = tparams'; sig_loc; @@ -2463,6 +2533,239 @@ class ['loc] mapper = else { expr with left = left'; right = right'; comments = comments' } + method match_ + : 'B. + 'loc -> + on_case_body:('B -> 'B) -> + ('loc, 'loc, 'B) Ast.Match.t -> + ('loc, 'loc, 'B) Ast.Match.t = + fun _loc ~on_case_body x -> + let open Ast.Match in + let { arg; cases; match_keyword_loc; comments } = x in + let arg' = this#expression arg in + let cases' = map_list (this#match_case ~on_case_body) cases in + let comments' = this#syntax_opt comments in + if arg == arg' && cases == cases' && comments == comments' then + x + else + { arg = arg'; cases = cases'; match_keyword_loc; comments = comments' } + + method match_case + : 'B. + on_case_body:('B -> 'B) -> + ('loc, 'loc, 'B) Ast.Match.Case.t -> + ('loc, 'loc, 'B) Ast.Match.Case.t = + fun ~on_case_body case -> + let open Ast.Match.Case in + let (loc, { pattern; body; guard; comments }) = case in + let pattern' = this#match_pattern pattern in + let body' = on_case_body body in + let guard' = map_opt this#expression guard in + let comments' = this#syntax_opt comments in + if pattern == pattern' && body == body' && guard == guard' && comments == comments' then + case + else + (loc, { pattern = pattern'; body = body'; guard = guard'; comments = comments' }) + + method match_expression loc (x : ('loc, 'loc) Ast.Expression.match_expression) = + this#match_ loc ~on_case_body:this#expression x + + method match_statement loc (x : ('loc, 'loc) Ast.Statement.match_statement) = + this#match_ loc ~on_case_body:this#statement x + + method match_pattern (pattern : ('loc, 'loc) Ast.MatchPattern.t) = + let open Ast.MatchPattern in + match pattern with + | (loc, WildcardPattern x) -> id this#syntax_opt x pattern (fun x -> (loc, WildcardPattern x)) + | (loc, StringPattern x) -> + id_loc this#string_literal loc x pattern (fun x -> (loc, StringPattern x)) + | (loc, BooleanPattern x) -> + id_loc this#boolean_literal loc x pattern (fun x -> (loc, BooleanPattern x)) + | (loc, NullPattern x) -> id this#syntax_opt x pattern (fun x -> (loc, NullPattern x)) + | (loc, NumberPattern x) -> + id_loc this#number_literal loc x pattern (fun x -> (loc, NumberPattern x)) + | (loc, BigIntPattern x) -> + id_loc this#bigint_literal loc x pattern (fun x -> (loc, BigIntPattern x)) + | (loc, UnaryPattern x) -> + id this#match_unary_pattern x pattern (fun x -> (loc, UnaryPattern x)) + | (loc, IdentifierPattern x) -> + id this#identifier x pattern (fun x -> (loc, IdentifierPattern x)) + | (loc, MemberPattern x) -> + id this#match_member_pattern x pattern (fun x -> (loc, MemberPattern x)) + | (loc, BindingPattern x) -> + id_loc this#match_binding_pattern loc x pattern (fun x -> (loc, BindingPattern x)) + | (loc, ObjectPattern x) -> + id this#match_object_pattern x pattern (fun x -> (loc, ObjectPattern x)) + | (loc, ArrayPattern x) -> + id this#match_array_pattern x pattern (fun x -> (loc, ArrayPattern x)) + | (loc, OrPattern x) -> id this#match_or_pattern x pattern (fun x -> (loc, OrPattern x)) + | (loc, AsPattern x) -> id this#match_as_pattern x pattern (fun x -> (loc, AsPattern x)) + + method match_unary_pattern (unary_pattern : 'loc Ast.MatchPattern.UnaryPattern.t) = + let open Ast.MatchPattern.UnaryPattern in + let { operator; argument; comments } = unary_pattern in + let (arg_loc, arg) = argument in + let argument' = + id_loc this#match_unary_pattern_argument arg_loc arg argument (fun arg -> (arg_loc, arg)) + in + let comments' = this#syntax_opt comments in + if argument == argument' && comments == comments' then + unary_pattern + else + { operator; argument = argument'; comments = comments' } + + method match_unary_pattern_argument loc (argument : 'loc Ast.MatchPattern.UnaryPattern.argument) + = + let open Ast.MatchPattern.UnaryPattern in + match argument with + | NumberLiteral lit -> + id_loc this#number_literal loc lit argument (fun lit -> NumberLiteral lit) + | BigIntLiteral lit -> + id_loc this#bigint_literal loc lit argument (fun lit -> BigIntLiteral lit) + + method match_member_pattern (member_pattern : ('loc, 'loc) Ast.MatchPattern.MemberPattern.t) = + let open Ast.MatchPattern.MemberPattern in + let (loc, { base; property; comments }) = member_pattern in + let base' = this#match_member_pattern_base base in + let property' = this#match_member_pattern_property property in + let comments' = this#syntax_opt comments in + if base == base' && property == property' && comments == comments' then + member_pattern + else + (loc, { base = base'; property = property'; comments = comments' }) + + method match_member_pattern_base (base : ('loc, 'loc) Ast.MatchPattern.MemberPattern.base) = + let open Ast.MatchPattern.MemberPattern in + match base with + | BaseIdentifier x -> id this#identifier x base (fun x -> BaseIdentifier x) + | BaseMember x -> id this#match_member_pattern x base (fun x -> BaseMember x) + + method match_member_pattern_property + (prop : ('loc, 'loc) Ast.MatchPattern.MemberPattern.property) = + let open Ast.MatchPattern.MemberPattern in + match prop with + | PropertyString (loc, lit) -> + id_loc this#string_literal loc lit prop (fun lit -> PropertyString (loc, lit)) + | PropertyNumber (loc, lit) -> + id_loc this#number_literal loc lit prop (fun lit -> PropertyNumber (loc, lit)) + | PropertyBigInt (loc, lit) -> + id_loc this#bigint_literal loc lit prop (fun lit -> PropertyBigInt (loc, lit)) + | PropertyIdentifier ident -> + id this#identifier ident prop (fun ident -> PropertyIdentifier ident) + + method match_binding_pattern + _loc (binding_pattern : ('loc, 'loc) Ast.MatchPattern.BindingPattern.t) = + let open Ast.MatchPattern.BindingPattern in + let { id; kind; comments } = binding_pattern in + let id' = this#pattern_identifier ~kind id in + let comments' = this#syntax_opt comments in + if id == id' && comments == comments' then + binding_pattern + else + { id = id'; kind; comments = comments' } + + method match_object_pattern (object_pattern : ('loc, 'loc) Ast.MatchPattern.ObjectPattern.t) = + let open Ast.MatchPattern.ObjectPattern in + let { properties; rest; comments } = object_pattern in + let properties' = map_list this#match_object_pattern_property properties in + let rest' = map_loc_opt this#match_rest_pattern rest in + let comments' = this#syntax_opt comments in + if properties == properties' && rest == rest' && comments == comments' then + object_pattern + else + { properties = properties'; rest = rest'; comments = comments' } + + method match_object_pattern_property + (prop : ('loc, 'loc) Ast.MatchPattern.ObjectPattern.Property.t) = + let open Ast.MatchPattern.ObjectPattern.Property in + match prop with + | (loc, Valid { key; pattern; shorthand; comments }) -> + let key' = this#match_object_pattern_property_key key in + let pattern' = this#match_pattern pattern in + let comments' = this#syntax_opt comments in + if key == key' && pattern == pattern' && comments == comments' then + prop + else + (loc, Valid { key = key'; pattern = pattern'; shorthand; comments = comments' }) + | (loc, InvalidShorthand id) -> + let id' = this#identifier id in + if id == id' then + prop + else + (loc, InvalidShorthand id') + + method match_object_pattern_property_key + (key : ('loc, 'loc) Ast.MatchPattern.ObjectPattern.Property.key) = + let open Ast.MatchPattern.ObjectPattern.Property in + match key with + | StringLiteral (loc, lit) -> + id_loc this#string_literal loc lit key (fun lit -> StringLiteral (loc, lit)) + | NumberLiteral (loc, lit) -> + id_loc this#number_literal loc lit key (fun lit -> NumberLiteral (loc, lit)) + | BigIntLiteral (loc, lit) -> + id_loc this#bigint_literal loc lit key (fun lit -> BigIntLiteral (loc, lit)) + | Identifier ident -> id this#identifier ident key (fun ident -> Identifier ident) + + method match_array_pattern (array_pattern : ('loc, 'loc) Ast.MatchPattern.ArrayPattern.t) = + let open Ast.MatchPattern.ArrayPattern in + let { elements; rest; comments } = array_pattern in + let elements' = map_list this#match_pattern_array_element elements in + let rest' = map_loc_opt this#match_rest_pattern rest in + let comments' = this#syntax_opt comments in + if elements == elements' && rest == rest' && comments == comments' then + array_pattern + else + { elements = elements'; rest = rest'; comments = comments' } + + method match_pattern_array_element + (element : ('loc, 'loc) Ast.MatchPattern.ArrayPattern.Element.t) = + let open Ast.MatchPattern.ArrayPattern.Element in + let { pattern; index } = element in + let pattern' = this#match_pattern pattern in + if pattern == pattern' then + element + else + { pattern = pattern'; index } + + method match_rest_pattern _loc (rest : ('loc, 'loc) Ast.MatchPattern.RestPattern.t') = + let open Ast.MatchPattern.RestPattern in + let { argument; comments } = rest in + let argument' = map_loc_opt this#match_binding_pattern argument in + let comments' = this#syntax_opt comments in + if argument == argument' && comments == comments' then + rest + else + { argument = argument'; comments = comments' } + + method match_or_pattern (or_pattern : ('loc, 'loc) Ast.MatchPattern.OrPattern.t) = + let open Ast.MatchPattern.OrPattern in + let { patterns; comments } = or_pattern in + let patterns' = map_list this#match_pattern patterns in + let comments' = this#syntax_opt comments in + if patterns == patterns' && comments == comments' then + or_pattern + else + { patterns = patterns'; comments = comments' } + + method match_as_pattern (as_pattern : ('loc, 'loc) Ast.MatchPattern.AsPattern.t) = + let open Ast.MatchPattern.AsPattern in + let { pattern; target; comments } = as_pattern in + let pattern' = this#match_pattern pattern in + let target' = this#match_as_pattern_target target in + let comments' = this#syntax_opt comments in + if pattern == pattern' && target == target' && comments == comments' then + as_pattern + else + { pattern = pattern'; target = target'; comments = comments' } + + method match_as_pattern_target (target : ('loc, 'loc) Ast.MatchPattern.AsPattern.target) = + let open Ast.MatchPattern.AsPattern in + match target with + | Binding (loc, binding) -> + id_loc this#match_binding_pattern loc binding target (fun x -> Binding (loc, x)) + | Identifier ident -> + id (this#pattern_identifier ~kind:Ast.Variable.Const) ident target (fun x -> Identifier x) + method member _loc (expr : ('loc, 'loc) Ast.Expression.Member.t) = let open Ast.Expression.Member in let { _object; property; comments } = expr in @@ -2880,14 +3183,14 @@ class ['loc] mapper = method type_guard (guard : ('loc, 'loc) Ast.Type.TypeGuard.t) = let open Ast.Type.TypeGuard in - let (loc, { asserts; guard = (x, t); comments }) = guard in + let (loc, { kind; guard = (x, t); comments }) = guard in let x' = this#identifier x in let t' = map_opt this#type_ t in let comments' = this#syntax_opt comments in if x' == x && t' == t && comments' == comments then guard else - (loc, { asserts; guard = (x', t'); comments = comments' }) + (loc, { kind; guard = (x', t'); comments = comments' }) method function_rest_param (expr : ('loc, 'loc) Ast.Function.RestParam.t) = let open Ast.Function.RestParam in @@ -3056,25 +3359,16 @@ class ['loc] mapper = else { expression = expression'; annot = annot'; comments = comments' } - method ts_type_cast _loc (expr : ('loc, 'loc) Ast.Expression.TSTypeCast.t) = - let open Ast.Expression.TSTypeCast in - let { expression; kind; comments } = expr in + method ts_satisfies _loc (expr : ('loc, 'loc) Ast.Expression.TSSatisfies.t) = + let open Ast.Expression.TSSatisfies in + let { expression; annot; comments } = expr in let expression' = this#expression expression in - let kind' = - match kind with - | AsConst -> kind - | Satisfies annot -> - let annot' = this#type_ annot in - if annot == annot' then - kind - else - Satisfies annot' - in + let annot' = this#type_annotation annot in let comments' = this#syntax_opt comments in - if expression' == expression && comments' == comments then + if expression' == expression && annot' = annot && comments' == comments then expr else - { expression = expression'; kind = kind'; comments = comments' } + { expression = expression'; annot = annot'; comments = comments' } method unary_expression _loc (expr : ('loc, 'loc) Flow_ast.Expression.Unary.t) = let open Flow_ast.Expression.Unary in diff --git a/jscomp/js_parser/flow_ast_utils.ml b/jscomp/js_parser/flow_ast_utils.ml index 4a60725692..535149f460 100644 --- a/jscomp/js_parser/flow_ast_utils.ml +++ b/jscomp/js_parser/flow_ast_utils.ml @@ -6,6 +6,8 @@ *) open Flow_ast +module E = Expression +module I = Identifier type 'loc binding = 'loc * string @@ -41,17 +43,17 @@ let rec fold_bindings_of_pattern = ) let fold_bindings_of_variable_declarations f acc declarations = - let open Flow_ast.Statement.VariableDeclaration in + let open Statement.VariableDeclaration in List.fold_left (fun acc -> function | (_, { Declarator.id = pattern; _ }) -> let has_anno = (* Only the toplevel annotation in a pattern is meaningful *) - let open Flow_ast.Pattern in + let open Pattern in match pattern with - | (_, Array { Array.annot = Flow_ast.Type.Available _; _ }) - | (_, Object { Object.annot = Flow_ast.Type.Available _; _ }) - | (_, Identifier { Identifier.annot = Flow_ast.Type.Available _; _ }) -> + | (_, Array { Array.annot = Type.Available _; _ }) + | (_, Object { Object.annot = Type.Available _; _ }) + | (_, Identifier { Identifier.annot = Type.Available _; _ }) -> true | _ -> false in @@ -82,8 +84,46 @@ let rec pattern_has_binding = | (_, Array { Array.elements; _ }) -> List.exists element elements | (_, Expression _) -> false +let rec match_pattern_has_binding = + let open MatchPattern in + let property = function + | (_, ObjectPattern.Property.Valid { ObjectPattern.Property.pattern = p; _ }) -> + match_pattern_has_binding p + | (_, ObjectPattern.Property.InvalidShorthand _) -> false + in + let rest_has_binding = function + | Some (_, { RestPattern.argument = Some _; comments = _ }) -> true + | _ -> false + in + function + | (_, WildcardPattern _) + | (_, NumberPattern _) + | (_, BigIntPattern _) + | (_, StringPattern _) + | (_, BooleanPattern _) + | (_, NullPattern _) + | (_, UnaryPattern _) + | (_, IdentifierPattern _) + | (_, MemberPattern _) -> + false + | (_, BindingPattern _) -> true + | (_, ObjectPattern { ObjectPattern.properties; rest; comments = _ }) -> + rest_has_binding rest || List.exists property properties + | (_, ArrayPattern { ArrayPattern.elements; rest; comments = _ }) -> + rest_has_binding rest + || List.exists + (fun { ArrayPattern.Element.pattern; _ } -> match_pattern_has_binding pattern) + elements + | (_, OrPattern { OrPattern.patterns; _ }) -> List.exists match_pattern_has_binding patterns + | (_, AsPattern _) -> true + +let string_of_variable_kind = function + | Variable.Var -> "var" + | Variable.Let -> "let" + | Variable.Const -> "const" + let partition_directives statements = - let open Flow_ast.Statement in + let open Statement in let rec helper directives = function | ((_, Expression { Expression.directive = Some _; _ }) as directive) :: rest -> helper (directive :: directives) rest @@ -92,22 +132,19 @@ let partition_directives statements = helper [] statements let hoist_function_and_component_declarations stmts = - let open Flow_ast.Statement in + let open Statement in let (func_and_component_decs, other_stmts) = List.partition (function (* function f() {} / component F() {} *) - | (_, (FunctionDeclaration { Flow_ast.Function.id = Some _; _ } | ComponentDeclaration _)) + | (_, (FunctionDeclaration { Function.id = Some _; _ } | ComponentDeclaration _)) (* export function f() {} / export component F() {} *) | ( _, ExportNamedDeclaration { ExportNamedDeclaration.declaration = Some - ( _, - ( FunctionDeclaration { Flow_ast.Function.id = Some _; _ } - | ComponentDeclaration _ ) - ); + (_, (FunctionDeclaration { Function.id = Some _; _ } | ComponentDeclaration _)); _; } ) @@ -117,10 +154,7 @@ let hoist_function_and_component_declarations stmts = { ExportDefaultDeclaration.declaration = ExportDefaultDeclaration.Declaration - ( _, - ( FunctionDeclaration { Flow_ast.Function.id = Some _; _ } - | ComponentDeclaration _ ) - ); + (_, (FunctionDeclaration { Function.id = Some _; _ } | ComponentDeclaration _)); _; } ) @@ -151,24 +185,71 @@ let negate_bigint_literal (value, raw) = | None -> (None, raw) | Some value -> (Some (Int64.neg value), negate_raw_lit raw) +let is_number_literal node = + match node with + | Expression.NumberLiteral _ + | Expression.Unary + { + Expression.Unary.operator = Expression.Unary.Minus; + argument = (_, Expression.NumberLiteral _); + comments = _; + } -> + true + | _ -> false + +let extract_number_literal node = + match node with + | Expression.NumberLiteral { NumberLiteral.value; raw; comments = _ } -> Some (value, raw) + | Expression.Unary + { + Expression.Unary.operator = Expression.Unary.Minus; + argument = (_, Expression.NumberLiteral { NumberLiteral.value; raw; _ }); + comments = _; + } -> + Some (negate_number_literal (value, raw)) + | _ -> None + +let is_bigint_literal node = + match node with + | Expression.BigIntLiteral _ + | Expression.Unary + { + Expression.Unary.operator = Expression.Unary.Minus; + argument = (_, Expression.BigIntLiteral _); + comments = _; + } -> + true + | _ -> false + +let extract_bigint_literal node = + match node with + | Expression.BigIntLiteral { BigIntLiteral.value; raw; comments = _ } -> Some (value, raw) + | Expression.Unary + { + Expression.Unary.operator = Expression.Unary.Minus; + argument = (_, Expression.BigIntLiteral { BigIntLiteral.value; raw; comments = _ }); + comments = _; + } -> + Some (negate_bigint_literal (value, raw)) + | _ -> None + let is_call_to_invariant callee = match callee with | (_, Expression.Identifier (_, { Identifier.name = "invariant"; _ })) -> true | _ -> false +let is_call_to_require callee = + match callee with + | (_, Expression.Identifier (_, { Identifier.name = "require"; _ })) -> true + | _ -> false + let is_call_to_is_array callee = match callee with | ( _, - Flow_ast.Expression.Member + E.Member { - Flow_ast.Expression.Member._object = - ( _, - Flow_ast.Expression.Identifier - (_, { Flow_ast.Identifier.name = "Array"; comments = _ }) - ); - property = - Flow_ast.Expression.Member.PropertyIdentifier - (_, { Flow_ast.Identifier.name = "isArray"; comments = _ }); + E.Member._object = (_, E.Identifier (_, { I.name = "Array"; comments = _ })); + property = E.Member.PropertyIdentifier (_, { I.name = "isArray"; comments = _ }); comments = _; } ) -> @@ -178,43 +259,201 @@ let is_call_to_is_array callee = let is_call_to_object_dot_freeze callee = match callee with | ( _, - Flow_ast.Expression.Member + E.Member { - Flow_ast.Expression.Member._object = - ( _, - Flow_ast.Expression.Identifier - (_, { Flow_ast.Identifier.name = "Object"; comments = _ }) - ); - property = - Flow_ast.Expression.Member.PropertyIdentifier - (_, { Flow_ast.Identifier.name = "freeze"; comments = _ }); + E.Member._object = (_, E.Identifier (_, { I.name = "Object"; comments = _ })); + property = E.Member.PropertyIdentifier (_, { I.name = "freeze"; comments = _ }); comments = _; } ) -> true | _ -> false +let get_call_to_object_dot_freeze_arg callee targs args = + match (targs, args) with + | (None, (_args_loc, { E.ArgList.arguments = [E.Expression (obj_loc, E.Object o)]; comments = _ })) + when is_call_to_object_dot_freeze callee -> + Some (obj_loc, o) + | _ -> None + let is_call_to_object_static_method callee = match callee with | ( _, - Flow_ast.Expression.Member + E.Member { - Flow_ast.Expression.Member._object = - ( _, - Flow_ast.Expression.Identifier - (_, { Flow_ast.Identifier.name = "Object"; comments = _ }) - ); - property = Flow_ast.Expression.Member.PropertyIdentifier _; + E.Member._object = (_, E.Identifier (_, { I.name = "Object"; comments = _ })); + property = E.Member.PropertyIdentifier _; comments = _; } ) -> true | _ -> false +let get_call_to_jest_module_mocking_fn callee arguments = + match (callee, arguments) with + | ( ( _, + E.Member + { + E.Member._object = (_, E.Identifier (jest_loc, { I.name = "jest"; comments = _ })); + property = + E.Member.PropertyIdentifier + ( _, + (* See https://jestjs.io/docs/jest-object#mock-modules *) + { + I.name = + ( "createMockFromModule" | "mock" | "unmock" | "deepUnmock" | "doMock" + | "dontMock" | "setMock" | "requireActual" | "requireMock" ); + comments = _; + } + ); + _; + } + ), + ( _, + { + E.ArgList.arguments = + E.Expression + ( source_loc, + ( E.StringLiteral { StringLiteral.value = name; _ } + | E.TemplateLiteral + { + E.TemplateLiteral.quasis = + [ + ( _, + { + E.TemplateLiteral.Element.value = + { E.TemplateLiteral.Element.cooked = name; _ }; + _; + } + ); + ]; + _; + } ) + ) + :: _; + comments = _; + } + ) + ) -> + Some (jest_loc, source_loc, name) + | _ -> None + let is_super_member_access = function - | { Flow_ast.Expression.Member._object = (_, Flow_ast.Expression.Super _); _ } -> true + | { E.Member._object = (_, E.Super _); _ } -> true | _ -> false +let acceptable_statement_in_declaration_context ~in_declare_namespace = + let open Statement in + function + | Block _ -> Error "block" + | Break _ -> Error "break" + | ClassDeclaration _ -> Error "class declaration" + | ComponentDeclaration _ -> Error "component declaration" + | Continue _ -> Error "continue" + | Debugger _ -> Error "debugger" + | DoWhile _ -> Error "do while" + | ExportDefaultDeclaration _ -> Error "export default" + | ExportNamedDeclaration { ExportNamedDeclaration.export_kind = ExportValue; _ } -> + Error "value export" + | Expression _ -> Error "expression" + | For _ -> Error "for" + | ForIn _ -> Error "for in" + | ForOf _ -> Error "for of" + | FunctionDeclaration _ -> Error "function declaration" + | If _ -> Error "if" + | Labeled _ -> Error "labeled" + | Match _ -> Error "match" + | Return _ -> Error "return" + | Switch _ -> Error "switch" + | Throw _ -> Error "throw" + | Try _ -> Error "try" + | VariableDeclaration _ -> Error "variable declaration" + | While _ -> Error "while" + | With _ -> Error "with" + | ImportDeclaration _ -> + if in_declare_namespace then + Error "import declaration" + else + Ok () + | DeclareModuleExports _ -> + if in_declare_namespace then + Error "declare module.exports" + else + Ok () + | DeclareClass _ + | DeclareComponent _ + | DeclareEnum _ + | DeclareExportDeclaration _ + | DeclareFunction _ + | DeclareInterface _ + | DeclareModule _ + | DeclareNamespace _ + | DeclareOpaqueType _ + | DeclareTypeAlias _ + | DeclareVariable _ + | Empty _ + | EnumDeclaration _ + | ExportNamedDeclaration { ExportNamedDeclaration.export_kind = ExportType; _ } + | InterfaceDeclaration _ + | OpaqueType _ + | TypeAlias _ -> + Ok () + +let rec is_type_only_declaration_statement (_, stmt') = + let open Statement in + let is_type_only_declaration_statement' = function + | DeclareInterface _ + | DeclareOpaqueType _ + | DeclareTypeAlias _ + | Empty _ + | InterfaceDeclaration _ + | OpaqueType _ + | TypeAlias _ -> + true + | DeclareExportDeclaration + DeclareExportDeclaration. + { declaration = Some (NamedType _ | NamedOpaqueType _ | Interface _); _ } -> + true + | DeclareNamespace { DeclareNamespace.body = (_, { Block.body; _ }); _ } -> + List.for_all is_type_only_declaration_statement body + | ExportNamedDeclaration { ExportNamedDeclaration.export_kind; _ } -> export_kind = ExportType + | Block _ + | Break _ + | ClassDeclaration _ + | ComponentDeclaration _ + | Continue _ + | Debugger _ + | DoWhile _ + | EnumDeclaration _ + | ExportDefaultDeclaration _ + | Expression _ + | For _ + | ForIn _ + | ForOf _ + | FunctionDeclaration _ + | If _ + | Labeled _ + | Match _ + | Return _ + | Switch _ + | Throw _ + | Try _ + | VariableDeclaration _ + | While _ + | With _ + | ImportDeclaration _ + | DeclareClass _ + | DeclareComponent _ + | DeclareEnum _ + | DeclareExportDeclaration _ + | DeclareFunction _ + | DeclareModule _ + | DeclareModuleExports _ + | DeclareVariable _ -> + false + in + is_type_only_declaration_statement' stmt' + let loc_of_statement = fst let loc_of_expression = fst @@ -274,7 +513,7 @@ let split_comments comments = (mk_comments_opt ~leading (), mk_comments_opt ~trailing ()) let string_of_assignment_operator op = - let open Flow_ast.Expression.Assignment in + let open E.Assignment in match op with | PlusAssign -> "+=" | MinusAssign -> "-=" @@ -293,7 +532,7 @@ let string_of_assignment_operator op = | OrAssign -> "||=" let string_of_binary_operator op = - let open Flow_ast.Expression.Binary in + let open E.Binary in match op with | Equal -> "==" | NotEqual -> "!=" @@ -334,12 +573,14 @@ module ExpressionSort = struct | JSXFragment | Literal | Logical + | Match | Member | MetaProperty | New | Object | OptionalCall | OptionalMember + | Satisfies | Sequence | Super | TaggedTemplate @@ -366,12 +607,14 @@ module ExpressionSort = struct | JSXFragment -> "JSX fragment" | Literal -> "literal" | Logical -> "logical expression" + | Match -> "match expression" | Member -> "member expression" | MetaProperty -> "metaproperty expression" | New -> "new expression" | Object -> "object" | OptionalCall -> "optional call expression" | OptionalMember -> "optional member expression" + | Satisfies -> "satisfies expression" | Sequence -> "sequence" | Super -> "`super` reference" | TaggedTemplate -> "tagged template expression" @@ -384,14 +627,14 @@ module ExpressionSort = struct end let loc_of_annotation_or_hint = - let open Flow_ast.Type in + let open Type in function | Missing loc | Available (_, (loc, _)) -> loc let loc_of_return_annot = - let open Flow_ast.Function.ReturnAnnot in + let open Function.ReturnAnnot in function | Missing loc | Available (_, (loc, _)) @@ -403,7 +646,7 @@ let loc_of_return_annot = * identifier and member property type position as well. This is to ensure that * type-at-pos searcher will detect the updated type. *) let push_toplevel_type t exp = - let open Flow_ast.Expression in + let open E in let push_toplevel_identifier id = let ((id_loc, _), id) = id in ((id_loc, t), id) @@ -426,29 +669,80 @@ let push_toplevel_type t exp = ((loc, t), e') let hook_name s = - let is_A_to_Z c = c >= 'A' && c <= 'Z' in - String.starts_with ~prefix:"use" s && (String.length s = 3 || is_A_to_Z s.[3]) + let is_cap c = c = Char.uppercase_ascii c in + String.starts_with ~prefix:"use" s && (String.length s = 3 || is_cap s.[3]) -let hook_function { Flow_ast.Function.id; _ } = +let hook_function { Function.id; _ } = match id with - | Some (loc, { Flow_ast.Identifier.name; _ }) when hook_name name -> Some loc + | Some (loc, { I.name; _ }) when hook_name name -> Some loc | _ -> None -let hook_call { Flow_ast.Expression.Call.callee; _ } = +let hook_call { E.Call.callee; _ } = (* A.B.C.useFoo() is a hook, A().useFoo() is not *) - let open Flow_ast.Expression in + let open E in let rec hook_callee top exp = match exp with - | (_, Identifier (_, { Flow_ast.Identifier.name; _ })) -> hook_name name || not top - | ( _, - Member - { - Member._object; - property = Member.PropertyIdentifier (_, { Flow_ast.Identifier.name; _ }); - _; - } - ) -> + | (_, Identifier (_, { I.name; _ })) -> hook_name name || not top + | (_, Member { Member._object; property = Member.PropertyIdentifier (_, { I.name; _ }); _ }) -> (hook_name name || not top) && hook_callee false _object | _ -> false in hook_callee true callee + +(* Match *) +let match_root_name = "" + +let match_root_ident loc = (loc, { Identifier.name = match_root_name; comments = None }) + +let expression_of_match_member_pattern ~visit_expression pattern = + let open MatchPattern in + let rec f (loc, { MemberPattern.base; property; comments }) = + let (_object, root_name) = + match base with + | MemberPattern.BaseIdentifier ((loc, _) as id) -> ((loc, Expression.Identifier id), id) + | MemberPattern.BaseMember mem -> f mem + in + let property = + match property with + | MemberPattern.PropertyIdentifier id -> Expression.Member.PropertyIdentifier id + | MemberPattern.PropertyString (loc, lit) -> + Expression.Member.PropertyExpression (loc, Expression.StringLiteral lit) + | MemberPattern.PropertyNumber (loc, lit) -> + Expression.Member.PropertyExpression (loc, Expression.NumberLiteral lit) + | MemberPattern.PropertyBigInt (loc, lit) -> + Expression.Member.PropertyExpression (loc, Expression.BigIntLiteral lit) + in + let exp = (loc, Expression.Member { Expression.Member._object; property; comments }) in + visit_expression exp; + (exp, root_name) + in + f pattern + +(* Type Guards *) +let get_inferred_type_guard_candidate params body return = + match (body, return) with + | (Function.BodyExpression _, Function.ReturnAnnot.Missing _) -> begin + match params with + | ( _, + { + Function.Params.params = + [ + ( _, + { + Function.Param.argument = + ( _, + Pattern.Identifier + { Pattern.Identifier.name = (loc, { Identifier.name; _ }); _ } + ); + _; + } + ); + ]; + rest = None; + _; + } + ) -> + Some (loc, name) + | _ -> None + end + | _ -> None diff --git a/jscomp/js_parser/flow_ast_utils.mli b/jscomp/js_parser/flow_ast_utils.mli index 65a8dbf3ce..6a84cc03bd 100644 --- a/jscomp/js_parser/flow_ast_utils.mli +++ b/jscomp/js_parser/flow_ast_utils.mli @@ -22,6 +22,10 @@ val fold_bindings_of_variable_declarations : val pattern_has_binding : ('m, 't) Flow_ast.Pattern.t -> bool +val match_pattern_has_binding : ('m, 't) Flow_ast.MatchPattern.t -> bool + +val string_of_variable_kind : Flow_ast.Variable.kind -> string + val partition_directives : (Loc.t, Loc.t) Flow_ast.Statement.t list -> (Loc.t, Loc.t) Flow_ast.Statement.t list * (Loc.t, Loc.t) Flow_ast.Statement.t list @@ -31,18 +35,45 @@ val hoist_function_and_component_declarations : val is_call_to_invariant : ('a, 'b) Flow_ast.Expression.t -> bool +val is_call_to_require : ('a, 'b) Flow_ast.Expression.t -> bool + val is_call_to_is_array : ('a, 'b) Flow_ast.Expression.t -> bool val is_call_to_object_dot_freeze : ('a, 'b) Flow_ast.Expression.t -> bool +val get_call_to_object_dot_freeze_arg : + ('a, 'b) Flow_ast.Expression.t -> + ('a, 'b) Flow_ast.Expression.CallTypeArgs.t option -> + ('a, 'b) Flow_ast.Expression.ArgList.t -> + ('b * ('a, 'b) Flow_ast.Expression.Object.t) option + val is_call_to_object_static_method : ('a, 'b) Flow_ast.Expression.t -> bool +val get_call_to_jest_module_mocking_fn : + ('loc, 'annot) Flow_ast.Expression.t -> + ('loc, 'annot) Flow_ast.Expression.ArgList.t -> + ('annot * 'annot * string) option + val is_super_member_access : ('a, 'b) Flow_ast.Expression.Member.t -> bool +(* Returns Ok () for such statement, and Error kind_of_statement otherwise. *) +val acceptable_statement_in_declaration_context : + in_declare_namespace:bool -> ('a, 'b) Flow_ast.Statement.t' -> (unit, string) result + +val is_type_only_declaration_statement : ('a, 'b) Flow_ast.Statement.t -> bool + val negate_number_literal : float * string -> float * string val negate_bigint_literal : int64 option * string -> int64 option * string +val is_number_literal : ('a, 'b) Flow_ast.Expression.t' -> bool + +val extract_number_literal : ('a, 'b) Flow_ast.Expression.t' -> (float * string) option + +val is_bigint_literal : ('a, 'b) Flow_ast.Expression.t' -> bool + +val extract_bigint_literal : ('a, 'b) Flow_ast.Expression.t' -> (int64 option * string) option + val loc_of_expression : ('a, 'a) Flow_ast.Expression.t -> 'a val loc_of_statement : ('a, 'a) Flow_ast.Statement.t -> 'a @@ -107,12 +138,14 @@ module ExpressionSort : sig | JSXFragment | Literal | Logical + | Match | Member | MetaProperty | New | Object | OptionalCall | OptionalMember + | Satisfies | Sequence | Super | TaggedTemplate @@ -140,4 +173,21 @@ val push_toplevel_type : val hook_function : ('a, 'b) Flow_ast.Function.t -> 'b option -val hook_call : ('loc, 'loc) Flow_ast.Expression.Call.t -> bool +val hook_call : ('a, 'b) Flow_ast.Expression.Call.t -> bool + +val hook_name : string -> bool + +val match_root_name : string + +val match_root_ident : 'loc -> ('loc, 'loc) Flow_ast.Identifier.t + +val expression_of_match_member_pattern : + visit_expression:(('loc, 'loc) Flow_ast.Expression.t -> unit) -> + ('loc, 'loc) Flow_ast.MatchPattern.MemberPattern.t -> + ('loc, 'loc) Flow_ast.Expression.t * ('loc, 'loc) Flow_ast.Identifier.t + +val get_inferred_type_guard_candidate : + ('l, 't) Flow_ast.Function.Params.t -> + ('l, 't) Flow_ast.Function.body -> + ('l, 't) Flow_ast.Function.ReturnAnnot.t -> + ('t * string) option diff --git a/jscomp/js_parser/flow_lexer.ml b/jscomp/js_parser/flow_lexer.ml index 2ab3ecf644..350e55fb31 100644 --- a/jscomp/js_parser/flow_lexer.ml +++ b/jscomp/js_parser/flow_lexer.ml @@ -6633,79 +6633,79 @@ let rec loop_id_continues lexbuf = then loop_id_continues lexbuf else (Sedlexing.backoff lexbuf 1; false) | _ -> assert false) -let rec loop_jsx_id_continues lexbuf = - (let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_6 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 1 - | 1 -> 2 - | 2 -> 0 - | 3 -> __sedlex_state_4 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_4 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 2; - (match __sedlex_partition_2 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_5 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_5 = - function - | lexbuf -> - (match __sedlex_partition_3 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_6 lexbuf - | 1 -> __sedlex_state_10 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_6 = - function - | lexbuf -> - (match __sedlex_partition_4 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_7 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_7 = - function - | lexbuf -> - (match __sedlex_partition_4 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_8 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_8 = - function - | lexbuf -> - (match __sedlex_partition_4 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 0 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_10 = - function - | lexbuf -> - (match __sedlex_partition_4 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_11 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_11 = - function - | lexbuf -> - (match __sedlex_partition_5 (Sedlexing.__private__next_int lexbuf) +let rec loop_jsx_id_continues lexbuf : unit= + let rec __sedlex_state_0 = + function + | lexbuf -> + (match __sedlex_partition_6 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> 1 + | 1 -> 2 + | 2 -> 0 + | 3 -> __sedlex_state_4 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_4 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 2; + (match __sedlex_partition_2 (Sedlexing.__private__next_int lexbuf) with - | 0 -> __sedlex_state_11 lexbuf - | 1 -> 0 - | _ -> Sedlexing.backtrack lexbuf) in - Sedlexing.start lexbuf; - (match __sedlex_state_0 lexbuf with - | 0 -> loop_jsx_id_continues lexbuf - | 1 -> () - | 2 -> - let s = Sedlexing.current_code_point lexbuf in - if Js_id.is_valid_unicode_id s - then loop_jsx_id_continues lexbuf - else Sedlexing.backoff lexbuf 1 - | _ -> assert false) : unit) + | 0 -> __sedlex_state_5 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_5 = + function + | lexbuf -> + (match __sedlex_partition_3 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_6 lexbuf + | 1 -> __sedlex_state_10 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_6 = + function + | lexbuf -> + (match __sedlex_partition_4 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_7 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_7 = + function + | lexbuf -> + (match __sedlex_partition_4 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_8 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_8 = + function + | lexbuf -> + (match __sedlex_partition_4 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> 0 + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_10 = + function + | lexbuf -> + (match __sedlex_partition_4 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_11 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_11 = + function + | lexbuf -> + (match __sedlex_partition_5 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_11 lexbuf + | 1 -> 0 + | _ -> Sedlexing.backtrack lexbuf) in + Sedlexing.start lexbuf; + (match __sedlex_state_0 lexbuf with + | 0 -> loop_jsx_id_continues lexbuf + | 1 -> () + | 2 -> + let s = Sedlexing.current_code_point lexbuf in + if Js_id.is_valid_unicode_id s + then loop_jsx_id_continues lexbuf + else Sedlexing.backoff lexbuf 1 + | _ -> assert false) let pos_at_offset env offset = { Loc.line = (Lex_env.line env); @@ -6736,9 +6736,9 @@ let loc_of_token env lex_token = | T_TEMPLATE_PART (loc, _, _, _, _) -> loc | T_REGEXP (loc, _, _) -> loc | _ -> loc_of_lexbuf env env.lex_lb -let lex_error (env : Lex_env.t) loc err = - (let lex_errors_acc = (loc, err) :: ((env.lex_state).lex_errors_acc) in - { env with lex_state = { lex_errors_acc } } : Lex_env.t) +let lex_error (env : Lex_env.t) loc err : Lex_env.t= + let lex_errors_acc = (loc, err) :: ((env.lex_state).lex_errors_acc) in + { env with lex_state = { lex_errors_acc } } let unexpected_error (env : Lex_env.t) (loc : Loc.t) value = lex_error env loc (Parse_error.Unexpected (quote_token_value value)) let unexpected_error_w_suggest (env : Lex_env.t) (loc : Loc.t) value suggest @@ -6759,16 +6759,15 @@ let bigint_strip_n raw = else raw in str let mk_comment (env : Lex_env.t) (start : Loc.position) (_end : Loc.position) - (buf : Buffer.t) (multiline : bool) = - (let open Flow_ast.Comment in - let loc = { Loc.source = (Lex_env.source env); start; _end } in - let text = Buffer.contents buf in - let kind = if multiline then Block else Line in - let on_newline = - let open Loc in - ((env.lex_last_loc)._end).Loc.line < (loc.start).Loc.line in - let c = { kind; text; on_newline } in (loc, c) : Loc.t - Flow_ast.Comment.t) + (buf : Buffer.t) (multiline : bool) : Loc.t Flow_ast.Comment.t= + let open Flow_ast.Comment in + let loc = { Loc.source = (Lex_env.source env); start; _end } in + let text = Buffer.contents buf in + let kind = if multiline then Block else Line in + let on_newline = + let open Loc in + ((env.lex_last_loc)._end).Loc.line < (loc.start).Loc.line in + let c = { kind; text; on_newline } in (loc, c) let mk_num_singleton number_type (lexeme : int array) = let raw = Sedlexing.string_of_utf8 lexeme in let value = @@ -6888,13 +6887,12 @@ let decode_identifier = | 2 -> (env, (Buffer.contents buf)) | 3 -> (lexeme_to_buffer lexbuf buf; id_char env offset buf lexbuf) | _ -> failwith "unreachable id_char") in - fun env -> - fun raw -> - let offset = Sedlexing.lexeme_start env.lex_lb in - let lexbuf = Sedlexing.from_int_array raw in - let buf = Buffer.create (Array.length raw) in - id_char env offset buf lexbuf -let recover env lexbuf ~f = + fun env raw -> + let offset = Sedlexing.lexeme_start env.lex_lb in + let lexbuf = Sedlexing.from_int_array raw in + let buf = Buffer.create (Array.length raw) in + id_char env offset buf lexbuf +let recover env lexbuf ~f = let env = illegal env (loc_of_lexbuf env lexbuf) in Sedlexing.rollback lexbuf; f env lexbuf type result = @@ -7289,2662 +7287,2642 @@ let rec template_part env cooked raw lexbuf = Buffer.add_string cooked c; template_part env cooked raw lexbuf) | _ -> failwith "unreachable template_part") -let token (env : Lex_env.t) lexbuf = - (let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_50 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 98 - | 1 -> 99 - | 2 -> __sedlex_state_3 lexbuf - | 3 -> 0 - | 4 -> __sedlex_state_6 lexbuf - | 5 -> __sedlex_state_8 lexbuf - | 6 -> 7 - | 7 -> __sedlex_state_12 lexbuf - | 8 -> 97 - | 9 -> __sedlex_state_15 lexbuf - | 10 -> __sedlex_state_17 lexbuf - | 11 -> 38 - | 12 -> 39 - | 13 -> __sedlex_state_23 lexbuf - | 14 -> __sedlex_state_28 lexbuf - | 15 -> 45 - | 16 -> __sedlex_state_32 lexbuf - | 17 -> __sedlex_state_35 lexbuf - | 18 -> __sedlex_state_58 lexbuf - | 19 -> __sedlex_state_76 lexbuf - | 20 -> __sedlex_state_129 lexbuf - | 21 -> 46 - | 22 -> 44 - | 23 -> __sedlex_state_135 lexbuf - | 24 -> __sedlex_state_139 lexbuf - | 25 -> __sedlex_state_143 lexbuf - | 26 -> __sedlex_state_149 lexbuf - | 27 -> __sedlex_state_154 lexbuf - | 28 -> 40 - | 29 -> __sedlex_state_177 lexbuf - | 30 -> 41 - | 31 -> __sedlex_state_186 lexbuf - | 32 -> 8 - | 33 -> 36 - | 34 -> __sedlex_state_190 lexbuf - | 35 -> 37 - | 36 -> 89 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_3 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 1; - (match __sedlex_partition_51 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_4 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_4 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 1; - (match __sedlex_partition_51 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_4 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_6 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_11 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 0 - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_8 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 88; - (match __sedlex_partition_52 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_9 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_9 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 58; - (match __sedlex_partition_52 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 54 - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_12 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 95; - (match __sedlex_partition_53 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 6 - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_15 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 84; - (match __sedlex_partition_52 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 71 - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_17 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 86; - (match __sedlex_partition_54 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_18 lexbuf - | 1 -> 72 - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_18 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 51; - (match __sedlex_partition_52 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 76 - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_23 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 82; - (match __sedlex_partition_55 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_24 lexbuf - | 1 -> 4 - | 2 -> 69 - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_24 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 83; - (match __sedlex_partition_52 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 70 - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_28 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 80; - (match __sedlex_partition_56 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 59 - | 1 -> 67 - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_32 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 81; - (match __sedlex_partition_57 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 60 - | 1 -> 68 - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_35 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 43; - (match __sedlex_partition_47 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_36 lexbuf - | 1 -> __sedlex_state_38 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_36 = - function - | lexbuf -> - (match __sedlex_partition_58 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 42 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_38 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 34; - (match __sedlex_partition_59 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_39 lexbuf - | 1 -> __sedlex_state_38 lexbuf - | 2 -> __sedlex_state_40 lexbuf - | 3 -> __sedlex_state_54 lexbuf - | 4 -> __sedlex_state_56 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_39 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 33; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_39 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_40 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 33; - (match __sedlex_partition_61 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_39 lexbuf - | 1 -> __sedlex_state_41 lexbuf - | 2 -> __sedlex_state_49 lexbuf - | 3 -> __sedlex_state_53 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_41 = - function - | lexbuf -> - (match __sedlex_partition_40 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_42 lexbuf - | 1 -> __sedlex_state_46 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_42 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 28; - (match __sedlex_partition_62 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_43 lexbuf - | 1 -> __sedlex_state_42 lexbuf - | 2 -> __sedlex_state_44 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_43 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 27; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_43 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_44 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 26; - (match __sedlex_partition_63 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_45 lexbuf - | 1 -> __sedlex_state_43 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_45 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 25; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_45 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_46 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 28; - (match __sedlex_partition_64 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_43 lexbuf - | 1 -> __sedlex_state_46 lexbuf - | 2 -> __sedlex_state_47 lexbuf - | 3 -> __sedlex_state_44 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_47 = - function - | lexbuf -> - (match __sedlex_partition_33 (Sedlexing.__private__next_int lexbuf) +let token (env : Lex_env.t) lexbuf : result= + let rec __sedlex_state_0 = + function + | lexbuf -> + (match __sedlex_partition_50 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> 98 + | 1 -> 99 + | 2 -> __sedlex_state_3 lexbuf + | 3 -> 0 + | 4 -> __sedlex_state_6 lexbuf + | 5 -> __sedlex_state_8 lexbuf + | 6 -> 7 + | 7 -> __sedlex_state_12 lexbuf + | 8 -> 97 + | 9 -> __sedlex_state_15 lexbuf + | 10 -> __sedlex_state_17 lexbuf + | 11 -> 38 + | 12 -> 39 + | 13 -> __sedlex_state_23 lexbuf + | 14 -> __sedlex_state_28 lexbuf + | 15 -> 45 + | 16 -> __sedlex_state_32 lexbuf + | 17 -> __sedlex_state_35 lexbuf + | 18 -> __sedlex_state_58 lexbuf + | 19 -> __sedlex_state_76 lexbuf + | 20 -> __sedlex_state_129 lexbuf + | 21 -> 46 + | 22 -> 44 + | 23 -> __sedlex_state_135 lexbuf + | 24 -> __sedlex_state_139 lexbuf + | 25 -> __sedlex_state_143 lexbuf + | 26 -> __sedlex_state_149 lexbuf + | 27 -> __sedlex_state_154 lexbuf + | 28 -> 40 + | 29 -> __sedlex_state_177 lexbuf + | 30 -> 41 + | 31 -> __sedlex_state_186 lexbuf + | 32 -> 8 + | 33 -> 36 + | 34 -> __sedlex_state_190 lexbuf + | 35 -> 37 + | 36 -> 89 + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_3 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 1; + (match __sedlex_partition_51 (Sedlexing.__private__next_int lexbuf) with - | 0 -> __sedlex_state_48 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_48 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 28; - (match __sedlex_partition_64 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_43 lexbuf - | 1 -> __sedlex_state_48 lexbuf - | 2 -> __sedlex_state_47 lexbuf - | 3 -> __sedlex_state_44 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_49 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 28; - (match __sedlex_partition_62 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_50 lexbuf - | 1 -> __sedlex_state_49 lexbuf - | 2 -> __sedlex_state_51 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_50 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 27; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_50 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_51 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 26; - (match __sedlex_partition_63 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_52 lexbuf - | 1 -> __sedlex_state_50 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_52 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 25; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_52 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_53 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 28; - (match __sedlex_partition_64 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_50 lexbuf - | 1 -> __sedlex_state_53 lexbuf - | 2 -> __sedlex_state_47 lexbuf - | 3 -> __sedlex_state_51 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_54 = - function - | lexbuf -> - (match __sedlex_partition_33 (Sedlexing.__private__next_int lexbuf) + | 0 -> __sedlex_state_4 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_4 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 1; + (match __sedlex_partition_51 (Sedlexing.__private__next_int lexbuf) with - | 0 -> __sedlex_state_55 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_55 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 34; - (match __sedlex_partition_59 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_39 lexbuf - | 1 -> __sedlex_state_55 lexbuf - | 2 -> __sedlex_state_40 lexbuf - | 3 -> __sedlex_state_54 lexbuf - | 4 -> __sedlex_state_56 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_56 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 31; - (match __sedlex_partition_63 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_57 lexbuf - | 1 -> __sedlex_state_39 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_57 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 29; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_57 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_58 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 93; - (match __sedlex_partition_55 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_59 lexbuf - | 1 -> 5 - | 2 -> 92 - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_59 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 2; - (match __sedlex_partition_65 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_60 lexbuf - | 1 -> __sedlex_state_61 lexbuf - | 2 -> __sedlex_state_63 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_60 = - function - | lexbuf -> - (match __sedlex_partition_65 (Sedlexing.__private__next_int lexbuf) + | 0 -> __sedlex_state_4 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_6 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 0; + (match __sedlex_partition_11 (Sedlexing.__private__next_int lexbuf) with - | 0 -> __sedlex_state_60 lexbuf - | 1 -> __sedlex_state_61 lexbuf - | 2 -> __sedlex_state_63 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_61 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 3; - (match __sedlex_partition_66 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 3 - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_63 = - function - | lexbuf -> - (match __sedlex_partition_67 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_64 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_64 = - function - | lexbuf -> - (match __sedlex_partition_68 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_65 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_65 = - function - | lexbuf -> - (match __sedlex_partition_69 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_66 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_66 = - function - | lexbuf -> - (match __sedlex_partition_70 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_67 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_67 = - function - | lexbuf -> - (match __sedlex_partition_71 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_68 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_68 = - function - | lexbuf -> - (match __sedlex_partition_72 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_69 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_69 = - function - | lexbuf -> - (match __sedlex_partition_73 (Sedlexing.__private__next_int lexbuf) + | 0 -> 0 + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_8 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 88; + (match __sedlex_partition_52 (Sedlexing.__private__next_int lexbuf) with - | 0 -> __sedlex_state_70 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_70 = - function - | lexbuf -> - (match __sedlex_partition_67 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_71 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_71 = - function - | lexbuf -> - (match __sedlex_partition_2 (Sedlexing.__private__next_int lexbuf) + | 0 -> __sedlex_state_9 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_9 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 58; + (match __sedlex_partition_52 (Sedlexing.__private__next_int lexbuf) with - | 0 -> __sedlex_state_72 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_72 = - function - | lexbuf -> - (match __sedlex_partition_74 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_73 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_73 = - function - | lexbuf -> - (match __sedlex_partition_75 (Sedlexing.__private__next_int lexbuf) + | 0 -> 54 + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_12 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 95; + (match __sedlex_partition_53 (Sedlexing.__private__next_int lexbuf) with - | 0 -> 3 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_76 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 34; - (match __sedlex_partition_76 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_39 lexbuf - | 1 -> __sedlex_state_77 lexbuf - | 2 -> __sedlex_state_81 lexbuf - | 3 -> __sedlex_state_93 lexbuf - | 4 -> __sedlex_state_97 lexbuf - | 5 -> __sedlex_state_40 lexbuf - | 6 -> __sedlex_state_107 lexbuf - | 7 -> __sedlex_state_117 lexbuf - | 8 -> __sedlex_state_127 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_77 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 34; - (match __sedlex_partition_77 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_39 lexbuf - | 1 -> __sedlex_state_78 lexbuf - | 2 -> __sedlex_state_40 lexbuf - | 3 -> __sedlex_state_56 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_78 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 34; - (match __sedlex_partition_59 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_39 lexbuf - | 1 -> __sedlex_state_78 lexbuf - | 2 -> __sedlex_state_40 lexbuf - | 3 -> __sedlex_state_79 lexbuf - | 4 -> __sedlex_state_56 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_79 = - function - | lexbuf -> - (match __sedlex_partition_33 (Sedlexing.__private__next_int lexbuf) + | 0 -> 6 + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_15 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 84; + (match __sedlex_partition_52 (Sedlexing.__private__next_int lexbuf) with - | 0 -> __sedlex_state_80 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_80 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 34; - (match __sedlex_partition_59 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_39 lexbuf - | 1 -> __sedlex_state_80 lexbuf - | 2 -> __sedlex_state_40 lexbuf - | 3 -> __sedlex_state_79 lexbuf - | 4 -> __sedlex_state_56 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_81 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 20; - (match __sedlex_partition_78 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_82 lexbuf - | 1 -> __sedlex_state_83 lexbuf - | 2 -> __sedlex_state_81 lexbuf - | 3 -> __sedlex_state_87 lexbuf - | 4 -> __sedlex_state_91 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_82 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 19; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_82 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_83 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 34; - (match __sedlex_partition_62 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_39 lexbuf - | 1 -> __sedlex_state_84 lexbuf - | 2 -> __sedlex_state_56 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_84 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 34; - (match __sedlex_partition_64 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_39 lexbuf - | 1 -> __sedlex_state_84 lexbuf - | 2 -> __sedlex_state_85 lexbuf - | 3 -> __sedlex_state_56 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_85 = - function - | lexbuf -> - (match __sedlex_partition_33 (Sedlexing.__private__next_int lexbuf) + | 0 -> 71 + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_17 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 86; + (match __sedlex_partition_54 (Sedlexing.__private__next_int lexbuf) with - | 0 -> __sedlex_state_86 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_86 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 34; - (match __sedlex_partition_64 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_39 lexbuf - | 1 -> __sedlex_state_86 lexbuf - | 2 -> __sedlex_state_85 lexbuf - | 3 -> __sedlex_state_56 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_87 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 18; - (match __sedlex_partition_79 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_88 lexbuf - | 1 -> __sedlex_state_83 lexbuf - | 2 -> __sedlex_state_87 lexbuf - | 3 -> __sedlex_state_89 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_88 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 17; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_88 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_89 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 17; - (match __sedlex_partition_63 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_90 lexbuf - | 1 -> __sedlex_state_88 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_90 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 17; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_90 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_91 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 19; - (match __sedlex_partition_63 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_92 lexbuf - | 1 -> __sedlex_state_82 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_92 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 19; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_92 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_93 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 18; - (match __sedlex_partition_79 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_94 lexbuf - | 1 -> __sedlex_state_83 lexbuf - | 2 -> __sedlex_state_93 lexbuf - | 3 -> __sedlex_state_95 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_94 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 17; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_94 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_95 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 17; - (match __sedlex_partition_63 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_96 lexbuf - | 1 -> __sedlex_state_94 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_96 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 17; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_96 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_97 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 33; - (match __sedlex_partition_80 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_39 lexbuf - | 1 -> __sedlex_state_98 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_98 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 12; - (match __sedlex_partition_81 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_99 lexbuf - | 1 -> __sedlex_state_98 lexbuf - | 2 -> __sedlex_state_100 lexbuf - | 3 -> __sedlex_state_105 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_99 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 11; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_99 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_100 = - function - | lexbuf -> - (match __sedlex_partition_26 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_101 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_101 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 12; - (match __sedlex_partition_81 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_102 lexbuf - | 1 -> __sedlex_state_101 lexbuf - | 2 -> __sedlex_state_100 lexbuf - | 3 -> __sedlex_state_103 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_102 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 11; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_102 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_103 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 10; - (match __sedlex_partition_63 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_104 lexbuf - | 1 -> __sedlex_state_102 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_104 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 9; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_104 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_105 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 10; - (match __sedlex_partition_63 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_106 lexbuf - | 1 -> __sedlex_state_99 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_106 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 9; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_106 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_107 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 33; - (match __sedlex_partition_82 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_39 lexbuf - | 1 -> __sedlex_state_108 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_108 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 16; - (match __sedlex_partition_83 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_109 lexbuf - | 1 -> __sedlex_state_108 lexbuf - | 2 -> __sedlex_state_110 lexbuf - | 3 -> __sedlex_state_115 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_109 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 15; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_109 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_110 = - function - | lexbuf -> - (match __sedlex_partition_17 (Sedlexing.__private__next_int lexbuf) + | 0 -> __sedlex_state_18 lexbuf + | 1 -> 72 + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_18 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 51; + (match __sedlex_partition_52 (Sedlexing.__private__next_int lexbuf) with - | 0 -> __sedlex_state_111 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_111 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 16; - (match __sedlex_partition_83 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_112 lexbuf - | 1 -> __sedlex_state_111 lexbuf - | 2 -> __sedlex_state_110 lexbuf - | 3 -> __sedlex_state_113 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_112 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 15; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_112 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_113 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 14; - (match __sedlex_partition_63 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_114 lexbuf - | 1 -> __sedlex_state_112 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_114 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 13; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_114 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_115 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 14; - (match __sedlex_partition_63 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_116 lexbuf - | 1 -> __sedlex_state_109 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_116 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 13; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_116 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_117 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 33; - (match __sedlex_partition_84 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_39 lexbuf - | 1 -> __sedlex_state_118 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_118 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 24; - (match __sedlex_partition_85 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_119 lexbuf - | 1 -> __sedlex_state_118 lexbuf - | 2 -> __sedlex_state_120 lexbuf - | 3 -> __sedlex_state_125 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_119 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 23; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_119 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_120 = - function - | lexbuf -> - (match __sedlex_partition_4 (Sedlexing.__private__next_int lexbuf) + | 0 -> 76 + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_23 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 82; + (match __sedlex_partition_55 (Sedlexing.__private__next_int lexbuf) with - | 0 -> __sedlex_state_121 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_121 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 24; - (match __sedlex_partition_85 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_122 lexbuf - | 1 -> __sedlex_state_121 lexbuf - | 2 -> __sedlex_state_120 lexbuf - | 3 -> __sedlex_state_123 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_122 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 23; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_122 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_123 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 22; - (match __sedlex_partition_63 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_124 lexbuf - | 1 -> __sedlex_state_122 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_124 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 21; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_124 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_125 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 22; - (match __sedlex_partition_63 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_126 lexbuf - | 1 -> __sedlex_state_119 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_126 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 21; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_126 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_127 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 32; - (match __sedlex_partition_63 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_128 lexbuf - | 1 -> __sedlex_state_39 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_128 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 30; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_128 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_129 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 34; - (match __sedlex_partition_86 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_39 lexbuf - | 1 -> __sedlex_state_77 lexbuf - | 2 -> __sedlex_state_130 lexbuf - | 3 -> __sedlex_state_40 lexbuf - | 4 -> __sedlex_state_131 lexbuf - | 5 -> __sedlex_state_127 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_130 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 34; - (match __sedlex_partition_86 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_39 lexbuf - | 1 -> __sedlex_state_77 lexbuf - | 2 -> __sedlex_state_130 lexbuf - | 3 -> __sedlex_state_40 lexbuf - | 4 -> __sedlex_state_131 lexbuf - | 5 -> __sedlex_state_127 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_131 = - function - | lexbuf -> - (match __sedlex_partition_33 (Sedlexing.__private__next_int lexbuf) + | 0 -> __sedlex_state_24 lexbuf + | 1 -> 4 + | 2 -> 69 + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_24 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 83; + (match __sedlex_partition_52 (Sedlexing.__private__next_int lexbuf) with - | 0 -> __sedlex_state_132 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_132 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 34; - (match __sedlex_partition_87 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_39 lexbuf - | 1 -> __sedlex_state_83 lexbuf - | 2 -> __sedlex_state_132 lexbuf - | 3 -> __sedlex_state_131 lexbuf - | 4 -> __sedlex_state_127 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_135 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 78; - (match __sedlex_partition_88 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_136 lexbuf - | 1 -> 55 - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_136 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 62; - (match __sedlex_partition_52 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 61 - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_139 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 90; - (match __sedlex_partition_89 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_140 lexbuf - | 1 -> 91 - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_140 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 57; - (match __sedlex_partition_52 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 53 - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_143 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 79; - (match __sedlex_partition_89 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 56 - | 1 -> __sedlex_state_145 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_145 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 66; - (match __sedlex_partition_89 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 63 - | 1 -> __sedlex_state_147 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_147 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 65; - (match __sedlex_partition_52 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 64 - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_149 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 50; - (match __sedlex_partition_90 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_150 lexbuf - | 1 -> __sedlex_state_152 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_150 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 48; - (match __sedlex_partition_33 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 47 - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_152 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 49; - (match __sedlex_partition_52 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 75 - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_154 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 94; - (match __sedlex_partition_91 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_155 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_155 = - function - | lexbuf -> - (match __sedlex_partition_92 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_156 lexbuf - | 1 -> __sedlex_state_169 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_156 = - function - | lexbuf -> - (match __sedlex_partition_93 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_157 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_157 = - function - | lexbuf -> - (match __sedlex_partition_94 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_158 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_158 = - function - | lexbuf -> - (match __sedlex_partition_72 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_159 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_159 = - function - | lexbuf -> - (match __sedlex_partition_73 (Sedlexing.__private__next_int lexbuf) + | 0 -> 70 + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_28 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 80; + (match __sedlex_partition_56 (Sedlexing.__private__next_int lexbuf) with - | 0 -> __sedlex_state_160 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_160 = - function - | lexbuf -> - (match __sedlex_partition_95 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_161 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_161 = - function - | lexbuf -> - (match __sedlex_partition_96 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_162 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_162 = - function - | lexbuf -> - (match __sedlex_partition_75 (Sedlexing.__private__next_int lexbuf) + | 0 -> 59 + | 1 -> 67 + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_32 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 81; + (match __sedlex_partition_57 (Sedlexing.__private__next_int lexbuf) with - | 0 -> __sedlex_state_163 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_163 = - function - | lexbuf -> - (match __sedlex_partition_97 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_164 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_164 = - function - | lexbuf -> - (match __sedlex_partition_98 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_165 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_165 = - function - | lexbuf -> - (match __sedlex_partition_96 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_166 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_166 = - function - | lexbuf -> - (match __sedlex_partition_68 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_167 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_167 = - function - | lexbuf -> - (match __sedlex_partition_97 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 35 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_169 = - function - | lexbuf -> - (match __sedlex_partition_96 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_170 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_170 = - function - | lexbuf -> - (match __sedlex_partition_75 (Sedlexing.__private__next_int lexbuf) + | 0 -> 60 + | 1 -> 68 + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_35 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 43; + (match __sedlex_partition_47 (Sedlexing.__private__next_int lexbuf) with - | 0 -> __sedlex_state_171 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_171 = - function - | lexbuf -> - (match __sedlex_partition_97 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_172 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_172 = - function - | lexbuf -> - (match __sedlex_partition_98 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_173 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_173 = - function - | lexbuf -> - (match __sedlex_partition_96 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_174 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_174 = - function - | lexbuf -> - (match __sedlex_partition_68 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_175 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_175 = - function - | lexbuf -> - (match __sedlex_partition_97 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 35 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_177 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 96; - (match __sedlex_partition_2 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_178 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_178 = - function - | lexbuf -> - (match __sedlex_partition_3 (Sedlexing.__private__next_int lexbuf) + | 0 -> __sedlex_state_36 lexbuf + | 1 -> __sedlex_state_38 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_36 = + function + | lexbuf -> + (match __sedlex_partition_58 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> 42 + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_38 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 34; + (match __sedlex_partition_59 (Sedlexing.__private__next_int lexbuf) with - | 0 -> __sedlex_state_179 lexbuf - | 1 -> __sedlex_state_183 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_179 = - function - | lexbuf -> - (match __sedlex_partition_4 (Sedlexing.__private__next_int lexbuf) + | 0 -> __sedlex_state_39 lexbuf + | 1 -> __sedlex_state_38 lexbuf + | 2 -> __sedlex_state_40 lexbuf + | 3 -> __sedlex_state_54 lexbuf + | 4 -> __sedlex_state_56 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_39 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 33; + (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) with - | 0 -> __sedlex_state_180 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_180 = - function - | lexbuf -> - (match __sedlex_partition_4 (Sedlexing.__private__next_int lexbuf) + | 0 -> __sedlex_state_39 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_40 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 33; + (match __sedlex_partition_61 (Sedlexing.__private__next_int lexbuf) with - | 0 -> __sedlex_state_181 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_181 = - function - | lexbuf -> - (match __sedlex_partition_4 (Sedlexing.__private__next_int lexbuf) + | 0 -> __sedlex_state_39 lexbuf + | 1 -> __sedlex_state_41 lexbuf + | 2 -> __sedlex_state_49 lexbuf + | 3 -> __sedlex_state_53 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_41 = + function + | lexbuf -> + (match __sedlex_partition_40 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_42 lexbuf + | 1 -> __sedlex_state_46 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_42 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 28; + (match __sedlex_partition_62 (Sedlexing.__private__next_int lexbuf) with - | 0 -> 97 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_183 = - function - | lexbuf -> - (match __sedlex_partition_4 (Sedlexing.__private__next_int lexbuf) + | 0 -> __sedlex_state_43 lexbuf + | 1 -> __sedlex_state_42 lexbuf + | 2 -> __sedlex_state_44 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_43 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 27; + (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) with - | 0 -> __sedlex_state_184 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_184 = - function - | lexbuf -> - (match __sedlex_partition_5 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_184 lexbuf - | 1 -> 97 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_186 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 87; - (match __sedlex_partition_52 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 74 - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_190 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 85; - (match __sedlex_partition_99 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 73 - | 1 -> __sedlex_state_192 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_192 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 52; - (match __sedlex_partition_52 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 77 - | _ -> Sedlexing.backtrack lexbuf)) in - Sedlexing.start lexbuf; - (match __sedlex_state_0 lexbuf with - | 0 -> let env = new_line env lexbuf in Continue env - | 1 -> Continue env - | 2 -> - let start_pos = start_pos_of_lexbuf env lexbuf in - let buf = Buffer.create 127 in - let (env, end_pos) = comment env buf lexbuf in - Comment (env, (mk_comment env start_pos end_pos buf true)) - | 3 -> - let pattern = lexeme lexbuf in - if not (is_comment_syntax_enabled env) - then - let start_pos = start_pos_of_lexbuf env lexbuf in - let buf = Buffer.create 127 in - (Buffer.add_string buf - (String.sub pattern 2 ((String.length pattern) - 2)); - (let (env, end_pos) = comment env buf lexbuf in - Comment (env, (mk_comment env start_pos end_pos buf true)))) - else - (let env = - if is_in_comment_syntax env - then - let loc = loc_of_lexbuf env lexbuf in - unexpected_error env loc pattern - else env in - let env = in_comment_syntax true env in - let len = Sedlexing.lexeme_length lexbuf in - if - ((Sedlexing.Utf8.sub_lexeme lexbuf (len - 1) 1) = ":") && - ((Sedlexing.Utf8.sub_lexeme lexbuf (len - 2) 1) <> ":") - then Token (env, T_COLON) - else Continue env) - | 4 -> - if is_in_comment_syntax env - then let env = in_comment_syntax false env in Continue env - else - (Sedlexing.rollback lexbuf; - (let __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_23 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 0 - | _ -> Sedlexing.backtrack lexbuf) in - Sedlexing.start lexbuf; - (match __sedlex_state_0 lexbuf with - | 0 -> Token (env, T_MULT) - | _ -> failwith "expected *"))) - | 5 -> - let start_pos = start_pos_of_lexbuf env lexbuf in - let buf = Buffer.create 127 in - let (env, end_pos) = line_comment env buf lexbuf in - Comment (env, (mk_comment env start_pos end_pos buf false)) - | 6 -> - if (Sedlexing.lexeme_start lexbuf) = 0 - then - let start = start_pos_of_lexbuf env lexbuf in - let buf = Buffer.create 127 in - let (env, _end) = line_comment env buf lexbuf in - let loc = { Loc.source = (Lex_env.source env); start; _end } in - Token (env, (T_INTERPRETER (loc, (Buffer.contents buf)))) - else Token (env, (T_ERROR "#!")) - | 7 -> - let quote = lexeme lexbuf in - let start = start_pos_of_lexbuf env lexbuf in - let buf = Buffer.create 127 in - let raw = Buffer.create 127 in - (Buffer.add_string raw quote; - (let octal = false in - let (env, _end, octal) = - string_quote env quote buf raw octal lexbuf in - let loc = { Loc.source = (Lex_env.source env); start; _end } in - Token - (env, - (T_STRING - (loc, (Buffer.contents buf), (Buffer.contents raw), octal))))) - | 8 -> - let value = Buffer.create 127 in - let raw = Buffer.create 127 in - let start = start_pos_of_lexbuf env lexbuf in - let (env, is_tail) = template_part env value raw lexbuf in - let _end = end_pos_of_lexbuf env lexbuf in - let loc = { Loc.source = (Lex_env.source env); start; _end } in - Token - (env, - (T_TEMPLATE_PART - (loc, (Buffer.contents value), (Buffer.contents raw), true, - is_tail))) - | 9 -> - recover env lexbuf - ~f:(fun env -> - fun lexbuf -> - let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_24 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_1 = - function - | lexbuf -> - (match __sedlex_partition_25 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_2 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_2 = - function - | lexbuf -> - (match __sedlex_partition_26 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_3 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_3 = - function - | lexbuf -> - (match __sedlex_partition_27 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_3 lexbuf - | 1 -> __sedlex_state_4 lexbuf - | 2 -> 0 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_4 = - function - | lexbuf -> - (match __sedlex_partition_26 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_5 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_5 = - function - | lexbuf -> - (match __sedlex_partition_27 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_5 lexbuf - | 1 -> __sedlex_state_4 lexbuf - | 2 -> 0 - | _ -> Sedlexing.backtrack lexbuf) in - Sedlexing.start lexbuf; - (match __sedlex_state_0 lexbuf with - | 0 -> - Token - (env, - (T_BIGINT - { kind = BIG_BINARY; raw = (lexeme lexbuf) })) - | _ -> failwith "unreachable token bigint")) - | 10 -> - Token (env, (T_BIGINT { kind = BIG_BINARY; raw = (lexeme lexbuf) })) - | 11 -> - recover env lexbuf - ~f:(fun env -> - fun lexbuf -> - let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_24 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_1 = - function - | lexbuf -> - (match __sedlex_partition_25 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_2 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_2 = - function - | lexbuf -> - (match __sedlex_partition_26 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_3 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_3 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_28 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_3 lexbuf - | 1 -> __sedlex_state_4 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_4 = - function - | lexbuf -> - (match __sedlex_partition_26 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_5 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_5 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_28 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_5 lexbuf - | 1 -> __sedlex_state_4 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) in - Sedlexing.start lexbuf; - (match __sedlex_state_0 lexbuf with - | 0 -> - Token - (env, - (T_NUMBER { kind = BINARY; raw = (lexeme lexbuf) })) - | _ -> failwith "unreachable token bignumber")) - | 12 -> Token (env, (T_NUMBER { kind = BINARY; raw = (lexeme lexbuf) })) - | 13 -> - recover env lexbuf - ~f:(fun env -> - fun lexbuf -> - let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_24 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_1 = - function - | lexbuf -> - (match __sedlex_partition_29 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_2 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_2 = - function - | lexbuf -> - (match __sedlex_partition_17 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_3 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_3 = - function - | lexbuf -> - (match __sedlex_partition_30 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_3 lexbuf - | 1 -> __sedlex_state_4 lexbuf - | 2 -> 0 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_4 = - function - | lexbuf -> - (match __sedlex_partition_17 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_5 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_5 = - function - | lexbuf -> - (match __sedlex_partition_30 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_5 lexbuf - | 1 -> __sedlex_state_4 lexbuf - | 2 -> 0 - | _ -> Sedlexing.backtrack lexbuf) in - Sedlexing.start lexbuf; - (match __sedlex_state_0 lexbuf with - | 0 -> - Token - (env, - (T_BIGINT - { kind = BIG_OCTAL; raw = (lexeme lexbuf) })) - | _ -> failwith "unreachable token octbigint")) - | 14 -> - Token (env, (T_BIGINT { kind = BIG_OCTAL; raw = (lexeme lexbuf) })) - | 15 -> - recover env lexbuf - ~f:(fun env -> - fun lexbuf -> - let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_24 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_1 = - function - | lexbuf -> - (match __sedlex_partition_29 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_2 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_2 = - function - | lexbuf -> - (match __sedlex_partition_17 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_3 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_3 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_31 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_3 lexbuf - | 1 -> __sedlex_state_4 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_4 = - function - | lexbuf -> - (match __sedlex_partition_17 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_5 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_5 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_31 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_5 lexbuf - | 1 -> __sedlex_state_4 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) in - Sedlexing.start lexbuf; - (match __sedlex_state_0 lexbuf with - | 0 -> - Token - (env, - (T_NUMBER { kind = OCTAL; raw = (lexeme lexbuf) })) - | _ -> failwith "unreachable token octnumber")) - | 16 -> Token (env, (T_NUMBER { kind = OCTAL; raw = (lexeme lexbuf) })) - | 17 -> - recover env lexbuf - ~f:(fun env -> - fun lexbuf -> - let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_24 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_1 = - function - | lexbuf -> - (match __sedlex_partition_32 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | 1 -> __sedlex_state_2 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_2 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_33 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_2 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) in - Sedlexing.start lexbuf; - (match __sedlex_state_0 lexbuf with - | 0 -> - Token - (env, - (T_NUMBER - { - kind = LEGACY_NON_OCTAL; - raw = (lexeme lexbuf) - })) - | _ -> failwith "unreachable token legacynonoctnumber")) - | 18 -> - Token - (env, - (T_NUMBER { kind = LEGACY_NON_OCTAL; raw = (lexeme lexbuf) })) - | 19 -> - recover env lexbuf - ~f:(fun env -> - fun lexbuf -> - let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_24 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_1 = - function - | lexbuf -> - (match __sedlex_partition_17 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_2 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_2 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_17 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_2 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) in - Sedlexing.start lexbuf; - (match __sedlex_state_0 lexbuf with - | 0 -> - Token - (env, - (T_NUMBER - { kind = LEGACY_OCTAL; raw = (lexeme lexbuf) })) - | _ -> failwith "unreachable token legacyoctnumber")) - | 20 -> - Token - (env, (T_NUMBER { kind = LEGACY_OCTAL; raw = (lexeme lexbuf) })) - | 21 -> - recover env lexbuf - ~f:(fun env -> - fun lexbuf -> - let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_24 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_1 = - function - | lexbuf -> - (match __sedlex_partition_34 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_2 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_2 = - function - | lexbuf -> - (match __sedlex_partition_4 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_3 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_3 = - function - | lexbuf -> - (match __sedlex_partition_35 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_3 lexbuf - | 1 -> __sedlex_state_4 lexbuf - | 2 -> 0 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_4 = - function - | lexbuf -> - (match __sedlex_partition_4 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_5 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_5 = - function - | lexbuf -> - (match __sedlex_partition_35 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_5 lexbuf - | 1 -> __sedlex_state_4 lexbuf - | 2 -> 0 - | _ -> Sedlexing.backtrack lexbuf) in - Sedlexing.start lexbuf; - (match __sedlex_state_0 lexbuf with - | 0 -> - Token - (env, - (T_BIGINT - { kind = BIG_NORMAL; raw = (lexeme lexbuf) })) - | _ -> failwith "unreachable token hexbigint")) - | 22 -> - Token (env, (T_BIGINT { kind = BIG_NORMAL; raw = (lexeme lexbuf) })) - | 23 -> - recover env lexbuf - ~f:(fun env -> - fun lexbuf -> - let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_24 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_1 = - function - | lexbuf -> - (match __sedlex_partition_34 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_2 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_2 = - function - | lexbuf -> - (match __sedlex_partition_4 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_3 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_3 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_36 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_3 lexbuf - | 1 -> __sedlex_state_4 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_4 = - function - | lexbuf -> - (match __sedlex_partition_4 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_5 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_5 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_36 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_5 lexbuf - | 1 -> __sedlex_state_4 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) in - Sedlexing.start lexbuf; - (match __sedlex_state_0 lexbuf with - | 0 -> - Token - (env, - (T_NUMBER { kind = NORMAL; raw = (lexeme lexbuf) })) - | _ -> failwith "unreachable token hexnumber")) - | 24 -> Token (env, (T_NUMBER { kind = NORMAL; raw = (lexeme lexbuf) })) - | 25 -> - recover env lexbuf - ~f:(fun env -> - fun lexbuf -> - let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_37 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | 1 -> __sedlex_state_12 lexbuf - | 2 -> __sedlex_state_17 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_1 = - function - | lexbuf -> - (match __sedlex_partition_33 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_2 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_2 = - function - | lexbuf -> - (match __sedlex_partition_38 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_2 lexbuf - | 1 -> __sedlex_state_3 lexbuf - | 2 -> __sedlex_state_10 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_3 = - function - | lexbuf -> - (match __sedlex_partition_39 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_4 lexbuf - | 1 -> __sedlex_state_5 lexbuf - | 2 -> __sedlex_state_7 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_4 = - function - | lexbuf -> - (match __sedlex_partition_40 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_5 lexbuf - | 1 -> __sedlex_state_7 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_5 = - function - | lexbuf -> - (match __sedlex_partition_41 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_5 lexbuf - | 1 -> 0 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_7 = - function - | lexbuf -> - (match __sedlex_partition_42 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_7 lexbuf - | 1 -> __sedlex_state_8 lexbuf - | 2 -> 0 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_8 = - function - | lexbuf -> - (match __sedlex_partition_33 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_9 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_9 = - function - | lexbuf -> - (match __sedlex_partition_42 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_9 lexbuf - | 1 -> __sedlex_state_8 lexbuf - | 2 -> 0 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_10 = - function - | lexbuf -> - (match __sedlex_partition_33 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_11 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_11 = - function - | lexbuf -> - (match __sedlex_partition_38 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_11 lexbuf - | 1 -> __sedlex_state_3 lexbuf - | 2 -> __sedlex_state_10 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_12 = - function - | lexbuf -> - (match __sedlex_partition_43 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_13 lexbuf - | 1 -> __sedlex_state_3 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_13 = - function - | lexbuf -> - (match __sedlex_partition_44 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_14 lexbuf - | 1 -> __sedlex_state_3 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_14 = - function - | lexbuf -> - (match __sedlex_partition_38 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_14 lexbuf - | 1 -> __sedlex_state_3 lexbuf - | 2 -> __sedlex_state_15 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_15 = - function - | lexbuf -> - (match __sedlex_partition_33 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_16 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_16 = - function - | lexbuf -> - (match __sedlex_partition_38 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_16 lexbuf - | 1 -> __sedlex_state_3 lexbuf - | 2 -> __sedlex_state_15 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_17 = - function - | lexbuf -> - (match __sedlex_partition_45 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_13 lexbuf - | 1 -> __sedlex_state_17 lexbuf - | 2 -> __sedlex_state_3 lexbuf - | _ -> Sedlexing.backtrack lexbuf) in - Sedlexing.start lexbuf; - (match __sedlex_state_0 lexbuf with - | 0 -> - let loc = loc_of_lexbuf env lexbuf in - let env = - lex_error env loc Parse_error.InvalidSciBigInt in - Token - (env, - (T_BIGINT - { kind = BIG_NORMAL; raw = (lexeme lexbuf) })) - | _ -> failwith "unreachable token scibigint")) - | 26 -> - let loc = loc_of_lexbuf env lexbuf in - let env = lex_error env loc Parse_error.InvalidSciBigInt in - Token (env, (T_BIGINT { kind = BIG_NORMAL; raw = (lexeme lexbuf) })) - | 27 -> - recover env lexbuf - ~f:(fun env -> - fun lexbuf -> - let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_37 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | 1 -> __sedlex_state_11 lexbuf - | 2 -> __sedlex_state_16 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_1 = - function - | lexbuf -> - (match __sedlex_partition_33 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_2 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_2 = - function - | lexbuf -> - (match __sedlex_partition_38 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_2 lexbuf - | 1 -> __sedlex_state_3 lexbuf - | 2 -> __sedlex_state_9 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_3 = - function - | lexbuf -> - (match __sedlex_partition_39 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_4 lexbuf - | 1 -> __sedlex_state_5 lexbuf - | 2 -> __sedlex_state_6 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_4 = - function - | lexbuf -> - (match __sedlex_partition_40 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_5 lexbuf - | 1 -> __sedlex_state_6 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_5 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_33 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_5 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_6 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_46 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_6 lexbuf - | 1 -> __sedlex_state_7 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_7 = - function - | lexbuf -> - (match __sedlex_partition_33 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_8 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_8 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_46 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_8 lexbuf - | 1 -> __sedlex_state_7 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_9 = - function - | lexbuf -> - (match __sedlex_partition_33 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_10 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_10 = - function - | lexbuf -> - (match __sedlex_partition_38 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_10 lexbuf - | 1 -> __sedlex_state_3 lexbuf - | 2 -> __sedlex_state_9 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_11 = - function - | lexbuf -> - (match __sedlex_partition_43 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_12 lexbuf - | 1 -> __sedlex_state_3 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_12 = - function - | lexbuf -> - (match __sedlex_partition_44 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_13 lexbuf - | 1 -> __sedlex_state_3 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_13 = - function - | lexbuf -> - (match __sedlex_partition_38 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_13 lexbuf - | 1 -> __sedlex_state_3 lexbuf - | 2 -> __sedlex_state_14 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_14 = - function - | lexbuf -> - (match __sedlex_partition_33 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_15 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_15 = - function - | lexbuf -> - (match __sedlex_partition_38 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_15 lexbuf - | 1 -> __sedlex_state_3 lexbuf - | 2 -> __sedlex_state_14 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_16 = - function - | lexbuf -> - (match __sedlex_partition_45 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_12 lexbuf - | 1 -> __sedlex_state_16 lexbuf - | 2 -> __sedlex_state_3 lexbuf - | _ -> Sedlexing.backtrack lexbuf) in - Sedlexing.start lexbuf; - (match __sedlex_state_0 lexbuf with - | 0 -> - Token - (env, - (T_NUMBER { kind = NORMAL; raw = (lexeme lexbuf) })) - | _ -> failwith "unreachable token scinumber")) - | 28 -> Token (env, (T_NUMBER { kind = NORMAL; raw = (lexeme lexbuf) })) - | 29 -> - recover env lexbuf - ~f:(fun env -> - fun lexbuf -> - let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_37 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | 1 -> __sedlex_state_6 lexbuf - | 2 -> __sedlex_state_8 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_1 = - function - | lexbuf -> - (match __sedlex_partition_33 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_2 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_2 = - function - | lexbuf -> - (match __sedlex_partition_42 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_2 lexbuf - | 1 -> __sedlex_state_3 lexbuf - | 2 -> 0 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_3 = - function - | lexbuf -> - (match __sedlex_partition_33 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_4 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_4 = - function - | lexbuf -> - (match __sedlex_partition_42 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_4 lexbuf - | 1 -> __sedlex_state_3 lexbuf - | 2 -> 0 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_6 = - function - | lexbuf -> - (match __sedlex_partition_47 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_7 lexbuf - | 1 -> __sedlex_state_6 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_7 = - function - | lexbuf -> - (match __sedlex_partition_41 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_2 lexbuf - | 1 -> 0 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_8 = - function - | lexbuf -> - (match __sedlex_partition_48 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_7 lexbuf - | 1 -> __sedlex_state_8 lexbuf - | 2 -> __sedlex_state_9 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_9 = - function - | lexbuf -> - (match __sedlex_partition_33 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_10 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_10 = - function - | lexbuf -> - (match __sedlex_partition_48 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_7 lexbuf - | 1 -> __sedlex_state_10 lexbuf - | 2 -> __sedlex_state_9 lexbuf - | _ -> Sedlexing.backtrack lexbuf) in - Sedlexing.start lexbuf; - (match __sedlex_state_0 lexbuf with - | 0 -> - let loc = loc_of_lexbuf env lexbuf in - let env = - lex_error env loc Parse_error.InvalidFloatBigInt in - Token - (env, - (T_BIGINT - { kind = BIG_NORMAL; raw = (lexeme lexbuf) })) - | _ -> failwith "unreachable token floatbigint")) - | 30 -> - recover env lexbuf - ~f:(fun env -> - fun lexbuf -> - let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_40 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | 1 -> __sedlex_state_3 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_1 = - function - | lexbuf -> - (match __sedlex_partition_41 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | 1 -> 0 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_3 = - function - | lexbuf -> - (match __sedlex_partition_42 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_3 lexbuf - | 1 -> __sedlex_state_4 lexbuf - | 2 -> 0 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_4 = - function - | lexbuf -> - (match __sedlex_partition_33 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_5 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_5 = - function - | lexbuf -> - (match __sedlex_partition_42 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_5 lexbuf - | 1 -> __sedlex_state_4 lexbuf - | 2 -> 0 - | _ -> Sedlexing.backtrack lexbuf) in - Sedlexing.start lexbuf; - (match __sedlex_state_0 lexbuf with - | 0 -> - Token - (env, - (T_BIGINT - { kind = BIG_NORMAL; raw = (lexeme lexbuf) })) - | _ -> failwith "unreachable token wholebigint")) - | 31 -> - let loc = loc_of_lexbuf env lexbuf in - let env = lex_error env loc Parse_error.InvalidFloatBigInt in - Token (env, (T_BIGINT { kind = BIG_NORMAL; raw = (lexeme lexbuf) })) - | 32 -> - Token (env, (T_BIGINT { kind = BIG_NORMAL; raw = (lexeme lexbuf) })) - | 33 -> - recover env lexbuf - ~f:(fun env -> - fun lexbuf -> - let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_37 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | 1 -> __sedlex_state_5 lexbuf - | 2 -> __sedlex_state_7 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_1 = - function - | lexbuf -> - (match __sedlex_partition_33 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_2 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_2 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_46 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_2 lexbuf - | 1 -> __sedlex_state_3 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_3 = - function - | lexbuf -> - (match __sedlex_partition_33 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_4 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_4 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_46 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_4 lexbuf - | 1 -> __sedlex_state_3 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_5 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_47 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_6 lexbuf - | 1 -> __sedlex_state_5 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_6 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_33 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_2 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_7 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_48 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_6 lexbuf - | 1 -> __sedlex_state_7 lexbuf - | 2 -> __sedlex_state_8 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_8 = - function - | lexbuf -> - (match __sedlex_partition_33 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_9 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_9 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_48 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_6 lexbuf - | 1 -> __sedlex_state_9 lexbuf - | 2 -> __sedlex_state_8 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) in - Sedlexing.start lexbuf; - (match __sedlex_state_0 lexbuf with - | 0 -> - Token - (env, - (T_NUMBER { kind = NORMAL; raw = (lexeme lexbuf) })) - | _ -> failwith "unreachable token wholenumber")) - | 34 -> Token (env, (T_NUMBER { kind = NORMAL; raw = (lexeme lexbuf) })) - | 35 -> - let loc = loc_of_lexbuf env lexbuf in - let raw = lexeme lexbuf in - Token (env, (T_IDENTIFIER { loc; value = raw; raw })) - | 36 -> Token (env, T_LCURLY) - | 37 -> Token (env, T_RCURLY) - | 38 -> Token (env, T_LPAREN) - | 39 -> Token (env, T_RPAREN) - | 40 -> Token (env, T_LBRACKET) - | 41 -> Token (env, T_RBRACKET) - | 42 -> Token (env, T_ELLIPSIS) - | 43 -> Token (env, T_PERIOD) - | 44 -> Token (env, T_SEMICOLON) - | 45 -> Token (env, T_COMMA) - | 46 -> Token (env, T_COLON) - | 47 -> - (Sedlexing.rollback lexbuf; - (let __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_49 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 0 - | _ -> Sedlexing.backtrack lexbuf) in - Sedlexing.start lexbuf; - (match __sedlex_state_0 lexbuf with - | 0 -> Token (env, T_PLING) - | _ -> failwith "expected ?"))) - | 48 -> Token (env, T_PLING_PERIOD) - | 49 -> Token (env, T_PLING_PLING) - | 50 -> Token (env, T_PLING) - | 51 -> Token (env, T_AND) - | 52 -> Token (env, T_OR) - | 53 -> Token (env, T_STRICT_EQUAL) - | 54 -> Token (env, T_STRICT_NOT_EQUAL) - | 55 -> Token (env, T_LESS_THAN_EQUAL) - | 56 -> Token (env, T_GREATER_THAN_EQUAL) - | 57 -> Token (env, T_EQUAL) - | 58 -> Token (env, T_NOT_EQUAL) - | 59 -> Token (env, T_INCR) - | 60 -> Token (env, T_DECR) - | 61 -> Token (env, T_LSHIFT_ASSIGN) - | 62 -> Token (env, T_LSHIFT) - | 63 -> Token (env, T_RSHIFT_ASSIGN) - | 64 -> Token (env, T_RSHIFT3_ASSIGN) - | 65 -> Token (env, T_RSHIFT3) - | 66 -> Token (env, T_RSHIFT) - | 67 -> Token (env, T_PLUS_ASSIGN) - | 68 -> Token (env, T_MINUS_ASSIGN) - | 69 -> Token (env, T_MULT_ASSIGN) - | 70 -> Token (env, T_EXP_ASSIGN) - | 71 -> Token (env, T_MOD_ASSIGN) - | 72 -> Token (env, T_BIT_AND_ASSIGN) - | 73 -> Token (env, T_BIT_OR_ASSIGN) - | 74 -> Token (env, T_BIT_XOR_ASSIGN) - | 75 -> Token (env, T_NULLISH_ASSIGN) - | 76 -> Token (env, T_AND_ASSIGN) - | 77 -> Token (env, T_OR_ASSIGN) - | 78 -> Token (env, T_LESS_THAN) - | 79 -> Token (env, T_GREATER_THAN) - | 80 -> Token (env, T_PLUS) - | 81 -> Token (env, T_MINUS) - | 82 -> Token (env, T_MULT) - | 83 -> Token (env, T_EXP) - | 84 -> Token (env, T_MOD) - | 85 -> Token (env, T_BIT_OR) - | 86 -> Token (env, T_BIT_AND) - | 87 -> Token (env, T_BIT_XOR) - | 88 -> Token (env, T_NOT) - | 89 -> Token (env, T_BIT_NOT) - | 90 -> Token (env, T_ASSIGN) - | 91 -> Token (env, T_ARROW) - | 92 -> Token (env, T_DIV_ASSIGN) - | 93 -> Token (env, T_DIV) - | 94 -> Token (env, T_AT) - | 95 -> Token (env, T_POUND) - | 96 -> let env = illegal env (loc_of_lexbuf env lexbuf) in Continue env - | 97 -> - let start_offset = Sedlexing.lexeme_start lexbuf in - ((loop_id_continues lexbuf) |> ignore; - (let end_offset = Sedlexing.lexeme_end lexbuf in - let loc = loc_of_offsets env start_offset end_offset in - Sedlexing.set_lexeme_start lexbuf start_offset; - (match lexeme lexbuf with - | "async" -> Token (env, T_ASYNC) - | "await" -> Token (env, T_AWAIT) - | "break" -> Token (env, T_BREAK) - | "case" -> Token (env, T_CASE) - | "catch" -> Token (env, T_CATCH) - | "class" -> Token (env, T_CLASS) - | "const" -> Token (env, T_CONST) - | "continue" -> Token (env, T_CONTINUE) - | "debugger" -> Token (env, T_DEBUGGER) - | "declare" -> Token (env, T_DECLARE) - | "default" -> Token (env, T_DEFAULT) - | "delete" -> Token (env, T_DELETE) - | "do" -> Token (env, T_DO) - | "else" -> Token (env, T_ELSE) - | "enum" -> Token (env, T_ENUM) - | "export" -> Token (env, T_EXPORT) - | "extends" -> Token (env, T_EXTENDS) - | "false" -> Token (env, T_FALSE) - | "finally" -> Token (env, T_FINALLY) - | "for" -> Token (env, T_FOR) - | "function" -> Token (env, T_FUNCTION) - | "if" -> Token (env, T_IF) - | "implements" -> Token (env, T_IMPLEMENTS) - | "import" -> Token (env, T_IMPORT) - | "in" -> Token (env, T_IN) - | "instanceof" -> Token (env, T_INSTANCEOF) - | "interface" -> Token (env, T_INTERFACE) - | "let" -> Token (env, T_LET) - | "new" -> Token (env, T_NEW) - | "null" -> Token (env, T_NULL) - | "of" -> Token (env, T_OF) - | "opaque" -> Token (env, T_OPAQUE) - | "package" -> Token (env, T_PACKAGE) - | "private" -> Token (env, T_PRIVATE) - | "protected" -> Token (env, T_PROTECTED) - | "public" -> Token (env, T_PUBLIC) - | "return" -> Token (env, T_RETURN) - | "static" -> Token (env, T_STATIC) - | "super" -> Token (env, T_SUPER) - | "switch" -> Token (env, T_SWITCH) - | "this" -> Token (env, T_THIS) - | "throw" -> Token (env, T_THROW) - | "true" -> Token (env, T_TRUE) - | "try" -> Token (env, T_TRY) - | "type" -> Token (env, T_TYPE) - | "typeof" -> Token (env, T_TYPEOF) - | "var" -> Token (env, T_VAR) - | "void" -> Token (env, T_VOID) - | "while" -> Token (env, T_WHILE) - | "with" -> Token (env, T_WITH) - | "yield" -> Token (env, T_YIELD) - | _ -> - let raw = Sedlexing.lexeme lexbuf in - let (nenv, value) = decode_identifier env raw in - Token - (nenv, - (T_IDENTIFIER - { loc; value; raw = (Sedlexing.string_of_utf8 raw) }))))) - | 98 -> - let env = - if is_in_comment_syntax env - then - let loc = loc_of_lexbuf env lexbuf in - lex_error env loc Parse_error.UnexpectedEOS - else env in - Token (env, T_EOF) - | 99 -> - let env = illegal env (loc_of_lexbuf env lexbuf) in - Token (env, (T_ERROR (lexeme lexbuf))) - | _ -> failwith "unreachable token") : result) + | 0 -> __sedlex_state_43 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_44 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 26; + (match __sedlex_partition_63 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_45 lexbuf + | 1 -> __sedlex_state_43 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_45 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 25; + (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_45 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_46 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 28; + (match __sedlex_partition_64 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_43 lexbuf + | 1 -> __sedlex_state_46 lexbuf + | 2 -> __sedlex_state_47 lexbuf + | 3 -> __sedlex_state_44 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_47 = + function + | lexbuf -> + (match __sedlex_partition_33 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_48 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_48 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 28; + (match __sedlex_partition_64 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_43 lexbuf + | 1 -> __sedlex_state_48 lexbuf + | 2 -> __sedlex_state_47 lexbuf + | 3 -> __sedlex_state_44 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_49 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 28; + (match __sedlex_partition_62 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_50 lexbuf + | 1 -> __sedlex_state_49 lexbuf + | 2 -> __sedlex_state_51 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_50 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 27; + (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_50 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_51 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 26; + (match __sedlex_partition_63 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_52 lexbuf + | 1 -> __sedlex_state_50 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_52 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 25; + (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_52 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_53 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 28; + (match __sedlex_partition_64 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_50 lexbuf + | 1 -> __sedlex_state_53 lexbuf + | 2 -> __sedlex_state_47 lexbuf + | 3 -> __sedlex_state_51 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_54 = + function + | lexbuf -> + (match __sedlex_partition_33 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_55 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_55 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 34; + (match __sedlex_partition_59 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_39 lexbuf + | 1 -> __sedlex_state_55 lexbuf + | 2 -> __sedlex_state_40 lexbuf + | 3 -> __sedlex_state_54 lexbuf + | 4 -> __sedlex_state_56 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_56 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 31; + (match __sedlex_partition_63 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_57 lexbuf + | 1 -> __sedlex_state_39 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_57 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 29; + (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_57 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_58 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 93; + (match __sedlex_partition_55 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_59 lexbuf + | 1 -> 5 + | 2 -> 92 + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_59 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 2; + (match __sedlex_partition_65 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_60 lexbuf + | 1 -> __sedlex_state_61 lexbuf + | 2 -> __sedlex_state_63 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_60 = + function + | lexbuf -> + (match __sedlex_partition_65 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_60 lexbuf + | 1 -> __sedlex_state_61 lexbuf + | 2 -> __sedlex_state_63 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_61 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 3; + (match __sedlex_partition_66 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> 3 + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_63 = + function + | lexbuf -> + (match __sedlex_partition_67 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_64 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_64 = + function + | lexbuf -> + (match __sedlex_partition_68 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_65 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_65 = + function + | lexbuf -> + (match __sedlex_partition_69 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_66 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_66 = + function + | lexbuf -> + (match __sedlex_partition_70 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_67 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_67 = + function + | lexbuf -> + (match __sedlex_partition_71 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_68 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_68 = + function + | lexbuf -> + (match __sedlex_partition_72 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_69 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_69 = + function + | lexbuf -> + (match __sedlex_partition_73 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_70 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_70 = + function + | lexbuf -> + (match __sedlex_partition_67 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_71 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_71 = + function + | lexbuf -> + (match __sedlex_partition_2 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_72 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_72 = + function + | lexbuf -> + (match __sedlex_partition_74 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_73 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_73 = + function + | lexbuf -> + (match __sedlex_partition_75 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> 3 + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_76 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 34; + (match __sedlex_partition_76 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_39 lexbuf + | 1 -> __sedlex_state_77 lexbuf + | 2 -> __sedlex_state_81 lexbuf + | 3 -> __sedlex_state_93 lexbuf + | 4 -> __sedlex_state_97 lexbuf + | 5 -> __sedlex_state_40 lexbuf + | 6 -> __sedlex_state_107 lexbuf + | 7 -> __sedlex_state_117 lexbuf + | 8 -> __sedlex_state_127 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_77 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 34; + (match __sedlex_partition_77 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_39 lexbuf + | 1 -> __sedlex_state_78 lexbuf + | 2 -> __sedlex_state_40 lexbuf + | 3 -> __sedlex_state_56 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_78 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 34; + (match __sedlex_partition_59 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_39 lexbuf + | 1 -> __sedlex_state_78 lexbuf + | 2 -> __sedlex_state_40 lexbuf + | 3 -> __sedlex_state_79 lexbuf + | 4 -> __sedlex_state_56 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_79 = + function + | lexbuf -> + (match __sedlex_partition_33 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_80 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_80 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 34; + (match __sedlex_partition_59 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_39 lexbuf + | 1 -> __sedlex_state_80 lexbuf + | 2 -> __sedlex_state_40 lexbuf + | 3 -> __sedlex_state_79 lexbuf + | 4 -> __sedlex_state_56 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_81 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 20; + (match __sedlex_partition_78 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_82 lexbuf + | 1 -> __sedlex_state_83 lexbuf + | 2 -> __sedlex_state_81 lexbuf + | 3 -> __sedlex_state_87 lexbuf + | 4 -> __sedlex_state_91 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_82 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 19; + (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_82 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_83 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 34; + (match __sedlex_partition_62 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_39 lexbuf + | 1 -> __sedlex_state_84 lexbuf + | 2 -> __sedlex_state_56 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_84 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 34; + (match __sedlex_partition_64 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_39 lexbuf + | 1 -> __sedlex_state_84 lexbuf + | 2 -> __sedlex_state_85 lexbuf + | 3 -> __sedlex_state_56 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_85 = + function + | lexbuf -> + (match __sedlex_partition_33 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_86 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_86 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 34; + (match __sedlex_partition_64 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_39 lexbuf + | 1 -> __sedlex_state_86 lexbuf + | 2 -> __sedlex_state_85 lexbuf + | 3 -> __sedlex_state_56 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_87 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 18; + (match __sedlex_partition_79 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_88 lexbuf + | 1 -> __sedlex_state_83 lexbuf + | 2 -> __sedlex_state_87 lexbuf + | 3 -> __sedlex_state_89 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_88 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 17; + (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_88 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_89 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 17; + (match __sedlex_partition_63 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_90 lexbuf + | 1 -> __sedlex_state_88 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_90 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 17; + (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_90 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_91 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 19; + (match __sedlex_partition_63 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_92 lexbuf + | 1 -> __sedlex_state_82 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_92 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 19; + (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_92 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_93 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 18; + (match __sedlex_partition_79 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_94 lexbuf + | 1 -> __sedlex_state_83 lexbuf + | 2 -> __sedlex_state_93 lexbuf + | 3 -> __sedlex_state_95 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_94 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 17; + (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_94 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_95 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 17; + (match __sedlex_partition_63 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_96 lexbuf + | 1 -> __sedlex_state_94 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_96 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 17; + (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_96 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_97 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 33; + (match __sedlex_partition_80 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_39 lexbuf + | 1 -> __sedlex_state_98 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_98 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 12; + (match __sedlex_partition_81 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_99 lexbuf + | 1 -> __sedlex_state_98 lexbuf + | 2 -> __sedlex_state_100 lexbuf + | 3 -> __sedlex_state_105 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_99 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 11; + (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_99 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_100 = + function + | lexbuf -> + (match __sedlex_partition_26 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_101 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_101 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 12; + (match __sedlex_partition_81 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_102 lexbuf + | 1 -> __sedlex_state_101 lexbuf + | 2 -> __sedlex_state_100 lexbuf + | 3 -> __sedlex_state_103 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_102 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 11; + (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_102 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_103 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 10; + (match __sedlex_partition_63 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_104 lexbuf + | 1 -> __sedlex_state_102 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_104 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 9; + (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_104 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_105 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 10; + (match __sedlex_partition_63 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_106 lexbuf + | 1 -> __sedlex_state_99 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_106 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 9; + (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_106 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_107 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 33; + (match __sedlex_partition_82 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_39 lexbuf + | 1 -> __sedlex_state_108 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_108 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 16; + (match __sedlex_partition_83 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_109 lexbuf + | 1 -> __sedlex_state_108 lexbuf + | 2 -> __sedlex_state_110 lexbuf + | 3 -> __sedlex_state_115 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_109 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 15; + (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_109 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_110 = + function + | lexbuf -> + (match __sedlex_partition_17 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_111 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_111 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 16; + (match __sedlex_partition_83 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_112 lexbuf + | 1 -> __sedlex_state_111 lexbuf + | 2 -> __sedlex_state_110 lexbuf + | 3 -> __sedlex_state_113 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_112 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 15; + (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_112 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_113 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 14; + (match __sedlex_partition_63 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_114 lexbuf + | 1 -> __sedlex_state_112 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_114 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 13; + (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_114 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_115 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 14; + (match __sedlex_partition_63 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_116 lexbuf + | 1 -> __sedlex_state_109 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_116 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 13; + (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_116 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_117 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 33; + (match __sedlex_partition_84 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_39 lexbuf + | 1 -> __sedlex_state_118 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_118 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 24; + (match __sedlex_partition_85 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_119 lexbuf + | 1 -> __sedlex_state_118 lexbuf + | 2 -> __sedlex_state_120 lexbuf + | 3 -> __sedlex_state_125 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_119 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 23; + (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_119 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_120 = + function + | lexbuf -> + (match __sedlex_partition_4 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_121 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_121 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 24; + (match __sedlex_partition_85 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_122 lexbuf + | 1 -> __sedlex_state_121 lexbuf + | 2 -> __sedlex_state_120 lexbuf + | 3 -> __sedlex_state_123 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_122 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 23; + (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_122 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_123 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 22; + (match __sedlex_partition_63 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_124 lexbuf + | 1 -> __sedlex_state_122 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_124 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 21; + (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_124 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_125 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 22; + (match __sedlex_partition_63 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_126 lexbuf + | 1 -> __sedlex_state_119 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_126 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 21; + (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_126 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_127 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 32; + (match __sedlex_partition_63 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_128 lexbuf + | 1 -> __sedlex_state_39 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_128 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 30; + (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_128 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_129 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 34; + (match __sedlex_partition_86 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_39 lexbuf + | 1 -> __sedlex_state_77 lexbuf + | 2 -> __sedlex_state_130 lexbuf + | 3 -> __sedlex_state_40 lexbuf + | 4 -> __sedlex_state_131 lexbuf + | 5 -> __sedlex_state_127 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_130 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 34; + (match __sedlex_partition_86 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_39 lexbuf + | 1 -> __sedlex_state_77 lexbuf + | 2 -> __sedlex_state_130 lexbuf + | 3 -> __sedlex_state_40 lexbuf + | 4 -> __sedlex_state_131 lexbuf + | 5 -> __sedlex_state_127 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_131 = + function + | lexbuf -> + (match __sedlex_partition_33 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_132 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_132 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 34; + (match __sedlex_partition_87 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_39 lexbuf + | 1 -> __sedlex_state_83 lexbuf + | 2 -> __sedlex_state_132 lexbuf + | 3 -> __sedlex_state_131 lexbuf + | 4 -> __sedlex_state_127 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_135 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 78; + (match __sedlex_partition_88 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_136 lexbuf + | 1 -> 55 + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_136 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 62; + (match __sedlex_partition_52 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> 61 + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_139 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 90; + (match __sedlex_partition_89 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_140 lexbuf + | 1 -> 91 + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_140 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 57; + (match __sedlex_partition_52 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> 53 + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_143 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 79; + (match __sedlex_partition_89 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> 56 + | 1 -> __sedlex_state_145 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_145 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 66; + (match __sedlex_partition_89 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> 63 + | 1 -> __sedlex_state_147 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_147 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 65; + (match __sedlex_partition_52 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> 64 + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_149 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 50; + (match __sedlex_partition_90 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_150 lexbuf + | 1 -> __sedlex_state_152 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_150 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 48; + (match __sedlex_partition_33 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> 47 + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_152 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 49; + (match __sedlex_partition_52 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> 75 + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_154 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 94; + (match __sedlex_partition_91 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_155 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_155 = + function + | lexbuf -> + (match __sedlex_partition_92 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_156 lexbuf + | 1 -> __sedlex_state_169 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_156 = + function + | lexbuf -> + (match __sedlex_partition_93 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_157 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_157 = + function + | lexbuf -> + (match __sedlex_partition_94 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_158 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_158 = + function + | lexbuf -> + (match __sedlex_partition_72 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_159 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_159 = + function + | lexbuf -> + (match __sedlex_partition_73 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_160 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_160 = + function + | lexbuf -> + (match __sedlex_partition_95 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_161 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_161 = + function + | lexbuf -> + (match __sedlex_partition_96 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_162 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_162 = + function + | lexbuf -> + (match __sedlex_partition_75 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_163 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_163 = + function + | lexbuf -> + (match __sedlex_partition_97 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_164 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_164 = + function + | lexbuf -> + (match __sedlex_partition_98 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_165 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_165 = + function + | lexbuf -> + (match __sedlex_partition_96 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_166 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_166 = + function + | lexbuf -> + (match __sedlex_partition_68 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_167 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_167 = + function + | lexbuf -> + (match __sedlex_partition_97 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> 35 + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_169 = + function + | lexbuf -> + (match __sedlex_partition_96 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_170 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_170 = + function + | lexbuf -> + (match __sedlex_partition_75 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_171 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_171 = + function + | lexbuf -> + (match __sedlex_partition_97 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_172 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_172 = + function + | lexbuf -> + (match __sedlex_partition_98 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_173 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_173 = + function + | lexbuf -> + (match __sedlex_partition_96 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_174 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_174 = + function + | lexbuf -> + (match __sedlex_partition_68 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_175 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_175 = + function + | lexbuf -> + (match __sedlex_partition_97 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> 35 + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_177 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 96; + (match __sedlex_partition_2 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_178 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_178 = + function + | lexbuf -> + (match __sedlex_partition_3 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_179 lexbuf + | 1 -> __sedlex_state_183 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_179 = + function + | lexbuf -> + (match __sedlex_partition_4 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_180 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_180 = + function + | lexbuf -> + (match __sedlex_partition_4 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_181 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_181 = + function + | lexbuf -> + (match __sedlex_partition_4 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> 97 + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_183 = + function + | lexbuf -> + (match __sedlex_partition_4 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_184 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_184 = + function + | lexbuf -> + (match __sedlex_partition_5 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_184 lexbuf + | 1 -> 97 + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_186 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 87; + (match __sedlex_partition_52 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> 74 + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_190 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 85; + (match __sedlex_partition_99 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> 73 + | 1 -> __sedlex_state_192 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_192 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 52; + (match __sedlex_partition_52 (Sedlexing.__private__next_int lexbuf) + with + | 0 -> 77 + | _ -> Sedlexing.backtrack lexbuf)) in + Sedlexing.start lexbuf; + (match __sedlex_state_0 lexbuf with + | 0 -> let env = new_line env lexbuf in Continue env + | 1 -> Continue env + | 2 -> + let start_pos = start_pos_of_lexbuf env lexbuf in + let buf = Buffer.create 127 in + let (env, end_pos) = comment env buf lexbuf in + Comment (env, (mk_comment env start_pos end_pos buf true)) + | 3 -> + let pattern = lexeme lexbuf in + if not (is_comment_syntax_enabled env) + then + let start_pos = start_pos_of_lexbuf env lexbuf in + let buf = Buffer.create 127 in + (Buffer.add_string buf + (String.sub pattern 2 ((String.length pattern) - 2)); + (let (env, end_pos) = comment env buf lexbuf in + Comment (env, (mk_comment env start_pos end_pos buf true)))) + else + (let env = + if is_in_comment_syntax env + then + let loc = loc_of_lexbuf env lexbuf in + unexpected_error env loc pattern + else env in + let env = in_comment_syntax true env in + let len = Sedlexing.lexeme_length lexbuf in + if + ((Sedlexing.Utf8.sub_lexeme lexbuf (len - 1) 1) = ":") && + ((Sedlexing.Utf8.sub_lexeme lexbuf (len - 2) 1) <> ":") + then Token (env, T_COLON) + else Continue env) + | 4 -> + if is_in_comment_syntax env + then let env = in_comment_syntax false env in Continue env + else + (Sedlexing.rollback lexbuf; + (let __sedlex_state_0 = + function + | lexbuf -> + (match __sedlex_partition_23 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> 0 + | _ -> Sedlexing.backtrack lexbuf) in + Sedlexing.start lexbuf; + (match __sedlex_state_0 lexbuf with + | 0 -> Token (env, T_MULT) + | _ -> failwith "expected *"))) + | 5 -> + let start_pos = start_pos_of_lexbuf env lexbuf in + let buf = Buffer.create 127 in + let (env, end_pos) = line_comment env buf lexbuf in + Comment (env, (mk_comment env start_pos end_pos buf false)) + | 6 -> + if (Sedlexing.lexeme_start lexbuf) = 0 + then + let start = start_pos_of_lexbuf env lexbuf in + let buf = Buffer.create 127 in + let (env, _end) = line_comment env buf lexbuf in + let loc = { Loc.source = (Lex_env.source env); start; _end } in + Token (env, (T_INTERPRETER (loc, (Buffer.contents buf)))) + else Token (env, (T_ERROR "#!")) + | 7 -> + let quote = lexeme lexbuf in + let start = start_pos_of_lexbuf env lexbuf in + let buf = Buffer.create 127 in + let raw = Buffer.create 127 in + (Buffer.add_string raw quote; + (let octal = false in + let (env, _end, octal) = string_quote env quote buf raw octal lexbuf in + let loc = { Loc.source = (Lex_env.source env); start; _end } in + Token + (env, + (T_STRING + (loc, (Buffer.contents buf), (Buffer.contents raw), octal))))) + | 8 -> + let value = Buffer.create 127 in + let raw = Buffer.create 127 in + let start = start_pos_of_lexbuf env lexbuf in + let (env, is_tail) = template_part env value raw lexbuf in + let _end = end_pos_of_lexbuf env lexbuf in + let loc = { Loc.source = (Lex_env.source env); start; _end } in + Token + (env, + (T_TEMPLATE_PART + (loc, (Buffer.contents value), (Buffer.contents raw), true, + is_tail))) + | 9 -> + recover env lexbuf + ~f:(fun env lexbuf -> + let rec __sedlex_state_0 = + function + | lexbuf -> + (match __sedlex_partition_24 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_1 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_1 = + function + | lexbuf -> + (match __sedlex_partition_25 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_2 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_2 = + function + | lexbuf -> + (match __sedlex_partition_26 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_3 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_3 = + function + | lexbuf -> + (match __sedlex_partition_27 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_3 lexbuf + | 1 -> __sedlex_state_4 lexbuf + | 2 -> 0 + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_4 = + function + | lexbuf -> + (match __sedlex_partition_26 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_5 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_5 = + function + | lexbuf -> + (match __sedlex_partition_27 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_5 lexbuf + | 1 -> __sedlex_state_4 lexbuf + | 2 -> 0 + | _ -> Sedlexing.backtrack lexbuf) in + Sedlexing.start lexbuf; + (match __sedlex_state_0 lexbuf with + | 0 -> + Token + (env, + (T_BIGINT + { kind = BIG_BINARY; raw = (lexeme lexbuf) })) + | _ -> failwith "unreachable token bigint")) + | 10 -> + Token (env, (T_BIGINT { kind = BIG_BINARY; raw = (lexeme lexbuf) })) + | 11 -> + recover env lexbuf + ~f:(fun env lexbuf -> + let rec __sedlex_state_0 = + function + | lexbuf -> + (match __sedlex_partition_24 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_1 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_1 = + function + | lexbuf -> + (match __sedlex_partition_25 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_2 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_2 = + function + | lexbuf -> + (match __sedlex_partition_26 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_3 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_3 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 0; + (match __sedlex_partition_28 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_3 lexbuf + | 1 -> __sedlex_state_4 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_4 = + function + | lexbuf -> + (match __sedlex_partition_26 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_5 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_5 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 0; + (match __sedlex_partition_28 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_5 lexbuf + | 1 -> __sedlex_state_4 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) in + Sedlexing.start lexbuf; + (match __sedlex_state_0 lexbuf with + | 0 -> + Token + (env, + (T_NUMBER { kind = BINARY; raw = (lexeme lexbuf) })) + | _ -> failwith "unreachable token bignumber")) + | 12 -> Token (env, (T_NUMBER { kind = BINARY; raw = (lexeme lexbuf) })) + | 13 -> + recover env lexbuf + ~f:(fun env lexbuf -> + let rec __sedlex_state_0 = + function + | lexbuf -> + (match __sedlex_partition_24 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_1 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_1 = + function + | lexbuf -> + (match __sedlex_partition_29 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_2 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_2 = + function + | lexbuf -> + (match __sedlex_partition_17 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_3 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_3 = + function + | lexbuf -> + (match __sedlex_partition_30 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_3 lexbuf + | 1 -> __sedlex_state_4 lexbuf + | 2 -> 0 + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_4 = + function + | lexbuf -> + (match __sedlex_partition_17 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_5 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_5 = + function + | lexbuf -> + (match __sedlex_partition_30 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_5 lexbuf + | 1 -> __sedlex_state_4 lexbuf + | 2 -> 0 + | _ -> Sedlexing.backtrack lexbuf) in + Sedlexing.start lexbuf; + (match __sedlex_state_0 lexbuf with + | 0 -> + Token + (env, + (T_BIGINT { kind = BIG_OCTAL; raw = (lexeme lexbuf) })) + | _ -> failwith "unreachable token octbigint")) + | 14 -> + Token (env, (T_BIGINT { kind = BIG_OCTAL; raw = (lexeme lexbuf) })) + | 15 -> + recover env lexbuf + ~f:(fun env lexbuf -> + let rec __sedlex_state_0 = + function + | lexbuf -> + (match __sedlex_partition_24 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_1 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_1 = + function + | lexbuf -> + (match __sedlex_partition_29 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_2 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_2 = + function + | lexbuf -> + (match __sedlex_partition_17 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_3 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_3 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 0; + (match __sedlex_partition_31 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_3 lexbuf + | 1 -> __sedlex_state_4 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_4 = + function + | lexbuf -> + (match __sedlex_partition_17 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_5 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_5 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 0; + (match __sedlex_partition_31 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_5 lexbuf + | 1 -> __sedlex_state_4 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) in + Sedlexing.start lexbuf; + (match __sedlex_state_0 lexbuf with + | 0 -> + Token + (env, + (T_NUMBER { kind = OCTAL; raw = (lexeme lexbuf) })) + | _ -> failwith "unreachable token octnumber")) + | 16 -> Token (env, (T_NUMBER { kind = OCTAL; raw = (lexeme lexbuf) })) + | 17 -> + recover env lexbuf + ~f:(fun env lexbuf -> + let rec __sedlex_state_0 = + function + | lexbuf -> + (match __sedlex_partition_24 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_1 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_1 = + function + | lexbuf -> + (match __sedlex_partition_32 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_1 lexbuf + | 1 -> __sedlex_state_2 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_2 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 0; + (match __sedlex_partition_33 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_2 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) in + Sedlexing.start lexbuf; + (match __sedlex_state_0 lexbuf with + | 0 -> + Token + (env, + (T_NUMBER + { kind = LEGACY_NON_OCTAL; raw = (lexeme lexbuf) })) + | _ -> failwith "unreachable token legacynonoctnumber")) + | 18 -> + Token + (env, (T_NUMBER { kind = LEGACY_NON_OCTAL; raw = (lexeme lexbuf) })) + | 19 -> + recover env lexbuf + ~f:(fun env lexbuf -> + let rec __sedlex_state_0 = + function + | lexbuf -> + (match __sedlex_partition_24 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_1 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_1 = + function + | lexbuf -> + (match __sedlex_partition_17 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_2 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_2 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 0; + (match __sedlex_partition_17 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_2 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) in + Sedlexing.start lexbuf; + (match __sedlex_state_0 lexbuf with + | 0 -> + Token + (env, + (T_NUMBER + { kind = LEGACY_OCTAL; raw = (lexeme lexbuf) })) + | _ -> failwith "unreachable token legacyoctnumber")) + | 20 -> + Token (env, (T_NUMBER { kind = LEGACY_OCTAL; raw = (lexeme lexbuf) })) + | 21 -> + recover env lexbuf + ~f:(fun env lexbuf -> + let rec __sedlex_state_0 = + function + | lexbuf -> + (match __sedlex_partition_24 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_1 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_1 = + function + | lexbuf -> + (match __sedlex_partition_34 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_2 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_2 = + function + | lexbuf -> + (match __sedlex_partition_4 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_3 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_3 = + function + | lexbuf -> + (match __sedlex_partition_35 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_3 lexbuf + | 1 -> __sedlex_state_4 lexbuf + | 2 -> 0 + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_4 = + function + | lexbuf -> + (match __sedlex_partition_4 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_5 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_5 = + function + | lexbuf -> + (match __sedlex_partition_35 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_5 lexbuf + | 1 -> __sedlex_state_4 lexbuf + | 2 -> 0 + | _ -> Sedlexing.backtrack lexbuf) in + Sedlexing.start lexbuf; + (match __sedlex_state_0 lexbuf with + | 0 -> + Token + (env, + (T_BIGINT + { kind = BIG_NORMAL; raw = (lexeme lexbuf) })) + | _ -> failwith "unreachable token hexbigint")) + | 22 -> + Token (env, (T_BIGINT { kind = BIG_NORMAL; raw = (lexeme lexbuf) })) + | 23 -> + recover env lexbuf + ~f:(fun env lexbuf -> + let rec __sedlex_state_0 = + function + | lexbuf -> + (match __sedlex_partition_24 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_1 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_1 = + function + | lexbuf -> + (match __sedlex_partition_34 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_2 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_2 = + function + | lexbuf -> + (match __sedlex_partition_4 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_3 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_3 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 0; + (match __sedlex_partition_36 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_3 lexbuf + | 1 -> __sedlex_state_4 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_4 = + function + | lexbuf -> + (match __sedlex_partition_4 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_5 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_5 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 0; + (match __sedlex_partition_36 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_5 lexbuf + | 1 -> __sedlex_state_4 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) in + Sedlexing.start lexbuf; + (match __sedlex_state_0 lexbuf with + | 0 -> + Token + (env, + (T_NUMBER { kind = NORMAL; raw = (lexeme lexbuf) })) + | _ -> failwith "unreachable token hexnumber")) + | 24 -> Token (env, (T_NUMBER { kind = NORMAL; raw = (lexeme lexbuf) })) + | 25 -> + recover env lexbuf + ~f:(fun env lexbuf -> + let rec __sedlex_state_0 = + function + | lexbuf -> + (match __sedlex_partition_37 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_1 lexbuf + | 1 -> __sedlex_state_12 lexbuf + | 2 -> __sedlex_state_17 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_1 = + function + | lexbuf -> + (match __sedlex_partition_33 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_2 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_2 = + function + | lexbuf -> + (match __sedlex_partition_38 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_2 lexbuf + | 1 -> __sedlex_state_3 lexbuf + | 2 -> __sedlex_state_10 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_3 = + function + | lexbuf -> + (match __sedlex_partition_39 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_4 lexbuf + | 1 -> __sedlex_state_5 lexbuf + | 2 -> __sedlex_state_7 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_4 = + function + | lexbuf -> + (match __sedlex_partition_40 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_5 lexbuf + | 1 -> __sedlex_state_7 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_5 = + function + | lexbuf -> + (match __sedlex_partition_41 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_5 lexbuf + | 1 -> 0 + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_7 = + function + | lexbuf -> + (match __sedlex_partition_42 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_7 lexbuf + | 1 -> __sedlex_state_8 lexbuf + | 2 -> 0 + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_8 = + function + | lexbuf -> + (match __sedlex_partition_33 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_9 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_9 = + function + | lexbuf -> + (match __sedlex_partition_42 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_9 lexbuf + | 1 -> __sedlex_state_8 lexbuf + | 2 -> 0 + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_10 = + function + | lexbuf -> + (match __sedlex_partition_33 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_11 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_11 = + function + | lexbuf -> + (match __sedlex_partition_38 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_11 lexbuf + | 1 -> __sedlex_state_3 lexbuf + | 2 -> __sedlex_state_10 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_12 = + function + | lexbuf -> + (match __sedlex_partition_43 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_13 lexbuf + | 1 -> __sedlex_state_3 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_13 = + function + | lexbuf -> + (match __sedlex_partition_44 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_14 lexbuf + | 1 -> __sedlex_state_3 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_14 = + function + | lexbuf -> + (match __sedlex_partition_38 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_14 lexbuf + | 1 -> __sedlex_state_3 lexbuf + | 2 -> __sedlex_state_15 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_15 = + function + | lexbuf -> + (match __sedlex_partition_33 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_16 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_16 = + function + | lexbuf -> + (match __sedlex_partition_38 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_16 lexbuf + | 1 -> __sedlex_state_3 lexbuf + | 2 -> __sedlex_state_15 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_17 = + function + | lexbuf -> + (match __sedlex_partition_45 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_13 lexbuf + | 1 -> __sedlex_state_17 lexbuf + | 2 -> __sedlex_state_3 lexbuf + | _ -> Sedlexing.backtrack lexbuf) in + Sedlexing.start lexbuf; + (match __sedlex_state_0 lexbuf with + | 0 -> + let loc = loc_of_lexbuf env lexbuf in + let env = lex_error env loc Parse_error.InvalidSciBigInt in + Token + (env, + (T_BIGINT + { kind = BIG_NORMAL; raw = (lexeme lexbuf) })) + | _ -> failwith "unreachable token scibigint")) + | 26 -> + let loc = loc_of_lexbuf env lexbuf in + let env = lex_error env loc Parse_error.InvalidSciBigInt in + Token (env, (T_BIGINT { kind = BIG_NORMAL; raw = (lexeme lexbuf) })) + | 27 -> + recover env lexbuf + ~f:(fun env lexbuf -> + let rec __sedlex_state_0 = + function + | lexbuf -> + (match __sedlex_partition_37 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_1 lexbuf + | 1 -> __sedlex_state_11 lexbuf + | 2 -> __sedlex_state_16 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_1 = + function + | lexbuf -> + (match __sedlex_partition_33 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_2 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_2 = + function + | lexbuf -> + (match __sedlex_partition_38 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_2 lexbuf + | 1 -> __sedlex_state_3 lexbuf + | 2 -> __sedlex_state_9 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_3 = + function + | lexbuf -> + (match __sedlex_partition_39 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_4 lexbuf + | 1 -> __sedlex_state_5 lexbuf + | 2 -> __sedlex_state_6 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_4 = + function + | lexbuf -> + (match __sedlex_partition_40 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_5 lexbuf + | 1 -> __sedlex_state_6 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_5 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 0; + (match __sedlex_partition_33 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_5 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_6 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 0; + (match __sedlex_partition_46 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_6 lexbuf + | 1 -> __sedlex_state_7 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_7 = + function + | lexbuf -> + (match __sedlex_partition_33 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_8 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_8 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 0; + (match __sedlex_partition_46 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_8 lexbuf + | 1 -> __sedlex_state_7 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_9 = + function + | lexbuf -> + (match __sedlex_partition_33 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_10 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_10 = + function + | lexbuf -> + (match __sedlex_partition_38 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_10 lexbuf + | 1 -> __sedlex_state_3 lexbuf + | 2 -> __sedlex_state_9 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_11 = + function + | lexbuf -> + (match __sedlex_partition_43 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_12 lexbuf + | 1 -> __sedlex_state_3 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_12 = + function + | lexbuf -> + (match __sedlex_partition_44 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_13 lexbuf + | 1 -> __sedlex_state_3 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_13 = + function + | lexbuf -> + (match __sedlex_partition_38 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_13 lexbuf + | 1 -> __sedlex_state_3 lexbuf + | 2 -> __sedlex_state_14 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_14 = + function + | lexbuf -> + (match __sedlex_partition_33 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_15 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_15 = + function + | lexbuf -> + (match __sedlex_partition_38 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_15 lexbuf + | 1 -> __sedlex_state_3 lexbuf + | 2 -> __sedlex_state_14 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_16 = + function + | lexbuf -> + (match __sedlex_partition_45 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_12 lexbuf + | 1 -> __sedlex_state_16 lexbuf + | 2 -> __sedlex_state_3 lexbuf + | _ -> Sedlexing.backtrack lexbuf) in + Sedlexing.start lexbuf; + (match __sedlex_state_0 lexbuf with + | 0 -> + Token + (env, + (T_NUMBER { kind = NORMAL; raw = (lexeme lexbuf) })) + | _ -> failwith "unreachable token scinumber")) + | 28 -> Token (env, (T_NUMBER { kind = NORMAL; raw = (lexeme lexbuf) })) + | 29 -> + recover env lexbuf + ~f:(fun env lexbuf -> + let rec __sedlex_state_0 = + function + | lexbuf -> + (match __sedlex_partition_37 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_1 lexbuf + | 1 -> __sedlex_state_6 lexbuf + | 2 -> __sedlex_state_8 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_1 = + function + | lexbuf -> + (match __sedlex_partition_33 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_2 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_2 = + function + | lexbuf -> + (match __sedlex_partition_42 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_2 lexbuf + | 1 -> __sedlex_state_3 lexbuf + | 2 -> 0 + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_3 = + function + | lexbuf -> + (match __sedlex_partition_33 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_4 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_4 = + function + | lexbuf -> + (match __sedlex_partition_42 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_4 lexbuf + | 1 -> __sedlex_state_3 lexbuf + | 2 -> 0 + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_6 = + function + | lexbuf -> + (match __sedlex_partition_47 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_7 lexbuf + | 1 -> __sedlex_state_6 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_7 = + function + | lexbuf -> + (match __sedlex_partition_41 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_2 lexbuf + | 1 -> 0 + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_8 = + function + | lexbuf -> + (match __sedlex_partition_48 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_7 lexbuf + | 1 -> __sedlex_state_8 lexbuf + | 2 -> __sedlex_state_9 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_9 = + function + | lexbuf -> + (match __sedlex_partition_33 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_10 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_10 = + function + | lexbuf -> + (match __sedlex_partition_48 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_7 lexbuf + | 1 -> __sedlex_state_10 lexbuf + | 2 -> __sedlex_state_9 lexbuf + | _ -> Sedlexing.backtrack lexbuf) in + Sedlexing.start lexbuf; + (match __sedlex_state_0 lexbuf with + | 0 -> + let loc = loc_of_lexbuf env lexbuf in + let env = + lex_error env loc Parse_error.InvalidFloatBigInt in + Token + (env, + (T_BIGINT + { kind = BIG_NORMAL; raw = (lexeme lexbuf) })) + | _ -> failwith "unreachable token floatbigint")) + | 30 -> + recover env lexbuf + ~f:(fun env lexbuf -> + let rec __sedlex_state_0 = + function + | lexbuf -> + (match __sedlex_partition_40 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_1 lexbuf + | 1 -> __sedlex_state_3 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_1 = + function + | lexbuf -> + (match __sedlex_partition_41 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_1 lexbuf + | 1 -> 0 + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_3 = + function + | lexbuf -> + (match __sedlex_partition_42 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_3 lexbuf + | 1 -> __sedlex_state_4 lexbuf + | 2 -> 0 + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_4 = + function + | lexbuf -> + (match __sedlex_partition_33 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_5 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_5 = + function + | lexbuf -> + (match __sedlex_partition_42 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_5 lexbuf + | 1 -> __sedlex_state_4 lexbuf + | 2 -> 0 + | _ -> Sedlexing.backtrack lexbuf) in + Sedlexing.start lexbuf; + (match __sedlex_state_0 lexbuf with + | 0 -> + Token + (env, + (T_BIGINT + { kind = BIG_NORMAL; raw = (lexeme lexbuf) })) + | _ -> failwith "unreachable token wholebigint")) + | 31 -> + let loc = loc_of_lexbuf env lexbuf in + let env = lex_error env loc Parse_error.InvalidFloatBigInt in + Token (env, (T_BIGINT { kind = BIG_NORMAL; raw = (lexeme lexbuf) })) + | 32 -> + Token (env, (T_BIGINT { kind = BIG_NORMAL; raw = (lexeme lexbuf) })) + | 33 -> + recover env lexbuf + ~f:(fun env lexbuf -> + let rec __sedlex_state_0 = + function + | lexbuf -> + (match __sedlex_partition_37 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_1 lexbuf + | 1 -> __sedlex_state_5 lexbuf + | 2 -> __sedlex_state_7 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_1 = + function + | lexbuf -> + (match __sedlex_partition_33 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_2 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_2 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 0; + (match __sedlex_partition_46 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_2 lexbuf + | 1 -> __sedlex_state_3 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_3 = + function + | lexbuf -> + (match __sedlex_partition_33 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_4 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_4 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 0; + (match __sedlex_partition_46 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_4 lexbuf + | 1 -> __sedlex_state_3 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_5 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 0; + (match __sedlex_partition_47 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_6 lexbuf + | 1 -> __sedlex_state_5 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_6 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 0; + (match __sedlex_partition_33 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_2 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_7 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 0; + (match __sedlex_partition_48 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_6 lexbuf + | 1 -> __sedlex_state_7 lexbuf + | 2 -> __sedlex_state_8 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_8 = + function + | lexbuf -> + (match __sedlex_partition_33 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_9 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_9 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 0; + (match __sedlex_partition_48 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_6 lexbuf + | 1 -> __sedlex_state_9 lexbuf + | 2 -> __sedlex_state_8 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) in + Sedlexing.start lexbuf; + (match __sedlex_state_0 lexbuf with + | 0 -> + Token + (env, + (T_NUMBER { kind = NORMAL; raw = (lexeme lexbuf) })) + | _ -> failwith "unreachable token wholenumber")) + | 34 -> Token (env, (T_NUMBER { kind = NORMAL; raw = (lexeme lexbuf) })) + | 35 -> + let loc = loc_of_lexbuf env lexbuf in + let raw = lexeme lexbuf in + Token (env, (T_IDENTIFIER { loc; value = raw; raw })) + | 36 -> Token (env, T_LCURLY) + | 37 -> Token (env, T_RCURLY) + | 38 -> Token (env, T_LPAREN) + | 39 -> Token (env, T_RPAREN) + | 40 -> Token (env, T_LBRACKET) + | 41 -> Token (env, T_RBRACKET) + | 42 -> Token (env, T_ELLIPSIS) + | 43 -> Token (env, T_PERIOD) + | 44 -> Token (env, T_SEMICOLON) + | 45 -> Token (env, T_COMMA) + | 46 -> Token (env, T_COLON) + | 47 -> + (Sedlexing.rollback lexbuf; + (let __sedlex_state_0 = + function + | lexbuf -> + (match __sedlex_partition_49 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> 0 + | _ -> Sedlexing.backtrack lexbuf) in + Sedlexing.start lexbuf; + (match __sedlex_state_0 lexbuf with + | 0 -> Token (env, T_PLING) + | _ -> failwith "expected ?"))) + | 48 -> Token (env, T_PLING_PERIOD) + | 49 -> Token (env, T_PLING_PLING) + | 50 -> Token (env, T_PLING) + | 51 -> Token (env, T_AND) + | 52 -> Token (env, T_OR) + | 53 -> Token (env, T_STRICT_EQUAL) + | 54 -> Token (env, T_STRICT_NOT_EQUAL) + | 55 -> Token (env, T_LESS_THAN_EQUAL) + | 56 -> Token (env, T_GREATER_THAN_EQUAL) + | 57 -> Token (env, T_EQUAL) + | 58 -> Token (env, T_NOT_EQUAL) + | 59 -> Token (env, T_INCR) + | 60 -> Token (env, T_DECR) + | 61 -> Token (env, T_LSHIFT_ASSIGN) + | 62 -> Token (env, T_LSHIFT) + | 63 -> Token (env, T_RSHIFT_ASSIGN) + | 64 -> Token (env, T_RSHIFT3_ASSIGN) + | 65 -> Token (env, T_RSHIFT3) + | 66 -> Token (env, T_RSHIFT) + | 67 -> Token (env, T_PLUS_ASSIGN) + | 68 -> Token (env, T_MINUS_ASSIGN) + | 69 -> Token (env, T_MULT_ASSIGN) + | 70 -> Token (env, T_EXP_ASSIGN) + | 71 -> Token (env, T_MOD_ASSIGN) + | 72 -> Token (env, T_BIT_AND_ASSIGN) + | 73 -> Token (env, T_BIT_OR_ASSIGN) + | 74 -> Token (env, T_BIT_XOR_ASSIGN) + | 75 -> Token (env, T_NULLISH_ASSIGN) + | 76 -> Token (env, T_AND_ASSIGN) + | 77 -> Token (env, T_OR_ASSIGN) + | 78 -> Token (env, T_LESS_THAN) + | 79 -> Token (env, T_GREATER_THAN) + | 80 -> Token (env, T_PLUS) + | 81 -> Token (env, T_MINUS) + | 82 -> Token (env, T_MULT) + | 83 -> Token (env, T_EXP) + | 84 -> Token (env, T_MOD) + | 85 -> Token (env, T_BIT_OR) + | 86 -> Token (env, T_BIT_AND) + | 87 -> Token (env, T_BIT_XOR) + | 88 -> Token (env, T_NOT) + | 89 -> Token (env, T_BIT_NOT) + | 90 -> Token (env, T_ASSIGN) + | 91 -> Token (env, T_ARROW) + | 92 -> Token (env, T_DIV_ASSIGN) + | 93 -> Token (env, T_DIV) + | 94 -> Token (env, T_AT) + | 95 -> Token (env, T_POUND) + | 96 -> let env = illegal env (loc_of_lexbuf env lexbuf) in Continue env + | 97 -> + let start_offset = Sedlexing.lexeme_start lexbuf in + ((loop_id_continues lexbuf) |> ignore; + (let end_offset = Sedlexing.lexeme_end lexbuf in + let loc = loc_of_offsets env start_offset end_offset in + Sedlexing.set_lexeme_start lexbuf start_offset; + (match lexeme lexbuf with + | "async" -> Token (env, T_ASYNC) + | "await" -> Token (env, T_AWAIT) + | "break" -> Token (env, T_BREAK) + | "case" -> Token (env, T_CASE) + | "catch" -> Token (env, T_CATCH) + | "class" -> Token (env, T_CLASS) + | "const" -> Token (env, T_CONST) + | "continue" -> Token (env, T_CONTINUE) + | "debugger" -> Token (env, T_DEBUGGER) + | "declare" -> Token (env, T_DECLARE) + | "default" -> Token (env, T_DEFAULT) + | "delete" -> Token (env, T_DELETE) + | "do" -> Token (env, T_DO) + | "else" -> Token (env, T_ELSE) + | "enum" -> Token (env, T_ENUM) + | "export" -> Token (env, T_EXPORT) + | "extends" -> Token (env, T_EXTENDS) + | "false" -> Token (env, T_FALSE) + | "finally" -> Token (env, T_FINALLY) + | "for" -> Token (env, T_FOR) + | "function" -> Token (env, T_FUNCTION) + | "if" -> Token (env, T_IF) + | "implements" -> Token (env, T_IMPLEMENTS) + | "import" -> Token (env, T_IMPORT) + | "in" -> Token (env, T_IN) + | "instanceof" -> Token (env, T_INSTANCEOF) + | "interface" -> Token (env, T_INTERFACE) + | "let" -> Token (env, T_LET) + | "match" -> Token (env, T_MATCH) + | "new" -> Token (env, T_NEW) + | "null" -> Token (env, T_NULL) + | "of" -> Token (env, T_OF) + | "opaque" -> Token (env, T_OPAQUE) + | "package" -> Token (env, T_PACKAGE) + | "private" -> Token (env, T_PRIVATE) + | "protected" -> Token (env, T_PROTECTED) + | "public" -> Token (env, T_PUBLIC) + | "return" -> Token (env, T_RETURN) + | "static" -> Token (env, T_STATIC) + | "super" -> Token (env, T_SUPER) + | "switch" -> Token (env, T_SWITCH) + | "this" -> Token (env, T_THIS) + | "throw" -> Token (env, T_THROW) + | "true" -> Token (env, T_TRUE) + | "try" -> Token (env, T_TRY) + | "type" -> Token (env, T_TYPE) + | "typeof" -> Token (env, T_TYPEOF) + | "var" -> Token (env, T_VAR) + | "void" -> Token (env, T_VOID) + | "while" -> Token (env, T_WHILE) + | "with" -> Token (env, T_WITH) + | "yield" -> Token (env, T_YIELD) + | _ -> + let raw = Sedlexing.lexeme lexbuf in + let (nenv, value) = decode_identifier env raw in + Token + (nenv, + (T_IDENTIFIER + { loc; value; raw = (Sedlexing.string_of_utf8 raw) }))))) + | 98 -> + let env = + if is_in_comment_syntax env + then + let loc = loc_of_lexbuf env lexbuf in + lex_error env loc Parse_error.UnexpectedEOS + else env in + Token (env, T_EOF) + | 99 -> + let env = illegal env (loc_of_lexbuf env lexbuf) in + Token (env, (T_ERROR (lexeme lexbuf))) + | _ -> failwith "unreachable token") let rec regexp_class env buf lexbuf = let rec __sedlex_state_0 = function @@ -12193,603 +12171,594 @@ let type_token env lexbuf = (loc, (Buffer.contents buf), (Buffer.contents raw), octal))))) | 7 -> recover env lexbuf - ~f:(fun env -> - fun lexbuf -> - let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_24 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_1 = - function - | lexbuf -> - (match __sedlex_partition_25 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_2 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_2 = - function - | lexbuf -> - (match __sedlex_partition_26 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_3 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_3 = - function - | lexbuf -> - (match __sedlex_partition_27 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_3 lexbuf - | 1 -> __sedlex_state_4 lexbuf - | 2 -> 0 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_4 = - function - | lexbuf -> - (match __sedlex_partition_26 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_5 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_5 = - function - | lexbuf -> - (match __sedlex_partition_27 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_5 lexbuf - | 1 -> __sedlex_state_4 lexbuf - | 2 -> 0 - | _ -> Sedlexing.backtrack lexbuf) in - Sedlexing.start lexbuf; - (match __sedlex_state_0 lexbuf with - | 0 -> - let num = Sedlexing.lexeme lexbuf in - Token (env, (mk_bignum_singleton BIG_BINARY num)) - | _ -> failwith "unreachable type_token bigbigint")) + ~f:(fun env lexbuf -> + let rec __sedlex_state_0 = + function + | lexbuf -> + (match __sedlex_partition_24 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_1 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_1 = + function + | lexbuf -> + (match __sedlex_partition_25 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_2 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_2 = + function + | lexbuf -> + (match __sedlex_partition_26 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_3 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_3 = + function + | lexbuf -> + (match __sedlex_partition_27 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_3 lexbuf + | 1 -> __sedlex_state_4 lexbuf + | 2 -> 0 + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_4 = + function + | lexbuf -> + (match __sedlex_partition_26 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_5 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_5 = + function + | lexbuf -> + (match __sedlex_partition_27 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_5 lexbuf + | 1 -> __sedlex_state_4 lexbuf + | 2 -> 0 + | _ -> Sedlexing.backtrack lexbuf) in + Sedlexing.start lexbuf; + (match __sedlex_state_0 lexbuf with + | 0 -> + let num = Sedlexing.lexeme lexbuf in + Token (env, (mk_bignum_singleton BIG_BINARY num)) + | _ -> failwith "unreachable type_token bigbigint")) | 8 -> let num = Sedlexing.lexeme lexbuf in Token (env, (mk_bignum_singleton BIG_BINARY num)) | 9 -> recover env lexbuf - ~f:(fun env -> - fun lexbuf -> - let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_24 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_1 = - function - | lexbuf -> - (match __sedlex_partition_25 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_2 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_2 = - function - | lexbuf -> - (match __sedlex_partition_26 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_3 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_3 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_28 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_3 lexbuf - | 1 -> __sedlex_state_4 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_4 = - function - | lexbuf -> - (match __sedlex_partition_26 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_5 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_5 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_28 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_5 lexbuf - | 1 -> __sedlex_state_4 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) in - Sedlexing.start lexbuf; - (match __sedlex_state_0 lexbuf with - | 0 -> - let num = Sedlexing.lexeme lexbuf in - Token (env, (mk_num_singleton BINARY num)) - | _ -> failwith "unreachable type_token binnumber")) + ~f:(fun env lexbuf -> + let rec __sedlex_state_0 = + function + | lexbuf -> + (match __sedlex_partition_24 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_1 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_1 = + function + | lexbuf -> + (match __sedlex_partition_25 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_2 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_2 = + function + | lexbuf -> + (match __sedlex_partition_26 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_3 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_3 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 0; + (match __sedlex_partition_28 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_3 lexbuf + | 1 -> __sedlex_state_4 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_4 = + function + | lexbuf -> + (match __sedlex_partition_26 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_5 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_5 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 0; + (match __sedlex_partition_28 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_5 lexbuf + | 1 -> __sedlex_state_4 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) in + Sedlexing.start lexbuf; + (match __sedlex_state_0 lexbuf with + | 0 -> + let num = Sedlexing.lexeme lexbuf in + Token (env, (mk_num_singleton BINARY num)) + | _ -> failwith "unreachable type_token binnumber")) | 10 -> let num = Sedlexing.lexeme lexbuf in Token (env, (mk_num_singleton BINARY num)) | 11 -> recover env lexbuf - ~f:(fun env -> - fun lexbuf -> - let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_24 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_1 = - function - | lexbuf -> - (match __sedlex_partition_29 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_2 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_2 = - function - | lexbuf -> - (match __sedlex_partition_17 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_3 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_3 = - function - | lexbuf -> - (match __sedlex_partition_30 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_3 lexbuf - | 1 -> __sedlex_state_4 lexbuf - | 2 -> 0 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_4 = - function - | lexbuf -> - (match __sedlex_partition_17 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_5 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_5 = - function - | lexbuf -> - (match __sedlex_partition_30 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_5 lexbuf - | 1 -> __sedlex_state_4 lexbuf - | 2 -> 0 - | _ -> Sedlexing.backtrack lexbuf) in - Sedlexing.start lexbuf; - (match __sedlex_state_0 lexbuf with - | 0 -> - let num = Sedlexing.lexeme lexbuf in - Token (env, (mk_bignum_singleton BIG_OCTAL num)) - | _ -> failwith "unreachable type_token octbigint")) + ~f:(fun env lexbuf -> + let rec __sedlex_state_0 = + function + | lexbuf -> + (match __sedlex_partition_24 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_1 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_1 = + function + | lexbuf -> + (match __sedlex_partition_29 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_2 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_2 = + function + | lexbuf -> + (match __sedlex_partition_17 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_3 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_3 = + function + | lexbuf -> + (match __sedlex_partition_30 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_3 lexbuf + | 1 -> __sedlex_state_4 lexbuf + | 2 -> 0 + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_4 = + function + | lexbuf -> + (match __sedlex_partition_17 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_5 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_5 = + function + | lexbuf -> + (match __sedlex_partition_30 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_5 lexbuf + | 1 -> __sedlex_state_4 lexbuf + | 2 -> 0 + | _ -> Sedlexing.backtrack lexbuf) in + Sedlexing.start lexbuf; + (match __sedlex_state_0 lexbuf with + | 0 -> + let num = Sedlexing.lexeme lexbuf in + Token (env, (mk_bignum_singleton BIG_OCTAL num)) + | _ -> failwith "unreachable type_token octbigint")) | 12 -> let num = Sedlexing.lexeme lexbuf in Token (env, (mk_bignum_singleton BIG_OCTAL num)) | 13 -> recover env lexbuf - ~f:(fun env -> - fun lexbuf -> - let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_24 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_1 = - function - | lexbuf -> - (match __sedlex_partition_29 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_2 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_2 = - function - | lexbuf -> - (match __sedlex_partition_17 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_3 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_3 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_31 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_3 lexbuf - | 1 -> __sedlex_state_4 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_4 = - function - | lexbuf -> - (match __sedlex_partition_17 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_5 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_5 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_31 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_5 lexbuf - | 1 -> __sedlex_state_4 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) in - Sedlexing.start lexbuf; - (match __sedlex_state_0 lexbuf with - | 0 -> - let num = Sedlexing.lexeme lexbuf in - Token (env, (mk_num_singleton OCTAL num)) - | _ -> failwith "unreachable type_token octnumber")) + ~f:(fun env lexbuf -> + let rec __sedlex_state_0 = + function + | lexbuf -> + (match __sedlex_partition_24 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_1 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_1 = + function + | lexbuf -> + (match __sedlex_partition_29 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_2 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_2 = + function + | lexbuf -> + (match __sedlex_partition_17 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_3 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_3 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 0; + (match __sedlex_partition_31 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_3 lexbuf + | 1 -> __sedlex_state_4 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_4 = + function + | lexbuf -> + (match __sedlex_partition_17 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_5 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_5 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 0; + (match __sedlex_partition_31 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_5 lexbuf + | 1 -> __sedlex_state_4 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) in + Sedlexing.start lexbuf; + (match __sedlex_state_0 lexbuf with + | 0 -> + let num = Sedlexing.lexeme lexbuf in + Token (env, (mk_num_singleton OCTAL num)) + | _ -> failwith "unreachable type_token octnumber")) | 14 -> let num = Sedlexing.lexeme lexbuf in Token (env, (mk_num_singleton OCTAL num)) | 15 -> recover env lexbuf - ~f:(fun env -> - fun lexbuf -> - let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_24 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_1 = - function - | lexbuf -> - (match __sedlex_partition_17 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_2 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_2 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_17 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_2 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) in - Sedlexing.start lexbuf; - (match __sedlex_state_0 lexbuf with - | 0 -> - let num = Sedlexing.lexeme lexbuf in - Token (env, (mk_num_singleton LEGACY_OCTAL num)) - | _ -> failwith "unreachable type_token legacyoctnumber")) + ~f:(fun env lexbuf -> + let rec __sedlex_state_0 = + function + | lexbuf -> + (match __sedlex_partition_24 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_1 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_1 = + function + | lexbuf -> + (match __sedlex_partition_17 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_2 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_2 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 0; + (match __sedlex_partition_17 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_2 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) in + Sedlexing.start lexbuf; + (match __sedlex_state_0 lexbuf with + | 0 -> + let num = Sedlexing.lexeme lexbuf in + Token (env, (mk_num_singleton LEGACY_OCTAL num)) + | _ -> failwith "unreachable type_token legacyoctnumber")) | 16 -> let num = Sedlexing.lexeme lexbuf in Token (env, (mk_num_singleton LEGACY_OCTAL num)) | 17 -> recover env lexbuf - ~f:(fun env -> - fun lexbuf -> - let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_24 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_1 = - function - | lexbuf -> - (match __sedlex_partition_34 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_2 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_2 = - function - | lexbuf -> - (match __sedlex_partition_4 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_3 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_3 = - function - | lexbuf -> - (match __sedlex_partition_35 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_3 lexbuf - | 1 -> __sedlex_state_4 lexbuf - | 2 -> 0 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_4 = - function - | lexbuf -> - (match __sedlex_partition_4 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_5 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_5 = - function - | lexbuf -> - (match __sedlex_partition_35 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_5 lexbuf - | 1 -> __sedlex_state_4 lexbuf - | 2 -> 0 - | _ -> Sedlexing.backtrack lexbuf) in - Sedlexing.start lexbuf; - (match __sedlex_state_0 lexbuf with - | 0 -> - let num = Sedlexing.lexeme lexbuf in - Token (env, (mk_bignum_singleton BIG_NORMAL num)) - | _ -> failwith "unreachable type_token hexbigint")) + ~f:(fun env lexbuf -> + let rec __sedlex_state_0 = + function + | lexbuf -> + (match __sedlex_partition_24 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_1 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_1 = + function + | lexbuf -> + (match __sedlex_partition_34 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_2 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_2 = + function + | lexbuf -> + (match __sedlex_partition_4 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_3 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_3 = + function + | lexbuf -> + (match __sedlex_partition_35 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_3 lexbuf + | 1 -> __sedlex_state_4 lexbuf + | 2 -> 0 + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_4 = + function + | lexbuf -> + (match __sedlex_partition_4 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_5 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_5 = + function + | lexbuf -> + (match __sedlex_partition_35 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_5 lexbuf + | 1 -> __sedlex_state_4 lexbuf + | 2 -> 0 + | _ -> Sedlexing.backtrack lexbuf) in + Sedlexing.start lexbuf; + (match __sedlex_state_0 lexbuf with + | 0 -> + let num = Sedlexing.lexeme lexbuf in + Token (env, (mk_bignum_singleton BIG_NORMAL num)) + | _ -> failwith "unreachable type_token hexbigint")) | 18 -> let num = Sedlexing.lexeme lexbuf in Token (env, (mk_bignum_singleton BIG_NORMAL num)) | 19 -> recover env lexbuf - ~f:(fun env -> - fun lexbuf -> - let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_24 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_1 = - function - | lexbuf -> - (match __sedlex_partition_34 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_2 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_2 = - function - | lexbuf -> - (match __sedlex_partition_4 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_3 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_3 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_36 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_3 lexbuf - | 1 -> __sedlex_state_4 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_4 = - function - | lexbuf -> - (match __sedlex_partition_4 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_5 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_5 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_36 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_5 lexbuf - | 1 -> __sedlex_state_4 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) in - Sedlexing.start lexbuf; - (match __sedlex_state_0 lexbuf with - | 0 -> - let num = Sedlexing.lexeme lexbuf in - Token (env, (mk_num_singleton NORMAL num)) - | _ -> failwith "unreachable type_token hexnumber")) + ~f:(fun env lexbuf -> + let rec __sedlex_state_0 = + function + | lexbuf -> + (match __sedlex_partition_24 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_1 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_1 = + function + | lexbuf -> + (match __sedlex_partition_34 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_2 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_2 = + function + | lexbuf -> + (match __sedlex_partition_4 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_3 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_3 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 0; + (match __sedlex_partition_36 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_3 lexbuf + | 1 -> __sedlex_state_4 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_4 = + function + | lexbuf -> + (match __sedlex_partition_4 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_5 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_5 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 0; + (match __sedlex_partition_36 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_5 lexbuf + | 1 -> __sedlex_state_4 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) in + Sedlexing.start lexbuf; + (match __sedlex_state_0 lexbuf with + | 0 -> + let num = Sedlexing.lexeme lexbuf in + Token (env, (mk_num_singleton NORMAL num)) + | _ -> failwith "unreachable type_token hexnumber")) | 20 -> let num = Sedlexing.lexeme lexbuf in Token (env, (mk_num_singleton NORMAL num)) | 21 -> recover env lexbuf - ~f:(fun env -> - fun lexbuf -> - let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_37 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | 1 -> __sedlex_state_12 lexbuf - | 2 -> __sedlex_state_17 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_1 = - function - | lexbuf -> - (match __sedlex_partition_33 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_2 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_2 = - function - | lexbuf -> - (match __sedlex_partition_38 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_2 lexbuf - | 1 -> __sedlex_state_3 lexbuf - | 2 -> __sedlex_state_10 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_3 = - function - | lexbuf -> - (match __sedlex_partition_39 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_4 lexbuf - | 1 -> __sedlex_state_5 lexbuf - | 2 -> __sedlex_state_7 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_4 = - function - | lexbuf -> - (match __sedlex_partition_40 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_5 lexbuf - | 1 -> __sedlex_state_7 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_5 = - function - | lexbuf -> - (match __sedlex_partition_41 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_5 lexbuf - | 1 -> 0 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_7 = - function - | lexbuf -> - (match __sedlex_partition_42 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_7 lexbuf - | 1 -> __sedlex_state_8 lexbuf - | 2 -> 0 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_8 = - function - | lexbuf -> - (match __sedlex_partition_33 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_9 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_9 = - function - | lexbuf -> - (match __sedlex_partition_42 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_9 lexbuf - | 1 -> __sedlex_state_8 lexbuf - | 2 -> 0 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_10 = - function - | lexbuf -> - (match __sedlex_partition_33 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_11 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_11 = - function - | lexbuf -> - (match __sedlex_partition_38 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_11 lexbuf - | 1 -> __sedlex_state_3 lexbuf - | 2 -> __sedlex_state_10 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_12 = - function - | lexbuf -> - (match __sedlex_partition_43 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_13 lexbuf - | 1 -> __sedlex_state_3 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_13 = - function - | lexbuf -> - (match __sedlex_partition_44 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_14 lexbuf - | 1 -> __sedlex_state_3 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_14 = - function - | lexbuf -> - (match __sedlex_partition_38 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_14 lexbuf - | 1 -> __sedlex_state_3 lexbuf - | 2 -> __sedlex_state_15 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_15 = - function - | lexbuf -> - (match __sedlex_partition_33 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_16 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_16 = - function - | lexbuf -> - (match __sedlex_partition_38 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_16 lexbuf - | 1 -> __sedlex_state_3 lexbuf - | 2 -> __sedlex_state_15 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_17 = - function - | lexbuf -> - (match __sedlex_partition_45 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_13 lexbuf - | 1 -> __sedlex_state_17 lexbuf - | 2 -> __sedlex_state_3 lexbuf - | _ -> Sedlexing.backtrack lexbuf) in - Sedlexing.start lexbuf; - (match __sedlex_state_0 lexbuf with - | 0 -> - let num = Sedlexing.lexeme lexbuf in - let loc = loc_of_lexbuf env lexbuf in - let env = - lex_error env loc Parse_error.InvalidSciBigInt in - Token (env, (mk_bignum_singleton BIG_NORMAL num)) - | _ -> failwith "unreachable type_token scibigint")) + ~f:(fun env lexbuf -> + let rec __sedlex_state_0 = + function + | lexbuf -> + (match __sedlex_partition_37 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_1 lexbuf + | 1 -> __sedlex_state_12 lexbuf + | 2 -> __sedlex_state_17 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_1 = + function + | lexbuf -> + (match __sedlex_partition_33 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_2 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_2 = + function + | lexbuf -> + (match __sedlex_partition_38 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_2 lexbuf + | 1 -> __sedlex_state_3 lexbuf + | 2 -> __sedlex_state_10 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_3 = + function + | lexbuf -> + (match __sedlex_partition_39 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_4 lexbuf + | 1 -> __sedlex_state_5 lexbuf + | 2 -> __sedlex_state_7 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_4 = + function + | lexbuf -> + (match __sedlex_partition_40 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_5 lexbuf + | 1 -> __sedlex_state_7 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_5 = + function + | lexbuf -> + (match __sedlex_partition_41 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_5 lexbuf + | 1 -> 0 + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_7 = + function + | lexbuf -> + (match __sedlex_partition_42 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_7 lexbuf + | 1 -> __sedlex_state_8 lexbuf + | 2 -> 0 + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_8 = + function + | lexbuf -> + (match __sedlex_partition_33 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_9 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_9 = + function + | lexbuf -> + (match __sedlex_partition_42 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_9 lexbuf + | 1 -> __sedlex_state_8 lexbuf + | 2 -> 0 + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_10 = + function + | lexbuf -> + (match __sedlex_partition_33 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_11 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_11 = + function + | lexbuf -> + (match __sedlex_partition_38 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_11 lexbuf + | 1 -> __sedlex_state_3 lexbuf + | 2 -> __sedlex_state_10 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_12 = + function + | lexbuf -> + (match __sedlex_partition_43 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_13 lexbuf + | 1 -> __sedlex_state_3 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_13 = + function + | lexbuf -> + (match __sedlex_partition_44 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_14 lexbuf + | 1 -> __sedlex_state_3 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_14 = + function + | lexbuf -> + (match __sedlex_partition_38 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_14 lexbuf + | 1 -> __sedlex_state_3 lexbuf + | 2 -> __sedlex_state_15 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_15 = + function + | lexbuf -> + (match __sedlex_partition_33 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_16 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_16 = + function + | lexbuf -> + (match __sedlex_partition_38 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_16 lexbuf + | 1 -> __sedlex_state_3 lexbuf + | 2 -> __sedlex_state_15 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_17 = + function + | lexbuf -> + (match __sedlex_partition_45 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_13 lexbuf + | 1 -> __sedlex_state_17 lexbuf + | 2 -> __sedlex_state_3 lexbuf + | _ -> Sedlexing.backtrack lexbuf) in + Sedlexing.start lexbuf; + (match __sedlex_state_0 lexbuf with + | 0 -> + let num = Sedlexing.lexeme lexbuf in + let loc = loc_of_lexbuf env lexbuf in + let env = lex_error env loc Parse_error.InvalidSciBigInt in + Token (env, (mk_bignum_singleton BIG_NORMAL num)) + | _ -> failwith "unreachable type_token scibigint")) | 22 -> let num = Sedlexing.lexeme lexbuf in let loc = loc_of_lexbuf env lexbuf in @@ -12797,336 +12766,333 @@ let type_token env lexbuf = Token (env, (mk_bignum_singleton BIG_NORMAL num)) | 23 -> recover env lexbuf - ~f:(fun env -> - fun lexbuf -> - let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_37 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | 1 -> __sedlex_state_11 lexbuf - | 2 -> __sedlex_state_16 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_1 = - function - | lexbuf -> - (match __sedlex_partition_33 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_2 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_2 = - function - | lexbuf -> - (match __sedlex_partition_38 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_2 lexbuf - | 1 -> __sedlex_state_3 lexbuf - | 2 -> __sedlex_state_9 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_3 = - function - | lexbuf -> - (match __sedlex_partition_39 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_4 lexbuf - | 1 -> __sedlex_state_5 lexbuf - | 2 -> __sedlex_state_6 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_4 = - function - | lexbuf -> - (match __sedlex_partition_40 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_5 lexbuf - | 1 -> __sedlex_state_6 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_5 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_33 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_5 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_6 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_46 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_6 lexbuf - | 1 -> __sedlex_state_7 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_7 = - function - | lexbuf -> - (match __sedlex_partition_33 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_8 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_8 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_46 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_8 lexbuf - | 1 -> __sedlex_state_7 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_9 = - function - | lexbuf -> - (match __sedlex_partition_33 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_10 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_10 = - function - | lexbuf -> - (match __sedlex_partition_38 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_10 lexbuf - | 1 -> __sedlex_state_3 lexbuf - | 2 -> __sedlex_state_9 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_11 = - function - | lexbuf -> - (match __sedlex_partition_43 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_12 lexbuf - | 1 -> __sedlex_state_3 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_12 = - function - | lexbuf -> - (match __sedlex_partition_44 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_13 lexbuf - | 1 -> __sedlex_state_3 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_13 = - function - | lexbuf -> - (match __sedlex_partition_38 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_13 lexbuf - | 1 -> __sedlex_state_3 lexbuf - | 2 -> __sedlex_state_14 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_14 = - function - | lexbuf -> - (match __sedlex_partition_33 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_15 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_15 = - function - | lexbuf -> - (match __sedlex_partition_38 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_15 lexbuf - | 1 -> __sedlex_state_3 lexbuf - | 2 -> __sedlex_state_14 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_16 = - function - | lexbuf -> - (match __sedlex_partition_45 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_12 lexbuf - | 1 -> __sedlex_state_16 lexbuf - | 2 -> __sedlex_state_3 lexbuf - | _ -> Sedlexing.backtrack lexbuf) in - Sedlexing.start lexbuf; - (match __sedlex_state_0 lexbuf with - | 0 -> - let num = Sedlexing.lexeme lexbuf in - Token (env, (mk_num_singleton NORMAL num)) - | _ -> failwith "unreachable type_token scinumber")) + ~f:(fun env lexbuf -> + let rec __sedlex_state_0 = + function + | lexbuf -> + (match __sedlex_partition_37 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_1 lexbuf + | 1 -> __sedlex_state_11 lexbuf + | 2 -> __sedlex_state_16 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_1 = + function + | lexbuf -> + (match __sedlex_partition_33 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_2 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_2 = + function + | lexbuf -> + (match __sedlex_partition_38 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_2 lexbuf + | 1 -> __sedlex_state_3 lexbuf + | 2 -> __sedlex_state_9 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_3 = + function + | lexbuf -> + (match __sedlex_partition_39 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_4 lexbuf + | 1 -> __sedlex_state_5 lexbuf + | 2 -> __sedlex_state_6 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_4 = + function + | lexbuf -> + (match __sedlex_partition_40 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_5 lexbuf + | 1 -> __sedlex_state_6 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_5 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 0; + (match __sedlex_partition_33 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_5 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_6 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 0; + (match __sedlex_partition_46 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_6 lexbuf + | 1 -> __sedlex_state_7 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_7 = + function + | lexbuf -> + (match __sedlex_partition_33 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_8 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_8 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 0; + (match __sedlex_partition_46 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_8 lexbuf + | 1 -> __sedlex_state_7 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_9 = + function + | lexbuf -> + (match __sedlex_partition_33 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_10 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_10 = + function + | lexbuf -> + (match __sedlex_partition_38 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_10 lexbuf + | 1 -> __sedlex_state_3 lexbuf + | 2 -> __sedlex_state_9 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_11 = + function + | lexbuf -> + (match __sedlex_partition_43 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_12 lexbuf + | 1 -> __sedlex_state_3 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_12 = + function + | lexbuf -> + (match __sedlex_partition_44 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_13 lexbuf + | 1 -> __sedlex_state_3 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_13 = + function + | lexbuf -> + (match __sedlex_partition_38 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_13 lexbuf + | 1 -> __sedlex_state_3 lexbuf + | 2 -> __sedlex_state_14 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_14 = + function + | lexbuf -> + (match __sedlex_partition_33 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_15 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_15 = + function + | lexbuf -> + (match __sedlex_partition_38 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_15 lexbuf + | 1 -> __sedlex_state_3 lexbuf + | 2 -> __sedlex_state_14 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_16 = + function + | lexbuf -> + (match __sedlex_partition_45 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_12 lexbuf + | 1 -> __sedlex_state_16 lexbuf + | 2 -> __sedlex_state_3 lexbuf + | _ -> Sedlexing.backtrack lexbuf) in + Sedlexing.start lexbuf; + (match __sedlex_state_0 lexbuf with + | 0 -> + let num = Sedlexing.lexeme lexbuf in + Token (env, (mk_num_singleton NORMAL num)) + | _ -> failwith "unreachable type_token scinumber")) | 24 -> let num = Sedlexing.lexeme lexbuf in Token (env, (mk_num_singleton NORMAL num)) | 25 -> recover env lexbuf - ~f:(fun env -> - fun lexbuf -> - let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_37 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | 1 -> __sedlex_state_6 lexbuf - | 2 -> __sedlex_state_8 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_1 = - function - | lexbuf -> - (match __sedlex_partition_33 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_2 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_2 = - function - | lexbuf -> - (match __sedlex_partition_42 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_2 lexbuf - | 1 -> __sedlex_state_3 lexbuf - | 2 -> 0 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_3 = - function - | lexbuf -> - (match __sedlex_partition_33 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_4 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_4 = - function - | lexbuf -> - (match __sedlex_partition_42 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_4 lexbuf - | 1 -> __sedlex_state_3 lexbuf - | 2 -> 0 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_6 = - function - | lexbuf -> - (match __sedlex_partition_47 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_7 lexbuf - | 1 -> __sedlex_state_6 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_7 = - function - | lexbuf -> - (match __sedlex_partition_41 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_2 lexbuf - | 1 -> 0 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_8 = - function - | lexbuf -> - (match __sedlex_partition_48 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_7 lexbuf - | 1 -> __sedlex_state_8 lexbuf - | 2 -> __sedlex_state_9 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_9 = - function - | lexbuf -> - (match __sedlex_partition_33 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_10 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_10 = - function - | lexbuf -> - (match __sedlex_partition_48 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_7 lexbuf - | 1 -> __sedlex_state_10 lexbuf - | 2 -> __sedlex_state_9 lexbuf - | _ -> Sedlexing.backtrack lexbuf) in - Sedlexing.start lexbuf; - (match __sedlex_state_0 lexbuf with - | 0 -> - let num = Sedlexing.lexeme lexbuf in - let loc = loc_of_lexbuf env lexbuf in - let env = - lex_error env loc Parse_error.InvalidFloatBigInt in - Token (env, (mk_bignum_singleton BIG_NORMAL num)) - | _ -> failwith "unreachable type_token floatbigint")) + ~f:(fun env lexbuf -> + let rec __sedlex_state_0 = + function + | lexbuf -> + (match __sedlex_partition_37 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_1 lexbuf + | 1 -> __sedlex_state_6 lexbuf + | 2 -> __sedlex_state_8 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_1 = + function + | lexbuf -> + (match __sedlex_partition_33 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_2 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_2 = + function + | lexbuf -> + (match __sedlex_partition_42 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_2 lexbuf + | 1 -> __sedlex_state_3 lexbuf + | 2 -> 0 + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_3 = + function + | lexbuf -> + (match __sedlex_partition_33 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_4 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_4 = + function + | lexbuf -> + (match __sedlex_partition_42 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_4 lexbuf + | 1 -> __sedlex_state_3 lexbuf + | 2 -> 0 + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_6 = + function + | lexbuf -> + (match __sedlex_partition_47 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_7 lexbuf + | 1 -> __sedlex_state_6 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_7 = + function + | lexbuf -> + (match __sedlex_partition_41 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_2 lexbuf + | 1 -> 0 + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_8 = + function + | lexbuf -> + (match __sedlex_partition_48 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_7 lexbuf + | 1 -> __sedlex_state_8 lexbuf + | 2 -> __sedlex_state_9 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_9 = + function + | lexbuf -> + (match __sedlex_partition_33 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_10 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_10 = + function + | lexbuf -> + (match __sedlex_partition_48 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_7 lexbuf + | 1 -> __sedlex_state_10 lexbuf + | 2 -> __sedlex_state_9 lexbuf + | _ -> Sedlexing.backtrack lexbuf) in + Sedlexing.start lexbuf; + (match __sedlex_state_0 lexbuf with + | 0 -> + let num = Sedlexing.lexeme lexbuf in + let loc = loc_of_lexbuf env lexbuf in + let env = + lex_error env loc Parse_error.InvalidFloatBigInt in + Token (env, (mk_bignum_singleton BIG_NORMAL num)) + | _ -> failwith "unreachable type_token floatbigint")) | 26 -> recover env lexbuf - ~f:(fun env -> - fun lexbuf -> - let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_40 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | 1 -> __sedlex_state_3 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_1 = - function - | lexbuf -> - (match __sedlex_partition_41 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | 1 -> 0 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_3 = - function - | lexbuf -> - (match __sedlex_partition_42 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_3 lexbuf - | 1 -> __sedlex_state_4 lexbuf - | 2 -> 0 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_4 = - function - | lexbuf -> - (match __sedlex_partition_33 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_5 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_5 = - function - | lexbuf -> - (match __sedlex_partition_42 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_5 lexbuf - | 1 -> __sedlex_state_4 lexbuf - | 2 -> 0 - | _ -> Sedlexing.backtrack lexbuf) in - Sedlexing.start lexbuf; - (match __sedlex_state_0 lexbuf with - | 0 -> - let num = Sedlexing.lexeme lexbuf in - Token (env, (mk_bignum_singleton BIG_NORMAL num)) - | _ -> failwith "unreachable type_token wholebigint")) + ~f:(fun env lexbuf -> + let rec __sedlex_state_0 = + function + | lexbuf -> + (match __sedlex_partition_40 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_1 lexbuf + | 1 -> __sedlex_state_3 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_1 = + function + | lexbuf -> + (match __sedlex_partition_41 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_1 lexbuf + | 1 -> 0 + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_3 = + function + | lexbuf -> + (match __sedlex_partition_42 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_3 lexbuf + | 1 -> __sedlex_state_4 lexbuf + | 2 -> 0 + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_4 = + function + | lexbuf -> + (match __sedlex_partition_33 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_5 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_5 = + function + | lexbuf -> + (match __sedlex_partition_42 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_5 lexbuf + | 1 -> __sedlex_state_4 lexbuf + | 2 -> 0 + | _ -> Sedlexing.backtrack lexbuf) in + Sedlexing.start lexbuf; + (match __sedlex_state_0 lexbuf with + | 0 -> + let num = Sedlexing.lexeme lexbuf in + Token (env, (mk_bignum_singleton BIG_NORMAL num)) + | _ -> failwith "unreachable type_token wholebigint")) | 27 -> let num = Sedlexing.lexeme lexbuf in let loc = loc_of_lexbuf env lexbuf in @@ -13137,109 +13103,108 @@ let type_token env lexbuf = Token (env, (mk_bignum_singleton BIG_NORMAL num)) | 29 -> recover env lexbuf - ~f:(fun env -> - fun lexbuf -> - let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_37 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | 1 -> __sedlex_state_5 lexbuf - | 2 -> __sedlex_state_7 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_1 = - function - | lexbuf -> - (match __sedlex_partition_33 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_2 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_2 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_46 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_2 lexbuf - | 1 -> __sedlex_state_3 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_3 = - function - | lexbuf -> - (match __sedlex_partition_33 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_4 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_4 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_46 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_4 lexbuf - | 1 -> __sedlex_state_3 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_5 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_47 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_6 lexbuf - | 1 -> __sedlex_state_5 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_6 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_33 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_2 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_7 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_48 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_6 lexbuf - | 1 -> __sedlex_state_7 lexbuf - | 2 -> __sedlex_state_8 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_8 = - function - | lexbuf -> - (match __sedlex_partition_33 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_9 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_9 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_48 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_6 lexbuf - | 1 -> __sedlex_state_9 lexbuf - | 2 -> __sedlex_state_8 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) in - Sedlexing.start lexbuf; - (match __sedlex_state_0 lexbuf with - | 0 -> - let num = Sedlexing.lexeme lexbuf in - Token (env, (mk_num_singleton NORMAL num)) - | _ -> failwith "unreachable type_token wholenumber")) + ~f:(fun env lexbuf -> + let rec __sedlex_state_0 = + function + | lexbuf -> + (match __sedlex_partition_37 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_1 lexbuf + | 1 -> __sedlex_state_5 lexbuf + | 2 -> __sedlex_state_7 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_1 = + function + | lexbuf -> + (match __sedlex_partition_33 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_2 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_2 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 0; + (match __sedlex_partition_46 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_2 lexbuf + | 1 -> __sedlex_state_3 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_3 = + function + | lexbuf -> + (match __sedlex_partition_33 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_4 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_4 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 0; + (match __sedlex_partition_46 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_4 lexbuf + | 1 -> __sedlex_state_3 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_5 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 0; + (match __sedlex_partition_47 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_6 lexbuf + | 1 -> __sedlex_state_5 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_6 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 0; + (match __sedlex_partition_33 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_2 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_7 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 0; + (match __sedlex_partition_48 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_6 lexbuf + | 1 -> __sedlex_state_7 lexbuf + | 2 -> __sedlex_state_8 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) + and __sedlex_state_8 = + function + | lexbuf -> + (match __sedlex_partition_33 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_9 lexbuf + | _ -> Sedlexing.backtrack lexbuf) + and __sedlex_state_9 = + function + | lexbuf -> + (Sedlexing.mark lexbuf 0; + (match __sedlex_partition_48 + (Sedlexing.__private__next_int lexbuf) + with + | 0 -> __sedlex_state_6 lexbuf + | 1 -> __sedlex_state_9 lexbuf + | 2 -> __sedlex_state_8 lexbuf + | _ -> Sedlexing.backtrack lexbuf)) in + Sedlexing.start lexbuf; + (match __sedlex_state_0 lexbuf with + | 0 -> + let num = Sedlexing.lexeme lexbuf in + Token (env, (mk_num_singleton NORMAL num)) + | _ -> failwith "unreachable type_token wholenumber")) | 30 -> let num = Sedlexing.lexeme lexbuf in Token (env, (mk_num_singleton NORMAL num)) @@ -13290,6 +13255,7 @@ let type_token env lexbuf = | "bigint" -> Token (env, T_BIGINT_TYPE) | "bool" -> Token (env, (T_BOOLEAN_TYPE BOOL)) | "boolean" -> Token (env, (T_BOOLEAN_TYPE BOOLEAN)) + | "const" -> Token (env, T_CONST) | "empty" -> Token (env, T_EMPTY_TYPE) | "extends" -> Token (env, T_EXTENDS) | "false" -> Token (env, T_FALSE) @@ -13303,6 +13269,7 @@ let type_token env lexbuf = | "infer" -> Token (env, T_INFER) | "is" -> Token (env, T_IS) | "asserts" -> Token (env, T_ASSERTS) + | "implies" -> Token (env, T_IMPLIES) | "static" -> Token (env, T_STATIC) | "string" -> Token (env, T_STRING_TYPE) | "symbol" -> Token (env, T_SYMBOL_TYPE) diff --git a/jscomp/js_parser/flow_lexer.mli b/jscomp/js_parser/flow_lexer.mli index 7f2754dd2c..0b1ad207b4 100644 --- a/jscomp/js_parser/flow_lexer.mli +++ b/jscomp/js_parser/flow_lexer.mli @@ -2,7 +2,8 @@ { tool_name = "ppx_driver"; include_dirs = []; - load_path = []; + hidden_include_dirs = []; + load_path = ([], []); open_modules = []; for_package = None; debug = false; diff --git a/jscomp/js_parser/flow_sedlexing.mli b/jscomp/js_parser/flow_sedlexing.mli index 4943380fe9..f07a400557 100644 --- a/jscomp/js_parser/flow_sedlexing.mli +++ b/jscomp/js_parser/flow_sedlexing.mli @@ -1,3 +1,4 @@ + (** This is a module provides the minimal Sedlexing suppport It is mostly a subset of Sedlexing with two functions for performance reasons: - Utf8.lexeme_to_buffer diff --git a/jscomp/js_parser/jsx_parser.ml b/jscomp/js_parser/jsx_parser.ml index 8946cc84d3..2a29078dd9 100644 --- a/jscomp/js_parser/jsx_parser.ml +++ b/jscomp/js_parser/jsx_parser.ml @@ -11,7 +11,8 @@ open Parser_common open Parser_env open Flow_ast -module JSX (Parse : Parser_common.PARSER) (Expression : Expression_parser.EXPRESSION) = struct +module JSX (Parse : Parser_common.PARSER) (Expression : Parser_common.EXPRESSION) : + Parser_common.JSX = struct (* Consumes and returns the trailing comments after the end of a JSX tag name, attribute, or spread attribute. diff --git a/jscomp/js_parser/jsx_parser.mli b/jscomp/js_parser/jsx_parser.mli new file mode 100644 index 0000000000..33d91aa185 --- /dev/null +++ b/jscomp/js_parser/jsx_parser.mli @@ -0,0 +1,8 @@ +(* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + *) + +module JSX (_ : Parser_common.PARSER) (_ : Parser_common.EXPRESSION) : Parser_common.JSX diff --git a/jscomp/js_parser/loc.ml b/jscomp/js_parser/loc.ml index 110e21640b..8a114f156c 100644 --- a/jscomp/js_parser/loc.ml +++ b/jscomp/js_parser/loc.ml @@ -1,35 +1,84 @@ -[@@@ocaml.ppx.context - { - tool_name = "ppx_driver"; - include_dirs = []; - load_path = []; - open_modules = []; - for_package = None; - debug = false; - use_threads = false; - use_vmthreads = false; - recursive_types = false; - principal = false; - transparent_modules = false; - unboxed_types = false; - unsafe_string = false; - cookies = - [("library-name", "flow_parser"); ("sedlex.regexps", ([%regexps ]))] - }] type position = { line: int ; column: int }[@@deriving (eq, show)] -let rec equal_position : position -> position -> bool = - (( - fun lhs -> - fun rhs -> - ((fun (a : int) -> fun b -> a = b) lhs.line rhs.line) && - ((fun (a : int) -> fun b -> a = b) lhs.column rhs.column)) - [@ocaml.warning "-A"])[@@ocaml.warning "-39"] +include + struct + let _ = fun (_ : position) -> () + let rec equal_position : + position -> position -> bool = + (( + fun lhs rhs -> + ((fun (a : int) b -> a = b) lhs.line rhs.line) && + ((fun (a : int) b -> a = b) lhs.column rhs.column)) + [@ocaml.warning "-39"][@ocaml.warning "-A"])[@@ocaml.warning "-39"] + let _ = equal_position + let rec pp_position : + Format.formatter -> + position -> unit + = + (( + fun fmt x -> + Format.fprintf fmt "@[<2>{ "; + ((Format.fprintf fmt "@[%s =@ " "Loc.line"; + (Format.fprintf fmt "%d") x.line; + Format.fprintf fmt "@]"); + Format.fprintf fmt ";@ "; + Format.fprintf fmt "@[%s =@ " "column"; + (Format.fprintf fmt "%d") x.column; + Format.fprintf fmt "@]"); + Format.fprintf fmt "@ }@]") + [@ocaml.warning "-39"][@ocaml.warning "-A"]) + and show_position : position -> string = + fun x -> Format.asprintf "%a" pp_position x + [@@ocaml.warning "-32"] + let _ = pp_position + and _ = show_position + end[@@ocaml.doc "@inline"][@@merlin.hide ] type t = { source: File_key.t option ; start: position ; _end: position }[@@deriving show] +include + struct + let _ = fun (_ : t) -> () + let rec pp : + Format.formatter -> t -> unit + = + ((let __2 = pp_position + and __1 = pp_position + and __0 = File_key.pp in + (( + fun fmt x -> + Format.fprintf fmt "@[<2>{ "; + (((Format.fprintf fmt "@[%s =@ " + "Loc.source"; + ((function + | None -> + Format.pp_print_string fmt "None" + | Some x -> + (Format.pp_print_string fmt + "(Some "; + (__0 fmt) x; + Format.pp_print_string fmt ")"))) + x.source; + Format.fprintf fmt "@]"); + Format.fprintf fmt ";@ "; + Format.fprintf fmt "@[%s =@ " "start"; + (__1 fmt) x.start; + Format.fprintf fmt "@]"); + Format.fprintf fmt ";@ "; + Format.fprintf fmt "@[%s =@ " "_end"; + (__2 fmt) x._end; + Format.fprintf fmt "@]"); + Format.fprintf fmt "@ }@]") + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"]) + and show : t -> string = + fun x -> Format.asprintf "%a" pp x[@@ocaml.warning + "-32"] + let _ = pp + and _ = show + end[@@ocaml.doc "@inline"][@@merlin.hide ] let none = { source = None; @@ -93,7 +142,7 @@ let compare loc1 loc2 = let k = File_key.compare_opt loc1.source loc2.source in if k = 0 then compare_ignore_source loc1 loc2 else k let equal loc1 loc2 = (compare loc1 loc2) = 0 -let debug_to_string ?(include_source= false) loc = +let debug_to_string ?(include_source= false) loc = let source = if include_source then @@ -120,7 +169,12 @@ let to_string_no_source loc = if line != (loc._end).line then Printf.sprintf "%d:%d,%d:%d" line start (loc._end).line end_ else Printf.sprintf "%d:%d-%d" line start end_ -let mk_loc ?source (start_line, start_column) (end_line, end_column) = +let start_pos_to_string_for_vscode_loc_uri_fragment loc = + let line = (loc.start).line in + let start = (loc.start).column + 1 in + let (line, start) = if line <= 0 then (0, 0) else (line, start) in + Printf.sprintf "#L%d,%d" line start +let mk_loc ?source (start_line, start_column) (end_line, end_column) = { source; start = { line = start_line; column = start_column }; diff --git a/jscomp/js_parser/loc.mli b/jscomp/js_parser/loc.mli index 361b537a12..3c53a38291 100644 --- a/jscomp/js_parser/loc.mli +++ b/jscomp/js_parser/loc.mli @@ -1,11 +1,44 @@ +[@@@ocaml.ppx.context + { + tool_name = "ppx_driver"; + include_dirs = []; + hidden_include_dirs = []; + load_path = ([], []); + open_modules = []; + for_package = None; + debug = false; + use_threads = false; + use_vmthreads = false; + recursive_types = false; + principal = false; + transparent_modules = false; + unboxed_types = false; + unsafe_string = false; + cookies = [("library-name", "flow_parser")] + }] type position = { line: int ; column: int }[@@deriving (eq, show)] -val equal_position : position -> position -> bool +include + sig + [@@@ocaml.warning "-32"] + val equal_position : position -> position -> bool + val pp_position : + Format.formatter -> + position -> unit + val show_position : position -> string + end[@@ocaml.doc "@inline"][@@merlin.hide ] type t = { source: File_key.t option ; start: position ; _end: position }[@@deriving show] +include + sig + [@@@ocaml.warning "-32"] + val pp : + Format.formatter -> t -> unit + val show : t -> string + end[@@ocaml.doc "@inline"][@@merlin.hide ] val none : t val is_none : t -> bool val is_none_ignore_source : t -> bool @@ -25,6 +58,7 @@ val compare : t -> t -> int val equal : t -> t -> bool val debug_to_string : ?include_source:bool -> t -> string val to_string_no_source : t -> string +val start_pos_to_string_for_vscode_loc_uri_fragment : t -> string val mk_loc : ?source:File_key.t -> (int * int) -> (int * int) -> t val source : t -> File_key.t option val cursor : File_key.t option -> int -> int -> t[@@ocaml.doc diff --git a/jscomp/js_parser/match_pattern_parser.ml b/jscomp/js_parser/match_pattern_parser.ml new file mode 100644 index 0000000000..4e446231ac --- /dev/null +++ b/jscomp/js_parser/match_pattern_parser.ml @@ -0,0 +1,439 @@ +(* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + *) + +open Token +open Parser_env +open Parser_common +open Flow_ast.MatchPattern +module Ast = Flow_ast + +module Match_pattern (Parse : PARSER) : Parser_common.MATCH_PATTERN = struct + let rec match_pattern env = + let start_loc = Peek.loc env in + ignore @@ Eat.maybe env T_BIT_OR; + let pattern = subpattern env in + let pattern = + match Peek.token env with + | T_BIT_OR -> + let rec or_patterns env acc = + match Peek.token env with + | T_BIT_OR -> + Eat.token env; + let acc = subpattern env :: acc in + or_patterns env acc + | _ -> List.rev acc + in + let (or_loc, or_pattern) = + with_loc + ~start_loc + (fun env -> + let patterns = or_patterns env [pattern] in + let trailing = Eat.trailing_comments env in + let comments = Flow_ast_utils.mk_comments_opt ~trailing () in + { OrPattern.patterns; comments }) + env + in + (or_loc, OrPattern or_pattern) + | _ -> pattern + in + match Peek.token env with + | T_IDENTIFIER { raw = "as"; _ } -> + let (as_loc, as_pattern) = + with_loc + ~start_loc + (fun env -> + Eat.token env; + let target = + match Peek.token env with + | T_CONST -> + let (loc, binding) = binding_pattern env ~kind:Ast.Variable.Const in + AsPattern.Binding (loc, binding) + | T_LET -> + let (loc, binding) = binding_pattern env ~kind:Ast.Variable.Let in + AsPattern.Binding (loc, binding) + | T_VAR -> + let (loc, binding) = binding_pattern env ~kind:Ast.Variable.Var in + AsPattern.Binding (loc, binding) + | _ -> AsPattern.Identifier (Parse.identifier env) + in + let trailing = Eat.trailing_comments env in + let comments = Flow_ast_utils.mk_comments_opt ~trailing () in + { AsPattern.pattern; target; comments }) + env + in + (as_loc, AsPattern as_pattern) + | _ -> pattern + + and subpattern env = + match Peek.token env with + | T_IDENTIFIER { raw = "_"; _ } -> + let leading = Peek.comments env in + let loc = Peek.loc env in + Eat.token env; + let trailing = Eat.trailing_comments env in + let comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () in + (loc, WildcardPattern comments) + | T_LPAREN -> + let leading = Peek.comments env in + Expect.token env T_LPAREN; + let pattern = match_pattern env in + Expect.token env T_RPAREN; + let trailing = Eat.trailing_comments env in + add_comments ~leading ~trailing pattern + | T_NUMBER { kind; raw } -> + let leading = Peek.comments env in + let loc = Peek.loc env in + let value = Parse.number env kind raw in + let trailing = Eat.trailing_comments env in + let comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () in + (loc, NumberPattern { Ast.NumberLiteral.value; raw; comments }) + | T_BIGINT { kind; raw } -> + let leading = Peek.comments env in + let loc = Peek.loc env in + let value = Parse.bigint env kind raw in + let trailing = Eat.trailing_comments env in + let comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () in + (loc, BigIntPattern { Ast.BigIntLiteral.value; raw; comments }) + | T_STRING (loc, value, raw, octal) -> + let leading = Peek.comments env in + if octal then strict_error env Parse_error.StrictOctalLiteral; + Eat.token env; + let trailing = Eat.trailing_comments env in + let comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () in + (loc, StringPattern { Ast.StringLiteral.value; raw; comments }) + | (T_TRUE | T_FALSE) as token -> + let leading = Peek.comments env in + let loc = Peek.loc env in + Eat.token env; + let value = token = T_TRUE in + let trailing = Eat.trailing_comments env in + let comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () in + (loc, BooleanPattern { Ast.BooleanLiteral.value; comments }) + | T_NULL -> + let leading = Peek.comments env in + let loc = Peek.loc env in + Eat.token env; + let trailing = Eat.trailing_comments env in + let comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () in + (loc, NullPattern comments) + | T_PLUS -> unary_pattern env ~operator:UnaryPattern.Plus + | T_MINUS -> unary_pattern env ~operator:UnaryPattern.Minus + | T_CONST -> + let (loc, binding) = binding_pattern env ~kind:Ast.Variable.Const in + (loc, BindingPattern binding) + | T_LET -> + let (loc, binding) = binding_pattern env ~kind:Ast.Variable.Let in + (loc, BindingPattern binding) + | T_VAR -> + let (loc, binding) = binding_pattern env ~kind:Ast.Variable.Var in + (loc, BindingPattern binding) + | T_LCURLY -> object_pattern env + | T_LBRACKET -> array_pattern env + | _ when Peek.is_identifier env -> + let start_loc = Peek.loc env in + let id = Parse.identifier env in + let rec member acc = + match Peek.token env with + | T_PERIOD -> + let mem = + with_loc + ~start_loc + (fun env -> + Eat.token env; + let property = MemberPattern.PropertyIdentifier (identifier_name env) in + let trailing = Eat.trailing_comments env in + let comments = Flow_ast_utils.mk_comments_opt ~trailing () in + { MemberPattern.base = acc; property; comments }) + env + in + member (MemberPattern.BaseMember mem) + | T_LBRACKET -> + let mem = + with_loc + ~start_loc + (fun env -> + Expect.token env T_LBRACKET; + let leading = Peek.comments env in + let property = + match Peek.token env with + | T_STRING (loc, value, raw, octal) -> + if octal then strict_error env Parse_error.StrictOctalLiteral; + Expect.token env (T_STRING (loc, value, raw, octal)); + let trailing = Eat.trailing_comments env in + let comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () in + MemberPattern.PropertyString (loc, { Ast.StringLiteral.value; raw; comments }) + | T_NUMBER { kind; raw } -> + let loc = Peek.loc env in + let value = Parse.number env kind raw in + let trailing = Eat.trailing_comments env in + let comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () in + MemberPattern.PropertyNumber (loc, { Ast.NumberLiteral.value; raw; comments }) + | T_BIGINT { kind; raw } -> + let loc = Peek.loc env in + let value = Parse.bigint env kind raw in + let trailing = Eat.trailing_comments env in + let comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () in + MemberPattern.PropertyBigInt (loc, { Ast.BigIntLiteral.value; raw; comments }) + | _ -> + error_unexpected ~expected:"a numeric or string literal" env; + let loc = Peek.loc env in + MemberPattern.PropertyString + (loc, { Ast.StringLiteral.value = ""; raw = "\"\""; comments = None }) + in + Expect.token env T_RBRACKET; + let trailing = Eat.trailing_comments env in + let comments = Flow_ast_utils.mk_comments_opt ~trailing () in + { MemberPattern.base = acc; property; comments }) + env + in + member (MemberPattern.BaseMember mem) + | _ -> + (match acc with + | MemberPattern.BaseIdentifier ((loc, _) as id) -> (loc, IdentifierPattern id) + | MemberPattern.BaseMember (loc, member) -> (loc, MemberPattern (loc, member))) + in + member (MemberPattern.BaseIdentifier id) + | t -> + let leading = Peek.comments env in + let loc = Peek.loc env in + error_unexpected env; + (* Let's get rid of the bad token *) + (match t with + | T_ERROR _ -> Eat.token env + | _ -> ()); + let comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing:[] () in + (loc, WildcardPattern comments) + + and unary_pattern env ~operator = + with_loc + (fun env -> + let leading = Peek.comments env in + Eat.token env; + let argument = + match Peek.token env with + | T_NUMBER { kind; raw } -> + let leading = Peek.comments env in + let loc = Peek.loc env in + let value = Parse.number env kind raw in + let trailing = Eat.trailing_comments env in + let comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () in + (loc, UnaryPattern.NumberLiteral { Ast.NumberLiteral.value; raw; comments }) + | T_BIGINT { kind; raw } -> + let leading = Peek.comments env in + let loc = Peek.loc env in + let value = Parse.bigint env kind raw in + let trailing = Eat.trailing_comments env in + let comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () in + (loc, UnaryPattern.BigIntLiteral { Ast.BigIntLiteral.value; raw; comments }) + | _ -> + let loc = Peek.loc env in + error_unexpected ~expected:"a number literal" env; + ( loc, + UnaryPattern.NumberLiteral + { Ast.NumberLiteral.value = 0.; raw = "0"; comments = None } + ) + in + let trailing = Eat.trailing_comments env in + let comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () in + UnaryPattern { UnaryPattern.operator; argument; comments }) + env + + and binding_pattern env ~kind = + with_loc + (fun env -> + let leading = Peek.comments env in + Eat.token env; + let id = Parse.identifier ~restricted_error:Parse_error.StrictVarName env in + let trailing = Eat.trailing_comments env in + let comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () in + { BindingPattern.kind; id; comments }) + env + + and object_pattern env = + let property_key env = + let open ObjectPattern.Property in + let leading = Peek.comments env in + match Peek.token env with + | T_STRING (loc, value, raw, octal) -> + if octal then strict_error env Parse_error.StrictOctalLiteral; + Expect.token env (T_STRING (loc, value, raw, octal)); + let trailing = Eat.trailing_comments env in + let comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () in + StringLiteral (loc, { Ast.StringLiteral.value; raw; comments }) + | T_NUMBER { kind; raw } -> + let loc = Peek.loc env in + let value = Parse.number env kind raw in + let trailing = Eat.trailing_comments env in + let comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () in + NumberLiteral (loc, { Ast.NumberLiteral.value; raw; comments }) + | T_BIGINT { kind; raw } -> + let loc = Peek.loc env in + let value = Parse.bigint env kind raw in + let trailing = Eat.trailing_comments env in + let comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () in + BigIntLiteral (loc, { Ast.BigIntLiteral.value; raw; comments }) + | _ -> + let id = identifier_name env in + Identifier id + in + let property = + with_loc (fun env -> + let leading = Peek.comments env in + let shorthand_prop (loc, binding) = + let { BindingPattern.id = (_, id); _ } = binding in + let key = ObjectPattern.Property.Identifier (loc, id) in + let pattern = (loc, BindingPattern binding) in + let trailing = Eat.trailing_comments env in + let comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () in + ObjectPattern.Property.Valid + { ObjectPattern.Property.key; pattern; shorthand = true; comments } + in + match Peek.token env with + | T_CONST -> shorthand_prop (binding_pattern env ~kind:Ast.Variable.Const) + | T_LET -> shorthand_prop (binding_pattern env ~kind:Ast.Variable.Let) + | T_VAR -> shorthand_prop (binding_pattern env ~kind:Ast.Variable.Var) + | _ + when Peek.is_identifier env + && + match Peek.ith_token ~i:1 env with + | T_COMMA + | T_RCURLY -> + true + | _ -> false -> + ObjectPattern.Property.InvalidShorthand (identifier_name env) + | _ -> + let key = property_key env in + Expect.token env T_COLON; + let pattern = match_pattern env in + let trailing = Eat.trailing_comments env in + let comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () in + ObjectPattern.Property.Valid + { ObjectPattern.Property.key; pattern; shorthand = false; comments } + ) + in + let rec properties env acc = + match Peek.token env with + | T_EOF + | T_RCURLY -> + (List.rev acc, None) + | T_ELLIPSIS -> + let rest = rest_pattern env in + if Peek.token env = T_COMMA then + error_at env (Peek.loc env, Parse_error.MatchNonLastRest `Object); + (List.rev acc, Some rest) + | _ -> + let prop = property env in + if not (Peek.token env = T_RCURLY) then Expect.token env T_COMMA; + properties env (prop :: acc) + in + with_loc + (fun env -> + let leading = Peek.comments env in + Expect.token env T_LCURLY; + let (properties, rest) = properties env [] in + let internal = Peek.comments env in + Expect.token env T_RCURLY; + let trailing = Eat.trailing_comments env in + ObjectPattern + { + ObjectPattern.properties; + rest; + comments = Flow_ast_utils.mk_comments_with_internal_opt ~leading ~trailing ~internal (); + }) + env + + and array_pattern env = + let rec elements env ~start_loc acc = + match Peek.token env with + | T_EOF + | T_RBRACKET -> + (List.rev acc, None) + | T_ELLIPSIS -> + let rest = rest_pattern env in + if Peek.token env = T_COMMA then + error_at env (Peek.loc env, Parse_error.MatchNonLastRest `Array); + (List.rev acc, Some rest) + | _ -> + let pattern = match_pattern env in + let index = Loc.btwn start_loc (Peek.loc env) in + if Peek.token env <> T_RBRACKET then Expect.token env T_COMMA; + let element = { ArrayPattern.Element.index; pattern } in + elements env ~start_loc (element :: acc) + in + with_loc + (fun env -> + let leading = Peek.comments env in + let start_loc = Peek.loc env in + Expect.token env T_LBRACKET; + let (elements, rest) = elements env ~start_loc [] in + let internal = Peek.comments env in + Expect.token env T_RBRACKET; + let trailing = Eat.trailing_comments env in + let comments = + Flow_ast_utils.mk_comments_with_internal_opt ~leading ~trailing ~internal () + in + ArrayPattern { ArrayPattern.elements; rest; comments }) + env + + and rest_pattern env = + with_loc + (fun env -> + let leading = Peek.comments env in + Expect.token env T_ELLIPSIS; + let argument = + match Peek.token env with + | T_CONST -> Some (binding_pattern env ~kind:Ast.Variable.Const) + | T_LET -> Some (binding_pattern env ~kind:Ast.Variable.Let) + | T_VAR -> Some (binding_pattern env ~kind:Ast.Variable.Var) + | _ -> None + in + let trailing = Eat.trailing_comments env in + let comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () in + { RestPattern.argument; comments }) + env + + and add_comments ?(leading = []) ?(trailing = []) (loc, pattern) = + let merge_comments inner = + Flow_ast_utils.merge_comments + ~inner + ~outer:(Flow_ast_utils.mk_comments_opt ~leading ~trailing ()) + in + let merge_comments_with_internal inner = + Flow_ast_utils.merge_comments_with_internal + ~inner + ~outer:(Flow_ast_utils.mk_comments_opt ~leading ~trailing ()) + in + ( loc, + match pattern with + | WildcardPattern comments -> WildcardPattern (merge_comments comments) + | NumberPattern ({ Ast.NumberLiteral.comments; _ } as p) -> + NumberPattern { p with Ast.NumberLiteral.comments = merge_comments comments } + | BigIntPattern ({ Ast.BigIntLiteral.comments; _ } as p) -> + BigIntPattern { p with Ast.BigIntLiteral.comments = merge_comments comments } + | StringPattern ({ Ast.StringLiteral.comments; _ } as p) -> + StringPattern { p with Ast.StringLiteral.comments = merge_comments comments } + | BooleanPattern ({ Ast.BooleanLiteral.comments; _ } as p) -> + BooleanPattern { p with Ast.BooleanLiteral.comments = merge_comments comments } + | NullPattern comments -> NullPattern (merge_comments comments) + | UnaryPattern ({ UnaryPattern.comments; _ } as p) -> + UnaryPattern { p with UnaryPattern.comments = merge_comments comments } + | BindingPattern ({ BindingPattern.comments; _ } as p) -> + BindingPattern { p with BindingPattern.comments = merge_comments comments } + | IdentifierPattern (id_loc, ({ Ast.Identifier.comments; _ } as p)) -> + IdentifierPattern (id_loc, { p with Ast.Identifier.comments = merge_comments comments }) + | MemberPattern (loc, ({ MemberPattern.comments; _ } as p)) -> + MemberPattern (loc, { p with MemberPattern.comments = merge_comments comments }) + | ObjectPattern ({ ObjectPattern.comments; _ } as p) -> + ObjectPattern { p with ObjectPattern.comments = merge_comments_with_internal comments } + | ArrayPattern ({ ArrayPattern.comments; _ } as p) -> + ArrayPattern { p with ArrayPattern.comments = merge_comments_with_internal comments } + | OrPattern ({ OrPattern.comments; _ } as p) -> + OrPattern { p with OrPattern.comments = merge_comments comments } + | AsPattern ({ AsPattern.comments; _ } as p) -> + AsPattern { p with AsPattern.comments = merge_comments comments } + ) +end diff --git a/jscomp/js_parser/object_parser.ml b/jscomp/js_parser/object_parser.ml index 6696471a63..c25b1da38d 100644 --- a/jscomp/js_parser/object_parser.ml +++ b/jscomp/js_parser/object_parser.ml @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. *) -module Ast = Flow_ast open Token open Parser_env open Flow_ast @@ -16,27 +15,12 @@ open Comment_attachment (* A module for parsing various object related things, like object literals * and classes *) -module type OBJECT = sig - val key : ?class_body:bool -> env -> Loc.t * (Loc.t, Loc.t) Ast.Expression.Object.Property.key - - val _initializer : env -> Loc.t * (Loc.t, Loc.t) Ast.Expression.Object.t * pattern_errors - - val class_declaration : - env -> (Loc.t, Loc.t) Ast.Class.Decorator.t list -> (Loc.t, Loc.t) Ast.Statement.t - - val class_expression : env -> (Loc.t, Loc.t) Ast.Expression.t - - val class_implements : env -> attach_leading:bool -> (Loc.t, Loc.t) Ast.Class.Implements.t - - val decorator_list : env -> (Loc.t, Loc.t) Ast.Class.Decorator.t list -end - module Object (Parse : Parser_common.PARSER) - (Type : Type_parser.TYPE) - (Declaration : Declaration_parser.DECLARATION) - (Expression : Expression_parser.EXPRESSION) - (Pattern_cover : Pattern_cover.COVER) : OBJECT = struct + (Type : Parser_common.TYPE) + (Declaration : Parser_common.DECLARATION) + (Expression : Parser_common.EXPRESSION) + (Pattern_cover : Parser_common.COVER) : Parser_common.OBJECT = struct let decorator_list = let expression env = let expression = Expression.left_hand_side env in @@ -195,6 +179,7 @@ module Object body; generator; async; + effect_ = Function.Arbitrary; predicate = None; (* setters/getter are not predicates *) return; @@ -289,6 +274,7 @@ module Object params; body; generator; + effect_ = Function.Arbitrary; async; (* TODO: add support for object method predicates *) predicate = None; @@ -864,6 +850,7 @@ module Object body; generator; async; + effect_ = Function.Arbitrary; (* TODO: add support for method predicates *) predicate = None; return; diff --git a/jscomp/js_parser/object_parser.mli b/jscomp/js_parser/object_parser.mli new file mode 100644 index 0000000000..a344deea70 --- /dev/null +++ b/jscomp/js_parser/object_parser.mli @@ -0,0 +1,16 @@ +(* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + *) + +(* A module for parsing various object related things, like object literals + * and classes *) + +module Object + (_ : Parser_common.PARSER) + (_ : Parser_common.TYPE) + (_ : Parser_common.DECLARATION) + (_ : Parser_common.EXPRESSION) + (_ : Parser_common.COVER) : Parser_common.OBJECT diff --git a/jscomp/js_parser/parse_error.ml b/jscomp/js_parser/parse_error.ml index 70f9637af4..70791cb6b5 100644 --- a/jscomp/js_parser/parse_error.ml +++ b/jscomp/js_parser/parse_error.ml @@ -2,7 +2,6 @@ type t = | AccessorDataProperty | AccessorGetSet | AdjacentJSXElements - | AmbiguousDeclareModuleKind | AmbiguousLetBracket | AsyncFunctionAsStatement | AwaitAsIdentifierReference @@ -14,11 +13,8 @@ type t = | DeclareAsync | DeclareClassElement | DeclareClassFieldInitializer - | DeclareExportInterface - | DeclareExportType | DeclareOpaqueTypeInitializer | DuplicateConstructor - | DuplicateDeclareModuleExports | DuplicateExport of string | DuplicatePrivateFields of string | ElementAfterRestElement @@ -83,7 +79,8 @@ type t = method_: bool ; private_: bool } | InvalidComponentParamName - | InvalidComponentRenderAnnotation + | InvalidComponentRenderAnnotation of { + has_nested_render: bool } | InvalidComponentStringParameterBinding of { optional: bool ; name: string } @@ -95,7 +92,6 @@ type t = | InvalidLHSInExponentiation | InvalidLHSInForIn | InvalidLHSInForOf - | InvalidNonTypeImportInDeclareModule | InvalidOptionalIndexedAccess | InvalidRegExp | InvalidRegExpFlags of string @@ -106,6 +102,9 @@ type t = | JSXAttributeValueEmptyExpression | LiteralShorthandProperty | MalformedUnicode + | MatchNonLastRest of [ `Object | `Array ] + | MatchEmptyArgument + | MatchSpreadArgument | MethodInDestructuring | MissingJSXClosingTag of string | MissingTypeParam @@ -179,7 +178,8 @@ type t = | YieldAsIdentifierReference | YieldInFormalParameters [@@deriving ord] let rec compare : t -> t -> int = - let __41 () (a : string) b = Stdlib.compare a b + let __42 () (a : string) b = Stdlib.compare a b + and __41 () (a : string) b = Stdlib.compare a b and __40 () (a : string) b = Stdlib.compare a b and __39 () (a : string) b = Stdlib.compare a b and __38 () (a : string) b = Stdlib.compare a b @@ -190,9 +190,9 @@ let rec compare : t -> t -> int = and __33 () (a : string) b = Stdlib.compare a b and __32 () (a : string) b = Stdlib.compare a b and __31 () (a : string) b = Stdlib.compare a b - and __30 () (a : string) b = Stdlib.compare a b - and __29 () (a : bool) b = Stdlib.compare a b - and __28 () (a : string) b = Stdlib.compare a b + and __30 () (a : bool) b = Stdlib.compare a b + and __29 () (a : string) b = Stdlib.compare a b + and __28 () (a : bool) b = Stdlib.compare a b and __27 () (a : bool) b = Stdlib.compare a b and __26 () (a : bool) b = Stdlib.compare a b and __25 () (a : bool) b = Stdlib.compare a b @@ -222,448 +222,474 @@ let rec compare : t -> t -> int = and __1 () (a : string) b = Stdlib.compare a b and __0 () (a : string) b = Stdlib.compare a b in (( - fun lhs -> - fun rhs -> - match (lhs, rhs) with - | (AccessorDataProperty, AccessorDataProperty) -> 0 - | (AccessorGetSet, AccessorGetSet) -> 0 - | (AdjacentJSXElements, AdjacentJSXElements) -> 0 - | (AmbiguousDeclareModuleKind, AmbiguousDeclareModuleKind) -> 0 - | (AmbiguousLetBracket, AmbiguousLetBracket) -> 0 - | (AsyncFunctionAsStatement, AsyncFunctionAsStatement) -> 0 - | (AwaitAsIdentifierReference, AwaitAsIdentifierReference) -> 0 - | (AwaitInAsyncFormalParameters, AwaitInAsyncFormalParameters) -> 0 - | (ComputedShorthandProperty, ComputedShorthandProperty) -> 0 - | (ConstructorCannotBeAccessor, ConstructorCannotBeAccessor) -> 0 - | (ConstructorCannotBeAsync, ConstructorCannotBeAsync) -> 0 - | (ConstructorCannotBeGenerator, ConstructorCannotBeGenerator) -> 0 - | (DeclareAsync, DeclareAsync) -> 0 - | (DeclareClassElement, DeclareClassElement) -> 0 - | (DeclareClassFieldInitializer, DeclareClassFieldInitializer) -> 0 - | (DeclareExportInterface, DeclareExportInterface) -> 0 - | (DeclareExportType, DeclareExportType) -> 0 - | (DeclareOpaqueTypeInitializer, DeclareOpaqueTypeInitializer) -> 0 - | (DuplicateConstructor, DuplicateConstructor) -> 0 - | (DuplicateDeclareModuleExports, DuplicateDeclareModuleExports) -> - 0 - | (DuplicateExport lhs0, DuplicateExport rhs0) -> - (__0 ()) lhs0 rhs0 - | (DuplicatePrivateFields lhs0, DuplicatePrivateFields rhs0) -> - (__1 ()) lhs0 rhs0 - | (ElementAfterRestElement, ElementAfterRestElement) -> 0 - | (EnumBigIntMemberNotInitialized - { enum_name = lhsenum_name; member_name = lhsmember_name }, - EnumBigIntMemberNotInitialized - { enum_name = rhsenum_name; member_name = rhsmember_name }) -> - (match (__2 ()) lhsenum_name rhsenum_name with - | 0 -> (__3 ()) lhsmember_name rhsmember_name - | x -> x) - | (EnumBooleanMemberNotInitialized - { enum_name = lhsenum_name; member_name = lhsmember_name }, - EnumBooleanMemberNotInitialized - { enum_name = rhsenum_name; member_name = rhsmember_name }) -> - (match (__4 ()) lhsenum_name rhsenum_name with - | 0 -> (__5 ()) lhsmember_name rhsmember_name - | x -> x) - | (EnumDuplicateMemberName - { enum_name = lhsenum_name; member_name = lhsmember_name }, - EnumDuplicateMemberName - { enum_name = rhsenum_name; member_name = rhsmember_name }) -> - (match (__6 ()) lhsenum_name rhsenum_name with - | 0 -> (__7 ()) lhsmember_name rhsmember_name - | x -> x) - | (EnumInconsistentMemberValues { enum_name = lhsenum_name }, - EnumInconsistentMemberValues { enum_name = rhsenum_name }) -> - (__8 ()) lhsenum_name rhsenum_name - | (EnumInvalidEllipsis { trailing_comma = lhstrailing_comma }, - EnumInvalidEllipsis { trailing_comma = rhstrailing_comma }) -> - (__9 ()) lhstrailing_comma rhstrailing_comma - | (EnumInvalidExplicitType - { enum_name = lhsenum_name; supplied_type = lhssupplied_type }, - EnumInvalidExplicitType - { enum_name = rhsenum_name; supplied_type = rhssupplied_type }) - -> - (match (__10 ()) lhsenum_name rhsenum_name with - | 0 -> - ((fun x -> - fun y -> - match (x, y) with - | (None, None) -> 0 - | (Some a, Some b) -> (__11 ()) a b - | (None, Some _) -> (-1) - | (Some _, None) -> 1)) lhssupplied_type - rhssupplied_type - | x -> x) - | (EnumInvalidExport, EnumInvalidExport) -> 0 - | (EnumInvalidInitializerSeparator - { member_name = lhsmember_name }, - EnumInvalidInitializerSeparator - { member_name = rhsmember_name }) -> - (__12 ()) lhsmember_name rhsmember_name - | (EnumInvalidMemberInitializer - { enum_name = lhsenum_name; explicit_type = lhsexplicit_type; - member_name = lhsmember_name }, - EnumInvalidMemberInitializer - { enum_name = rhsenum_name; explicit_type = rhsexplicit_type; - member_name = rhsmember_name }) - -> - (match (__13 ()) lhsenum_name rhsenum_name with - | 0 -> - (match (fun x -> - fun y -> - match (x, y) with - | (None, None) -> 0 - | (Some a, Some b) -> __14 a b - | (None, Some _) -> (-1) - | (Some _, None) -> 1) lhsexplicit_type - rhsexplicit_type - with - | 0 -> (__15 ()) lhsmember_name rhsmember_name - | x -> x) - | x -> x) - | (EnumInvalidMemberName - { enum_name = lhsenum_name; member_name = lhsmember_name }, - EnumInvalidMemberName - { enum_name = rhsenum_name; member_name = rhsmember_name }) -> - (match (__16 ()) lhsenum_name rhsenum_name with - | 0 -> (__17 ()) lhsmember_name rhsmember_name - | x -> x) - | (EnumInvalidMemberSeparator, EnumInvalidMemberSeparator) -> 0 - | (EnumNumberMemberNotInitialized - { enum_name = lhsenum_name; member_name = lhsmember_name }, - EnumNumberMemberNotInitialized - { enum_name = rhsenum_name; member_name = rhsmember_name }) -> - (match (__18 ()) lhsenum_name rhsenum_name with - | 0 -> (__19 ()) lhsmember_name rhsmember_name - | x -> x) - | (EnumStringMemberInconsistentlyInitialized - { enum_name = lhsenum_name }, - EnumStringMemberInconsistentlyInitialized - { enum_name = rhsenum_name }) -> - (__20 ()) lhsenum_name rhsenum_name - | (EnumInvalidConstPrefix, EnumInvalidConstPrefix) -> 0 - | (ExpectedJSXClosingTag lhs0, ExpectedJSXClosingTag rhs0) -> - (__21 ()) lhs0 rhs0 - | (ExpectedPatternFoundExpression, ExpectedPatternFoundExpression) - -> 0 - | (ExportSpecifierMissingComma, ExportSpecifierMissingComma) -> 0 - | (FunctionAsStatement { in_strict_mode = lhsin_strict_mode }, - FunctionAsStatement { in_strict_mode = rhsin_strict_mode }) -> - (__22 ()) lhsin_strict_mode rhsin_strict_mode - | (GeneratorFunctionAsStatement, GeneratorFunctionAsStatement) -> 0 - | (GetterArity, GetterArity) -> 0 - | (GetterMayNotHaveThisParam, GetterMayNotHaveThisParam) -> 0 - | (IllegalBreak, IllegalBreak) -> 0 - | (IllegalContinue, IllegalContinue) -> 0 - | (IllegalReturn, IllegalReturn) -> 0 - | (IllegalUnicodeEscape, IllegalUnicodeEscape) -> 0 - | (ImportSpecifierMissingComma, ImportSpecifierMissingComma) -> 0 - | (ImportTypeShorthandOnlyInPureImport, - ImportTypeShorthandOnlyInPureImport) -> 0 - | (InexactInsideExact, InexactInsideExact) -> 0 - | (InexactInsideNonObject, InexactInsideNonObject) -> 0 - | (InvalidClassMemberName - { name = lhsname; static = lhsstatic; method_ = lhsmethod_; - private_ = lhsprivate_ }, - InvalidClassMemberName - { name = rhsname; static = rhsstatic; method_ = rhsmethod_; - private_ = rhsprivate_ }) - -> - (match (__23 ()) lhsname rhsname with - | 0 -> - (match (__24 ()) lhsstatic rhsstatic with - | 0 -> - (match (__25 ()) lhsmethod_ rhsmethod_ with - | 0 -> (__26 ()) lhsprivate_ rhsprivate_ - | x -> x) - | x -> x) - | x -> x) - | (InvalidComponentParamName, InvalidComponentParamName) -> 0 - | (InvalidComponentRenderAnnotation, - InvalidComponentRenderAnnotation) -> 0 - | (InvalidComponentStringParameterBinding - { optional = lhsoptional; name = lhsname }, - InvalidComponentStringParameterBinding - { optional = rhsoptional; name = rhsname }) -> - (match (__27 ()) lhsoptional rhsoptional with - | 0 -> (__28 ()) lhsname rhsname - | x -> x) - | (InvalidFloatBigInt, InvalidFloatBigInt) -> 0 - | (InvalidIndexedAccess { has_bracket = lhshas_bracket }, - InvalidIndexedAccess { has_bracket = rhshas_bracket }) -> - (__29 ()) lhshas_bracket rhshas_bracket - | (InvalidJSXAttributeValue, InvalidJSXAttributeValue) -> 0 - | (InvalidLHSInAssignment, InvalidLHSInAssignment) -> 0 - | (InvalidLHSInExponentiation, InvalidLHSInExponentiation) -> 0 - | (InvalidLHSInForIn, InvalidLHSInForIn) -> 0 - | (InvalidLHSInForOf, InvalidLHSInForOf) -> 0 - | (InvalidNonTypeImportInDeclareModule, - InvalidNonTypeImportInDeclareModule) -> 0 - | (InvalidOptionalIndexedAccess, InvalidOptionalIndexedAccess) -> 0 - | (InvalidRegExp, InvalidRegExp) -> 0 - | (InvalidRegExpFlags lhs0, InvalidRegExpFlags rhs0) -> - (__30 ()) lhs0 rhs0 - | (InvalidSciBigInt, InvalidSciBigInt) -> 0 - | (InvalidTupleOptionalSpread, InvalidTupleOptionalSpread) -> 0 - | (InvalidTupleVariance, InvalidTupleVariance) -> 0 - | (InvalidTypeof, InvalidTypeof) -> 0 - | (JSXAttributeValueEmptyExpression, - JSXAttributeValueEmptyExpression) -> 0 - | (LiteralShorthandProperty, LiteralShorthandProperty) -> 0 - | (MalformedUnicode, MalformedUnicode) -> 0 - | (MethodInDestructuring, MethodInDestructuring) -> 0 - | (MissingJSXClosingTag lhs0, MissingJSXClosingTag rhs0) -> - (__31 ()) lhs0 rhs0 - | (MissingTypeParam, MissingTypeParam) -> 0 - | (MissingTypeParamDefault, MissingTypeParamDefault) -> 0 - | (MultipleDefaultsInSwitch, MultipleDefaultsInSwitch) -> 0 - | (NewlineAfterThrow, NewlineAfterThrow) -> 0 - | (NewlineBeforeArrow, NewlineBeforeArrow) -> 0 - | (NoCatchOrFinally, NoCatchOrFinally) -> 0 - | (NoUninitializedConst, NoUninitializedConst) -> 0 - | (NoUninitializedDestructuring, NoUninitializedDestructuring) -> 0 - | (NullishCoalescingUnexpectedLogical lhs0, - NullishCoalescingUnexpectedLogical rhs0) -> (__32 ()) lhs0 rhs0 - | (OptionalChainNew, OptionalChainNew) -> 0 - | (OptionalChainTemplate, OptionalChainTemplate) -> 0 - | (ParameterAfterRestParameter, ParameterAfterRestParameter) -> 0 - | (PrivateDelete, PrivateDelete) -> 0 - | (PrivateNotInClass, PrivateNotInClass) -> 0 - | (PropertyAfterRestElement, PropertyAfterRestElement) -> 0 - | (Redeclaration (lhs0, lhs1), Redeclaration (rhs0, rhs1)) -> - (match (__33 ()) lhs0 rhs0 with - | 0 -> (__34 ()) lhs1 rhs1 - | x -> x) - | (SetterArity, SetterArity) -> 0 - | (SetterMayNotHaveThisParam, SetterMayNotHaveThisParam) -> 0 - | (StrictCatchVariable, StrictCatchVariable) -> 0 - | (StrictDelete, StrictDelete) -> 0 - | (StrictDuplicateProperty, StrictDuplicateProperty) -> 0 - | (StrictFunctionName, StrictFunctionName) -> 0 - | (StrictLHSAssignment, StrictLHSAssignment) -> 0 - | (StrictLHSPostfix, StrictLHSPostfix) -> 0 - | (StrictLHSPrefix, StrictLHSPrefix) -> 0 - | (StrictModeWith, StrictModeWith) -> 0 - | (StrictNonOctalLiteral, StrictNonOctalLiteral) -> 0 - | (StrictOctalLiteral, StrictOctalLiteral) -> 0 - | (StrictParamDupe, StrictParamDupe) -> 0 - | (StrictParamName, StrictParamName) -> 0 - | (StrictParamNotSimple, StrictParamNotSimple) -> 0 - | (StrictReservedWord, StrictReservedWord) -> 0 - | (StrictVarName, StrictVarName) -> 0 - | (SuperPrivate, SuperPrivate) -> 0 - | (TSAbstractClass, TSAbstractClass) -> 0 - | (TSClassVisibility lhs0, TSClassVisibility rhs0) -> - ((fun lhs -> - fun rhs -> - match (lhs, rhs) with - | (`Public, `Public) -> 0 - | (`Private, `Private) -> 0 - | (`Protected, `Protected) -> 0 - | _ -> - let to_int = - function - | `Public -> 0 - | `Private -> 1 - | `Protected -> 2 in - Stdlib.compare (to_int lhs) - (to_int rhs))) lhs0 rhs0 - | (TSTemplateLiteralType, TSTemplateLiteralType) -> 0 - | (ThisParamAnnotationRequired, ThisParamAnnotationRequired) -> 0 - | (ThisParamBannedInArrowFunctions, - ThisParamBannedInArrowFunctions) -> 0 - | (ThisParamBannedInConstructor, ThisParamBannedInConstructor) -> 0 - | (ThisParamMayNotBeOptional, ThisParamMayNotBeOptional) -> 0 - | (ThisParamMustBeFirst, ThisParamMustBeFirst) -> 0 - | (TrailingCommaAfterRestElement, TrailingCommaAfterRestElement) -> - 0 - | (UnboundPrivate lhs0, UnboundPrivate rhs0) -> (__35 ()) lhs0 rhs0 - | (Unexpected lhs0, Unexpected rhs0) -> (__36 ()) lhs0 rhs0 - | (UnexpectedEOS, UnexpectedEOS) -> 0 - | (UnexpectedExplicitInexactInObject, - UnexpectedExplicitInexactInObject) -> 0 - | (UnexpectedOpaqueTypeAlias, UnexpectedOpaqueTypeAlias) -> 0 - | (UnexpectedProto, UnexpectedProto) -> 0 - | (UnexpectedReserved, UnexpectedReserved) -> 0 - | (UnexpectedReservedType, UnexpectedReservedType) -> 0 - | (UnexpectedSpreadType, UnexpectedSpreadType) -> 0 - | (UnexpectedStatic, UnexpectedStatic) -> 0 - | (UnexpectedSuper, UnexpectedSuper) -> 0 - | (UnexpectedSuperCall, UnexpectedSuperCall) -> 0 - | (UnexpectedTokenWithSuggestion (lhs0, lhs1), - UnexpectedTokenWithSuggestion (rhs0, rhs1)) -> - (match (__37 ()) lhs0 rhs0 with - | 0 -> (__38 ()) lhs1 rhs1 - | x -> x) - | (UnexpectedTypeAlias, UnexpectedTypeAlias) -> 0 - | (UnexpectedTypeAnnotation, UnexpectedTypeAnnotation) -> 0 - | (UnexpectedTypeDeclaration, UnexpectedTypeDeclaration) -> 0 - | (UnexpectedTypeExport, UnexpectedTypeExport) -> 0 - | (UnexpectedTypeImport, UnexpectedTypeImport) -> 0 - | (UnexpectedTypeInterface, UnexpectedTypeInterface) -> 0 - | (UnexpectedVariance, UnexpectedVariance) -> 0 - | (UnexpectedWithExpected (lhs0, lhs1), UnexpectedWithExpected - (rhs0, rhs1)) -> - (match (__39 ()) lhs0 rhs0 with - | 0 -> (__40 ()) lhs1 rhs1 - | x -> x) - | (UnknownLabel lhs0, UnknownLabel rhs0) -> (__41 ()) lhs0 rhs0 - | (UnsupportedDecorator, UnsupportedDecorator) -> 0 - | (UnterminatedRegExp, UnterminatedRegExp) -> 0 - | (WhitespaceInPrivateName, WhitespaceInPrivateName) -> 0 - | (YieldAsIdentifierReference, YieldAsIdentifierReference) -> 0 - | (YieldInFormalParameters, YieldInFormalParameters) -> 0 - | _ -> - let to_int = - function - | AccessorDataProperty -> 0 - | AccessorGetSet -> 1 - | AdjacentJSXElements -> 2 - | AmbiguousDeclareModuleKind -> 3 - | AmbiguousLetBracket -> 4 - | AsyncFunctionAsStatement -> 5 - | AwaitAsIdentifierReference -> 6 - | AwaitInAsyncFormalParameters -> 7 - | ComputedShorthandProperty -> 8 - | ConstructorCannotBeAccessor -> 9 - | ConstructorCannotBeAsync -> 10 - | ConstructorCannotBeGenerator -> 11 - | DeclareAsync -> 12 - | DeclareClassElement -> 13 - | DeclareClassFieldInitializer -> 14 - | DeclareExportInterface -> 15 - | DeclareExportType -> 16 - | DeclareOpaqueTypeInitializer -> 17 - | DuplicateConstructor -> 18 - | DuplicateDeclareModuleExports -> 19 - | DuplicateExport _ -> 20 - | DuplicatePrivateFields _ -> 21 - | ElementAfterRestElement -> 22 - | EnumBigIntMemberNotInitialized _ -> 23 - | EnumBooleanMemberNotInitialized _ -> 24 - | EnumDuplicateMemberName _ -> 25 - | EnumInconsistentMemberValues _ -> 26 - | EnumInvalidEllipsis _ -> 27 - | EnumInvalidExplicitType _ -> 28 - | EnumInvalidExport -> 29 - | EnumInvalidInitializerSeparator _ -> 30 - | EnumInvalidMemberInitializer _ -> 31 - | EnumInvalidMemberName _ -> 32 - | EnumInvalidMemberSeparator -> 33 - | EnumNumberMemberNotInitialized _ -> 34 - | EnumStringMemberInconsistentlyInitialized _ -> 35 - | EnumInvalidConstPrefix -> 36 - | ExpectedJSXClosingTag _ -> 37 - | ExpectedPatternFoundExpression -> 38 - | ExportSpecifierMissingComma -> 39 - | FunctionAsStatement _ -> 40 - | GeneratorFunctionAsStatement -> 41 - | GetterArity -> 42 - | GetterMayNotHaveThisParam -> 43 - | IllegalBreak -> 44 - | IllegalContinue -> 45 - | IllegalReturn -> 46 - | IllegalUnicodeEscape -> 47 - | ImportSpecifierMissingComma -> 48 - | ImportTypeShorthandOnlyInPureImport -> 49 - | InexactInsideExact -> 50 - | InexactInsideNonObject -> 51 - | InvalidClassMemberName _ -> 52 - | InvalidComponentParamName -> 53 - | InvalidComponentRenderAnnotation -> 54 - | InvalidComponentStringParameterBinding _ -> 55 - | InvalidFloatBigInt -> 56 - | InvalidIndexedAccess _ -> 57 - | InvalidJSXAttributeValue -> 58 - | InvalidLHSInAssignment -> 59 - | InvalidLHSInExponentiation -> 60 - | InvalidLHSInForIn -> 61 - | InvalidLHSInForOf -> 62 - | InvalidNonTypeImportInDeclareModule -> 63 - | InvalidOptionalIndexedAccess -> 64 - | InvalidRegExp -> 65 - | InvalidRegExpFlags _ -> 66 - | InvalidSciBigInt -> 67 - | InvalidTupleOptionalSpread -> 68 - | InvalidTupleVariance -> 69 - | InvalidTypeof -> 70 - | JSXAttributeValueEmptyExpression -> 71 - | LiteralShorthandProperty -> 72 - | MalformedUnicode -> 73 - | MethodInDestructuring -> 74 - | MissingJSXClosingTag _ -> 75 - | MissingTypeParam -> 76 - | MissingTypeParamDefault -> 77 - | MultipleDefaultsInSwitch -> 78 - | NewlineAfterThrow -> 79 - | NewlineBeforeArrow -> 80 - | NoCatchOrFinally -> 81 - | NoUninitializedConst -> 82 - | NoUninitializedDestructuring -> 83 - | NullishCoalescingUnexpectedLogical _ -> 84 - | OptionalChainNew -> 85 - | OptionalChainTemplate -> 86 - | ParameterAfterRestParameter -> 87 - | PrivateDelete -> 88 - | PrivateNotInClass -> 89 - | PropertyAfterRestElement -> 90 - | Redeclaration _ -> 91 - | SetterArity -> 92 - | SetterMayNotHaveThisParam -> 93 - | StrictCatchVariable -> 94 - | StrictDelete -> 95 - | StrictDuplicateProperty -> 96 - | StrictFunctionName -> 97 - | StrictLHSAssignment -> 98 - | StrictLHSPostfix -> 99 - | StrictLHSPrefix -> 100 - | StrictModeWith -> 101 - | StrictNonOctalLiteral -> 102 - | StrictOctalLiteral -> 103 - | StrictParamDupe -> 104 - | StrictParamName -> 105 - | StrictParamNotSimple -> 106 - | StrictReservedWord -> 107 - | StrictVarName -> 108 - | SuperPrivate -> 109 - | TSAbstractClass -> 110 - | TSClassVisibility _ -> 111 - | TSTemplateLiteralType -> 112 - | ThisParamAnnotationRequired -> 113 - | ThisParamBannedInArrowFunctions -> 114 - | ThisParamBannedInConstructor -> 115 - | ThisParamMayNotBeOptional -> 116 - | ThisParamMustBeFirst -> 117 - | TrailingCommaAfterRestElement -> 118 - | UnboundPrivate _ -> 119 - | Unexpected _ -> 120 - | UnexpectedEOS -> 121 - | UnexpectedExplicitInexactInObject -> 122 - | UnexpectedOpaqueTypeAlias -> 123 - | UnexpectedProto -> 124 - | UnexpectedReserved -> 125 - | UnexpectedReservedType -> 126 - | UnexpectedSpreadType -> 127 - | UnexpectedStatic -> 128 - | UnexpectedSuper -> 129 - | UnexpectedSuperCall -> 130 - | UnexpectedTokenWithSuggestion _ -> 131 - | UnexpectedTypeAlias -> 132 - | UnexpectedTypeAnnotation -> 133 - | UnexpectedTypeDeclaration -> 134 - | UnexpectedTypeExport -> 135 - | UnexpectedTypeImport -> 136 - | UnexpectedTypeInterface -> 137 - | UnexpectedVariance -> 138 - | UnexpectedWithExpected _ -> 139 - | UnknownLabel _ -> 140 - | UnsupportedDecorator -> 141 - | UnterminatedRegExp -> 142 - | WhitespaceInPrivateName -> 143 - | YieldAsIdentifierReference -> 144 - | YieldInFormalParameters -> 145 in - Stdlib.compare (to_int lhs) (to_int rhs)) - [@ocaml.warning "-A"])[@@ocaml.warning "-39"] + fun lhs rhs -> + match (lhs, rhs) with + | (AccessorDataProperty, AccessorDataProperty) -> 0 + | (AccessorGetSet, AccessorGetSet) -> 0 + | (AdjacentJSXElements, AdjacentJSXElements) -> 0 + | (AmbiguousLetBracket, AmbiguousLetBracket) -> 0 + | (AsyncFunctionAsStatement, AsyncFunctionAsStatement) -> 0 + | (AwaitAsIdentifierReference, AwaitAsIdentifierReference) -> 0 + | (AwaitInAsyncFormalParameters, AwaitInAsyncFormalParameters) + -> 0 + | (ComputedShorthandProperty, ComputedShorthandProperty) -> 0 + | (ConstructorCannotBeAccessor, ConstructorCannotBeAccessor) -> + 0 + | (ConstructorCannotBeAsync, ConstructorCannotBeAsync) -> 0 + | (ConstructorCannotBeGenerator, ConstructorCannotBeGenerator) + -> 0 + | (DeclareAsync, DeclareAsync) -> 0 + | (DeclareClassElement, DeclareClassElement) -> 0 + | (DeclareClassFieldInitializer, DeclareClassFieldInitializer) + -> 0 + | (DeclareOpaqueTypeInitializer, DeclareOpaqueTypeInitializer) + -> 0 + | (DuplicateConstructor, DuplicateConstructor) -> 0 + | (DuplicateExport lhs0, DuplicateExport rhs0) -> + (__0 ()) lhs0 rhs0 + | (DuplicatePrivateFields lhs0, DuplicatePrivateFields rhs0) -> + (__1 ()) lhs0 rhs0 + | (ElementAfterRestElement, ElementAfterRestElement) -> 0 + | (EnumBigIntMemberNotInitialized + { enum_name = lhsenum_name; member_name = lhsmember_name }, + EnumBigIntMemberNotInitialized + { enum_name = rhsenum_name; member_name = rhsmember_name }) + -> + (match (__2 ()) lhsenum_name rhsenum_name with + | 0 -> (__3 ()) lhsmember_name rhsmember_name + | x -> x) + | (EnumBooleanMemberNotInitialized + { enum_name = lhsenum_name; member_name = lhsmember_name }, + EnumBooleanMemberNotInitialized + { enum_name = rhsenum_name; member_name = rhsmember_name }) + -> + (match (__4 ()) lhsenum_name rhsenum_name with + | 0 -> (__5 ()) lhsmember_name rhsmember_name + | x -> x) + | (EnumDuplicateMemberName + { enum_name = lhsenum_name; member_name = lhsmember_name }, + EnumDuplicateMemberName + { enum_name = rhsenum_name; member_name = rhsmember_name }) + -> + (match (__6 ()) lhsenum_name rhsenum_name with + | 0 -> (__7 ()) lhsmember_name rhsmember_name + | x -> x) + | (EnumInconsistentMemberValues { enum_name = lhsenum_name }, + EnumInconsistentMemberValues { enum_name = rhsenum_name }) + -> (__8 ()) lhsenum_name rhsenum_name + | (EnumInvalidEllipsis { trailing_comma = lhstrailing_comma }, + EnumInvalidEllipsis { trailing_comma = rhstrailing_comma }) + -> (__9 ()) lhstrailing_comma rhstrailing_comma + | (EnumInvalidExplicitType + { enum_name = lhsenum_name; supplied_type = lhssupplied_type + }, + EnumInvalidExplicitType + { enum_name = rhsenum_name; supplied_type = rhssupplied_type + }) + -> + (match (__10 ()) lhsenum_name rhsenum_name with + | 0 -> + ((fun x y -> + match (x, y) with + | (None, None) -> 0 + | (Some a, Some b) -> (__11 ()) a b + | (None, Some _) -> (-1) + | (Some _, None) -> 1)) lhssupplied_type + rhssupplied_type + | x -> x) + | (EnumInvalidExport, EnumInvalidExport) -> 0 + | (EnumInvalidInitializerSeparator + { member_name = lhsmember_name }, + EnumInvalidInitializerSeparator + { member_name = rhsmember_name }) -> + (__12 ()) lhsmember_name rhsmember_name + | (EnumInvalidMemberInitializer + { enum_name = lhsenum_name; + explicit_type = lhsexplicit_type; + member_name = lhsmember_name }, + EnumInvalidMemberInitializer + { enum_name = rhsenum_name; + explicit_type = rhsexplicit_type; + member_name = rhsmember_name }) + -> + (match (__13 ()) lhsenum_name rhsenum_name with + | 0 -> + (match (fun x y -> + match (x, y) with + | (None, None) -> 0 + | (Some a, Some b) -> __14 a b + | (None, Some _) -> (-1) + | (Some _, None) -> 1) lhsexplicit_type + rhsexplicit_type + with + | 0 -> (__15 ()) lhsmember_name rhsmember_name + | x -> x) + | x -> x) + | (EnumInvalidMemberName + { enum_name = lhsenum_name; member_name = lhsmember_name }, + EnumInvalidMemberName + { enum_name = rhsenum_name; member_name = rhsmember_name }) + -> + (match (__16 ()) lhsenum_name rhsenum_name with + | 0 -> (__17 ()) lhsmember_name rhsmember_name + | x -> x) + | (EnumInvalidMemberSeparator, EnumInvalidMemberSeparator) -> 0 + | (EnumNumberMemberNotInitialized + { enum_name = lhsenum_name; member_name = lhsmember_name }, + EnumNumberMemberNotInitialized + { enum_name = rhsenum_name; member_name = rhsmember_name }) + -> + (match (__18 ()) lhsenum_name rhsenum_name with + | 0 -> (__19 ()) lhsmember_name rhsmember_name + | x -> x) + | (EnumStringMemberInconsistentlyInitialized + { enum_name = lhsenum_name }, + EnumStringMemberInconsistentlyInitialized + { enum_name = rhsenum_name }) -> + (__20 ()) lhsenum_name rhsenum_name + | (EnumInvalidConstPrefix, EnumInvalidConstPrefix) -> 0 + | (ExpectedJSXClosingTag lhs0, ExpectedJSXClosingTag rhs0) -> + (__21 ()) lhs0 rhs0 + | (ExpectedPatternFoundExpression, + ExpectedPatternFoundExpression) -> 0 + | (ExportSpecifierMissingComma, ExportSpecifierMissingComma) -> + 0 + | (FunctionAsStatement { in_strict_mode = lhsin_strict_mode }, + FunctionAsStatement { in_strict_mode = rhsin_strict_mode }) + -> (__22 ()) lhsin_strict_mode rhsin_strict_mode + | (GeneratorFunctionAsStatement, GeneratorFunctionAsStatement) + -> 0 + | (GetterArity, GetterArity) -> 0 + | (GetterMayNotHaveThisParam, GetterMayNotHaveThisParam) -> 0 + | (IllegalBreak, IllegalBreak) -> 0 + | (IllegalContinue, IllegalContinue) -> 0 + | (IllegalReturn, IllegalReturn) -> 0 + | (IllegalUnicodeEscape, IllegalUnicodeEscape) -> 0 + | (ImportSpecifierMissingComma, ImportSpecifierMissingComma) -> + 0 + | (ImportTypeShorthandOnlyInPureImport, + ImportTypeShorthandOnlyInPureImport) -> 0 + | (InexactInsideExact, InexactInsideExact) -> 0 + | (InexactInsideNonObject, InexactInsideNonObject) -> 0 + | (InvalidClassMemberName + { name = lhsname; static = lhsstatic; method_ = lhsmethod_; + private_ = lhsprivate_ }, + InvalidClassMemberName + { name = rhsname; static = rhsstatic; method_ = rhsmethod_; + private_ = rhsprivate_ }) + -> + (match (__23 ()) lhsname rhsname with + | 0 -> + (match (__24 ()) lhsstatic rhsstatic with + | 0 -> + (match (__25 ()) lhsmethod_ rhsmethod_ with + | 0 -> (__26 ()) lhsprivate_ rhsprivate_ + | x -> x) + | x -> x) + | x -> x) + | (InvalidComponentParamName, InvalidComponentParamName) -> 0 + | (InvalidComponentRenderAnnotation + { has_nested_render = lhshas_nested_render }, + InvalidComponentRenderAnnotation + { has_nested_render = rhshas_nested_render }) -> + (__27 ()) lhshas_nested_render rhshas_nested_render + | (InvalidComponentStringParameterBinding + { optional = lhsoptional; name = lhsname }, + InvalidComponentStringParameterBinding + { optional = rhsoptional; name = rhsname }) -> + (match (__28 ()) lhsoptional rhsoptional with + | 0 -> (__29 ()) lhsname rhsname + | x -> x) + | (InvalidFloatBigInt, InvalidFloatBigInt) -> 0 + | (InvalidIndexedAccess { has_bracket = lhshas_bracket }, + InvalidIndexedAccess { has_bracket = rhshas_bracket }) -> + (__30 ()) lhshas_bracket rhshas_bracket + | (InvalidJSXAttributeValue, InvalidJSXAttributeValue) -> 0 + | (InvalidLHSInAssignment, InvalidLHSInAssignment) -> 0 + | (InvalidLHSInExponentiation, InvalidLHSInExponentiation) -> 0 + | (InvalidLHSInForIn, InvalidLHSInForIn) -> 0 + | (InvalidLHSInForOf, InvalidLHSInForOf) -> 0 + | (InvalidOptionalIndexedAccess, InvalidOptionalIndexedAccess) + -> 0 + | (InvalidRegExp, InvalidRegExp) -> 0 + | (InvalidRegExpFlags lhs0, InvalidRegExpFlags rhs0) -> + (__31 ()) lhs0 rhs0 + | (InvalidSciBigInt, InvalidSciBigInt) -> 0 + | (InvalidTupleOptionalSpread, InvalidTupleOptionalSpread) -> 0 + | (InvalidTupleVariance, InvalidTupleVariance) -> 0 + | (InvalidTypeof, InvalidTypeof) -> 0 + | (JSXAttributeValueEmptyExpression, + JSXAttributeValueEmptyExpression) -> 0 + | (LiteralShorthandProperty, LiteralShorthandProperty) -> 0 + | (MalformedUnicode, MalformedUnicode) -> 0 + | (MatchNonLastRest lhs0, MatchNonLastRest rhs0) -> + ((fun lhs rhs -> + match (lhs, rhs) with + | (`Object, `Object) -> 0 + | (`Array, `Array) -> 0 + | _ -> + let to_int = function | `Object -> 0 | `Array -> 1 in + Stdlib.compare (to_int lhs) + (to_int rhs))) lhs0 rhs0 + | (MatchEmptyArgument, MatchEmptyArgument) -> 0 + | (MatchSpreadArgument, MatchSpreadArgument) -> 0 + | (MethodInDestructuring, MethodInDestructuring) -> 0 + | (MissingJSXClosingTag lhs0, MissingJSXClosingTag rhs0) -> + (__32 ()) lhs0 rhs0 + | (MissingTypeParam, MissingTypeParam) -> 0 + | (MissingTypeParamDefault, MissingTypeParamDefault) -> 0 + | (MultipleDefaultsInSwitch, MultipleDefaultsInSwitch) -> 0 + | (NewlineAfterThrow, NewlineAfterThrow) -> 0 + | (NewlineBeforeArrow, NewlineBeforeArrow) -> 0 + | (NoCatchOrFinally, NoCatchOrFinally) -> 0 + | (NoUninitializedConst, NoUninitializedConst) -> 0 + | (NoUninitializedDestructuring, NoUninitializedDestructuring) + -> 0 + | (NullishCoalescingUnexpectedLogical lhs0, + NullishCoalescingUnexpectedLogical rhs0) -> + (__33 ()) lhs0 rhs0 + | (OptionalChainNew, OptionalChainNew) -> 0 + | (OptionalChainTemplate, OptionalChainTemplate) -> 0 + | (ParameterAfterRestParameter, ParameterAfterRestParameter) -> + 0 + | (PrivateDelete, PrivateDelete) -> 0 + | (PrivateNotInClass, PrivateNotInClass) -> 0 + | (PropertyAfterRestElement, PropertyAfterRestElement) -> 0 + | (Redeclaration (lhs0, lhs1), Redeclaration (rhs0, rhs1)) -> + (match (__34 ()) lhs0 rhs0 with + | 0 -> (__35 ()) lhs1 rhs1 + | x -> x) + | (SetterArity, SetterArity) -> 0 + | (SetterMayNotHaveThisParam, SetterMayNotHaveThisParam) -> 0 + | (StrictCatchVariable, StrictCatchVariable) -> 0 + | (StrictDelete, StrictDelete) -> 0 + | (StrictDuplicateProperty, StrictDuplicateProperty) -> 0 + | (StrictFunctionName, StrictFunctionName) -> 0 + | (StrictLHSAssignment, StrictLHSAssignment) -> 0 + | (StrictLHSPostfix, StrictLHSPostfix) -> 0 + | (StrictLHSPrefix, StrictLHSPrefix) -> 0 + | (StrictModeWith, StrictModeWith) -> 0 + | (StrictNonOctalLiteral, StrictNonOctalLiteral) -> 0 + | (StrictOctalLiteral, StrictOctalLiteral) -> 0 + | (StrictParamDupe, StrictParamDupe) -> 0 + | (StrictParamName, StrictParamName) -> 0 + | (StrictParamNotSimple, StrictParamNotSimple) -> 0 + | (StrictReservedWord, StrictReservedWord) -> 0 + | (StrictVarName, StrictVarName) -> 0 + | (SuperPrivate, SuperPrivate) -> 0 + | (TSAbstractClass, TSAbstractClass) -> 0 + | (TSClassVisibility lhs0, TSClassVisibility rhs0) -> + ((fun lhs rhs -> + match (lhs, rhs) with + | (`Public, `Public) -> 0 + | (`Private, `Private) -> 0 + | (`Protected, `Protected) -> 0 + | _ -> + let to_int = + function + | `Public -> 0 + | `Private -> 1 + | `Protected -> 2 in + Stdlib.compare (to_int lhs) + (to_int rhs))) lhs0 rhs0 + | (TSTemplateLiteralType, TSTemplateLiteralType) -> 0 + | (ThisParamAnnotationRequired, ThisParamAnnotationRequired) -> + 0 + | (ThisParamBannedInArrowFunctions, + ThisParamBannedInArrowFunctions) -> 0 + | (ThisParamBannedInConstructor, ThisParamBannedInConstructor) + -> 0 + | (ThisParamMayNotBeOptional, ThisParamMayNotBeOptional) -> 0 + | (ThisParamMustBeFirst, ThisParamMustBeFirst) -> 0 + | (TrailingCommaAfterRestElement, + TrailingCommaAfterRestElement) -> 0 + | (UnboundPrivate lhs0, UnboundPrivate rhs0) -> + (__36 ()) lhs0 rhs0 + | (Unexpected lhs0, Unexpected rhs0) -> (__37 ()) lhs0 rhs0 + | (UnexpectedEOS, UnexpectedEOS) -> 0 + | (UnexpectedExplicitInexactInObject, + UnexpectedExplicitInexactInObject) -> 0 + | (UnexpectedOpaqueTypeAlias, UnexpectedOpaqueTypeAlias) -> 0 + | (UnexpectedProto, UnexpectedProto) -> 0 + | (UnexpectedReserved, UnexpectedReserved) -> 0 + | (UnexpectedReservedType, UnexpectedReservedType) -> 0 + | (UnexpectedSpreadType, UnexpectedSpreadType) -> 0 + | (UnexpectedStatic, UnexpectedStatic) -> 0 + | (UnexpectedSuper, UnexpectedSuper) -> 0 + | (UnexpectedSuperCall, UnexpectedSuperCall) -> 0 + | (UnexpectedTokenWithSuggestion (lhs0, lhs1), + UnexpectedTokenWithSuggestion (rhs0, rhs1)) -> + (match (__38 ()) lhs0 rhs0 with + | 0 -> (__39 ()) lhs1 rhs1 + | x -> x) + | (UnexpectedTypeAlias, UnexpectedTypeAlias) -> 0 + | (UnexpectedTypeAnnotation, UnexpectedTypeAnnotation) -> 0 + | (UnexpectedTypeDeclaration, UnexpectedTypeDeclaration) -> 0 + | (UnexpectedTypeExport, UnexpectedTypeExport) -> 0 + | (UnexpectedTypeImport, UnexpectedTypeImport) -> 0 + | (UnexpectedTypeInterface, UnexpectedTypeInterface) -> 0 + | (UnexpectedVariance, UnexpectedVariance) -> 0 + | (UnexpectedWithExpected (lhs0, lhs1), UnexpectedWithExpected + (rhs0, rhs1)) -> + (match (__40 ()) lhs0 rhs0 with + | 0 -> (__41 ()) lhs1 rhs1 + | x -> x) + | (UnknownLabel lhs0, UnknownLabel rhs0) -> (__42 ()) lhs0 rhs0 + | (UnsupportedDecorator, UnsupportedDecorator) -> 0 + | (UnterminatedRegExp, UnterminatedRegExp) -> 0 + | (WhitespaceInPrivateName, WhitespaceInPrivateName) -> 0 + | (YieldAsIdentifierReference, YieldAsIdentifierReference) -> 0 + | (YieldInFormalParameters, YieldInFormalParameters) -> 0 + | _ -> + let to_int = + function + | AccessorDataProperty -> 0 + | AccessorGetSet -> 1 + | AdjacentJSXElements -> 2 + | AmbiguousLetBracket -> 3 + | AsyncFunctionAsStatement -> 4 + | AwaitAsIdentifierReference -> 5 + | AwaitInAsyncFormalParameters -> 6 + | ComputedShorthandProperty -> 7 + | ConstructorCannotBeAccessor -> 8 + | ConstructorCannotBeAsync -> 9 + | ConstructorCannotBeGenerator -> 10 + | DeclareAsync -> 11 + | DeclareClassElement -> 12 + | DeclareClassFieldInitializer -> 13 + | DeclareOpaqueTypeInitializer -> 14 + | DuplicateConstructor -> 15 + | DuplicateExport _ -> 16 + | DuplicatePrivateFields _ -> 17 + | ElementAfterRestElement -> 18 + | EnumBigIntMemberNotInitialized _ -> 19 + | EnumBooleanMemberNotInitialized _ -> 20 + | EnumDuplicateMemberName _ -> 21 + | EnumInconsistentMemberValues _ -> 22 + | EnumInvalidEllipsis _ -> 23 + | EnumInvalidExplicitType _ -> 24 + | EnumInvalidExport -> 25 + | EnumInvalidInitializerSeparator _ -> 26 + | EnumInvalidMemberInitializer _ -> 27 + | EnumInvalidMemberName _ -> 28 + | EnumInvalidMemberSeparator -> 29 + | EnumNumberMemberNotInitialized _ -> 30 + | EnumStringMemberInconsistentlyInitialized _ -> 31 + | EnumInvalidConstPrefix -> 32 + | ExpectedJSXClosingTag _ -> 33 + | ExpectedPatternFoundExpression -> 34 + | ExportSpecifierMissingComma -> 35 + | FunctionAsStatement _ -> 36 + | GeneratorFunctionAsStatement -> 37 + | GetterArity -> 38 + | GetterMayNotHaveThisParam -> 39 + | IllegalBreak -> 40 + | IllegalContinue -> 41 + | IllegalReturn -> 42 + | IllegalUnicodeEscape -> 43 + | ImportSpecifierMissingComma -> 44 + | ImportTypeShorthandOnlyInPureImport -> 45 + | InexactInsideExact -> 46 + | InexactInsideNonObject -> 47 + | InvalidClassMemberName _ -> 48 + | InvalidComponentParamName -> 49 + | InvalidComponentRenderAnnotation _ -> 50 + | InvalidComponentStringParameterBinding _ -> 51 + | InvalidFloatBigInt -> 52 + | InvalidIndexedAccess _ -> 53 + | InvalidJSXAttributeValue -> 54 + | InvalidLHSInAssignment -> 55 + | InvalidLHSInExponentiation -> 56 + | InvalidLHSInForIn -> 57 + | InvalidLHSInForOf -> 58 + | InvalidOptionalIndexedAccess -> 59 + | InvalidRegExp -> 60 + | InvalidRegExpFlags _ -> 61 + | InvalidSciBigInt -> 62 + | InvalidTupleOptionalSpread -> 63 + | InvalidTupleVariance -> 64 + | InvalidTypeof -> 65 + | JSXAttributeValueEmptyExpression -> 66 + | LiteralShorthandProperty -> 67 + | MalformedUnicode -> 68 + | MatchNonLastRest _ -> 69 + | MatchEmptyArgument -> 70 + | MatchSpreadArgument -> 71 + | MethodInDestructuring -> 72 + | MissingJSXClosingTag _ -> 73 + | MissingTypeParam -> 74 + | MissingTypeParamDefault -> 75 + | MultipleDefaultsInSwitch -> 76 + | NewlineAfterThrow -> 77 + | NewlineBeforeArrow -> 78 + | NoCatchOrFinally -> 79 + | NoUninitializedConst -> 80 + | NoUninitializedDestructuring -> 81 + | NullishCoalescingUnexpectedLogical _ -> 82 + | OptionalChainNew -> 83 + | OptionalChainTemplate -> 84 + | ParameterAfterRestParameter -> 85 + | PrivateDelete -> 86 + | PrivateNotInClass -> 87 + | PropertyAfterRestElement -> 88 + | Redeclaration _ -> 89 + | SetterArity -> 90 + | SetterMayNotHaveThisParam -> 91 + | StrictCatchVariable -> 92 + | StrictDelete -> 93 + | StrictDuplicateProperty -> 94 + | StrictFunctionName -> 95 + | StrictLHSAssignment -> 96 + | StrictLHSPostfix -> 97 + | StrictLHSPrefix -> 98 + | StrictModeWith -> 99 + | StrictNonOctalLiteral -> 100 + | StrictOctalLiteral -> 101 + | StrictParamDupe -> 102 + | StrictParamName -> 103 + | StrictParamNotSimple -> 104 + | StrictReservedWord -> 105 + | StrictVarName -> 106 + | SuperPrivate -> 107 + | TSAbstractClass -> 108 + | TSClassVisibility _ -> 109 + | TSTemplateLiteralType -> 110 + | ThisParamAnnotationRequired -> 111 + | ThisParamBannedInArrowFunctions -> 112 + | ThisParamBannedInConstructor -> 113 + | ThisParamMayNotBeOptional -> 114 + | ThisParamMustBeFirst -> 115 + | TrailingCommaAfterRestElement -> 116 + | UnboundPrivate _ -> 117 + | Unexpected _ -> 118 + | UnexpectedEOS -> 119 + | UnexpectedExplicitInexactInObject -> 120 + | UnexpectedOpaqueTypeAlias -> 121 + | UnexpectedProto -> 122 + | UnexpectedReserved -> 123 + | UnexpectedReservedType -> 124 + | UnexpectedSpreadType -> 125 + | UnexpectedStatic -> 126 + | UnexpectedSuper -> 127 + | UnexpectedSuperCall -> 128 + | UnexpectedTokenWithSuggestion _ -> 129 + | UnexpectedTypeAlias -> 130 + | UnexpectedTypeAnnotation -> 131 + | UnexpectedTypeDeclaration -> 132 + | UnexpectedTypeExport -> 133 + | UnexpectedTypeImport -> 134 + | UnexpectedTypeInterface -> 135 + | UnexpectedVariance -> 136 + | UnexpectedWithExpected _ -> 137 + | UnknownLabel _ -> 138 + | UnsupportedDecorator -> 139 + | UnterminatedRegExp -> 140 + | WhitespaceInPrivateName -> 141 + | YieldAsIdentifierReference -> 142 + | YieldInFormalParameters -> 143 in + Stdlib.compare (to_int lhs) (to_int rhs)) + [@ocaml.warning "-A"] + [@ocaml.warning "-39"])[@@ocaml.warning "-39"] exception Error of (Loc.t * t) * (Loc.t * t) list let error loc e = raise (Error ((loc, e), [])) module PP = @@ -676,10 +702,6 @@ module PP = "Object literal may not have multiple get/set accessors with the same name" | AdjacentJSXElements -> "Unexpected token <. Remember, adjacent JSX elements must be wrapped in an enclosing parent tag" - | AmbiguousDeclareModuleKind -> - "Found both `declare module.exports` and `declare export` in the same module. " - ^ - "Modules can only have 1 since they are either an ES module xor they are a CommonJS module." | AmbiguousLetBracket -> "`let [` is ambiguous in this position because it is either a `let` binding pattern, or a member expression." | AsyncFunctionAsStatement -> @@ -700,15 +722,9 @@ module PP = "`declare` modifier can only appear on class fields." | DeclareClassFieldInitializer -> "Unexpected token `=`. Initializers are not allowed in a `declare`." - | DeclareExportInterface -> - "`declare export interface` is not supported. Use `export interface` instead." - | DeclareExportType -> - "`declare export type` is not supported. Use `export type` instead." | DeclareOpaqueTypeInitializer -> "Unexpected token `=`. Initializers are not allowed in a `declare opaque type`." | DuplicateConstructor -> "Classes may only have one constructor" - | DuplicateDeclareModuleExports -> - "Duplicate `declare module.exports` statement!" | DuplicateExport export -> Printf.sprintf "Duplicate export for `%s`" export | DuplicatePrivateFields name -> @@ -835,7 +851,7 @@ module PP = static_modifier category name | InvalidComponentParamName -> "Component params must be an identifier. If you'd like to destructure, you should use `name as {destructure}`" - | InvalidComponentRenderAnnotation -> + | InvalidComponentRenderAnnotation _ -> "Components use `renders` instead of `:` to annotate the render type of a component." | InvalidComponentStringParameterBinding { optional; name } -> let camelized_name = Parse_error_utils.camelize name in @@ -857,8 +873,6 @@ module PP = "Invalid left-hand side in exponentiation expression" | InvalidLHSInForIn -> "Invalid left-hand side in for-in" | InvalidLHSInForOf -> "Invalid left-hand side in for-of" - | InvalidNonTypeImportInDeclareModule -> - "Imports within a `declare module` body must always be `import type` or `import typeof`!" | InvalidOptionalIndexedAccess -> "Invalid optional indexed access. Indexed access uses bracket notation. Use the format `T?.[K]`." | InvalidRegExp -> "Invalid regular expression" @@ -878,6 +892,15 @@ module PP = | LiteralShorthandProperty -> "Literals cannot be used as shorthand properties." | MalformedUnicode -> "Malformed unicode" + | MatchNonLastRest kind -> + let kind = + match kind with | `Object -> "object" | `Array -> "array" in + Printf.sprintf + "In match %s pattern, the rest must be the last element in the pattern" + kind + | MatchEmptyArgument -> "`match` argument must not be empty" + | MatchSpreadArgument -> + "`match` argument cannot contain spread elements" | MethodInDestructuring -> "Object pattern can't contain methods" | MissingJSXClosingTag name -> Printf.sprintf "JSX element %s has no corresponding closing tag." diff --git a/jscomp/js_parser/parser_common.ml b/jscomp/js_parser/parser_common.ml index 1669edfe5d..e651749946 100644 --- a/jscomp/js_parser/parser_common.ml +++ b/jscomp/js_parser/parser_common.ml @@ -20,7 +20,7 @@ type pattern_cover = module type PARSER = sig val program : env -> (Loc.t, Loc.t) Program.t - val statement : env -> (Loc.t, Loc.t) Statement.t + val statement : ?allow_sequence:bool -> env -> (Loc.t, Loc.t) Statement.t val statement_list_item : ?decorators:(Loc.t, Loc.t) Class.Decorator.t list -> env -> (Loc.t, Loc.t) Statement.t @@ -75,6 +75,240 @@ module type PARSER = sig val annot : env -> (Loc.t, Loc.t) Type.annotation val bigint : env -> Token.bigint_type -> string -> int64 option + + val match_pattern : env -> (Loc.t, Loc.t) MatchPattern.t +end + +module type TYPE = sig + val _type : env -> (Loc.t, Loc.t) Type.t + + val type_identifier : env -> (Loc.t, Loc.t) Identifier.t + + val type_params : env -> (Loc.t, Loc.t) Type.TypeParams.t option + + val type_args : env -> (Loc.t, Loc.t) Type.TypeArgs.t option + + val generic : env -> Loc.t * (Loc.t, Loc.t) Type.Generic.t + + val _object : is_class:bool -> env -> Loc.t * (Loc.t, Loc.t) Type.Object.t + + val interface_helper : + env -> (Loc.t * (Loc.t, Loc.t) Type.Generic.t) list * (Loc.t * (Loc.t, Loc.t) Type.Object.t) + + val function_param_list : env -> (Loc.t, Loc.t) Type.Function.Params.t + + val component_param_list : env -> (Loc.t, Loc.t) Type.Component.Params.t + + val annotation : env -> (Loc.t, Loc.t) Type.annotation + + val annotation_opt : env -> (Loc.t, Loc.t) Type.annotation_or_hint + + val renders_annotation_opt : env -> (Loc.t, Loc.t) Type.component_renders_annotation + + val function_return_annotation_opt : env -> (Loc.t, Loc.t) Function.ReturnAnnot.t + + val predicate_opt : env -> (Loc.t, Loc.t) Type.Predicate.t option + + val function_return_annotation_and_predicate_opt : + env -> (Loc.t, Loc.t) Function.ReturnAnnot.t * (Loc.t, Loc.t) Type.Predicate.t option + + val type_guard : env -> (Loc.t, Loc.t) Type.TypeGuard.t +end + +module type COVER = sig + val as_expression : env -> pattern_cover -> (Loc.t, Loc.t) Expression.t + + val as_pattern : ?err:Parse_error.t -> env -> pattern_cover -> (Loc.t, Loc.t) Pattern.t + + val empty_errors : pattern_errors + + val cons_error : Loc.t * Parse_error.t -> pattern_errors -> pattern_errors + + val rev_append_errors : pattern_errors -> pattern_errors -> pattern_errors + + val rev_errors : pattern_errors -> pattern_errors +end + +module type PATTERN = sig + val from_expr : Parser_env.env -> (Loc.t, Loc.t) Expression.t -> (Loc.t, Loc.t) Pattern.t + + val pattern : Parser_env.env -> Parse_error.t -> (Loc.t, Loc.t) Pattern.t +end + +module type OBJECT = sig + val key : ?class_body:bool -> env -> Loc.t * (Loc.t, Loc.t) Expression.Object.Property.key + + val _initializer : env -> Loc.t * (Loc.t, Loc.t) Expression.Object.t * pattern_errors + + val class_declaration : env -> (Loc.t, Loc.t) Class.Decorator.t list -> (Loc.t, Loc.t) Statement.t + + val class_expression : env -> (Loc.t, Loc.t) Expression.t + + val class_implements : env -> attach_leading:bool -> (Loc.t, Loc.t) Class.Implements.t + + val decorator_list : env -> (Loc.t, Loc.t) Class.Decorator.t list +end + +module type JSX = sig + val element_or_fragment : + parent_opening_name:(Loc.t, Loc.t) JSX.name option -> + env -> + Loc.t * [ `Element of (Loc.t, Loc.t) JSX.element | `Fragment of (Loc.t, Loc.t) JSX.fragment ] +end + +module type EXPRESSION = sig + val arguments : env -> (Loc.t, Loc.t) Expression.ArgList.t + + val assignment : env -> (Loc.t, Loc.t) Expression.t + + val assignment_cover : env -> pattern_cover + + val conditional : env -> (Loc.t, Loc.t) Expression.t + + val is_assignable_lhs : (Loc.t, Loc.t) Expression.t -> bool + + val left_hand_side : env -> (Loc.t, Loc.t) Expression.t + + val number : env -> Token.number_type -> string -> float + + val bigint : env -> Token.bigint_type -> string -> int64 option + + val sequence : + env -> start_loc:Loc.t -> (Loc.t, Loc.t) Expression.t list -> (Loc.t, Loc.t) Expression.t + + val call_type_args : env -> (Loc.t, Loc.t) Expression.CallTypeArgs.t option + + val call_cover : + ?allow_optional_chain:bool -> + ?in_optional_chain:bool -> + env -> + Loc.t -> + pattern_cover -> + pattern_cover +end + +module type STATEMENT = sig + val for_ : env -> (Loc.t, Loc.t) Statement.t + + val if_ : env -> (Loc.t, Loc.t) Statement.t + + val let_ : env -> (Loc.t, Loc.t) Statement.t + + val try_ : env -> (Loc.t, Loc.t) Statement.t + + val while_ : env -> (Loc.t, Loc.t) Statement.t + + val with_ : env -> (Loc.t, Loc.t) Statement.t + + val block : env -> (Loc.t, Loc.t) Statement.t + + val break : env -> (Loc.t, Loc.t) Statement.t + + val continue : env -> (Loc.t, Loc.t) Statement.t + + val debugger : env -> (Loc.t, Loc.t) Statement.t + + val declare : ?in_module_or_namespace:bool -> env -> (Loc.t, Loc.t) Statement.t + + val declare_export_declaration : env -> (Loc.t, Loc.t) Statement.t + + val declare_opaque_type : env -> (Loc.t, Loc.t) Statement.t + + val do_while : env -> (Loc.t, Loc.t) Statement.t + + val empty : env -> (Loc.t, Loc.t) Statement.t + + val export_declaration : + decorators:(Loc.t, Loc.t) Class.Decorator.t list -> env -> (Loc.t, Loc.t) Statement.t + + val expression : ?allow_sequence:bool -> env -> (Loc.t, Loc.t) Statement.t + + val import_declaration : env -> (Loc.t, Loc.t) Statement.t + + val interface : env -> (Loc.t, Loc.t) Statement.t + + val match_statement : env -> (Loc.t, Loc.t) Statement.t + + val maybe_labeled : env -> (Loc.t, Loc.t) Statement.t + + val opaque_type : env -> (Loc.t, Loc.t) Statement.t + + val return : env -> (Loc.t, Loc.t) Statement.t + + val switch : env -> (Loc.t, Loc.t) Statement.t + + val throw : env -> (Loc.t, Loc.t) Statement.t + + val type_alias : env -> (Loc.t, Loc.t) Statement.t + + val var : env -> (Loc.t, Loc.t) Statement.t + + val const : env -> (Loc.t, Loc.t) Statement.t +end + +module type DECLARATION = sig + val async : env -> bool * Loc.t Comment.t list + + val generator : env -> bool * Loc.t Comment.t list + + val variance : env -> parse_readonly:bool -> bool -> bool -> Loc.t Variance.t option + + val function_params : await:bool -> yield:bool -> env -> (Loc.t, Loc.t) Function.Params.t + + val function_body : + env -> + async:bool -> + generator:bool -> + expression:bool -> + simple_params:bool -> + (Loc.t, Loc.t) Function.body * bool + + val check_unique_formal_parameters : env -> (Loc.t, Loc.t) Function.Params.t -> unit + + val check_unique_component_formal_parameters : + env -> (Loc.t, Loc.t) Statement.ComponentDeclaration.Params.t -> unit + + val strict_function_post_check : + env -> + contains_use_strict:bool -> + (Loc.t, Loc.t) Identifier.t option -> + (Loc.t, Loc.t) Function.Params.t -> + unit + + val strict_component_post_check : + env -> + contains_use_strict:bool -> + (Loc.t, Loc.t) Identifier.t -> + (Loc.t, Loc.t) Statement.ComponentDeclaration.Params.t -> + unit + + val let_ : + env -> + (Loc.t, Loc.t) Statement.VariableDeclaration.Declarator.t list + * Loc.t Comment.t list + * (Loc.t * Parse_error.t) list + + val const : + env -> + (Loc.t, Loc.t) Statement.VariableDeclaration.Declarator.t list + * Loc.t Comment.t list + * (Loc.t * Parse_error.t) list + + val var : + env -> + (Loc.t, Loc.t) Statement.VariableDeclaration.Declarator.t list + * Loc.t Comment.t list + * (Loc.t * Parse_error.t) list + + val _function : env -> (Loc.t, Loc.t) Statement.t + + val enum_declaration : ?leading:Loc.t Comment.t list -> env -> (Loc.t, Loc.t) Statement.t + + val component : env -> (Loc.t, Loc.t) Statement.t +end + +module type MATCH_PATTERN = sig + val match_pattern : env -> (Loc.t, Loc.t) MatchPattern.t end let identifier_name_raw env = @@ -135,11 +369,13 @@ let identifier_name_raw env = | T_FALSE -> "false" (* Flow-specific stuff *) | T_ASSERTS -> "asserts" + | T_IMPLIES -> "implies" | T_IS -> "is" | T_DECLARE -> "declare" | T_TYPE -> "type" | T_OPAQUE -> "opaque" | T_ANY_TYPE -> "any" + | T_MATCH -> "match" | T_MIXED_TYPE -> "mixed" | T_EMPTY_TYPE -> "empty" | T_BOOLEAN_TYPE BOOL -> "bool" @@ -276,6 +512,24 @@ let is_start_of_type_guard env = let token_2 = Peek.ith_token ~i:1 env in match (token_1, token_2) with | (T_IDENTIFIER { raw = "asserts"; _ }, (T_IDENTIFIER _ | T_THIS)) + | (T_IDENTIFIER { raw = "implies"; _ }, (T_IDENTIFIER _ | T_THIS)) | ((T_IDENTIFIER _ | T_THIS), (T_IS | T_IDENTIFIER { raw = "is"; _ })) -> true | _ -> false + +let reparse_arguments_as_match_argument env (args_loc, args) = + let { Expression.ArgList.arguments; _ } = args in + if List.is_empty arguments then Parser_env.error_at env (args_loc, Parse_error.MatchEmptyArgument); + let filtered_args = + List.filter_map + (function + | Expression.Spread (loc, _) -> + Parser_env.error_at env (loc, Parse_error.MatchSpreadArgument); + None + | Expression.Expression e -> Some e) + arguments + in + match filtered_args with + | [expr] -> expr + | expressions -> + (args_loc, Expression.Sequence { Expression.Sequence.expressions; comments = None }) diff --git a/jscomp/js_parser/parser_env.ml b/jscomp/js_parser/parser_env.ml index 1eb0146509..bc40743638 100644 --- a/jscomp/js_parser/parser_env.ml +++ b/jscomp/js_parser/parser_env.ml @@ -126,6 +126,7 @@ type token_sink_result = { type parse_options = { components: bool; (* enable parsing of Flow component syntax *) enums: bool; (** enable parsing of Flow enums *) + pattern_matching: bool; esproposal_decorators: bool; (** enable parsing of decorators *) types: bool; (** enable parsing of Flow types *) use_strict: bool; (** treat the file as strict, without needing a "use strict" directive *) @@ -137,6 +138,7 @@ let default_parse_options = { components = false; enums = false; + pattern_matching = false; esproposal_decorators = false; types = true; use_strict = false; @@ -144,6 +146,18 @@ let default_parse_options = module_ref_prefix_LEGACY_INTEROP = None; } +let permissive_parse_options = + { + components = true; + enums = true; + pattern_matching = true; + esproposal_decorators = true; + types = true; + use_strict = false; + module_ref_prefix = None; + module_ref_prefix_LEGACY_INTEROP = None; + } + type allowed_super = | No_super | Super_prop @@ -647,6 +661,7 @@ let is_reserved_type str_val = | "bigint" | "bool" | "boolean" + | "const" | "empty" | "extends" | "false" @@ -677,6 +692,7 @@ let token_is_reserved_type t = | T_ANY_TYPE | T_BIGINT_TYPE | T_BOOLEAN_TYPE _ + | T_CONST | T_EMPTY_TYPE | T_EXTENDS | T_FALSE @@ -758,6 +774,7 @@ let token_is_type_identifier env t = | T_INSTANCEOF | T_INTERFACE | T_LET + | T_MATCH | T_NEW | T_NULL | T_OF @@ -788,6 +805,7 @@ let token_is_type_identifier env t = | T_INFER | T_IS | T_ASSERTS + | T_IMPLIES | T_VOID | T_RENDERS_QUESTION | T_RENDERS_STAR -> @@ -964,6 +982,7 @@ module Peek = struct | T_ASYNC | T_AWAIT | T_ENUM + | T_MATCH | T_POUND | T_IDENTIFIER _ | T_READONLY -> @@ -988,6 +1007,14 @@ module Peek = struct && ith_token ~i:1 env = T_FUNCTION && (loc env)._end.line = (ith_loc ~i:1 env).start.line + let is_hook env = + match token env with + | T_IDENTIFIER { raw = "hook"; _ } -> + (parse_options env).components + && ith_is_identifier ~i:1 env + && (loc env)._end.line = (ith_loc ~i:1 env).start.line + | _ -> false + let is_class env = match token env with | T_CLASS diff --git a/jscomp/js_parser/parser_env.mli b/jscomp/js_parser/parser_env.mli index e54a91f4b1..0286af980c 100644 --- a/jscomp/js_parser/parser_env.mli +++ b/jscomp/js_parser/parser_env.mli @@ -31,6 +31,7 @@ type token_sink_result = { type parse_options = { components: bool; (* enable parsing of Flow component syntax *) enums: bool; (** enable parsing of Flow enums *) + pattern_matching: bool; esproposal_decorators: bool; (** enable parsing of decorators *) types: bool; (** enable parsing of Flow types *) use_strict: bool; (** treat the file as strict, without needing a "use strict" directive *) @@ -40,6 +41,8 @@ type parse_options = { val default_parse_options : parse_options +val permissive_parse_options : parse_options + type env type allowed_super = @@ -228,6 +231,8 @@ module Peek : sig val is_function : env -> bool + val is_hook : env -> bool + val is_class : env -> bool val is_component : env -> bool diff --git a/jscomp/js_parser/parser_flow.ml b/jscomp/js_parser/parser_flow.ml index d0b0b91686..ef0b64a868 100644 --- a/jscomp/js_parser/parser_flow.ml +++ b/jscomp/js_parser/parser_flow.ml @@ -92,7 +92,15 @@ let check_for_duplicate_exports = (match specifiers with | ExportSpecifiers specifiers -> List.fold_left - (fun seen (_, { Statement.ExportNamedDeclaration.ExportSpecifier.local; exported }) -> + (fun seen + ( _, + { + Statement.ExportNamedDeclaration.ExportSpecifier.local; + exported; + from_remote = _; + imported_name_def_loc = _; + } + ) -> match exported with | Some exported -> record_export env seen exported | None -> record_export env seen local) @@ -132,12 +140,12 @@ let check_for_duplicate_exports = | ClassDeclaration { Class.id = None; _ } | Continue _ | Debugger _ | DeclareClass _ | DeclareComponent _ | DeclareEnum _ | DeclareExportDeclaration _ | DeclareFunction _ | DeclareInterface _ | DeclareModule _ - | DeclareModuleExports _ | DeclareTypeAlias _ | DeclareOpaqueType _ | DeclareVariable _ - | DoWhile _ | Empty _ | ExportDefaultDeclaration _ | ExportNamedDeclaration _ - | Expression _ | For _ | ForIn _ | ForOf _ + | DeclareModuleExports _ | DeclareNamespace _ | DeclareTypeAlias _ | DeclareOpaqueType _ + | DeclareVariable _ | DoWhile _ | Empty _ | ExportDefaultDeclaration _ + | ExportNamedDeclaration _ | Expression _ | For _ | ForIn _ | ForOf _ | FunctionDeclaration { Function.id = None; _ } - | If _ | ImportDeclaration _ | Labeled _ | Return _ | Switch _ | Throw _ | Try _ - | While _ | With _ )) + | If _ | ImportDeclaration _ | Labeled _ | Match _ | Return _ | Switch _ | Throw _ + | Try _ | While _ | With _ )) ) -> (* these don't export names -- some are invalid, but the AST allows them *) seen) @@ -155,11 +163,11 @@ let check_for_duplicate_exports = Statement.( ( Block _ | Break _ | ClassDeclaration _ | Continue _ | Debugger _ | DeclareClass _ | DeclareComponent _ | DeclareEnum _ | DeclareExportDeclaration _ | DeclareFunction _ - | DeclareInterface _ | DeclareModule _ | DeclareModuleExports _ | DeclareTypeAlias _ - | DeclareOpaqueType _ | DeclareVariable _ | DoWhile _ | Empty _ | EnumDeclaration _ - | Expression _ | For _ | ForIn _ | ForOf _ | FunctionDeclaration _ + | DeclareInterface _ | DeclareModule _ | DeclareModuleExports _ | DeclareNamespace _ + | DeclareTypeAlias _ | DeclareOpaqueType _ | DeclareVariable _ | DoWhile _ | Empty _ + | EnumDeclaration _ | Expression _ | For _ | ForIn _ | ForOf _ | FunctionDeclaration _ | ComponentDeclaration _ | If _ | ImportDeclaration _ | InterfaceDeclaration _ | Labeled _ - | Return _ | Switch _ | Throw _ | Try _ | TypeAlias _ | OpaqueType _ + | Match _ | Return _ | Switch _ | Throw _ | Try _ | TypeAlias _ | OpaqueType _ | VariableDeclaration _ | While _ | With _ )) ) -> seen @@ -170,10 +178,11 @@ module rec Parse : PARSER = struct module Type = Type_parser.Type (Parse) module Declaration = Declaration_parser.Declaration (Parse) (Type) module Pattern_cover = Pattern_cover.Cover (Parse) + module Match_pattern = Match_pattern_parser.Match_pattern (Parse) module Expression = Expression_parser.Expression (Parse) (Type) (Declaration) (Pattern_cover) module Object = Object_parser.Object (Parse) (Type) (Declaration) (Expression) (Pattern_cover) module Statement = - Statement_parser.Statement (Parse) (Type) (Declaration) (Object) (Pattern_cover) + Statement_parser.Statement (Parse) (Type) (Declaration) (Object) (Pattern_cover) (Expression) module Pattern = Pattern_parser.Pattern (Parse) (Type) module JSX = Jsx_parser.JSX (Parse) (Expression) @@ -312,7 +321,7 @@ module rec Parse : PARSER = struct * statements... (see section 13) *) | T_LET -> let_ env | T_CONST -> const env - | _ when Peek.is_function env -> Declaration._function env + | _ when Peek.is_function env || Peek.is_hook env -> Declaration._function env | _ when Peek.is_class env -> class_declaration env decorators | T_INTERFACE -> interface env | T_DECLARE -> declare env @@ -322,8 +331,9 @@ module rec Parse : PARSER = struct | _ when Peek.is_component env -> Declaration.component env | _ -> statement env - and statement env = + and statement ?(allow_sequence = true) env = let open Statement in + let expression = Statement.expression ~allow_sequence in match Peek.token env with | T_EOF -> error_unexpected ~expected:"the start of a statement" env; @@ -339,6 +349,13 @@ module rec Parse : PARSER = struct | T_IF -> if_ env | T_RETURN -> return env | T_SWITCH -> switch env + | T_MATCH + when (parse_options env).pattern_matching + && (not (Peek.ith_is_line_terminator ~i:1 env)) + && Peek.ith_token ~i:1 env = T_LPAREN -> + (match Try.to_parse env Statement.match_statement with + | Try.ParsedSuccessfully m -> m + | Try.FailedToParse -> expression env) | T_THROW -> throw env | T_TRY -> try_ env | T_WHILE -> while_ env @@ -374,7 +391,7 @@ module rec Parse : PARSER = struct (* The rest of these patterns handle ExpressionStatement and its negative lookaheads, which prevent ambiguities. See https://tc39.github.io/ecma262/#sec-expression-statement *) - | _ when Peek.is_function env -> + | _ when Peek.is_function env || Peek.is_hook env -> let func = Declaration._function env in function_as_statement_error_at env (fst func); func @@ -383,14 +400,14 @@ module rec Parse : PARSER = struct member expression, so it is banned. *) let loc = Loc.btwn (Peek.loc env) (Peek.ith_loc ~i:1 env) in error_at env (loc, Parse_error.AmbiguousLetBracket); - Statement.expression env + expression env (* recover as a member expression *) | _ when Peek.is_identifier env -> maybe_labeled env | _ when Peek.is_class env -> error_unexpected env; Eat.token env; - Statement.expression env - | _ -> Statement.expression env + expression env + | _ -> expression env and expression env = let start_loc = Peek.loc env in @@ -497,6 +514,8 @@ module rec Parse : PARSER = struct and pattern = Pattern.pattern and pattern_from_expr = Pattern.from_expr + + and match_pattern = Match_pattern.match_pattern end (*****************************************************************************) @@ -574,3 +593,22 @@ let jsx_pragma_expression = let string_is_valid_identifier_name str = let lexbuf = Sedlexing.Utf8.from_string str in Flow_lexer.is_valid_identifier_name lexbuf + +(** + * Returns the string and location of the first identifier in [input] for which + * [predicate] holds. + *) +let find_ident ~predicate input = + let env = init_env ~token_sink:None ~parse_options:None None input in + let rec loop token = + match token with + | T_EOF -> None + | _ -> + let loc = Peek.loc env in + (match token with + | T_IDENTIFIER { value = s; _ } when predicate s -> Some (loc, s) + | _ -> + Eat.token env; + loop (Peek.token env)) + in + loop (Peek.token env) diff --git a/jscomp/js_parser/pattern_cover.ml b/jscomp/js_parser/pattern_cover.ml index bf307e4b58..93143df1f8 100644 --- a/jscomp/js_parser/pattern_cover.ml +++ b/jscomp/js_parser/pattern_cover.ml @@ -5,25 +5,10 @@ * LICENSE file in the root directory of this source tree. *) -open Flow_ast open Parser_common open Parser_env -module type COVER = sig - val as_expression : env -> pattern_cover -> (Loc.t, Loc.t) Expression.t - - val as_pattern : ?err:Parse_error.t -> env -> pattern_cover -> (Loc.t, Loc.t) Pattern.t - - val empty_errors : pattern_errors - - val cons_error : Loc.t * Parse_error.t -> pattern_errors -> pattern_errors - - val rev_append_errors : pattern_errors -> pattern_errors -> pattern_errors - - val rev_errors : pattern_errors -> pattern_errors -end - -module Cover (Parse : PARSER) : COVER = struct +module Cover (Parse : PARSER) : Parser_common.COVER = struct let as_expression env = function | Cover_expr expr -> expr | Cover_patt (expr, { if_expr; if_patt = _ }) -> diff --git a/jscomp/js_parser/pattern_cover.mli b/jscomp/js_parser/pattern_cover.mli new file mode 100644 index 0000000000..4a8a461e16 --- /dev/null +++ b/jscomp/js_parser/pattern_cover.mli @@ -0,0 +1,8 @@ +(* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + *) + +module Cover (_ : Parser_common.PARSER) : Parser_common.COVER diff --git a/jscomp/js_parser/pattern_parser.ml b/jscomp/js_parser/pattern_parser.ml index 7c29ff0176..f3a790928d 100644 --- a/jscomp/js_parser/pattern_parser.ml +++ b/jscomp/js_parser/pattern_parser.ml @@ -13,7 +13,8 @@ open Flow_ast let missing_annot env = Ast.Type.Missing (Peek.loc_skip_lookahead env) -module Pattern (Parse : Parser_common.PARSER) (Type : Type_parser.TYPE) = struct +module Pattern (Parse : Parser_common.PARSER) (Type : Parser_common.TYPE) : Parser_common.PATTERN = +struct (* Reinterpret various expressions as patterns. * This is not the correct thing to do and is only used for assignment * expressions. This should be removed and replaced ASAP. diff --git a/jscomp/js_parser/pattern_parser.mli b/jscomp/js_parser/pattern_parser.mli new file mode 100644 index 0000000000..8d73d0fd0f --- /dev/null +++ b/jscomp/js_parser/pattern_parser.mli @@ -0,0 +1,8 @@ +(* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + *) + +module Pattern (_ : Parser_common.PARSER) (_ : Parser_common.TYPE) : Parser_common.PATTERN diff --git a/jscomp/js_parser/primitive_deriving.ml b/jscomp/js_parser/primitive_deriving.ml deleted file mode 100644 index db77258f9d..0000000000 --- a/jscomp/js_parser/primitive_deriving.ml +++ /dev/null @@ -1,39 +0,0 @@ -let equal_int (x : int) y = x = y -let equal_string (x : string) y = x = y -let equal_bool (x : bool) y = x = y -let equal_float (x : float) y = x = y -let equal_int64 (x : int64) y = x = y - -let equal_option f x y = - match x with - | None -> y = None - | Some x -> begin - match y with - | None -> false - | Some y -> f x y - end - -let compare_string (x : string) y = compare x y - -let compare_option cmp x y = - match x with - | None -> - (match y with - | None -> 0 - | Some _ -> -1) - | Some x -> - (match y with - | None -> 1 - | Some y -> cmp x y) - -let compare_bool (x : bool) (y : bool) = compare x y -(* TODO : turn it into externals *) -module Ppx_compare_lib = struct - external polymorphic_compare : 'a -> 'a -> int = "%compare" - external phys_equal : 'a -> 'a -> bool = "%eq" - - external ( && ) : bool -> bool -> bool = "%sequand" - - external polymorphic_equal : 'a -> 'a -> bool = "%equal" -end - diff --git a/jscomp/js_parser/statement_parser.ml b/jscomp/js_parser/statement_parser.ml index f7faa6e179..c329ba0153 100644 --- a/jscomp/js_parser/statement_parser.ml +++ b/jscomp/js_parser/statement_parser.ml @@ -5,76 +5,19 @@ * LICENSE file in the root directory of this source tree. *) -module Ast = Flow_ast open Token open Parser_env open Flow_ast open Parser_common open Comment_attachment -module type STATEMENT = sig - val for_ : env -> (Loc.t, Loc.t) Statement.t - - val if_ : env -> (Loc.t, Loc.t) Statement.t - - val let_ : env -> (Loc.t, Loc.t) Statement.t - - val try_ : env -> (Loc.t, Loc.t) Statement.t - - val while_ : env -> (Loc.t, Loc.t) Statement.t - - val with_ : env -> (Loc.t, Loc.t) Statement.t - - val block : env -> (Loc.t, Loc.t) Statement.t - - val break : env -> (Loc.t, Loc.t) Statement.t - - val continue : env -> (Loc.t, Loc.t) Statement.t - - val debugger : env -> (Loc.t, Loc.t) Statement.t - - val declare : ?in_module:bool -> env -> (Loc.t, Loc.t) Statement.t - - val declare_export_declaration : ?allow_export_type:bool -> env -> (Loc.t, Loc.t) Statement.t - - val declare_opaque_type : env -> (Loc.t, Loc.t) Statement.t - - val do_while : env -> (Loc.t, Loc.t) Statement.t - - val empty : env -> (Loc.t, Loc.t) Statement.t - - val export_declaration : - decorators:(Loc.t, Loc.t) Class.Decorator.t list -> env -> (Loc.t, Loc.t) Statement.t - - val expression : env -> (Loc.t, Loc.t) Statement.t - - val import_declaration : env -> (Loc.t, Loc.t) Statement.t - - val interface : env -> (Loc.t, Loc.t) Statement.t - - val maybe_labeled : env -> (Loc.t, Loc.t) Statement.t - - val opaque_type : env -> (Loc.t, Loc.t) Statement.t - - val return : env -> (Loc.t, Loc.t) Statement.t - - val switch : env -> (Loc.t, Loc.t) Statement.t - - val throw : env -> (Loc.t, Loc.t) Statement.t - - val type_alias : env -> (Loc.t, Loc.t) Statement.t - - val var : env -> (Loc.t, Loc.t) Statement.t - - val const : env -> (Loc.t, Loc.t) Statement.t -end - module Statement (Parse : PARSER) - (Type : Type_parser.TYPE) - (Declaration : Declaration_parser.DECLARATION) - (Object : Object_parser.OBJECT) - (Pattern_cover : Pattern_cover.COVER) : STATEMENT = struct + (Type : Parser_common.TYPE) + (Declaration : Parser_common.DECLARATION) + (Object : Parser_common.OBJECT) + (Pattern_cover : Parser_common.COVER) + (Expression : Parser_common.EXPRESSION) : Parser_common.STATEMENT = struct module Enum = Enum_parser.Enum (Parse) type for_lhs = @@ -636,6 +579,60 @@ module Statement } ) + and match_statement env = + let open Match in + let case env = + let leading = Peek.comments env in + let pattern = Parse.match_pattern env in + let guard = + if Eat.maybe env T_IF then ( + Expect.token env T_LPAREN; + let test = Parse.expression env in + Expect.token env T_RPAREN; + Some test + ) else + None + in + (* Continue parsing colon until hermes-parser is also updated. *) + if not @@ Eat.maybe env T_COLON then Expect.token env T_ARROW; + let body = Parse.statement ~allow_sequence:false env in + (match Peek.token env with + | T_EOF + | T_RCURLY -> + () + | _ -> ignore @@ Eat.maybe env T_COMMA); + let trailing = Eat.trailing_comments env in + let comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () in + { Case.pattern; body; guard; comments } + in + let rec case_list env acc = + match Peek.token env with + | T_EOF + | T_RCURLY -> + List.rev acc + | _ -> case_list env (with_loc case env :: acc) + in + with_loc + (fun env -> + let leading = Peek.comments env in + let match_keyword_loc = Peek.loc env in + Expect.token env T_MATCH; + if Peek.is_line_terminator env then raise Try.Rollback; + let args = Expression.arguments env in + if Peek.is_line_terminator env || not (Eat.maybe env T_LCURLY) then raise Try.Rollback; + let arg = Parser_common.reparse_arguments_as_match_argument env args in + let cases = case_list env [] in + Expect.token env T_RCURLY; + let trailing = Eat.trailing_comments env in + Statement.Match + { + arg; + cases; + match_keyword_loc; + comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing (); + }) + env + and throw = with_loc (fun env -> let leading = Peek.comments env in @@ -849,9 +846,14 @@ module Statement } ) - and expression = + and expression ?(allow_sequence = true) = with_loc (fun env -> - let expression = Parse.expression env in + let expression = + if allow_sequence then + Parse.expression env + else + Parse.assignment env + in let (trailing, expression) = match semicolon ~expected:"the end of an expression statement (`;`)" env with | Explicit comments -> (comments, expression) @@ -1207,9 +1209,20 @@ module Statement Statement.DeclareEnum enum) env - and declare_function ?(leading = []) env = + and declare_function ~async ?(leading = []) env = let leading = leading @ Peek.comments env in - Expect.token env T_FUNCTION; + let effect_ = + match Peek.token env with + | T_FUNCTION -> + Eat.token env; + Function.Arbitrary + | T_IDENTIFIER { raw = "hook"; _ } when not async -> + Eat.token env; + Function.Hook + | t -> + Expect.error env t; + Function.Arbitrary + in let id = id_remove_trailing env (Parse.identifier env) in let annot = with_loc @@ -1219,18 +1232,18 @@ module Statement Expect.token env T_COLON; Eat.push_lex_mode env Lex_mode.TYPE; let return = - if is_start_of_type_guard env then + if is_start_of_type_guard env && effect_ <> Function.Hook then Ast.Type.Function.TypeGuard (Type.type_guard env) else let return = Type._type env in let has_predicate = Peek.token env = T_CHECKS in - if has_predicate then + if has_predicate && effect_ <> Function.Hook then Ast.Type.Function.TypeAnnotation (type_remove_trailing env return) else Ast.Type.Function.TypeAnnotation return in Eat.pop_lex_mode env; - Ast.Type.(Function { Function.params; return; tparams; comments = None })) + Ast.Type.(Function { Function.params; return; tparams; comments = None; effect_ })) env in let predicate = Type.predicate_opt env in @@ -1256,14 +1269,15 @@ module Statement (fun env -> let leading = Peek.comments env in Expect.token env T_DECLARE; - begin + let async = match Peek.token env with | T_ASYNC -> error env Parse_error.DeclareAsync; - Expect.token env T_ASYNC - | _ -> () - end; - let fn = declare_function ~leading env in + Expect.token env T_ASYNC; + true + | _ -> false + in + let fn = declare_function ~async ~leading env in Statement.DeclareFunction fn) env @@ -1300,64 +1314,33 @@ module Statement Statement.DeclareVariable var) env - and declare_module = - let rec module_items env ~module_kind acc = - match Peek.token env with - | T_EOF - | T_RCURLY -> - (module_kind, List.rev acc) - | _ -> - let stmt = declare ~in_module:true env in - (* TODO: This is a semantic analysis and shouldn't be in the parser *) - let module_kind = - let open Statement in - let (_loc, stmt) = stmt in - match (module_kind, stmt) with - (* - * The first time we see either a `declare export` or a - * `declare module.exports`, we lock in the kind of the module. - * - * `declare export type` and `declare export interface` are the two - * exceptions to this rule because they are valid in both CommonJS - * and ES modules (and thus do not indicate an intent for either). - *) - | (None, DeclareModuleExports _) -> Some DeclareModule.CommonJS - | (None, DeclareExportDeclaration { DeclareExportDeclaration.declaration; _ }) -> - (match declaration with - | Some (DeclareExportDeclaration.NamedType _) - | Some (DeclareExportDeclaration.Interface _) -> - module_kind - | _ -> Some DeclareModule.ES) - (* - * There should never be more than one `declare module.exports` - * statement *) - | (Some DeclareModule.CommonJS, DeclareModuleExports _) -> - error env Parse_error.DuplicateDeclareModuleExports; - module_kind - (* - * It's never ok to mix and match `declare export` and - * `declare module.exports` in the same module because it leaves the - * kind of the module (CommonJS vs ES) ambiguous. - * - * The 1 exception to this rule is that `export type/interface` are - * both ok in CommonJS modules. - *) - | (Some DeclareModule.ES, DeclareModuleExports _) -> - error env Parse_error.AmbiguousDeclareModuleKind; - module_kind - | ( Some DeclareModule.CommonJS, - DeclareExportDeclaration { DeclareExportDeclaration.declaration; _ } - ) -> - (match declaration with - | Some (DeclareExportDeclaration.NamedType _) - | Some (DeclareExportDeclaration.Interface _) -> - () - | _ -> error env Parse_error.AmbiguousDeclareModuleKind); - module_kind - | _ -> module_kind + and declare_module_or_namespace_body env = + with_loc + (fun env -> + let leading = Peek.comments env in + Expect.token env T_LCURLY; + let body = + Parse.module_body + ~term_fn:(function + | T_RCURLY -> true + | _ -> false) + env in - module_items env ~module_kind (stmt :: acc) - in + let internal = + if body = [] then + Peek.comments env + else + [] + in + Expect.token env T_RCURLY; + let { trailing; _ } = statement_end_trailing_comments env in + let comments = + Flow_ast_utils.mk_comments_with_internal_opt ~leading ~trailing ~internal () + in + { Statement.Block.body; comments }) + env + + and declare_module = let declare_module_ ~leading env = let id = match Peek.token env with @@ -1366,46 +1349,42 @@ module Statement (string_literal_remove_trailing env (string_literal env str)) | _ -> Statement.DeclareModule.Identifier (id_remove_trailing env (Parse.identifier env)) in - let (body, module_kind) = - with_loc_extra - (fun env -> - let leading = Peek.comments env in - Expect.token env T_LCURLY; - let (module_kind, body) = module_items env ~module_kind:None [] in - let internal = - if body = [] then - Peek.comments env - else - [] - in - Expect.token env T_RCURLY; - let { trailing; _ } = statement_end_trailing_comments env in - let comments = - Flow_ast_utils.mk_comments_with_internal_opt ~leading ~trailing ~internal () - in - let body = { Statement.Block.body; comments } in - (body, module_kind)) - env - in - let kind = - match module_kind with - | Some k -> k - | None -> Statement.DeclareModule.CommonJS - in + let body = declare_module_or_namespace_body env in let comments = Flow_ast_utils.mk_comments_opt ~leading () in - Statement.(DeclareModule DeclareModule.{ id; body; kind; comments }) + Statement.(DeclareModule DeclareModule.{ id; body; comments }) in - fun ~in_module env -> + fun env -> let start_loc = Peek.loc env in let leading = Peek.comments env in Expect.token env T_DECLARE; let leading = leading @ Peek.comments env in Expect.identifier env "module"; - if in_module || Peek.token env = T_PERIOD then + if Peek.token env = T_PERIOD then with_loc ~start_loc (declare_module_exports ~leading) env else with_loc ~start_loc (declare_module_ ~leading) env + and declare_namespace = + let declare_namespace_ ~leading ~global env = + let id = id_remove_trailing env (Parse.identifier env) in + let id = + if global then + Statement.DeclareNamespace.Global id + else + Statement.DeclareNamespace.Local id + in + let body = declare_module_or_namespace_body env in + let comments = Flow_ast_utils.mk_comments_opt ~leading () in + Statement.(DeclareNamespace DeclareNamespace.{ id; body; comments }) + in + fun env ~global -> + let start_loc = Peek.loc env in + let leading = Peek.comments env in + Expect.token env T_DECLARE; + let leading = leading @ Peek.comments env in + if not global then Expect.identifier env "namespace"; + with_loc ~start_loc (declare_namespace_ ~global ~leading) env + and declare_module_exports ~leading env = let leading_period = Peek.comments env in Expect.token env T_PERIOD; @@ -1423,7 +1402,7 @@ module Statement let comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () in Statement.DeclareModuleExports { Statement.DeclareModuleExports.annot; comments } - and declare ?(in_module = false) env = + and declare ?(in_module_or_namespace = false) env = if not (should_parse_types env) then error env Parse_error.UnexpectedTypeDeclaration; (* eventually, just emit a wrapper AST node *) @@ -1433,25 +1412,27 @@ module Statement | T_INTERFACE -> declare_interface env | T_TYPE -> (match Peek.token env with - | T_IMPORT when in_module -> import_declaration env + | T_IMPORT when in_module_or_namespace -> import_declaration env | _ -> declare_type_alias env) | T_OPAQUE -> declare_opaque_type env | T_TYPEOF when Peek.token env = T_IMPORT -> import_declaration env | T_FUNCTION | T_ASYNC -> declare_function_statement env + | T_IDENTIFIER { raw = "hook"; _ } when (parse_options env).components -> + declare_function_statement env | T_VAR -> declare_var_statement ~kind:Ast.Variable.Var env | T_LET -> declare_var_statement ~kind:Ast.Variable.Let env | T_CONST -> declare_var_statement ~kind:Ast.Variable.Const env - | T_EXPORT when in_module -> declare_export_declaration ~allow_export_type:in_module env - | T_IDENTIFIER { raw = "module"; _ } -> declare_module ~in_module env + | T_EXPORT when in_module_or_namespace -> declare_export_declaration env + | T_IDENTIFIER { raw = "module"; _ } -> declare_module env + | T_IDENTIFIER { raw = "global"; _ } -> declare_namespace ~global:true env + | T_IDENTIFIER { raw = "namespace"; _ } -> declare_namespace ~global:false env | T_IDENTIFIER { raw = "component"; _ } when (parse_options env).components -> declare_component_statement env - | _ when in_module -> + | _ when in_module_or_namespace -> (match Peek.token env with - | T_IMPORT -> - error env Parse_error.InvalidNonTypeImportInDeclareModule; - Parse.statement env + | T_IMPORT -> import_declaration env | _ -> (* Oh boy, found some bad stuff in a declare module. Let's just * pretend it's a declare var (arbitrary choice) *) @@ -1497,7 +1478,12 @@ module Statement Some (identifier_name env) | _ -> None in - { Statement.ExportNamedDeclaration.ExportSpecifier.local; exported }) + { + Statement.ExportNamedDeclaration.ExportSpecifier.local; + exported; + from_remote = false; + imported_name_def_loc = None; + }) env in let preceding_comma = Eat.maybe env T_COMMA in @@ -1506,7 +1492,14 @@ module Statement and assert_export_specifier_identifiers env specifiers = List.iter (function - | (_, { Statement.ExportNamedDeclaration.ExportSpecifier.local = id; exported = _ }) -> + | ( _, + { + Statement.ExportNamedDeclaration.ExportSpecifier.local = id; + exported = _; + from_remote = _; + imported_name_def_loc = _; + } + ) -> assert_identifier_name_is_identifier ~restricted_error:Parse_error.StrictVarName env id) specifiers @@ -1526,7 +1519,7 @@ module Statement let (default, ()) = with_loc (fun env -> Expect.token env T_DEFAULT) env in let env = with_in_export_default true env in let (declaration, trailing) = - if Peek.is_function env then + if Peek.is_function env || Peek.is_hook env then (* export default [async] function [foo] (...) { ... } *) let fn = Declaration._function env in (Declaration fn, []) @@ -1653,7 +1646,7 @@ module Statement comments = Flow_ast_utils.mk_comments_opt ~leading (); }) env - | _ when Peek.is_function env -> + | _ when Peek.is_function env || Peek.is_hook env -> with_loc ~start_loc (fun env -> @@ -1752,11 +1745,22 @@ module Statement (fun env -> let specifiers = export_specifiers env [] in Expect.token env T_RCURLY; - let (source, trailing) = + let (source, trailing, specifiers) = match Peek.token env with | T_IDENTIFIER { raw = "from"; _ } -> let (source, trailing) = export_source_and_semicolon env in - (Some source, trailing) + let specifiers = + List.map + (fun (loc, s) -> + ( loc, + { + s with + Statement.ExportNamedDeclaration.ExportSpecifier.from_remote = true; + } + )) + specifiers + in + (Some source, trailing, specifiers) | _ -> assert_export_specifier_identifiers env specifiers; let trailing = @@ -1764,7 +1768,7 @@ module Statement | Explicit trailing -> trailing | Implicit { trailing; _ } -> trailing in - (None, trailing) + (None, trailing, specifiers) in Statement.ExportNamedDeclaration { @@ -1781,8 +1785,9 @@ module Statement Parse.statement_list_item env ~decorators ) - and declare_export_declaration ?(allow_export_type = false) = - with_loc (fun env -> + and declare_export_declaration env = + with_loc + (fun env -> if not (should_parse_types env) then error env Parse_error.UnexpectedTypeDeclaration; let leading = Peek.comments env in Expect.token env T_DECLARE; @@ -1800,7 +1805,7 @@ module Statement match Peek.token env with | T_FUNCTION -> (* declare export default function foo (...): ... *) - let fn = with_loc declare_function env in + let fn = with_loc (declare_function ~async:false) env in (Some (Function fn), []) | T_CLASS -> (* declare export default class foo { ... } *) @@ -1810,6 +1815,10 @@ module Statement (* declare export default component Foo() { ... } *) let component = with_loc (declare_component ~leading:[]) env in (Some (Component component), []) + | T_IDENTIFIER { raw = "hook"; _ } when (parse_options env).components -> + (* declare export default hook foo (...): ... *) + let fn = with_loc (declare_function ~async:false) env in + (Some (Function fn), []) | _ -> (* declare export default [type]; *) let type_ = Type._type env in @@ -1833,7 +1842,7 @@ module Statement match Peek.token env with | T_FUNCTION -> (* declare export function foo (...): ... *) - let fn = with_loc declare_function env in + let fn = with_loc (declare_function ~async:false) env in Some (Function fn) | T_CLASS -> (* declare export class foo { ... } *) @@ -1856,6 +1865,15 @@ module Statement let comments = Flow_ast_utils.mk_comments_opt ~leading () in Statement.DeclareExportDeclaration { default = None; declaration; specifiers = None; source = None; comments } + | T_IDENTIFIER { raw = "hook"; _ } when (parse_options env).components -> + let declaration = + (* declare export hook foo (...): ... *) + let fn = with_loc (declare_function ~async:false) env in + Some (Function fn) + in + let comments = Flow_ast_utils.mk_comments_opt ~leading () in + Statement.DeclareExportDeclaration + { default = None; declaration; specifiers = None; source = None; comments } | T_IDENTIFIER { raw = "component"; _ } when (parse_options env).components -> let declaration = (* declare export component Foo() { ... } *) @@ -1883,7 +1901,7 @@ module Statement let comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () in Statement.DeclareExportDeclaration { default = None; declaration = None; specifiers; source = Some source; comments } - | T_TYPE when allow_export_type -> + | T_TYPE -> (* declare export type = ... *) let alias = with_loc (type_alias_helper ~leading:[]) env in let comments = Flow_ast_utils.mk_comments_opt ~leading () in @@ -1907,7 +1925,7 @@ module Statement source = None; comments; } - | T_INTERFACE when allow_export_type -> + | T_INTERFACE -> (* declare export interface ... *) let iface = with_loc (interface_helper ~leading:[]) env in let comments = Flow_ast_utils.mk_comments_opt ~leading () in @@ -1932,10 +1950,6 @@ module Statement comments; } | _ -> - (match Peek.token env with - | T_TYPE -> error env Parse_error.DeclareExportType - | T_INTERFACE -> error env Parse_error.DeclareExportInterface - | _ -> ()); Expect.token env T_LCURLY; let specifiers = export_specifiers env [] in Expect.token env T_RCURLY; @@ -1962,8 +1976,8 @@ module Statement source; comments; } - ) - ) + )) + env and import_declaration = Statement.ImportDeclaration.( diff --git a/jscomp/js_parser/statement_parser.mli b/jscomp/js_parser/statement_parser.mli new file mode 100644 index 0000000000..4b9c72ed40 --- /dev/null +++ b/jscomp/js_parser/statement_parser.mli @@ -0,0 +1,14 @@ +(* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + *) + +module Statement + (_ : Parser_common.PARSER) + (_ : Parser_common.TYPE) + (_ : Parser_common.DECLARATION) + (_ : Parser_common.OBJECT) + (_ : Parser_common.COVER) + (_ : Parser_common.EXPRESSION) : Parser_common.STATEMENT diff --git a/jscomp/js_parser/token.ml b/jscomp/js_parser/token.ml index a611eedbeb..03c945820b 100644 --- a/jscomp/js_parser/token.ml +++ b/jscomp/js_parser/token.ml @@ -1,3 +1,5 @@ +[@@@ocaml.warning "-32-37"] + type t = | T_NUMBER of { kind: number_type ; @@ -33,6 +35,7 @@ type t = | T_INSTANCEOF | T_RETURN | T_SWITCH + | T_MATCH | T_THIS | T_THROW | T_TRY @@ -160,6 +163,7 @@ type t = | T_INFER | T_IS | T_ASSERTS + | T_IMPLIES | T_RENDERS_QUESTION | T_RENDERS_STAR and bool_or_boolean = @@ -175,267 +179,276 @@ and bigint_type = | BIG_BINARY | BIG_OCTAL | BIG_NORMAL [@@deriving eq] -let rec equal : t -> t -> bool = - let __12 = equal_bigint_type - and __11 = equal_number_type - and __10 = equal_bool_or_boolean - and __9 = Loc.equal - and __8 = Loc.equal - and __7 = Loc.equal - and __6 = Loc.equal - and __5 = Loc.equal - and __4 = Loc.equal - and __3 = Loc.equal - and __2 = Loc.equal - and __1 = equal_bigint_type - and __0 = equal_number_type in - (( - fun lhs -> - fun rhs -> - match (lhs, rhs) with - | (T_NUMBER { kind = lhskind; raw = lhsraw }, T_NUMBER - { kind = rhskind; raw = rhsraw }) -> - (__0 lhskind rhskind) && - (((fun (a : string) -> fun b -> a = b)) lhsraw rhsraw) - | (T_BIGINT { kind = lhskind; raw = lhsraw }, T_BIGINT - { kind = rhskind; raw = rhsraw }) -> - (__1 lhskind rhskind) && - (((fun (a : string) -> fun b -> a = b)) lhsraw rhsraw) - | (T_STRING lhs0, T_STRING rhs0) -> - ((fun (lhs0, lhs1, lhs2, lhs3) -> - fun (rhs0, rhs1, rhs2, rhs3) -> - (((__2 lhs0 rhs0) && - ((fun (a : string) -> fun b -> a = b) lhs1 rhs1)) - && ((fun (a : string) -> fun b -> a = b) lhs2 rhs2)) - && ((fun (a : bool) -> fun b -> a = b) lhs3 rhs3))) - lhs0 rhs0 - | (T_TEMPLATE_PART lhs0, T_TEMPLATE_PART rhs0) -> - ((fun (lhs0, lhs1, lhs2, lhs3, lhs4) -> - fun (rhs0, rhs1, rhs2, rhs3, rhs4) -> - ((((__3 lhs0 rhs0) && - ((fun (a : string) -> fun b -> a = b) lhs1 rhs1)) - && ((fun (a : string) -> fun b -> a = b) lhs2 rhs2)) - && ((fun (a : bool) -> fun b -> a = b) lhs3 rhs3)) - && ((fun (a : bool) -> fun b -> a = b) lhs4 rhs4))) - lhs0 rhs0 - | (T_IDENTIFIER { loc = lhsloc; value = lhsvalue; raw = lhsraw }, - T_IDENTIFIER { loc = rhsloc; value = rhsvalue; raw = rhsraw }) - -> - ((__4 lhsloc rhsloc) && - ((fun (a : string) -> fun b -> a = b) lhsvalue rhsvalue)) - && (((fun (a : string) -> fun b -> a = b)) lhsraw rhsraw) - | (T_REGEXP (lhs0, lhs1, lhs2), T_REGEXP (rhs0, rhs1, rhs2)) -> - ((__5 lhs0 rhs0) && - ((fun (a : string) -> fun b -> a = b) lhs1 rhs1)) - && (((fun (a : string) -> fun b -> a = b)) lhs2 rhs2) - | (T_LCURLY, T_LCURLY) -> true - | (T_RCURLY, T_RCURLY) -> true - | (T_LCURLYBAR, T_LCURLYBAR) -> true - | (T_RCURLYBAR, T_RCURLYBAR) -> true - | (T_LPAREN, T_LPAREN) -> true - | (T_RPAREN, T_RPAREN) -> true - | (T_LBRACKET, T_LBRACKET) -> true - | (T_RBRACKET, T_RBRACKET) -> true - | (T_SEMICOLON, T_SEMICOLON) -> true - | (T_COMMA, T_COMMA) -> true - | (T_PERIOD, T_PERIOD) -> true - | (T_ARROW, T_ARROW) -> true - | (T_ELLIPSIS, T_ELLIPSIS) -> true - | (T_AT, T_AT) -> true - | (T_POUND, T_POUND) -> true - | (T_FUNCTION, T_FUNCTION) -> true - | (T_IF, T_IF) -> true - | (T_IN, T_IN) -> true - | (T_INSTANCEOF, T_INSTANCEOF) -> true - | (T_RETURN, T_RETURN) -> true - | (T_SWITCH, T_SWITCH) -> true - | (T_THIS, T_THIS) -> true - | (T_THROW, T_THROW) -> true - | (T_TRY, T_TRY) -> true - | (T_VAR, T_VAR) -> true - | (T_WHILE, T_WHILE) -> true - | (T_WITH, T_WITH) -> true - | (T_CONST, T_CONST) -> true - | (T_LET, T_LET) -> true - | (T_NULL, T_NULL) -> true - | (T_FALSE, T_FALSE) -> true - | (T_TRUE, T_TRUE) -> true - | (T_BREAK, T_BREAK) -> true - | (T_CASE, T_CASE) -> true - | (T_CATCH, T_CATCH) -> true - | (T_CONTINUE, T_CONTINUE) -> true - | (T_DEFAULT, T_DEFAULT) -> true - | (T_DO, T_DO) -> true - | (T_FINALLY, T_FINALLY) -> true - | (T_FOR, T_FOR) -> true - | (T_CLASS, T_CLASS) -> true - | (T_EXTENDS, T_EXTENDS) -> true - | (T_STATIC, T_STATIC) -> true - | (T_ELSE, T_ELSE) -> true - | (T_NEW, T_NEW) -> true - | (T_DELETE, T_DELETE) -> true - | (T_TYPEOF, T_TYPEOF) -> true - | (T_VOID, T_VOID) -> true - | (T_ENUM, T_ENUM) -> true - | (T_EXPORT, T_EXPORT) -> true - | (T_IMPORT, T_IMPORT) -> true - | (T_SUPER, T_SUPER) -> true - | (T_IMPLEMENTS, T_IMPLEMENTS) -> true - | (T_INTERFACE, T_INTERFACE) -> true - | (T_PACKAGE, T_PACKAGE) -> true - | (T_PRIVATE, T_PRIVATE) -> true - | (T_PROTECTED, T_PROTECTED) -> true - | (T_PUBLIC, T_PUBLIC) -> true - | (T_YIELD, T_YIELD) -> true - | (T_DEBUGGER, T_DEBUGGER) -> true - | (T_DECLARE, T_DECLARE) -> true - | (T_TYPE, T_TYPE) -> true - | (T_OPAQUE, T_OPAQUE) -> true - | (T_OF, T_OF) -> true - | (T_ASYNC, T_ASYNC) -> true - | (T_AWAIT, T_AWAIT) -> true - | (T_CHECKS, T_CHECKS) -> true - | (T_RSHIFT3_ASSIGN, T_RSHIFT3_ASSIGN) -> true - | (T_RSHIFT_ASSIGN, T_RSHIFT_ASSIGN) -> true - | (T_LSHIFT_ASSIGN, T_LSHIFT_ASSIGN) -> true - | (T_BIT_XOR_ASSIGN, T_BIT_XOR_ASSIGN) -> true - | (T_BIT_OR_ASSIGN, T_BIT_OR_ASSIGN) -> true - | (T_BIT_AND_ASSIGN, T_BIT_AND_ASSIGN) -> true - | (T_MOD_ASSIGN, T_MOD_ASSIGN) -> true - | (T_DIV_ASSIGN, T_DIV_ASSIGN) -> true - | (T_MULT_ASSIGN, T_MULT_ASSIGN) -> true - | (T_EXP_ASSIGN, T_EXP_ASSIGN) -> true - | (T_MINUS_ASSIGN, T_MINUS_ASSIGN) -> true - | (T_PLUS_ASSIGN, T_PLUS_ASSIGN) -> true - | (T_NULLISH_ASSIGN, T_NULLISH_ASSIGN) -> true - | (T_AND_ASSIGN, T_AND_ASSIGN) -> true - | (T_OR_ASSIGN, T_OR_ASSIGN) -> true - | (T_ASSIGN, T_ASSIGN) -> true - | (T_PLING_PERIOD, T_PLING_PERIOD) -> true - | (T_PLING_PLING, T_PLING_PLING) -> true - | (T_PLING, T_PLING) -> true - | (T_COLON, T_COLON) -> true - | (T_OR, T_OR) -> true - | (T_AND, T_AND) -> true - | (T_BIT_OR, T_BIT_OR) -> true - | (T_BIT_XOR, T_BIT_XOR) -> true - | (T_BIT_AND, T_BIT_AND) -> true - | (T_EQUAL, T_EQUAL) -> true - | (T_NOT_EQUAL, T_NOT_EQUAL) -> true - | (T_STRICT_EQUAL, T_STRICT_EQUAL) -> true - | (T_STRICT_NOT_EQUAL, T_STRICT_NOT_EQUAL) -> true - | (T_LESS_THAN_EQUAL, T_LESS_THAN_EQUAL) -> true - | (T_GREATER_THAN_EQUAL, T_GREATER_THAN_EQUAL) -> true - | (T_LESS_THAN, T_LESS_THAN) -> true - | (T_GREATER_THAN, T_GREATER_THAN) -> true - | (T_LSHIFT, T_LSHIFT) -> true - | (T_RSHIFT, T_RSHIFT) -> true - | (T_RSHIFT3, T_RSHIFT3) -> true - | (T_PLUS, T_PLUS) -> true - | (T_MINUS, T_MINUS) -> true - | (T_DIV, T_DIV) -> true - | (T_MULT, T_MULT) -> true - | (T_EXP, T_EXP) -> true - | (T_MOD, T_MOD) -> true - | (T_NOT, T_NOT) -> true - | (T_BIT_NOT, T_BIT_NOT) -> true - | (T_INCR, T_INCR) -> true - | (T_DECR, T_DECR) -> true - | (T_INTERPRETER (lhs0, lhs1), T_INTERPRETER (rhs0, rhs1)) -> - (__6 lhs0 rhs0) && - (((fun (a : string) -> fun b -> a = b)) lhs1 rhs1) - | (T_ERROR lhs0, T_ERROR rhs0) -> - ((fun (a : string) -> fun b -> a = b)) lhs0 rhs0 - | (T_EOF, T_EOF) -> true - | (T_JSX_IDENTIFIER { raw = lhsraw; loc = lhsloc }, - T_JSX_IDENTIFIER { raw = rhsraw; loc = rhsloc }) -> - ((fun (a : string) -> fun b -> a = b) lhsraw rhsraw) && - (__7 lhsloc rhsloc) - | (T_JSX_CHILD_TEXT (lhs0, lhs1, lhs2), T_JSX_CHILD_TEXT - (rhs0, rhs1, rhs2)) -> - ((__8 lhs0 rhs0) && - ((fun (a : string) -> fun b -> a = b) lhs1 rhs1)) - && (((fun (a : string) -> fun b -> a = b)) lhs2 rhs2) - | (T_JSX_QUOTE_TEXT (lhs0, lhs1, lhs2), T_JSX_QUOTE_TEXT - (rhs0, rhs1, rhs2)) -> - ((__9 lhs0 rhs0) && - ((fun (a : string) -> fun b -> a = b) lhs1 rhs1)) - && (((fun (a : string) -> fun b -> a = b)) lhs2 rhs2) - | (T_ANY_TYPE, T_ANY_TYPE) -> true - | (T_MIXED_TYPE, T_MIXED_TYPE) -> true - | (T_EMPTY_TYPE, T_EMPTY_TYPE) -> true - | (T_BOOLEAN_TYPE lhs0, T_BOOLEAN_TYPE rhs0) -> __10 lhs0 rhs0 - | (T_NUMBER_TYPE, T_NUMBER_TYPE) -> true - | (T_BIGINT_TYPE, T_BIGINT_TYPE) -> true - | (T_NUMBER_SINGLETON_TYPE - { kind = lhskind; value = lhsvalue; raw = lhsraw }, - T_NUMBER_SINGLETON_TYPE - { kind = rhskind; value = rhsvalue; raw = rhsraw }) -> - ((__11 lhskind rhskind) && - ((fun (a : float) -> fun b -> a = b) lhsvalue rhsvalue)) - && (((fun (a : string) -> fun b -> a = b)) lhsraw rhsraw) - | (T_BIGINT_SINGLETON_TYPE - { kind = lhskind; value = lhsvalue; raw = lhsraw }, - T_BIGINT_SINGLETON_TYPE - { kind = rhskind; value = rhsvalue; raw = rhsraw }) -> - ((__12 lhskind rhskind) && - ((fun x -> - fun y -> - match (x, y) with - | (None, None) -> true - | (Some a, Some b) -> - ((fun (a : int64) -> fun b -> a = b)) a b - | _ -> false) lhsvalue rhsvalue)) - && (((fun (a : string) -> fun b -> a = b)) lhsraw rhsraw) - | (T_STRING_TYPE, T_STRING_TYPE) -> true - | (T_VOID_TYPE, T_VOID_TYPE) -> true - | (T_SYMBOL_TYPE, T_SYMBOL_TYPE) -> true - | (T_UNKNOWN_TYPE, T_UNKNOWN_TYPE) -> true - | (T_NEVER_TYPE, T_NEVER_TYPE) -> true - | (T_UNDEFINED_TYPE, T_UNDEFINED_TYPE) -> true - | (T_KEYOF, T_KEYOF) -> true - | (T_READONLY, T_READONLY) -> true - | (T_INFER, T_INFER) -> true - | (T_IS, T_IS) -> true - | (T_ASSERTS, T_ASSERTS) -> true - | (T_RENDERS_QUESTION, T_RENDERS_QUESTION) -> true - | (T_RENDERS_STAR, T_RENDERS_STAR) -> true - | _ -> false) - [@ocaml.warning "-A"])[@@ocaml.warning "-39"] -and equal_bool_or_boolean : - bool_or_boolean -> bool_or_boolean -> bool = - (( - fun lhs -> - fun rhs -> - match (lhs, rhs) with - | (BOOL, BOOL) -> true - | (BOOLEAN, BOOLEAN) -> true - | _ -> false) - [@ocaml.warning "-A"])[@@ocaml.warning "-39"] -and equal_number_type : - number_type -> number_type -> bool = - (( - fun lhs -> - fun rhs -> - match (lhs, rhs) with - | (BINARY, BINARY) -> true - | (LEGACY_OCTAL, LEGACY_OCTAL) -> true - | (LEGACY_NON_OCTAL, LEGACY_NON_OCTAL) -> true - | (OCTAL, OCTAL) -> true - | (NORMAL, NORMAL) -> true - | _ -> false) - [@ocaml.warning "-A"])[@@ocaml.warning "-39"] -and equal_bigint_type : - bigint_type -> bigint_type -> bool = - (( - fun lhs -> - fun rhs -> - match (lhs, rhs) with - | (BIG_BINARY, BIG_BINARY) -> true - | (BIG_OCTAL, BIG_OCTAL) -> true - | (BIG_NORMAL, BIG_NORMAL) -> true - | _ -> false) - [@ocaml.warning "-A"])[@@ocaml.warning "-39"] +include + struct + let _ = fun (_ : t) -> () + let _ = fun (_ : bool_or_boolean) -> () + let _ = fun (_ : number_type) -> () + let _ = fun (_ : bigint_type) -> () + let rec equal : t -> t -> bool = + ((let __12 = equal_bigint_type + and __11 = equal_number_type + and __10 = equal_bool_or_boolean + and __9 = Loc.equal + and __8 = Loc.equal + and __7 = Loc.equal + and __6 = Loc.equal + and __5 = Loc.equal + and __4 = Loc.equal + and __3 = Loc.equal + and __2 = Loc.equal + and __1 = equal_bigint_type + and __0 = equal_number_type in + (( + fun lhs rhs -> + match (lhs, rhs) with + | (T_NUMBER { kind = lhskind; raw = lhsraw }, T_NUMBER + { kind = rhskind; raw = rhsraw }) -> + (__0 lhskind rhskind) && + (((fun (a : string) b -> a = b)) lhsraw rhsraw) + | (T_BIGINT { kind = lhskind; raw = lhsraw }, T_BIGINT + { kind = rhskind; raw = rhsraw }) -> + (__1 lhskind rhskind) && + (((fun (a : string) b -> a = b)) lhsraw rhsraw) + | (T_STRING lhs0, T_STRING rhs0) -> + ((fun (lhs0, lhs1, lhs2, lhs3) (rhs0, rhs1, rhs2, rhs3) -> + (((__2 lhs0 rhs0) && + ((fun (a : string) b -> a = b) lhs1 rhs1)) + && ((fun (a : string) b -> a = b) lhs2 rhs2)) + && ((fun (a : bool) b -> a = b) lhs3 rhs3))) lhs0 + rhs0 + | (T_TEMPLATE_PART lhs0, T_TEMPLATE_PART rhs0) -> + ((fun (lhs0, lhs1, lhs2, lhs3, lhs4) + (rhs0, rhs1, rhs2, rhs3, rhs4) -> + ((((__3 lhs0 rhs0) && + ((fun (a : string) b -> a = b) lhs1 rhs1)) + && ((fun (a : string) b -> a = b) lhs2 rhs2)) + && ((fun (a : bool) b -> a = b) lhs3 rhs3)) + && ((fun (a : bool) b -> a = b) lhs4 rhs4))) lhs0 + rhs0 + | (T_IDENTIFIER + { loc = lhsloc; value = lhsvalue; raw = lhsraw }, + T_IDENTIFIER + { loc = rhsloc; value = rhsvalue; raw = rhsraw }) -> + ((__4 lhsloc rhsloc) && + ((fun (a : string) b -> a = b) lhsvalue rhsvalue)) + && (((fun (a : string) b -> a = b)) lhsraw rhsraw) + | (T_REGEXP (lhs0, lhs1, lhs2), T_REGEXP (rhs0, rhs1, rhs2)) -> + ((__5 lhs0 rhs0) && + ((fun (a : string) b -> a = b) lhs1 rhs1)) + && (((fun (a : string) b -> a = b)) lhs2 rhs2) + | (T_LCURLY, T_LCURLY) -> true + | (T_RCURLY, T_RCURLY) -> true + | (T_LCURLYBAR, T_LCURLYBAR) -> true + | (T_RCURLYBAR, T_RCURLYBAR) -> true + | (T_LPAREN, T_LPAREN) -> true + | (T_RPAREN, T_RPAREN) -> true + | (T_LBRACKET, T_LBRACKET) -> true + | (T_RBRACKET, T_RBRACKET) -> true + | (T_SEMICOLON, T_SEMICOLON) -> true + | (T_COMMA, T_COMMA) -> true + | (T_PERIOD, T_PERIOD) -> true + | (T_ARROW, T_ARROW) -> true + | (T_ELLIPSIS, T_ELLIPSIS) -> true + | (T_AT, T_AT) -> true + | (T_POUND, T_POUND) -> true + | (T_FUNCTION, T_FUNCTION) -> true + | (T_IF, T_IF) -> true + | (T_IN, T_IN) -> true + | (T_INSTANCEOF, T_INSTANCEOF) -> true + | (T_RETURN, T_RETURN) -> true + | (T_SWITCH, T_SWITCH) -> true + | (T_MATCH, T_MATCH) -> true + | (T_THIS, T_THIS) -> true + | (T_THROW, T_THROW) -> true + | (T_TRY, T_TRY) -> true + | (T_VAR, T_VAR) -> true + | (T_WHILE, T_WHILE) -> true + | (T_WITH, T_WITH) -> true + | (T_CONST, T_CONST) -> true + | (T_LET, T_LET) -> true + | (T_NULL, T_NULL) -> true + | (T_FALSE, T_FALSE) -> true + | (T_TRUE, T_TRUE) -> true + | (T_BREAK, T_BREAK) -> true + | (T_CASE, T_CASE) -> true + | (T_CATCH, T_CATCH) -> true + | (T_CONTINUE, T_CONTINUE) -> true + | (T_DEFAULT, T_DEFAULT) -> true + | (T_DO, T_DO) -> true + | (T_FINALLY, T_FINALLY) -> true + | (T_FOR, T_FOR) -> true + | (T_CLASS, T_CLASS) -> true + | (T_EXTENDS, T_EXTENDS) -> true + | (T_STATIC, T_STATIC) -> true + | (T_ELSE, T_ELSE) -> true + | (T_NEW, T_NEW) -> true + | (T_DELETE, T_DELETE) -> true + | (T_TYPEOF, T_TYPEOF) -> true + | (T_VOID, T_VOID) -> true + | (T_ENUM, T_ENUM) -> true + | (T_EXPORT, T_EXPORT) -> true + | (T_IMPORT, T_IMPORT) -> true + | (T_SUPER, T_SUPER) -> true + | (T_IMPLEMENTS, T_IMPLEMENTS) -> true + | (T_INTERFACE, T_INTERFACE) -> true + | (T_PACKAGE, T_PACKAGE) -> true + | (T_PRIVATE, T_PRIVATE) -> true + | (T_PROTECTED, T_PROTECTED) -> true + | (T_PUBLIC, T_PUBLIC) -> true + | (T_YIELD, T_YIELD) -> true + | (T_DEBUGGER, T_DEBUGGER) -> true + | (T_DECLARE, T_DECLARE) -> true + | (T_TYPE, T_TYPE) -> true + | (T_OPAQUE, T_OPAQUE) -> true + | (T_OF, T_OF) -> true + | (T_ASYNC, T_ASYNC) -> true + | (T_AWAIT, T_AWAIT) -> true + | (T_CHECKS, T_CHECKS) -> true + | (T_RSHIFT3_ASSIGN, T_RSHIFT3_ASSIGN) -> true + | (T_RSHIFT_ASSIGN, T_RSHIFT_ASSIGN) -> true + | (T_LSHIFT_ASSIGN, T_LSHIFT_ASSIGN) -> true + | (T_BIT_XOR_ASSIGN, T_BIT_XOR_ASSIGN) -> true + | (T_BIT_OR_ASSIGN, T_BIT_OR_ASSIGN) -> true + | (T_BIT_AND_ASSIGN, T_BIT_AND_ASSIGN) -> true + | (T_MOD_ASSIGN, T_MOD_ASSIGN) -> true + | (T_DIV_ASSIGN, T_DIV_ASSIGN) -> true + | (T_MULT_ASSIGN, T_MULT_ASSIGN) -> true + | (T_EXP_ASSIGN, T_EXP_ASSIGN) -> true + | (T_MINUS_ASSIGN, T_MINUS_ASSIGN) -> true + | (T_PLUS_ASSIGN, T_PLUS_ASSIGN) -> true + | (T_NULLISH_ASSIGN, T_NULLISH_ASSIGN) -> true + | (T_AND_ASSIGN, T_AND_ASSIGN) -> true + | (T_OR_ASSIGN, T_OR_ASSIGN) -> true + | (T_ASSIGN, T_ASSIGN) -> true + | (T_PLING_PERIOD, T_PLING_PERIOD) -> true + | (T_PLING_PLING, T_PLING_PLING) -> true + | (T_PLING, T_PLING) -> true + | (T_COLON, T_COLON) -> true + | (T_OR, T_OR) -> true + | (T_AND, T_AND) -> true + | (T_BIT_OR, T_BIT_OR) -> true + | (T_BIT_XOR, T_BIT_XOR) -> true + | (T_BIT_AND, T_BIT_AND) -> true + | (T_EQUAL, T_EQUAL) -> true + | (T_NOT_EQUAL, T_NOT_EQUAL) -> true + | (T_STRICT_EQUAL, T_STRICT_EQUAL) -> true + | (T_STRICT_NOT_EQUAL, T_STRICT_NOT_EQUAL) -> true + | (T_LESS_THAN_EQUAL, T_LESS_THAN_EQUAL) -> true + | (T_GREATER_THAN_EQUAL, T_GREATER_THAN_EQUAL) -> true + | (T_LESS_THAN, T_LESS_THAN) -> true + | (T_GREATER_THAN, T_GREATER_THAN) -> true + | (T_LSHIFT, T_LSHIFT) -> true + | (T_RSHIFT, T_RSHIFT) -> true + | (T_RSHIFT3, T_RSHIFT3) -> true + | (T_PLUS, T_PLUS) -> true + | (T_MINUS, T_MINUS) -> true + | (T_DIV, T_DIV) -> true + | (T_MULT, T_MULT) -> true + | (T_EXP, T_EXP) -> true + | (T_MOD, T_MOD) -> true + | (T_NOT, T_NOT) -> true + | (T_BIT_NOT, T_BIT_NOT) -> true + | (T_INCR, T_INCR) -> true + | (T_DECR, T_DECR) -> true + | (T_INTERPRETER (lhs0, lhs1), T_INTERPRETER (rhs0, rhs1)) -> + (__6 lhs0 rhs0) && + (((fun (a : string) b -> a = b)) lhs1 rhs1) + | (T_ERROR lhs0, T_ERROR rhs0) -> + ((fun (a : string) b -> a = b)) lhs0 rhs0 + | (T_EOF, T_EOF) -> true + | (T_JSX_IDENTIFIER { raw = lhsraw; loc = lhsloc }, + T_JSX_IDENTIFIER { raw = rhsraw; loc = rhsloc }) -> + ((fun (a : string) b -> a = b) lhsraw rhsraw) && + (__7 lhsloc rhsloc) + | (T_JSX_CHILD_TEXT (lhs0, lhs1, lhs2), T_JSX_CHILD_TEXT + (rhs0, rhs1, rhs2)) -> + ((__8 lhs0 rhs0) && + ((fun (a : string) b -> a = b) lhs1 rhs1)) + && (((fun (a : string) b -> a = b)) lhs2 rhs2) + | (T_JSX_QUOTE_TEXT (lhs0, lhs1, lhs2), T_JSX_QUOTE_TEXT + (rhs0, rhs1, rhs2)) -> + ((__9 lhs0 rhs0) && + ((fun (a : string) b -> a = b) lhs1 rhs1)) + && (((fun (a : string) b -> a = b)) lhs2 rhs2) + | (T_ANY_TYPE, T_ANY_TYPE) -> true + | (T_MIXED_TYPE, T_MIXED_TYPE) -> true + | (T_EMPTY_TYPE, T_EMPTY_TYPE) -> true + | (T_BOOLEAN_TYPE lhs0, T_BOOLEAN_TYPE rhs0) -> __10 lhs0 rhs0 + | (T_NUMBER_TYPE, T_NUMBER_TYPE) -> true + | (T_BIGINT_TYPE, T_BIGINT_TYPE) -> true + | (T_NUMBER_SINGLETON_TYPE + { kind = lhskind; value = lhsvalue; raw = lhsraw }, + T_NUMBER_SINGLETON_TYPE + { kind = rhskind; value = rhsvalue; raw = rhsraw }) -> + ((__11 lhskind rhskind) && + ((fun (a : float) b -> a = b) lhsvalue rhsvalue)) + && (((fun (a : string) b -> a = b)) lhsraw rhsraw) + | (T_BIGINT_SINGLETON_TYPE + { kind = lhskind; value = lhsvalue; raw = lhsraw }, + T_BIGINT_SINGLETON_TYPE + { kind = rhskind; value = rhsvalue; raw = rhsraw }) -> + ((__12 lhskind rhskind) && + ((fun x y -> + match (x, y) with + | (None, None) -> true + | (Some a, Some b) -> + ((fun (a : int64) b -> a = b)) a b + | _ -> false) lhsvalue rhsvalue)) + && (((fun (a : string) b -> a = b)) lhsraw rhsraw) + | (T_STRING_TYPE, T_STRING_TYPE) -> true + | (T_VOID_TYPE, T_VOID_TYPE) -> true + | (T_SYMBOL_TYPE, T_SYMBOL_TYPE) -> true + | (T_UNKNOWN_TYPE, T_UNKNOWN_TYPE) -> true + | (T_NEVER_TYPE, T_NEVER_TYPE) -> true + | (T_UNDEFINED_TYPE, T_UNDEFINED_TYPE) -> true + | (T_KEYOF, T_KEYOF) -> true + | (T_READONLY, T_READONLY) -> true + | (T_INFER, T_INFER) -> true + | (T_IS, T_IS) -> true + | (T_ASSERTS, T_ASSERTS) -> true + | (T_IMPLIES, T_IMPLIES) -> true + | (T_RENDERS_QUESTION, T_RENDERS_QUESTION) -> true + | (T_RENDERS_STAR, T_RENDERS_STAR) -> true + | _ -> false) + [@ocaml.warning "-A"])) + [@ocaml.warning "-39"])[@@ocaml.warning "-39"] + and equal_bool_or_boolean : + bool_or_boolean -> bool_or_boolean -> bool = + (( + fun lhs rhs -> + match (lhs, rhs) with + | (BOOL, BOOL) -> true + | (BOOLEAN, BOOLEAN) -> true + | _ -> false) + [@ocaml.warning "-39"][@ocaml.warning "-A"])[@@ocaml.warning "-39"] + and equal_number_type : + number_type -> number_type -> bool = + (( + fun lhs rhs -> + match (lhs, rhs) with + | (BINARY, BINARY) -> true + | (LEGACY_OCTAL, LEGACY_OCTAL) -> true + | (LEGACY_NON_OCTAL, LEGACY_NON_OCTAL) -> true + | (OCTAL, OCTAL) -> true + | (NORMAL, NORMAL) -> true + | _ -> false) + [@ocaml.warning "-39"][@ocaml.warning "-A"])[@@ocaml.warning "-39"] + and equal_bigint_type : + bigint_type -> bigint_type -> bool = + (( + fun lhs rhs -> + match (lhs, rhs) with + | (BIG_BINARY, BIG_BINARY) -> true + | (BIG_OCTAL, BIG_OCTAL) -> true + | (BIG_NORMAL, BIG_NORMAL) -> true + | _ -> false) + [@ocaml.warning "-39"][@ocaml.warning "-A"])[@@ocaml.warning "-39"] + let _ = equal + and _ = equal_bool_or_boolean + and _ = equal_number_type + and _ = equal_bigint_type + end[@@ocaml.doc "@inline"][@@merlin.hide ] let token_to_string = function | T_NUMBER _ -> "T_NUMBER" @@ -450,6 +463,7 @@ let token_to_string = | T_INSTANCEOF -> "T_INSTANCEOF" | T_RETURN -> "T_RETURN" | T_SWITCH -> "T_SWITCH" + | T_MATCH -> "T_MATCH" | T_THIS -> "T_THIS" | T_THROW -> "T_THROW" | T_TRY -> "T_TRY" @@ -562,6 +576,7 @@ let token_to_string = | T_INFER -> "T_INFER" | T_IS -> "T_IS" | T_ASSERTS -> "T_ASSERTS" + | T_IMPLIES -> "T_IMPLIES" | T_RENDERS_QUESTION -> "T_RENDERS_QUESTION" | T_RENDERS_STAR -> "T_RENDERS_QUESTION" | T_INTERPRETER _ -> "T_INTERPRETER" @@ -619,6 +634,7 @@ let value_of_token = | T_INSTANCEOF -> "instanceof" | T_RETURN -> "return" | T_SWITCH -> "switch" + | T_MATCH -> "match" | T_THIS -> "this" | T_THROW -> "throw" | T_TRY -> "try" @@ -716,6 +732,7 @@ let value_of_token = | T_INFER -> "infer" | T_IS -> "is" | T_ASSERTS -> "asserts" + | T_IMPLIES -> "implies" | T_RENDERS_QUESTION -> "renders?" | T_RENDERS_STAR -> "renders*" | T_INTERPRETER (_, str) -> str @@ -740,7 +757,7 @@ let value_of_token = | T_NEVER_TYPE -> "never" | T_UNDEFINED_TYPE -> "undefined" let quote_token_value value = Printf.sprintf "token `%s`" value -let explanation_of_token ?(use_article= false) token = +let explanation_of_token ?(use_article= false) token = let (value, article) = match token with | T_NUMBER_SINGLETON_TYPE _ | T_NUMBER _ -> ("number", "a") diff --git a/jscomp/js_parser/type_parser.ml b/jscomp/js_parser/type_parser.ml index ab8040ccc7..c9a0eaf6bb 100644 --- a/jscomp/js_parser/type_parser.ml +++ b/jscomp/js_parser/type_parser.ml @@ -5,55 +5,21 @@ * LICENSE file in the root directory of this source tree. *) -module Ast = Flow_ast open Token open Parser_env open Flow_ast open Parser_common open Comment_attachment -module type TYPE = sig - val _type : env -> (Loc.t, Loc.t) Ast.Type.t - - val type_identifier : env -> (Loc.t, Loc.t) Ast.Identifier.t - - val type_params : env -> (Loc.t, Loc.t) Ast.Type.TypeParams.t option - - val type_args : env -> (Loc.t, Loc.t) Ast.Type.TypeArgs.t option - - val generic : env -> Loc.t * (Loc.t, Loc.t) Ast.Type.Generic.t - - val _object : is_class:bool -> env -> Loc.t * (Loc.t, Loc.t) Type.Object.t - - val interface_helper : - env -> - (Loc.t * (Loc.t, Loc.t) Ast.Type.Generic.t) list * (Loc.t * (Loc.t, Loc.t) Ast.Type.Object.t) - - val function_param_list : env -> (Loc.t, Loc.t) Type.Function.Params.t - - val component_param_list : env -> (Loc.t, Loc.t) Ast.Type.Component.Params.t - - val annotation : env -> (Loc.t, Loc.t) Ast.Type.annotation - - val annotation_opt : env -> (Loc.t, Loc.t) Ast.Type.annotation_or_hint - - val renders_annotation_opt : env -> (Loc.t, Loc.t) Ast.Type.component_renders_annotation - - val function_return_annotation_opt : env -> (Loc.t, Loc.t) Ast.Function.ReturnAnnot.t - - val predicate_opt : env -> (Loc.t, Loc.t) Ast.Type.Predicate.t option - - val function_return_annotation_and_predicate_opt : - env -> (Loc.t, Loc.t) Ast.Function.ReturnAnnot.t * (Loc.t, Loc.t) Ast.Type.Predicate.t option - - val type_guard : env -> (Loc.t, Loc.t) Ast.Type.TypeGuard.t -end - -module Type (Parse : Parser_common.PARSER) : TYPE = struct +module Type (Parse : Parser_common.PARSER) : Parser_common.TYPE = struct type param_list_or_type = | ParamList of (Loc.t, Loc.t) Type.Function.Params.t' | Type of (Loc.t, Loc.t) Type.t + type tuple_syntax_element = + | TupleElement of (Loc.t, Loc.t) Type.Tuple.element' + | InexactTupleMarker + let maybe_variance ?(parse_readonly = false) ?(parse_in_out = false) env = let loc = Peek.loc env in match Peek.token env with @@ -102,6 +68,19 @@ module Type (Parse : Parser_common.PARSER) : TYPE = struct ) | _ -> None + let maybe_const env = + match Peek.token env with + | T_CONST -> + Some + (with_loc + (fun env -> + let leading = Peek.comments env in + Eat.token env; + Flow_ast_utils.mk_comments_opt ~leading ()) + env + ) + | _ -> None + let number_singleton ~neg kind value raw env = if kind = LEGACY_OCTAL then strict_error env Parse_error.StrictOctalLiteral; let leading = Peek.comments env in @@ -271,7 +250,7 @@ module Type (Parse : Parser_common.PARSER) : TYPE = struct ) ) in - function_with_params env start_loc tparams params + function_with_params ~effect_:Function.Arbitrary env start_loc tparams params | _ -> param and prefix env = @@ -472,6 +451,14 @@ module Type (Parse : Parser_common.PARSER) : TYPE = struct | T_RENDERS_QUESTION | T_RENDERS_STAR -> with_loc (fun env -> Type.Renders (render_type env)) env + | T_IDENTIFIER { raw = "hook"; _ } when (parse_options env).components -> + (match Peek.ith_token ~i:1 env with + | T_LESS_THAN + | T_LPAREN -> + hook env + | _ -> + let (loc, g) = generic env in + (loc, Type.Generic g)) | T_IDENTIFIER _ | T_EXTENDS (* `extends` is reserved, but recover by treating it as an identifier *) | T_STATIC (* `static` is reserved, but recover by treating it as an identifier *) -> @@ -555,6 +542,7 @@ module Type (Parse : Parser_common.PARSER) : TYPE = struct bound_kind = Type.TypeParam.Extends; variance = None; default = None; + const = None; }) env in @@ -678,6 +666,7 @@ module Type (Parse : Parser_common.PARSER) : TYPE = struct let trailing = Eat.trailing_comments env in Some (Type.Undefined (Flow_ast_utils.mk_comments_opt ~leading ~trailing ())) | T_ASSERTS -> generic_of_primitive env "asserts" + | T_IMPLIES -> generic_of_primitive env "implies" | T_IS -> generic_of_primitive env "is" | _ -> None @@ -686,21 +675,33 @@ module Type (Parse : Parser_common.PARSER) : TYPE = struct with_loc (fun env -> if Eat.maybe env T_ELLIPSIS then - let name = - match (Peek.is_identifier env, Peek.ith_token ~i:1 env) with - | (true, T_PLING) - | (true, T_COLON) -> - let name = identifier_name env in - if Peek.token env = T_PLING then ( - error env Parse_error.InvalidTupleOptionalSpread; - Eat.token env - ); - Expect.token env T_COLON; - Some name - | _ -> None - in - let annot = _type env in - Type.Tuple.SpreadElement { Type.Tuple.SpreadElement.name; annot } + match Peek.token env with + | T_EOF + | T_RBRACKET -> + InexactTupleMarker + | T_COMMA -> + error_unexpected + ~expected: + "the end of a tuple type (no trailing comma is allowed in inexact tuple type)." + env; + Eat.token env; + InexactTupleMarker + | _ -> + let name = + match (Peek.is_identifier env, Peek.ith_token ~i:1 env) with + | (true, T_PLING) + | (true, T_COLON) -> + let name = identifier_name env in + if Peek.token env = T_PLING then ( + error env Parse_error.InvalidTupleOptionalSpread; + Eat.token env + ); + Expect.token env T_COLON; + Some name + | _ -> None + in + let annot = _type env in + TupleElement (Type.Tuple.SpreadElement { Type.Tuple.SpreadElement.name; annot }) else let variance = match Peek.token env with @@ -718,35 +719,41 @@ module Type (Parse : Parser_common.PARSER) : TYPE = struct let optional = Eat.maybe env T_PLING in Expect.token env T_COLON; let annot = _type env in - Type.Tuple.LabeledElement - { Type.Tuple.LabeledElement.name; annot; variance; optional } + TupleElement + (Type.Tuple.LabeledElement + { Type.Tuple.LabeledElement.name; annot; variance; optional } + ) | _ -> if Option.is_some variance then error env Parse_error.InvalidTupleVariance; - Type.Tuple.UnlabeledElement (_type env)) + TupleElement (Type.Tuple.UnlabeledElement (_type env))) env in let rec elements env acc = match Peek.token env with | T_EOF | T_RBRACKET -> - List.rev acc + (List.rev acc, false) | _ -> - let acc = element env :: acc in - (* Trailing comma support (like [number, string,]) *) - if Peek.token env <> T_RBRACKET then Expect.token env T_COMMA; - elements env acc + (match element env with + | (_, InexactTupleMarker) -> (List.rev acc, true) + | (loc, TupleElement el) -> + let acc = (loc, el) :: acc in + (* Trailing comma support (like [number, string,]) *) + if Peek.token env <> T_RBRACKET then Expect.token env T_COMMA; + elements env acc) in fun env -> with_loc (fun env -> let leading = Peek.comments env in Expect.token env T_LBRACKET; - let els = elements (with_no_anon_function_type false env) [] in + let (els, inexact) = elements (with_no_anon_function_type false env) [] in Expect.token env T_RBRACKET; let trailing = Eat.trailing_comments env in Type.Tuple { Type.Tuple.elements = els; + inexact; comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing (); }) env @@ -914,6 +921,7 @@ module Type (Parse : Parser_common.PARSER) : TYPE = struct | _ -> (None, false) in let annot = _type env in + if Peek.token env = T_COMMA then Eat.token env; { Ast.Type.Component.RestParam.argument; annot; @@ -979,6 +987,12 @@ module Type (Parse : Parser_common.PARSER) : TYPE = struct (* Ok this is definitely a parameter *) ParamList (function_param_list_without_parens env []) | _ -> Type (_type env)) + | T_IDENTIFIER { raw = "component"; _ } when (parse_options env).components -> + (match Peek.ith_token ~i:1 env with + | T_LESS_THAN + | T_LPAREN -> + Type (_type env) + | _ -> function_param_or_generic_type env) | T_IDENTIFIER _ | T_STATIC (* `static` is reserved in strict mode, but still an identifier *) -> (* This could be a function parameter or a generic type *) @@ -1055,25 +1069,33 @@ module Type (Parse : Parser_common.PARSER) : TYPE = struct and function_or_group env = let start_loc = Peek.loc env in match with_loc param_list_or_type env with - | (loc, ParamList params) -> function_with_params env start_loc None (loc, params) + | (loc, ParamList params) -> + function_with_params ~effect_:Function.Arbitrary env start_loc None (loc, params) | (_, Type _type) -> _type and _function env = let start_loc = Peek.loc env in let tparams = type_params_remove_trailing env (type_params env) in let params = function_param_list env in - function_with_params env start_loc tparams params + function_with_params ~effect_:Function.Arbitrary env start_loc tparams params - and function_with_params env start_loc tparams (params : (Loc.t, Loc.t) Ast.Type.Function.Params.t) - = + and function_with_params + ~effect_ env start_loc tparams (params : (Loc.t, Loc.t) Ast.Type.Function.Params.t) = with_loc ~start_loc (fun env -> Expect.token env T_ARROW; let return = function_return_type env in - Type.(Function { Function.params; return; tparams; comments = None })) + Type.(Function { Function.params; return; tparams; comments = None; effect_ })) env + and hook env = + let start_loc = Peek.loc env in + Eat.token env; + let tparams = type_params_remove_trailing env (type_params env) in + let params = function_param_list env in + function_with_params ~effect_:Function.Hook env start_loc tparams params + and function_return_type env = if is_start_of_type_guard env then Type.Function.TypeGuard (type_guard env) @@ -1081,27 +1103,39 @@ module Type (Parse : Parser_common.PARSER) : TYPE = struct Type.Function.TypeAnnotation (_type env) and type_guard env = + let parse_is_type_guard env = + let internal = Peek.comments env in + Expect.token env T_IS; + let internal = internal @ Peek.comments env in + (Some (_type env), internal) + in with_loc (fun env -> let leading = Peek.comments env in - let asserts = Eat.maybe env T_ASSERTS in + let kind = + if Eat.maybe env T_ASSERTS then + Ast.Type.TypeGuard.Asserts + else if Eat.maybe env T_IMPLIES then + Ast.Type.TypeGuard.Implies + else + Ast.Type.TypeGuard.Default + in (* Parse the identifier part as normal code, since this can be any name that * a parameter can be. *) Eat.push_lex_mode env Lex_mode.NORMAL; let param = identifier_name env in Eat.pop_lex_mode env; let (t, internal) = - match Peek.token env with - | T_IS -> - let internal = Peek.comments env in - Expect.token env T_IS; - let internal = internal @ Peek.comments env in - (Some (_type env), internal) - | _ -> (None, []) + if kind = Ast.Type.TypeGuard.Implies then + parse_is_type_guard env + else + match Peek.token env with + | T_IS -> parse_is_type_guard env + | _ -> (None, []) in let guard = (param, t) in let comments = Flow_ast_utils.mk_comments_with_internal_opt ~leading ~internal () in - { Ast.Type.TypeGuard.asserts; guard; comments }) + { Ast.Type.TypeGuard.kind; guard; comments }) env and type_guard_annotation env ~start_loc = with_loc ~start_loc type_guard env @@ -1114,7 +1148,7 @@ module Type (Parse : Parser_common.PARSER) : TYPE = struct let params = function_param_list env in Expect.token env T_COLON; let return = function_return_type env in - { Type.Function.params; return; tparams; comments = None }) + { Type.Function.params; return; tparams; comments = None; effect_ = Function.Arbitrary }) env in let method_property env start_loc static key ~leading = @@ -1275,6 +1309,7 @@ module Type (Parse : Parser_common.PARSER) : TYPE = struct variance = None; default = None; bound_kind = Type.TypeParam.Colon; + const = None; } in (* We already checked in mapped_type_or_indexer that the next token was an @@ -1777,6 +1812,7 @@ module Type (Parse : Parser_common.PARSER) : TYPE = struct let (param, require_default) = with_loc_extra (fun env -> + let const = maybe_const env in let variance = maybe_variance ~parse_in_out:true env in let (loc, (name, bound, bound_kind)) = bounded_type env in let (default, require_default) = @@ -1788,7 +1824,9 @@ module Type (Parse : Parser_common.PARSER) : TYPE = struct if require_default then error_at env (loc, Parse_error.MissingTypeParamDefault); (None, require_default) in - ({ Type.TypeParam.name; bound; bound_kind; variance; default }, require_default)) + ( { Type.TypeParam.name; bound; bound_kind; variance; default; const }, + require_default + )) env in (param :: acc, require_default) @@ -1930,9 +1968,14 @@ module Type (Parse : Parser_common.PARSER) : TYPE = struct | T_COLON -> let operator_loc = Peek.loc env in if not (should_parse_types env) then error env Parse_error.UnexpectedTypeAnnotation; - error env Parse_error.InvalidComponentRenderAnnotation; Eat.token env; let (loc, argument) = with_loc _type env in + let has_nested_render = + match argument with + | (_, Ast.Type.Renders _) -> true + | _ -> false + in + error_at env (operator_loc, Parse_error.InvalidComponentRenderAnnotation { has_nested_render }); Type.AvailableRenders ( loc, { diff --git a/jscomp/js_parser/type_parser.mli b/jscomp/js_parser/type_parser.mli new file mode 100644 index 0000000000..bc73503c7a --- /dev/null +++ b/jscomp/js_parser/type_parser.mli @@ -0,0 +1,8 @@ +(* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + *) + +module Type (_ : Parser_common.PARSER) : Parser_common.TYPE