diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e6012f45fb..81657ff016 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -128,11 +128,12 @@ jobs: DUNE_PROFILE: release steps: - - name: "Windows: Set git to use LF" + - name: "Windows: Set git config" if: runner.os == 'Windows' run: | - git config --global core.autocrlf false - git config --global core.eol lf + git config --system core.autocrlf false + git config --system core.eol lf + git config --system core.longpaths true - name: Checkout uses: actions/checkout@v4 diff --git a/Makefile b/Makefile index 5f6677fc31..6978e4097a 100644 --- a/Makefile +++ b/Makefile @@ -49,7 +49,7 @@ test-gentype: test-all: test test-gentype test-analysis test-tools reanalyze: - reanalyze.exe -set-exit-code -all-cmt _build/default/compiler _build/default/tests -exclude-paths compiler/outcome_printer,compiler/ml,compiler/js_parser,compiler/frontend,compiler/ext,compiler/depends,compiler/core,compiler/common,compiler/cmij,compiler/bsb_helper,compiler/bsb + reanalyze.exe -set-exit-code -all-cmt _build/default/compiler _build/default/tests -exclude-paths compiler/outcome_printer,compiler/ml,compiler/frontend,compiler/ext,compiler/depends,compiler/core,compiler/common,compiler/cmij,compiler/bsb_helper,compiler/bsb lib: build ./scripts/buildRuntime.sh diff --git a/analysis/vendor/dune b/analysis/vendor/dune index 2064349dd9..07b8286153 100644 --- a/analysis/vendor/dune +++ b/analysis/vendor/dune @@ -1 +1 @@ -(dirs ext ml res_syntax json js_parser) +(dirs ext ml res_syntax json flow_parser) diff --git a/compiler/bsc/dune b/compiler/bsc/dune index 240599abee..4a50387af2 100644 --- a/compiler/bsc/dune +++ b/compiler/bsc/dune @@ -9,4 +9,4 @@ (package rescript) (flags (:standard -w +a-4-9-30-40-41-42-48-70)) - (libraries common core depends gentype js_parser syntax)) + (libraries common core depends flow_parser gentype syntax)) diff --git a/compiler/core/dune b/compiler/core/dune index c62f4cfee8..d7d75f3443 100644 --- a/compiler/core/dune +++ b/compiler/core/dune @@ -6,4 +6,4 @@ (run %{bin:cppo} %{env:CPPO_FLAGS=} %{input-file}))) (flags (:standard -w +a-4-9-27-30-40-41-42-48-70)) - (libraries depends ext frontend gentype js_parser)) + (libraries depends ext flow_parser frontend gentype)) diff --git a/compiler/dune b/compiler/dune index 7c5ba77749..6eb9778dac 100644 --- a/compiler/dune +++ b/compiler/dune @@ -9,10 +9,10 @@ core depends ext + flow_parser frontend gentype jsoo - js_parser ml syntax) diff --git a/compiler/js_parser/comment_attachment.ml b/compiler/js_parser/comment_attachment.ml deleted file mode 100644 index 4866a47851..0000000000 --- a/compiler/js_parser/comment_attachment.ml +++ /dev/null @@ -1,779 +0,0 @@ -(* - * 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 Ast = Flow_ast -open Flow_ast -open Parser_env - -let id = Flow_ast_mapper.id - -let map_loc = Flow_ast_mapper.map_loc - -let map_opt = Flow_ast_mapper.map_opt - -let id_list_last (map : 'a -> 'a) (lst : 'a list) : 'a list = - match List.rev lst with - | [] -> lst - | hd :: tl -> - let hd' = map hd in - if hd == hd' then - lst - else - List.rev (hd' :: tl) - -(* Mapper that removes all trailing comments that appear after a given position in an AST node *) -class ['loc] trailing_comments_remover ~after_pos = - object (this) - inherit ['loc] Flow_ast_mapper.mapper - - method! syntax comments = - let open Syntax in - let { trailing; _ } = comments in - let trailing' = - List.filter (fun (loc, _) -> Loc.(pos_cmp loc.start after_pos < 0)) trailing - in - if List.length trailing = List.length trailing' then - comments - else - { comments with trailing = trailing' } - - method! array _loc expr = - let open Ast.Expression.Array in - let { comments; _ } = expr in - id this#syntax_opt comments expr (fun comments' -> { expr with comments = comments' }) - - method! array_type t = - let open Ast.Type.Array in - let { comments; _ } = t in - id this#syntax_opt comments t (fun comments' -> { t with comments = comments' }) - - method! assignment _loc expr = - let open Ast.Expression.Assignment in - let { right; comments; _ } = expr in - let right' = this#expression right in - let comments' = this#syntax_opt comments in - if right == right' && comments == comments' then - expr - else - { expr with right = right'; comments = comments' } - - method! binary _loc expr = - let open Ast.Expression.Binary in - let { right; comments; _ } = expr in - let right' = this#expression right in - let comments' = this#syntax_opt comments in - if right == right' && comments == comments' then - expr - else - { expr with right = right'; comments = comments' } - - method! block _loc stmt = - let open Ast.Statement.Block in - let { comments; _ } = stmt in - id this#syntax_opt comments stmt (fun comments' -> { stmt with comments = comments' }) - - method! call _annot expr = - let open Ast.Expression.Call in - let { arguments; comments; _ } = expr in - let arguments' = this#call_arguments arguments in - let comments' = this#syntax_opt comments in - if arguments == arguments' && comments == comments' then - expr - else - { expr with arguments = arguments'; comments = comments' } - - method! call_arguments arg_list = - let open Ast.Expression.ArgList in - let (loc, { arguments; comments }) = arg_list in - id this#syntax_opt comments arg_list (fun comments' -> - (loc, { arguments; comments = comments' }) - ) - - method! call_type_args targs = - let open Ast.Expression.CallTypeArgs in - let (loc, { arguments; comments }) = targs in - id this#syntax_opt comments targs (fun comments' -> (loc, { arguments; comments = comments' })) - - method! class_ _loc cls = - let open Ast.Class in - let { body; comments; _ } = cls in - let body' = this#class_body body in - let comments' = this#syntax_opt comments in - if body == body' && comments == comments' then - cls - else - { cls with body = body'; comments = comments' } - - method! class_body body = - let open Ast.Class.Body in - let (loc, { body = _body; comments }) = body in - id this#syntax_opt comments body (fun comments' -> - (loc, { body = _body; comments = comments' }) - ) - - method! class_extends _loc extends = - let open Ast.Class.Extends in - let { expr; targs; _ } = extends in - if targs = None then - id this#expression expr extends (fun expr' -> { extends with expr = expr' }) - else - id (map_opt this#type_args) targs extends (fun targs' -> { extends with targs = targs' }) - - method! class_implements implements = - let open Ast.Class.Implements in - let (loc, { interfaces; comments }) = implements in - id (id_list_last this#class_implements_interface) interfaces implements (fun interfaces' -> - (loc, { interfaces = interfaces'; comments }) - ) - - method! class_implements_interface interface = - let open Ast.Class.Implements.Interface in - let (loc, { id = id_; targs }) = interface in - if targs = None then - id this#identifier id_ interface (fun id' -> (loc, { id = id'; targs })) - else - id (map_opt this#type_args) targs interface (fun targs' -> - (loc, { id = id_; targs = targs' }) - ) - - method! computed_key key = - let open Ast.ComputedKey in - let (loc, { expression; comments }) = key in - id this#syntax_opt comments key (fun comments' -> (loc, { expression; comments = comments' })) - - method! conditional _loc expr = - let open Ast.Expression.Conditional in - let { alternate; comments; _ } = expr in - let alternate' = this#expression alternate in - let comments' = this#syntax_opt comments in - if alternate == alternate' && comments == comments' then - expr - else - { expr with alternate = alternate'; comments = comments' } - - method! function_ _loc func = - let open Ast.Function in - let { body; comments; _ } = func in - let body' = this#function_body_any body in - let comments' = this#syntax_opt comments in - if body == body' && comments == comments' then - func - else - { func with body = body'; comments = comments' } - - method! function_params (loc, params) = - let open Ast.Function.Params in - let { comments; _ } = params in - id this#syntax_opt comments (loc, params) (fun comments' -> - (loc, { params with comments = comments' }) - ) - - method! function_type _loc func = - let open Ast.Type.Function in - let { return; comments; _ } = func in - let return' = this#type_ return in - let comments' = this#syntax_opt comments in - if return == return' && comments == comments' then - func - else - { func with return = return'; comments = comments' } - - method! generic_identifier_type git = - let open Ast.Type.Generic.Identifier in - match git with - | Unqualified i -> id this#identifier i git (fun i -> Unqualified i) - | Qualified (loc, ({ id; _ } as qualified)) -> - let id' = this#identifier id in - if id == id' then - git - else - Qualified (loc, { qualified with id = id' }) - - method! import _loc expr = - let open Ast.Expression.Import in - let { comments; _ } = expr in - id this#syntax_opt comments expr (fun comments' -> { expr with comments = comments' }) - - method! interface_type _loc t = - let open Ast.Type.Interface in - let { body; comments; _ } = t in - let body' = map_loc this#object_type body in - let comments' = this#syntax_opt comments in - if body == body' && comments == comments' then - t - else - { t with body = body'; comments = comments' } - - method! intersection_type _loc t = - let { Ast.Type.Intersection.types = (t0, t1, ts); comments } = t in - let (t1', ts') = - match ts with - | [] -> (this#type_ t1, []) - | _ -> (t1, id_list_last this#type_ ts) - in - let comments' = this#syntax_opt comments in - if t1 == t1' && ts == ts' && comments == comments' then - t - else - { Ast.Type.Intersection.types = (t0, t1', ts'); comments = comments' } - - method! jsx_element _loc elem = - let open Ast.JSX in - let { comments; _ } = elem in - id this#syntax_opt comments elem (fun comments' -> { elem with comments = comments' }) - - method! jsx_fragment _loc frag = - let open Ast.JSX in - let { frag_comments = comments; _ } = frag in - id this#syntax_opt comments frag (fun comments' -> { frag with frag_comments = comments' }) - - method! logical _loc expr = - let open Ast.Expression.Logical in - let { right; comments; _ } = expr in - let right' = this#expression right in - let comments' = this#syntax_opt comments in - if right == right' && comments == comments' then - expr - else - { expr with right = right'; comments = comments' } - - method! new_ _loc expr = - let open Ast.Expression.New in - let { callee; targs; arguments; comments } = expr in - let comments' = this#syntax_opt comments in - match (targs, arguments) with - (* new Callee() *) - | (_, Some _) -> - let arguments' = map_opt this#call_arguments arguments in - if arguments == arguments' && comments == comments' then - expr - else - { expr with arguments = arguments'; comments = comments' } - (* new Callee *) - | (Some _, _) -> - let targs' = map_opt this#call_type_args targs in - if targs == targs' && comments == comments' then - expr - else - { expr with targs = targs'; comments = comments' } - (* new Callee *) - | (None, None) -> - let callee' = this#expression callee in - if callee == callee' && comments == comments' then - expr - else - { expr with callee = callee'; comments = comments' } - - method! member _loc expr = - let open Ast.Expression.Member in - let { property; comments; _ } = expr in - let property' = this#member_property property in - let comments' = this#syntax_opt comments in - if property == property' && comments == comments' then - expr - else - { expr with property = property'; comments = comments' } - - method! object_ _loc expr = - let open Ast.Expression.Object in - let { comments; _ } = expr in - id this#syntax_opt comments expr (fun comments' -> { expr with comments = comments' }) - - method! object_type _loc obj = - let open Ast.Type.Object in - let { comments; _ } = obj in - id this#syntax_opt comments obj (fun comments' -> { obj with comments = comments' }) - - method! predicate pred = - let open Ast.Type.Predicate in - let (loc, { kind; comments }) = pred in - id this#syntax_opt comments pred (fun comments' -> (loc, { kind; comments = comments' })) - - method! sequence _loc expr = - let open Ast.Expression.Sequence in - let { expressions; comments } = expr in - let expressions' = id_list_last this#expression expressions in - let comments' = this#syntax_opt comments in - if expressions == expressions' && comments == comments' then - expr - else - { expressions = expressions'; comments = comments' } - - method! template_literal _loc expr = - let open Ast.Expression.TemplateLiteral in - let { comments; _ } = expr in - id this#syntax_opt comments expr (fun comments' -> { expr with comments = comments' }) - - method! tuple_type t = - let open Ast.Type.Tuple in - let { comments; _ } = t in - id this#syntax_opt comments t (fun comments' -> { t with comments = comments' }) - - method! type_cast _loc expr = - let open Ast.Expression.TypeCast in - let { comments; _ } = expr in - id this#syntax_opt comments expr (fun comments' -> { expr with comments = comments' }) - - method! type_params tparams = - let open Ast.Type.TypeParams in - let (loc, { params; comments }) = tparams in - id this#syntax_opt comments tparams (fun comments' -> (loc, { params; comments = comments' })) - - method! union_type _loc t = - let { Ast.Type.Union.types = (t0, t1, ts); comments } = t in - let (t1', ts') = - match ts with - | [] -> (this#type_ t1, []) - | _ -> (t1, id_list_last this#type_ ts) - in - let comments' = this#syntax_opt comments in - if t1 == t1' && ts == ts' && comments == comments' then - t - else - { Ast.Type.Union.types = (t0, t1', ts'); comments = comments' } - - method! variable_declarator ~kind decl = - let open Ast.Statement.VariableDeclaration.Declarator in - let (loc, { id = ident; init }) = decl in - match init with - | None -> - id (this#variable_declarator_pattern ~kind) ident decl (fun ident' -> - (loc, { id = ident'; init }) - ) - | Some init -> - id this#expression init decl (fun init' -> (loc, { id = ident; init = Some init' })) - end - -type trailing_and_remover_result = { - trailing: Loc.t Comment.t list; - remove_trailing: 'a. 'a -> (Loc.t trailing_comments_remover -> 'a -> 'a) -> 'a; -} - -(* Returns a remover function which removes comments beginning after the previous token. - No trailing comments are returned, since all comments since the last loc should be removed. *) -let trailing_and_remover_after_last_loc : Parser_env.env -> trailing_and_remover_result = - fun env -> - let open Loc in - let remover = - match Parser_env.last_loc env with - | None -> None - | Some _ when not (Peek.has_eaten_comments env) -> None - | Some last_loc -> - Parser_env.consume_comments_until env last_loc._end; - let remover = new trailing_comments_remover ~after_pos:last_loc._end in - Some remover - in - { - trailing = []; - remove_trailing = - (fun node f -> - match remover with - | None -> node - | Some remover -> f remover node); - } - -(* Consumes and returns comments on the same line as the previous token. Also returns a remover - function which can be used to remove comments beginning after the previous token's line. *) -let trailing_and_remover_after_last_line : Parser_env.env -> trailing_and_remover_result = - fun env -> - let open Loc in - let (trailing, remover) = - match Parser_env.last_loc env with - | None -> ([], None) - | Some _ when not (Peek.has_eaten_comments env) -> (Eat.comments_until_next_line env, None) - | Some last_loc -> - Parser_env.consume_comments_until env last_loc._end; - let trailing = Eat.comments_until_next_line env in - let next_line_start = { line = last_loc._end.line + 1; column = 0 } in - let remover = new trailing_comments_remover ~after_pos:next_line_start in - (trailing, Some remover) - in - { - trailing; - remove_trailing = - (fun node f -> - match remover with - | None -> node - | Some remover -> f remover node); - } - -let trailing_and_remover : Parser_env.env -> trailing_and_remover_result = - fun env -> - if Peek.is_line_terminator env then - trailing_and_remover_after_last_line env - else - trailing_and_remover_after_last_loc env - -let id_remove_trailing env id = - let { remove_trailing; _ } = trailing_and_remover env in - remove_trailing id (fun remover id -> remover#identifier id) - -let expression_remove_trailing env expr = - let { remove_trailing; _ } = trailing_and_remover env in - remove_trailing expr (fun remover expr -> remover#expression expr) - -let block_remove_trailing env block = - let { remove_trailing; _ } = trailing_and_remover env in - remove_trailing block (fun remover (loc, str) -> (loc, remover#block loc str)) - -let type_params_remove_trailing env tparams = - match tparams with - | None -> None - | Some tparams -> - let { remove_trailing; _ } = trailing_and_remover env in - Some (remove_trailing tparams (fun remover tparams -> remover#type_params tparams)) - -let type_remove_trailing env ty = - let { remove_trailing; _ } = trailing_and_remover env in - remove_trailing ty (fun remover ty -> remover#type_ ty) - -let type_annotation_hint_remove_trailing env annot = - let { remove_trailing; _ } = trailing_and_remover env in - remove_trailing annot (fun remover annot -> remover#type_annotation_hint annot) - -let function_params_remove_trailing env params = - let { remove_trailing; _ } = trailing_and_remover env in - remove_trailing params (fun remover params -> remover#function_params params) - -let predicate_remove_trailing env pred = - match pred with - | None -> None - | Some pred -> - let { remove_trailing; _ } = trailing_and_remover env in - Some (remove_trailing pred (fun remover pred -> remover#predicate pred)) - -let object_key_remove_trailing env key = - let { remove_trailing; _ } = trailing_and_remover env in - remove_trailing key (fun remover key -> remover#object_key key) - -let generic_type_remove_trailing env ty = - let { remove_trailing; _ } = trailing_and_remover env in - remove_trailing ty (fun remover ty -> map_loc remover#generic_type ty) - -let generic_type_list_remove_trailing env extends = - let { remove_trailing; _ } = trailing_and_remover env in - remove_trailing extends (fun remover extends -> - id_list_last (map_loc remover#generic_type) extends - ) - -let class_implements_remove_trailing env implements = - let { remove_trailing; _ } = trailing_and_remover env in - remove_trailing implements (fun remover impl -> remover#class_implements impl) - -let string_literal_remove_trailing env str = - let { remove_trailing; _ } = trailing_and_remover env in - remove_trailing str (fun remover (loc, str) -> (loc, remover#string_literal_type loc str)) - -let statement_add_comments - ((loc, stmt) : (Loc.t, Loc.t) Statement.t) (comments : (Loc.t, unit) Syntax.t option) : - (Loc.t, Loc.t) Statement.t = - let open Statement in - let merge_comments inner = Flow_ast_utils.merge_comments ~inner ~outer:comments in - let merge_comments_with_internal inner = - Flow_ast_utils.merge_comments_with_internal ~inner ~outer:comments - in - ( loc, - match stmt with - | Block ({ Block.comments; _ } as s) -> - Block { s with Block.comments = merge_comments_with_internal comments } - | Break ({ Break.comments; _ } as s) -> - Break { s with Break.comments = merge_comments comments } - | ClassDeclaration ({ Class.comments; _ } as s) -> - ClassDeclaration { s with Class.comments = merge_comments comments } - | Continue ({ Continue.comments; _ } as s) -> - Continue { s with Continue.comments = merge_comments comments } - | Debugger { Debugger.comments } -> Debugger { Debugger.comments = merge_comments comments } - | DeclareClass ({ DeclareClass.comments; _ } as s) -> - DeclareClass { s with DeclareClass.comments = merge_comments comments } - | DeclareExportDeclaration ({ DeclareExportDeclaration.comments; _ } as s) -> - DeclareExportDeclaration - { s with DeclareExportDeclaration.comments = merge_comments comments } - | DeclareFunction ({ DeclareFunction.comments; _ } as s) -> - DeclareFunction { s with DeclareFunction.comments = merge_comments comments } - | DeclareInterface ({ Interface.comments; _ } as s) -> - DeclareInterface { s with Interface.comments = merge_comments comments } - | DeclareModule ({ DeclareModule.comments; _ } as s) -> - DeclareModule { s with DeclareModule.comments = merge_comments comments } - | DeclareModuleExports ({ DeclareModuleExports.comments; _ } as s) -> - DeclareModuleExports { s with DeclareModuleExports.comments = merge_comments comments } - | DeclareTypeAlias ({ TypeAlias.comments; _ } as s) -> - DeclareTypeAlias { s with TypeAlias.comments = merge_comments comments } - | DeclareOpaqueType ({ OpaqueType.comments; _ } as s) -> - DeclareOpaqueType { s with OpaqueType.comments = merge_comments comments } - | DeclareVariable ({ DeclareVariable.comments; _ } as s) -> - DeclareVariable { s with DeclareVariable.comments = merge_comments comments } - | DoWhile ({ DoWhile.comments; _ } as s) -> - DoWhile { s with DoWhile.comments = merge_comments comments } - | Empty { Empty.comments } -> Empty { Empty.comments = merge_comments comments } - | EnumDeclaration ({ EnumDeclaration.comments; _ } as s) -> - EnumDeclaration { s with EnumDeclaration.comments = merge_comments comments } - | ExportDefaultDeclaration ({ ExportDefaultDeclaration.comments; _ } as s) -> - ExportDefaultDeclaration - { s with ExportDefaultDeclaration.comments = merge_comments comments } - | ExportNamedDeclaration ({ ExportNamedDeclaration.comments; _ } as s) -> - ExportNamedDeclaration { s with ExportNamedDeclaration.comments = merge_comments comments } - | Expression ({ Expression.comments; _ } as s) -> - Expression { s with Expression.comments = merge_comments comments } - | For ({ For.comments; _ } as s) -> For { s with For.comments = merge_comments comments } - | ForIn ({ ForIn.comments; _ } as s) -> - ForIn { s with ForIn.comments = merge_comments comments } - | ForOf ({ ForOf.comments; _ } as s) -> - ForOf { s with ForOf.comments = merge_comments comments } - | FunctionDeclaration ({ Function.comments; _ } as s) -> - FunctionDeclaration { s with Function.comments = merge_comments comments } - | If ({ If.comments; _ } as s) -> If { s with If.comments = merge_comments comments } - | ImportDeclaration ({ ImportDeclaration.comments; _ } as s) -> - ImportDeclaration { s with ImportDeclaration.comments = merge_comments comments } - | InterfaceDeclaration ({ Interface.comments; _ } as s) -> - InterfaceDeclaration { s with Interface.comments = merge_comments comments } - | Labeled ({ Labeled.comments; _ } as s) -> - Labeled { s with Labeled.comments = merge_comments comments } - | Return ({ Return.comments; _ } as s) -> - Return { s with Return.comments = merge_comments comments } - | Switch ({ Switch.comments; _ } as s) -> - Switch { s with Switch.comments = merge_comments comments } - | Throw ({ Throw.comments; _ } as s) -> - Throw { s with Throw.comments = merge_comments comments } - | Try ({ Try.comments; _ } as s) -> Try { s with Try.comments = merge_comments comments } - | TypeAlias ({ TypeAlias.comments; _ } as s) -> - TypeAlias { s with TypeAlias.comments = merge_comments comments } - | OpaqueType ({ OpaqueType.comments; _ } as s) -> - OpaqueType { s with OpaqueType.comments = merge_comments comments } - | VariableDeclaration ({ VariableDeclaration.comments; _ } as s) -> - VariableDeclaration { s with VariableDeclaration.comments = merge_comments comments } - | While ({ While.comments; _ } as s) -> - While { s with While.comments = merge_comments comments } - | With ({ With.comments; _ } as s) -> With { s with With.comments = merge_comments comments } - ) - -(* Collects the first leading and last trailing comment on an AST node or its children. - The first leading comment is the first attached comment that begins before the given node's loc, - and the last trailing comment is the last attached comment that begins after the given node's loc. *) -class ['loc] comment_bounds_collector ~loc = - object (this) - inherit ['loc] Flow_ast_mapper.mapper - - val mutable first_leading = None - - val mutable last_trailing = None - - method comment_bounds = (first_leading, last_trailing) - - method collect_comments : 'internal. ('loc, 'internal) Syntax.t -> unit = - function - | { Syntax.leading; trailing; _ } -> - List.iter this#visit_leading_comment leading; - List.iter this#visit_trailing_comment trailing - - method collect_comments_opt = - function - | None -> () - | Some comments -> this#collect_comments comments - - method visit_leading_comment ((comment_loc, _) as comment) = - let open Loc in - match first_leading with - | None -> if pos_cmp comment_loc.start loc.start < 0 then first_leading <- Some comment - | Some (current_first_loc, _) -> - if pos_cmp comment_loc.start current_first_loc.start < 0 then first_leading <- Some comment - - method visit_trailing_comment ((comment_loc, _) as comment) = - let open Loc in - match last_trailing with - | None -> if pos_cmp comment_loc.start loc._end >= 0 then last_trailing <- Some comment - | Some (current_last_loc, _) -> - if pos_cmp current_last_loc.start comment_loc.start < 0 then last_trailing <- Some comment - - method! syntax comments = - this#collect_comments comments; - comments - - method! block _loc block = - let { Statement.Block.comments; _ } = block in - this#collect_comments_opt comments; - block - end - -(* Given an AST node and a function to collect all its comments, return the first leading - and last trailing comment on the node. *) -let comment_bounds loc node f = - let collector = new comment_bounds_collector ~loc in - ignore (f collector node); - collector#comment_bounds - -(* Expand node's loc to include its attached comments *) -let expand_loc_with_comment_bounds loc (first_leading, last_trailing) = - let open Loc in - let start = - match first_leading with - | None -> loc - | Some (first_leading_loc, _) -> first_leading_loc - in - let _end = - match last_trailing with - | None -> loc - | Some (last_trailing_loc, _) -> last_trailing_loc - in - btwn start _end - -(* Remove the trailing comment bound if it is a line comment *) -let comment_bounds_without_trailing_line_comment (leading, trailing) = - match trailing with - | Some (_, { Ast.Comment.kind = Ast.Comment.Line; _ }) -> (leading, None) - | _ -> (leading, trailing) - -let collect_without_trailing_line_comment collector = - comment_bounds_without_trailing_line_comment collector#comment_bounds - -(* Return the first leading and last trailing comment of a statement *) -let statement_comment_bounds ((loc, _) as stmt : (Loc.t, Loc.t) Statement.t) : - Loc.t Comment.t option * Loc.t Comment.t option = - let collector = new comment_bounds_collector ~loc in - ignore (collector#statement stmt); - collector#comment_bounds - -let expression_comment_bounds ((loc, _) as expr) = - let collector = new comment_bounds_collector ~loc in - ignore (collector#expression expr); - collector#comment_bounds - -let type_comment_bounds ((loc, _) as ty) = - let collector = new comment_bounds_collector ~loc in - ignore (collector#type_ ty); - collector#comment_bounds - -let block_comment_bounds (loc, block) = - let collector = new comment_bounds_collector ~loc in - ignore (collector#block loc block); - collector#comment_bounds - -let object_property_comment_bounds property = - let open Ast.Expression.Object in - let collector = - match property with - | Property ((loc, _) as p) -> - let collector = new comment_bounds_collector ~loc in - ignore (collector#object_property p); - collector - | SpreadProperty ((loc, _) as p) -> - let collector = new comment_bounds_collector ~loc in - ignore (collector#spread_property p); - collector - in - collect_without_trailing_line_comment collector - -let object_type_property_comment_bounds property = - let open Ast.Type.Object in - let collector = - match property with - | Property ((loc, _) as p) -> - let collector = new comment_bounds_collector ~loc in - ignore (collector#object_property_type p); - collector - | SpreadProperty ((loc, _) as p) -> - let collector = new comment_bounds_collector ~loc in - ignore (collector#object_spread_property_type p); - collector - | Indexer ((loc, _) as p) -> - let collector = new comment_bounds_collector ~loc in - ignore (collector#object_indexer_property_type p); - collector - | InternalSlot ((loc, _) as p) -> - let collector = new comment_bounds_collector ~loc in - ignore (collector#object_internal_slot_property_type p); - collector - | CallProperty ((loc, _) as p) -> - let collector = new comment_bounds_collector ~loc in - ignore (collector#object_call_property_type p); - collector - in - collect_without_trailing_line_comment collector - -let object_pattern_property_comment_bounds loc property = - let collector = new comment_bounds_collector ~loc in - ignore (collector#pattern_object_p property); - collect_without_trailing_line_comment collector - -let switch_case_comment_bounds (loc, case) = - let collector = new comment_bounds_collector ~loc in - ignore (collector#switch_case (loc, case)); - collector#comment_bounds - -let function_param_comment_bounds (loc, param) = - let collector = new comment_bounds_collector ~loc in - ignore (collector#function_param (loc, param)); - collect_without_trailing_line_comment collector - -let function_rest_param_comment_bounds (loc, param) = - let collector = new comment_bounds_collector ~loc in - ignore (collector#function_rest_param (loc, param)); - collect_without_trailing_line_comment collector - -let function_this_param_comment_bounds (loc, param) = - let collector = new comment_bounds_collector ~loc in - ignore (collector#function_this_param (loc, param)); - collect_without_trailing_line_comment collector - -let function_type_param_comment_bounds (loc, param) = - let collector = new comment_bounds_collector ~loc in - ignore (collector#function_param_type (loc, param)); - collect_without_trailing_line_comment collector - -let function_type_rest_param_comment_bounds (loc, param) = - let collector = new comment_bounds_collector ~loc in - ignore (collector#function_rest_param_type (loc, param)); - collect_without_trailing_line_comment collector - -let function_type_this_param_comment_bounds (loc, param) = - let collector = new comment_bounds_collector ~loc in - ignore (collector#function_this_param_type (loc, param)); - collect_without_trailing_line_comment collector - -let array_element_comment_bounds loc element = - let collector = new comment_bounds_collector ~loc in - ignore (collector#array_element element); - collect_without_trailing_line_comment collector - -let array_pattern_element_comment_bounds loc element = - let collector = new comment_bounds_collector ~loc in - ignore (collector#pattern_array_e element); - collect_without_trailing_line_comment collector - -let expression_or_spread_comment_bounds loc expr_or_spread = - let collector = new comment_bounds_collector ~loc in - ignore (collector#expression_or_spread expr_or_spread); - collect_without_trailing_line_comment collector - -let call_type_arg_comment_bounds loc arg = - let collector = new comment_bounds_collector ~loc in - ignore (collector#call_type_arg arg); - collect_without_trailing_line_comment collector - -let type_param_comment_bounds (loc, param) = - let collector = new comment_bounds_collector ~loc in - ignore (collector#type_param (loc, param)); - collect_without_trailing_line_comment collector - -let function_body_comment_bounds body = - let loc = - match body with - | Ast.Function.BodyBlock (loc, _) -> loc - | Ast.Function.BodyExpression (loc, _) -> loc - in - let collector = new comment_bounds_collector ~loc in - ignore (collector#function_body_any body); - collector#comment_bounds - -let if_alternate_statement_comment_bounds loc alternate = - let collector = new comment_bounds_collector ~loc in - ignore (collector#if_alternate_statement loc alternate); - collector#comment_bounds - -let member_property_comment_bounds loc property = - let collector = new comment_bounds_collector ~loc in - ignore (collector#member_property property); - collector#comment_bounds diff --git a/compiler/js_parser/declaration_parser.ml b/compiler/js_parser/declaration_parser.ml deleted file mode 100644 index ef9f983acb..0000000000 --- a/compiler/js_parser/declaration_parser.ml +++ /dev/null @@ -1,432 +0,0 @@ -(* - * 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 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 -> 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 strict_post_check : - env -> - contains_use_strict:bool -> - (Loc.t, Loc.t) Identifier.t option -> - (Loc.t, Loc.t) Ast.Function.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 : env -> (Loc.t, Loc.t) Statement.t -end - -module Declaration (Parse : Parser_common.PARSER) (Type : Type_parser.TYPE) : DECLARATION = struct - module Enum = Enum_parser.Enum (Parse) - - let check_param = - let rec pattern ((env, _) as check_env) (loc, p) = - Pattern.( - match p with - | Object o -> _object check_env o - | Array arr -> _array check_env arr - | Identifier id -> identifier_pattern check_env id - | Expression _ -> - error_at env (loc, Parse_error.ExpectedPatternFoundExpression); - check_env - ) - and _object check_env o = List.fold_left object_property check_env o.Pattern.Object.properties - and object_property check_env = - let open Pattern.Object in - function - | Property (_, property) -> - Property.( - let check_env = - match property.key with - | Identifier id -> identifier_no_dupe_check check_env id - | _ -> check_env - in - pattern check_env property.pattern - ) - | RestElement (_, { Pattern.RestElement.argument; comments = _ }) -> - pattern check_env argument - and _array check_env arr = List.fold_left array_element check_env arr.Pattern.Array.elements - and array_element check_env = - let open Pattern.Array in - function - | Hole _ -> check_env - | Element (_, { Element.argument; default = _ }) -> pattern check_env argument - | RestElement (_, { Pattern.RestElement.argument; comments = _ }) -> - pattern check_env argument - and identifier_pattern check_env { Pattern.Identifier.name = id; _ } = identifier check_env id - and identifier (env, param_names) ((loc, { Identifier.name; comments = _ }) as id) = - if SSet.mem name param_names then error_at env (loc, Parse_error.StrictParamDupe); - let (env, param_names) = identifier_no_dupe_check (env, param_names) id in - (env, SSet.add name param_names) - and identifier_no_dupe_check (env, param_names) (loc, { Identifier.name; comments = _ }) = - if is_restricted name then strict_error_at env (loc, Parse_error.StrictParamName); - if is_future_reserved name || is_strict_reserved name then - strict_error_at env (loc, Parse_error.StrictReservedWord); - (env, param_names) - in - pattern - - let strict_post_check env ~contains_use_strict id params = - let strict_mode = Parser_env.in_strict_mode env in - let simple = is_simple_parameter_list params in - let (_, { Ast.Function.Params.params; rest; this_ = _; comments = _ }) = params in - (* If we were already in strict mode and therefore already threw strict - errors, we want to do these checks outside of strict mode. If we - were in non-strict mode but the function contains "use strict", then - we want to do these checks in strict mode *) - let env = - if strict_mode then - with_strict false env - else - with_strict contains_use_strict env - in - if contains_use_strict || strict_mode || not simple then ( - (match id with - | Some (loc, { Identifier.name; comments = _ }) -> - if is_restricted name then strict_error_at env (loc, Parse_error.StrictFunctionName); - if is_future_reserved name || is_strict_reserved name then - strict_error_at env (loc, Parse_error.StrictReservedWord) - | None -> ()); - let acc = - List.fold_left - (fun acc (_, { Function.Param.argument; default = _ }) -> check_param acc argument) - (env, SSet.empty) - params - in - match rest with - | Some (_, { Function.RestParam.argument; comments = _ }) -> ignore (check_param acc argument) - | None -> () - ) - - let function_params = - let rec param = - with_loc (fun env -> - if Peek.token env = T_THIS then error env Parse_error.ThisParamMustBeFirst; - let argument = Parse.pattern env Parse_error.StrictParamName in - let default = - if Peek.token env = T_ASSIGN then ( - Expect.token env T_ASSIGN; - Some (Parse.assignment env) - ) else - None - in - { Function.Param.argument; default } - ) - and param_list env acc = - match Peek.token env with - | (T_EOF | T_RPAREN | T_ELLIPSIS) as t -> - let rest = - if t = T_ELLIPSIS then - let leading = Peek.comments env in - let (loc, id) = - with_loc - (fun env -> - Expect.token env T_ELLIPSIS; - Parse.pattern env Parse_error.StrictParamName) - env - in - Some - ( loc, - { - Function.RestParam.argument = id; - comments = Flow_ast_utils.mk_comments_opt ~leading (); - } - ) - else - None - in - if Peek.token env <> T_RPAREN then error env Parse_error.ParameterAfterRestParameter; - (List.rev acc, rest) - | _ -> - let the_param = param env in - if Peek.token env <> T_RPAREN then Expect.token env T_COMMA; - param_list env (the_param :: acc) - in - let this_param_annotation env = - if should_parse_types env && Peek.token env = T_THIS then ( - let leading = Peek.comments env in - let (this_loc, this_param) = - with_loc - (fun env -> - Expect.token env T_THIS; - if Peek.token env <> T_COLON then begin - error env Parse_error.ThisParamAnnotationRequired; - None - end else - Some (Type.annotation env)) - env - in - match this_param with - | None -> None - | Some annot -> - if Peek.token env = T_COMMA then Eat.token env; - Some - ( this_loc, - { - Ast.Function.ThisParam.annot; - comments = Flow_ast_utils.mk_comments_opt ~leading (); - } - ) - ) else - None - in - fun ~await ~yield -> - with_loc (fun env -> - let env = - env - |> with_allow_await await - |> with_allow_yield yield - |> with_in_formal_parameters true - in - let leading = Peek.comments env in - Expect.token env T_LPAREN; - let this_ = this_param_annotation env in - let (params, rest) = param_list env [] in - let internal = Peek.comments env in - Expect.token env T_RPAREN; - let trailing = Eat.trailing_comments env in - { - Ast.Function.Params.params; - rest; - comments = Flow_ast_utils.mk_comments_with_internal_opt ~leading ~trailing ~internal (); - this_; - } - ) - - let function_body env ~async ~generator ~expression ~simple_params = - let env = enter_function env ~async ~generator ~simple_params in - let (body_block, contains_use_strict) = Parse.function_block_body env ~expression in - (Function.BodyBlock body_block, contains_use_strict) - - let variance env is_async is_generator = - let loc = Peek.loc env in - let variance = - match Peek.token env with - | T_PLUS -> - let leading = Peek.comments env in - Eat.token env; - Some - ( loc, - { Variance.kind = Variance.Plus; comments = Flow_ast_utils.mk_comments_opt ~leading () } - ) - | T_MINUS -> - let leading = Peek.comments env in - Eat.token env; - Some - ( loc, - { - Variance.kind = Variance.Minus; - comments = Flow_ast_utils.mk_comments_opt ~leading (); - } - ) - | _ -> None - in - match variance with - | Some (loc, _) when is_async || is_generator -> - error_at env (loc, Parse_error.UnexpectedVariance); - None - | _ -> variance - - let generator env = - if Peek.token env = T_MULT then ( - let leading = Peek.comments env in - Eat.token env; - (true, leading) - ) else - (false, []) - - (* Returns true and consumes a token if the token is `async` and the token after it is on - the same line (see https://tc39.github.io/ecma262/#sec-async-function-definitions) *) - let async env = - if Peek.token env = T_ASYNC && not (Peek.ith_is_line_terminator ~i:1 env) then - let leading = Peek.comments env in - let () = Eat.token env in - (true, leading) - else - (false, []) - - let _function = - with_loc (fun env -> - let (async, leading_async) = async env in - let (sig_loc, (generator, 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 leading = List.concat [leading_async; leading_function; leading_generator] in - let (tparams, id) = - match (in_export_default env, Peek.token env) with - | (true, T_LPAREN) -> (None, None) - | (true, T_LESS_THAN) -> - let tparams = type_params_remove_trailing env (Type.type_params env) in - let id = - if Peek.token env = T_LPAREN then - None - else - let id = - id_remove_trailing - env - (Parse.identifier ~restricted_error:Parse_error.StrictFunctionName env) - in - Some id - in - (tparams, id) - | _ -> - let id = - if Peek.is_identifier env then - id_remove_trailing - env - (Parse.identifier ~restricted_error:Parse_error.StrictFunctionName env) - else ( - (* don't consume the identifier here like Parse.identifier does. *) - error_nameless_declaration env "function"; - (Peek.loc env, { Identifier.name = ""; comments = None }) - ) - in - let tparams = type_params_remove_trailing env (Type.type_params env) in - (tparams, Some id) - in - let params = - let params = function_params ~await:async ~yield:generator env in - if Peek.token env = T_COLON then - params - else - function_params_remove_trailing env params - in - let (return, predicate) = Type.annotation_and_predicate_opt env in - let (return, predicate) = - match predicate with - | None -> (type_annotation_hint_remove_trailing env return, predicate) - | Some _ -> (return, predicate_remove_trailing env predicate) - in - (generator, tparams, id, params, return, predicate, leading)) - env - in - let simple_params = is_simple_parameter_list params in - let (body, contains_use_strict) = - function_body env ~async ~generator ~expression:false ~simple_params - in - strict_post_check env ~contains_use_strict id params; - Statement.FunctionDeclaration - { - Function.id; - params; - body; - generator; - async; - predicate; - return; - tparams; - sig_loc; - comments = Flow_ast_utils.mk_comments_opt ~leading (); - } - ) - - let variable_declaration_list = - let variable_declaration env = - let (loc, (decl, err)) = - with_loc - (fun env -> - let id = Parse.pattern env Parse_error.StrictVarName in - let (init, err) = - if Eat.maybe env T_ASSIGN then - (Some (Parse.assignment env), None) - else - match id with - | (_, Ast.Pattern.Identifier _) -> (None, None) - | (loc, _) -> (None, Some (loc, Parse_error.NoUninitializedDestructuring)) - in - (Ast.Statement.VariableDeclaration.Declarator.{ id; init }, err)) - env - in - ((loc, decl), err) - in - let rec helper env decls errs = - let (decl, err) = variable_declaration env in - let decls = decl :: decls in - let errs = - match err with - | Some x -> x :: errs - | None -> errs - in - if Eat.maybe env T_COMMA then - helper env decls errs - else - (List.rev decls, List.rev errs) - in - (fun env -> helper env [] []) - - let declarations token env = - let leading = Peek.comments env in - Expect.token env token; - let (declarations, errs) = variable_declaration_list env in - (declarations, leading, errs) - - let var = declarations T_VAR - - let const env = - let env = env |> with_no_let true in - let (declarations, leading_comments, errs) = declarations T_CONST env in - (* Make sure all consts defined are initialized *) - let errs = - List.fold_left - (fun errs decl -> - match decl with - | (loc, { Statement.VariableDeclaration.Declarator.init = None; _ }) -> - (loc, Parse_error.NoUninitializedConst) :: errs - | _ -> errs) - errs - declarations - in - (declarations, leading_comments, List.rev errs) - - let let_ env = - let env = env |> with_no_let true in - declarations T_LET env - - let enum_declaration = Enum.declaration -end diff --git a/compiler/js_parser/dune b/compiler/js_parser/dune deleted file mode 100644 index a783f2d656..0000000000 --- a/compiler/js_parser/dune +++ /dev/null @@ -1,5 +0,0 @@ -(library - (name js_parser) - (wrapped false) - (flags - (:standard -w +a-4-44-48-50-70))) diff --git a/compiler/js_parser/enum_common.ml b/compiler/js_parser/enum_common.ml deleted file mode 100644 index 45b52ee74c..0000000000 --- a/compiler/js_parser/enum_common.ml +++ /dev/null @@ -1,24 +0,0 @@ -(* - * 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 Primitive_deriving -type explicit_type = - | Boolean - | Number - | String - | Symbol -[@@deriving_inline compare] -let _ = fun (_ : explicit_type) -> () -let compare_explicit_type = - (Ppx_compare_lib.polymorphic_compare : explicit_type -> - explicit_type -> int) -let _ = compare_explicit_type -[@@@end] -let string_of_explicit_type = function - | Boolean -> "boolean" - | Number -> "number" - | String -> "string" - | Symbol -> "symbol" diff --git a/compiler/js_parser/enum_parser.ml b/compiler/js_parser/enum_parser.ml deleted file mode 100644 index e5eb0272e4..0000000000 --- a/compiler/js_parser/enum_parser.ml +++ /dev/null @@ -1,435 +0,0 @@ -(* - * 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 Flow_ast -open Parser_common -open Parser_env -open Token - -module Enum (Parse : Parser_common.PARSER) : sig - val declaration : env -> (Loc.t, Loc.t) Statement.t -end = struct - open Flow_ast.Statement.EnumDeclaration - - type members = { - boolean_members: (Loc.t BooleanLiteral.t, Loc.t) InitializedMember.t list; - number_members: (Loc.t NumberLiteral.t, Loc.t) InitializedMember.t list; - string_members: (Loc.t StringLiteral.t, Loc.t) InitializedMember.t list; - defaulted_members: Loc.t DefaultedMember.t list; - } - - type acc = { - members: members; - seen_names: SSet.t; - has_unknown_members: bool; - internal_comments: Loc.t Comment.t list; - } - - type init = - | NoInit - | InvalidInit of Loc.t - | BooleanInit of Loc.t * Loc.t BooleanLiteral.t - | NumberInit of Loc.t * Loc.t NumberLiteral.t - | StringInit of Loc.t * Loc.t StringLiteral.t - - let empty_members = - { boolean_members = []; number_members = []; string_members = []; defaulted_members = [] } - - let empty_acc = - { - members = empty_members; - seen_names = SSet.empty; - has_unknown_members = false; - internal_comments = []; - } - - let end_of_member_init env = - match Peek.token env with - | T_SEMICOLON - | T_COMMA - | T_RCURLY -> - true - | _ -> false - - 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_STRING (loc, value, raw, octal) -> - if octal then strict_error env Parse_error.StrictOctalLiteral; - Eat.token env; - let trailing = Eat.trailing_comments env in - if end_of_member_init env then - StringInit - ( loc, - { - StringLiteral.value; - raw; - comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing (); - } - ) - else - InvalidInit loc - | (T_TRUE | T_FALSE) as token -> - Eat.token env; - let trailing = Eat.trailing_comments env in - if end_of_member_init env then - BooleanInit - ( loc, - { - BooleanLiteral.value = token = T_TRUE; - comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing (); - } - ) - else - InvalidInit loc - | _ -> - Eat.token env; - InvalidInit loc - - let member_raw = - with_loc (fun env -> - let id = identifier_name env in - let init = - match Peek.token env with - | T_ASSIGN -> - Expect.token env T_ASSIGN; - member_init env - | T_COLON -> - let (_, { Identifier.name = member_name; _ }) = id in - error env (Parse_error.EnumInvalidInitializerSeparator { member_name }); - Expect.token env T_COLON; - member_init env - | _ -> NoInit - in - (id, init) - ) - - let check_explicit_type_mismatch env ~enum_name ~explicit_type ~member_name literal_type loc = - match explicit_type with - | Some enum_type when enum_type <> literal_type -> - error_at - env - (loc, Parse_error.EnumInvalidMemberInitializer { enum_name; explicit_type; member_name }) - | _ -> () - - let is_a_to_z c = c >= 'a' && c <= 'z' - - let enum_member ~enum_name ~explicit_type acc env = - let { members; seen_names; _ } = acc in - let (member_loc, (id, init)) = member_raw env in - let (id_loc, { Identifier.name = member_name; _ }) = id in - (* if we parsed an empty name, something has gone wrong and we should abort analysis *) - if member_name = "" then - acc - else ( - if is_a_to_z @@ member_name.[0] then - error_at env (id_loc, Parse_error.EnumInvalidMemberName { enum_name; member_name }); - if SSet.mem member_name seen_names then - error_at env (id_loc, Parse_error.EnumDuplicateMemberName { enum_name; member_name }); - let acc = { acc with seen_names = SSet.add member_name seen_names } in - let check_explicit_type_mismatch = - check_explicit_type_mismatch env ~enum_name ~explicit_type ~member_name - in - match init with - | BooleanInit (loc, value) -> - check_explicit_type_mismatch Enum_common.Boolean loc; - let member = (member_loc, { InitializedMember.id; init = (loc, value) }) in - { acc with members = { members with boolean_members = member :: members.boolean_members } } - | NumberInit (loc, value) -> - check_explicit_type_mismatch Enum_common.Number loc; - let member = (member_loc, { InitializedMember.id; init = (loc, value) }) in - { acc with members = { members with number_members = member :: members.number_members } } - | StringInit (loc, value) -> - check_explicit_type_mismatch Enum_common.String loc; - let member = (member_loc, { InitializedMember.id; init = (loc, value) }) in - { acc with members = { members with string_members = member :: members.string_members } } - | InvalidInit loc -> - error_at - env - (loc, Parse_error.EnumInvalidMemberInitializer { enum_name; explicit_type; member_name }); - acc - | NoInit -> - begin - match explicit_type with - | Some Enum_common.Boolean -> - error_at - env - (member_loc, Parse_error.EnumBooleanMemberNotInitialized { enum_name; member_name }); - acc - | Some Enum_common.Number -> - error_at - env - (member_loc, Parse_error.EnumNumberMemberNotInitialized { enum_name; member_name }); - acc - | Some Enum_common.String - | Some Enum_common.Symbol - | None -> - let member = (member_loc, { DefaultedMember.id }) in - { - acc with - members = { members with defaulted_members = member :: members.defaulted_members }; - } - end - ) - - let rec enum_members ~enum_name ~explicit_type acc env = - match Peek.token env with - | T_RCURLY - | T_EOF -> - ( { - boolean_members = List.rev acc.members.boolean_members; - number_members = List.rev acc.members.number_members; - string_members = List.rev acc.members.string_members; - defaulted_members = List.rev acc.members.defaulted_members; - }, - acc.has_unknown_members, - acc.internal_comments - ) - | T_ELLIPSIS -> - let loc = Peek.loc env in - (* Internal comments may appear before the ellipsis *) - let internal_comments = Peek.comments env in - Eat.token env; - (match Peek.token env with - | T_RCURLY - | T_EOF -> - () - | T_COMMA -> - Expect.token env T_COMMA; - let trailing_comma = - match Peek.token env with - | T_RCURLY - | T_EOF -> - true - | _ -> false - in - error_at env (loc, Parse_error.EnumInvalidEllipsis { trailing_comma }) - | _ -> error_at env (loc, Parse_error.EnumInvalidEllipsis { trailing_comma = false })); - enum_members - ~enum_name - ~explicit_type - { acc with has_unknown_members = true; internal_comments } - env - | _ -> - let acc = enum_member ~enum_name ~explicit_type acc env in - (match Peek.token env with - | T_RCURLY - | T_EOF -> - () - | T_SEMICOLON -> - error env Parse_error.EnumInvalidMemberSeparator; - Expect.token env T_SEMICOLON - | _ -> Expect.token env T_COMMA); - enum_members ~enum_name ~explicit_type acc env - - let string_body - ~env ~enum_name ~is_explicit ~has_unknown_members string_members defaulted_members comments = - let initialized_len = List.length string_members in - let defaulted_len = List.length defaulted_members in - let defaulted_body () = - StringBody - { - StringBody.members = StringBody.Defaulted defaulted_members; - explicit_type = is_explicit; - has_unknown_members; - comments; - } - in - let initialized_body () = - StringBody - { - StringBody.members = StringBody.Initialized string_members; - explicit_type = is_explicit; - has_unknown_members; - comments; - } - in - match (initialized_len, defaulted_len) with - | (0, 0) - | (0, _) -> - defaulted_body () - | (_, 0) -> initialized_body () - | _ when defaulted_len > initialized_len -> - List.iter - (fun (loc, _) -> - error_at env (loc, Parse_error.EnumStringMemberInconsistentlyInitailized { enum_name })) - string_members; - defaulted_body () - | _ -> - List.iter - (fun (loc, _) -> - error_at env (loc, Parse_error.EnumStringMemberInconsistentlyInitailized { enum_name })) - defaulted_members; - initialized_body () - - let parse_explicit_type ~enum_name env = - if Eat.maybe env T_OF then ( - Eat.push_lex_mode env Lex_mode.TYPE; - let result = - match Peek.token env with - | T_BOOLEAN_TYPE BOOLEAN -> Some Enum_common.Boolean - | T_NUMBER_TYPE -> Some Enum_common.Number - | T_STRING_TYPE -> Some Enum_common.String - | T_SYMBOL_TYPE -> Some Enum_common.Symbol - | T_IDENTIFIER { value; _ } -> - let supplied_type = Some value in - error env (Parse_error.EnumInvalidExplicitType { enum_name; supplied_type }); - None - | _ -> - error env (Parse_error.EnumInvalidExplicitType { enum_name; supplied_type = None }); - None - in - Eat.token env; - Eat.pop_lex_mode env; - result - ) else - None - - let enum_body ~enum_name ~name_loc = - with_loc (fun env -> - let explicit_type = parse_explicit_type ~enum_name env in - let leading = - if explicit_type <> None then - Peek.comments env - else - [] - in - Expect.token env T_LCURLY; - let (members, has_unknown_members, internal) = - enum_members ~enum_name ~explicit_type empty_acc env - in - let internal = internal @ Peek.comments env in - Expect.token env T_RCURLY; - let trailing = - match Peek.token env with - | T_EOF - | T_RCURLY -> - Eat.trailing_comments env - | _ when Peek.is_line_terminator env -> Eat.comments_until_next_line env - | _ -> [] - in - let comments = - Flow_ast_utils.mk_comments_with_internal_opt ~leading ~trailing ~internal () - in - let body = - match explicit_type with - | Some Enum_common.Boolean -> - BooleanBody - { - BooleanBody.members = members.boolean_members; - explicit_type = true; - has_unknown_members; - comments; - } - | Some Enum_common.Number -> - NumberBody - { - NumberBody.members = members.number_members; - explicit_type = true; - has_unknown_members; - comments; - } - | Some Enum_common.String -> - string_body - ~env - ~enum_name - ~is_explicit:true - ~has_unknown_members - members.string_members - members.defaulted_members - comments - | Some Enum_common.Symbol -> - SymbolBody - { SymbolBody.members = members.defaulted_members; has_unknown_members; comments } - | None -> - let bools_len = List.length members.boolean_members in - let nums_len = List.length members.number_members in - let strs_len = List.length members.string_members in - let defaulted_len = List.length members.defaulted_members in - let empty () = - StringBody - { - StringBody.members = StringBody.Defaulted []; - explicit_type = false; - has_unknown_members; - comments; - } - in - begin - match (bools_len, nums_len, strs_len, defaulted_len) with - | (0, 0, 0, 0) -> empty () - | (0, 0, _, _) -> - string_body - ~env - ~enum_name - ~is_explicit:false - ~has_unknown_members - members.string_members - members.defaulted_members - comments - | (_, 0, 0, _) when bools_len >= defaulted_len -> - List.iter - (fun (loc, { DefaultedMember.id = (_, { Identifier.name = member_name; _ }) }) -> - error_at - env - (loc, Parse_error.EnumBooleanMemberNotInitialized { enum_name; member_name })) - members.defaulted_members; - BooleanBody - { - BooleanBody.members = members.boolean_members; - explicit_type = false; - has_unknown_members; - comments; - } - | (0, _, 0, _) when nums_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; - NumberBody - { - NumberBody.members = members.number_members; - explicit_type = false; - has_unknown_members; - comments; - } - | _ -> - error_at env (name_loc, Parse_error.EnumInconsistentMemberValues { enum_name }); - empty () - end - in - body - ) - - let declaration = - with_loc (fun env -> - let leading = Peek.comments env in - Expect.token env T_ENUM; - let id = Parse.identifier env in - let (name_loc, { Identifier.name = enum_name; _ }) = id in - let body = enum_body ~enum_name ~name_loc env in - let comments = Flow_ast_utils.mk_comments_opt ~leading () in - Statement.EnumDeclaration { id; body; comments } - ) -end diff --git a/compiler/js_parser/expression_parser.ml b/compiler/js_parser/expression_parser.ml deleted file mode 100644 index f35eda7277..0000000000 --- a/compiler/js_parser/expression_parser.ml +++ /dev/null @@ -1,1734 +0,0 @@ -(* - * 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 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 sequence : - env -> start_loc:Loc.t -> (Loc.t, Loc.t) Expression.t list -> (Loc.t, Loc.t) Expression.t -end - -module Expression - (Parse : PARSER) - (Type : Type_parser.TYPE) - (Declaration : Declaration_parser.DECLARATION) - (Pattern_cover : Pattern_cover.COVER) : EXPRESSION = struct - type op_precedence = - | Left_assoc of int - | Right_assoc of int - - type group_cover = - | Group_expr of (Loc.t, Loc.t) Expression.t - | Group_typecast of (Loc.t, Loc.t) Expression.TypeCast.t - - let is_tighter a b = - let a_prec = - match a with - | Left_assoc x -> x - | Right_assoc x -> x - 1 - in - let b_prec = - match b with - | Left_assoc x -> x - | Right_assoc x -> x - in - a_prec >= b_prec - - let is_assignable_lhs = - let open Expression in - function - | ( _, - MetaProperty - { - MetaProperty.meta = (_, { Identifier.name = "new"; comments = _ }); - property = (_, { Identifier.name = "target"; comments = _ }); - comments = _; - } - ) -> - false - | ( _, - MetaProperty - { - MetaProperty.meta = (_, { Identifier.name = "import"; comments = _ }); - property = (_, { Identifier.name = "meta"; comments = _ }); - comments = _; - } - ) -> - false - (* #sec-static-semantics-static-semantics-isvalidsimpleassignmenttarget *) - | (_, Array _) - | (_, Identifier _) - | (_, Member _) - | (_, MetaProperty _) - | (_, Object _) -> - true - | (_, ArrowFunction _) - | (_, Assignment _) - | (_, Binary _) - | (_, Call _) - | (_, Class _) - | (_, Comprehension _) - | (_, Conditional _) - | (_, Function _) - | (_, Generator _) - | (_, Import _) - | (_, JSXElement _) - | (_, JSXFragment _) - | (_, Literal _) - | (_, Logical _) - | (_, New _) - | (_, OptionalCall _) - | (_, OptionalMember _) - | (_, Sequence _) - | (_, Super _) - | (_, TaggedTemplate _) - | (_, TemplateLiteral _) - | (_, This _) - | (_, TypeCast _) - | (_, Unary _) - | (_, Update _) - | (_, Yield _) -> - false - - let as_expression = Pattern_cover.as_expression - - let as_pattern = Pattern_cover.as_pattern - - (* AssignmentExpression : - * [+Yield] YieldExpression - * ConditionalExpression - * LeftHandSideExpression = AssignmentExpression - * LeftHandSideExpression AssignmentOperator AssignmentExpression - * ArrowFunctionFunction - * - * Originally we were parsing this without backtracking, but - * ArrowFunctionExpression got too tricky. Oh well. - *) - let rec assignment_cover = - let assignment_but_not_arrow_function_cover env = - let start_loc = Peek.loc env in - let expr_or_pattern = conditional_cover env in - match assignment_op env with - | Some operator -> - let expr = - with_loc - ~start_loc - (fun env -> - let left = as_pattern env expr_or_pattern in - let right = assignment env in - Expression.(Assignment { Assignment.operator; left; right; comments = None })) - env - in - Cover_expr expr - | _ -> expr_or_pattern - in - let error_callback _ = function - (* Don't rollback on these errors. *) - | Parse_error.StrictReservedWord -> () - (* Everything else causes a rollback *) - | _ -> raise Try.Rollback - (* So we may or may not be parsing the first part of an arrow function - * (the part before the =>). We might end up parsing that whole thing or - * we might end up parsing only part of it and thinking we're done. We - * need to look at the next token to figure out if we really parsed an - * assignment expression or if this is just the beginning of an arrow - * function *) - in - let try_assignment_but_not_arrow_function env = - let env = env |> with_error_callback error_callback in - let ret = assignment_but_not_arrow_function_cover env in - match Peek.token env with - | T_ARROW -> - (* x => 123 *) - raise Try.Rollback - | T_COLON - when match last_token env with - | Some T_RPAREN -> true - | _ -> false -> - (* (x): number => 123 *) - raise Try.Rollback - (* async x => 123 -- and we've already parsed async as an identifier - * expression *) - | _ when Peek.is_identifier env -> - begin - match ret with - | Cover_expr (_, Expression.Identifier (_, { Identifier.name = "async"; comments = _ })) - when not (Peek.is_line_terminator env) -> - raise Try.Rollback - | _ -> ret - end - | _ -> ret - in - fun env -> - match (Peek.token env, Peek.is_identifier env) with - | (T_YIELD, _) when allow_yield env -> Cover_expr (yield env) - | ((T_LPAREN as t), _) - | ((T_LESS_THAN as t), _) - | ((T_THIS as t), _) - | (t, true) -> - (* Ok, we don't know if this is going to be an arrow function or a - * regular assignment expression. Let's first try to parse it as an - * assignment expression. If that fails we'll try an arrow function. - * Unless it begins with `async <` in which case we first try parsing - * it as an arrow function, and then an assignment expression. - *) - let (initial, secondary) = - if t = T_ASYNC && should_parse_types env && Peek.ith_token ~i:1 env = T_LESS_THAN then - (try_arrow_function, try_assignment_but_not_arrow_function) - else - (try_assignment_but_not_arrow_function, try_arrow_function) - in - (match Try.to_parse env initial with - | Try.ParsedSuccessfully expr -> expr - | Try.FailedToParse -> - (match Try.to_parse env secondary with - | Try.ParsedSuccessfully expr -> expr - | Try.FailedToParse -> - (* Well shoot. It doesn't parse cleanly as a normal - * expression or as an arrow_function. Let's treat it as a - * normal assignment expression gone wrong *) - assignment_but_not_arrow_function_cover env)) - | _ -> assignment_but_not_arrow_function_cover env - - and assignment env = as_expression env (assignment_cover env) - - and yield env = - with_loc - (fun env -> - if in_formal_parameters env then error env Parse_error.YieldInFormalParameters; - let leading = Peek.comments env in - let start_loc = Peek.loc env in - Expect.token env T_YIELD; - let end_loc = Peek.loc env in - let (argument, delegate) = - if Peek.is_implicit_semicolon env then - (None, false) - else - let delegate = Eat.maybe env T_MULT in - let has_argument = - match Peek.token env with - | T_SEMICOLON - | T_RBRACKET - | T_RCURLY - | T_RPAREN - | T_COLON - | T_COMMA -> - false - | _ -> true - in - let argument = - if delegate || has_argument then - Some (assignment env) - else - None - in - (argument, delegate) - in - let trailing = - match argument with - | None -> Eat.trailing_comments env - | Some _ -> [] - in - let open Expression in - Yield - Yield. - { - argument; - delegate; - comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing (); - result_out = Loc.btwn start_loc end_loc; - } - ) - env - - and is_lhs = - let open Expression in - function - | ( _, - MetaProperty - { - MetaProperty.meta = (_, { Identifier.name = "new"; comments = _ }); - property = (_, { Identifier.name = "target"; comments = _ }); - comments = _; - } - ) -> - false - | ( _, - MetaProperty - { - MetaProperty.meta = (_, { Identifier.name = "import"; comments = _ }); - property = (_, { Identifier.name = "meta"; comments = _ }); - comments = _; - } - ) -> - false - (* #sec-static-semantics-static-semantics-isvalidsimpleassignmenttarget *) - | (_, Identifier _) - | (_, Member _) - | (_, MetaProperty _) -> - true - | (_, Array _) - | (_, ArrowFunction _) - | (_, Assignment _) - | (_, Binary _) - | (_, Call _) - | (_, Class _) - | (_, Comprehension _) - | (_, Conditional _) - | (_, Function _) - | (_, Generator _) - | (_, Import _) - | (_, JSXElement _) - | (_, JSXFragment _) - | (_, Literal _) - | (_, Logical _) - | (_, New _) - | (_, Object _) - | (_, OptionalCall _) - | (_, OptionalMember _) - | (_, Sequence _) - | (_, Super _) - | (_, TaggedTemplate _) - | (_, TemplateLiteral _) - | (_, This _) - | (_, TypeCast _) - | (_, Unary _) - | (_, Update _) - | (_, Yield _) -> - false - - and assignment_op env = - let op = - let open Expression.Assignment in - match Peek.token env with - | T_RSHIFT3_ASSIGN -> Some (Some RShift3Assign) - | T_RSHIFT_ASSIGN -> Some (Some RShiftAssign) - | T_LSHIFT_ASSIGN -> Some (Some LShiftAssign) - | T_BIT_XOR_ASSIGN -> Some (Some BitXorAssign) - | T_BIT_OR_ASSIGN -> Some (Some BitOrAssign) - | T_BIT_AND_ASSIGN -> Some (Some BitAndAssign) - | T_MOD_ASSIGN -> Some (Some ModAssign) - | T_DIV_ASSIGN -> Some (Some DivAssign) - | T_MULT_ASSIGN -> Some (Some MultAssign) - | T_EXP_ASSIGN -> Some (Some ExpAssign) - | T_MINUS_ASSIGN -> Some (Some MinusAssign) - | T_PLUS_ASSIGN -> Some (Some PlusAssign) - | T_NULLISH_ASSIGN -> Some (Some NullishAssign) - | T_AND_ASSIGN -> Some (Some AndAssign) - | T_OR_ASSIGN -> Some (Some OrAssign) - | T_ASSIGN -> Some None - | _ -> None - in - if op <> None then Eat.token env; - op - - (* ConditionalExpression : - * LogicalExpression - * LogicalExpression ? AssignmentExpression : AssignmentExpression - *) - and conditional_cover env = - let start_loc = Peek.loc env in - let expr = logical_cover env in - if Peek.token env = T_PLING then ( - Eat.token env; - - (* no_in is ignored for the consequent *) - let env' = env |> with_no_in false in - let consequent = assignment env' in - Expect.token env T_COLON; - let (loc, alternate) = with_loc ~start_loc assignment env in - Cover_expr - ( loc, - let open Expression in - Conditional - { Conditional.test = as_expression env expr; consequent; alternate; comments = None } - ) - ) else - expr - - and conditional env = as_expression env (conditional_cover env) - - (* - * LogicalANDExpression : - * BinaryExpression - * LogicalANDExpression && BitwiseORExpression - * - * LogicalORExpression : - * LogicalANDExpression - * LogicalORExpression || LogicalANDExpression - * LogicalORExpression ?? LogicalANDExpression - * - * LogicalExpression : - * LogicalORExpression - *) - and logical_cover = - let open Expression in - let make_logical env left right operator loc = - let left = as_expression env left in - let right = as_expression env right in - Cover_expr (loc, Logical { Logical.operator; left; right; comments = None }) - in - let rec logical_and env left lloc = - match Peek.token env with - | T_AND -> - Eat.token env; - let (rloc, right) = with_loc binary_cover env in - let loc = Loc.btwn lloc rloc in - let left = make_logical env left right Logical.And loc in - (* `a && b ?? c` is an error, but to recover, try to parse it like `(a && b) ?? c`. *) - let (loc, left) = coalesce ~allowed:false env left loc in - logical_and env left loc - | _ -> (lloc, left) - and logical_or env left lloc = - match Peek.token env with - | T_OR -> - Eat.token env; - let (rloc, right) = with_loc binary_cover env in - let (rloc, right) = logical_and env right rloc in - let loc = Loc.btwn lloc rloc in - let left = make_logical env left right Logical.Or loc in - (* `a || b ?? c` is an error, but to recover, try to parse it like `(a || b) ?? c`. *) - let (loc, left) = coalesce ~allowed:false env left loc in - logical_or env left loc - | _ -> (lloc, left) - and coalesce ~allowed env left lloc = - match Peek.token env with - | T_PLING_PLING -> - if not allowed then error env (Parse_error.NullishCoalescingUnexpectedLogical "??"); - - Expect.token env T_PLING_PLING; - let (rloc, right) = with_loc binary_cover env in - let (rloc, right) = - match Peek.token env with - | (T_AND | T_OR) as t -> - (* `a ?? b || c` is an error. To recover, treat it like `a ?? (b || c)`. *) - error env (Parse_error.NullishCoalescingUnexpectedLogical (Token.value_of_token t)); - let (rloc, right) = logical_and env right rloc in - logical_or env right rloc - | _ -> (rloc, right) - in - let loc = Loc.btwn lloc rloc in - coalesce ~allowed:true env (make_logical env left right Logical.NullishCoalesce loc) loc - | _ -> (lloc, left) - in - fun env -> - let (loc, left) = with_loc binary_cover env in - let (_, left) = - match Peek.token env with - | T_PLING_PLING -> coalesce ~allowed:true env left loc - | _ -> - let (loc, left) = logical_and env left loc in - logical_or env left loc - in - left - - and binary_cover = - let binary_op env = - let ret = - let open Expression.Binary in - match Peek.token env with - (* Most BinaryExpression operators are left associative *) - (* Lowest pri *) - | T_BIT_OR -> Some (BitOr, Left_assoc 2) - | T_BIT_XOR -> Some (Xor, Left_assoc 3) - | T_BIT_AND -> Some (BitAnd, Left_assoc 4) - | T_EQUAL -> Some (Equal, Left_assoc 5) - | T_STRICT_EQUAL -> Some (StrictEqual, Left_assoc 5) - | T_NOT_EQUAL -> Some (NotEqual, Left_assoc 5) - | T_STRICT_NOT_EQUAL -> Some (StrictNotEqual, Left_assoc 5) - | T_LESS_THAN -> Some (LessThan, Left_assoc 6) - | T_LESS_THAN_EQUAL -> Some (LessThanEqual, Left_assoc 6) - | T_GREATER_THAN -> Some (GreaterThan, Left_assoc 6) - | T_GREATER_THAN_EQUAL -> Some (GreaterThanEqual, Left_assoc 6) - | T_IN -> - if no_in env then - None - else - Some (In, Left_assoc 6) - | T_INSTANCEOF -> Some (Instanceof, Left_assoc 6) - | T_LSHIFT -> Some (LShift, Left_assoc 7) - | T_RSHIFT -> Some (RShift, Left_assoc 7) - | T_RSHIFT3 -> Some (RShift3, Left_assoc 7) - | T_PLUS -> Some (Plus, Left_assoc 8) - | T_MINUS -> Some (Minus, Left_assoc 8) - | T_MULT -> Some (Mult, Left_assoc 9) - | T_DIV -> Some (Div, Left_assoc 9) - | T_MOD -> Some (Mod, Left_assoc 9) - | T_EXP -> Some (Exp, Right_assoc 10) - (* Highest priority *) - | _ -> None - in - if ret <> None then Eat.token env; - ret - in - let make_binary left right operator loc = - (loc, Expression.(Binary Binary.{ operator; left; right; comments = None })) - in - let rec add_to_stack right (rop, rpri) rloc = function - | (left, (lop, lpri), lloc) :: rest when is_tighter lpri rpri -> - let loc = Loc.btwn lloc rloc in - let right = make_binary left right lop loc in - add_to_stack right (rop, rpri) loc rest - | stack -> (right, (rop, rpri), rloc) :: stack - in - let rec collapse_stack right rloc = function - | [] -> right - | (left, (lop, _), lloc) :: rest -> - let loc = Loc.btwn lloc rloc in - collapse_stack (make_binary left right lop loc) loc rest - in - let rec helper env stack = - let (right_loc, (is_unary, right)) = - with_loc - (fun env -> - let is_unary = peek_unary_op env <> None in - let right = unary_cover (env |> with_no_in false) in - (is_unary, right)) - env - in - ( if Peek.token env = T_LESS_THAN then - match right with - | Cover_expr (_, Expression.JSXElement _) -> error env Parse_error.AdjacentJSXElements - | _ -> () - ); - match (stack, binary_op env) with - | ([], None) -> right - | (_, None) -> - let right = as_expression env right in - Cover_expr (collapse_stack right right_loc stack) - | (_, Some (rop, rpri)) -> - if is_unary && rop = Expression.Binary.Exp then - error_at env (right_loc, Parse_error.InvalidLHSInExponentiation); - let right = as_expression env right in - helper env (add_to_stack right (rop, rpri) right_loc stack) - in - (fun env -> helper env []) - - and peek_unary_op env = - let open Expression.Unary in - match Peek.token env with - | T_NOT -> Some Not - | T_BIT_NOT -> Some BitNot - | T_PLUS -> Some Plus - | T_MINUS -> Some Minus - | T_TYPEOF -> Some Typeof - | T_VOID -> Some Void - | T_DELETE -> Some Delete - (* If we are in a unary expression context, and within an async function, - * assume that a use of "await" is intended as a keyword, not an ordinary - * identifier. This is a little bit inconsistent, since it can be used as - * an identifier in other contexts (such as a variable name), but it's how - * Babel does it. *) - | T_AWAIT when allow_await env -> Some Await - | _ -> None - - and unary_cover env = - let start_loc = Peek.loc env in - let leading = Peek.comments env in - let op = peek_unary_op env in - match op with - | None -> - let op = - let open Expression.Update in - match Peek.token env with - | T_INCR -> Some Increment - | T_DECR -> Some Decrement - | _ -> None - in - (match op with - | None -> postfix_cover env - | Some operator -> - Eat.token env; - let (loc, argument) = with_loc ~start_loc unary env in - if not (is_lhs argument) then error_at env (fst argument, Parse_error.InvalidLHSInAssignment); - (match argument with - | (_, Expression.Identifier (_, { Identifier.name; comments = _ })) when is_restricted name - -> - strict_error env Parse_error.StrictLHSPrefix - | _ -> ()); - Cover_expr - ( loc, - Expression.( - Update - { - Update.operator; - prefix = true; - argument; - comments = Flow_ast_utils.mk_comments_opt ~leading (); - } - ) - )) - | Some operator -> - Eat.token env; - let (loc, argument) = with_loc ~start_loc unary env in - let open Expression in - (match (operator, argument) with - | (Unary.Delete, (_, Identifier _)) -> strict_error_at env (loc, Parse_error.StrictDelete) - | (Unary.Delete, (_, Member member)) -> - begin - match member.Ast.Expression.Member.property with - | Ast.Expression.Member.PropertyPrivateName _ -> - error_at env (loc, Parse_error.PrivateDelete) - | _ -> () - end - | _ -> ()); - Cover_expr - ( loc, - let open Expression in - Unary { Unary.operator; argument; comments = Flow_ast_utils.mk_comments_opt ~leading () } - ) - - and unary env = as_expression env (unary_cover env) - - and postfix_cover env = - let argument = left_hand_side_cover env in - (* No line terminator allowed before operator *) - if Peek.is_line_terminator env then - argument - else - let op = - let open Expression.Update in - match Peek.token env with - | T_INCR -> Some Increment - | T_DECR -> Some Decrement - | _ -> None - in - match op with - | None -> argument - | Some operator -> - let argument = as_expression env argument in - if not (is_lhs argument) then error_at env (fst argument, Parse_error.InvalidLHSInAssignment); - (match argument with - | (_, Expression.Identifier (_, { Identifier.name; comments = _ })) when is_restricted name - -> - strict_error env Parse_error.StrictLHSPostfix - | _ -> ()); - let end_loc = Peek.loc env in - Eat.token env; - let trailing = Eat.trailing_comments env in - let loc = Loc.btwn (fst argument) end_loc in - Cover_expr - ( loc, - Expression.( - Update - { - Update.operator; - prefix = false; - argument; - comments = Flow_ast_utils.mk_comments_opt ~trailing (); - } - ) - ) - - and left_hand_side_cover env = - let start_loc = Peek.loc env in - let allow_new = not (no_new env) in - let env = with_no_new false env in - let expr = - match Peek.token env with - | T_NEW when allow_new -> Cover_expr (new_expression env) - | T_IMPORT -> Cover_expr (import env) - | T_SUPER -> Cover_expr (super env) - | _ when Peek.is_function env -> Cover_expr (_function env) - | _ -> primary_cover env - in - call_cover env start_loc expr - - and left_hand_side env = as_expression env (left_hand_side_cover env) - - and super env = - let (allowed, call_allowed) = - match allow_super env with - | No_super -> (false, false) - | Super_prop -> (true, false) - | Super_prop_or_call -> (true, true) - in - let loc = Peek.loc env in - let leading = Peek.comments env in - Expect.token env T_SUPER; - let trailing = Eat.trailing_comments env in - let super = - ( loc, - Expression.Super - { Expression.Super.comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () } - ) - in - match Peek.token env with - | T_PERIOD - | T_LBRACKET -> - let super = - if not allowed then ( - error_at env (loc, Parse_error.UnexpectedSuper); - (loc, Expression.Identifier (Flow_ast_utils.ident_of_source (loc, "super"))) - ) else - super - in - call ~allow_optional_chain:false env loc super - | T_LPAREN -> - let super = - if not call_allowed then ( - error_at env (loc, Parse_error.UnexpectedSuperCall); - (loc, Expression.Identifier (Flow_ast_utils.ident_of_source (loc, "super"))) - ) else - super - in - call ~allow_optional_chain:false env loc super - | _ -> - if not allowed then - error_at env (loc, Parse_error.UnexpectedSuper) - else - error_unexpected ~expected:"either a call or access of `super`" env; - super - - and import env = - with_loc - (fun env -> - let leading = Peek.comments env in - let start_loc = Peek.loc env in - Expect.token env T_IMPORT; - if Eat.maybe env T_PERIOD then ( - (* import.meta *) - let import_ident = Flow_ast_utils.ident_of_source (start_loc, "import") in - let meta_loc = Peek.loc env in - Expect.identifier env "meta"; - let meta_ident = Flow_ast_utils.ident_of_source (meta_loc, "meta") in - let trailing = Eat.trailing_comments env in - Expression.MetaProperty - { - Expression.MetaProperty.meta = import_ident; - property = meta_ident; - comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing (); - } - ) else - let leading_arg = Peek.comments env in - Expect.token env T_LPAREN; - let argument = add_comments (assignment (with_no_in false env)) ~leading:leading_arg in - Expect.token env T_RPAREN; - let trailing = Eat.trailing_comments env in - Expression.Import - { - Expression.Import.argument; - comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing (); - }) - env - - and call_cover ?(allow_optional_chain = true) ?(in_optional_chain = false) env start_loc left = - let left = member_cover ~allow_optional_chain ~in_optional_chain env start_loc left in - let optional = - match last_token env with - | Some T_PLING_PERIOD -> true - | _ -> false - in - let left_to_callee env = - let { remove_trailing; _ } = trailing_and_remover env in - remove_trailing (as_expression env left) (fun remover left -> remover#expression left) - in - let arguments ?targs env callee = - let (args_loc, arguments) = arguments env in - let loc = Loc.btwn start_loc args_loc in - let call = - { Expression.Call.callee; targs; arguments = (args_loc, arguments); comments = None } - in - let call = - if optional || in_optional_chain then - let open Expression in - OptionalCall { OptionalCall.call; optional; filtered_out = loc } - else - Expression.Call call - in - let in_optional_chain = in_optional_chain || optional in - call_cover ~allow_optional_chain ~in_optional_chain env start_loc (Cover_expr (loc, call)) - in - if no_call env then - left - else - match Peek.token env with - | T_LPAREN -> arguments env (left_to_callee env) - | T_LSHIFT - | T_LESS_THAN - when should_parse_types env -> - (* If we are parsing types, then f(e) is a function call with a - type application. If we aren't, it's a nested binary expression. *) - let error_callback _ _ = raise Try.Rollback in - let env = env |> with_error_callback error_callback in - (* Parameterized call syntax is ambiguous, so we fall back to - standard parsing if it fails. *) - Try.or_else env ~fallback:left (fun env -> - let callee = left_to_callee env in - let targs = call_type_args env in - arguments ?targs env callee - ) - | _ -> left - - and call ?(allow_optional_chain = true) env start_loc left = - as_expression env (call_cover ~allow_optional_chain env start_loc (Cover_expr left)) - - and new_expression env = - with_loc - (fun env -> - let start_loc = Peek.loc env in - let leading = Peek.comments env in - Expect.token env T_NEW; - - if in_function env && Peek.token env = T_PERIOD then ( - let trailing = Eat.trailing_comments env in - Eat.token env; - let meta = - Flow_ast_utils.ident_of_source - (start_loc, "new") - ?comments:(Flow_ast_utils.mk_comments_opt ~leading ~trailing ()) - in - match Peek.token env with - | T_IDENTIFIER { raw = "target"; _ } -> - let property = Parse.identifier env in - Expression.(MetaProperty MetaProperty.{ meta; property; comments = None }) - | _ -> - error_unexpected ~expected:"the identifier `target`" env; - Eat.token env; - - (* skip unknown identifier *) - Expression.Identifier meta - (* return `new` identifier *) - ) else - let callee_loc = Peek.loc env in - let expr = - match Peek.token env with - | T_NEW -> new_expression env - | T_SUPER -> super (env |> with_no_call true) - | _ when Peek.is_function env -> _function env - | _ -> primary env - in - let callee = - member ~allow_optional_chain:false (env |> with_no_call true) callee_loc expr - in - (* You can do something like - * new raw`42` - *) - let callee = - let callee = - match Peek.token env with - | T_TEMPLATE_PART part -> tagged_template env callee_loc callee part - | _ -> callee - in - (* Remove trailing comments if the callee is followed by args or type args *) - if Peek.token env = T_LPAREN || (should_parse_types env && Peek.token env = T_LESS_THAN) - then - let { remove_trailing; _ } = trailing_and_remover env in - remove_trailing callee (fun remover callee -> remover#expression callee) - else - callee - in - let targs = - (* If we are parsing types, then new C(e) is a constructor with a - type application. If we aren't, it's a nested binary expression. *) - if should_parse_types env then - (* Parameterized call syntax is ambiguous, so we fall back to - standard parsing if it fails. *) - let error_callback _ _ = raise Try.Rollback in - let env = env |> with_error_callback error_callback in - Try.or_else env ~fallback:None call_type_args - else - None - in - let arguments = - match Peek.token env with - | T_LPAREN -> Some (arguments env) - | _ -> None - in - let comments = Flow_ast_utils.mk_comments_opt ~leading () in - Expression.(New New.{ callee; targs; arguments; comments })) - env - - and call_type_args = - let args = - let rec args_helper env acc = - match Peek.token env with - | T_EOF - | T_GREATER_THAN -> - List.rev acc - | _ -> - let t = - match Peek.token env with - | T_IDENTIFIER { value = "_"; _ } -> - let loc = Peek.loc env in - let leading = Peek.comments env in - Expect.identifier env "_"; - let trailing = Eat.trailing_comments env in - Expression.CallTypeArg.Implicit - ( loc, - { - Expression.CallTypeArg.Implicit.comments = - Flow_ast_utils.mk_comments_opt ~leading ~trailing (); - } - ) - | _ -> Expression.CallTypeArg.Explicit (Type._type env) - in - let acc = t :: acc in - if Peek.token env <> T_GREATER_THAN then Expect.token env T_COMMA; - args_helper env acc - in - fun env -> - let leading = Peek.comments env in - Expect.token env T_LESS_THAN; - let arguments = args_helper env [] in - let internal = Peek.comments env in - Expect.token env T_GREATER_THAN; - let trailing = - if Peek.token env = T_LPAREN then - let { trailing; _ } = trailing_and_remover env in - trailing - else - Eat.trailing_comments env - in - { - Expression.CallTypeArgs.arguments; - comments = Flow_ast_utils.mk_comments_with_internal_opt ~leading ~trailing ~internal (); - } - in - fun env -> - Eat.push_lex_mode env Lex_mode.TYPE; - let node = - if Peek.token env = T_LESS_THAN then - Some (with_loc args env) - else - None - in - Eat.pop_lex_mode env; - node - - and arguments = - let spread_element env = - let leading = Peek.comments env in - Expect.token env T_ELLIPSIS; - let argument = assignment env in - Expression.SpreadElement.{ argument; comments = Flow_ast_utils.mk_comments_opt ~leading () } - in - let argument env = - match Peek.token env with - | T_ELLIPSIS -> Expression.Spread (with_loc spread_element env) - | _ -> Expression.Expression (assignment env) - in - let rec arguments' env acc = - match Peek.token env with - | T_EOF - | T_RPAREN -> - List.rev acc - | _ -> - let acc = argument env :: acc in - if Peek.token env <> T_RPAREN then Expect.token env T_COMMA; - arguments' env acc - in - fun env -> - with_loc - (fun env -> - let leading = Peek.comments env in - Expect.token env T_LPAREN; - let args = arguments' env [] in - let internal = Peek.comments env in - Expect.token env T_RPAREN; - let trailing = Eat.trailing_comments env in - { - Expression.ArgList.arguments = args; - comments = Flow_ast_utils.mk_comments_with_internal_opt ~leading ~trailing ~internal (); - }) - env - - and member_cover = - let dynamic - ?(allow_optional_chain = true) - ?(in_optional_chain = false) - ?(optional = false) - env - start_loc - left = - let expr = Parse.expression (env |> with_no_call false) in - let last_loc = Peek.loc env in - Expect.token env T_RBRACKET; - let trailing = Eat.trailing_comments env in - let loc = Loc.btwn start_loc last_loc in - let member = - { - Expression.Member._object = as_expression env left; - property = Expression.Member.PropertyExpression expr; - comments = Flow_ast_utils.mk_comments_opt ~trailing (); - } - in - - let member = - if in_optional_chain then - let open Expression in - OptionalMember { OptionalMember.member; optional; filtered_out = loc } - else - Expression.Member member - in - call_cover ~allow_optional_chain ~in_optional_chain env start_loc (Cover_expr (loc, member)) - in - let static - ?(allow_optional_chain = true) - ?(in_optional_chain = false) - ?(optional = false) - env - start_loc - left = - let open Expression.Member in - let (id_loc, property) = - match Peek.token env with - | T_POUND -> - let ((id_loc, { Ast.PrivateName.name; _ }) as id) = private_identifier env in - add_used_private env name id_loc; - (id_loc, PropertyPrivateName id) - | _ -> - let ((id_loc, _) as id) = identifier_name env in - (id_loc, PropertyIdentifier id) - in - let loc = Loc.btwn start_loc id_loc in - (* super.PrivateName is a syntax error *) - begin - match (left, property) with - | (Cover_expr (_, Ast.Expression.Super _), PropertyPrivateName _) -> - error_at env (loc, Parse_error.SuperPrivate) - | _ -> () - end; - let member = - Expression.Member.{ _object = as_expression env left; property; comments = None } - in - let member = - if in_optional_chain then - let open Expression in - OptionalMember { OptionalMember.member; optional; filtered_out = loc } - else - Expression.Member member - in - call_cover ~allow_optional_chain ~in_optional_chain env start_loc (Cover_expr (loc, member)) - in - fun ?(allow_optional_chain = true) ?(in_optional_chain = false) env start_loc left -> - match Peek.token env with - | T_PLING_PERIOD -> - if not allow_optional_chain then error env Parse_error.OptionalChainNew; - - Expect.token env T_PLING_PERIOD; - begin - match Peek.token env with - | T_TEMPLATE_PART _ -> - error env Parse_error.OptionalChainTemplate; - left - | T_LPAREN -> left - | T_LESS_THAN when should_parse_types env -> left - | T_LBRACKET -> - Eat.token env; - dynamic ~allow_optional_chain ~in_optional_chain:true ~optional:true env start_loc left - | _ -> - static ~allow_optional_chain ~in_optional_chain:true ~optional:true env start_loc left - end - | T_LBRACKET -> - Eat.token env; - dynamic ~allow_optional_chain ~in_optional_chain env start_loc left - | T_PERIOD -> - Eat.token env; - static ~allow_optional_chain ~in_optional_chain env start_loc left - | T_TEMPLATE_PART part -> - if in_optional_chain then error env Parse_error.OptionalChainTemplate; - - let expr = tagged_template env start_loc (as_expression env left) part in - call_cover ~allow_optional_chain:false env start_loc (Cover_expr expr) - | _ -> left - - and member ?(allow_optional_chain = true) env start_loc left = - as_expression env (member_cover ~allow_optional_chain env start_loc (Cover_expr left)) - - and _function env = - with_loc - (fun env -> - let (async, leading_async) = Declaration.async env in - let (sig_loc, (id, params, generator, predicate, return, tparams, leading)) = - with_loc - (fun env -> - let leading_function = Peek.comments env in - Expect.token env T_FUNCTION; - let (generator, leading_generator) = Declaration.generator env in - let leading = List.concat [leading_async; leading_function; leading_generator] in - (* `await` is a keyword in async functions: - - proposal-async-iteration/#prod-AsyncGeneratorExpression - - #prod-AsyncFunctionExpression *) - let await = async in - (* `yield` is a keyword in generator functions: - - proposal-async-iteration/#prod-AsyncGeneratorExpression - - #prod-GeneratorExpression *) - let yield = generator in - let (id, tparams) = - if Peek.token env = T_LPAREN then - (None, None) - else - let id = - match Peek.token env with - | T_LESS_THAN -> None - | _ -> - let env = env |> with_allow_await await |> with_allow_yield yield in - let id = - id_remove_trailing - env - (Parse.identifier ~restricted_error:Parse_error.StrictFunctionName env) - in - Some id - in - let tparams = type_params_remove_trailing env (Type.type_params env) in - (id, tparams) - in - (* #sec-function-definitions-static-semantics-early-errors *) - let env = env |> with_allow_super No_super in - let params = - let params = Declaration.function_params ~await ~yield env in - if Peek.token env = T_COLON then - params - else - function_params_remove_trailing env params - in - let (return, predicate) = Type.annotation_and_predicate_opt env in - let (return, predicate) = - match predicate with - | None -> (type_annotation_hint_remove_trailing env return, predicate) - | Some _ -> (return, predicate_remove_trailing env predicate) - in - (id, params, generator, predicate, return, tparams, leading)) - env - in - let simple_params = is_simple_parameter_list params in - let (body, contains_use_strict) = - Declaration.function_body env ~async ~generator ~expression:true ~simple_params - in - Declaration.strict_post_check env ~contains_use_strict id params; - Expression.Function - { - Function.id; - params; - body; - generator; - async; - predicate; - return; - tparams; - sig_loc; - comments = Flow_ast_utils.mk_comments_opt ~leading (); - }) - env - - and number env kind raw = - let value = - match kind with - | LEGACY_OCTAL -> - strict_error env Parse_error.StrictOctalLiteral; - begin - try Int64.to_float (Int64.of_string ("0o" ^ raw)) with - | Failure _ -> failwith ("Invalid legacy octal " ^ raw) - end - | LEGACY_NON_OCTAL -> - strict_error env Parse_error.StrictNonOctalLiteral; - begin - try float_of_string raw with - | Failure _ -> failwith ("Invalid number " ^ raw) - end - | BINARY - | OCTAL -> - begin - try Int64.to_float (Int64.of_string raw) with - | Failure _ -> failwith ("Invalid binary/octal " ^ raw) - end - | NORMAL -> - begin - try float_of_string raw with - | Failure _ -> failwith ("Invalid number " ^ raw) - end - in - Expect.token env (T_NUMBER { kind; raw }); - value - - and bigint_strip_n raw = - let size = String.length raw in - let str = - if size != 0 && raw.[size - 1] == 'n' then - String.sub raw 0 (size - 1) - else - raw - in - str - - and bigint env kind raw = - let postraw = bigint_strip_n raw in - let value = Int64.of_string_opt postraw in - Expect.token env (T_BIGINT { kind; raw }); - value - - and primary_cover env = - let loc = Peek.loc env in - let leading = Peek.comments env in - match Peek.token env with - | T_THIS -> - Eat.token env; - let trailing = Eat.trailing_comments env in - Cover_expr - ( loc, - Expression.This - { Expression.This.comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () } - ) - | T_NUMBER { kind; raw } -> - let value = Literal.Number (number env kind raw) in - let trailing = Eat.trailing_comments env in - Cover_expr - ( loc, - let open Expression in - Literal - { Literal.value; raw; comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () } - ) - | T_BIGINT { kind; raw } -> - let value = Literal.BigInt (bigint env kind raw) in - let trailing = Eat.trailing_comments env in - Cover_expr - ( loc, - let open Expression in - Literal - { Literal.value; raw; comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () } - ) - | T_STRING (loc, value, raw, octal) -> - if octal then strict_error env Parse_error.StrictOctalLiteral; - Eat.token env; - let value = Literal.String value in - let trailing = Eat.trailing_comments env in - Cover_expr - ( loc, - Expression.Literal - { Literal.value; raw; comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () } - ) - | (T_TRUE | T_FALSE) as token -> - Eat.token env; - let truthy = token = T_TRUE in - let raw = - if truthy then - "true" - else - "false" - in - let value = Literal.Boolean truthy in - let trailing = Eat.trailing_comments env in - Cover_expr - ( loc, - Expression.Literal - { Literal.value; raw; comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () } - ) - | T_NULL -> - Eat.token env; - let raw = "null" in - let value = Literal.Null in - let trailing = Eat.trailing_comments env in - Cover_expr - ( loc, - Expression.Literal - { Literal.value; raw; comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () } - ) - | T_LPAREN -> Cover_expr (group env) - | T_LCURLY -> - let (loc, obj, errs) = Parse.object_initializer env in - Cover_patt ((loc, Expression.Object obj), errs) - | T_LBRACKET -> - let (loc, (arr, errs)) = with_loc array_initializer env in - Cover_patt ((loc, Expression.Array arr), errs) - | T_DIV - | T_DIV_ASSIGN -> - Cover_expr (regexp env) - | T_LESS_THAN -> - let (loc, expression) = - match Parse.jsx_element_or_fragment env with - | (loc, `Element e) -> (loc, Expression.JSXElement e) - | (loc, `Fragment f) -> (loc, Expression.JSXFragment f) - in - Cover_expr (loc, expression) - | T_TEMPLATE_PART part -> - let (loc, template) = template_literal env part in - Cover_expr (loc, Expression.TemplateLiteral template) - | T_CLASS -> Cover_expr (Parse.class_expression env) - | _ when Peek.is_identifier env -> - let id = Parse.identifier env in - Cover_expr (fst id, Expression.Identifier id) - | t -> - error_unexpected env; - - (* Let's get rid of the bad token *) - begin - match t with - | T_ERROR _ -> Eat.token env - | _ -> () - end; - - (* Really no idea how to recover from this. I suppose a null - * expression is as good as anything *) - let value = Literal.Null in - let raw = "null" in - let trailing = [] in - Cover_expr - ( loc, - let open Expression in - Literal - { Literal.value; raw; comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () } - ) - - and primary env = as_expression env (primary_cover env) - - and template_literal = - let rec template_parts env quasis expressions = - let expr = Parse.expression env in - let expressions = expr :: expressions in - match Peek.token env with - | T_RCURLY -> - Eat.push_lex_mode env Lex_mode.TEMPLATE; - let (loc, part, is_tail) = - match Peek.token env with - | T_TEMPLATE_PART (loc, { cooked; raw; _ }, tail) -> - let open Ast.Expression.TemplateLiteral in - Eat.token env; - (loc, { Element.value = { Element.cooked; raw }; tail }, tail) - | _ -> assert false - in - Eat.pop_lex_mode env; - let quasis = (loc, part) :: quasis in - if is_tail then - (loc, List.rev quasis, List.rev expressions) - else - template_parts env quasis expressions - | _ -> - (* Malformed template *) - error_unexpected ~expected:"a template literal part" env; - let imaginary_quasi = - ( fst expr, - { - Expression.TemplateLiteral.Element.value = - { Expression.TemplateLiteral.Element.raw = ""; cooked = "" }; - tail = true; - } - ) - in - (fst expr, List.rev (imaginary_quasi :: quasis), List.rev expressions) - in - fun env ((start_loc, { cooked; raw; _ }, is_tail) as part) -> - let leading = Peek.comments env in - Expect.token env (T_TEMPLATE_PART part); - let (end_loc, quasis, expressions) = - let head = - ( start_loc, - { - Ast.Expression.TemplateLiteral.Element.value = - { Ast.Expression.TemplateLiteral.Element.cooked; raw }; - tail = is_tail; - } - ) - in - - if is_tail then - (start_loc, [head], []) - else - template_parts env [head] [] - in - let trailing = Eat.trailing_comments env in - let loc = Loc.btwn start_loc end_loc in - ( loc, - { - Expression.TemplateLiteral.quasis; - expressions; - comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing (); - } - ) - - and tagged_template env start_loc tag part = - let tag = expression_remove_trailing env tag in - let quasi = template_literal env part in - ( Loc.btwn start_loc (fst quasi), - Expression.(TaggedTemplate TaggedTemplate.{ tag; quasi; comments = None }) - ) - - and group env = - let leading = Peek.comments env in - let (loc, cover) = - with_loc - (fun env -> - Expect.token env T_LPAREN; - let expr_start_loc = Peek.loc env in - let expression = assignment env in - let ret = - match Peek.token env with - | T_COLON -> - let annot = Type.annotation env in - Group_typecast Expression.TypeCast.{ expression; annot; comments = None } - | T_COMMA -> Group_expr (sequence env ~start_loc:expr_start_loc [expression]) - | _ -> Group_expr expression - in - Expect.token env T_RPAREN; - ret) - env - in - let trailing = Eat.trailing_comments env in - let ret = - match cover with - | Group_expr expr -> expr - | Group_typecast cast -> (loc, Expression.TypeCast cast) - in - add_comments ret ~leading ~trailing - - and add_comments ?(leading = []) ?(trailing = []) (loc, expression) = - 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 - let open Expression in - ( loc, - match expression with - | Array ({ Array.comments; _ } as e) -> - Array { e with Array.comments = merge_comments_with_internal comments } - | ArrowFunction ({ Function.comments; _ } as e) -> - ArrowFunction { e with Function.comments = merge_comments comments } - | Assignment ({ Assignment.comments; _ } as e) -> - Assignment { e with Assignment.comments = merge_comments comments } - | Binary ({ Binary.comments; _ } as e) -> - Binary { e with Binary.comments = merge_comments comments } - | Call ({ Call.comments; _ } as e) -> Call { e with Call.comments = merge_comments comments } - | Class ({ Class.comments; _ } as e) -> - Class { e with Class.comments = merge_comments comments } - | Conditional ({ Conditional.comments; _ } as e) -> - Conditional { e with Conditional.comments = merge_comments comments } - | Function ({ Function.comments; _ } as e) -> - Function { e with Function.comments = merge_comments comments } - | Identifier (loc, ({ Identifier.comments; _ } as e)) -> - Identifier (loc, { e with Identifier.comments = merge_comments comments }) - | Import ({ Import.comments; _ } as e) -> - Import { e with Import.comments = merge_comments comments } - | JSXElement ({ JSX.comments; _ } as e) -> - JSXElement { e with JSX.comments = merge_comments comments } - | JSXFragment ({ JSX.frag_comments; _ } as e) -> - JSXFragment { e with JSX.frag_comments = merge_comments frag_comments } - | Literal ({ Literal.comments; _ } as e) -> - Literal { e with Literal.comments = merge_comments comments } - | Logical ({ Logical.comments; _ } as e) -> - Logical { e with Logical.comments = merge_comments comments } - | Member ({ Member.comments; _ } as e) -> - Member { e with Member.comments = merge_comments comments } - | MetaProperty ({ MetaProperty.comments; _ } as e) -> - MetaProperty { e with MetaProperty.comments = merge_comments comments } - | New ({ New.comments; _ } as e) -> New { e with New.comments = merge_comments comments } - | Object ({ Object.comments; _ } as e) -> - Object { e with Object.comments = merge_comments_with_internal comments } - | OptionalCall ({ OptionalCall.call = { Call.comments; _ } as call; _ } as optional_call) -> - OptionalCall - { - optional_call with - OptionalCall.call = { call with Call.comments = merge_comments comments }; - } - | OptionalMember - ({ OptionalMember.member = { Member.comments; _ } as member; _ } as optional_member) -> - OptionalMember - { - optional_member with - OptionalMember.member = { member with Member.comments = merge_comments comments }; - } - | Sequence ({ Sequence.comments; _ } as e) -> - Sequence { e with Sequence.comments = merge_comments comments } - | Super { Super.comments; _ } -> Super { Super.comments = merge_comments comments } - | TaggedTemplate ({ TaggedTemplate.comments; _ } as e) -> - TaggedTemplate { e with TaggedTemplate.comments = merge_comments comments } - | TemplateLiteral ({ TemplateLiteral.comments; _ } as e) -> - TemplateLiteral { e with TemplateLiteral.comments = merge_comments comments } - | This { This.comments; _ } -> This { This.comments = merge_comments comments } - | TypeCast ({ TypeCast.comments; _ } as e) -> - TypeCast { e with TypeCast.comments = merge_comments comments } - | Unary ({ Unary.comments; _ } as e) -> - Unary { e with Unary.comments = merge_comments comments } - | Update ({ Update.comments; _ } as e) -> - 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 = - let rec elements env (acc, errs) = - match Peek.token env with - | T_EOF - | T_RBRACKET -> - (List.rev acc, Pattern_cover.rev_errors errs) - | T_COMMA -> - let loc = Peek.loc env in - Eat.token env; - elements env (Expression.Array.Hole loc :: acc, errs) - | T_ELLIPSIS -> - let leading = Peek.comments env in - let (loc, (argument, new_errs)) = - with_loc - (fun env -> - Eat.token env; - match assignment_cover env with - | Cover_expr argument -> (argument, Pattern_cover.empty_errors) - | Cover_patt (argument, new_errs) -> (argument, new_errs)) - env - in - let elem = - Expression.( - Array.Spread - ( loc, - SpreadElement.{ argument; comments = Flow_ast_utils.mk_comments_opt ~leading () } - ) - ) - in - let is_last = Peek.token env = T_RBRACKET in - (* if this array is interpreted as a pattern, the spread becomes an AssignmentRestElement - which must be the last element. We can easily error about additional elements since - they will be in the element list, but a trailing elision, like `[...x,]`, is not part - of the AST. so, keep track of the error so we can raise it if this is a pattern. *) - let new_errs = - if (not is_last) && Peek.ith_token ~i:1 env = T_RBRACKET then - let if_patt = (loc, Parse_error.ElementAfterRestElement) :: new_errs.if_patt in - { new_errs with if_patt } - else - new_errs - in - if not is_last then Expect.token env T_COMMA; - let acc = elem :: acc in - let errs = Pattern_cover.rev_append_errors new_errs errs in - elements env (acc, errs) - | _ -> - let (elem, new_errs) = - match assignment_cover env with - | Cover_expr elem -> (elem, Pattern_cover.empty_errors) - | Cover_patt (elem, new_errs) -> (elem, new_errs) - in - if Peek.token env <> T_RBRACKET then Expect.token env T_COMMA; - let acc = Expression.Array.Expression elem :: acc in - let errs = Pattern_cover.rev_append_errors new_errs errs in - elements env (acc, errs) - in - fun env -> - let leading = Peek.comments env in - Expect.token env T_LBRACKET; - let (elems, errs) = elements env ([], Pattern_cover.empty_errors) in - let internal = Peek.comments env in - Expect.token env T_RBRACKET; - let trailing = Eat.trailing_comments env in - ( { - Ast.Expression.Array.elements = elems; - comments = Flow_ast_utils.mk_comments_with_internal_opt ~leading ~trailing ~internal (); - }, - errs - ) - - and regexp env = - Eat.push_lex_mode env Lex_mode.REGEXP; - let loc = Peek.loc env in - let leading = Peek.comments env in - let tkn = Peek.token env in - let (raw, pattern, raw_flags, trailing) = - match tkn with - | T_REGEXP (_, pattern, flags) -> - Eat.token env; - let trailing = Eat.trailing_comments env in - let raw = "/" ^ pattern ^ "/" ^ flags in - (raw, pattern, flags, trailing) - | _ -> - error_unexpected ~expected:"a regular expression" env; - ("", "", "", []) - in - Eat.pop_lex_mode env; - 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 - | _ -> ()) - raw_flags; - let flags = Buffer.contents filtered_flags in - if flags <> raw_flags then error env (Parse_error.InvalidRegExpFlags raw_flags); - let value = Literal.(RegExp { RegExp.pattern; flags }) in - ( loc, - let open Expression in - Literal - { Literal.value; raw; comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () } - ) - - and try_arrow_function = - (* Certain errors (almost all errors) cause a rollback *) - let error_callback _ = - Parse_error.( - function - (* Don't rollback on these errors. *) - | StrictParamName - | StrictReservedWord - | ParameterAfterRestParameter - | NewlineBeforeArrow - | YieldInFormalParameters - | ThisParamBannedInArrowFunctions -> - () - (* Everything else causes a rollback *) - | _ -> raise Try.Rollback - ) - in - let concise_function_body env = - match Peek.token env with - | T_LCURLY -> - let (body_block, contains_use_strict) = Parse.function_block_body env ~expression:true in - (Function.BodyBlock body_block, contains_use_strict) - | _ -> - let expr = Parse.assignment env in - (Function.BodyExpression expr, false) - in - fun env -> - let env = env |> with_error_callback error_callback in - let start_loc = Peek.loc env in - (* a T_ASYNC could either be a parameter name or it could be indicating - * that it's an async function *) - let (async, leading) = - if Peek.ith_token ~i:1 env <> T_ARROW then - Declaration.async env - else - (false, []) - in - let (sig_loc, (tparams, params, return, predicate)) = - with_loc - (fun env -> - let tparams = type_params_remove_trailing env (Type.type_params env) in - (* Disallow all fancy features for identifier => body *) - if Peek.is_identifier env && tparams = None then - let ((loc, _) as name) = - Parse.identifier ~restricted_error:Parse_error.StrictParamName env - in - let param = - ( loc, - { - Ast.Function.Param.argument = - ( loc, - Pattern.Identifier - { - Pattern.Identifier.name; - annot = Ast.Type.Missing (Peek.loc_skip_lookahead env); - optional = false; - } - ); - default = None; - } - ) - in - ( tparams, - ( loc, - { - Ast.Function.Params.params = [param]; - rest = None; - comments = None; - this_ = None; - } - ), - Ast.Type.Missing Loc.{ loc with start = loc._end }, - None - ) - else - let params = - let yield = allow_yield env in - let await = allow_await env in - Declaration.function_params ~await ~yield env - in - (* There's an ambiguity if you use a function type as the return - * type for an arrow function. So we disallow anonymous function - * types in arrow function return types unless the function type is - * enclosed in parens *) - let (return, predicate) = - env |> with_no_anon_function_type true |> Type.annotation_and_predicate_opt - in - (tparams, params, return, predicate)) - env - in - (* It's hard to tell if an invalid expression was intended to be an - * arrow function before we see the =>. If there are no params, that - * implies "()" which is only ever found in arrow params. Similarly, - * rest params indicate arrow functions. Therefore, if we see a rest - * param or an empty param list then we can disable the rollback and - * instead generate errors as if we were parsing an arrow function *) - let env = - match params with - | (_, { Ast.Function.Params.params = _; rest = Some _; this_ = None; comments = _ }) - | (_, { Ast.Function.Params.params = []; rest = _; this_ = None; comments = _ }) -> - without_error_callback env - | _ -> env - in - - (* Disallow this param annotations in arrow functions *) - let params = - match params with - | (loc, ({ Ast.Function.Params.this_ = Some (this_loc, _); _ } as params)) -> - error_at env (this_loc, Parse_error.ThisParamBannedInArrowFunctions); - (loc, { params with Ast.Function.Params.this_ = None }) - | _ -> params - in - let simple_params = is_simple_parameter_list params in - - if Peek.is_line_terminator env && Peek.token env = T_ARROW then - error env Parse_error.NewlineBeforeArrow; - Expect.token env T_ARROW; - - (* Now we know for sure this is an arrow function *) - let env = without_error_callback env in - (* arrow functions can't be generators *) - let env = enter_function env ~async ~generator:false ~simple_params in - let (end_loc, (body, contains_use_strict)) = with_loc concise_function_body env in - Declaration.strict_post_check env ~contains_use_strict None params; - let loc = Loc.btwn start_loc end_loc in - Cover_expr - ( loc, - let open Expression in - ArrowFunction - { - Function.id = None; - params; - body; - async; - generator = false; - (* arrow functions cannot be generators *) - predicate; - return; - tparams; - sig_loc; - comments = Flow_ast_utils.mk_comments_opt ~leading (); - } - ) - - and sequence = - let rec helper acc env = - match Peek.token env with - | T_COMMA -> - Eat.token env; - let expr = assignment env in - helper (expr :: acc) env - | _ -> - let expressions = List.rev acc in - Expression.(Sequence Sequence.{ expressions; comments = None }) - in - (fun env ~start_loc acc -> with_loc ~start_loc (helper acc) env) -end diff --git a/compiler/js_parser/file_key.ml b/compiler/js_parser/file_key.ml deleted file mode 100644 index 2ee9176dc0..0000000000 --- a/compiler/js_parser/file_key.ml +++ /dev/null @@ -1,100 +0,0 @@ -(* - * 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 Primitive_deriving - -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_inline equal] -let _ = fun (_ : t) -> () -let equal = - (fun a__001_ -> - fun b__002_ -> - if Ppx_compare_lib.phys_equal a__001_ b__002_ - then true - else - (match (a__001_, b__002_) with - | (LibFile _a__003_, LibFile _b__004_) -> - equal_string _a__003_ _b__004_ - | (LibFile _, _) -> false - | (_, LibFile _) -> false - | (SourceFile _a__005_, SourceFile _b__006_) -> - equal_string _a__005_ _b__006_ - | (SourceFile _, _) -> false - | (_, SourceFile _) -> false - | (JsonFile _a__007_, JsonFile _b__008_) -> - equal_string _a__007_ _b__008_ - | (JsonFile _, _) -> false - | (_, JsonFile _) -> false - | (ResourceFile _a__009_, ResourceFile _b__010_) -> - equal_string _a__009_ _b__010_) : t -> t -> bool) -let _ = equal -[@@@end] -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 - | LibFile _ -> 1 - | SourceFile _ -> 2 - | JsonFile _ -> 2 - | 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 compare_opt a b = - match (a, b) with - | (Some _, None) -> -1 - | (None, Some _) -> 1 - | (None, None) -> 0 - | (Some a, Some b) -> compare a b - -let is_lib_file = function - | LibFile _ -> true - | SourceFile _ -> false - | JsonFile _ -> false - | ResourceFile _ -> false - -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 with_suffix filename suffix = map (fun fn -> fn ^ suffix) filename diff --git a/compiler/js_parser/flow_LICENSE b/compiler/js_parser/flow_LICENSE deleted file mode 100644 index 188fb2b0bd..0000000000 --- a/compiler/js_parser/flow_LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2013-present, Facebook, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/compiler/js_parser/flow_ast.ml b/compiler/js_parser/flow_ast.ml deleted file mode 100644 index 628b21ce3b..0000000000 --- a/compiler/js_parser/flow_ast.ml +++ /dev/null @@ -1,1754 +0,0 @@ -(* - * 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 Literal : sig - module RegExp : sig - type t = { - pattern: string; - flags: string; - } - end - - (* Literals also carry along their raw value *) - type 'M t = { - value: value; - raw: string; - comments: ('M, unit) Syntax.t option; - } - - and value = - | String of string - | Boolean of bool - | Null - | Number of float - | BigInt of int64 option - | RegExp of RegExp.t -end = - Literal - -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 Variance : sig - type 'M t = 'M * 'M t' - - and kind = - | Plus - | Minus - - 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 Type : sig - 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; - } - end - - type ('M, 'T) t = { - tparams: ('M, 'T) Type.TypeParams.t option; - params: ('M, 'T) Params.t; - return: ('M, 'T) Type.t; - 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' - 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 - 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' - end - - type ('M, 'T) t = { - argument: ('M, 'T) Target.t; - comments: ('M, unit) Syntax.t option; - } - end - - module Tuple : sig - type ('M, 'T) t = { - types: ('M, 'T) Type.t 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 ('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 - | Object of ('M, 'T) Object.t - | Interface of ('M, 'T) Interface.t - | Array of ('M, 'T) Array.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 - | 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 - - (* 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 - - and ('M, 'T) annotation_or_hint = - | Missing of 'T - | Available of ('M, 'T) Type.annotation - - module TypeParam : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - name: ('M, 'M) Identifier.t; - bound: ('M, 'T) Type.annotation_or_hint; - 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 - 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 } - 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: kind; - comments: ('M, unit) Syntax.t option; - } - - and kind = - | Var - | Let - | Const - 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 } - 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; - } - 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 - 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; - } - end - - module DeclareVariable : sig - type ('M, 'T) t = { - id: ('M, 'T) Identifier.t; - annot: ('M, 'T) Type.annotation; - 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 = 'M * 'M t' - - and 'M t' = { - local: ('M, 'M) Identifier.t; - exported: ('M, 'M) Identifier.t option; - } - end - - module ExportBatchSpecifier : sig - type 'M t = 'M * ('M, 'M) Identifier.t option - end - - type ('M, 'T) t = { - declaration: ('M, 'T) Statement.t option; - specifiers: 'M specifier option; - source: ('M * 'M StringLiteral.t) option; - export_kind: Statement.export_kind; - comments: ('M, unit) Syntax.t option; - } - - and 'M specifier = - | ExportSpecifiers of 'M ExportSpecifier.t list - | ExportBatchSpecifier of 'M ExportBatchSpecifier.t - 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 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) - - and ('M, 'T) t = { - default: 'M option; - declaration: ('M, 'T) declaration option; - specifiers: 'M ExportNamedDeclaration.specifier option; - source: ('M * '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; - } - - and ('M, 'T) t = { - import_kind: import_kind; - source: 'T * 'M StringLiteral.t; - default: ('M, 'T) Identifier.t 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 } - 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 - | Continue of 'M Continue.t - | Debugger of 'M Debugger.t - | DeclareClass of ('M, 'T) DeclareClass.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 } - 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 = - | Literal of ('T * 'M Literal.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 Comprehension : sig - module Block : sig - type ('M, 'T) t = 'M * ('M, 'T) t' - - and ('M, 'T) t' = { - left: ('M, 'T) Pattern.t; - right: ('M, 'T) Expression.t; - each: bool; - } - end - - type ('M, 'T) t = { - blocks: ('M, 'T) Block.t list; - filter: ('M, 'T) Expression.t option; - } - end - - module Generator : sig - type ('M, 'T) t = { - blocks: ('M, 'T) Comprehension.Block.t list; - filter: ('M, 'T) Expression.t option; - } - 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 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 } - end - - module Super : sig - type 'M t = { comments: ('M, unit) Syntax.t option } - 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 - | Assignment of ('M, 'T) Assignment.t - | Binary of ('M, 'T) Binary.t - | Call of ('M, 'T) Call.t - | Class of ('M, 'T) Class.t - | Comprehension of ('M, 'T) Comprehension.t - | Conditional of ('M, 'T) Conditional.t - | Function of ('M, 'T) Function.t - | Generator of ('M, 'T) Generator.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 - | Literal of 'M Literal.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 - | 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 '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 = - | Identifier of ('M, 'T) Identifier.t - | NamespacedName of ('M, 'T) NamespacedName.t - - and ('M, 'T) value = - | Literal of 'T * 'M Literal.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; - 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 } - 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 = - | Literal of ('M * 'M Literal.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; - 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; - 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; - } - - 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; - } - 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) Type.annotation_or_hint; - 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; - comments: ('M, unit) Syntax.t option; - all_comments: 'M Comment.t list; - } -end = - Program diff --git a/compiler/js_parser/flow_ast_mapper.ml b/compiler/js_parser/flow_ast_mapper.ml deleted file mode 100644 index 388ec00d6a..0000000000 --- a/compiler/js_parser/flow_ast_mapper.ml +++ /dev/null @@ -1,2681 +0,0 @@ -(* - * 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 Ast = Flow_ast - -let map_opt : 'node. ('node -> 'node) -> 'node option -> 'node option = - fun map opt -> - match opt with - | Some item -> - let item' = map item in - if item == item' then - opt - else - Some item' - | None -> opt - -let id_loc : 'node 'a. ('loc -> 'node -> 'node) -> 'loc -> 'node -> 'a -> ('node -> 'a) -> 'a = - fun map loc item same diff -> - let item' = map loc item in - if item == item' then - same - else - diff item' - -let id : 'node 'a. ('node -> 'node) -> 'node -> 'a -> ('node -> 'a) -> 'a = - fun map item same diff -> - let item' = map item in - if item == item' then - same - else - diff item' - -let map_loc : 'node. ('loc -> 'node -> 'node) -> 'loc * 'node -> 'loc * 'node = - fun map same -> - let (loc, item) = same in - id_loc map loc item same (fun diff -> (loc, diff)) - -let map_loc_opt : 'node. ('loc -> 'node -> 'node) -> ('loc * 'node) option -> ('loc * 'node) option - = - fun map same -> - map_opt - (fun same -> - let (loc, item) = same in - id_loc map loc item same (fun diff -> (loc, diff))) - same - -let map_list map lst = - let (rev_lst, changed) = - List.fold_left - (fun (lst', changed) item -> - let item' = map item in - (item' :: lst', changed || item' != item)) - ([], false) - lst - in - if changed then - List.rev rev_lst - else - lst - -let map_list_multiple map lst = - let (rev_lst, changed) = - List.fold_left - (fun (lst', changed) item -> - match map item with - | [] -> (lst', true) - | [item'] -> (item' :: lst', changed || item != item') - | items' -> (List.rev_append items' lst', true)) - ([], false) - lst - in - if changed then - List.rev rev_lst - else - lst - -class ['loc] mapper = - object (this) - method program (program : ('loc, 'loc) Ast.Program.t) = - let open Ast.Program in - let (loc, { statements; comments; all_comments }) = program in - let statements' = this#toplevel_statement_list statements in - let comments' = this#syntax_opt comments in - let all_comments' = map_list this#comment all_comments in - if statements == statements' && comments == comments' && all_comments == all_comments' then - program - else - (loc, { statements = statements'; comments = comments'; all_comments = all_comments' }) - - method statement (stmt : ('loc, 'loc) Ast.Statement.t) = - let open Ast.Statement in - match stmt with - | (loc, Block block) -> id_loc this#block loc block stmt (fun block -> (loc, Block block)) - | (loc, Break break) -> id_loc this#break loc break stmt (fun break -> (loc, Break break)) - | (loc, ClassDeclaration cls) -> - id_loc this#class_declaration loc cls stmt (fun cls -> (loc, ClassDeclaration cls)) - | (loc, Continue cont) -> id_loc this#continue loc cont stmt (fun cont -> (loc, Continue cont)) - | (loc, Debugger dbg) -> id_loc this#debugger loc dbg stmt (fun dbg -> (loc, Debugger dbg)) - | (loc, DeclareClass stuff) -> - id_loc this#declare_class loc stuff stmt (fun stuff -> (loc, DeclareClass stuff)) - | (loc, DeclareExportDeclaration decl) -> - id_loc this#declare_export_declaration loc decl stmt (fun decl -> - (loc, DeclareExportDeclaration decl) - ) - | (loc, DeclareFunction stuff) -> - id_loc this#declare_function loc stuff stmt (fun stuff -> (loc, DeclareFunction stuff)) - | (loc, DeclareInterface stuff) -> - id_loc this#declare_interface loc stuff stmt (fun stuff -> (loc, DeclareInterface stuff)) - | (loc, DeclareModule m) -> - id_loc this#declare_module loc m stmt (fun m -> (loc, DeclareModule m)) - | (loc, DeclareTypeAlias stuff) -> - id_loc this#declare_type_alias loc stuff stmt (fun stuff -> (loc, DeclareTypeAlias stuff)) - | (loc, DeclareVariable stuff) -> - id_loc this#declare_variable loc stuff stmt (fun stuff -> (loc, DeclareVariable stuff)) - | (loc, DeclareModuleExports annot) -> - id_loc this#declare_module_exports loc annot stmt (fun annot -> - (loc, DeclareModuleExports annot) - ) - | (loc, DoWhile stuff) -> - id_loc this#do_while loc stuff stmt (fun stuff -> (loc, DoWhile stuff)) - | (loc, Empty empty) -> id_loc this#empty loc empty stmt (fun empty -> (loc, Empty empty)) - | (loc, EnumDeclaration enum) -> - id_loc this#enum_declaration loc enum stmt (fun enum -> (loc, EnumDeclaration enum)) - | (loc, ExportDefaultDeclaration decl) -> - id_loc this#export_default_declaration loc decl stmt (fun decl -> - (loc, ExportDefaultDeclaration decl) - ) - | (loc, ExportNamedDeclaration decl) -> - id_loc this#export_named_declaration loc decl stmt (fun decl -> - (loc, ExportNamedDeclaration decl) - ) - | (loc, Expression expr) -> - id_loc this#expression_statement loc expr stmt (fun expr -> (loc, Expression expr)) - | (loc, For for_stmt) -> - id_loc this#for_statement loc for_stmt stmt (fun for_stmt -> (loc, For for_stmt)) - | (loc, ForIn stuff) -> - id_loc this#for_in_statement loc stuff stmt (fun stuff -> (loc, ForIn stuff)) - | (loc, ForOf stuff) -> - id_loc this#for_of_statement loc stuff stmt (fun stuff -> (loc, ForOf stuff)) - | (loc, FunctionDeclaration func) -> - id_loc this#function_declaration loc func stmt (fun func -> (loc, FunctionDeclaration func)) - | (loc, If if_stmt) -> - id_loc this#if_statement loc if_stmt stmt (fun if_stmt -> (loc, If if_stmt)) - | (loc, ImportDeclaration decl) -> - id_loc this#import_declaration loc decl stmt (fun decl -> (loc, ImportDeclaration decl)) - | (loc, InterfaceDeclaration stuff) -> - id_loc this#interface_declaration loc stuff stmt (fun stuff -> - (loc, InterfaceDeclaration stuff) - ) - | (loc, Labeled label) -> - id_loc this#labeled_statement loc label stmt (fun label -> (loc, Labeled label)) - | (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)) - | (loc, Switch switch) -> - id_loc this#switch loc switch stmt (fun switch -> (loc, Switch switch)) - | (loc, Throw throw) -> id_loc this#throw loc throw stmt (fun throw -> (loc, Throw throw)) - | (loc, Try try_stmt) -> - id_loc this#try_catch loc try_stmt stmt (fun try_stmt -> (loc, Try try_stmt)) - | (loc, VariableDeclaration decl) -> - id_loc this#variable_declaration loc decl stmt (fun decl -> (loc, VariableDeclaration decl)) - | (loc, While stuff) -> id_loc this#while_ loc stuff stmt (fun stuff -> (loc, While stuff)) - | (loc, With stuff) -> id_loc this#with_ loc stuff stmt (fun stuff -> (loc, With stuff)) - | (loc, TypeAlias stuff) -> - id_loc this#type_alias loc stuff stmt (fun stuff -> (loc, TypeAlias stuff)) - | (loc, DeclareOpaqueType otype) -> - id_loc this#opaque_type loc otype stmt (fun otype -> (loc, OpaqueType otype)) - - method comment (c : 'loc Ast.Comment.t) = c - - method syntax_opt - : 'internal. ('loc, 'internal) Ast.Syntax.t option -> ('loc, 'internal) Ast.Syntax.t option - = - map_opt this#syntax - - method syntax : 'internal. ('loc, 'internal) Ast.Syntax.t -> ('loc, 'internal) Ast.Syntax.t = - fun attached -> - let open Ast.Syntax in - let { leading; trailing; internal } = attached in - let leading' = map_list this#comment leading in - let trailing' = map_list this#comment trailing in - if leading == leading' && trailing == trailing' then - attached - else - { leading = leading'; trailing = trailing'; internal } - - method expression (expr : ('loc, 'loc) Ast.Expression.t) = - let open Ast.Expression in - match expr with - | (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, Assignment x) -> id_loc this#assignment loc x expr (fun x -> (loc, Assignment x)) - | (loc, Binary x) -> id_loc this#binary loc x expr (fun x -> (loc, Binary x)) - | (loc, Call x) -> id_loc this#call loc x expr (fun x -> (loc, Call x)) - | (loc, Class x) -> id_loc this#class_expression loc x expr (fun x -> (loc, Class x)) - | (loc, Comprehension x) -> - id_loc this#comprehension loc x expr (fun x -> (loc, Comprehension x)) - | (loc, Conditional x) -> id_loc this#conditional loc x expr (fun x -> (loc, Conditional x)) - | (loc, Function x) -> id_loc this#function_expression loc x expr (fun x -> (loc, Function x)) - | (loc, Generator x) -> id_loc this#generator loc x expr (fun x -> (loc, Generator x)) - | (loc, Identifier x) -> id this#identifier x expr (fun x -> (loc, Identifier x)) - | (loc, Import x) -> id (this#import loc) x expr (fun x -> (loc, Import x)) - | (loc, JSXElement x) -> id_loc this#jsx_element loc x expr (fun x -> (loc, JSXElement x)) - | (loc, JSXFragment x) -> id_loc this#jsx_fragment loc x expr (fun x -> (loc, JSXFragment x)) - | (loc, Literal x) -> id_loc this#literal loc x expr (fun x -> (loc, Literal x)) - | (loc, Logical x) -> id_loc this#logical loc x expr (fun x -> (loc, Logical 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)) - | (loc, New x) -> id_loc this#new_ loc x expr (fun x -> (loc, New x)) - | (loc, Object x) -> id_loc this#object_ loc x expr (fun x -> (loc, Object x)) - | (loc, OptionalCall x) -> id (this#optional_call loc) x expr (fun x -> (loc, OptionalCall x)) - | (loc, OptionalMember x) -> - id_loc this#optional_member loc x expr (fun x -> (loc, OptionalMember x)) - | (loc, Sequence x) -> id_loc this#sequence loc x expr (fun x -> (loc, Sequence x)) - | (loc, Super x) -> id_loc this#super_expression loc x expr (fun x -> (loc, Super x)) - | (loc, TaggedTemplate x) -> - id_loc this#tagged_template loc x expr (fun x -> (loc, TaggedTemplate x)) - | (loc, TemplateLiteral x) -> - 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, 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)) - - method array _loc (expr : ('loc, 'loc) Ast.Expression.Array.t) = - let open Ast.Expression in - let { Array.elements; comments } = expr in - let elements' = map_list this#array_element elements in - let comments' = this#syntax_opt comments in - if elements == elements' && comments == comments' then - expr - else - { Array.elements = elements'; comments = comments' } - - method array_element element = - let open Ast.Expression.Array in - match element with - | Expression expr -> id this#expression expr element (fun expr -> Expression expr) - | Spread spread -> id this#spread_element spread element (fun spread -> Spread spread) - | Hole _ -> element - - method arrow_function loc (expr : ('loc, 'loc) Ast.Function.t) = this#function_ loc expr - - method assignment _loc (expr : ('loc, 'loc) Ast.Expression.Assignment.t) = - let open Ast.Expression.Assignment in - let { operator = _; left; right; comments } = expr in - let left' = this#assignment_pattern left in - let right' = this#expression right in - let comments' = this#syntax_opt comments in - if left == left' && right == right' && comments == comments' then - expr - else - { expr with left = left'; right = right'; comments = comments' } - - method binary _loc (expr : ('loc, 'loc) Ast.Expression.Binary.t) = - let open Ast.Expression.Binary in - let { operator = _; left; right; comments } = expr in - let left' = this#expression left in - let right' = this#expression right in - let comments' = this#syntax_opt comments in - if left == left' && right == right' && comments == comments' then - expr - else - { expr with left = left'; right = right'; comments = comments' } - - method block _loc (stmt : ('loc, 'loc) Ast.Statement.Block.t) = - let open Ast.Statement.Block in - let { body; comments } = stmt in - let body' = this#statement_list body in - let comments' = this#syntax_opt comments in - if body == body' && comments == comments' then - stmt - else - { body = body'; comments = comments' } - - method break _loc (break : 'loc Ast.Statement.Break.t) = - let open Ast.Statement.Break in - let { label; comments } = break in - let label' = map_opt this#label_identifier label in - let comments' = this#syntax_opt comments in - if label == label' && comments == comments' then - break - else - { label = label'; comments = comments' } - - method call _loc (expr : ('loc, 'loc) Ast.Expression.Call.t) = - let open Ast.Expression.Call in - let { callee; targs; arguments; comments } = expr in - let callee' = this#expression callee in - let targs' = map_opt this#call_type_args targs in - let arguments' = this#call_arguments arguments in - let comments' = this#syntax_opt comments in - if callee == callee' && targs == targs' && arguments == arguments' && comments == comments' - then - expr - else - { callee = callee'; targs = targs'; arguments = arguments'; comments = comments' } - - method call_arguments (arg_list : ('loc, 'loc) Ast.Expression.ArgList.t) = - let open Ast.Expression.ArgList in - let (loc, { arguments; comments }) = arg_list in - let arguments' = map_list this#expression_or_spread arguments in - let comments' = this#syntax_opt comments in - if arguments == arguments' && comments == comments' then - arg_list - else - (loc, { arguments = arguments'; comments = comments' }) - - method optional_call loc (expr : ('loc, 'loc) Ast.Expression.OptionalCall.t) = - let open Ast.Expression.OptionalCall in - let { call; optional = _; filtered_out = _ } = expr in - let call' = this#call loc call in - if call == call' then - expr - else - { expr with call = call' } - - method call_type_args (targs : ('loc, 'loc) Ast.Expression.CallTypeArgs.t) = - let open Ast.Expression.CallTypeArgs in - let (loc, { arguments; comments }) = targs in - let arguments' = map_list this#call_type_arg arguments in - let comments' = this#syntax_opt comments in - if arguments == arguments' && comments == comments' then - targs - else - (loc, { arguments = arguments'; comments = comments' }) - - method call_type_arg t = - let open Ast.Expression.CallTypeArg in - match t with - | Explicit x -> - let x' = this#type_ x in - if x' == x then - t - else - Explicit x' - | Implicit (loc, { Implicit.comments }) -> - let comments' = this#syntax_opt comments in - if comments == comments' then - t - else - Implicit (loc, { Implicit.comments = comments' }) - - method catch_body (body : 'loc * ('loc, 'loc) Ast.Statement.Block.t) = map_loc this#block body - - method catch_clause _loc (clause : ('loc, 'loc) Ast.Statement.Try.CatchClause.t') = - let open Ast.Statement.Try.CatchClause in - let { param; body; comments } = clause in - let param' = map_opt this#catch_clause_pattern param in - let body' = this#catch_body body in - let comments' = this#syntax_opt comments in - if param == param' && body == body' && comments == comments' then - clause - else - { param = param'; body = body'; comments = comments' } - - method class_declaration loc (cls : ('loc, 'loc) Ast.Class.t) = this#class_ loc cls - - method class_expression loc (cls : ('loc, 'loc) Ast.Class.t) = this#class_ loc cls - - method class_ _loc (cls : ('loc, 'loc) Ast.Class.t) = - let open Ast.Class in - let { id; body; tparams; extends; implements; class_decorators; comments } = cls in - let id' = map_opt this#class_identifier id in - let tparams' = map_opt this#type_params tparams in - let body' = this#class_body body in - let extends' = map_opt (map_loc this#class_extends) extends in - let implements' = map_opt this#class_implements implements in - let class_decorators' = map_list this#class_decorator class_decorators in - let comments' = this#syntax_opt comments in - if - id == id' - && body == body' - && extends == extends' - && implements == implements' - && class_decorators == class_decorators' - && comments == comments' - && tparams == tparams' - then - cls - else - { - id = id'; - body = body'; - extends = extends'; - implements = implements'; - class_decorators = class_decorators'; - comments = comments'; - tparams = tparams'; - } - - method class_extends _loc (extends : ('loc, 'loc) Ast.Class.Extends.t') = - let open Ast.Class.Extends in - let { expr; targs; comments } = extends in - let expr' = this#expression expr in - let targs' = map_opt this#type_args targs in - let comments' = this#syntax_opt comments in - if expr == expr' && targs == targs' && comments == comments' then - extends - else - { expr = expr'; targs = targs'; comments = comments' } - - method class_identifier (ident : ('loc, 'loc) Ast.Identifier.t) = - this#pattern_identifier ~kind:Ast.Statement.VariableDeclaration.Let ident - - method class_body (cls_body : ('loc, 'loc) Ast.Class.Body.t) = - let open Ast.Class.Body in - let (loc, { body; comments }) = cls_body in - let body' = map_list this#class_element body in - let comments' = this#syntax_opt comments in - if body == body' && comments == comments' then - cls_body - else - (loc, { body = body'; comments = comments' }) - - method class_decorator (dec : ('loc, 'loc) Ast.Class.Decorator.t) = - let open Ast.Class.Decorator in - let (loc, { expression; comments }) = dec in - let expression' = this#expression expression in - let comments' = this#syntax_opt comments in - if expression == expression' && comments == comments' then - dec - else - (loc, { expression = expression'; comments = comments' }) - - method class_element (elem : ('loc, 'loc) Ast.Class.Body.element) = - let open Ast.Class.Body in - match elem with - | Method (loc, meth) -> id_loc this#class_method loc meth elem (fun meth -> Method (loc, meth)) - | Property (loc, prop) -> - id_loc this#class_property loc prop elem (fun prop -> Property (loc, prop)) - | PrivateField (loc, field) -> - id_loc this#class_private_field loc field elem (fun field -> PrivateField (loc, field)) - - method class_implements (implements : ('loc, 'loc) Ast.Class.Implements.t) = - let open Ast.Class.Implements in - let (loc, { interfaces; comments }) = implements in - let interfaces' = map_list this#class_implements_interface interfaces in - let comments' = this#syntax_opt comments in - if interfaces == interfaces' && comments == comments' then - implements - else - (loc, { interfaces = interfaces'; comments = comments' }) - - method class_implements_interface (interface : ('loc, 'loc) Ast.Class.Implements.Interface.t) = - let open Ast.Class.Implements.Interface in - let (loc, { id; targs }) = interface in - let id' = this#type_identifier_reference id in - let targs' = map_opt this#type_args targs in - if id == id' && targs == targs' then - interface - else - (loc, { id = id'; targs = targs' }) - - method class_method _loc (meth : ('loc, 'loc) Ast.Class.Method.t') = - let open Ast.Class.Method in - let { kind = _; key; value; static = _; decorators; comments } = meth in - let key' = this#object_key key in - let value' = map_loc this#function_expression_or_method value in - let decorators' = map_list this#class_decorator decorators in - let comments' = this#syntax_opt comments in - if key == key' && value == value' && decorators == decorators' && comments == comments' then - meth - else - { meth with key = key'; value = value'; decorators = decorators'; comments = comments' } - - method class_property _loc (prop : ('loc, 'loc) Ast.Class.Property.t') = - let open Ast.Class.Property in - let { key; value; annot; static = _; variance; comments } = prop in - let key' = this#object_key key in - let value' = this#class_property_value value in - let annot' = this#type_annotation_hint annot in - let variance' = this#variance_opt variance in - let comments' = this#syntax_opt comments in - if - key == key' - && value == value' - && annot' == annot - && variance' == variance - && comments' == comments - then - prop - else - { - prop with - key = key'; - value = value'; - annot = annot'; - variance = variance'; - comments = comments'; - } - - method class_property_value (value : ('loc, 'loc) Ast.Class.Property.value) = - let open Ast.Class.Property in - match value with - | Declared -> value - | Uninitialized -> value - | Initialized x -> - let x' = this#expression x in - if x == x' then - value - else - Initialized x' - - method class_private_field _loc (prop : ('loc, 'loc) Ast.Class.PrivateField.t') = - let open Ast.Class.PrivateField in - let { key; value; annot; static = _; variance; comments } = prop in - let key' = this#private_name key in - let value' = this#class_property_value value in - let annot' = this#type_annotation_hint annot in - let variance' = this#variance_opt variance in - let comments' = this#syntax_opt comments in - if - key == key' - && value == value' - && annot' == annot - && variance' == variance - && comments' == comments - then - prop - else - { - prop with - key = key'; - value = value'; - annot = annot'; - variance = variance'; - comments = comments'; - } - - (* TODO *) - method comprehension _loc (expr : ('loc, 'loc) Ast.Expression.Comprehension.t) = expr - - method conditional _loc (expr : ('loc, 'loc) Ast.Expression.Conditional.t) = - let open Ast.Expression.Conditional in - let { test; consequent; alternate; comments } = expr in - let test' = this#predicate_expression test in - let consequent' = this#expression consequent in - let alternate' = this#expression alternate in - let comments' = this#syntax_opt comments in - if - test == test' - && consequent == consequent' - && alternate == alternate' - && comments == comments' - then - expr - else - { test = test'; consequent = consequent'; alternate = alternate'; comments = comments' } - - method continue _loc (cont : 'loc Ast.Statement.Continue.t) = - let open Ast.Statement.Continue in - let { label; comments } = cont in - let label' = map_opt this#label_identifier label in - let comments' = this#syntax_opt comments in - if label == label' && comments == comments' then - cont - else - { label = label'; comments = comments' } - - method debugger _loc (dbg : 'loc Ast.Statement.Debugger.t) = - let open Ast.Statement.Debugger in - let { comments } = dbg in - let comments' = this#syntax_opt comments in - if comments == comments' then - dbg - else - { comments = comments' } - - method declare_class _loc (decl : ('loc, 'loc) Ast.Statement.DeclareClass.t) = - let open Ast.Statement.DeclareClass in - let { id = ident; tparams; body; extends; mixins; implements; comments } = decl in - let id' = this#class_identifier ident in - let tparams' = map_opt this#type_params tparams in - let body' = map_loc this#object_type body in - let extends' = map_opt (map_loc this#generic_type) extends in - let mixins' = map_list (map_loc this#generic_type) mixins in - let implements' = map_opt this#class_implements implements in - let comments' = this#syntax_opt comments in - if - id' == ident - && tparams' == tparams - && body' == body - && extends' == extends - && mixins' == mixins - && implements' == implements - && comments' == comments - then - decl - else - { - id = id'; - tparams = tparams'; - body = body'; - extends = extends'; - mixins = mixins'; - implements = implements'; - comments = comments'; - } - - method declare_export_declaration - _loc (decl : ('loc, 'loc) Ast.Statement.DeclareExportDeclaration.t) = - let open Ast.Statement.DeclareExportDeclaration in - let { default; source; specifiers; declaration; comments } = decl in - let source' = map_loc_opt this#export_source source in - let specifiers' = map_opt this#export_named_specifier specifiers in - let declaration' = map_opt this#declare_export_declaration_decl declaration in - let comments' = this#syntax_opt comments in - if - source == source' - && specifiers == specifiers' - && declaration == declaration' - && comments == comments' - then - decl - else - { - default; - source = source'; - specifiers = specifiers'; - declaration = declaration'; - comments = comments'; - } - - method declare_export_declaration_decl - (decl : ('loc, 'loc) Ast.Statement.DeclareExportDeclaration.declaration) = - let open Ast.Statement.DeclareExportDeclaration in - match decl with - | Variable (loc, dv) -> - let dv' = this#declare_variable loc dv in - if dv' == dv then - decl - else - Variable (loc, dv') - | Function (loc, df) -> - let df' = this#declare_function loc df in - if df' == df then - decl - else - Function (loc, df') - | Class (loc, dc) -> - let dc' = this#declare_class loc dc in - if dc' == dc then - decl - else - Class (loc, dc') - | DefaultType t -> - let t' = this#type_ t in - if t' == t then - decl - else - DefaultType t' - | NamedType (loc, ta) -> - let ta' = this#type_alias loc ta in - if ta' == ta then - decl - else - NamedType (loc, ta') - | NamedOpaqueType (loc, ot) -> - let ot' = this#opaque_type loc ot in - if ot' == ot then - decl - else - NamedOpaqueType (loc, ot') - | Interface (loc, i) -> - let i' = this#interface loc i in - if i' == i then - decl - else - Interface (loc, i') - - method declare_function _loc (decl : ('loc, 'loc) Ast.Statement.DeclareFunction.t) = - let open Ast.Statement.DeclareFunction in - let { id = ident; annot; predicate; comments } = decl in - let id' = this#function_identifier ident in - let annot' = this#type_annotation annot in - let predicate' = map_opt this#predicate predicate in - let comments' = this#syntax_opt comments in - if id' == ident && annot' == annot && predicate' == predicate && comments' == comments then - decl - else - { id = id'; annot = annot'; predicate = predicate'; comments = comments' } - - method declare_interface loc (decl : ('loc, 'loc) Ast.Statement.Interface.t) = - this#interface loc decl - - 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 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' } - - method declare_module_exports _loc (exports : ('loc, 'loc) Ast.Statement.DeclareModuleExports.t) - = - let open Ast.Statement.DeclareModuleExports in - let { annot; comments } = exports in - let annot' = this#type_annotation annot in - let comments' = this#syntax_opt comments in - if annot == annot' && comments == comments' then - exports - else - { annot = annot'; comments = comments' } - - method declare_type_alias loc (decl : ('loc, 'loc) Ast.Statement.TypeAlias.t) = - this#type_alias loc decl - - method declare_variable _loc (decl : ('loc, 'loc) Ast.Statement.DeclareVariable.t) = - let open Ast.Statement.DeclareVariable in - let { id = ident; annot; comments } = decl in - let id' = this#pattern_identifier ~kind:Ast.Statement.VariableDeclaration.Var ident in - let annot' = this#type_annotation annot in - let comments' = this#syntax_opt comments in - if id' == ident && annot' == annot && comments' == comments then - decl - else - { id = id'; annot = annot'; comments = comments' } - - method do_while _loc (stuff : ('loc, 'loc) Ast.Statement.DoWhile.t) = - let open Ast.Statement.DoWhile in - let { body; test; comments } = stuff in - let body' = this#statement body in - let test' = this#predicate_expression test in - let comments' = this#syntax_opt comments in - if body == body' && test == test' && comments == comments' then - stuff - else - { body = body'; test = test'; comments = comments' } - - method empty _loc empty = - let open Ast.Statement.Empty in - let { comments } = empty in - let comments' = this#syntax_opt comments in - if comments == comments' then - empty - else - { comments = comments' } - - method enum_declaration _loc (enum : ('loc, 'loc) Ast.Statement.EnumDeclaration.t) = - let open Ast.Statement.EnumDeclaration in - let { id = ident; body; comments } = enum in - let id' = this#pattern_identifier ~kind:Ast.Statement.VariableDeclaration.Const ident in - let body' = this#enum_body body in - let comments' = this#syntax_opt comments in - if ident == id' && body == body' && comments == comments' then - enum - else - { id = id'; body = body'; comments = comments' } - - method enum_body (body : 'loc Ast.Statement.EnumDeclaration.body) = - let open Ast.Statement.EnumDeclaration in - match body with - | (loc, BooleanBody boolean_body) -> - id this#enum_boolean_body boolean_body body (fun body -> (loc, BooleanBody body)) - | (loc, NumberBody number_body) -> - id this#enum_number_body number_body body (fun body -> (loc, NumberBody body)) - | (loc, StringBody string_body) -> - id this#enum_string_body string_body body (fun body -> (loc, StringBody body)) - | (loc, SymbolBody symbol_body) -> - id this#enum_symbol_body symbol_body body (fun body -> (loc, SymbolBody body)) - - method enum_boolean_body (body : 'loc Ast.Statement.EnumDeclaration.BooleanBody.t) = - let open Ast.Statement.EnumDeclaration.BooleanBody in - let { members; explicit_type = _; has_unknown_members = _; comments } = body in - let members' = map_list this#enum_boolean_member members in - let comments' = this#syntax_opt comments in - if members == members' && comments == comments' then - body - else - { body with members = members'; comments = comments' } - - method enum_number_body (body : 'loc Ast.Statement.EnumDeclaration.NumberBody.t) = - let open Ast.Statement.EnumDeclaration.NumberBody in - let { members; explicit_type = _; has_unknown_members = _; comments } = body in - let members' = map_list this#enum_number_member members in - let comments' = this#syntax_opt comments in - if members == members' && comments == comments' then - body - else - { body with members = members'; comments = comments' } - - method enum_string_body (body : 'loc Ast.Statement.EnumDeclaration.StringBody.t) = - let open Ast.Statement.EnumDeclaration.StringBody in - let { members; explicit_type = _; has_unknown_members = _; comments } = body in - let members' = - match members with - | Defaulted m -> id (map_list this#enum_defaulted_member) m members (fun m -> Defaulted m) - | Initialized m -> id (map_list this#enum_string_member) m members (fun m -> Initialized m) - in - let comments' = this#syntax_opt comments in - if members == members' && comments == comments' then - body - else - { body with members = members'; comments = comments' } - - method enum_symbol_body (body : 'loc Ast.Statement.EnumDeclaration.SymbolBody.t) = - let open Ast.Statement.EnumDeclaration.SymbolBody in - let { members; has_unknown_members = _; comments } = body in - let members' = map_list this#enum_defaulted_member members in - let comments' = this#syntax_opt comments in - if members == members' && comments == comments' then - body - else - { body with members = members'; comments = comments' } - - method enum_defaulted_member (member : 'loc Ast.Statement.EnumDeclaration.DefaultedMember.t) = - let open Ast.Statement.EnumDeclaration.DefaultedMember in - let (loc, { id = ident }) = member in - let id' = this#enum_member_identifier ident in - if ident == id' then - member - else - (loc, { id = id' }) - - method enum_boolean_member - (member : - ('loc Ast.BooleanLiteral.t, 'loc) Ast.Statement.EnumDeclaration.InitializedMember.t - ) = - let open Ast.Statement.EnumDeclaration.InitializedMember in - let (loc, { id = ident; init }) = member in - let id' = this#enum_member_identifier ident in - if ident == id' then - member - else - (loc, { id = id'; init }) - - method enum_number_member - (member : ('loc Ast.NumberLiteral.t, 'loc) Ast.Statement.EnumDeclaration.InitializedMember.t) - = - let open Ast.Statement.EnumDeclaration.InitializedMember in - let (loc, { id = ident; init }) = member in - let id' = this#enum_member_identifier ident in - if ident == id' then - member - else - (loc, { id = id'; init }) - - method enum_string_member - (member : ('loc Ast.StringLiteral.t, 'loc) Ast.Statement.EnumDeclaration.InitializedMember.t) - = - let open Ast.Statement.EnumDeclaration.InitializedMember in - let (loc, { id = ident; init }) = member in - let id' = this#enum_member_identifier ident in - if ident == id' then - member - else - (loc, { id = id'; init }) - - method enum_member_identifier (id : ('loc, 'loc) Ast.Identifier.t) = this#identifier id - - method export_default_declaration - _loc (decl : ('loc, 'loc) Ast.Statement.ExportDefaultDeclaration.t) = - let open Ast.Statement.ExportDefaultDeclaration in - let { default; declaration; comments } = decl in - let declaration' = this#export_default_declaration_decl declaration in - let comments' = this#syntax_opt comments in - if declaration' == declaration && comments' == comments then - decl - else - { default; declaration = declaration'; comments = comments' } - - method export_default_declaration_decl - (decl : ('loc, 'loc) Ast.Statement.ExportDefaultDeclaration.declaration) = - let open Ast.Statement.ExportDefaultDeclaration in - match decl with - | Declaration stmt -> id this#statement stmt decl (fun stmt -> Declaration stmt) - | Expression expr -> id this#expression expr decl (fun expr -> Expression expr) - - method export_named_declaration _loc (decl : ('loc, 'loc) Ast.Statement.ExportNamedDeclaration.t) - = - let open Ast.Statement.ExportNamedDeclaration in - let { export_kind; source; specifiers; declaration; comments } = decl in - let source' = map_loc_opt this#export_source source in - let specifiers' = map_opt this#export_named_specifier specifiers in - let declaration' = map_opt this#statement declaration in - let comments' = this#syntax_opt comments in - if - source == source' - && specifiers == specifiers' - && declaration == declaration' - && comments == comments' - then - decl - else - { - export_kind; - source = source'; - specifiers = specifiers'; - declaration = declaration'; - comments = comments'; - } - - method export_named_declaration_specifier - (spec : 'loc Ast.Statement.ExportNamedDeclaration.ExportSpecifier.t) = - let open Ast.Statement.ExportNamedDeclaration.ExportSpecifier in - let (loc, { local; exported }) = 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' }) - - method export_batch_specifier - (spec : 'loc Ast.Statement.ExportNamedDeclaration.ExportBatchSpecifier.t) = - let (loc, id_opt) = spec in - let id_opt' = map_opt this#identifier id_opt in - if id_opt == id_opt' then - spec - else - (loc, id_opt') - - method export_named_specifier (spec : 'loc Ast.Statement.ExportNamedDeclaration.specifier) = - let open Ast.Statement.ExportNamedDeclaration in - match spec with - | ExportSpecifiers spec_list -> - let spec_list' = map_list this#export_named_declaration_specifier spec_list in - if spec_list == spec_list' then - spec - else - ExportSpecifiers spec_list' - | ExportBatchSpecifier batch -> - let batch' = this#export_batch_specifier batch in - if batch == batch' then - spec - else - ExportBatchSpecifier batch' - - method export_source _loc (source : 'loc Ast.StringLiteral.t) = - let open Ast.StringLiteral in - let { value; raw; comments } = source in - let comments' = this#syntax_opt comments in - if comments == comments' then - source - else - { value; raw; comments = comments' } - - method expression_statement _loc (stmt : ('loc, 'loc) Ast.Statement.Expression.t) = - let open Ast.Statement.Expression in - let { expression = expr; directive; comments } = stmt in - let expr' = this#expression expr in - let comments' = this#syntax_opt comments in - if expr == expr' && comments == comments' then - stmt - else - { expression = expr'; directive; comments = comments' } - - method expression_or_spread expr_or_spread = - let open Ast.Expression in - match expr_or_spread with - | Expression expr -> id this#expression expr expr_or_spread (fun expr -> Expression expr) - | Spread spread -> id this#spread_element spread expr_or_spread (fun spread -> Spread spread) - - method for_in_statement _loc (stmt : ('loc, 'loc) Ast.Statement.ForIn.t) = - let open Ast.Statement.ForIn in - let { left; right; body; each; comments } = stmt in - let left' = this#for_in_statement_lhs left in - let right' = this#expression right in - let body' = this#statement body in - let comments' = this#syntax_opt comments in - if left == left' && right == right' && body == body' && comments == comments' then - stmt - else - { left = left'; right = right'; body = body'; each; comments = comments' } - - method for_in_statement_lhs (left : ('loc, 'loc) Ast.Statement.ForIn.left) = - let open Ast.Statement.ForIn in - match left with - | LeftDeclaration decl -> - id this#for_in_left_declaration decl left (fun decl -> LeftDeclaration decl) - | LeftPattern patt -> - id this#for_in_assignment_pattern patt left (fun patt -> LeftPattern patt) - - method for_in_left_declaration left = - let (loc, decl) = left in - id_loc this#variable_declaration loc decl left (fun decl -> (loc, decl)) - - method for_of_statement _loc (stuff : ('loc, 'loc) Ast.Statement.ForOf.t) = - let open Ast.Statement.ForOf in - let { left; right; body; await; comments } = stuff in - let left' = this#for_of_statement_lhs left in - let right' = this#expression right in - let body' = this#statement body in - let comments' = this#syntax_opt comments in - if left == left' && right == right' && body == body' && comments == comments' then - stuff - else - { left = left'; right = right'; body = body'; await; comments = comments' } - - method for_of_statement_lhs (left : ('loc, 'loc) Ast.Statement.ForOf.left) = - let open Ast.Statement.ForOf in - match left with - | LeftDeclaration decl -> - id this#for_of_left_declaration decl left (fun decl -> LeftDeclaration decl) - | LeftPattern patt -> - id this#for_of_assignment_pattern patt left (fun patt -> LeftPattern patt) - - method for_of_left_declaration left = - let (loc, decl) = left in - id_loc this#variable_declaration loc decl left (fun decl -> (loc, decl)) - - method for_statement _loc (stmt : ('loc, 'loc) Ast.Statement.For.t) = - let open Ast.Statement.For in - let { init; test; update; body; comments } = stmt in - let init' = map_opt this#for_statement_init init in - let test' = map_opt this#predicate_expression test in - let update' = map_opt this#expression update in - let body' = this#statement body in - let comments' = this#syntax_opt comments in - if - init == init' - && test == test' - && update == update' - && body == body' - && comments == comments' - then - stmt - else - { init = init'; test = test'; update = update'; body = body'; comments = comments' } - - method for_statement_init (init : ('loc, 'loc) Ast.Statement.For.init) = - let open Ast.Statement.For in - match init with - | InitDeclaration decl -> - id this#for_init_declaration decl init (fun decl -> InitDeclaration decl) - | InitExpression expr -> id this#expression expr init (fun expr -> InitExpression expr) - - method for_init_declaration init = - let (loc, decl) = init in - id_loc this#variable_declaration loc decl init (fun decl -> (loc, decl)) - - method function_param_type (fpt : ('loc, 'loc) Ast.Type.Function.Param.t) = - let open Ast.Type.Function.Param in - let (loc, { annot; name; optional }) = fpt in - let annot' = this#type_ annot in - let name' = map_opt this#identifier name in - if annot' == annot && name' == name then - fpt - else - (loc, { annot = annot'; name = name'; optional }) - - method function_rest_param_type (frpt : ('loc, 'loc) Ast.Type.Function.RestParam.t) = - let open Ast.Type.Function.RestParam in - let (loc, { argument; comments }) = frpt in - let argument' = this#function_param_type argument in - let comments' = this#syntax_opt comments in - if argument' == argument && comments' == comments then - frpt - else - (loc, { argument = argument'; comments = comments' }) - - method function_this_param_type (this_param : ('loc, 'loc) Ast.Type.Function.ThisParam.t) = - let open Ast.Type.Function.ThisParam in - let (loc, { annot; comments }) = this_param in - let annot' = this#type_annotation annot in - let comments' = this#syntax_opt comments in - if annot' == annot && comments' == comments then - this_param - else - (loc, { annot = annot'; comments = comments' }) - - method function_type _loc (ft : ('loc, 'loc) Ast.Type.Function.t) = - let open Ast.Type.Function in - let { - params = (params_loc, { Params.this_; params = ps; rest = rpo; comments = params_comments }); - return; - tparams; - comments = func_comments; - } = - ft - in - let tparams' = map_opt this#type_params tparams in - let this_' = map_opt this#function_this_param_type this_ in - let ps' = map_list this#function_param_type ps in - let rpo' = map_opt this#function_rest_param_type rpo in - let return' = this#type_ return in - let func_comments' = this#syntax_opt func_comments in - let params_comments' = this#syntax_opt params_comments in - if - ps' == ps - && rpo' == rpo - && return' == return - && tparams' == tparams - && func_comments' == func_comments - && params_comments' == params_comments - && this_' == this_ - then - ft - else - { - params = - ( params_loc, - { Params.this_ = this_'; params = ps'; rest = rpo'; comments = params_comments' } - ); - return = return'; - tparams = tparams'; - comments = func_comments'; - } - - method label_identifier (ident : ('loc, 'loc) Ast.Identifier.t) = this#identifier ident - - method object_property_value_type (opvt : ('loc, 'loc) Ast.Type.Object.Property.value) = - let open Ast.Type.Object.Property in - match opvt with - | Init t -> id this#type_ t opvt (fun t -> Init t) - | Get t -> id this#object_type_property_getter t opvt (fun t -> Get t) - | Set t -> id this#object_type_property_setter t opvt (fun t -> Set t) - - method object_type_property_getter getter = - let (loc, ft) = getter in - id_loc this#function_type loc ft getter (fun ft -> (loc, ft)) - - method object_type_property_setter setter = - let (loc, ft) = setter in - id_loc this#function_type loc ft setter (fun ft -> (loc, ft)) - - method object_property_type (opt : ('loc, 'loc) Ast.Type.Object.Property.t) = - let open Ast.Type.Object.Property in - let (loc, { key; value; optional; static; proto; _method; variance; comments }) = opt in - let key' = this#object_key key in - let value' = this#object_property_value_type value in - let variance' = this#variance_opt variance in - let comments' = this#syntax_opt comments in - if key' == key && value' == value && variance' == variance && comments' == comments then - opt - else - ( loc, - { - key = key'; - value = value'; - optional; - static; - proto; - _method; - variance = variance'; - comments = comments'; - } - ) - - method object_spread_property_type (opt : ('loc, 'loc) Ast.Type.Object.SpreadProperty.t) = - let open Ast.Type.Object.SpreadProperty in - let (loc, { argument; comments }) = opt in - let argument' = this#type_ argument in - let comments' = this#syntax_opt comments in - if argument' == argument && comments == comments' then - opt - else - (loc, { argument = argument'; comments = comments' }) - - method object_indexer_property_type (opt : ('loc, 'loc) Ast.Type.Object.Indexer.t) = - let open Ast.Type.Object.Indexer in - let (loc, { id; key; value; static; variance; comments }) = opt in - let key' = this#type_ key in - let value' = this#type_ value in - let variance' = this#variance_opt variance in - let comments' = this#syntax_opt comments in - if key' == key && value' == value && variance' == variance && comments' == comments then - opt - else - (loc, { id; key = key'; value = value'; static; variance = variance'; comments = comments' }) - - method object_internal_slot_property_type (slot : ('loc, 'loc) Ast.Type.Object.InternalSlot.t) = - let open Ast.Type.Object.InternalSlot in - let (loc, { id; value; optional; static; _method; comments }) = slot in - let id' = this#identifier id in - let value' = this#type_ value in - let comments' = this#syntax_opt comments in - if id == id' && value == value' && comments == comments' then - slot - else - (loc, { id = id'; value = value'; optional; static; _method; comments = comments' }) - - method object_call_property_type (call : ('loc, 'loc) Ast.Type.Object.CallProperty.t) = - let open Ast.Type.Object.CallProperty in - let (loc, { value = (value_loc, value); static; comments }) = call in - let value' = this#function_type value_loc value in - let comments' = this#syntax_opt comments in - if value == value' && comments == comments' then - call - else - (loc, { value = (value_loc, value'); static; comments = comments' }) - - method object_type _loc (ot : ('loc, 'loc) Ast.Type.Object.t) = - let open Ast.Type.Object in - let { properties; exact; inexact; comments } = ot in - let properties' = - map_list - (fun p -> - match p with - | Property p' -> id this#object_property_type p' p (fun p' -> Property p') - | SpreadProperty p' -> - id this#object_spread_property_type p' p (fun p' -> SpreadProperty p') - | Indexer p' -> id this#object_indexer_property_type p' p (fun p' -> Indexer p') - | InternalSlot p' -> - id this#object_internal_slot_property_type p' p (fun p' -> InternalSlot p') - | CallProperty p' -> id this#object_call_property_type p' p (fun p' -> CallProperty p')) - properties - in - let comments' = this#syntax_opt comments in - if properties' == properties && comments == comments' then - ot - else - { properties = properties'; exact; inexact; comments = comments' } - - method interface_type _loc (i : ('loc, 'loc) Ast.Type.Interface.t) = - let open Ast.Type.Interface in - let { extends; body; comments } = i in - let extends' = map_list (map_loc this#generic_type) extends in - let body' = map_loc this#object_type body in - let comments' = this#syntax_opt comments in - if extends' == extends && body' == body && comments == comments' then - i - else - { extends = extends'; body = body'; comments = comments' } - - method generic_identifier_type (git : ('loc, 'loc) Ast.Type.Generic.Identifier.t) = - let open Ast.Type.Generic.Identifier in - match git with - | Unqualified i -> id this#type_identifier_reference i git (fun i -> Unqualified i) - | Qualified i -> id this#generic_qualified_identifier_type i git (fun i -> Qualified i) - - method generic_qualified_identifier_type qual = - let open Ast.Type.Generic.Identifier in - let (loc, { qualification; id }) = qual in - let qualification' = this#generic_identifier_type qualification in - let id' = this#member_type_identifier id in - if qualification' == qualification && id' == id then - qual - else - (loc, { qualification = qualification'; id = id' }) - - method member_type_identifier id = this#identifier id - - method variance (variance : 'loc Ast.Variance.t) = - let (loc, { Ast.Variance.kind; comments }) = variance in - let comments' = this#syntax_opt comments in - if comments == comments' then - variance - else - (loc, { Ast.Variance.kind; comments = comments' }) - - method variance_opt (opt : 'loc Ast.Variance.t option) = map_opt this#variance opt - - method type_args (targs : ('loc, 'loc) Ast.Type.TypeArgs.t) = - let open Ast.Type.TypeArgs in - let (loc, { arguments; comments }) = targs in - let arguments' = map_list this#type_ arguments in - let comments' = this#syntax_opt comments in - if arguments == arguments' && comments == comments' then - targs - else - (loc, { arguments = arguments'; comments = comments' }) - - method type_params (tparams : ('loc, 'loc) Ast.Type.TypeParams.t) = - let open Ast.Type.TypeParams in - let (loc, { params = tps; comments }) = tparams in - let tps' = map_list this#type_param tps in - let comments' = this#syntax_opt comments in - if tps' == tps && comments' == comments then - tparams - else - (loc, { params = tps'; comments = comments' }) - - method type_param (tparam : ('loc, 'loc) Ast.Type.TypeParam.t) = - let open Ast.Type.TypeParam in - let (loc, { name; bound; variance; default }) = 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 name' = this#binding_type_identifier name in - if name' == name && bound' == bound && variance' == variance && default' == default then - tparam - else - (loc, { name = name'; bound = bound'; variance = variance'; default = default' }) - - method generic_type _loc (gt : ('loc, 'loc) Ast.Type.Generic.t) = - let open Ast.Type.Generic in - let { id; targs; comments } = gt in - let id' = this#generic_identifier_type id in - let targs' = map_opt this#type_args targs in - let comments' = this#syntax_opt comments in - if id' == id && targs' == targs && comments' == comments then - gt - else - { id = id'; targs = targs'; comments = comments' } - - method indexed_access _loc (ia : ('loc, 'loc) Ast.Type.IndexedAccess.t) = - let open Ast.Type.IndexedAccess in - let { _object; index; comments } = ia in - let _object' = this#type_ _object in - let index' = this#type_ index in - let comments' = this#syntax_opt comments in - if _object' == _object && index' == index && comments' == comments then - ia - else - { _object = _object'; index = index'; comments = comments' } - - method optional_indexed_access loc (ia : ('loc, 'loc) Ast.Type.OptionalIndexedAccess.t) = - let open Ast.Type.OptionalIndexedAccess in - let { indexed_access; optional } = ia in - let indexed_access' = this#indexed_access loc indexed_access in - if indexed_access' == indexed_access then - ia - else - { indexed_access = indexed_access'; optional } - - method string_literal_type _loc (lit : 'loc Ast.StringLiteral.t) = - let open Ast.StringLiteral in - let { value; raw; comments } = lit in - let comments' = this#syntax_opt comments in - if comments == comments' then - lit - else - { value; raw; comments = comments' } - - method number_literal_type _loc (lit : 'loc Ast.NumberLiteral.t) = - let open Ast.NumberLiteral in - let { value; raw; comments } = lit in - let comments' = this#syntax_opt comments in - if comments == comments' then - lit - else - { value; raw; comments = comments' } - - method bigint_literal_type _loc (lit : 'loc Ast.BigIntLiteral.t) = - let open Ast.BigIntLiteral in - let { value; raw; comments } = lit in - let comments' = this#syntax_opt comments in - if comments == comments' then - lit - else - { value; raw; comments = comments' } - - method boolean_literal_type _loc (lit : 'loc Ast.BooleanLiteral.t) = - let open Ast.BooleanLiteral in - let { value; comments } = lit in - let comments' = this#syntax_opt comments in - if comments == comments' then - lit - else - { value; comments = comments' } - - method nullable_type (t : ('loc, 'loc) Ast.Type.Nullable.t) = - let open Ast.Type.Nullable in - let { argument; comments } = t in - let argument' = this#type_ argument in - let comments' = this#syntax_opt comments in - if argument == argument' && comments == comments' then - t - else - { argument = argument'; comments = comments' } - - method typeof_type (t : ('loc, 'loc) Ast.Type.Typeof.t) = - let open Ast.Type.Typeof in - let { argument; comments } = t in - let argument' = this#typeof_expression argument in - let comments' = this#syntax_opt comments in - if argument == argument' && comments == comments' then - t - else - { argument = argument'; comments = comments' } - - method typeof_expression (git : ('loc, 'loc) Ast.Type.Typeof.Target.t) = - let open Ast.Type.Typeof.Target in - match git with - | Unqualified i -> id this#typeof_identifier i git (fun i -> Unqualified i) - | Qualified i -> id this#typeof_qualified_identifier i git (fun i -> Qualified i) - - method typeof_identifier id = this#identifier id - - method typeof_member_identifier id = this#identifier id - - method typeof_qualified_identifier qual = - let open Ast.Type.Typeof.Target in - let (loc, { qualification; id }) = qual in - let qualification' = this#typeof_expression qualification in - let id' = this#typeof_member_identifier id in - if qualification' == qualification && id' == id then - qual - else - (loc, { qualification = qualification'; id = id' }) - - method tuple_type (t : ('loc, 'loc) Ast.Type.Tuple.t) = - let open Ast.Type.Tuple in - let { types; comments } = t in - let types' = map_list this#type_ types in - let comments' = this#syntax_opt comments in - if types == types' && comments == comments' then - t - else - { types = types'; comments = comments' } - - method array_type (t : ('loc, 'loc) Ast.Type.Array.t) = - let open Ast.Type.Array in - let { argument; comments } = t in - let argument' = this#type_ argument in - let comments' = this#syntax_opt comments in - if argument == argument' && comments == comments' then - t - else - { argument = argument'; comments = comments' } - - method union_type _loc (t : ('loc, 'loc) Ast.Type.Union.t) = - let open Ast.Type.Union in - let { types = (t0, t1, ts); comments } = t in - let t0' = this#type_ t0 in - let t1' = this#type_ t1 in - let ts' = map_list this#type_ ts in - let comments' = this#syntax_opt comments in - if t0' == t0 && t1' == t1 && ts' == ts && comments' == comments then - t - else - { types = (t0', t1', ts'); comments = comments' } - - method intersection_type _loc (t : ('loc, 'loc) Ast.Type.Intersection.t) = - let open Ast.Type.Intersection in - let { types = (t0, t1, ts); comments } = t in - let t0' = this#type_ t0 in - let t1' = this#type_ t1 in - let ts' = map_list this#type_ ts in - let comments' = this#syntax_opt comments in - if t0' == t0 && t1' == t1 && ts' == ts && comments' == comments then - t - else - { types = (t0', t1', ts'); comments = comments' } - - method type_ (t : ('loc, 'loc) Ast.Type.t) = - let open Ast.Type in - match t with - | (loc, Any comments) -> id this#syntax_opt comments t (fun comments -> (loc, Any comments)) - | (loc, Mixed comments) -> - id this#syntax_opt comments t (fun comments -> (loc, Mixed comments)) - | (loc, Empty comments) -> - id this#syntax_opt comments t (fun comments -> (loc, Empty comments)) - | (loc, Void comments) -> id this#syntax_opt comments t (fun comments -> (loc, Void comments)) - | (loc, Null comments) -> id this#syntax_opt comments t (fun comments -> (loc, Null comments)) - | (loc, Symbol comments) -> - id this#syntax_opt comments t (fun comments -> (loc, Symbol comments)) - | (loc, Number comments) -> - id this#syntax_opt comments t (fun comments -> (loc, Number comments)) - | (loc, BigInt comments) -> - id this#syntax_opt comments t (fun comments -> (loc, BigInt comments)) - | (loc, String comments) -> - id this#syntax_opt comments t (fun comments -> (loc, String comments)) - | (loc, Boolean comments) -> - id this#syntax_opt comments t (fun comments -> (loc, Boolean comments)) - | (loc, Exists comments) -> - id this#syntax_opt comments t (fun comments -> (loc, Exists comments)) - | (loc, Nullable t') -> id this#nullable_type t' t (fun t' -> (loc, Nullable t')) - | (loc, Array t') -> id this#array_type t' t (fun t' -> (loc, Array t')) - | (loc, Typeof t') -> id this#typeof_type t' t (fun t' -> (loc, Typeof t')) - | (loc, Function ft) -> id_loc this#function_type loc ft t (fun ft -> (loc, Function ft)) - | (loc, Object ot) -> id_loc this#object_type loc ot t (fun ot -> (loc, Object ot)) - | (loc, Interface i) -> id_loc this#interface_type loc i t (fun i -> (loc, Interface i)) - | (loc, Generic gt) -> id_loc this#generic_type loc gt t (fun gt -> (loc, Generic gt)) - | (loc, IndexedAccess ia) -> - id_loc this#indexed_access loc ia t (fun ia -> (loc, IndexedAccess ia)) - | (loc, OptionalIndexedAccess ia) -> - id_loc this#optional_indexed_access loc ia t (fun ia -> (loc, OptionalIndexedAccess ia)) - | (loc, StringLiteral lit) -> - id_loc this#string_literal_type loc lit t (fun lit -> (loc, StringLiteral lit)) - | (loc, NumberLiteral lit) -> - id_loc this#number_literal_type loc lit t (fun lit -> (loc, NumberLiteral lit)) - | (loc, BigIntLiteral lit) -> - id_loc this#bigint_literal_type loc lit t (fun lit -> (loc, BigIntLiteral lit)) - | (loc, BooleanLiteral lit) -> - id_loc this#boolean_literal_type loc lit t (fun lit -> (loc, BooleanLiteral lit)) - | (loc, Union t') -> id_loc this#union_type loc t' t (fun t' -> (loc, Union t')) - | (loc, Intersection t') -> - id_loc this#intersection_type loc t' t (fun t' -> (loc, Intersection t')) - | (loc, Tuple t') -> id this#tuple_type t' t (fun t' -> (loc, Tuple t')) - - method type_annotation (annot : ('loc, 'loc) Ast.Type.annotation) = - let (loc, a) = annot in - id this#type_ a annot (fun a -> (loc, a)) - - method type_annotation_hint (return : ('M, 'T) Ast.Type.annotation_or_hint) = - let open Ast.Type in - match return with - | Available annot -> - let annot' = this#type_annotation annot in - if annot' == annot then - return - else - Available annot' - | Missing _loc -> return - - method function_declaration loc (stmt : ('loc, 'loc) Ast.Function.t) = this#function_ loc stmt - - method function_expression loc (stmt : ('loc, 'loc) Ast.Function.t) = - this#function_expression_or_method loc stmt - - (** previously, we conflated [function_expression] and [class_method]. callers should be - updated to override those individually. *) - 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) = - let open Ast.Function in - let { - id = ident; - params; - body; - async; - generator; - predicate; - return; - tparams; - sig_loc; - comments; - } = - expr - in - let ident' = map_opt this#function_identifier ident in - let tparams' = map_opt this#type_params tparams in - let params' = this#function_params params in - let return' = this#type_annotation_hint return in - let body' = this#function_body_any body in - let predicate' = map_opt this#predicate predicate in - let comments' = this#syntax_opt comments in - if - ident == ident' - && params == params' - && body == body' - && predicate == predicate' - && return == return' - && tparams == tparams' - && comments == comments' - then - expr - else - { - id = ident'; - params = params'; - return = return'; - body = body'; - async; - generator; - predicate = predicate'; - tparams = tparams'; - sig_loc; - comments = comments'; - } - - method function_params (params : ('loc, 'loc) Ast.Function.Params.t) = - let open Ast.Function in - let (loc, { Params.params = params_list; rest; comments; this_ }) = params in - let params_list' = map_list this#function_param params_list in - let rest' = map_opt this#function_rest_param rest in - let this_' = map_opt this#function_this_param this_ in - let comments' = this#syntax_opt comments in - if params_list == params_list' && rest == rest' && comments == comments' && this_ == this_' - then - params - else - (loc, { Params.params = params_list'; rest = rest'; comments = comments'; this_ = this_' }) - - method function_this_param (this_param : ('loc, 'loc) Ast.Function.ThisParam.t) = - let open Ast.Function.ThisParam in - let (loc, { annot; comments }) = this_param in - let annot' = this#type_annotation annot in - let comments' = this#syntax_opt comments in - if annot' == annot && comments' == comments then - this_param - else - (loc, { annot = annot'; comments = comments' }) - - method function_param (param : ('loc, 'loc) Ast.Function.Param.t) = - let open Ast.Function.Param in - let (loc, { argument; default }) = param in - let argument' = this#function_param_pattern argument in - let default' = map_opt this#expression default in - if argument == argument' && default == default' then - param - else - (loc, { argument = argument'; default = default' }) - - method function_body_any (body : ('loc, 'loc) Ast.Function.body) = - match body with - | Ast.Function.BodyBlock block -> - id this#function_body block body (fun block -> Ast.Function.BodyBlock block) - | Ast.Function.BodyExpression expr -> - id this#expression expr body (fun expr -> Ast.Function.BodyExpression expr) - - method function_body (body : 'loc * ('loc, 'loc) Ast.Statement.Block.t) = - let (loc, block) = body in - id_loc this#block loc block body (fun block -> (loc, block)) - - method function_identifier (ident : ('loc, 'loc) Ast.Identifier.t) = - this#pattern_identifier ~kind:Ast.Statement.VariableDeclaration.Var ident - - (* TODO *) - method generator _loc (expr : ('loc, 'loc) Ast.Expression.Generator.t) = expr - - method identifier (id : ('loc, 'loc) Ast.Identifier.t) = - let open Ast.Identifier in - let (loc, { name; comments }) = id in - let comments' = this#syntax_opt comments in - if comments == comments' then - id - else - (loc, { name; comments = comments' }) - - method type_identifier (id : ('loc, 'loc) Ast.Identifier.t) = this#identifier id - - method type_identifier_reference (id : ('loc, 'loc) Ast.Identifier.t) = this#type_identifier id - - method binding_type_identifier (id : ('loc, 'loc) Ast.Identifier.t) = this#type_identifier id - - method interface _loc (interface : ('loc, 'loc) Ast.Statement.Interface.t) = - let open Ast.Statement.Interface in - let { id = ident; tparams; extends; body; comments } = interface in - let id' = this#binding_type_identifier ident in - let tparams' = map_opt this#type_params tparams in - let extends' = map_list (map_loc this#generic_type) extends in - let body' = map_loc this#object_type body in - let comments' = this#syntax_opt comments in - if - id' == ident - && tparams' == tparams - && extends' == extends - && body' == body - && comments' == comments - then - interface - else - { id = id'; tparams = tparams'; extends = extends'; body = body'; comments = comments' } - - method interface_declaration loc (decl : ('loc, 'loc) Ast.Statement.Interface.t) = - this#interface loc decl - - method private_name (id : 'loc Ast.PrivateName.t) = - let open Ast.PrivateName in - let (loc, { name; comments }) = id in - let comments' = this#syntax_opt comments in - if comments == comments' then - id - else - (loc, { name; comments = comments' }) - - method computed_key (key : ('loc, 'loc) Ast.ComputedKey.t) = - let open Ast.ComputedKey in - let (loc, { expression; comments }) = key in - let expression' = this#expression expression in - let comments' = this#syntax_opt comments in - if expression == expression' && comments == comments' then - key - else - (loc, { expression = expression'; comments = comments' }) - - method import _loc (expr : ('loc, 'loc) Ast.Expression.Import.t) = - let open Ast.Expression.Import in - let { argument; comments } = expr in - let argument' = this#expression argument in - let comments' = this#syntax_opt comments in - if argument == argument' && comments == comments' then - expr - else - { argument = argument'; comments = comments' } - - method if_consequent_statement ~has_else (stmt : ('loc, 'loc) Ast.Statement.t) = - ignore has_else; - this#statement stmt - - method if_alternate_statement _loc (altern : ('loc, 'loc) Ast.Statement.If.Alternate.t') = - let open Ast.Statement.If.Alternate in - let { body; comments } = altern in - let body' = this#statement body in - let comments' = this#syntax_opt comments in - if body == body' && comments == comments' then - altern - else - { body = body'; comments = comments' } - - method if_statement _loc (stmt : ('loc, 'loc) Ast.Statement.If.t) = - let open Ast.Statement.If in - let { test; consequent; alternate; comments } = stmt in - let test' = this#predicate_expression test in - let consequent' = this#if_consequent_statement ~has_else:(alternate <> None) consequent in - let alternate' = map_opt (map_loc this#if_alternate_statement) alternate in - let comments' = this#syntax_opt comments in - if - test == test' - && consequent == consequent' - && alternate == alternate' - && comments == comments' - then - stmt - else - { test = test'; consequent = consequent'; alternate = alternate'; comments = comments' } - - method import_declaration _loc (decl : ('loc, 'loc) Ast.Statement.ImportDeclaration.t) = - let open Ast.Statement.ImportDeclaration in - let { import_kind; source; specifiers; default; comments } = decl in - let source' = map_loc this#import_source source in - let specifiers' = map_opt (this#import_specifier ~import_kind) specifiers in - let default' = map_opt (this#import_default_specifier ~import_kind) default in - let comments' = this#syntax_opt comments in - if - source == source' - && specifiers == specifiers' - && default == default' - && comments == comments' - then - decl - else - { - import_kind; - source = source'; - specifiers = specifiers'; - default = default'; - comments = comments'; - } - - method import_source _loc (source : 'loc Ast.StringLiteral.t) = - let open Ast.StringLiteral in - let { value; raw; comments } = source in - let comments' = this#syntax_opt comments in - if comments == comments' then - source - else - { value; raw; comments = comments' } - - method import_specifier - ~import_kind (specifier : ('loc, 'loc) Ast.Statement.ImportDeclaration.specifier) = - let open Ast.Statement.ImportDeclaration in - match specifier with - | ImportNamedSpecifiers named_specifiers -> - let named_specifiers' = - map_list (this#import_named_specifier ~import_kind) named_specifiers - in - if named_specifiers == named_specifiers' then - specifier - else - ImportNamedSpecifiers named_specifiers' - | ImportNamespaceSpecifier (loc, ident) -> - id_loc (this#import_namespace_specifier ~import_kind) loc ident specifier (fun ident -> - ImportNamespaceSpecifier (loc, ident) - ) - - method remote_identifier id = this#identifier id - - method import_named_specifier - ~(import_kind : Ast.Statement.ImportDeclaration.import_kind) - (specifier : ('loc, 'loc) Ast.Statement.ImportDeclaration.named_specifier) = - let open Ast.Statement.ImportDeclaration in - let { kind; local; remote } = specifier in - let (is_type_remote, is_type_local) = - match (import_kind, kind) with - | (ImportType, _) - | (_, Some ImportType) -> - (true, true) - | (ImportTypeof, _) - | (_, Some ImportTypeof) -> - (false, true) - | _ -> (false, false) - in - let remote' = - match local with - | None -> - if is_type_remote then - this#binding_type_identifier remote - else - this#pattern_identifier ~kind:Ast.Statement.VariableDeclaration.Let remote - | Some _ -> this#remote_identifier remote - in - let local' = - match local with - | None -> None - | Some ident -> - let local_visitor = - if is_type_local then - this#binding_type_identifier - else - this#pattern_identifier ~kind:Ast.Statement.VariableDeclaration.Let - in - id local_visitor ident local (fun ident -> Some ident) - in - if local == local' && remote == remote' then - specifier - else - { kind; local = local'; remote = remote' } - - method import_default_specifier ~import_kind (id : ('loc, 'loc) Ast.Identifier.t) = - let open Ast.Statement.ImportDeclaration in - let local_visitor = - match import_kind with - | ImportType - | ImportTypeof -> - this#binding_type_identifier - | _ -> this#pattern_identifier ~kind:Ast.Statement.VariableDeclaration.Let - in - local_visitor id - - method import_namespace_specifier ~import_kind _loc (id : ('loc, 'loc) Ast.Identifier.t) = - let open Ast.Statement.ImportDeclaration in - let local_visitor = - match import_kind with - | ImportType - | ImportTypeof -> - this#binding_type_identifier - | _ -> this#pattern_identifier ~kind:Ast.Statement.VariableDeclaration.Let - in - local_visitor id - - method jsx_element _loc (expr : ('loc, 'loc) Ast.JSX.element) = - let open Ast.JSX in - let { opening_element; closing_element; children; comments } = expr in - let opening_element' = this#jsx_opening_element opening_element in - let closing_element' = map_opt this#jsx_closing_element closing_element in - let children' = this#jsx_children children in - let comments' = this#syntax_opt comments in - if - opening_element == opening_element' - && closing_element == closing_element' - && children == children' - && comments == comments' - then - expr - else - { - opening_element = opening_element'; - closing_element = closing_element'; - children = children'; - comments = comments'; - } - - method jsx_fragment _loc (expr : ('loc, 'loc) Ast.JSX.fragment) = - let open Ast.JSX in - let { frag_children; frag_comments; _ } = expr in - let children' = this#jsx_children frag_children in - let frag_comments' = this#syntax_opt frag_comments in - if frag_children == children' && frag_comments == frag_comments' then - expr - else - { expr with frag_children = children'; frag_comments = frag_comments' } - - method jsx_opening_element (elem : ('loc, 'loc) Ast.JSX.Opening.t) = - let open Ast.JSX.Opening in - let (loc, { name; self_closing; attributes }) = elem in - let name' = this#jsx_element_name name in - let attributes' = map_list this#jsx_opening_attribute attributes in - if name == name' && attributes == attributes' then - elem - else - (loc, { name = name'; self_closing; attributes = attributes' }) - - method jsx_closing_element (elem : ('loc, 'loc) Ast.JSX.Closing.t) = - let open Ast.JSX.Closing in - let (loc, { name }) = elem in - let name' = this#jsx_element_name name in - if name == name' then - elem - else - (loc, { name = name' }) - - method jsx_opening_attribute (jsx_attr : ('loc, 'loc) Ast.JSX.Opening.attribute) = - let open Ast.JSX.Opening in - match jsx_attr with - | Attribute attr -> id this#jsx_attribute attr jsx_attr (fun attr -> Attribute attr) - | SpreadAttribute (loc, attr) -> - id_loc this#jsx_spread_attribute loc attr jsx_attr (fun attr -> SpreadAttribute (loc, attr)) - - method jsx_spread_attribute _loc (attr : ('loc, 'loc) Ast.JSX.SpreadAttribute.t') = - let open Ast.JSX.SpreadAttribute in - let { argument; comments } = attr in - let argument' = this#expression argument in - let comments' = this#syntax_opt comments in - if argument == argument' && comments == comments' then - attr - else - { argument = argument'; comments = comments' } - - method jsx_attribute (attr : ('loc, 'loc) Ast.JSX.Attribute.t) = - let open Ast.JSX.Attribute in - let (loc, { name; value }) = attr in - let name' = this#jsx_attribute_name name in - let value' = map_opt this#jsx_attribute_value value in - if name == name' && value == value' then - attr - else - (loc, { name = name'; value = value' }) - - method jsx_attribute_name (name : ('loc, 'loc) Ast.JSX.Attribute.name) = - let open Ast.JSX.Attribute in - match name with - | Identifier ident -> - id this#jsx_attribute_name_identifier ident name (fun ident -> Identifier ident) - | NamespacedName ns -> - id this#jsx_attribute_name_namespaced ns name (fun ns -> NamespacedName ns) - - method jsx_attribute_name_identifier ident = this#jsx_identifier ident - - method jsx_attribute_name_namespaced ns = this#jsx_namespaced_name ns - - method jsx_attribute_value (value : ('loc, 'loc) Ast.JSX.Attribute.value) = - let open Ast.JSX.Attribute in - match value with - | Literal (loc, lit) -> - id_loc this#jsx_attribute_value_literal loc lit value (fun lit -> Literal (loc, lit)) - | ExpressionContainer (loc, expr) -> - id_loc this#jsx_attribute_value_expression loc expr value (fun expr -> - ExpressionContainer (loc, expr) - ) - - method jsx_attribute_value_expression loc (jsx_expr : ('loc, 'loc) Ast.JSX.ExpressionContainer.t) - = - this#jsx_expression loc jsx_expr - - method jsx_attribute_value_literal loc (lit : 'loc Ast.Literal.t) = this#literal loc lit - - method jsx_children ((loc, children) as orig : 'loc * ('loc, 'loc) Ast.JSX.child list) = - let children' = map_list this#jsx_child children in - if children == children' then - orig - else - (loc, children') - - method jsx_child (child : ('loc, 'loc) Ast.JSX.child) = - let open Ast.JSX in - match child with - | (loc, Element elem) -> - id_loc this#jsx_element loc elem child (fun elem -> (loc, Element elem)) - | (loc, Fragment frag) -> - id_loc this#jsx_fragment loc frag child (fun frag -> (loc, Fragment frag)) - | (loc, ExpressionContainer expr) -> - id_loc this#jsx_expression loc expr child (fun expr -> (loc, ExpressionContainer expr)) - | (loc, SpreadChild spread) -> - id this#jsx_spread_child spread child (fun spread -> (loc, SpreadChild spread)) - | (_loc, Text _) -> child - - method jsx_expression _loc (jsx_expr : ('loc, 'loc) Ast.JSX.ExpressionContainer.t) = - let open Ast.JSX.ExpressionContainer in - let { expression; comments } = jsx_expr in - let comments' = this#syntax_opt comments in - match expression with - | Expression expr -> - let expr' = this#expression expr in - if expr == expr' && comments == comments' then - jsx_expr - else - { expression = Expression expr'; comments = comments' } - | EmptyExpression -> - if comments == comments' then - jsx_expr - else - { expression = EmptyExpression; comments = comments' } - - method jsx_spread_child (jsx_spread_child : ('loc, 'loc) Ast.JSX.SpreadChild.t) = - let open Ast.JSX.SpreadChild in - let { expression; comments } = jsx_spread_child in - let expression' = this#expression expression in - let comments' = this#syntax_opt comments in - if expression == expression' && comments == comments' then - jsx_spread_child - else - { expression = expression'; comments = comments' } - - method jsx_element_name (name : ('loc, 'loc) Ast.JSX.name) = - let open Ast.JSX in - match name with - | Identifier ident -> - id this#jsx_element_name_identifier ident name (fun ident -> Identifier ident) - | NamespacedName ns -> - id this#jsx_element_name_namespaced ns name (fun ns -> NamespacedName ns) - | MemberExpression expr -> - id this#jsx_element_name_member_expression expr name (fun expr -> MemberExpression expr) - - method jsx_element_name_identifier ident = this#jsx_identifier ident - - method jsx_element_name_namespaced ns = this#jsx_namespaced_name ns - - method jsx_element_name_member_expression expr = this#jsx_member_expression expr - - method jsx_namespaced_name (namespaced_name : ('loc, 'loc) Ast.JSX.NamespacedName.t) = - let open Ast.JSX in - NamespacedName.( - let (loc, { namespace; name }) = namespaced_name in - let namespace' = this#jsx_identifier namespace in - let name' = this#jsx_identifier name in - if namespace == namespace' && name == name' then - namespaced_name - else - (loc, { namespace = namespace'; name = name' }) - ) - - method jsx_member_expression (member_exp : ('loc, 'loc) Ast.JSX.MemberExpression.t) = - let open Ast.JSX in - let (loc, { MemberExpression._object; MemberExpression.property }) = member_exp in - let _object' = this#jsx_member_expression_object _object in - let property' = this#jsx_identifier property in - if _object == _object' && property == property' then - member_exp - else - (loc, MemberExpression.{ _object = _object'; property = property' }) - - method jsx_member_expression_object (_object : ('loc, 'loc) Ast.JSX.MemberExpression._object) = - let open Ast.JSX.MemberExpression in - match _object with - | Identifier ident -> - id this#jsx_member_expression_identifier ident _object (fun ident -> Identifier ident) - | MemberExpression nested_exp -> - id this#jsx_member_expression nested_exp _object (fun exp -> MemberExpression exp) - - method jsx_member_expression_identifier ident = this#jsx_element_name_identifier ident - - method jsx_identifier (id : ('loc, 'loc) Ast.JSX.Identifier.t) = - let open Ast.JSX.Identifier in - let (loc, { name; comments }) = id in - let comments' = this#syntax_opt comments in - if comments == comments' then - id - else - (loc, { name; comments = comments' }) - - method labeled_statement _loc (stmt : ('loc, 'loc) Ast.Statement.Labeled.t) = - let open Ast.Statement.Labeled in - let { label; body; comments } = stmt in - let label' = this#label_identifier label in - let body' = this#statement body in - let comments' = this#syntax_opt comments in - if label == label' && body == body' && comments == comments' then - stmt - else - { label = label'; body = body'; comments = comments' } - - method literal _loc (expr : 'loc Ast.Literal.t) = - let open Ast.Literal in - let { value; raw; comments } = expr in - let comments' = this#syntax_opt comments in - if comments == comments' then - expr - else - { value; raw; comments = comments' } - - method logical _loc (expr : ('loc, 'loc) Ast.Expression.Logical.t) = - let open Ast.Expression.Logical in - let { operator = _; left; right; comments } = expr in - let left' = this#expression left in - let right' = this#expression right in - let comments' = this#syntax_opt comments in - if left == left' && right == right' && comments == comments' then - expr - else - { expr with left = left'; right = right'; comments = comments' } - - method member _loc (expr : ('loc, 'loc) Ast.Expression.Member.t) = - let open Ast.Expression.Member in - let { _object; property; comments } = expr in - let _object' = this#expression _object in - let property' = this#member_property property in - let comments' = this#syntax_opt comments in - if _object == _object' && property == property' && comments == comments' then - expr - else - { _object = _object'; property = property'; comments = comments' } - - method optional_member loc (expr : ('loc, 'loc) Ast.Expression.OptionalMember.t) = - let open Ast.Expression.OptionalMember in - let { member; optional = _; filtered_out = _ } = expr in - let member' = this#member loc member in - if member == member' then - expr - else - { expr with member = member' } - - method member_property (expr : ('loc, 'loc) Ast.Expression.Member.property) = - let open Ast.Expression.Member in - match expr with - | PropertyIdentifier ident -> - id this#member_property_identifier ident expr (fun ident -> PropertyIdentifier ident) - | PropertyPrivateName ident -> - id this#member_private_name ident expr (fun ident -> PropertyPrivateName ident) - | PropertyExpression e -> - id this#member_property_expression e expr (fun e -> PropertyExpression e) - - method member_property_identifier (ident : ('loc, 'loc) Ast.Identifier.t) = - this#identifier ident - - method member_private_name (name : 'loc Ast.PrivateName.t) = this#private_name name - - method member_property_expression (expr : ('loc, 'loc) Ast.Expression.t) = this#expression expr - - method meta_property _loc (expr : 'loc Ast.Expression.MetaProperty.t) = - let open Ast.Expression.MetaProperty in - let { meta; property; comments } = expr in - let meta' = this#identifier meta in - let property' = this#identifier property in - let comments' = this#syntax_opt comments in - if meta == meta' && property == property' && comments == comments' then - expr - else - { meta = meta'; property = property'; comments = comments' } - - method new_ _loc (expr : ('loc, 'loc) Ast.Expression.New.t) = - let open Ast.Expression.New in - let { callee; targs; arguments; comments } = expr in - let callee' = this#expression callee in - let targs' = map_opt this#call_type_args targs in - let arguments' = map_opt this#call_arguments arguments in - let comments' = this#syntax_opt comments in - if callee == callee' && targs == targs' && arguments == arguments' && comments == comments' - then - expr - else - { callee = callee'; targs = targs'; arguments = arguments'; comments = comments' } - - method object_ _loc (expr : ('loc, 'loc) Ast.Expression.Object.t) = - let open Ast.Expression.Object in - let { properties; comments } = expr in - let properties' = - map_list - (fun prop -> - match prop with - | Property p -> - let p' = this#object_property p in - if p == p' then - prop - else - Property p' - | SpreadProperty s -> - let s' = this#spread_property s in - if s == s' then - prop - else - SpreadProperty s') - properties - in - let comments' = this#syntax_opt comments in - if properties == properties' && comments == comments' then - expr - else - { properties = properties'; comments = comments' } - - method object_property (prop : ('loc, 'loc) Ast.Expression.Object.Property.t) = - let open Ast.Expression.Object.Property in - match prop with - | (loc, Init { key; value; shorthand }) -> - let key' = this#object_key key in - let value' = this#expression value in - let shorthand' = - (* Try to figure out if shorthand should still be true--if - key and value change differently, it should become false *) - shorthand - && - match (key', value') with - | ( Identifier (_, { Ast.Identifier.name = key_name; _ }), - (_, Ast.Expression.Identifier (_, { Ast.Identifier.name = value_name; _ })) - ) -> - String.equal key_name value_name - | _ -> key == key' && value == value' - in - if key == key' && value == value' && shorthand == shorthand' then - prop - else - (loc, Init { key = key'; value = value'; shorthand = shorthand' }) - | (loc, Method { key; value = fn }) -> - let key' = this#object_key key in - let fn' = map_loc this#function_expression_or_method fn in - if key == key' && fn == fn' then - prop - else - (loc, Method { key = key'; value = fn' }) - | (loc, Get { key; value = fn; comments }) -> - let key' = this#object_key key in - let fn' = map_loc this#function_expression_or_method fn in - let comments' = this#syntax_opt comments in - if key == key' && fn == fn' && comments == comments' then - prop - else - (loc, Get { key = key'; value = fn'; comments = comments' }) - | (loc, Set { key; value = fn; comments }) -> - let key' = this#object_key key in - let fn' = map_loc this#function_expression_or_method fn in - let comments' = this#syntax_opt comments in - if key == key' && fn == fn' && comments == comments' then - prop - else - (loc, Set { key = key'; value = fn'; comments = comments' }) - - method object_key (key : ('loc, 'loc) Ast.Expression.Object.Property.key) = - let open Ast.Expression.Object.Property in - match key with - | Literal literal -> id this#object_key_literal literal key (fun lit -> Literal lit) - | Identifier ident -> id this#object_key_identifier ident key (fun ident -> Identifier ident) - | PrivateName ident -> id this#private_name ident key (fun ident -> PrivateName ident) - | Computed computed -> id this#object_key_computed computed key (fun expr -> Computed expr) - - method object_key_literal (literal : 'loc * 'loc Ast.Literal.t) = - let (loc, lit) = literal in - id_loc this#literal loc lit literal (fun lit -> (loc, lit)) - - method object_key_identifier (ident : ('loc, 'loc) Ast.Identifier.t) = this#identifier ident - - method object_key_computed (key : ('loc, 'loc) Ast.ComputedKey.t) = this#computed_key key - - method opaque_type _loc (otype : ('loc, 'loc) Ast.Statement.OpaqueType.t) = - let open Ast.Statement.OpaqueType in - let { id; tparams; impltype; supertype; comments } = otype in - let id' = this#binding_type_identifier id in - let tparams' = map_opt this#type_params tparams in - let impltype' = map_opt this#type_ impltype in - let supertype' = map_opt this#type_ supertype in - let comments' = this#syntax_opt comments in - if - id == id' - && impltype == impltype' - && tparams == tparams' - && impltype == impltype' - && supertype == supertype' - && comments == comments' - then - otype - else - { - id = id'; - tparams = tparams'; - impltype = impltype'; - supertype = supertype'; - comments = comments'; - } - - method function_param_pattern (expr : ('loc, 'loc) Ast.Pattern.t) = - this#binding_pattern ~kind:Ast.Statement.VariableDeclaration.Let expr - - method variable_declarator_pattern ~kind (expr : ('loc, 'loc) Ast.Pattern.t) = - this#binding_pattern ~kind expr - - method catch_clause_pattern (expr : ('loc, 'loc) Ast.Pattern.t) = - this#binding_pattern ~kind:Ast.Statement.VariableDeclaration.Let expr - - method for_in_assignment_pattern (expr : ('loc, 'loc) Ast.Pattern.t) = - this#assignment_pattern expr - - method for_of_assignment_pattern (expr : ('loc, 'loc) Ast.Pattern.t) = - this#assignment_pattern expr - - method binding_pattern - ?(kind = Ast.Statement.VariableDeclaration.Var) (expr : ('loc, 'loc) Ast.Pattern.t) = - this#pattern ~kind expr - - method assignment_pattern (expr : ('loc, 'loc) Ast.Pattern.t) = this#pattern expr - - (* NOTE: Patterns are highly overloaded. A pattern can be a binding pattern, - which has a kind (Var/Let/Const, with Var being the default for all pre-ES5 - bindings), or an assignment pattern, which has no kind. Subterms that are - patterns inherit the kind (or lack thereof). *) - method pattern ?kind (expr : ('loc, 'loc) Ast.Pattern.t) = - let open Ast.Pattern in - let (loc, patt) = expr in - let patt' = - match patt with - | Object { Object.properties; annot; comments } -> - let properties' = map_list (this#pattern_object_p ?kind) properties in - let annot' = this#type_annotation_hint annot in - let comments' = this#syntax_opt comments in - if properties' == properties && annot' == annot && comments' == comments then - patt - else - Object { Object.properties = properties'; annot = annot'; comments = comments' } - | Array { Array.elements; annot; comments } -> - let elements' = map_list (this#pattern_array_e ?kind) elements in - let annot' = this#type_annotation_hint annot in - let comments' = this#syntax_opt comments in - if comments == comments' && elements' == elements && annot' == annot then - patt - else - Array { Array.elements = elements'; annot = annot'; comments = comments' } - | Identifier { Identifier.name; annot; optional } -> - let name' = this#pattern_identifier ?kind name in - let annot' = this#type_annotation_hint annot in - if name == name' && annot == annot' then - patt - else - Identifier { Identifier.name = name'; annot = annot'; optional } - | Expression e -> id this#pattern_expression e patt (fun e -> Expression e) - in - if patt == patt' then - expr - else - (loc, patt') - - method pattern_identifier ?kind (ident : ('loc, 'loc) Ast.Identifier.t) = - ignore kind; - this#identifier ident - - method pattern_literal ?kind loc (expr : 'loc Ast.Literal.t) = - ignore kind; - this#literal loc expr - - method pattern_object_p ?kind (p : ('loc, 'loc) Ast.Pattern.Object.property) = - let open Ast.Pattern.Object in - match p with - | Property prop -> id (this#pattern_object_property ?kind) prop p (fun prop -> Property prop) - | RestElement prop -> - id (this#pattern_object_rest_property ?kind) prop p (fun prop -> RestElement prop) - - method pattern_object_property ?kind (prop : ('loc, 'loc) Ast.Pattern.Object.Property.t) = - let open Ast.Pattern.Object.Property in - let (loc, { key; pattern; default; shorthand }) = prop in - let key' = this#pattern_object_property_key ?kind key in - let pattern' = this#pattern_object_property_pattern ?kind pattern in - let default' = map_opt this#expression default in - let shorthand' = - (* Try to figure out if shorthand should still be true--if - key and value change differently, it should become false *) - shorthand - && - match (key', pattern') with - | ( Identifier (_, { Ast.Identifier.name = key_name; _ }), - ( _, - Ast.Pattern.Identifier - { Ast.Pattern.Identifier.name = (_, { Ast.Identifier.name = value_name; _ }); _ } - ) - ) -> - String.equal key_name value_name - | _ -> key == key' && pattern == pattern' - in - if key' == key && pattern' == pattern && default' == default && shorthand == shorthand' then - prop - else - (loc, { key = key'; pattern = pattern'; default = default'; shorthand = shorthand' }) - - method pattern_object_property_key ?kind (key : ('loc, 'loc) Ast.Pattern.Object.Property.key) = - let open Ast.Pattern.Object.Property in - match key with - | Literal lit -> - id (this#pattern_object_property_literal_key ?kind) lit key (fun lit' -> Literal lit') - | Identifier identifier -> - id (this#pattern_object_property_identifier_key ?kind) identifier key (fun id' -> - Identifier id' - ) - | Computed expr -> - id (this#pattern_object_property_computed_key ?kind) expr key (fun expr' -> Computed expr') - - method pattern_object_property_literal_key ?kind (literal : 'loc * 'loc Ast.Literal.t) = - let (loc, key) = literal in - id_loc (this#pattern_literal ?kind) loc key literal (fun key' -> (loc, key')) - - method pattern_object_property_identifier_key ?kind (key : ('loc, 'loc) Ast.Identifier.t) = - this#pattern_identifier ?kind key - - method pattern_object_property_computed_key ?kind (key : ('loc, 'loc) Ast.ComputedKey.t) = - ignore kind; - this#computed_key key - - method pattern_object_rest_property ?kind (prop : ('loc, 'loc) Ast.Pattern.RestElement.t) = - let open Ast.Pattern.RestElement in - let (loc, { argument; comments }) = prop in - let argument' = this#pattern_object_rest_property_pattern ?kind argument in - let comments' = this#syntax_opt comments in - if argument' == argument && comments == comments' then - prop - else - (loc, { argument = argument'; comments = comments' }) - - method pattern_object_property_pattern ?kind (expr : ('loc, 'loc) Ast.Pattern.t) = - this#pattern ?kind expr - - method pattern_object_rest_property_pattern ?kind (expr : ('loc, 'loc) Ast.Pattern.t) = - this#pattern ?kind expr - - method pattern_array_e ?kind (e : ('loc, 'loc) Ast.Pattern.Array.element) = - let open Ast.Pattern.Array in - match e with - | Hole _ -> e - | Element elem -> id (this#pattern_array_element ?kind) elem e (fun elem -> Element elem) - | RestElement elem -> - id (this#pattern_array_rest_element ?kind) elem e (fun elem -> RestElement elem) - - method pattern_array_element ?kind (elem : ('loc, 'loc) Ast.Pattern.Array.Element.t) = - let open Ast.Pattern.Array.Element in - let (loc, { argument; default }) = elem in - let argument' = this#pattern_array_element_pattern ?kind argument in - let default' = map_opt this#expression default in - if argument == argument' && default == default' then - elem - else - (loc, { argument = argument'; default = default' }) - - method pattern_array_element_pattern ?kind (patt : ('loc, 'loc) Ast.Pattern.t) = - this#pattern ?kind patt - - method pattern_array_rest_element ?kind (elem : ('loc, 'loc) Ast.Pattern.RestElement.t) = - let open Ast.Pattern.RestElement in - let (loc, { argument; comments }) = elem in - let argument' = this#pattern_array_rest_element_pattern ?kind argument in - let comments' = this#syntax_opt comments in - if argument' == argument && comments == comments' then - elem - else - (loc, { argument = argument'; comments = comments' }) - - method pattern_array_rest_element_pattern ?kind (expr : ('loc, 'loc) Ast.Pattern.t) = - this#pattern ?kind expr - - method pattern_expression (expr : ('loc, 'loc) Ast.Expression.t) = this#expression expr - - method predicate (pred : ('loc, 'loc) Ast.Type.Predicate.t) = - let open Ast.Type.Predicate in - let (loc, { kind; comments }) = pred in - let kind' = - match kind with - | Inferred -> kind - | Declared expr -> id this#expression expr kind (fun expr' -> Declared expr') - in - let comments' = this#syntax_opt comments in - if kind == kind' && comments == comments' then - pred - else - (loc, { kind = kind'; comments = comments' }) - - method predicate_expression (expr : ('loc, 'loc) Ast.Expression.t) = this#expression expr - - method function_rest_param (expr : ('loc, 'loc) Ast.Function.RestParam.t) = - let open Ast.Function.RestParam in - let (loc, { argument; comments }) = expr in - let argument' = this#function_param_pattern argument in - let comments' = this#syntax_opt comments in - if argument == argument' && comments == comments' then - expr - else - (loc, { argument = argument'; comments = comments' }) - - method return _loc (stmt : ('loc, 'loc) Ast.Statement.Return.t) = - let open Ast.Statement.Return in - let { argument; comments; return_out } = stmt in - let argument' = map_opt this#expression argument in - let comments' = this#syntax_opt comments in - if argument == argument' && comments == comments' then - stmt - else - { argument = argument'; comments = comments'; return_out } - - method sequence _loc (expr : ('loc, 'loc) Ast.Expression.Sequence.t) = - let open Ast.Expression.Sequence in - let { expressions; comments } = expr in - let expressions' = map_list this#expression expressions in - let comments' = this#syntax_opt comments in - if expressions == expressions' && comments == comments' then - expr - else - { expressions = expressions'; comments = comments' } - - method toplevel_statement_list (stmts : ('loc, 'loc) Ast.Statement.t list) = - this#statement_list stmts - - method statement_list (stmts : ('loc, 'loc) Ast.Statement.t list) = - map_list_multiple this#statement_fork_point stmts - - method statement_fork_point (stmt : ('loc, 'loc) Ast.Statement.t) = [this#statement stmt] - - method spread_element (expr : ('loc, 'loc) Ast.Expression.SpreadElement.t) = - let open Ast.Expression.SpreadElement in - let (loc, { argument; comments }) = expr in - let argument' = this#expression argument in - let comments' = this#syntax_opt comments in - if argument == argument' && comments == comments' then - expr - else - (loc, { argument = argument'; comments = comments' }) - - method spread_property (expr : ('loc, 'loc) Ast.Expression.Object.SpreadProperty.t) = - let open Ast.Expression.Object.SpreadProperty in - let (loc, { argument; comments }) = expr in - let argument' = this#expression argument in - let comments' = this#syntax_opt comments in - if argument == argument' && comments == comments' then - expr - else - (loc, { argument = argument'; comments = comments' }) - - method super_expression _loc (expr : 'loc Ast.Expression.Super.t) = - let open Ast.Expression.Super in - let { comments } = expr in - let comments' = this#syntax_opt comments in - if comments == comments' then - expr - else - { comments = comments' } - - method switch _loc (switch : ('loc, 'loc) Ast.Statement.Switch.t) = - let open Ast.Statement.Switch in - let { discriminant; cases; comments; exhaustive_out } = switch in - let discriminant' = this#expression discriminant in - let cases' = map_list this#switch_case cases in - let comments' = this#syntax_opt comments in - if discriminant == discriminant' && cases == cases' && comments == comments' then - switch - else - { discriminant = discriminant'; cases = cases'; comments = comments'; exhaustive_out } - - method switch_case (case : ('loc, 'loc) Ast.Statement.Switch.Case.t) = - let open Ast.Statement.Switch.Case in - let (loc, { test; consequent; comments }) = case in - let test' = map_opt this#expression test in - let consequent' = this#statement_list consequent in - let comments' = this#syntax_opt comments in - if test == test' && consequent == consequent' && comments == comments' then - case - else - (loc, { test = test'; consequent = consequent'; comments = comments' }) - - method tagged_template _loc (expr : ('loc, 'loc) Ast.Expression.TaggedTemplate.t) = - let open Ast.Expression.TaggedTemplate in - let { tag; quasi; comments } = expr in - let tag' = this#expression tag in - let quasi' = map_loc this#template_literal quasi in - let comments' = this#syntax_opt comments in - if tag == tag' && quasi == quasi' && comments == comments' then - expr - else - { tag = tag'; quasi = quasi'; comments = comments' } - - method template_literal _loc (expr : ('loc, 'loc) Ast.Expression.TemplateLiteral.t) = - let open Ast.Expression.TemplateLiteral in - let { quasis; expressions; comments } = expr in - let quasis' = map_list this#template_literal_element quasis in - let expressions' = map_list this#expression expressions in - let comments' = this#syntax_opt comments in - if quasis == quasis' && expressions == expressions' && comments == comments' then - expr - else - { quasis = quasis'; expressions = expressions'; comments = comments' } - - (* TODO *) - method template_literal_element (elem : 'loc Ast.Expression.TemplateLiteral.Element.t) = elem - - method this_expression _loc (expr : 'loc Ast.Expression.This.t) = - let open Ast.Expression.This in - let { comments } = expr in - let comments' = this#syntax_opt comments in - if comments == comments' then - expr - else - { comments = comments' } - - method throw _loc (stmt : ('loc, 'loc) Ast.Statement.Throw.t) = - let open Ast.Statement.Throw in - let { argument; comments } = stmt in - let argument' = this#expression argument in - let comments' = this#syntax_opt comments in - if argument == argument' && comments == comments' then - stmt - else - { argument = argument'; comments = comments' } - - method try_catch _loc (stmt : ('loc, 'loc) Ast.Statement.Try.t) = - let open Ast.Statement.Try in - let { block; handler; finalizer; comments } = stmt in - let block' = map_loc this#block block in - let handler' = - match handler with - | Some (loc, clause) -> - id_loc this#catch_clause loc clause handler (fun clause -> Some (loc, clause)) - | None -> handler - in - let finalizer' = - match finalizer with - | Some (finalizer_loc, block) -> - id_loc this#block finalizer_loc block finalizer (fun block -> Some (finalizer_loc, block)) - | None -> finalizer - in - let comments' = this#syntax_opt comments in - if block == block' && handler == handler' && finalizer == finalizer' && comments == comments' - then - stmt - else - { block = block'; handler = handler'; finalizer = finalizer'; comments = comments' } - - method type_cast _loc (expr : ('loc, 'loc) Ast.Expression.TypeCast.t) = - let open Ast.Expression.TypeCast in - let { expression; annot; comments } = expr in - let expression' = this#expression expression in - let annot' = this#type_annotation annot in - let comments' = this#syntax_opt comments in - if expression' == expression && annot' == annot && comments' == comments then - expr - else - { 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 - let { argument; operator = _; comments } = expr in - let argument' = this#expression argument in - let comments' = this#syntax_opt comments in - if argument == argument' && comments == comments' then - expr - else - { expr with argument = argument'; comments = comments' } - - method update_expression _loc (expr : ('loc, 'loc) Ast.Expression.Update.t) = - let open Ast.Expression.Update in - let { argument; operator = _; prefix = _; comments } = expr in - let argument' = this#expression argument in - let comments' = this#syntax_opt comments in - if argument == argument' && comments == comments' then - expr - else - { expr with argument = argument'; comments = comments' } - - method variable_declaration _loc (decl : ('loc, 'loc) Ast.Statement.VariableDeclaration.t) = - let open Ast.Statement.VariableDeclaration in - let { declarations; kind; comments } = decl in - let decls' = map_list (this#variable_declarator ~kind) declarations in - let comments' = this#syntax_opt comments in - if declarations == decls' && comments == comments' then - decl - else - { declarations = decls'; kind; comments = comments' } - - method variable_declarator - ~kind (decl : ('loc, 'loc) Ast.Statement.VariableDeclaration.Declarator.t) = - let open Ast.Statement.VariableDeclaration.Declarator in - let (loc, { id; init }) = decl in - let id' = this#variable_declarator_pattern ~kind id in - let init' = map_opt this#expression init in - if id == id' && init == init' then - decl - else - (loc, { id = id'; init = init' }) - - method while_ _loc (stuff : ('loc, 'loc) Ast.Statement.While.t) = - let open Ast.Statement.While in - let { test; body; comments } = stuff in - let test' = this#predicate_expression test in - let body' = this#statement body in - let comments' = this#syntax_opt comments in - if test == test' && body == body' && comments == comments' then - stuff - else - { test = test'; body = body'; comments = comments' } - - method with_ _loc (stuff : ('loc, 'loc) Ast.Statement.With.t) = - let open Ast.Statement.With in - let { _object; body; comments } = stuff in - let _object' = this#expression _object in - let body' = this#statement body in - let comments' = this#syntax_opt comments in - if _object == _object' && body == body' && comments == comments' then - stuff - else - { _object = _object'; body = body'; comments = comments' } - - method type_alias _loc (stuff : ('loc, 'loc) Ast.Statement.TypeAlias.t) = - let open Ast.Statement.TypeAlias in - let { id; tparams; right; comments } = stuff in - let id' = this#binding_type_identifier id in - let tparams' = map_opt this#type_params tparams in - let right' = this#type_ right in - let comments' = this#syntax_opt comments in - if id == id' && right == right' && tparams == tparams' && comments == comments' then - stuff - else - { id = id'; tparams = tparams'; right = right'; comments = comments' } - - method yield _loc (expr : ('loc, 'loc) Ast.Expression.Yield.t) = - let open Ast.Expression.Yield in - let { argument; delegate; comments; result_out } = expr in - let argument' = map_opt this#expression argument in - let comments' = this#syntax_opt comments in - if comments == comments' && argument == argument' then - expr - else - { argument = argument'; delegate; comments = comments'; result_out } - end - -let fold_program (mappers : 'a mapper list) ast = - List.fold_left (fun ast (m : 'a mapper) -> m#program ast) ast mappers diff --git a/compiler/js_parser/flow_ast_utils.ml b/compiler/js_parser/flow_ast_utils.ml deleted file mode 100644 index cdaee7b075..0000000000 --- a/compiler/js_parser/flow_ast_utils.ml +++ /dev/null @@ -1,339 +0,0 @@ -(* - * 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 Flow_ast - -type 'loc binding = 'loc * string -type 'loc ident = 'loc * string -type 'loc source = 'loc * string - -let rec fold_bindings_of_pattern = - Pattern.( - let property f acc = - Object.( - function - | Property (_, { Property.pattern = p; _ }) - | RestElement (_, { RestElement.argument = p; comments = _ }) -> - fold_bindings_of_pattern f acc p - ) - in - let element f acc = - Array.( - function - | Hole _ -> acc - | Element (_, { Element.argument = p; default = _ }) - | RestElement (_, { RestElement.argument = p; comments = _ }) -> - fold_bindings_of_pattern f acc p - ) - in - fun f acc -> function - | (_, Identifier { Identifier.name; _ }) -> f acc name - | (_, Object { Object.properties; _ }) -> List.fold_left (property f) acc properties - | (_, Array { Array.elements; _ }) -> List.fold_left (element f) acc elements - (* This is for assignment and default param destructuring `[a.b=1]=c`, ignore these for now. *) - | (_, Expression _) -> acc - ) - -let fold_bindings_of_variable_declarations f acc declarations = - let open Flow_ast.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 - match pattern with - | (_, Array { Array.annot = Flow_ast.Type.Available _; _ }) - | (_, Object { Object.annot = Flow_ast.Type.Available _; _ }) - | (_, Identifier { Identifier.annot = Flow_ast.Type.Available _; _ }) -> - true - | _ -> false - in - fold_bindings_of_pattern (f has_anno) acc pattern) - acc - declarations - -let partition_directives statements = - let open Flow_ast.Statement in - let rec helper directives = function - | ((_, Expression { Expression.directive = Some _; _ }) as directive) :: rest -> - helper (directive :: directives) rest - | rest -> (List.rev directives, rest) - in - helper [] statements - -let hoist_function_declarations stmts = - let open Flow_ast.Statement in - let (func_decs, other_stmts) = - List.partition - (function - (* function f() {} *) - | (_, FunctionDeclaration { Flow_ast.Function.id = Some _; _ }) - (* export function f() {} *) - | ( _, - ExportNamedDeclaration - { - ExportNamedDeclaration.declaration = - Some (_, FunctionDeclaration { Flow_ast.Function.id = Some _; _ }); - _; - } - ) - (* export default function f() {} *) - | ( _, - ExportDefaultDeclaration - { - ExportDefaultDeclaration.declaration = - ExportDefaultDeclaration.Declaration - (_, FunctionDeclaration { Flow_ast.Function.id = Some _; _ }); - _; - } - ) - (* declare function f(): void; *) - | (_, DeclareFunction _) - (* declare export function f(): void; *) - | ( _, - DeclareExportDeclaration DeclareExportDeclaration.{ declaration = Some (Function _); _ } - ) -> - true - | _ -> false) - stmts - in - func_decs @ other_stmts - -let negate_number_literal (value, raw) = - let raw_len = String.length raw in - let raw = - if raw_len > 0 && raw.[0] = '-' then - String.sub raw 1 (raw_len - 1) - else - "-" ^ raw - in - (~-.value, raw) - -let is_call_to_invariant callee = - match callee with - | (_, Expression.Identifier (_, { Identifier.name = "invariant"; _ })) -> true - | _ -> false - -let is_call_to_is_array callee = - match callee with - | ( _, - Flow_ast.Expression.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 = _ }); - comments = _; - } - ) -> - true - | _ -> false - -let is_call_to_object_dot_freeze callee = - match callee with - | ( _, - Flow_ast.Expression.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 = _ }); - comments = _; - } - ) -> - true - | _ -> false - -let is_call_to_object_static_method callee = - match callee with - | ( _, - Flow_ast.Expression.Member - { - Flow_ast.Expression.Member._object = - ( _, - Flow_ast.Expression.Identifier - (_, { Flow_ast.Identifier.name = "Object"; comments = _ }) - ); - property = Flow_ast.Expression.Member.PropertyIdentifier _; - comments = _; - } - ) -> - true - | _ -> false - -let loc_of_statement = fst -let loc_of_expression = fst -let loc_of_pattern = fst -let loc_of_ident = fst -let name_of_ident (_, { Identifier.name; comments = _ }) = name -let source_of_ident (loc, { Identifier.name; comments = _ }) = (loc, name) -let ident_of_source ?comments (loc, name) = (loc, { Identifier.name; comments }) -let mk_comments ?(leading = []) ?(trailing = []) a = { Syntax.leading; trailing; internal = a } - -let mk_comments_opt ?(leading = []) ?(trailing = []) () = - match (leading, trailing) with - | ([], []) -> None - | (_, _) -> Some (mk_comments ~leading ~trailing ()) - -let mk_comments_with_internal_opt ?(leading = []) ?(trailing = []) ~internal () = - match (leading, trailing, internal) with - | ([], [], []) -> None - | _ -> Some (mk_comments ~leading ~trailing internal) - -let merge_comments ~inner ~outer = - let open Syntax in - match (inner, outer) with - | (None, c) - | (c, None) -> - c - | (Some inner, Some outer) -> - mk_comments_opt - ~leading:(outer.leading @ inner.leading) - ~trailing:(inner.trailing @ outer.trailing) - () - -let merge_comments_with_internal ~inner ~outer = - match (inner, outer) with - | (inner, None) -> inner - | (None, Some { Syntax.leading; trailing; _ }) -> - mk_comments_with_internal_opt ~leading ~trailing ~internal:[] () - | ( Some { Syntax.leading = inner_leading; trailing = inner_trailing; internal }, - Some { Syntax.leading = outer_leading; trailing = outer_trailing; _ } - ) -> - mk_comments_with_internal_opt - ~leading:(outer_leading @ inner_leading) - ~trailing:(inner_trailing @ outer_trailing) - ~internal - () - -let split_comments comments = - match comments with - | None -> (None, None) - | Some { Syntax.leading; trailing; _ } -> - (mk_comments_opt ~leading (), mk_comments_opt ~trailing ()) - -let string_of_assignment_operator op = - let open Flow_ast.Expression.Assignment in - match op with - | PlusAssign -> "+=" - | MinusAssign -> "-=" - | MultAssign -> "*=" - | ExpAssign -> "**=" - | DivAssign -> "/=" - | ModAssign -> "%=" - | LShiftAssign -> "<<=" - | RShiftAssign -> ">>=" - | RShift3Assign -> ">>>=" - | BitOrAssign -> "|=" - | BitXorAssign -> "^=" - | BitAndAssign -> "&=" - | NullishAssign -> "??=" - | AndAssign -> "&&=" - | OrAssign -> "||=" - -let string_of_binary_operator op = - let open Flow_ast.Expression.Binary in - match op with - | Equal -> "==" - | NotEqual -> "!=" - | StrictEqual -> "===" - | StrictNotEqual -> "!==" - | LessThan -> "<" - | LessThanEqual -> "<=" - | GreaterThan -> ">" - | GreaterThanEqual -> ">=" - | LShift -> "<<" - | RShift -> ">>" - | RShift3 -> ">>>" - | Plus -> "+" - | Minus -> "-" - | Mult -> "*" - | Exp -> "**" - | Div -> "/" - | Mod -> "%" - | BitOr -> "|" - | Xor -> "^" - | BitAnd -> "&" - | In -> "in" - | Instanceof -> "instanceof" - -module ExpressionSort = struct - type t = - | Array - | ArrowFunction - | Assignment - | Binary - | Call - | Class - | Comprehension - | Conditional - | Function - | Generator - | Identifier - | Import - | JSXElement - | JSXFragment - | Literal - | Logical - | Member - | MetaProperty - | New - | Object - | OptionalCall - | OptionalMember - | Sequence - | Super - | TaggedTemplate - | TemplateLiteral - | This - | TypeCast - | Unary - | Update - | Yield - - let to_string = function - | Array -> "array" - | ArrowFunction -> "arrow function" - | Assignment -> "assignment expression" - | Binary -> "binary expression" - | Call -> "call expression" - | Class -> "class" - | Comprehension -> "comprehension expression" - | Conditional -> "conditional expression" - | Function -> "function" - | Generator -> "generator" - | Identifier -> "identifier" - | Import -> "import expression" - | JSXElement -> "JSX element" - | JSXFragment -> "JSX fragment" - | Literal -> "literal" - | Logical -> "logical expression" - | Member -> "member expression" - | MetaProperty -> "metaproperty expression" - | New -> "new expression" - | Object -> "object" - | OptionalCall -> "optional call expression" - | OptionalMember -> "optional member expression" - | Sequence -> "sequence" - | Super -> "`super` reference" - | TaggedTemplate -> "tagged template expression" - | TemplateLiteral -> "template literal" - | This -> "`this` reference" - | TypeCast -> "type cast" - | Unary -> "unary expression" - | Update -> "update expression" - | Yield -> "yield expression" -end diff --git a/compiler/js_parser/flow_ast_utils.mli b/compiler/js_parser/flow_ast_utils.mli deleted file mode 100644 index 2155346b17..0000000000 --- a/compiler/js_parser/flow_ast_utils.mli +++ /dev/null @@ -1,128 +0,0 @@ -(* - * 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. - *) - -type 'loc binding = 'loc * string - -type 'loc ident = 'loc * string - -type 'loc source = 'loc * string - -val fold_bindings_of_pattern : - ('a -> ('m, 't) Flow_ast.Identifier.t -> 'a) -> 'a -> ('m, 't) Flow_ast.Pattern.t -> 'a - -val fold_bindings_of_variable_declarations : - (bool -> 'a -> ('m, 't) Flow_ast.Identifier.t -> 'a) -> - 'a -> - ('m, 't) Flow_ast.Statement.VariableDeclaration.Declarator.t list -> - 'a - -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 - -val hoist_function_declarations : - ('a, 'b) Flow_ast.Statement.t list -> ('a, 'b) Flow_ast.Statement.t list - -val is_call_to_invariant : ('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 is_call_to_object_static_method : ('a, 'b) Flow_ast.Expression.t -> bool - -val negate_number_literal : float * string -> float * string - -val loc_of_expression : ('a, 'a) Flow_ast.Expression.t -> 'a - -val loc_of_statement : ('a, 'a) Flow_ast.Statement.t -> 'a - -val loc_of_pattern : ('a, 'a) Flow_ast.Pattern.t -> 'a - -val loc_of_ident : ('a, 'a) Flow_ast.Identifier.t -> 'a - -val name_of_ident : ('loc, 'a) Flow_ast.Identifier.t -> string - -val source_of_ident : ('a, 'a) Flow_ast.Identifier.t -> 'a source - -val ident_of_source : - ?comments:('a, unit) Flow_ast.Syntax.t -> 'a source -> ('a, 'a) Flow_ast.Identifier.t - -val mk_comments : - ?leading:'loc Flow_ast.Comment.t list -> - ?trailing:'loc Flow_ast.Comment.t list -> - 'a -> - ('loc, 'a) Flow_ast.Syntax.t - -val mk_comments_opt : - ?leading:'loc Flow_ast.Comment.t list -> - ?trailing:'loc Flow_ast.Comment.t list -> - unit -> - ('loc, unit) Flow_ast.Syntax.t option - -val mk_comments_with_internal_opt : - ?leading:'loc Flow_ast.Comment.t list -> - ?trailing:'loc Flow_ast.Comment.t list -> - internal:'loc Flow_ast.Comment.t list -> - unit -> - ('loc, 'loc Flow_ast.Comment.t list) Flow_ast.Syntax.t option - -val merge_comments : - inner:('M, unit) Flow_ast.Syntax.t option -> - outer:('M, unit) Flow_ast.Syntax.t option -> - ('M, unit) Flow_ast.Syntax.t option - -val merge_comments_with_internal : - inner:('M, 'loc Flow_ast.Comment.t list) Flow_ast.Syntax.t option -> - outer:('M, 'a) Flow_ast.Syntax.t option -> - ('M, 'loc Flow_ast.Comment.t list) Flow_ast.Syntax.t option - -val split_comments : - ('loc, unit) Flow_ast.Syntax.t option -> - ('loc, unit) Flow_ast.Syntax.t option * ('loc, unit) Flow_ast.Syntax.t option - -module ExpressionSort : sig - type t = - | Array - | ArrowFunction - | Assignment - | Binary - | Call - | Class - | Comprehension - | Conditional - | Function - | Generator - | Identifier - | Import - | JSXElement - | JSXFragment - | Literal - | Logical - | Member - | MetaProperty - | New - | Object - | OptionalCall - | OptionalMember - | Sequence - | Super - | TaggedTemplate - | TemplateLiteral - | This - | TypeCast - | Unary - | Update - | Yield - - - val to_string : t -> string -end - -val string_of_assignment_operator : Flow_ast.Expression.Assignment.operator -> string - -val string_of_binary_operator : Flow_ast.Expression.Binary.operator -> string diff --git a/compiler/js_parser/flow_lexer.ml b/compiler/js_parser/flow_lexer.ml deleted file mode 100644 index bf4c9f44b2..0000000000 --- a/compiler/js_parser/flow_lexer.ml +++ /dev/null @@ -1,13521 +0,0 @@ - -let __sedlex_table_58 = - "\001\001\001\001\001\001\001\001\001\001\000\001\001" -let __sedlex_table_2 = - "\001\000\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001" -let __sedlex_table_17 = - "\001\000\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001" -let __sedlex_table_28 = - "\001\000\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001" -let __sedlex_table_41 = - "\001\000\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\003\004\004\004\004\004\004\004\004\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001" -let __sedlex_table_52 = - "\001\000\000\002\003\003\003\003\003\003\003\003\003" -let __sedlex_table_70 = - "\001\000\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\003\003\003\003\003\003\003\003\003\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001" -let __sedlex_table_47 = - "\001\001\001\001\001\001\001\001\001\001\002\001\001\003\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\004" -let __sedlex_table_57 = - "\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002" -let __sedlex_table_29 = - "\001\002\000\003\004\004\004\004\004\004\004\004\004" -let __sedlex_table_30 = - "\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002" -let __sedlex_table_42 = - "\001\000\002\002\002\002\002\002\002\002\002\002\000\000\000\000\000\000\000\000\000\000\000\003\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003" -let __sedlex_table_5 = "\001\002" -let __sedlex_table_3 = - "\001\001\001\001\001\001\001\001\001\001\000\001\001\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\001\001\001" -let __sedlex_table_21 = - "\001\001\001\001\001\001\001\001\001\001\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\001\001\001\001\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001" -let __sedlex_table_60 = - "\001\001\001\001\001\001\001\001\001\001\000\001\001\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001" -let __sedlex_table_83 = - "\001\002\002\002\002\002\002\002\002\002\002\003\002\002\004\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\005\002\002\002\006\005\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\005\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\005\002\007" -let __sedlex_table_18 = - "\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002" -let __sedlex_table_23 = - "\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002" -let __sedlex_table_43 = - "\001\002\002\002\002\002\002\002\002\002\002\003\002\002\004\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\005\006\006\006\006\006\006\006\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\002\002\002\002\002\b\002\002\002\t\002\002\002\002\002\002\002\n\002\002\002\011\002\012\r\014\002\015" -let __sedlex_table_76 = - "\001\001\001\001\001\001\001\001\001\002\003\002\002\004\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\002\001\001\001\001\001\001\001\001\001\001\001\001\001\001\005\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\006\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\002\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\002\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001" -let __sedlex_table_82 = - "\001\000\001\000\000\002\003\003\003\003\003\003\003\003\003" -let __sedlex_table_10 = "\001\001\001\001\001\001\001\001\001\001\000\002" -let __sedlex_table_12 = - "\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001" -let __sedlex_table_33 = - "\001\001\001\001\001\001\001\001\001\001\000\001\001\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\001\001\001\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001" -let __sedlex_table_45 = - "\001\001\001\001\001\001\001\001\001\001\002\001\001\003" -let __sedlex_table_78 = - "\001\002\002\002\002\002\002\002\002\002\002\003\002\002\004\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\005\006" -let __sedlex_table_88 = - "\001\000\002\002\002\002\002\002\002\002\002\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003" -let __sedlex_table_11 = - "\001\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\000\002\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001" -let __sedlex_table_14 = - "\001\000\000\000\000\000\000\000\000\000\000\000\002\002\002\002\002\002\002\002\002\002\000\000\000\000\000\000\000\002\002\002\002\002\002\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\002\002\002\002\002\002\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001" -let __sedlex_table_16 = - "\001\000\000\000\000\000\000\000\000\000\000\000\002\002\002\002\002\002\002\002\002\002\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\003\001\001\001\001\001\001\001\001\001\001\001\001" -let __sedlex_table_22 = - "\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\001\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001" -let __sedlex_table_27 = - "\001\000\000\000\000\000\000\000\000\000\002\000\003\003\003\003\003\003\003\003\003\003\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\004\001\001\001\001\001\001\001\001\001\001\001\001" -let __sedlex_table_32 = - "\001\000\000\000\000\000\000\000\000\000\002\000\003\003\003\003\003\003\003\003\003\003\000\000\000\000\000\000\000\001\001\001\001\004\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\005\000\001\001\001\001\004\001\001\001\001\001\001\001\001\006\001\001\001\001\001\001\001\001\001\001\001\001" -let __sedlex_table_38 = - "\001\000\000\000\000\000\000\000\000\000\000\000\002\002\002\002\002\002\002\002\002\002\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001" -let __sedlex_table_46 = - "\001\000\000\000\000\000\000\000\000\000\000\000\002\002\002\002\002\002\002\002\002\002\000\000\000\000\000\000\000\001\001\001\001\003\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\001\001\001\001\003\001\001\001\001\001\001\001\001\004\001\001\001\001\001\001\001\001\001\001\001\001" -let __sedlex_table_49 = - "\001\000\000\000\000\000\000\000\000\000\000\000\002\002\002\002\002\002\002\002\002\002\000\000\000\000\000\000\000\001\001\001\001\003\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\004\000\001\001\001\001\003\001\001\001\001\001\001\001\001\005\001\001\001\001\001\001\001\001\001\001\001\001" -let __sedlex_table_55 = - "\001\000\000\000\000\000\000\000\000\000\000\000\002\002\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001" -let __sedlex_table_59 = - "\001\000\000\000\000\000\000\000\000\000\002\000\003\003\003\003\003\003\003\003\004\004\000\000\000\000\000\000\000\001\005\001\001\006\001\001\001\001\001\001\001\001\001\007\001\001\001\001\001\001\001\001\b\001\001\000\000\000\000\000\000\001\005\001\001\006\001\001\001\001\001\001\001\001\t\007\001\001\001\001\001\001\001\001\b\001\001" -let __sedlex_table_62 = - "\001\000\000\000\000\000\000\000\000\000\000\000\002\002\002\002\002\002\002\002\001\001\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001" -let __sedlex_table_63 = - "\001\000\000\000\000\000\000\000\000\000\000\000\002\002\002\002\002\002\002\002\002\002\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\003\000\001\001\001\001\001\001\001\001\001\001\001\001\001\004\001\001\001\001\001\001\001\001\001\001\001\001" -let __sedlex_table_65 = - "\001\000\000\000\000\000\000\000\000\000\000\000\002\002\002\002\002\002\002\002\001\001\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\003\000\001\001\001\001\001\001\001\001\001\001\001\001\001\004\001\001\001\001\001\001\001\001\001\001\001\001" -let __sedlex_table_68 = - "\001\000\000\000\000\000\000\000\000\000\002\000\003\003\003\003\003\003\003\003\003\003\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\004\000\001\001\001\001\001\001\001\001\001\001\001\001\001\005\001\001\001\001\001\001\001\001\001\001\001\001" -let __sedlex_table_73 = - "\001\000\000\000\000\000\000\000\000\000\000\000\002\002\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\003\000\001\001\001\001\001\001\001\001\001\001\001\001\001\004\001\001\001\001\001\001\001\001\001\001\001\001" -let __sedlex_table_75 = - "\001\000\000\000\000\000\000\000\000\000\002\000\003\003\003\003\003\003\003\003\004\004\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\005\001\001\001\001\001\001\001\001\001\001\001\001" -let __sedlex_table_77 = - "\001\000\000\000\000\000\000\000\000\000\000\000\002\002\002\002\002\002\002\002\002\002\000\000\000\000\000\000\000\002\002\002\002\002\002\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\003\000\002\002\002\002\002\002\001\001\001\001\001\001\001\004\001\001\001\001\001\001\001\001\001\001\001\001" -let __sedlex_table_89 = - "\001\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001" -let __sedlex_table_1 = - "\001\002\002\002\002\002\002\002\002\002\003\004\003\003\005\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\003\006\007\b\t\n\011\007\012\r\014\015\016\017\018\019\020\021\021\021\021\021\021\021\021\021\022\023\024\025\026\027\028\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\029\030\031 \t!\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"#$%\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\003\002\002\002\002\002\002\002\002\002\t\002\002\002\002\002\002\002\002\002\002\t\002\002\002\002\t\002\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\t\t\t\002\002\002\002\002\002\002\t\002\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\t\t\t\002\t\t\002\002\t\t\t\t\002\t\002\002\002\002\002\002\t\002\t\t\t\002\t\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\002\002\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\t\002\002\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\002\002\t\t\t\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\002\002\002\002\002\002\002\t\t\002\002\002\002\002\002\002\002\002\002\t\t\t\002\002\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\002\002\002\002\002\002\002\002\002\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\002\002\002\002\002\002\002\t\t\002\002\002\002\t\002\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\002\002\t\002\002\002\002\002\002\002\002\002\t\002\002\002\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\002\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\002\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\t\t\t\t\t\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\002\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\002\002\002\002\002\002\002\t\t\t\t\t\t\t\t\t\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\002\002\t\t\t\t\t\t\t\t\002\002\t\t\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\t\t\t\t\t\t\t\002\t\002\002\002\t\t\t\t\002\002\002\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\002\t\t\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\002\002\002\002\002\002\002\002\002\002\t\002\002\002\002\002\002\002\002\t\t\t\t\t\t\002\002\002\002\t\t\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\t\t\t\t\t\t\t\002\t\t\002\t\t\002\t\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\t\t\002\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\t\t\t\t\t\t\t\002\t\t\t\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\t\t\t\t\t\t\t\002\t\t\002\t\t\t\t\t\002\002\002\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\002\002\002\002\002\002\002\002\002\002\002\t\t\t\t\t\t\t\t\002\002\t\t\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\t\t\t\t\t\t\t\002\t\t\002\t\t\t\t\t\002\002\002\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\002\t\t\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\002\t\t\t\t\t\t\002\002\002\t\t\t\002\t\t\t\t\002\002\002\t\t\002\t\002\t\t\002\002\002\t\t\002\002\002\t\t\t\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\t\t\t\t\t\t\002\t\t\t\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\002\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\t\002\002\t\002\002\t\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\002\002\002\002\t\t\t\t\t\t\t\t\002\t\t\t\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\t\t\t\t\t\t\t\t\t\t\002\t\t\t\t\t\002\002\002\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\002\t\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\t\t\t\t\t\t\t\002\t\t\t\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\002\002\002\002\002\t\t\t\002\002\002\002\002\002\002\002\t\t\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\t\t\t\t\002\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\t\t\t\t\t\t\t\t\t\002\t\002\002\t\t\t\t\t\t\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\t\t\002\002\002\002\002\002\002\002\002\002\002\002\t\t\t\t\t\t\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\002\t\002\t\t\t\t\t\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\t\002\t\t\t\t\t\t\t\t\t\t\002\t\t\002\002\002\002\002\002\002\002\002\t\002\002\t\t\t\t\t\002\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\t\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\t\t\t\t\t\t\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\t\t\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\t\t\t\t\002\002\002\002\t\t\t\t\002\002\002\t\002\002\002\t\t\002\002\002\002\002\002\002\t\t\t\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\002\002\002\002\002\002\002\002\002\002\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\t\002\002\002\002\002\t\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\t\t\t\t\002\002\t\t\t\t\t\t\t\002\t\002\t\t\t\t\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\t\t\t\t\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\t\t\t\t\002\002\t\t\t\t\t\t\t\002\t\002\t\t\t\t\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\t\t\t\t\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\t\t\t\t\t\t\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\003\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\002\t\t\t\t\t\t\t\t\t\t\t\002\002\002\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\002\t\t\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\002\002\002\002\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\002\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\t\002\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\002\002\002\002\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\t\t\t\t\t\002\002\002\002\002\002\002\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\002\002\002\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\t\t\t\t\t\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\002\002\002\002\002\002\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\t\002\002\002\002\002\002\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\t\t\t\t\t\t\t\t\t\002\002\002\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\t\t\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\t\t\002\t\t\t\t\t\t\002\t\t\002\002\002\t\002\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\t\t\t\t\t\t\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\t\t\t\t\t\t\002\002\t\t\t\t\t\t\t\t\002\t\002\t\002\t\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\002\t\t\t\t\t\t\t\002\t\002\002\002\t\t\t\002\t\t\t\t\t\t\t\002\002\002\t\t\t\t\002\002\t\t\t\t\t\t\002\002\002\002\t\t\t\t\t\t\t\t\t\t\t\t\t\002\002\002\002\002\t\t\t\002\t\t\t\t\t\t\t\002\002\002" -let __sedlex_table_61 = - "\001\002\002\002\002\002\002\002\002\002\003\004\003\003\005\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\003\002\002\002\002\002\002\002\002\002\002\002\002\002\002\006\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\003\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\003\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002" -let __sedlex_table_66 = - "\001\002\002\002\002\002\002\002\002\002\002\003\002\002\004" -let __sedlex_table_72 = "\001\000\000\000\000\002" -let __sedlex_table_74 = - "\001\002\002\002\002\002\002\002\002\002\003\004\003\003\005\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\003\002\006\002\007\b\t\006\n\011\012\r\014\015\016\017\018\019\019\019\019\019\019\019\019\019\020\021\022\023\024\025\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\026\027\028\002\007\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\029\030\031\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\003\002\002\002\002\002\002\002\002\002\007\002\002\002\002\002\002\002\002\002\002\007\002\002\002\002\007\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\002\002\002\002\002\002\002\007\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\002\007\007\002\002\007\007\007\007\002\007\002\002\002\002\002\002\007\002\007\007\007\002\007\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\007\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\002\002\002\002\002\002\002\007\007\002\002\002\002\002\002\002\002\002\002\007\007\007\002\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\007\007\002\002\002\002\007\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\007\002\002\002\002\002\002\002\002\002\007\002\002\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\007\007\007\007\007\007\007\007\002\002\007\007\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\007\007\007\007\007\002\007\002\002\002\007\007\007\007\002\002\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\002\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\002\002\002\002\002\002\002\002\002\002\007\002\002\002\002\002\002\002\002\007\007\007\007\007\007\002\002\002\002\007\007\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\007\007\007\007\007\002\007\007\002\007\007\002\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\002\007\007\007\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\007\007\007\007\007\002\007\007\002\007\007\007\007\007\002\002\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\002\002\007\007\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\007\007\007\007\007\002\007\007\002\007\007\007\007\007\002\002\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\002\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\002\007\007\007\007\007\007\002\002\002\007\007\007\002\007\007\007\007\002\002\002\007\007\002\007\002\007\007\002\002\002\007\007\002\002\002\007\007\007\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\002\007\007\007\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\002\002\007\002\002\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\002\002\002\002\007\007\007\007\007\007\007\007\002\007\007\007\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\007\007\007\007\007\007\007\007\002\007\007\007\007\007\002\002\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\002\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\002\007\007\007\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\002\002\002\002\002\007\007\007\002\002\002\002\002\002\002\002\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\007\007\007\007\007\007\007\002\007\002\002\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\002\007\002\007\007\007\007\007\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\002\007\007\007\007\007\007\007\007\007\007\002\007\007\002\002\002\002\002\002\002\002\002\007\002\002\007\007\007\007\007\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\002\002\002\002\007\007\007\007\002\002\002\007\002\002\002\007\007\002\002\002\002\002\002\002\007\007\007\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\002\002\002\002\002\007\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\007\007\002\002\007\007\007\007\007\007\007\002\007\002\007\007\007\007\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\007\007\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\007\007\002\002\007\007\007\007\007\007\007\002\007\002\007\007\007\007\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\007\007\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\007\007\007\007\007\007\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\003\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\002\002\002\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\002\007\007\007\007\007\007\002\007\007\002\002\002\007\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\007\007\007\007\007\007\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\007\007\007\007\007\007\002\002\007\007\007\007\007\007\007\007\002\007\002\007\002\007\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\007\007\007\007\007\002\007\002\002\002\007\007\007\002\007\007\007\007\007\007\007\002\002\002\007\007\007\007\002\002\007\007\007\007\007\007\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\007\007\007\002\007\007\007\007\007\007\007\002\002\002" -let __sedlex_table_91 = - "\001\002\002\002\002\002\002\002\002\002\003\004\003\003\005\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\003\002\006\002\007\002\002\006\002\002\002\002\002\002\b\t\002\002\002\002\002\002\002\002\002\002\n\002\011\012\r\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\014\002\002\007\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\015\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\003\002\002\002\002\002\002\002\002\002\007\002\002\002\002\002\002\002\002\002\002\007\002\002\002\002\007\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\002\002\002\002\002\002\002\007\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\002\007\007\002\002\007\007\007\007\002\007\002\002\002\002\002\002\007\002\007\007\007\002\007\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\007\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\002\002\002\002\002\002\002\007\007\002\002\002\002\002\002\002\002\002\002\007\007\007\002\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\007\007\002\002\002\002\007\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\007\002\002\002\002\002\002\002\002\002\007\002\002\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\007\007\007\007\007\007\007\007\002\002\007\007\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\007\007\007\007\007\002\007\002\002\002\007\007\007\007\002\002\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\002\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\002\002\002\002\002\002\002\002\002\002\007\002\002\002\002\002\002\002\002\007\007\007\007\007\007\002\002\002\002\007\007\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\007\007\007\007\007\002\007\007\002\007\007\002\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\002\007\007\007\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\007\007\007\007\007\002\007\007\002\007\007\007\007\007\002\002\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\002\002\007\007\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\007\007\007\007\007\002\007\007\002\007\007\007\007\007\002\002\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\002\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\002\007\007\007\007\007\007\002\002\002\007\007\007\002\007\007\007\007\002\002\002\007\007\002\007\002\007\007\002\002\002\007\007\002\002\002\007\007\007\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\002\007\007\007\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\002\002\007\002\002\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\002\002\002\002\007\007\007\007\007\007\007\007\002\007\007\007\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\007\007\007\007\007\007\007\007\002\007\007\007\007\007\002\002\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\002\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\002\007\007\007\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\002\002\002\002\002\007\007\007\002\002\002\002\002\002\002\002\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\007\007\007\007\007\007\007\002\007\002\002\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\002\007\002\007\007\007\007\007\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\002\007\007\007\007\007\007\007\007\007\007\002\007\007\002\002\002\002\002\002\002\002\002\007\002\002\007\007\007\007\007\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\002\002\002\002\007\007\007\007\002\002\002\007\002\002\002\007\007\002\002\002\002\002\002\002\007\007\007\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\002\002\002\002\002\007\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\007\007\002\002\007\007\007\007\007\007\007\002\007\002\007\007\007\007\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\007\007\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\007\007\002\002\007\007\007\007\007\007\007\002\007\002\007\007\007\007\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\007\007\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\007\007\007\007\007\007\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\003\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\002\002\002\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\002\007\007\007\007\007\007\002\007\007\002\002\002\007\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\007\007\007\007\007\007\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\007\007\007\007\007\007\002\002\007\007\007\007\007\007\007\007\002\007\002\007\002\007\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\002\007\007\007\007\007\007\007\002\007\002\002\002\007\007\007\002\007\007\007\007\007\007\007\002\002\002\007\007\007\007\002\002\007\007\007\007\007\007\002\002\002\002\007\007\007\007\007\007\007\007\007\007\007\007\007\002\002\002\002\002\007\007\007\002\007\007\007\007\007\007\007\002\002\002" -let __sedlex_table_51 = "\001\000\000\002" -let __sedlex_table_8 = - "\001\002\002\002\002\002\002\002\002\002\002\003\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\004\002\002\002\002\004\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\005" -let __sedlex_table_20 = - "\001\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\003" -let __sedlex_table_69 = - "\001\002\002\002\002\002\002\002\002\002\002\003\002\002\004\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\005\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\006\007" -let __sedlex_table_15 = - "\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002" -let __sedlex_table_48 = - "\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002" -let __sedlex_table_81 = - "\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\000\000\000\000\000\002" -let __sedlex_table_9 = - "\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003" -let __sedlex_table_26 = - "\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\001\001\001\001\001\001\000\000\000\000\000\000\000\003" -let __sedlex_table_35 = - "\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002" -let __sedlex_table_67 = - "\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002" -let __sedlex_table_36 = "\001\000\000\000\000\000\000\000\002" -let __sedlex_table_39 = - "\001\002\002\002\002\002\002\002\002\002\002\003\002\002\004\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\005\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\006\002\002\002\007" -let __sedlex_table_50 = - "\001\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\003" -let __sedlex_table_90 = - "\001\002\000\000\000\000\000\000\000\000\000\000\000\002\002\002\002\002\002\002\002\002\002\000\000\000\000\000\000\000\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\000\000\000\000\000\000\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002" -let __sedlex_table_37 = - "\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003" -let __sedlex_table_7 = - "\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001" -let __sedlex_table_13 = "\001\000\002\003\003\003\003\003\003\003\003\003" -let __sedlex_table_53 = - "\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\001\001\001\001\001\001" -let __sedlex_table_87 = - "\001\001\001\001\001\001\001\001\001\001\000\002\000\000\000\000\000\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001" -let __sedlex_table_34 = - "\001\001\001\001\001\001\001\001\001\001\000\001\001\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001" -let __sedlex_table_54 = "\001\000\002\002\002\002\002\002\002\002\002\002" -let __sedlex_table_71 = - "\001\000\000\000\000\000\000\002\000\002\000\000\003\004\004\004\004\004\004\004\004\004\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001" -let __sedlex_table_80 = "\001\001\001\001\001\001\001\001\002\002" -let __sedlex_table_4 = - "\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002" -let __sedlex_table_79 = - "\001\002\002\002\002\002\002\002\002\002\002\003\002\002\004\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\005\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\006" -let __sedlex_table_84 = - "\001\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\003\002\002\002\002\002\002\002\002\002\002\002\003\003\003\003\003\003\003\003\003\003\002\002\002\002\002\002\002\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\002\004\002\002\003\002\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003" -let __sedlex_table_85 = - "\001\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\003\002\002\002\002\002\002\002\002\003\002\002\003\003\003\003\003\003\003\003\003\003\002\002\002\002\002\002\002\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\002\004\002\002\003\002\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003\003" -let __sedlex_table_64 = - "\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\002\000\000\001\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\001\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\000\000\000\000\000\000\000\001\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\000\001\001\000\000\001\001\001\001\000\001\000\000\000\000\000\000\001\000\001\001\001\000\001\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\001\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\000\000\000\000\000\000\000\001\001\000\000\000\000\000\000\000\000\000\000\001\001\001\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\001\001\000\000\000\000\001\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\001\000\000\000\000\000\000\000\000\000\001\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\001\001\001\001\001\001\001\001\000\000\001\001\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\001\001\001\001\001\001\001\000\001\000\000\000\001\001\001\001\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\000\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\001\001\001\001\001\001\000\000\000\000\001\001\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\001\001\001\001\001\001\001\000\001\001\000\001\001\000\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\000\001\001\001\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\001\001\001\001\001\001\001\000\001\001\000\001\001\001\001\001\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\000\000\001\001\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\001\001\001\001\001\001\001\000\001\001\000\001\001\001\001\001\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\000\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\001\001\001\001\001\001\000\000\000\001\001\001\000\001\001\001\001\000\000\000\001\001\000\001\000\001\001\000\000\000\001\001\000\000\000\001\001\001\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\000\001\001\001\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\000\000\001\000\000\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\001\001\001\001\001\001\001\001\000\001\001\001\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\001\001\001\001\001\001\001\001\001\001\000\001\001\001\001\001\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\000\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\000\001\001\001\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\001\001\001\000\000\000\000\000\000\000\000\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\001\001\001\001\001\001\001\001\001\000\001\000\000\001\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\001\001\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\000\001\000\001\001\001\001\001\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\001\000\001\001\001\001\001\001\001\001\001\001\000\001\001\000\000\000\000\000\000\000\000\000\001\000\000\001\001\001\001\001\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\000\000\000\000\001\001\001\001\000\000\000\001\000\000\000\001\001\000\000\000\000\000\000\000\001\001\001\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\001\000\000\000\000\000\001\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\001\001\001\001\000\000\001\001\001\001\001\001\001\000\001\000\001\001\001\001\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\001\001\001\001\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\001\001\001\001\000\000\001\001\001\001\001\001\001\000\001\000\001\001\001\001\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\001\001\001\001\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\001\001\001\001\001\001\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\000\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\001\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\000\001\001\001\001\001\001\000\001\001\000\000\000\001\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\001\001\001\001\001\001\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\001\001\001\001\001\001\000\000\001\001\001\001\001\001\001\001\000\001\000\001\000\001\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\001\001\001\001\001\001\001\000\001\000\000\000\001\001\001\000\001\001\001\001\001\001\001\000\000\000\001\001\001\001\000\000\001\001\001\001\001\001\000\000\000\000\001\001\001\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\001\001\001\000\001\001\001\001\001\001\001" -let __sedlex_table_86 = "\001\000\002" -let __sedlex_table_6 = - "\001\001\001\001\001\001\001\001\001\001\000\001\001\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\000\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001" -let __sedlex_table_24 = - "\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002" -let __sedlex_table_31 = "\001\002\002\002\002\002\002\002\002\002" -let __sedlex_table_25 = - "\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003" -let __sedlex_table_56 = - "\001\001\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\001\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002" -let __sedlex_table_44 = - "\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002" -let __sedlex_table_19 = - "\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002" -let __sedlex_table_40 = - "\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002" -let __sedlex_partition_94 c = - if c <= 120 then (-1) else if c <= 121 then 0 else (-1) -let __sedlex_partition_50 c = - if c <= 8191 - then (Char.code (String.unsafe_get __sedlex_table_1 (c - (-1)))) - 1 - else - if c <= 194559 - then - (if c <= 69599 - then - (if c <= 43711 - then - (if c <= 12703 - then - (if c <= 11519 - then - (if c <= 8489 - then - (if c <= 8454 - then - (if c <= 8304 - then - (if c <= 8238 - then - (if c <= 8231 - then (if c <= 8202 then 2 else 1) - else if c <= 8233 then 3 else 1) - else - if c <= 8286 - then (if c <= 8239 then 2 else 1) - else if c <= 8287 then 2 else 1) - else - if c <= 8335 - then - (if c <= 8318 - then (if c <= 8305 then 8 else 1) - else if c <= 8319 then 8 else 1) - else - if c <= 8449 - then (if c <= 8348 then 8 else 1) - else if c <= 8450 then 8 else 1) - else - if c <= 8477 - then - (if c <= 8468 - then - (if c <= 8457 - then (if c <= 8455 then 8 else 1) - else if c <= 8467 then 8 else 1) - else - if c <= 8471 - then (if c <= 8469 then 8 else 1) - else 8) - else - if c <= 8485 - then - (if c <= 8483 - then 1 - else if c <= 8484 then 8 else 1) - else - if c <= 8487 - then (if c <= 8486 then 8 else 1) - else if c <= 8488 then 8 else 1) - else - if c <= 8543 - then - (if c <= 8505 - then 8 - else - if c <= 8516 - then - (if c <= 8507 - then 1 - else if c <= 8511 then 8 else 1) - else - if c <= 8525 - then (if c <= 8521 then 8 else 1) - else if c <= 8526 then 8 else 1) - else - if c <= 11389 - then - (if c <= 8584 - then 8 - else if c <= 11263 then 1 else 8) - else - if c <= 11498 - then (if c <= 11492 then 8 else 1) - else - if c <= 11505 - then (if c <= 11502 then 8 else 1) - else if c <= 11507 then 8 else 1) - else - if c <= 12294 - then - (if c <= 11695 - then - (if c <= 11630 - then - (if c <= 11564 - then - (if c <= 11558 - then (if c <= 11557 then 8 else 1) - else if c <= 11559 then 8 else 1) - else - if c <= 11567 - then (if c <= 11565 then 8 else 1) - else if c <= 11623 then 8 else 1) - else - if c <= 11679 - then - (if c <= 11647 - then (if c <= 11631 then 8 else 1) - else if c <= 11670 then 8 else 1) - else - if c <= 11687 - then (if c <= 11686 then 8 else 1) - else if c <= 11694 then 8 else 1) - else - if c <= 11727 - then - (if c <= 11711 - then - (if c <= 11703 - then (if c <= 11702 then 8 else 1) - else if c <= 11710 then 8 else 1) - else - if c <= 11719 - then (if c <= 11718 then 8 else 1) - else if c <= 11726 then 8 else 1) - else - if c <= 12287 - then - (if c <= 11735 - then (if c <= 11734 then 8 else 1) - else if c <= 11742 then 8 else 1) - else - if c <= 12292 - then (if c <= 12288 then 2 else 1) - else 8) - else - if c <= 12442 - then - (if c <= 12343 - then - (if c <= 12320 - then (if c <= 12295 then 8 else 1) - else - if c <= 12336 - then (if c <= 12329 then 8 else 1) - else if c <= 12341 then 8 else 1) - else - if c <= 12348 - then 8 - else - if c <= 12352 - then 1 - else if c <= 12438 then 8 else 1) - else - if c <= 12539 - then - (if c <= 12447 - then 8 - else - if c <= 12448 - then 1 - else if c <= 12538 then 8 else 1) - else - if c <= 12548 - then (if c <= 12543 then 8 else 1) - else - if c <= 12592 - then (if c <= 12591 then 8 else 1) - else if c <= 12686 then 8 else 1) - else - if c <= 42999 - then - (if c <= 42653 - then - (if c <= 42239 - then - (if c <= 40981 - then - (if c <= 13311 - then - (if c <= 12783 - then (if c <= 12735 then 8 else 1) - else if c <= 12799 then 8 else 1) - else - if c <= 19967 - then (if c <= 19903 then 8 else 1) - else 8) - else - if c <= 42191 - then (if c <= 42124 then 8 else 1) - else if c <= 42237 then 8 else 1) - else - if c <= 42559 - then - (if c <= 42511 - then (if c <= 42508 then 8 else 1) - else - if c <= 42537 - then (if c <= 42527 then 8 else 1) - else if c <= 42539 then 8 else 1) - else - if c <= 42622 - then (if c <= 42606 then 8 else 1) - else 8) - else - if c <= 42890 - then - (if c <= 42785 - then - (if c <= 42735 - then (if c <= 42655 then 1 else 8) - else - if c <= 42774 - then 1 - else if c <= 42783 then 8 else 1) - else - if c <= 42887 - then 8 - else if c <= 42888 then 8 else 1) - else - if c <= 42962 - then - (if c <= 42954 - then 8 - else - if c <= 42959 - then 1 - else if c <= 42961 then 8 else 1) - else - if c <= 42993 - then - (if c <= 42964 - then (if c <= 42963 then 8 else 1) - else if c <= 42969 then 8 else 1) - else 8) - else - if c <= 43470 - then - (if c <= 43137 - then - (if c <= 43010 - then - (if c <= 43002 - then 8 - else if c <= 43009 then 8 else 1) - else - if c <= 43019 - then - (if c <= 43014 - then (if c <= 43013 then 8 else 1) - else if c <= 43018 then 8 else 1) - else - if c <= 43071 - then (if c <= 43042 then 8 else 1) - else if c <= 43123 then 8 else 1) - else - if c <= 43273 - then - (if c <= 43258 - then - (if c <= 43249 - then (if c <= 43187 then 8 else 1) - else if c <= 43255 then 8 else 1) - else - if c <= 43260 - then (if c <= 43259 then 8 else 1) - else if c <= 43262 then 8 else 1) - else - if c <= 43359 - then - (if c <= 43311 - then (if c <= 43301 then 8 else 1) - else if c <= 43334 then 8 else 1) - else - if c <= 43395 - then (if c <= 43388 then 8 else 1) - else if c <= 43442 then 8 else 1) - else - if c <= 43615 - then - (if c <= 43513 - then - (if c <= 43493 - then - (if c <= 43487 - then (if c <= 43471 then 8 else 1) - else if c <= 43492 then 8 else 1) - else if c <= 43503 then 8 else 1) - else - if c <= 43583 - then - (if c <= 43519 - then (if c <= 43518 then 8 else 1) - else if c <= 43560 then 8 else 1) - else - if c <= 43587 - then (if c <= 43586 then 8 else 1) - else if c <= 43595 then 8 else 1) - else - if c <= 43645 - then - (if c <= 43638 - then 8 - else - if c <= 43641 - then 1 - else if c <= 43642 then 8 else 1) - else - if c <= 43700 - then - (if c <= 43696 - then (if c <= 43695 then 8 else 1) - else if c <= 43697 then 8 else 1) - else - if c <= 43704 - then (if c <= 43702 then 8 else 1) - else if c <= 43709 then 8 else 1) - else - if c <= 66377 - then - (if c <= 64325 - then - (if c <= 43887 - then - (if c <= 43784 - then - (if c <= 43743 - then - (if c <= 43738 - then - (if c <= 43713 - then (if c <= 43712 then 8 else 1) - else if c <= 43714 then 8 else 1) - else if c <= 43741 then 8 else 1) - else - if c <= 43764 - then - (if c <= 43761 - then (if c <= 43754 then 8 else 1) - else 8) - else - if c <= 43776 - then 1 - else if c <= 43782 then 8 else 1) - else - if c <= 43823 - then - (if c <= 43807 - then - (if c <= 43792 - then (if c <= 43790 then 8 else 1) - else if c <= 43798 then 8 else 1) - else - if c <= 43815 - then (if c <= 43814 then 8 else 1) - else if c <= 43822 then 8 else 1) - else - if c <= 43880 - then - (if c <= 43867 - then (if c <= 43866 then 8 else 1) - else 8) - else if c <= 43881 then 8 else 1) - else - if c <= 64274 - then - (if c <= 55242 - then - (if c <= 44031 - then (if c <= 44002 then 8 else 1) - else - if c <= 55215 - then (if c <= 55203 then 8 else 1) - else if c <= 55238 then 8 else 1) - else - if c <= 64111 - then - (if c <= 63743 - then (if c <= 55291 then 8 else 1) - else if c <= 64109 then 8 else 1) - else - if c <= 64255 - then (if c <= 64217 then 8 else 1) - else if c <= 64262 then 8 else 1) - else - if c <= 64311 - then - (if c <= 64286 - then - (if c <= 64284 - then (if c <= 64279 then 8 else 1) - else if c <= 64285 then 8 else 1) - else - if c <= 64297 - then (if c <= 64296 then 8 else 1) - else if c <= 64310 then 8 else 1) - else - if c <= 64319 - then - (if c <= 64317 - then (if c <= 64316 then 8 else 1) - else if c <= 64318 then 8 else 1) - else - if c <= 64322 - then (if c <= 64321 then 8 else 1) - else if c <= 64324 then 8 else 1) - else - if c <= 65481 - then - (if c <= 65312 - then - (if c <= 65007 - then - (if c <= 64847 - then - (if c <= 64466 - then (if c <= 64433 then 8 else 1) - else if c <= 64829 then 8 else 1) - else - if c <= 64913 - then (if c <= 64911 then 8 else 1) - else if c <= 64967 then 8 else 1) - else - if c <= 65141 - then - (if c <= 65135 - then (if c <= 65019 then 8 else 1) - else if c <= 65140 then 8 else 1) - else - if c <= 65278 - then (if c <= 65276 then 8 else 1) - else if c <= 65279 then 2 else 1) - else - if c <= 65437 - then - (if c <= 65381 - then - (if c <= 65344 - then (if c <= 65338 then 8 else 1) - else if c <= 65370 then 8 else 1) - else 8) - else - if c <= 65470 - then 8 - else - if c <= 65473 - then 1 - else if c <= 65479 then 8 else 1) - else - if c <= 65615 - then - (if c <= 65548 - then - (if c <= 65497 - then - (if c <= 65489 - then (if c <= 65487 then 8 else 1) - else if c <= 65495 then 8 else 1) - else - if c <= 65535 - then (if c <= 65500 then 8 else 1) - else if c <= 65547 then 8 else 1) - else - if c <= 65595 - then - (if c <= 65575 - then (if c <= 65574 then 8 else 1) - else if c <= 65594 then 8 else 1) - else - if c <= 65598 - then (if c <= 65597 then 8 else 1) - else if c <= 65613 then 8 else 1) - else - if c <= 66207 - then - (if c <= 65855 - then - (if c <= 65663 - then (if c <= 65629 then 8 else 1) - else if c <= 65786 then 8 else 1) - else - if c <= 66175 - then (if c <= 65908 then 8 else 1) - else if c <= 66204 then 8 else 1) - else - if c <= 66348 - then - (if c <= 66303 - then (if c <= 66256 then 8 else 1) - else if c <= 66335 then 8 else 1) - else 8) - else - if c <= 67646 - then - (if c <= 66963 - then - (if c <= 66717 - then - (if c <= 66463 - then - (if c <= 66383 - then (if c <= 66378 then 8 else 1) - else - if c <= 66431 - then (if c <= 66421 then 8 else 1) - else if c <= 66461 then 8 else 1) - else - if c <= 66512 - then - (if c <= 66503 - then (if c <= 66499 then 8 else 1) - else if c <= 66511 then 8 else 1) - else - if c <= 66559 - then (if c <= 66517 then 8 else 1) - else 8) - else - if c <= 66863 - then - (if c <= 66775 - then - (if c <= 66735 - then 1 - else if c <= 66771 then 8 else 1) - else - if c <= 66815 - then (if c <= 66811 then 8 else 1) - else if c <= 66855 then 8 else 1) - else - if c <= 66939 - then - (if c <= 66927 - then (if c <= 66915 then 8 else 1) - else if c <= 66938 then 8 else 1) - else - if c <= 66955 - then (if c <= 66954 then 8 else 1) - else if c <= 66962 then 8 else 1) - else - if c <= 67455 - then - (if c <= 67002 - then - (if c <= 66978 - then - (if c <= 66966 - then (if c <= 66965 then 8 else 1) - else if c <= 66977 then 8 else 1) - else - if c <= 66994 - then (if c <= 66993 then 8 else 1) - else if c <= 67001 then 8 else 1) - else - if c <= 67391 - then - (if c <= 67071 - then (if c <= 67004 then 8 else 1) - else if c <= 67382 then 8 else 1) - else - if c <= 67423 - then (if c <= 67413 then 8 else 1) - else if c <= 67431 then 8 else 1) - else - if c <= 67591 - then - (if c <= 67505 - then - (if c <= 67462 - then (if c <= 67461 then 8 else 1) - else if c <= 67504 then 8 else 1) - else - if c <= 67583 - then (if c <= 67514 then 8 else 1) - else if c <= 67589 then 8 else 1) - else - if c <= 67638 - then - (if c <= 67593 - then (if c <= 67592 then 8 else 1) - else if c <= 67637 then 8 else 1) - else - if c <= 67643 - then (if c <= 67640 then 8 else 1) - else if c <= 67644 then 8 else 1) - else - if c <= 68296 - then - (if c <= 68029 - then - (if c <= 67827 - then - (if c <= 67711 - then - (if c <= 67679 - then (if c <= 67669 then 8 else 1) - else if c <= 67702 then 8 else 1) - else - if c <= 67807 - then (if c <= 67742 then 8 else 1) - else if c <= 67826 then 8 else 1) - else - if c <= 67871 - then - (if c <= 67839 - then (if c <= 67829 then 8 else 1) - else if c <= 67861 then 8 else 1) - else - if c <= 67967 - then (if c <= 67897 then 8 else 1) - else if c <= 68023 then 8 else 1) - else - if c <= 68120 - then - (if c <= 68111 - then - (if c <= 68095 - then (if c <= 68031 then 8 else 1) - else if c <= 68096 then 8 else 1) - else - if c <= 68116 - then (if c <= 68115 then 8 else 1) - else if c <= 68119 then 8 else 1) - else - if c <= 68223 - then - (if c <= 68191 - then (if c <= 68149 then 8 else 1) - else if c <= 68220 then 8 else 1) - else - if c <= 68287 - then (if c <= 68252 then 8 else 1) - else if c <= 68295 then 8 else 1) - else - if c <= 68863 - then - (if c <= 68479 - then - (if c <= 68415 - then - (if c <= 68351 - then (if c <= 68324 then 8 else 1) - else if c <= 68405 then 8 else 1) - else - if c <= 68447 - then (if c <= 68437 then 8 else 1) - else if c <= 68466 then 8 else 1) - else - if c <= 68735 - then - (if c <= 68607 - then (if c <= 68497 then 8 else 1) - else if c <= 68680 then 8 else 1) - else - if c <= 68799 - then (if c <= 68786 then 8 else 1) - else if c <= 68850 then 8 else 1) - else - if c <= 69414 - then - (if c <= 69295 - then - (if c <= 69247 - then (if c <= 68899 then 8 else 1) - else if c <= 69289 then 8 else 1) - else - if c <= 69375 - then (if c <= 69297 then 8 else 1) - else if c <= 69404 then 8 else 1) - else - if c <= 69487 - then - (if c <= 69423 - then (if c <= 69415 then 8 else 1) - else if c <= 69445 then 8 else 1) - else - if c <= 69551 - then (if c <= 69505 then 8 else 1) - else if c <= 69572 then 8 else 1) - else - if c <= 120122 - then - (if c <= 72348 - then - (if c <= 70655 - then - (if c <= 70162 - then - (if c <= 69958 - then - (if c <= 69762 - then - (if c <= 69744 - then - (if c <= 69634 - then (if c <= 69622 then 8 else 1) - else if c <= 69687 then 8 else 1) - else - if c <= 69748 - then (if c <= 69746 then 8 else 1) - else if c <= 69749 then 8 else 1) - else - if c <= 69890 - then - (if c <= 69839 - then (if c <= 69807 then 8 else 1) - else if c <= 69864 then 8 else 1) - else - if c <= 69955 - then (if c <= 69926 then 8 else 1) - else if c <= 69956 then 8 else 1) - else - if c <= 70080 - then - (if c <= 70005 - then - (if c <= 69967 - then (if c <= 69959 then 8 else 1) - else if c <= 70002 then 8 else 1) - else - if c <= 70018 - then (if c <= 70006 then 8 else 1) - else if c <= 70066 then 8 else 1) - else - if c <= 70107 - then - (if c <= 70105 - then (if c <= 70084 then 8 else 1) - else if c <= 70106 then 8 else 1) - else - if c <= 70143 - then (if c <= 70108 then 8 else 1) - else if c <= 70161 then 8 else 1) - else - if c <= 70414 - then - (if c <= 70286 - then - (if c <= 70279 - then - (if c <= 70271 - then (if c <= 70187 then 8 else 1) - else if c <= 70278 then 8 else 1) - else - if c <= 70281 - then (if c <= 70280 then 8 else 1) - else if c <= 70285 then 8 else 1) - else - if c <= 70319 - then - (if c <= 70302 - then (if c <= 70301 then 8 else 1) - else if c <= 70312 then 8 else 1) - else - if c <= 70404 - then (if c <= 70366 then 8 else 1) - else if c <= 70412 then 8 else 1) - else - if c <= 70452 - then - (if c <= 70441 - then - (if c <= 70418 - then (if c <= 70416 then 8 else 1) - else if c <= 70440 then 8 else 1) - else - if c <= 70449 - then (if c <= 70448 then 8 else 1) - else if c <= 70451 then 8 else 1) - else - if c <= 70479 - then - (if c <= 70460 - then (if c <= 70457 then 8 else 1) - else if c <= 70461 then 8 else 1) - else - if c <= 70492 - then (if c <= 70480 then 8 else 1) - else if c <= 70497 then 8 else 1) - else - if c <= 71934 - then - (if c <= 71167 - then - (if c <= 70851 - then - (if c <= 70750 - then - (if c <= 70726 - then (if c <= 70708 then 8 else 1) - else if c <= 70730 then 8 else 1) - else - if c <= 70783 - then (if c <= 70753 then 8 else 1) - else if c <= 70831 then 8 else 1) - else - if c <= 71039 - then - (if c <= 70854 - then (if c <= 70853 then 8 else 1) - else if c <= 70855 then 8 else 1) - else - if c <= 71127 - then (if c <= 71086 then 8 else 1) - else if c <= 71131 then 8 else 1) - else - if c <= 71423 - then - (if c <= 71295 - then - (if c <= 71235 - then (if c <= 71215 then 8 else 1) - else if c <= 71236 then 8 else 1) - else - if c <= 71351 - then (if c <= 71338 then 8 else 1) - else if c <= 71352 then 8 else 1) - else - if c <= 71679 - then - (if c <= 71487 - then (if c <= 71450 then 8 else 1) - else if c <= 71494 then 8 else 1) - else - if c <= 71839 - then (if c <= 71723 then 8 else 1) - else if c <= 71903 then 8 else 1) - else - if c <= 72105 - then - (if c <= 71959 - then - (if c <= 71947 - then - (if c <= 71944 - then (if c <= 71942 then 8 else 1) - else if c <= 71945 then 8 else 1) - else - if c <= 71956 - then (if c <= 71955 then 8 else 1) - else if c <= 71958 then 8 else 1) - else - if c <= 72000 - then - (if c <= 71998 - then (if c <= 71983 then 8 else 1) - else if c <= 71999 then 8 else 1) - else - if c <= 72095 - then (if c <= 72001 then 8 else 1) - else if c <= 72103 then 8 else 1) - else - if c <= 72202 - then - (if c <= 72162 - then - (if c <= 72160 - then (if c <= 72144 then 8 else 1) - else if c <= 72161 then 8 else 1) - else - if c <= 72191 - then (if c <= 72163 then 8 else 1) - else if c <= 72192 then 8 else 1) - else - if c <= 72271 - then - (if c <= 72249 - then (if c <= 72242 then 8 else 1) - else if c <= 72250 then 8 else 1) - else - if c <= 72283 - then (if c <= 72272 then 8 else 1) - else if c <= 72329 then 8 else 1) - else - if c <= 94031 - then - (if c <= 73727 - then - (if c <= 72970 - then - (if c <= 72767 - then - (if c <= 72703 - then - (if c <= 72367 - then (if c <= 72349 then 8 else 1) - else if c <= 72440 then 8 else 1) - else - if c <= 72713 - then (if c <= 72712 then 8 else 1) - else if c <= 72750 then 8 else 1) - else - if c <= 72959 - then - (if c <= 72817 - then (if c <= 72768 then 8 else 1) - else if c <= 72847 then 8 else 1) - else - if c <= 72967 - then (if c <= 72966 then 8 else 1) - else if c <= 72969 then 8 else 1) - else - if c <= 73065 - then - (if c <= 73055 - then - (if c <= 73029 - then (if c <= 73008 then 8 else 1) - else if c <= 73030 then 8 else 1) - else - if c <= 73062 - then (if c <= 73061 then 8 else 1) - else if c <= 73064 then 8 else 1) - else - if c <= 73439 - then - (if c <= 73111 - then (if c <= 73097 then 8 else 1) - else if c <= 73112 then 8 else 1) - else - if c <= 73647 - then (if c <= 73458 then 8 else 1) - else if c <= 73648 then 8 else 1) - else - if c <= 92783 - then - (if c <= 77823 - then - (if c <= 74879 - then - (if c <= 74751 - then (if c <= 74649 then 8 else 1) - else if c <= 74862 then 8 else 1) - else - if c <= 77711 - then (if c <= 75075 then 8 else 1) - else if c <= 77808 then 8 else 1) - else - if c <= 92159 - then - (if c <= 82943 - then (if c <= 78894 then 8 else 1) - else if c <= 83526 then 8 else 1) - else - if c <= 92735 - then (if c <= 92728 then 8 else 1) - else if c <= 92766 then 8 else 1) - else - if c <= 93026 - then - (if c <= 92927 - then - (if c <= 92879 - then (if c <= 92862 then 8 else 1) - else if c <= 92909 then 8 else 1) - else - if c <= 92991 - then (if c <= 92975 then 8 else 1) - else if c <= 92995 then 8 else 1) - else - if c <= 93759 - then - (if c <= 93052 - then (if c <= 93047 then 8 else 1) - else if c <= 93071 then 8 else 1) - else - if c <= 93951 - then (if c <= 93823 then 8 else 1) - else if c <= 94026 then 8 else 1) - else - if c <= 113791 - then - (if c <= 110580 - then - (if c <= 94207 - then - (if c <= 94175 - then - (if c <= 94098 - then (if c <= 94032 then 8 else 1) - else if c <= 94111 then 8 else 1) - else - if c <= 94178 - then (if c <= 94177 then 8 else 1) - else if c <= 94179 then 8 else 1) - else - if c <= 101631 - then - (if c <= 100351 - then (if c <= 100343 then 8 else 1) - else if c <= 101589 then 8 else 1) - else - if c <= 110575 - then (if c <= 101640 then 8 else 1) - else if c <= 110579 then 8 else 1) - else - if c <= 110947 - then - (if c <= 110591 - then - (if c <= 110588 - then (if c <= 110587 then 8 else 1) - else if c <= 110590 then 8 else 1) - else - if c <= 110927 - then (if c <= 110882 then 8 else 1) - else if c <= 110930 then 8 else 1) - else - if c <= 113663 - then - (if c <= 110959 - then (if c <= 110951 then 8 else 1) - else if c <= 111355 then 8 else 1) - else - if c <= 113775 - then (if c <= 113770 then 8 else 1) - else if c <= 113788 then 8 else 1) - else - if c <= 119981 - then - (if c <= 119965 - then - (if c <= 119807 - then - (if c <= 113807 - then (if c <= 113800 then 8 else 1) - else if c <= 113817 then 8 else 1) - else - if c <= 119893 - then (if c <= 119892 then 8 else 1) - else if c <= 119964 then 8 else 1) - else - if c <= 119972 - then - (if c <= 119969 - then (if c <= 119967 then 8 else 1) - else if c <= 119970 then 8 else 1) - else - if c <= 119976 - then (if c <= 119974 then 8 else 1) - else if c <= 119980 then 8 else 1) - else - if c <= 120070 - then - (if c <= 119996 - then - (if c <= 119994 - then (if c <= 119993 then 8 else 1) - else if c <= 119995 then 8 else 1) - else - if c <= 120004 - then (if c <= 120003 then 8 else 1) - else if c <= 120069 then 8 else 1) - else - if c <= 120085 - then - (if c <= 120076 - then (if c <= 120074 then 8 else 1) - else if c <= 120084 then 8 else 1) - else - if c <= 120093 - then (if c <= 120092 then 8 else 1) - else if c <= 120121 then 8 else 1) - else - if c <= 131071 - then - (if c <= 126468 - then - (if c <= 122623 - then - (if c <= 120571 - then - (if c <= 120145 - then - (if c <= 120133 - then - (if c <= 120127 - then (if c <= 120126 then 8 else 1) - else if c <= 120132 then 8 else 1) - else - if c <= 120137 - then (if c <= 120134 then 8 else 1) - else if c <= 120144 then 8 else 1) - else - if c <= 120513 - then - (if c <= 120487 - then (if c <= 120485 then 8 else 1) - else if c <= 120512 then 8 else 1) - else - if c <= 120539 - then (if c <= 120538 then 8 else 1) - else if c <= 120570 then 8 else 1) - else - if c <= 120687 - then - (if c <= 120629 - then - (if c <= 120597 - then (if c <= 120596 then 8 else 1) - else if c <= 120628 then 8 else 1) - else - if c <= 120655 - then (if c <= 120654 then 8 else 1) - else if c <= 120686 then 8 else 1) - else - if c <= 120745 - then - (if c <= 120713 - then (if c <= 120712 then 8 else 1) - else if c <= 120744 then 8 else 1) - else - if c <= 120771 - then (if c <= 120770 then 8 else 1) - else if c <= 120779 then 8 else 1) - else - if c <= 124895 - then - (if c <= 123190 - then - (if c <= 122654 - then 8 - else - if c <= 123135 - then 1 - else if c <= 123180 then 8 else 1) - else - if c <= 123535 - then - (if c <= 123213 - then (if c <= 123197 then 8 else 1) - else if c <= 123214 then 8 else 1) - else - if c <= 123583 - then (if c <= 123565 then 8 else 1) - else if c <= 123627 then 8 else 1) - else - if c <= 124927 - then - (if c <= 124908 - then - (if c <= 124903 - then (if c <= 124902 then 8 else 1) - else if c <= 124907 then 8 else 1) - else - if c <= 124911 - then (if c <= 124910 then 8 else 1) - else if c <= 124926 then 8 else 1) - else - if c <= 125258 - then - (if c <= 125183 - then (if c <= 125124 then 8 else 1) - else if c <= 125251 then 8 else 1) - else - if c <= 126463 - then (if c <= 125259 then 8 else 1) - else if c <= 126467 then 8 else 1) - else - if c <= 126552 - then - (if c <= 126529 - then - (if c <= 126504 - then - (if c <= 126499 - then - (if c <= 126496 - then (if c <= 126495 then 8 else 1) - else if c <= 126498 then 8 else 1) - else - if c <= 126502 - then (if c <= 126500 then 8 else 1) - else if c <= 126503 then 8 else 1) - else - if c <= 126520 - then - (if c <= 126515 - then (if c <= 126514 then 8 else 1) - else if c <= 126519 then 8 else 1) - else - if c <= 126522 - then (if c <= 126521 then 8 else 1) - else if c <= 126523 then 8 else 1) - else - if c <= 126540 - then - (if c <= 126536 - then - (if c <= 126534 - then (if c <= 126530 then 8 else 1) - else if c <= 126535 then 8 else 1) - else - if c <= 126538 - then (if c <= 126537 then 8 else 1) - else if c <= 126539 then 8 else 1) - else - if c <= 126547 - then - (if c <= 126544 - then (if c <= 126543 then 8 else 1) - else if c <= 126546 then 8 else 1) - else - if c <= 126550 - then (if c <= 126548 then 8 else 1) - else if c <= 126551 then 8 else 1) - else - if c <= 126579 - then - (if c <= 126560 - then - (if c <= 126556 - then - (if c <= 126554 - then (if c <= 126553 then 8 else 1) - else if c <= 126555 then 8 else 1) - else - if c <= 126558 - then (if c <= 126557 then 8 else 1) - else if c <= 126559 then 8 else 1) - else - if c <= 126566 - then - (if c <= 126563 - then (if c <= 126562 then 8 else 1) - else if c <= 126564 then 8 else 1) - else - if c <= 126571 - then (if c <= 126570 then 8 else 1) - else if c <= 126578 then 8 else 1) - else - if c <= 126602 - then - (if c <= 126589 - then - (if c <= 126584 - then (if c <= 126583 then 8 else 1) - else if c <= 126588 then 8 else 1) - else - if c <= 126591 - then (if c <= 126590 then 8 else 1) - else if c <= 126601 then 8 else 1) - else - if c <= 126628 - then - (if c <= 126624 - then (if c <= 126619 then 8 else 1) - else if c <= 126627 then 8 else 1) - else - if c <= 126634 - then (if c <= 126633 then 8 else 1) - else if c <= 126651 then 8 else 1) - else - if c <= 183983 - then - (if c <= 177983 - then - (if c <= 173823 - then (if c <= 173791 then 8 else 1) - else if c <= 177976 then 8 else 1) - else - if c <= 178207 - then (if c <= 178205 then 8 else 1) - else if c <= 183969 then 8 else 1) - else if c <= 191456 then 8 else 1) - else (-1) -let __sedlex_partition_58 c = - if c <= 45 then (-1) else if c <= 46 then 0 else (-1) -let __sedlex_partition_51 c = - if c <= 8 - then (-1) - else - if c <= 5760 - then (Char.code (String.unsafe_get __sedlex_table_2 (c - 9))) - 1 - else - if c <= 8191 - then (-1) - else - if c <= 65279 - then - (if c <= 12288 - then - (if c <= 8239 - then (if c <= 8202 then 0 else if c <= 8238 then (-1) else 0) - else - if c <= 8286 - then (-1) - else if c <= 8287 then 0 else if c <= 12287 then (-1) else 0) - else if c <= 65278 then (-1) else 0) - else (-1) -let __sedlex_partition_21 c = - if c <= (-1) - then (-1) - else - if c <= 95 - then (Char.code (String.unsafe_get __sedlex_table_3 c)) - 1 - else if c <= 96 then (-1) else 0 -let __sedlex_partition_91 c = - if c <= 63 then (-1) else if c <= 64 then 0 else (-1) -let __sedlex_partition_112 c = - if c <= 47 - then (-1) - else - if c <= 120 - then (Char.code (String.unsafe_get __sedlex_table_4 (c - 48))) - 1 - else (-1) -let __sedlex_partition_33 c = - if c <= 47 then (-1) else if c <= 57 then 0 else (-1) -let __sedlex_partition_102 c = - if c <= 91 - then (-1) - else - if c <= 93 - then (Char.code (String.unsafe_get __sedlex_table_5 (c - 92))) - 1 - else (-1) -let __sedlex_partition_104 c = - if c <= (-1) - then (-1) - else - if c <= 90 - then (Char.code (String.unsafe_get __sedlex_table_6 c)) - 1 - else - if c <= 92 - then (-1) - else if c <= 8231 then 0 else if c <= 8233 then (-1) else 0 -let __sedlex_partition_4 c = - if c <= 47 - then (-1) - else - if c <= 102 - then (Char.code (String.unsafe_get __sedlex_table_7 (c - 48))) - 1 - else (-1) -let __sedlex_partition_18 c = - if c <= 92 - then (Char.code (String.unsafe_get __sedlex_table_8 (c - (-1)))) - 1 - else 1 -let __sedlex_partition_42 c = - if c <= 47 - then (-1) - else - if c <= 110 - then (Char.code (String.unsafe_get __sedlex_table_9 (c - 48))) - 1 - else (-1) -let __sedlex_partition_129 c = - if c <= 61 then (-1) else if c <= 62 then 0 else (-1) -let __sedlex_partition_130 c = - if c <= 123 then (-1) else if c <= 124 then 0 else (-1) -let __sedlex_partition_113 c = - if c <= 47 - then (-1) - else - if c <= 59 - then (Char.code (String.unsafe_get __sedlex_table_10 (c - 48))) - 1 - else (-1) -let __sedlex_partition_115 c = - if c <= 35 - then (-1) - else - if c <= 122 - then (Char.code (String.unsafe_get __sedlex_table_11 (c - 36))) - 1 - else (-1) -let __sedlex_partition_34 c = - if c <= 87 - then (-1) - else - if c <= 120 - then (Char.code (String.unsafe_get __sedlex_table_12 (c - 88))) - 1 - else (-1) -let __sedlex_partition_37 c = - if c <= 45 - then (-1) - else - if c <= 57 - then (Char.code (String.unsafe_get __sedlex_table_13 (c - 46))) - 1 - else (-1) -let __sedlex_partition_84 c = - if c <= 35 - then (-1) - else - if c <= 122 - then (Char.code (String.unsafe_get __sedlex_table_14 (c - 36))) - 1 - else (-1) -let __sedlex_partition_5 c = - if c <= 47 - then (-1) - else - if c <= 125 - then (Char.code (String.unsafe_get __sedlex_table_15 (c - 48))) - 1 - else (-1) -let __sedlex_partition_62 c = - if c <= 35 - then (-1) - else - if c <= 122 - then (Char.code (String.unsafe_get __sedlex_table_16 (c - 36))) - 1 - else (-1) -let __sedlex_partition_121 c = - if c <= 8 - then (-1) - else - if c <= 5760 - then (Char.code (String.unsafe_get __sedlex_table_17 (c - 9))) - 1 - else - if c <= 8191 - then (-1) - else - if c <= 65279 - then - (if c <= 12288 - then - (if c <= 8239 - then (if c <= 8202 then 0 else if c <= 8238 then (-1) else 0) - else - if c <= 8286 - then (-1) - else if c <= 8287 then 0 else if c <= 12287 then (-1) else 0) - else if c <= 65278 then (-1) else 0) - else (-1) -let __sedlex_partition_131 c = - if c <= 124 then (-1) else if c <= 125 then 0 else (-1) -let __sedlex_partition_43 c = - if c <= 45 - then (-1) - else - if c <= 101 - then (Char.code (String.unsafe_get __sedlex_table_18 (c - 46))) - 1 - else (-1) -let __sedlex_partition_56 c = - if c <= 42 - then (-1) - else - if c <= 61 - then (Char.code (String.unsafe_get __sedlex_table_19 (c - 43))) - 1 - else (-1) -let __sedlex_partition_7 c = - if c <= 92 - then (Char.code (String.unsafe_get __sedlex_table_20 (c - (-1)))) - 1 - else 1 -let __sedlex_partition_19 c = - if c <= (-1) - then (-1) - else - if c <= 91 - then (Char.code (String.unsafe_get __sedlex_table_21 c)) - 1 - else if c <= 92 then (-1) else 0 -let __sedlex_partition_105 c = - if c <= 35 - then (-1) - else - if c <= 122 - then (Char.code (String.unsafe_get __sedlex_table_22 (c - 36))) - 1 - else (-1) -let __sedlex_partition_57 c = - if c <= 44 - then (-1) - else - if c <= 61 - then (Char.code (String.unsafe_get __sedlex_table_23 (c - 45))) - 1 - else (-1) -let __sedlex_partition_127 c = - if c <= 103 then (-1) else if c <= 104 then 0 else (-1) -let __sedlex_partition_28 c = - if c <= 47 - then (-1) - else - if c <= 95 - then (Char.code (String.unsafe_get __sedlex_table_24 (c - 48))) - 1 - else (-1) -let __sedlex_partition_27 c = - if c <= 47 - then (-1) - else - if c <= 110 - then (Char.code (String.unsafe_get __sedlex_table_25 (c - 48))) - 1 - else (-1) -let __sedlex_partition_35 c = - if c <= 47 - then (-1) - else - if c <= 110 - then (Char.code (String.unsafe_get __sedlex_table_26 (c - 48))) - 1 - else (-1) -let __sedlex_partition_79 c = - if c <= 35 - then (-1) - else - if c <= 122 - then (Char.code (String.unsafe_get __sedlex_table_27 (c - 36))) - 1 - else (-1) -let __sedlex_partition_65 c = - if c <= 8 - then (-1) - else - if c <= 5760 - then (Char.code (String.unsafe_get __sedlex_table_28 (c - 9))) - 1 - else - if c <= 8191 - then (-1) - else - if c <= 65279 - then - (if c <= 12288 - then - (if c <= 8239 - then (if c <= 8202 then 0 else if c <= 8238 then (-1) else 0) - else - if c <= 8286 - then (-1) - else if c <= 8287 then 0 else if c <= 12287 then (-1) else 0) - else if c <= 65278 then (-1) else 0) - else (-1) -let __sedlex_partition_122 c = - if c <= 44 - then (-1) - else - if c <= 57 - then (Char.code (String.unsafe_get __sedlex_table_29 (c - 45))) - 1 - else (-1) -let __sedlex_partition_26 c = - if c <= 47 then (-1) else if c <= 49 then 0 else (-1) -let __sedlex_partition_31 c = - if c <= 47 - then (-1) - else - if c <= 95 - then (Char.code (String.unsafe_get __sedlex_table_30 (c - 48))) - 1 - else (-1) -let __sedlex_partition_40 c = - if c <= 47 - then (-1) - else - if c <= 57 - then (Char.code (String.unsafe_get __sedlex_table_31 (c - 48))) - 1 - else (-1) -let __sedlex_partition_86 c = - if c <= 35 - then (-1) - else - if c <= 122 - then (Char.code (String.unsafe_get __sedlex_table_32 (c - 36))) - 1 - else (-1) -let __sedlex_partition_93 c = - if c <= 114 then (-1) else if c <= 115 then 0 else (-1) -let __sedlex_partition_52 c = - if c <= 60 then (-1) else if c <= 61 then 0 else (-1) -let __sedlex_partition_110 c = - if c <= (-1) - then (-1) - else - if c <= 122 - then (Char.code (String.unsafe_get __sedlex_table_33 c)) - 1 - else - if c <= 123 - then (-1) - else if c <= 8231 then 0 else if c <= 8233 then (-1) else 0 -let __sedlex_partition_10 c = - if c <= (-1) - then (-1) - else - if c <= 41 - then (Char.code (String.unsafe_get __sedlex_table_34 c)) - 1 - else - if c <= 42 - then (-1) - else if c <= 8231 then 0 else if c <= 8233 then (-1) else 0 -let __sedlex_partition_88 c = - if c <= 59 - then (-1) - else - if c <= 61 - then (Char.code (String.unsafe_get __sedlex_table_5 (c - 60))) - 1 - else (-1) -let __sedlex_partition_41 c = - if c <= 47 - then (-1) - else - if c <= 110 - then (Char.code (String.unsafe_get __sedlex_table_35 (c - 48))) - 1 - else (-1) -let __sedlex_partition_92 c = - if c <= 96 - then (-1) - else - if c <= 105 - then (Char.code (String.unsafe_get __sedlex_table_36 (c - 97))) - 1 - else (-1) -let __sedlex_partition_30 c = - if c <= 47 - then (-1) - else - if c <= 110 - then (Char.code (String.unsafe_get __sedlex_table_37 (c - 48))) - 1 - else (-1) -let __sedlex_partition_89 c = - if c <= 60 - then (-1) - else - if c <= 62 - then (Char.code (String.unsafe_get __sedlex_table_5 (c - 61))) - 1 - else (-1) -let __sedlex_partition_22 c = - if c <= 122 then (-1) else if c <= 123 then 0 else (-1) -let __sedlex_partition_25 c = - if c <= 65 - then (-1) - else - if c <= 98 - then (Char.code (String.unsafe_get __sedlex_table_12 (c - 66))) - 1 - else (-1) -let __sedlex_partition_63 c = - if c <= 35 - then (-1) - else - if c <= 122 - then (Char.code (String.unsafe_get __sedlex_table_38 (c - 36))) - 1 - else (-1) -let __sedlex_partition_20 c = - if c <= 96 - then (Char.code (String.unsafe_get __sedlex_table_39 (c - (-1)))) - 1 - else 1 -let __sedlex_partition_96 c = - if c <= 115 then (-1) else if c <= 116 then 0 else (-1) -let __sedlex_partition_17 c = - if c <= 47 then (-1) else if c <= 55 then 0 else (-1) -let __sedlex_partition_72 c = - if c <= 109 then (-1) else if c <= 110 then 0 else (-1) -let __sedlex_partition_99 c = - if c <= 60 - then (-1) - else - if c <= 124 - then (Char.code (String.unsafe_get __sedlex_table_40 (c - 61))) - 1 - else (-1) -let __sedlex_partition_68 c = - if c <= 110 then (-1) else if c <= 111 then 0 else (-1) -let __sedlex_partition_73 c = - if c <= 98 then (-1) else if c <= 99 then 0 else (-1) -let __sedlex_partition_24 c = - if c <= 47 then (-1) else if c <= 48 then 0 else (-1) -let __sedlex_partition_123 c = - if c <= 8 - then (-1) - else - if c <= 5760 - then (Char.code (String.unsafe_get __sedlex_table_41 (c - 9))) - 1 - else - if c <= 8191 - then (-1) - else - if c <= 65279 - then - (if c <= 12288 - then - (if c <= 8239 - then (if c <= 8202 then 0 else if c <= 8238 then (-1) else 0) - else - if c <= 8286 - then (-1) - else if c <= 8287 then 0 else if c <= 12287 then (-1) else 0) - else if c <= 65278 then (-1) else 0) - else (-1) -let __sedlex_partition_45 c = - if c <= 45 - then (-1) - else - if c <= 101 - then (Char.code (String.unsafe_get __sedlex_table_42 (c - 46))) - 1 - else (-1) -let __sedlex_partition_29 c = - if c <= 78 - then (-1) - else - if c <= 111 - then (Char.code (String.unsafe_get __sedlex_table_12 (c - 79))) - 1 - else (-1) -let __sedlex_partition_23 c = - if c <= 41 then (-1) else if c <= 42 then 0 else (-1) -let __sedlex_partition_16 c = - if c <= 120 - then (Char.code (String.unsafe_get __sedlex_table_43 (c - (-1)))) - 1 - else if c <= 8233 then (if c <= 8231 then 1 else 2) else 1 -let __sedlex_partition_53 c = - if c <= 32 then (-1) else if c <= 33 then 0 else (-1) -let __sedlex_partition_54 c = - if c <= 37 - then (-1) - else - if c <= 61 - then (Char.code (String.unsafe_get __sedlex_table_44 (c - 38))) - 1 - else (-1) -let __sedlex_partition_106 c = - if c <= (-1) - then (-1) - else - if c <= 13 - then (Char.code (String.unsafe_get __sedlex_table_45 c)) - 1 - else if c <= 8233 then (if c <= 8231 then 0 else 1) else 0 -let __sedlex_partition_77 c = - if c <= 35 - then (-1) - else - if c <= 122 - then (Char.code (String.unsafe_get __sedlex_table_46 (c - 36))) - 1 - else (-1) -let __sedlex_partition_9 c = - if c <= (-1) - then (-1) - else - if c <= 42 - then (Char.code (String.unsafe_get __sedlex_table_47 c)) - 1 - else if c <= 8233 then (if c <= 8231 then 0 else 1) else 0 -let __sedlex_partition_44 c = - if c <= 47 - then (-1) - else - if c <= 101 - then (Char.code (String.unsafe_get __sedlex_table_48 (c - 48))) - 1 - else (-1) -let __sedlex_partition_59 c = - if c <= 35 - then (-1) - else - if c <= 122 - then (Char.code (String.unsafe_get __sedlex_table_49 (c - 36))) - 1 - else (-1) -let __sedlex_partition_55 c = - if c <= 41 - then (-1) - else - if c <= 61 - then (Char.code (String.unsafe_get __sedlex_table_50 (c - 42))) - 1 - else (-1) -let __sedlex_partition_95 c = - if c <= 72 then (-1) else if c <= 73 then 0 else (-1) -let __sedlex_partition_120 c = - if c <= 44 - then (-1) - else - if c <= 48 - then (Char.code (String.unsafe_get __sedlex_table_51 (c - 45))) - 1 - else (-1) -let __sedlex_partition_124 c = - if c <= 44 - then (-1) - else - if c <= 57 - then (Char.code (String.unsafe_get __sedlex_table_52 (c - 45))) - 1 - else (-1) -let __sedlex_partition_70 c = - if c <= 44 then (-1) else if c <= 45 then 0 else (-1) -let __sedlex_partition_71 c = - if c <= 104 then (-1) else if c <= 105 then 0 else (-1) -let __sedlex_partition_67 c = - if c <= 107 then (-1) else if c <= 108 then 0 else (-1) -let __sedlex_partition_74 c = - if c <= 99 then (-1) else if c <= 100 then 0 else (-1) -let __sedlex_partition_36 c = - if c <= 47 - then (-1) - else - if c <= 102 - then (Char.code (String.unsafe_get __sedlex_table_53 (c - 48))) - 1 - else (-1) -let __sedlex_partition_97 c = - if c <= 113 then (-1) else if c <= 114 then 0 else (-1) -let __sedlex_partition_47 c = - if c <= 45 - then (-1) - else - if c <= 57 - then (Char.code (String.unsafe_get __sedlex_table_54 (c - 46))) - 1 - else (-1) -let __sedlex_partition_80 c = - if c <= 35 - then (-1) - else - if c <= 122 - then (Char.code (String.unsafe_get __sedlex_table_55 (c - 36))) - 1 - else (-1) -let __sedlex_partition_3 c = - if c <= 47 - then (-1) - else - if c <= 123 - then (Char.code (String.unsafe_get __sedlex_table_56 (c - 48))) - 1 - else (-1) -let __sedlex_partition_90 c = - if c <= 45 - then (-1) - else - if c <= 63 - then (Char.code (String.unsafe_get __sedlex_table_57 (c - 46))) - 1 - else (-1) -let __sedlex_partition_8 c = - if c <= (-1) - then (-1) - else if c <= 91 then 0 else if c <= 92 then (-1) else 0 -let __sedlex_partition_15 c = - if c <= (-1) - then (-1) - else - if c <= 12 - then (Char.code (String.unsafe_get __sedlex_table_58 c)) - 1 - else - if c <= 13 - then (-1) - else if c <= 8231 then 0 else if c <= 8233 then (-1) else 0 -let __sedlex_partition_76 c = - if c <= 35 - then (-1) - else - if c <= 122 - then (Char.code (String.unsafe_get __sedlex_table_59 (c - 36))) - 1 - else (-1) -let __sedlex_partition_101 c = - if c <= (-1) - then (-1) - else - if c <= 91 - then (Char.code (String.unsafe_get __sedlex_table_60 c)) - 1 - else - if c <= 93 - then (-1) - else if c <= 8231 then 0 else if c <= 8233 then (-1) else 0 -let __sedlex_partition_107 c = - if c <= 8191 - then (Char.code (String.unsafe_get __sedlex_table_61 (c - (-1)))) - 1 - else - if c <= 12287 - then - (if c <= 8238 - then - (if c <= 8231 - then (if c <= 8202 then 2 else 1) - else if c <= 8233 then 3 else 1) - else - if c <= 8286 - then (if c <= 8239 then 2 else 1) - else if c <= 8287 then 2 else 1) - else - if c <= 65278 - then (if c <= 12288 then 2 else 1) - else if c <= 65279 then 2 else 1 -let __sedlex_partition_11 c = - if c <= 9 then (-1) else if c <= 10 then 0 else (-1) -let __sedlex_partition_82 c = - if c <= 35 - then (-1) - else - if c <= 122 - then (Char.code (String.unsafe_get __sedlex_table_62 (c - 36))) - 1 - else (-1) -let __sedlex_partition_98 c = - if c <= 96 then (-1) else if c <= 97 then 0 else (-1) -let __sedlex_partition_64 c = - if c <= 35 - then (-1) - else - if c <= 122 - then (Char.code (String.unsafe_get __sedlex_table_63 (c - 36))) - 1 - else (-1) -let __sedlex_partition_132 c = - if c <= 35 - then (-1) - else - if c <= 8188 - then (Char.code (String.unsafe_get __sedlex_table_64 (c - 36))) - 1 - else - if c <= 8304 - then (-1) - else - if c <= 201546 - then - (if c <= 69864 - then - (if c <= 43754 - then - (if c <= 40981 - then - (if c <= 11623 - then - (if c <= 8504 - then - (if c <= 8472 - then - (if c <= 8450 - then - (if c <= 8319 - then - (if c <= 8305 - then 0 - else if c <= 8318 then (-1) else 0) - else - if c <= 8335 - then (-1) - else - if c <= 8348 - then 0 - else if c <= 8449 then (-1) else 0) - else - if c <= 8454 - then (-1) - else - if c <= 8467 - then - (if c <= 8455 - then 0 - else if c <= 8457 then (-1) else 0) - else - if c <= 8468 - then (-1) - else - if c <= 8469 - then 0 - else if c <= 8471 then (-1) else 0) - else - if c <= 8488 - then - (if c <= 8484 - then - (if c <= 8477 - then 0 - else if c <= 8483 then (-1) else 0) - else - if c <= 8485 - then (-1) - else - if c <= 8486 - then 0 - else if c <= 8487 then (-1) else 0) - else if c <= 8489 then (-1) else 0) - else - if c <= 11387 - then - (if c <= 8526 - then - (if c <= 8511 - then - (if c <= 8505 - then 0 - else if c <= 8507 then (-1) else 0) - else - if c <= 8516 - then (-1) - else - if c <= 8521 - then 0 - else if c <= 8525 then (-1) else 0) - else - if c <= 8543 - then (-1) - else - if c <= 8580 - then 0 - else - if c <= 8584 - then 0 - else if c <= 11263 then (-1) else 0) - else - if c <= 11507 - then - (if c <= 11492 - then 0 - else - if c <= 11498 - then (-1) - else - if c <= 11502 - then 0 - else if c <= 11505 then (-1) else 0) - else - if c <= 11519 - then (-1) - else - if c <= 11559 - then - (if c <= 11557 - then 0 - else if c <= 11558 then (-1) else 0) - else - if c <= 11564 - then (-1) - else - if c <= 11565 - then 0 - else if c <= 11567 then (-1) else 0) - else - if c <= 11630 - then (-1) - else - if c <= 12346 - then - (if c <= 11726 - then - (if c <= 11694 - then - (if c <= 11670 - then - (if c <= 11631 - then 0 - else if c <= 11647 then (-1) else 0) - else - if c <= 11679 - then (-1) - else - if c <= 11686 - then 0 - else if c <= 11687 then (-1) else 0) - else - if c <= 11695 - then (-1) - else - if c <= 11710 - then - (if c <= 11702 - then 0 - else if c <= 11703 then (-1) else 0) - else - if c <= 11711 - then (-1) - else - if c <= 11718 - then 0 - else if c <= 11719 then (-1) else 0) - else - if c <= 11727 - then (-1) - else - if c <= 12294 - then - (if c <= 11742 - then - (if c <= 11734 - then 0 - else if c <= 11735 then (-1) else 0) - else if c <= 12292 then (-1) else 0) - else - if c <= 12329 - then - (if c <= 12295 - then 0 - else if c <= 12320 then (-1) else 0) - else - if c <= 12336 - then (-1) - else - if c <= 12341 - then 0 - else if c <= 12343 then (-1) else 0) - else - if c <= 12542 - then - (if c <= 12444 - then - (if c <= 12348 - then 0 - else - if c <= 12352 - then (-1) - else - if c <= 12438 - then 0 - else if c <= 12442 then (-1) else 0) - else - if c <= 12447 - then 0 - else - if c <= 12448 - then (-1) - else - if c <= 12538 - then 0 - else if c <= 12539 then (-1) else 0) - else - if c <= 12735 - then - (if c <= 12591 - then - (if c <= 12543 - then 0 - else if c <= 12548 then (-1) else 0) - else - if c <= 12592 - then (-1) - else - if c <= 12686 - then 0 - else if c <= 12703 then (-1) else 0) - else - if c <= 12783 - then (-1) - else - if c <= 19903 - then - (if c <= 12799 - then 0 - else if c <= 13311 then (-1) else 0) - else if c <= 19967 then (-1) else 0) - else - if c <= 43013 - then - (if c <= 42863 - then - (if c <= 42605 - then - (if c <= 42507 - then - (if c <= 42231 - then - (if c <= 42124 - then 0 - else if c <= 42191 then (-1) else 0) - else - if c <= 42237 - then 0 - else if c <= 42239 then (-1) else 0) - else - if c <= 42527 - then - (if c <= 42508 - then 0 - else if c <= 42511 then (-1) else 0) - else - if c <= 42537 - then (-1) - else - if c <= 42539 - then 0 - else if c <= 42559 then (-1) else 0) - else - if c <= 42653 - then - (if c <= 42623 - then - (if c <= 42606 - then 0 - else if c <= 42622 then (-1) else 0) - else 0) - else - if c <= 42655 - then (-1) - else - if c <= 42735 - then 0 - else - if c <= 42774 - then (-1) - else - if c <= 42783 - then 0 - else if c <= 42785 then (-1) else 0) - else - if c <= 42963 - then - (if c <= 42894 - then - (if c <= 42887 - then 0 - else - if c <= 42888 - then 0 - else if c <= 42890 then (-1) else 0) - else - if c <= 42954 - then 0 - else - if c <= 42959 - then (-1) - else - if c <= 42961 - then 0 - else if c <= 42962 then (-1) else 0) - else - if c <= 42964 - then (-1) - else - if c <= 42999 - then - (if c <= 42996 - then - (if c <= 42969 - then 0 - else if c <= 42993 then (-1) else 0) - else 0) - else - if c <= 43002 - then 0 - else - if c <= 43009 - then 0 - else if c <= 43010 then (-1) else 0) - else - if c <= 43014 - then (-1) - else - if c <= 43518 - then - (if c <= 43301 - then - (if c <= 43187 - then - (if c <= 43042 - then - (if c <= 43018 - then 0 - else if c <= 43019 then (-1) else 0) - else - if c <= 43071 - then (-1) - else - if c <= 43123 - then 0 - else if c <= 43137 then (-1) else 0) - else - if c <= 43249 - then (-1) - else - if c <= 43259 - then - (if c <= 43255 - then 0 - else if c <= 43258 then (-1) else 0) - else - if c <= 43260 - then (-1) - else - if c <= 43262 - then 0 - else if c <= 43273 then (-1) else 0) - else - if c <= 43311 - then (-1) - else - if c <= 43471 - then - (if c <= 43388 - then - (if c <= 43334 - then 0 - else if c <= 43359 then (-1) else 0) - else - if c <= 43395 - then (-1) - else - if c <= 43442 - then 0 - else if c <= 43470 then (-1) else 0) - else - if c <= 43487 - then (-1) - else - if c <= 43494 - then - (if c <= 43492 - then 0 - else if c <= 43493 then (-1) else 0) - else - if c <= 43503 - then 0 - else if c <= 43513 then (-1) else 0) - else - if c <= 43519 - then (-1) - else - if c <= 43695 - then - (if c <= 43631 - then - (if c <= 43586 - then - (if c <= 43560 - then 0 - else if c <= 43583 then (-1) else 0) - else - if c <= 43587 - then (-1) - else - if c <= 43595 - then 0 - else if c <= 43615 then (-1) else 0) - else - if c <= 43638 - then 0 - else - if c <= 43641 - then (-1) - else - if c <= 43642 - then 0 - else if c <= 43645 then (-1) else 0) - else - if c <= 43696 - then (-1) - else - if c <= 43712 - then - (if c <= 43702 - then - (if c <= 43697 - then 0 - else if c <= 43700 then (-1) else 0) - else - if c <= 43704 - then (-1) - else - if c <= 43709 - then 0 - else if c <= 43711 then (-1) else 0) - else - if c <= 43713 - then (-1) - else - if c <= 43740 - then - (if c <= 43714 - then 0 - else if c <= 43738 then (-1) else 0) - else - if c <= 43741 - then 0 - else if c <= 43743 then (-1) else 0) - else - if c <= 43761 - then (-1) - else - if c <= 66511 - then - (if c <= 65019 - then - (if c <= 55291 - then - (if c <= 43866 - then - (if c <= 43790 - then - (if c <= 43764 - then 0 - else - if c <= 43776 - then (-1) - else - if c <= 43782 - then 0 - else if c <= 43784 then (-1) else 0) - else - if c <= 43792 - then (-1) - else - if c <= 43814 - then - (if c <= 43798 - then 0 - else if c <= 43807 then (-1) else 0) - else - if c <= 43815 - then (-1) - else - if c <= 43822 - then 0 - else if c <= 43823 then (-1) else 0) - else - if c <= 43867 - then (-1) - else - if c <= 43967 - then - (if c <= 43880 - then 0 - else - if c <= 43881 - then 0 - else if c <= 43887 then (-1) else 0) - else - if c <= 55203 - then - (if c <= 44002 - then 0 - else if c <= 44031 then (-1) else 0) - else - if c <= 55215 - then (-1) - else - if c <= 55238 - then 0 - else if c <= 55242 then (-1) else 0) - else - if c <= 63743 - then (-1) - else - if c <= 64316 - then - (if c <= 64279 - then - (if c <= 64217 - then - (if c <= 64109 - then 0 - else if c <= 64111 then (-1) else 0) - else - if c <= 64255 - then (-1) - else - if c <= 64262 - then 0 - else if c <= 64274 then (-1) else 0) - else - if c <= 64284 - then (-1) - else - if c <= 64296 - then - (if c <= 64285 - then 0 - else if c <= 64286 then (-1) else 0) - else - if c <= 64297 - then (-1) - else - if c <= 64310 - then 0 - else if c <= 64311 then (-1) else 0) - else - if c <= 64317 - then (-1) - else - if c <= 64433 - then - (if c <= 64321 - then - (if c <= 64318 - then 0 - else if c <= 64319 then (-1) else 0) - else - if c <= 64322 - then (-1) - else - if c <= 64324 - then 0 - else if c <= 64325 then (-1) else 0) - else - if c <= 64466 - then (-1) - else - if c <= 64911 - then - (if c <= 64829 - then 0 - else if c <= 64847 then (-1) else 0) - else - if c <= 64913 - then (-1) - else - if c <= 64967 - then 0 - else if c <= 65007 then (-1) else 0) - else - if c <= 65135 - then (-1) - else - if c <= 65594 - then - (if c <= 65439 - then - (if c <= 65370 - then - (if c <= 65276 - then - (if c <= 65140 - then 0 - else if c <= 65141 then (-1) else 0) - else - if c <= 65312 - then (-1) - else - if c <= 65338 - then 0 - else if c <= 65344 then (-1) else 0) - else if c <= 65381 then (-1) else 0) - else - if c <= 65495 - then - (if c <= 65479 - then - (if c <= 65470 - then 0 - else if c <= 65473 then (-1) else 0) - else - if c <= 65481 - then (-1) - else - if c <= 65487 - then 0 - else if c <= 65489 then (-1) else 0) - else - if c <= 65497 - then (-1) - else - if c <= 65547 - then - (if c <= 65500 - then 0 - else if c <= 65535 then (-1) else 0) - else - if c <= 65548 - then (-1) - else - if c <= 65574 - then 0 - else if c <= 65575 then (-1) else 0) - else - if c <= 65595 - then (-1) - else - if c <= 66335 - then - (if c <= 65786 - then - (if c <= 65613 - then - (if c <= 65597 - then 0 - else if c <= 65598 then (-1) else 0) - else - if c <= 65615 - then (-1) - else - if c <= 65629 - then 0 - else if c <= 65663 then (-1) else 0) - else - if c <= 65855 - then (-1) - else - if c <= 66204 - then - (if c <= 65908 - then 0 - else if c <= 66175 then (-1) else 0) - else - if c <= 66207 - then (-1) - else - if c <= 66256 - then 0 - else if c <= 66303 then (-1) else 0) - else - if c <= 66348 - then (-1) - else - if c <= 66378 - then 0 - else - if c <= 66383 - then (-1) - else - if c <= 66461 - then - (if c <= 66421 - then 0 - else if c <= 66431 then (-1) else 0) - else - if c <= 66463 - then (-1) - else - if c <= 66499 - then 0 - else if c <= 66503 then (-1) else 0) - else - if c <= 66512 - then (-1) - else - if c <= 67861 - then - (if c <= 67382 - then - (if c <= 66938 - then - (if c <= 66771 - then - (if c <= 66639 - then - (if c <= 66517 - then 0 - else if c <= 66559 then (-1) else 0) - else - if c <= 66717 - then 0 - else if c <= 66735 then (-1) else 0) - else - if c <= 66775 - then (-1) - else - if c <= 66855 - then - (if c <= 66811 - then 0 - else if c <= 66815 then (-1) else 0) - else - if c <= 66863 - then (-1) - else - if c <= 66915 - then 0 - else if c <= 66927 then (-1) else 0) - else - if c <= 66939 - then (-1) - else - if c <= 66977 - then - (if c <= 66962 - then - (if c <= 66954 - then 0 - else if c <= 66955 then (-1) else 0) - else - if c <= 66963 - then (-1) - else - if c <= 66965 - then 0 - else if c <= 66966 then (-1) else 0) - else - if c <= 66978 - then (-1) - else - if c <= 67001 - then - (if c <= 66993 - then 0 - else if c <= 66994 then (-1) else 0) - else - if c <= 67002 - then (-1) - else - if c <= 67004 - then 0 - else if c <= 67071 then (-1) else 0) - else - if c <= 67391 - then (-1) - else - if c <= 67637 - then - (if c <= 67504 - then - (if c <= 67431 - then - (if c <= 67413 - then 0 - else if c <= 67423 then (-1) else 0) - else - if c <= 67455 - then (-1) - else - if c <= 67461 - then 0 - else if c <= 67462 then (-1) else 0) - else - if c <= 67505 - then (-1) - else - if c <= 67589 - then - (if c <= 67514 - then 0 - else if c <= 67583 then (-1) else 0) - else - if c <= 67591 - then (-1) - else - if c <= 67592 - then 0 - else if c <= 67593 then (-1) else 0) - else - if c <= 67638 - then (-1) - else - if c <= 67702 - then - (if c <= 67644 - then - (if c <= 67640 - then 0 - else if c <= 67643 then (-1) else 0) - else - if c <= 67646 - then (-1) - else - if c <= 67669 - then 0 - else if c <= 67679 then (-1) else 0) - else - if c <= 67711 - then (-1) - else - if c <= 67826 - then - (if c <= 67742 - then 0 - else if c <= 67807 then (-1) else 0) - else - if c <= 67827 - then (-1) - else - if c <= 67829 - then 0 - else if c <= 67839 then (-1) else 0) - else - if c <= 67871 - then (-1) - else - if c <= 68680 - then - (if c <= 68220 - then - (if c <= 68096 - then - (if c <= 68023 - then - (if c <= 67897 - then 0 - else if c <= 67967 then (-1) else 0) - else - if c <= 68029 - then (-1) - else - if c <= 68031 - then 0 - else if c <= 68095 then (-1) else 0) - else - if c <= 68111 - then (-1) - else - if c <= 68119 - then - (if c <= 68115 - then 0 - else if c <= 68116 then (-1) else 0) - else - if c <= 68120 - then (-1) - else - if c <= 68149 - then 0 - else if c <= 68191 then (-1) else 0) - else - if c <= 68223 - then (-1) - else - if c <= 68405 - then - (if c <= 68295 - then - (if c <= 68252 - then 0 - else if c <= 68287 then (-1) else 0) - else - if c <= 68296 - then (-1) - else - if c <= 68324 - then 0 - else if c <= 68351 then (-1) else 0) - else - if c <= 68415 - then (-1) - else - if c <= 68466 - then - (if c <= 68437 - then 0 - else if c <= 68447 then (-1) else 0) - else - if c <= 68479 - then (-1) - else - if c <= 68497 - then 0 - else if c <= 68607 then (-1) else 0) - else - if c <= 68735 - then (-1) - else - if c <= 69445 - then - (if c <= 69289 - then - (if c <= 68850 - then - (if c <= 68786 - then 0 - else if c <= 68799 then (-1) else 0) - else - if c <= 68863 - then (-1) - else - if c <= 68899 - then 0 - else if c <= 69247 then (-1) else 0) - else - if c <= 69295 - then (-1) - else - if c <= 69404 - then - (if c <= 69297 - then 0 - else if c <= 69375 then (-1) else 0) - else - if c <= 69414 - then (-1) - else - if c <= 69415 - then 0 - else if c <= 69423 then (-1) else 0) - else - if c <= 69487 - then (-1) - else - if c <= 69687 - then - (if c <= 69572 - then - (if c <= 69505 - then 0 - else if c <= 69551 then (-1) else 0) - else - if c <= 69599 - then (-1) - else - if c <= 69622 - then 0 - else if c <= 69634 then (-1) else 0) - else - if c <= 69744 - then (-1) - else - if c <= 69749 - then - (if c <= 69746 - then 0 - else if c <= 69748 then (-1) else 0) - else - if c <= 69762 - then (-1) - else - if c <= 69807 - then 0 - else if c <= 69839 then (-1) else 0) - else - if c <= 69890 - then (-1) - else - if c <= 120512 - then - (if c <= 72847 - then - (if c <= 70855 - then - (if c <= 70312 - then - (if c <= 70106 - then - (if c <= 70002 - then - (if c <= 69956 - then - (if c <= 69926 - then 0 - else if c <= 69955 then (-1) else 0) - else - if c <= 69958 - then (-1) - else - if c <= 69959 - then 0 - else if c <= 69967 then (-1) else 0) - else - if c <= 70005 - then (-1) - else - if c <= 70066 - then - (if c <= 70006 - then 0 - else if c <= 70018 then (-1) else 0) - else - if c <= 70080 - then (-1) - else - if c <= 70084 - then 0 - else if c <= 70105 then (-1) else 0) - else - if c <= 70107 - then (-1) - else - if c <= 70278 - then - (if c <= 70161 - then - (if c <= 70108 - then 0 - else if c <= 70143 then (-1) else 0) - else - if c <= 70162 - then (-1) - else - if c <= 70187 - then 0 - else if c <= 70271 then (-1) else 0) - else - if c <= 70279 - then (-1) - else - if c <= 70285 - then - (if c <= 70280 - then 0 - else if c <= 70281 then (-1) else 0) - else - if c <= 70286 - then (-1) - else - if c <= 70301 - then 0 - else if c <= 70302 then (-1) else 0) - else - if c <= 70319 - then (-1) - else - if c <= 70461 - then - (if c <= 70440 - then - (if c <= 70412 - then - (if c <= 70366 - then 0 - else if c <= 70404 then (-1) else 0) - else - if c <= 70414 - then (-1) - else - if c <= 70416 - then 0 - else if c <= 70418 then (-1) else 0) - else - if c <= 70441 - then (-1) - else - if c <= 70451 - then - (if c <= 70448 - then 0 - else if c <= 70449 then (-1) else 0) - else - if c <= 70452 - then (-1) - else - if c <= 70457 - then 0 - else if c <= 70460 then (-1) else 0) - else - if c <= 70479 - then (-1) - else - if c <= 70730 - then - (if c <= 70497 - then - (if c <= 70480 - then 0 - else if c <= 70492 then (-1) else 0) - else - if c <= 70655 - then (-1) - else - if c <= 70708 - then 0 - else if c <= 70726 then (-1) else 0) - else - if c <= 70750 - then (-1) - else - if c <= 70831 - then - (if c <= 70753 - then 0 - else if c <= 70783 then (-1) else 0) - else - if c <= 70851 - then (-1) - else - if c <= 70853 - then 0 - else if c <= 70854 then (-1) else 0) - else - if c <= 71039 - then (-1) - else - if c <= 71999 - then - (if c <= 71494 - then - (if c <= 71236 - then - (if c <= 71131 - then - (if c <= 71086 - then 0 - else if c <= 71127 then (-1) else 0) - else - if c <= 71167 - then (-1) - else - if c <= 71215 - then 0 - else if c <= 71235 then (-1) else 0) - else - if c <= 71295 - then (-1) - else - if c <= 71352 - then - (if c <= 71338 - then 0 - else if c <= 71351 then (-1) else 0) - else - if c <= 71423 - then (-1) - else - if c <= 71450 - then 0 - else if c <= 71487 then (-1) else 0) - else - if c <= 71679 - then (-1) - else - if c <= 71945 - then - (if c <= 71903 - then - (if c <= 71723 - then 0 - else if c <= 71839 then (-1) else 0) - else - if c <= 71934 - then (-1) - else - if c <= 71942 - then 0 - else if c <= 71944 then (-1) else 0) - else - if c <= 71947 - then (-1) - else - if c <= 71958 - then - (if c <= 71955 - then 0 - else if c <= 71956 then (-1) else 0) - else - if c <= 71959 - then (-1) - else - if c <= 71983 - then 0 - else if c <= 71998 then (-1) else 0) - else - if c <= 72000 - then (-1) - else - if c <= 72250 - then - (if c <= 72161 - then - (if c <= 72103 - then - (if c <= 72001 - then 0 - else if c <= 72095 then (-1) else 0) - else - if c <= 72105 - then (-1) - else - if c <= 72144 - then 0 - else if c <= 72160 then (-1) else 0) - else - if c <= 72162 - then (-1) - else - if c <= 72192 - then - (if c <= 72163 - then 0 - else if c <= 72191 then (-1) else 0) - else - if c <= 72202 - then (-1) - else - if c <= 72242 - then 0 - else if c <= 72249 then (-1) else 0) - else - if c <= 72271 - then (-1) - else - if c <= 72440 - then - (if c <= 72329 - then - (if c <= 72272 - then 0 - else if c <= 72283 then (-1) else 0) - else - if c <= 72348 - then (-1) - else - if c <= 72349 - then 0 - else if c <= 72367 then (-1) else 0) - else - if c <= 72703 - then (-1) - else - if c <= 72750 - then - (if c <= 72712 - then 0 - else if c <= 72713 then (-1) else 0) - else - if c <= 72767 - then (-1) - else - if c <= 72768 - then 0 - else if c <= 72817 then (-1) else 0) - else - if c <= 72959 - then (-1) - else - if c <= 101589 - then - (if c <= 83526 - then - (if c <= 73112 - then - (if c <= 73030 - then - (if c <= 72969 - then - (if c <= 72966 - then 0 - else if c <= 72967 then (-1) else 0) - else - if c <= 72970 - then (-1) - else - if c <= 73008 - then 0 - else if c <= 73029 then (-1) else 0) - else - if c <= 73055 - then (-1) - else - if c <= 73064 - then - (if c <= 73061 - then 0 - else if c <= 73062 then (-1) else 0) - else - if c <= 73065 - then (-1) - else - if c <= 73097 - then 0 - else if c <= 73111 then (-1) else 0) - else - if c <= 73439 - then (-1) - else - if c <= 74862 - then - (if c <= 73648 - then - (if c <= 73458 - then 0 - else if c <= 73647 then (-1) else 0) - else - if c <= 73727 - then (-1) - else - if c <= 74649 - then 0 - else if c <= 74751 then (-1) else 0) - else - if c <= 74879 - then (-1) - else - if c <= 77808 - then - (if c <= 75075 - then 0 - else if c <= 77711 then (-1) else 0) - else - if c <= 77823 - then (-1) - else - if c <= 78894 - then 0 - else if c <= 82943 then (-1) else 0) - else - if c <= 92159 - then (-1) - else - if c <= 93071 - then - (if c <= 92909 - then - (if c <= 92766 - then - (if c <= 92728 - then 0 - else if c <= 92735 then (-1) else 0) - else - if c <= 92783 - then (-1) - else - if c <= 92862 - then 0 - else if c <= 92879 then (-1) else 0) - else - if c <= 92927 - then (-1) - else - if c <= 92995 - then - (if c <= 92975 - then 0 - else if c <= 92991 then (-1) else 0) - else - if c <= 93026 - then (-1) - else - if c <= 93047 - then 0 - else if c <= 93052 then (-1) else 0) - else - if c <= 93759 - then (-1) - else - if c <= 94111 - then - (if c <= 94026 - then - (if c <= 93823 - then 0 - else if c <= 93951 then (-1) else 0) - else - if c <= 94031 - then (-1) - else - if c <= 94032 - then 0 - else if c <= 94098 then (-1) else 0) - else - if c <= 94175 - then (-1) - else - if c <= 94179 - then - (if c <= 94177 - then 0 - else if c <= 94178 then (-1) else 0) - else - if c <= 94207 - then (-1) - else - if c <= 100343 - then 0 - else if c <= 100351 then (-1) else 0) - else - if c <= 101631 - then (-1) - else - if c <= 119970 - then - (if c <= 111355 - then - (if c <= 110590 - then - (if c <= 110579 - then - (if c <= 101640 - then 0 - else if c <= 110575 then (-1) else 0) - else - if c <= 110580 - then (-1) - else - if c <= 110587 - then 0 - else if c <= 110588 then (-1) else 0) - else - if c <= 110591 - then (-1) - else - if c <= 110930 - then - (if c <= 110882 - then 0 - else if c <= 110927 then (-1) else 0) - else - if c <= 110947 - then (-1) - else - if c <= 110951 - then 0 - else if c <= 110959 then (-1) else 0) - else - if c <= 113663 - then (-1) - else - if c <= 113817 - then - (if c <= 113788 - then - (if c <= 113770 - then 0 - else if c <= 113775 then (-1) else 0) - else - if c <= 113791 - then (-1) - else - if c <= 113800 - then 0 - else if c <= 113807 then (-1) else 0) - else - if c <= 119807 - then (-1) - else - if c <= 119964 - then - (if c <= 119892 - then 0 - else if c <= 119893 then (-1) else 0) - else - if c <= 119965 - then (-1) - else - if c <= 119967 - then 0 - else if c <= 119969 then (-1) else 0) - else - if c <= 119972 - then (-1) - else - if c <= 120084 - then - (if c <= 119995 - then - (if c <= 119980 - then - (if c <= 119974 - then 0 - else if c <= 119976 then (-1) else 0) - else - if c <= 119981 - then (-1) - else - if c <= 119993 - then 0 - else if c <= 119994 then (-1) else 0) - else - if c <= 119996 - then (-1) - else - if c <= 120069 - then - (if c <= 120003 - then 0 - else if c <= 120004 then (-1) else 0) - else - if c <= 120070 - then (-1) - else - if c <= 120074 - then 0 - else if c <= 120076 then (-1) else 0) - else - if c <= 120085 - then (-1) - else - if c <= 120132 - then - (if c <= 120121 - then - (if c <= 120092 - then 0 - else if c <= 120093 then (-1) else 0) - else - if c <= 120122 - then (-1) - else - if c <= 120126 - then 0 - else if c <= 120127 then (-1) else 0) - else - if c <= 120133 - then (-1) - else - if c <= 120144 - then - (if c <= 120134 - then 0 - else if c <= 120137 then (-1) else 0) - else - if c <= 120145 - then (-1) - else - if c <= 120485 - then 0 - else - if c <= 120487 then (-1) else 0) - else - if c <= 120513 - then (-1) - else - if c <= 195101 - then - (if c <= 126519 - then - (if c <= 123214 - then - (if c <= 120744 - then - (if c <= 120628 - then - (if c <= 120570 - then - (if c <= 120538 - then 0 - else if c <= 120539 then (-1) else 0) - else - if c <= 120571 - then (-1) - else - if c <= 120596 - then 0 - else if c <= 120597 then (-1) else 0) - else - if c <= 120629 - then (-1) - else - if c <= 120686 - then - (if c <= 120654 - then 0 - else if c <= 120655 then (-1) else 0) - else - if c <= 120687 - then (-1) - else - if c <= 120712 - then 0 - else if c <= 120713 then (-1) else 0) - else - if c <= 120745 - then (-1) - else - if c <= 122634 - then - (if c <= 120779 - then - (if c <= 120770 - then 0 - else if c <= 120771 then (-1) else 0) - else if c <= 122623 then (-1) else 0) - else - if c <= 123180 - then - (if c <= 122654 - then 0 - else if c <= 123135 then (-1) else 0) - else - if c <= 123190 - then (-1) - else - if c <= 123197 - then 0 - else if c <= 123213 then (-1) else 0) - else - if c <= 123535 - then (-1) - else - if c <= 125251 - then - (if c <= 124907 - then - (if c <= 123627 - then - (if c <= 123565 - then 0 - else if c <= 123583 then (-1) else 0) - else - if c <= 124895 - then (-1) - else - if c <= 124902 - then 0 - else if c <= 124903 then (-1) else 0) - else - if c <= 124908 - then (-1) - else - if c <= 124926 - then - (if c <= 124910 - then 0 - else if c <= 124911 then (-1) else 0) - else - if c <= 124927 - then (-1) - else - if c <= 125124 - then 0 - else if c <= 125183 then (-1) else 0) - else - if c <= 125258 - then (-1) - else - if c <= 126498 - then - (if c <= 126467 - then - (if c <= 125259 - then 0 - else if c <= 126463 then (-1) else 0) - else - if c <= 126468 - then (-1) - else - if c <= 126495 - then 0 - else if c <= 126496 then (-1) else 0) - else - if c <= 126499 - then (-1) - else - if c <= 126503 - then - (if c <= 126500 - then 0 - else if c <= 126502 then (-1) else 0) - else - if c <= 126504 - then (-1) - else - if c <= 126514 - then 0 - else if c <= 126515 then (-1) else 0) - else - if c <= 126520 - then (-1) - else - if c <= 126564 - then - (if c <= 126546 - then - (if c <= 126535 - then - (if c <= 126523 - then - (if c <= 126521 - then 0 - else if c <= 126522 then (-1) else 0) - else - if c <= 126529 - then (-1) - else - if c <= 126530 - then 0 - else if c <= 126534 then (-1) else 0) - else - if c <= 126536 - then (-1) - else - if c <= 126539 - then - (if c <= 126537 - then 0 - else if c <= 126538 then (-1) else 0) - else - if c <= 126540 - then (-1) - else - if c <= 126543 - then 0 - else if c <= 126544 then (-1) else 0) - else - if c <= 126547 - then (-1) - else - if c <= 126555 - then - (if c <= 126551 - then - (if c <= 126548 - then 0 - else if c <= 126550 then (-1) else 0) - else - if c <= 126552 - then (-1) - else - if c <= 126553 - then 0 - else if c <= 126554 then (-1) else 0) - else - if c <= 126556 - then (-1) - else - if c <= 126559 - then - (if c <= 126557 - then 0 - else if c <= 126558 then (-1) else 0) - else - if c <= 126560 - then (-1) - else - if c <= 126562 - then 0 - else if c <= 126563 then (-1) else 0) - else - if c <= 126566 - then (-1) - else - if c <= 126627 - then - (if c <= 126588 - then - (if c <= 126578 - then - (if c <= 126570 - then 0 - else if c <= 126571 then (-1) else 0) - else - if c <= 126579 - then (-1) - else - if c <= 126583 - then 0 - else if c <= 126584 then (-1) else 0) - else - if c <= 126589 - then (-1) - else - if c <= 126601 - then - (if c <= 126590 - then 0 - else if c <= 126591 then (-1) else 0) - else - if c <= 126602 - then (-1) - else - if c <= 126619 - then 0 - else if c <= 126624 then (-1) else 0) - else - if c <= 126628 - then (-1) - else - if c <= 177976 - then - (if c <= 126651 - then - (if c <= 126633 - then 0 - else if c <= 126634 then (-1) else 0) - else - if c <= 131071 - then (-1) - else - if c <= 173791 - then 0 - else if c <= 173823 then (-1) else 0) - else - if c <= 177983 - then (-1) - else - if c <= 183969 - then - (if c <= 178205 - then 0 - else if c <= 178207 then (-1) else 0) - else - if c <= 183983 - then (-1) - else - if c <= 191456 - then 0 - else - if c <= 194559 then (-1) else 0) - else if c <= 196607 then (-1) else 0) - else (-1) -let __sedlex_partition_83 c = - if c <= 35 - then (-1) - else - if c <= 122 - then (Char.code (String.unsafe_get __sedlex_table_65 (c - 36))) - 1 - else (-1) -let __sedlex_partition_128 c = - if c <= 106 then (-1) else if c <= 107 then 0 else (-1) -let __sedlex_partition_14 c = - if c <= 13 - then (Char.code (String.unsafe_get __sedlex_table_66 (c - (-1)))) - 1 - else if c <= 8233 then (if c <= 8231 then 1 else 2) else 1 -let __sedlex_partition_46 c = - if c <= 47 - then (-1) - else - if c <= 95 - then (Char.code (String.unsafe_get __sedlex_table_67 (c - 48))) - 1 - else (-1) -let __sedlex_partition_87 c = - if c <= 35 - then (-1) - else - if c <= 122 - then (Char.code (String.unsafe_get __sedlex_table_68 (c - 36))) - 1 - else (-1) -let __sedlex_partition_103 c = - if c <= 92 - then (Char.code (String.unsafe_get __sedlex_table_69 (c - (-1)))) - 1 - else if c <= 8233 then (if c <= 8231 then 1 else 2) else 1 -let __sedlex_partition_75 c = - if c <= 100 then (-1) else if c <= 101 then 0 else (-1) -let __sedlex_partition_116 c = - if c <= 58 then (-1) else if c <= 59 then 0 else (-1) -let __sedlex_partition_125 c = - if c <= 8 - then (-1) - else - if c <= 5760 - then (Char.code (String.unsafe_get __sedlex_table_70 (c - 9))) - 1 - else - if c <= 8191 - then (-1) - else - if c <= 65279 - then - (if c <= 12288 - then - (if c <= 8239 - then (if c <= 8202 then 0 else if c <= 8238 then (-1) else 0) - else - if c <= 8286 - then (-1) - else if c <= 8287 then 0 else if c <= 12287 then (-1) else 0) - else if c <= 65278 then (-1) else 0) - else (-1) -let __sedlex_partition_61 c = - if c <= 35 - then (-1) - else - if c <= 122 - then (Char.code (String.unsafe_get __sedlex_table_71 (c - 36))) - 1 - else (-1) -let __sedlex_partition_108 c = - if c <= 41 - then (-1) - else - if c <= 47 - then (Char.code (String.unsafe_get __sedlex_table_72 (c - 42))) - 1 - else (-1) -let __sedlex_partition_81 c = - if c <= 35 - then (-1) - else - if c <= 122 - then (Char.code (String.unsafe_get __sedlex_table_73 (c - 36))) - 1 - else (-1) -let __sedlex_partition_126 c = - if c <= 8191 - then (Char.code (String.unsafe_get __sedlex_table_74 (c - (-1)))) - 1 - else - if c <= 194559 - then - (if c <= 69599 - then - (if c <= 43711 - then - (if c <= 12703 - then - (if c <= 11519 - then - (if c <= 8489 - then - (if c <= 8454 - then - (if c <= 8304 - then - (if c <= 8238 - then - (if c <= 8231 - then (if c <= 8202 then 2 else 1) - else if c <= 8233 then 3 else 1) - else - if c <= 8286 - then (if c <= 8239 then 2 else 1) - else if c <= 8287 then 2 else 1) - else - if c <= 8335 - then - (if c <= 8318 - then (if c <= 8305 then 6 else 1) - else if c <= 8319 then 6 else 1) - else - if c <= 8449 - then (if c <= 8348 then 6 else 1) - else if c <= 8450 then 6 else 1) - else - if c <= 8477 - then - (if c <= 8468 - then - (if c <= 8457 - then (if c <= 8455 then 6 else 1) - else if c <= 8467 then 6 else 1) - else - if c <= 8471 - then (if c <= 8469 then 6 else 1) - else 6) - else - if c <= 8485 - then - (if c <= 8483 - then 1 - else if c <= 8484 then 6 else 1) - else - if c <= 8487 - then (if c <= 8486 then 6 else 1) - else if c <= 8488 then 6 else 1) - else - if c <= 8543 - then - (if c <= 8505 - then 6 - else - if c <= 8516 - then - (if c <= 8507 - then 1 - else if c <= 8511 then 6 else 1) - else - if c <= 8525 - then (if c <= 8521 then 6 else 1) - else if c <= 8526 then 6 else 1) - else - if c <= 11389 - then - (if c <= 8584 - then 6 - else if c <= 11263 then 1 else 6) - else - if c <= 11498 - then (if c <= 11492 then 6 else 1) - else - if c <= 11505 - then (if c <= 11502 then 6 else 1) - else if c <= 11507 then 6 else 1) - else - if c <= 12294 - then - (if c <= 11695 - then - (if c <= 11630 - then - (if c <= 11564 - then - (if c <= 11558 - then (if c <= 11557 then 6 else 1) - else if c <= 11559 then 6 else 1) - else - if c <= 11567 - then (if c <= 11565 then 6 else 1) - else if c <= 11623 then 6 else 1) - else - if c <= 11679 - then - (if c <= 11647 - then (if c <= 11631 then 6 else 1) - else if c <= 11670 then 6 else 1) - else - if c <= 11687 - then (if c <= 11686 then 6 else 1) - else if c <= 11694 then 6 else 1) - else - if c <= 11727 - then - (if c <= 11711 - then - (if c <= 11703 - then (if c <= 11702 then 6 else 1) - else if c <= 11710 then 6 else 1) - else - if c <= 11719 - then (if c <= 11718 then 6 else 1) - else if c <= 11726 then 6 else 1) - else - if c <= 12287 - then - (if c <= 11735 - then (if c <= 11734 then 6 else 1) - else if c <= 11742 then 6 else 1) - else - if c <= 12292 - then (if c <= 12288 then 2 else 1) - else 6) - else - if c <= 12442 - then - (if c <= 12343 - then - (if c <= 12320 - then (if c <= 12295 then 6 else 1) - else - if c <= 12336 - then (if c <= 12329 then 6 else 1) - else if c <= 12341 then 6 else 1) - else - if c <= 12348 - then 6 - else - if c <= 12352 - then 1 - else if c <= 12438 then 6 else 1) - else - if c <= 12539 - then - (if c <= 12447 - then 6 - else - if c <= 12448 - then 1 - else if c <= 12538 then 6 else 1) - else - if c <= 12548 - then (if c <= 12543 then 6 else 1) - else - if c <= 12592 - then (if c <= 12591 then 6 else 1) - else if c <= 12686 then 6 else 1) - else - if c <= 42999 - then - (if c <= 42653 - then - (if c <= 42239 - then - (if c <= 40981 - then - (if c <= 13311 - then - (if c <= 12783 - then (if c <= 12735 then 6 else 1) - else if c <= 12799 then 6 else 1) - else - if c <= 19967 - then (if c <= 19903 then 6 else 1) - else 6) - else - if c <= 42191 - then (if c <= 42124 then 6 else 1) - else if c <= 42237 then 6 else 1) - else - if c <= 42559 - then - (if c <= 42511 - then (if c <= 42508 then 6 else 1) - else - if c <= 42537 - then (if c <= 42527 then 6 else 1) - else if c <= 42539 then 6 else 1) - else - if c <= 42622 - then (if c <= 42606 then 6 else 1) - else 6) - else - if c <= 42890 - then - (if c <= 42785 - then - (if c <= 42735 - then (if c <= 42655 then 1 else 6) - else - if c <= 42774 - then 1 - else if c <= 42783 then 6 else 1) - else - if c <= 42887 - then 6 - else if c <= 42888 then 6 else 1) - else - if c <= 42962 - then - (if c <= 42954 - then 6 - else - if c <= 42959 - then 1 - else if c <= 42961 then 6 else 1) - else - if c <= 42993 - then - (if c <= 42964 - then (if c <= 42963 then 6 else 1) - else if c <= 42969 then 6 else 1) - else 6) - else - if c <= 43470 - then - (if c <= 43137 - then - (if c <= 43010 - then - (if c <= 43002 - then 6 - else if c <= 43009 then 6 else 1) - else - if c <= 43019 - then - (if c <= 43014 - then (if c <= 43013 then 6 else 1) - else if c <= 43018 then 6 else 1) - else - if c <= 43071 - then (if c <= 43042 then 6 else 1) - else if c <= 43123 then 6 else 1) - else - if c <= 43273 - then - (if c <= 43258 - then - (if c <= 43249 - then (if c <= 43187 then 6 else 1) - else if c <= 43255 then 6 else 1) - else - if c <= 43260 - then (if c <= 43259 then 6 else 1) - else if c <= 43262 then 6 else 1) - else - if c <= 43359 - then - (if c <= 43311 - then (if c <= 43301 then 6 else 1) - else if c <= 43334 then 6 else 1) - else - if c <= 43395 - then (if c <= 43388 then 6 else 1) - else if c <= 43442 then 6 else 1) - else - if c <= 43615 - then - (if c <= 43513 - then - (if c <= 43493 - then - (if c <= 43487 - then (if c <= 43471 then 6 else 1) - else if c <= 43492 then 6 else 1) - else if c <= 43503 then 6 else 1) - else - if c <= 43583 - then - (if c <= 43519 - then (if c <= 43518 then 6 else 1) - else if c <= 43560 then 6 else 1) - else - if c <= 43587 - then (if c <= 43586 then 6 else 1) - else if c <= 43595 then 6 else 1) - else - if c <= 43645 - then - (if c <= 43638 - then 6 - else - if c <= 43641 - then 1 - else if c <= 43642 then 6 else 1) - else - if c <= 43700 - then - (if c <= 43696 - then (if c <= 43695 then 6 else 1) - else if c <= 43697 then 6 else 1) - else - if c <= 43704 - then (if c <= 43702 then 6 else 1) - else if c <= 43709 then 6 else 1) - else - if c <= 66377 - then - (if c <= 64325 - then - (if c <= 43887 - then - (if c <= 43784 - then - (if c <= 43743 - then - (if c <= 43738 - then - (if c <= 43713 - then (if c <= 43712 then 6 else 1) - else if c <= 43714 then 6 else 1) - else if c <= 43741 then 6 else 1) - else - if c <= 43764 - then - (if c <= 43761 - then (if c <= 43754 then 6 else 1) - else 6) - else - if c <= 43776 - then 1 - else if c <= 43782 then 6 else 1) - else - if c <= 43823 - then - (if c <= 43807 - then - (if c <= 43792 - then (if c <= 43790 then 6 else 1) - else if c <= 43798 then 6 else 1) - else - if c <= 43815 - then (if c <= 43814 then 6 else 1) - else if c <= 43822 then 6 else 1) - else - if c <= 43880 - then - (if c <= 43867 - then (if c <= 43866 then 6 else 1) - else 6) - else if c <= 43881 then 6 else 1) - else - if c <= 64274 - then - (if c <= 55242 - then - (if c <= 44031 - then (if c <= 44002 then 6 else 1) - else - if c <= 55215 - then (if c <= 55203 then 6 else 1) - else if c <= 55238 then 6 else 1) - else - if c <= 64111 - then - (if c <= 63743 - then (if c <= 55291 then 6 else 1) - else if c <= 64109 then 6 else 1) - else - if c <= 64255 - then (if c <= 64217 then 6 else 1) - else if c <= 64262 then 6 else 1) - else - if c <= 64311 - then - (if c <= 64286 - then - (if c <= 64284 - then (if c <= 64279 then 6 else 1) - else if c <= 64285 then 6 else 1) - else - if c <= 64297 - then (if c <= 64296 then 6 else 1) - else if c <= 64310 then 6 else 1) - else - if c <= 64319 - then - (if c <= 64317 - then (if c <= 64316 then 6 else 1) - else if c <= 64318 then 6 else 1) - else - if c <= 64322 - then (if c <= 64321 then 6 else 1) - else if c <= 64324 then 6 else 1) - else - if c <= 65481 - then - (if c <= 65312 - then - (if c <= 65007 - then - (if c <= 64847 - then - (if c <= 64466 - then (if c <= 64433 then 6 else 1) - else if c <= 64829 then 6 else 1) - else - if c <= 64913 - then (if c <= 64911 then 6 else 1) - else if c <= 64967 then 6 else 1) - else - if c <= 65141 - then - (if c <= 65135 - then (if c <= 65019 then 6 else 1) - else if c <= 65140 then 6 else 1) - else - if c <= 65278 - then (if c <= 65276 then 6 else 1) - else if c <= 65279 then 2 else 1) - else - if c <= 65437 - then - (if c <= 65381 - then - (if c <= 65344 - then (if c <= 65338 then 6 else 1) - else if c <= 65370 then 6 else 1) - else 6) - else - if c <= 65470 - then 6 - else - if c <= 65473 - then 1 - else if c <= 65479 then 6 else 1) - else - if c <= 65615 - then - (if c <= 65548 - then - (if c <= 65497 - then - (if c <= 65489 - then (if c <= 65487 then 6 else 1) - else if c <= 65495 then 6 else 1) - else - if c <= 65535 - then (if c <= 65500 then 6 else 1) - else if c <= 65547 then 6 else 1) - else - if c <= 65595 - then - (if c <= 65575 - then (if c <= 65574 then 6 else 1) - else if c <= 65594 then 6 else 1) - else - if c <= 65598 - then (if c <= 65597 then 6 else 1) - else if c <= 65613 then 6 else 1) - else - if c <= 66207 - then - (if c <= 65855 - then - (if c <= 65663 - then (if c <= 65629 then 6 else 1) - else if c <= 65786 then 6 else 1) - else - if c <= 66175 - then (if c <= 65908 then 6 else 1) - else if c <= 66204 then 6 else 1) - else - if c <= 66348 - then - (if c <= 66303 - then (if c <= 66256 then 6 else 1) - else if c <= 66335 then 6 else 1) - else 6) - else - if c <= 67646 - then - (if c <= 66963 - then - (if c <= 66717 - then - (if c <= 66463 - then - (if c <= 66383 - then (if c <= 66378 then 6 else 1) - else - if c <= 66431 - then (if c <= 66421 then 6 else 1) - else if c <= 66461 then 6 else 1) - else - if c <= 66512 - then - (if c <= 66503 - then (if c <= 66499 then 6 else 1) - else if c <= 66511 then 6 else 1) - else - if c <= 66559 - then (if c <= 66517 then 6 else 1) - else 6) - else - if c <= 66863 - then - (if c <= 66775 - then - (if c <= 66735 - then 1 - else if c <= 66771 then 6 else 1) - else - if c <= 66815 - then (if c <= 66811 then 6 else 1) - else if c <= 66855 then 6 else 1) - else - if c <= 66939 - then - (if c <= 66927 - then (if c <= 66915 then 6 else 1) - else if c <= 66938 then 6 else 1) - else - if c <= 66955 - then (if c <= 66954 then 6 else 1) - else if c <= 66962 then 6 else 1) - else - if c <= 67455 - then - (if c <= 67002 - then - (if c <= 66978 - then - (if c <= 66966 - then (if c <= 66965 then 6 else 1) - else if c <= 66977 then 6 else 1) - else - if c <= 66994 - then (if c <= 66993 then 6 else 1) - else if c <= 67001 then 6 else 1) - else - if c <= 67391 - then - (if c <= 67071 - then (if c <= 67004 then 6 else 1) - else if c <= 67382 then 6 else 1) - else - if c <= 67423 - then (if c <= 67413 then 6 else 1) - else if c <= 67431 then 6 else 1) - else - if c <= 67591 - then - (if c <= 67505 - then - (if c <= 67462 - then (if c <= 67461 then 6 else 1) - else if c <= 67504 then 6 else 1) - else - if c <= 67583 - then (if c <= 67514 then 6 else 1) - else if c <= 67589 then 6 else 1) - else - if c <= 67638 - then - (if c <= 67593 - then (if c <= 67592 then 6 else 1) - else if c <= 67637 then 6 else 1) - else - if c <= 67643 - then (if c <= 67640 then 6 else 1) - else if c <= 67644 then 6 else 1) - else - if c <= 68296 - then - (if c <= 68029 - then - (if c <= 67827 - then - (if c <= 67711 - then - (if c <= 67679 - then (if c <= 67669 then 6 else 1) - else if c <= 67702 then 6 else 1) - else - if c <= 67807 - then (if c <= 67742 then 6 else 1) - else if c <= 67826 then 6 else 1) - else - if c <= 67871 - then - (if c <= 67839 - then (if c <= 67829 then 6 else 1) - else if c <= 67861 then 6 else 1) - else - if c <= 67967 - then (if c <= 67897 then 6 else 1) - else if c <= 68023 then 6 else 1) - else - if c <= 68120 - then - (if c <= 68111 - then - (if c <= 68095 - then (if c <= 68031 then 6 else 1) - else if c <= 68096 then 6 else 1) - else - if c <= 68116 - then (if c <= 68115 then 6 else 1) - else if c <= 68119 then 6 else 1) - else - if c <= 68223 - then - (if c <= 68191 - then (if c <= 68149 then 6 else 1) - else if c <= 68220 then 6 else 1) - else - if c <= 68287 - then (if c <= 68252 then 6 else 1) - else if c <= 68295 then 6 else 1) - else - if c <= 68863 - then - (if c <= 68479 - then - (if c <= 68415 - then - (if c <= 68351 - then (if c <= 68324 then 6 else 1) - else if c <= 68405 then 6 else 1) - else - if c <= 68447 - then (if c <= 68437 then 6 else 1) - else if c <= 68466 then 6 else 1) - else - if c <= 68735 - then - (if c <= 68607 - then (if c <= 68497 then 6 else 1) - else if c <= 68680 then 6 else 1) - else - if c <= 68799 - then (if c <= 68786 then 6 else 1) - else if c <= 68850 then 6 else 1) - else - if c <= 69414 - then - (if c <= 69295 - then - (if c <= 69247 - then (if c <= 68899 then 6 else 1) - else if c <= 69289 then 6 else 1) - else - if c <= 69375 - then (if c <= 69297 then 6 else 1) - else if c <= 69404 then 6 else 1) - else - if c <= 69487 - then - (if c <= 69423 - then (if c <= 69415 then 6 else 1) - else if c <= 69445 then 6 else 1) - else - if c <= 69551 - then (if c <= 69505 then 6 else 1) - else if c <= 69572 then 6 else 1) - else - if c <= 120122 - then - (if c <= 72348 - then - (if c <= 70655 - then - (if c <= 70162 - then - (if c <= 69958 - then - (if c <= 69762 - then - (if c <= 69744 - then - (if c <= 69634 - then (if c <= 69622 then 6 else 1) - else if c <= 69687 then 6 else 1) - else - if c <= 69748 - then (if c <= 69746 then 6 else 1) - else if c <= 69749 then 6 else 1) - else - if c <= 69890 - then - (if c <= 69839 - then (if c <= 69807 then 6 else 1) - else if c <= 69864 then 6 else 1) - else - if c <= 69955 - then (if c <= 69926 then 6 else 1) - else if c <= 69956 then 6 else 1) - else - if c <= 70080 - then - (if c <= 70005 - then - (if c <= 69967 - then (if c <= 69959 then 6 else 1) - else if c <= 70002 then 6 else 1) - else - if c <= 70018 - then (if c <= 70006 then 6 else 1) - else if c <= 70066 then 6 else 1) - else - if c <= 70107 - then - (if c <= 70105 - then (if c <= 70084 then 6 else 1) - else if c <= 70106 then 6 else 1) - else - if c <= 70143 - then (if c <= 70108 then 6 else 1) - else if c <= 70161 then 6 else 1) - else - if c <= 70414 - then - (if c <= 70286 - then - (if c <= 70279 - then - (if c <= 70271 - then (if c <= 70187 then 6 else 1) - else if c <= 70278 then 6 else 1) - else - if c <= 70281 - then (if c <= 70280 then 6 else 1) - else if c <= 70285 then 6 else 1) - else - if c <= 70319 - then - (if c <= 70302 - then (if c <= 70301 then 6 else 1) - else if c <= 70312 then 6 else 1) - else - if c <= 70404 - then (if c <= 70366 then 6 else 1) - else if c <= 70412 then 6 else 1) - else - if c <= 70452 - then - (if c <= 70441 - then - (if c <= 70418 - then (if c <= 70416 then 6 else 1) - else if c <= 70440 then 6 else 1) - else - if c <= 70449 - then (if c <= 70448 then 6 else 1) - else if c <= 70451 then 6 else 1) - else - if c <= 70479 - then - (if c <= 70460 - then (if c <= 70457 then 6 else 1) - else if c <= 70461 then 6 else 1) - else - if c <= 70492 - then (if c <= 70480 then 6 else 1) - else if c <= 70497 then 6 else 1) - else - if c <= 71934 - then - (if c <= 71167 - then - (if c <= 70851 - then - (if c <= 70750 - then - (if c <= 70726 - then (if c <= 70708 then 6 else 1) - else if c <= 70730 then 6 else 1) - else - if c <= 70783 - then (if c <= 70753 then 6 else 1) - else if c <= 70831 then 6 else 1) - else - if c <= 71039 - then - (if c <= 70854 - then (if c <= 70853 then 6 else 1) - else if c <= 70855 then 6 else 1) - else - if c <= 71127 - then (if c <= 71086 then 6 else 1) - else if c <= 71131 then 6 else 1) - else - if c <= 71423 - then - (if c <= 71295 - then - (if c <= 71235 - then (if c <= 71215 then 6 else 1) - else if c <= 71236 then 6 else 1) - else - if c <= 71351 - then (if c <= 71338 then 6 else 1) - else if c <= 71352 then 6 else 1) - else - if c <= 71679 - then - (if c <= 71487 - then (if c <= 71450 then 6 else 1) - else if c <= 71494 then 6 else 1) - else - if c <= 71839 - then (if c <= 71723 then 6 else 1) - else if c <= 71903 then 6 else 1) - else - if c <= 72105 - then - (if c <= 71959 - then - (if c <= 71947 - then - (if c <= 71944 - then (if c <= 71942 then 6 else 1) - else if c <= 71945 then 6 else 1) - else - if c <= 71956 - then (if c <= 71955 then 6 else 1) - else if c <= 71958 then 6 else 1) - else - if c <= 72000 - then - (if c <= 71998 - then (if c <= 71983 then 6 else 1) - else if c <= 71999 then 6 else 1) - else - if c <= 72095 - then (if c <= 72001 then 6 else 1) - else if c <= 72103 then 6 else 1) - else - if c <= 72202 - then - (if c <= 72162 - then - (if c <= 72160 - then (if c <= 72144 then 6 else 1) - else if c <= 72161 then 6 else 1) - else - if c <= 72191 - then (if c <= 72163 then 6 else 1) - else if c <= 72192 then 6 else 1) - else - if c <= 72271 - then - (if c <= 72249 - then (if c <= 72242 then 6 else 1) - else if c <= 72250 then 6 else 1) - else - if c <= 72283 - then (if c <= 72272 then 6 else 1) - else if c <= 72329 then 6 else 1) - else - if c <= 94031 - then - (if c <= 73727 - then - (if c <= 72970 - then - (if c <= 72767 - then - (if c <= 72703 - then - (if c <= 72367 - then (if c <= 72349 then 6 else 1) - else if c <= 72440 then 6 else 1) - else - if c <= 72713 - then (if c <= 72712 then 6 else 1) - else if c <= 72750 then 6 else 1) - else - if c <= 72959 - then - (if c <= 72817 - then (if c <= 72768 then 6 else 1) - else if c <= 72847 then 6 else 1) - else - if c <= 72967 - then (if c <= 72966 then 6 else 1) - else if c <= 72969 then 6 else 1) - else - if c <= 73065 - then - (if c <= 73055 - then - (if c <= 73029 - then (if c <= 73008 then 6 else 1) - else if c <= 73030 then 6 else 1) - else - if c <= 73062 - then (if c <= 73061 then 6 else 1) - else if c <= 73064 then 6 else 1) - else - if c <= 73439 - then - (if c <= 73111 - then (if c <= 73097 then 6 else 1) - else if c <= 73112 then 6 else 1) - else - if c <= 73647 - then (if c <= 73458 then 6 else 1) - else if c <= 73648 then 6 else 1) - else - if c <= 92783 - then - (if c <= 77823 - then - (if c <= 74879 - then - (if c <= 74751 - then (if c <= 74649 then 6 else 1) - else if c <= 74862 then 6 else 1) - else - if c <= 77711 - then (if c <= 75075 then 6 else 1) - else if c <= 77808 then 6 else 1) - else - if c <= 92159 - then - (if c <= 82943 - then (if c <= 78894 then 6 else 1) - else if c <= 83526 then 6 else 1) - else - if c <= 92735 - then (if c <= 92728 then 6 else 1) - else if c <= 92766 then 6 else 1) - else - if c <= 93026 - then - (if c <= 92927 - then - (if c <= 92879 - then (if c <= 92862 then 6 else 1) - else if c <= 92909 then 6 else 1) - else - if c <= 92991 - then (if c <= 92975 then 6 else 1) - else if c <= 92995 then 6 else 1) - else - if c <= 93759 - then - (if c <= 93052 - then (if c <= 93047 then 6 else 1) - else if c <= 93071 then 6 else 1) - else - if c <= 93951 - then (if c <= 93823 then 6 else 1) - else if c <= 94026 then 6 else 1) - else - if c <= 113791 - then - (if c <= 110580 - then - (if c <= 94207 - then - (if c <= 94175 - then - (if c <= 94098 - then (if c <= 94032 then 6 else 1) - else if c <= 94111 then 6 else 1) - else - if c <= 94178 - then (if c <= 94177 then 6 else 1) - else if c <= 94179 then 6 else 1) - else - if c <= 101631 - then - (if c <= 100351 - then (if c <= 100343 then 6 else 1) - else if c <= 101589 then 6 else 1) - else - if c <= 110575 - then (if c <= 101640 then 6 else 1) - else if c <= 110579 then 6 else 1) - else - if c <= 110947 - then - (if c <= 110591 - then - (if c <= 110588 - then (if c <= 110587 then 6 else 1) - else if c <= 110590 then 6 else 1) - else - if c <= 110927 - then (if c <= 110882 then 6 else 1) - else if c <= 110930 then 6 else 1) - else - if c <= 113663 - then - (if c <= 110959 - then (if c <= 110951 then 6 else 1) - else if c <= 111355 then 6 else 1) - else - if c <= 113775 - then (if c <= 113770 then 6 else 1) - else if c <= 113788 then 6 else 1) - else - if c <= 119981 - then - (if c <= 119965 - then - (if c <= 119807 - then - (if c <= 113807 - then (if c <= 113800 then 6 else 1) - else if c <= 113817 then 6 else 1) - else - if c <= 119893 - then (if c <= 119892 then 6 else 1) - else if c <= 119964 then 6 else 1) - else - if c <= 119972 - then - (if c <= 119969 - then (if c <= 119967 then 6 else 1) - else if c <= 119970 then 6 else 1) - else - if c <= 119976 - then (if c <= 119974 then 6 else 1) - else if c <= 119980 then 6 else 1) - else - if c <= 120070 - then - (if c <= 119996 - then - (if c <= 119994 - then (if c <= 119993 then 6 else 1) - else if c <= 119995 then 6 else 1) - else - if c <= 120004 - then (if c <= 120003 then 6 else 1) - else if c <= 120069 then 6 else 1) - else - if c <= 120085 - then - (if c <= 120076 - then (if c <= 120074 then 6 else 1) - else if c <= 120084 then 6 else 1) - else - if c <= 120093 - then (if c <= 120092 then 6 else 1) - else if c <= 120121 then 6 else 1) - else - if c <= 131071 - then - (if c <= 126468 - then - (if c <= 122623 - then - (if c <= 120571 - then - (if c <= 120145 - then - (if c <= 120133 - then - (if c <= 120127 - then (if c <= 120126 then 6 else 1) - else if c <= 120132 then 6 else 1) - else - if c <= 120137 - then (if c <= 120134 then 6 else 1) - else if c <= 120144 then 6 else 1) - else - if c <= 120513 - then - (if c <= 120487 - then (if c <= 120485 then 6 else 1) - else if c <= 120512 then 6 else 1) - else - if c <= 120539 - then (if c <= 120538 then 6 else 1) - else if c <= 120570 then 6 else 1) - else - if c <= 120687 - then - (if c <= 120629 - then - (if c <= 120597 - then (if c <= 120596 then 6 else 1) - else if c <= 120628 then 6 else 1) - else - if c <= 120655 - then (if c <= 120654 then 6 else 1) - else if c <= 120686 then 6 else 1) - else - if c <= 120745 - then - (if c <= 120713 - then (if c <= 120712 then 6 else 1) - else if c <= 120744 then 6 else 1) - else - if c <= 120771 - then (if c <= 120770 then 6 else 1) - else if c <= 120779 then 6 else 1) - else - if c <= 124895 - then - (if c <= 123190 - then - (if c <= 122654 - then 6 - else - if c <= 123135 - then 1 - else if c <= 123180 then 6 else 1) - else - if c <= 123535 - then - (if c <= 123213 - then (if c <= 123197 then 6 else 1) - else if c <= 123214 then 6 else 1) - else - if c <= 123583 - then (if c <= 123565 then 6 else 1) - else if c <= 123627 then 6 else 1) - else - if c <= 124927 - then - (if c <= 124908 - then - (if c <= 124903 - then (if c <= 124902 then 6 else 1) - else if c <= 124907 then 6 else 1) - else - if c <= 124911 - then (if c <= 124910 then 6 else 1) - else if c <= 124926 then 6 else 1) - else - if c <= 125258 - then - (if c <= 125183 - then (if c <= 125124 then 6 else 1) - else if c <= 125251 then 6 else 1) - else - if c <= 126463 - then (if c <= 125259 then 6 else 1) - else if c <= 126467 then 6 else 1) - else - if c <= 126552 - then - (if c <= 126529 - then - (if c <= 126504 - then - (if c <= 126499 - then - (if c <= 126496 - then (if c <= 126495 then 6 else 1) - else if c <= 126498 then 6 else 1) - else - if c <= 126502 - then (if c <= 126500 then 6 else 1) - else if c <= 126503 then 6 else 1) - else - if c <= 126520 - then - (if c <= 126515 - then (if c <= 126514 then 6 else 1) - else if c <= 126519 then 6 else 1) - else - if c <= 126522 - then (if c <= 126521 then 6 else 1) - else if c <= 126523 then 6 else 1) - else - if c <= 126540 - then - (if c <= 126536 - then - (if c <= 126534 - then (if c <= 126530 then 6 else 1) - else if c <= 126535 then 6 else 1) - else - if c <= 126538 - then (if c <= 126537 then 6 else 1) - else if c <= 126539 then 6 else 1) - else - if c <= 126547 - then - (if c <= 126544 - then (if c <= 126543 then 6 else 1) - else if c <= 126546 then 6 else 1) - else - if c <= 126550 - then (if c <= 126548 then 6 else 1) - else if c <= 126551 then 6 else 1) - else - if c <= 126579 - then - (if c <= 126560 - then - (if c <= 126556 - then - (if c <= 126554 - then (if c <= 126553 then 6 else 1) - else if c <= 126555 then 6 else 1) - else - if c <= 126558 - then (if c <= 126557 then 6 else 1) - else if c <= 126559 then 6 else 1) - else - if c <= 126566 - then - (if c <= 126563 - then (if c <= 126562 then 6 else 1) - else if c <= 126564 then 6 else 1) - else - if c <= 126571 - then (if c <= 126570 then 6 else 1) - else if c <= 126578 then 6 else 1) - else - if c <= 126602 - then - (if c <= 126589 - then - (if c <= 126584 - then (if c <= 126583 then 6 else 1) - else if c <= 126588 then 6 else 1) - else - if c <= 126591 - then (if c <= 126590 then 6 else 1) - else if c <= 126601 then 6 else 1) - else - if c <= 126628 - then - (if c <= 126624 - then (if c <= 126619 then 6 else 1) - else if c <= 126627 then 6 else 1) - else - if c <= 126634 - then (if c <= 126633 then 6 else 1) - else if c <= 126651 then 6 else 1) - else - if c <= 183983 - then - (if c <= 177983 - then - (if c <= 173823 - then (if c <= 173791 then 6 else 1) - else if c <= 177976 then 6 else 1) - else - if c <= 178207 - then (if c <= 178205 then 6 else 1) - else if c <= 183969 then 6 else 1) - else if c <= 191456 then 6 else 1) - else (-1) -let __sedlex_partition_78 c = - if c <= 35 - then (-1) - else - if c <= 122 - then (Char.code (String.unsafe_get __sedlex_table_75 (c - 36))) - 1 - else (-1) -let __sedlex_partition_119 c = - if c <= (-1) - then (-1) - else - if c <= 8191 - then (Char.code (String.unsafe_get __sedlex_table_76 c)) - 1 - else - if c <= 12287 - then - (if c <= 8238 - then - (if c <= 8231 - then (if c <= 8202 then 1 else 0) - else if c <= 8233 then 2 else 0) - else - if c <= 8286 - then (if c <= 8239 then 1 else 0) - else if c <= 8287 then 1 else 0) - else - if c <= 65278 - then (if c <= 12288 then 1 else 0) - else if c <= 65279 then 1 else 0 -let __sedlex_partition_69 c = - if c <= 118 then (-1) else if c <= 119 then 0 else (-1) -let __sedlex_partition_85 c = - if c <= 35 - then (-1) - else - if c <= 122 - then (Char.code (String.unsafe_get __sedlex_table_77 (c - 36))) - 1 - else (-1) -let __sedlex_partition_100 c = - if c <= 93 - then (Char.code (String.unsafe_get __sedlex_table_78 (c - (-1)))) - 1 - else if c <= 8233 then (if c <= 8231 then 1 else 2) else 1 -let __sedlex_partition_118 c = - if c <= 123 - then (Char.code (String.unsafe_get __sedlex_table_79 (c - (-1)))) - 1 - else if c <= 8233 then (if c <= 8231 then 1 else 2) else 1 -let __sedlex_partition_32 c = - if c <= 47 - then (-1) - else - if c <= 57 - then (Char.code (String.unsafe_get __sedlex_table_80 (c - 48))) - 1 - else (-1) -let __sedlex_partition_38 c = - if c <= 47 - then (-1) - else - if c <= 101 - then (Char.code (String.unsafe_get __sedlex_table_81 (c - 48))) - 1 - else (-1) -let __sedlex_partition_39 c = - if c <= 42 - then (-1) - else - if c <= 57 - then (Char.code (String.unsafe_get __sedlex_table_82 (c - 43))) - 1 - else (-1) -let __sedlex_partition_109 c = - if c <= 125 - then (Char.code (String.unsafe_get __sedlex_table_83 (c - (-1)))) - 1 - else if c <= 8233 then (if c <= 8231 then 1 else 2) else 1 -let __sedlex_partition_1 c = - if c <= 122 - then (Char.code (String.unsafe_get __sedlex_table_84 (c - (-1)))) - 1 - else 1 -let __sedlex_partition_6 c = - if c <= 122 - then (Char.code (String.unsafe_get __sedlex_table_85 (c - (-1)))) - 1 - else 1 -let __sedlex_partition_12 c = - if c <= 44 - then (-1) - else - if c <= 47 - then (Char.code (String.unsafe_get __sedlex_table_86 (c - 45))) - 1 - else (-1) -let __sedlex_partition_114 c = - if c <= 47 - then (-1) - else - if c <= 102 - then (Char.code (String.unsafe_get __sedlex_table_87 (c - 48))) - 1 - else (-1) -let __sedlex_partition_49 c = - if c <= 62 then (-1) else if c <= 63 then 0 else (-1) -let __sedlex_partition_48 c = - if c <= 45 - then (-1) - else - if c <= 95 - then (Char.code (String.unsafe_get __sedlex_table_88 (c - 46))) - 1 - else (-1) -let __sedlex_partition_2 c = - if c <= 116 then (-1) else if c <= 117 then 0 else (-1) -let __sedlex_partition_13 c = - if c <= 46 then (-1) else if c <= 47 then 0 else (-1) -let __sedlex_partition_66 c = - if c <= 57 then (-1) else if c <= 58 then 0 else (-1) -let __sedlex_partition_60 c = - if c <= 35 - then (-1) - else - if c <= 122 - then (Char.code (String.unsafe_get __sedlex_table_89 (c - 36))) - 1 - else (-1) -let __sedlex_partition_111 c = - if c <= 34 - then (-1) - else - if c <= 122 - then (Char.code (String.unsafe_get __sedlex_table_90 (c - 35))) - 1 - else (-1) -let __sedlex_partition_117 c = - if c <= 8191 - then (Char.code (String.unsafe_get __sedlex_table_91 (c - (-1)))) - 1 - else - if c <= 194559 - then - (if c <= 69599 - then - (if c <= 43711 - then - (if c <= 12703 - then - (if c <= 11519 - then - (if c <= 8489 - then - (if c <= 8454 - then - (if c <= 8304 - then - (if c <= 8238 - then - (if c <= 8231 - then (if c <= 8202 then 2 else 1) - else if c <= 8233 then 3 else 1) - else - if c <= 8286 - then (if c <= 8239 then 2 else 1) - else if c <= 8287 then 2 else 1) - else - if c <= 8335 - then - (if c <= 8318 - then (if c <= 8305 then 6 else 1) - else if c <= 8319 then 6 else 1) - else - if c <= 8449 - then (if c <= 8348 then 6 else 1) - else if c <= 8450 then 6 else 1) - else - if c <= 8477 - then - (if c <= 8468 - then - (if c <= 8457 - then (if c <= 8455 then 6 else 1) - else if c <= 8467 then 6 else 1) - else - if c <= 8471 - then (if c <= 8469 then 6 else 1) - else 6) - else - if c <= 8485 - then - (if c <= 8483 - then 1 - else if c <= 8484 then 6 else 1) - else - if c <= 8487 - then (if c <= 8486 then 6 else 1) - else if c <= 8488 then 6 else 1) - else - if c <= 8543 - then - (if c <= 8505 - then 6 - else - if c <= 8516 - then - (if c <= 8507 - then 1 - else if c <= 8511 then 6 else 1) - else - if c <= 8525 - then (if c <= 8521 then 6 else 1) - else if c <= 8526 then 6 else 1) - else - if c <= 11389 - then - (if c <= 8584 - then 6 - else if c <= 11263 then 1 else 6) - else - if c <= 11498 - then (if c <= 11492 then 6 else 1) - else - if c <= 11505 - then (if c <= 11502 then 6 else 1) - else if c <= 11507 then 6 else 1) - else - if c <= 12294 - then - (if c <= 11695 - then - (if c <= 11630 - then - (if c <= 11564 - then - (if c <= 11558 - then (if c <= 11557 then 6 else 1) - else if c <= 11559 then 6 else 1) - else - if c <= 11567 - then (if c <= 11565 then 6 else 1) - else if c <= 11623 then 6 else 1) - else - if c <= 11679 - then - (if c <= 11647 - then (if c <= 11631 then 6 else 1) - else if c <= 11670 then 6 else 1) - else - if c <= 11687 - then (if c <= 11686 then 6 else 1) - else if c <= 11694 then 6 else 1) - else - if c <= 11727 - then - (if c <= 11711 - then - (if c <= 11703 - then (if c <= 11702 then 6 else 1) - else if c <= 11710 then 6 else 1) - else - if c <= 11719 - then (if c <= 11718 then 6 else 1) - else if c <= 11726 then 6 else 1) - else - if c <= 12287 - then - (if c <= 11735 - then (if c <= 11734 then 6 else 1) - else if c <= 11742 then 6 else 1) - else - if c <= 12292 - then (if c <= 12288 then 2 else 1) - else 6) - else - if c <= 12442 - then - (if c <= 12343 - then - (if c <= 12320 - then (if c <= 12295 then 6 else 1) - else - if c <= 12336 - then (if c <= 12329 then 6 else 1) - else if c <= 12341 then 6 else 1) - else - if c <= 12348 - then 6 - else - if c <= 12352 - then 1 - else if c <= 12438 then 6 else 1) - else - if c <= 12539 - then - (if c <= 12447 - then 6 - else - if c <= 12448 - then 1 - else if c <= 12538 then 6 else 1) - else - if c <= 12548 - then (if c <= 12543 then 6 else 1) - else - if c <= 12592 - then (if c <= 12591 then 6 else 1) - else if c <= 12686 then 6 else 1) - else - if c <= 42999 - then - (if c <= 42653 - then - (if c <= 42239 - then - (if c <= 40981 - then - (if c <= 13311 - then - (if c <= 12783 - then (if c <= 12735 then 6 else 1) - else if c <= 12799 then 6 else 1) - else - if c <= 19967 - then (if c <= 19903 then 6 else 1) - else 6) - else - if c <= 42191 - then (if c <= 42124 then 6 else 1) - else if c <= 42237 then 6 else 1) - else - if c <= 42559 - then - (if c <= 42511 - then (if c <= 42508 then 6 else 1) - else - if c <= 42537 - then (if c <= 42527 then 6 else 1) - else if c <= 42539 then 6 else 1) - else - if c <= 42622 - then (if c <= 42606 then 6 else 1) - else 6) - else - if c <= 42890 - then - (if c <= 42785 - then - (if c <= 42735 - then (if c <= 42655 then 1 else 6) - else - if c <= 42774 - then 1 - else if c <= 42783 then 6 else 1) - else - if c <= 42887 - then 6 - else if c <= 42888 then 6 else 1) - else - if c <= 42962 - then - (if c <= 42954 - then 6 - else - if c <= 42959 - then 1 - else if c <= 42961 then 6 else 1) - else - if c <= 42993 - then - (if c <= 42964 - then (if c <= 42963 then 6 else 1) - else if c <= 42969 then 6 else 1) - else 6) - else - if c <= 43470 - then - (if c <= 43137 - then - (if c <= 43010 - then - (if c <= 43002 - then 6 - else if c <= 43009 then 6 else 1) - else - if c <= 43019 - then - (if c <= 43014 - then (if c <= 43013 then 6 else 1) - else if c <= 43018 then 6 else 1) - else - if c <= 43071 - then (if c <= 43042 then 6 else 1) - else if c <= 43123 then 6 else 1) - else - if c <= 43273 - then - (if c <= 43258 - then - (if c <= 43249 - then (if c <= 43187 then 6 else 1) - else if c <= 43255 then 6 else 1) - else - if c <= 43260 - then (if c <= 43259 then 6 else 1) - else if c <= 43262 then 6 else 1) - else - if c <= 43359 - then - (if c <= 43311 - then (if c <= 43301 then 6 else 1) - else if c <= 43334 then 6 else 1) - else - if c <= 43395 - then (if c <= 43388 then 6 else 1) - else if c <= 43442 then 6 else 1) - else - if c <= 43615 - then - (if c <= 43513 - then - (if c <= 43493 - then - (if c <= 43487 - then (if c <= 43471 then 6 else 1) - else if c <= 43492 then 6 else 1) - else if c <= 43503 then 6 else 1) - else - if c <= 43583 - then - (if c <= 43519 - then (if c <= 43518 then 6 else 1) - else if c <= 43560 then 6 else 1) - else - if c <= 43587 - then (if c <= 43586 then 6 else 1) - else if c <= 43595 then 6 else 1) - else - if c <= 43645 - then - (if c <= 43638 - then 6 - else - if c <= 43641 - then 1 - else if c <= 43642 then 6 else 1) - else - if c <= 43700 - then - (if c <= 43696 - then (if c <= 43695 then 6 else 1) - else if c <= 43697 then 6 else 1) - else - if c <= 43704 - then (if c <= 43702 then 6 else 1) - else if c <= 43709 then 6 else 1) - else - if c <= 66377 - then - (if c <= 64325 - then - (if c <= 43887 - then - (if c <= 43784 - then - (if c <= 43743 - then - (if c <= 43738 - then - (if c <= 43713 - then (if c <= 43712 then 6 else 1) - else if c <= 43714 then 6 else 1) - else if c <= 43741 then 6 else 1) - else - if c <= 43764 - then - (if c <= 43761 - then (if c <= 43754 then 6 else 1) - else 6) - else - if c <= 43776 - then 1 - else if c <= 43782 then 6 else 1) - else - if c <= 43823 - then - (if c <= 43807 - then - (if c <= 43792 - then (if c <= 43790 then 6 else 1) - else if c <= 43798 then 6 else 1) - else - if c <= 43815 - then (if c <= 43814 then 6 else 1) - else if c <= 43822 then 6 else 1) - else - if c <= 43880 - then - (if c <= 43867 - then (if c <= 43866 then 6 else 1) - else 6) - else if c <= 43881 then 6 else 1) - else - if c <= 64274 - then - (if c <= 55242 - then - (if c <= 44031 - then (if c <= 44002 then 6 else 1) - else - if c <= 55215 - then (if c <= 55203 then 6 else 1) - else if c <= 55238 then 6 else 1) - else - if c <= 64111 - then - (if c <= 63743 - then (if c <= 55291 then 6 else 1) - else if c <= 64109 then 6 else 1) - else - if c <= 64255 - then (if c <= 64217 then 6 else 1) - else if c <= 64262 then 6 else 1) - else - if c <= 64311 - then - (if c <= 64286 - then - (if c <= 64284 - then (if c <= 64279 then 6 else 1) - else if c <= 64285 then 6 else 1) - else - if c <= 64297 - then (if c <= 64296 then 6 else 1) - else if c <= 64310 then 6 else 1) - else - if c <= 64319 - then - (if c <= 64317 - then (if c <= 64316 then 6 else 1) - else if c <= 64318 then 6 else 1) - else - if c <= 64322 - then (if c <= 64321 then 6 else 1) - else if c <= 64324 then 6 else 1) - else - if c <= 65481 - then - (if c <= 65312 - then - (if c <= 65007 - then - (if c <= 64847 - then - (if c <= 64466 - then (if c <= 64433 then 6 else 1) - else if c <= 64829 then 6 else 1) - else - if c <= 64913 - then (if c <= 64911 then 6 else 1) - else if c <= 64967 then 6 else 1) - else - if c <= 65141 - then - (if c <= 65135 - then (if c <= 65019 then 6 else 1) - else if c <= 65140 then 6 else 1) - else - if c <= 65278 - then (if c <= 65276 then 6 else 1) - else if c <= 65279 then 2 else 1) - else - if c <= 65437 - then - (if c <= 65381 - then - (if c <= 65344 - then (if c <= 65338 then 6 else 1) - else if c <= 65370 then 6 else 1) - else 6) - else - if c <= 65470 - then 6 - else - if c <= 65473 - then 1 - else if c <= 65479 then 6 else 1) - else - if c <= 65615 - then - (if c <= 65548 - then - (if c <= 65497 - then - (if c <= 65489 - then (if c <= 65487 then 6 else 1) - else if c <= 65495 then 6 else 1) - else - if c <= 65535 - then (if c <= 65500 then 6 else 1) - else if c <= 65547 then 6 else 1) - else - if c <= 65595 - then - (if c <= 65575 - then (if c <= 65574 then 6 else 1) - else if c <= 65594 then 6 else 1) - else - if c <= 65598 - then (if c <= 65597 then 6 else 1) - else if c <= 65613 then 6 else 1) - else - if c <= 66207 - then - (if c <= 65855 - then - (if c <= 65663 - then (if c <= 65629 then 6 else 1) - else if c <= 65786 then 6 else 1) - else - if c <= 66175 - then (if c <= 65908 then 6 else 1) - else if c <= 66204 then 6 else 1) - else - if c <= 66348 - then - (if c <= 66303 - then (if c <= 66256 then 6 else 1) - else if c <= 66335 then 6 else 1) - else 6) - else - if c <= 67646 - then - (if c <= 66963 - then - (if c <= 66717 - then - (if c <= 66463 - then - (if c <= 66383 - then (if c <= 66378 then 6 else 1) - else - if c <= 66431 - then (if c <= 66421 then 6 else 1) - else if c <= 66461 then 6 else 1) - else - if c <= 66512 - then - (if c <= 66503 - then (if c <= 66499 then 6 else 1) - else if c <= 66511 then 6 else 1) - else - if c <= 66559 - then (if c <= 66517 then 6 else 1) - else 6) - else - if c <= 66863 - then - (if c <= 66775 - then - (if c <= 66735 - then 1 - else if c <= 66771 then 6 else 1) - else - if c <= 66815 - then (if c <= 66811 then 6 else 1) - else if c <= 66855 then 6 else 1) - else - if c <= 66939 - then - (if c <= 66927 - then (if c <= 66915 then 6 else 1) - else if c <= 66938 then 6 else 1) - else - if c <= 66955 - then (if c <= 66954 then 6 else 1) - else if c <= 66962 then 6 else 1) - else - if c <= 67455 - then - (if c <= 67002 - then - (if c <= 66978 - then - (if c <= 66966 - then (if c <= 66965 then 6 else 1) - else if c <= 66977 then 6 else 1) - else - if c <= 66994 - then (if c <= 66993 then 6 else 1) - else if c <= 67001 then 6 else 1) - else - if c <= 67391 - then - (if c <= 67071 - then (if c <= 67004 then 6 else 1) - else if c <= 67382 then 6 else 1) - else - if c <= 67423 - then (if c <= 67413 then 6 else 1) - else if c <= 67431 then 6 else 1) - else - if c <= 67591 - then - (if c <= 67505 - then - (if c <= 67462 - then (if c <= 67461 then 6 else 1) - else if c <= 67504 then 6 else 1) - else - if c <= 67583 - then (if c <= 67514 then 6 else 1) - else if c <= 67589 then 6 else 1) - else - if c <= 67638 - then - (if c <= 67593 - then (if c <= 67592 then 6 else 1) - else if c <= 67637 then 6 else 1) - else - if c <= 67643 - then (if c <= 67640 then 6 else 1) - else if c <= 67644 then 6 else 1) - else - if c <= 68296 - then - (if c <= 68029 - then - (if c <= 67827 - then - (if c <= 67711 - then - (if c <= 67679 - then (if c <= 67669 then 6 else 1) - else if c <= 67702 then 6 else 1) - else - if c <= 67807 - then (if c <= 67742 then 6 else 1) - else if c <= 67826 then 6 else 1) - else - if c <= 67871 - then - (if c <= 67839 - then (if c <= 67829 then 6 else 1) - else if c <= 67861 then 6 else 1) - else - if c <= 67967 - then (if c <= 67897 then 6 else 1) - else if c <= 68023 then 6 else 1) - else - if c <= 68120 - then - (if c <= 68111 - then - (if c <= 68095 - then (if c <= 68031 then 6 else 1) - else if c <= 68096 then 6 else 1) - else - if c <= 68116 - then (if c <= 68115 then 6 else 1) - else if c <= 68119 then 6 else 1) - else - if c <= 68223 - then - (if c <= 68191 - then (if c <= 68149 then 6 else 1) - else if c <= 68220 then 6 else 1) - else - if c <= 68287 - then (if c <= 68252 then 6 else 1) - else if c <= 68295 then 6 else 1) - else - if c <= 68863 - then - (if c <= 68479 - then - (if c <= 68415 - then - (if c <= 68351 - then (if c <= 68324 then 6 else 1) - else if c <= 68405 then 6 else 1) - else - if c <= 68447 - then (if c <= 68437 then 6 else 1) - else if c <= 68466 then 6 else 1) - else - if c <= 68735 - then - (if c <= 68607 - then (if c <= 68497 then 6 else 1) - else if c <= 68680 then 6 else 1) - else - if c <= 68799 - then (if c <= 68786 then 6 else 1) - else if c <= 68850 then 6 else 1) - else - if c <= 69414 - then - (if c <= 69295 - then - (if c <= 69247 - then (if c <= 68899 then 6 else 1) - else if c <= 69289 then 6 else 1) - else - if c <= 69375 - then (if c <= 69297 then 6 else 1) - else if c <= 69404 then 6 else 1) - else - if c <= 69487 - then - (if c <= 69423 - then (if c <= 69415 then 6 else 1) - else if c <= 69445 then 6 else 1) - else - if c <= 69551 - then (if c <= 69505 then 6 else 1) - else if c <= 69572 then 6 else 1) - else - if c <= 120122 - then - (if c <= 72348 - then - (if c <= 70655 - then - (if c <= 70162 - then - (if c <= 69958 - then - (if c <= 69762 - then - (if c <= 69744 - then - (if c <= 69634 - then (if c <= 69622 then 6 else 1) - else if c <= 69687 then 6 else 1) - else - if c <= 69748 - then (if c <= 69746 then 6 else 1) - else if c <= 69749 then 6 else 1) - else - if c <= 69890 - then - (if c <= 69839 - then (if c <= 69807 then 6 else 1) - else if c <= 69864 then 6 else 1) - else - if c <= 69955 - then (if c <= 69926 then 6 else 1) - else if c <= 69956 then 6 else 1) - else - if c <= 70080 - then - (if c <= 70005 - then - (if c <= 69967 - then (if c <= 69959 then 6 else 1) - else if c <= 70002 then 6 else 1) - else - if c <= 70018 - then (if c <= 70006 then 6 else 1) - else if c <= 70066 then 6 else 1) - else - if c <= 70107 - then - (if c <= 70105 - then (if c <= 70084 then 6 else 1) - else if c <= 70106 then 6 else 1) - else - if c <= 70143 - then (if c <= 70108 then 6 else 1) - else if c <= 70161 then 6 else 1) - else - if c <= 70414 - then - (if c <= 70286 - then - (if c <= 70279 - then - (if c <= 70271 - then (if c <= 70187 then 6 else 1) - else if c <= 70278 then 6 else 1) - else - if c <= 70281 - then (if c <= 70280 then 6 else 1) - else if c <= 70285 then 6 else 1) - else - if c <= 70319 - then - (if c <= 70302 - then (if c <= 70301 then 6 else 1) - else if c <= 70312 then 6 else 1) - else - if c <= 70404 - then (if c <= 70366 then 6 else 1) - else if c <= 70412 then 6 else 1) - else - if c <= 70452 - then - (if c <= 70441 - then - (if c <= 70418 - then (if c <= 70416 then 6 else 1) - else if c <= 70440 then 6 else 1) - else - if c <= 70449 - then (if c <= 70448 then 6 else 1) - else if c <= 70451 then 6 else 1) - else - if c <= 70479 - then - (if c <= 70460 - then (if c <= 70457 then 6 else 1) - else if c <= 70461 then 6 else 1) - else - if c <= 70492 - then (if c <= 70480 then 6 else 1) - else if c <= 70497 then 6 else 1) - else - if c <= 71934 - then - (if c <= 71167 - then - (if c <= 70851 - then - (if c <= 70750 - then - (if c <= 70726 - then (if c <= 70708 then 6 else 1) - else if c <= 70730 then 6 else 1) - else - if c <= 70783 - then (if c <= 70753 then 6 else 1) - else if c <= 70831 then 6 else 1) - else - if c <= 71039 - then - (if c <= 70854 - then (if c <= 70853 then 6 else 1) - else if c <= 70855 then 6 else 1) - else - if c <= 71127 - then (if c <= 71086 then 6 else 1) - else if c <= 71131 then 6 else 1) - else - if c <= 71423 - then - (if c <= 71295 - then - (if c <= 71235 - then (if c <= 71215 then 6 else 1) - else if c <= 71236 then 6 else 1) - else - if c <= 71351 - then (if c <= 71338 then 6 else 1) - else if c <= 71352 then 6 else 1) - else - if c <= 71679 - then - (if c <= 71487 - then (if c <= 71450 then 6 else 1) - else if c <= 71494 then 6 else 1) - else - if c <= 71839 - then (if c <= 71723 then 6 else 1) - else if c <= 71903 then 6 else 1) - else - if c <= 72105 - then - (if c <= 71959 - then - (if c <= 71947 - then - (if c <= 71944 - then (if c <= 71942 then 6 else 1) - else if c <= 71945 then 6 else 1) - else - if c <= 71956 - then (if c <= 71955 then 6 else 1) - else if c <= 71958 then 6 else 1) - else - if c <= 72000 - then - (if c <= 71998 - then (if c <= 71983 then 6 else 1) - else if c <= 71999 then 6 else 1) - else - if c <= 72095 - then (if c <= 72001 then 6 else 1) - else if c <= 72103 then 6 else 1) - else - if c <= 72202 - then - (if c <= 72162 - then - (if c <= 72160 - then (if c <= 72144 then 6 else 1) - else if c <= 72161 then 6 else 1) - else - if c <= 72191 - then (if c <= 72163 then 6 else 1) - else if c <= 72192 then 6 else 1) - else - if c <= 72271 - then - (if c <= 72249 - then (if c <= 72242 then 6 else 1) - else if c <= 72250 then 6 else 1) - else - if c <= 72283 - then (if c <= 72272 then 6 else 1) - else if c <= 72329 then 6 else 1) - else - if c <= 94031 - then - (if c <= 73727 - then - (if c <= 72970 - then - (if c <= 72767 - then - (if c <= 72703 - then - (if c <= 72367 - then (if c <= 72349 then 6 else 1) - else if c <= 72440 then 6 else 1) - else - if c <= 72713 - then (if c <= 72712 then 6 else 1) - else if c <= 72750 then 6 else 1) - else - if c <= 72959 - then - (if c <= 72817 - then (if c <= 72768 then 6 else 1) - else if c <= 72847 then 6 else 1) - else - if c <= 72967 - then (if c <= 72966 then 6 else 1) - else if c <= 72969 then 6 else 1) - else - if c <= 73065 - then - (if c <= 73055 - then - (if c <= 73029 - then (if c <= 73008 then 6 else 1) - else if c <= 73030 then 6 else 1) - else - if c <= 73062 - then (if c <= 73061 then 6 else 1) - else if c <= 73064 then 6 else 1) - else - if c <= 73439 - then - (if c <= 73111 - then (if c <= 73097 then 6 else 1) - else if c <= 73112 then 6 else 1) - else - if c <= 73647 - then (if c <= 73458 then 6 else 1) - else if c <= 73648 then 6 else 1) - else - if c <= 92783 - then - (if c <= 77823 - then - (if c <= 74879 - then - (if c <= 74751 - then (if c <= 74649 then 6 else 1) - else if c <= 74862 then 6 else 1) - else - if c <= 77711 - then (if c <= 75075 then 6 else 1) - else if c <= 77808 then 6 else 1) - else - if c <= 92159 - then - (if c <= 82943 - then (if c <= 78894 then 6 else 1) - else if c <= 83526 then 6 else 1) - else - if c <= 92735 - then (if c <= 92728 then 6 else 1) - else if c <= 92766 then 6 else 1) - else - if c <= 93026 - then - (if c <= 92927 - then - (if c <= 92879 - then (if c <= 92862 then 6 else 1) - else if c <= 92909 then 6 else 1) - else - if c <= 92991 - then (if c <= 92975 then 6 else 1) - else if c <= 92995 then 6 else 1) - else - if c <= 93759 - then - (if c <= 93052 - then (if c <= 93047 then 6 else 1) - else if c <= 93071 then 6 else 1) - else - if c <= 93951 - then (if c <= 93823 then 6 else 1) - else if c <= 94026 then 6 else 1) - else - if c <= 113791 - then - (if c <= 110580 - then - (if c <= 94207 - then - (if c <= 94175 - then - (if c <= 94098 - then (if c <= 94032 then 6 else 1) - else if c <= 94111 then 6 else 1) - else - if c <= 94178 - then (if c <= 94177 then 6 else 1) - else if c <= 94179 then 6 else 1) - else - if c <= 101631 - then - (if c <= 100351 - then (if c <= 100343 then 6 else 1) - else if c <= 101589 then 6 else 1) - else - if c <= 110575 - then (if c <= 101640 then 6 else 1) - else if c <= 110579 then 6 else 1) - else - if c <= 110947 - then - (if c <= 110591 - then - (if c <= 110588 - then (if c <= 110587 then 6 else 1) - else if c <= 110590 then 6 else 1) - else - if c <= 110927 - then (if c <= 110882 then 6 else 1) - else if c <= 110930 then 6 else 1) - else - if c <= 113663 - then - (if c <= 110959 - then (if c <= 110951 then 6 else 1) - else if c <= 111355 then 6 else 1) - else - if c <= 113775 - then (if c <= 113770 then 6 else 1) - else if c <= 113788 then 6 else 1) - else - if c <= 119981 - then - (if c <= 119965 - then - (if c <= 119807 - then - (if c <= 113807 - then (if c <= 113800 then 6 else 1) - else if c <= 113817 then 6 else 1) - else - if c <= 119893 - then (if c <= 119892 then 6 else 1) - else if c <= 119964 then 6 else 1) - else - if c <= 119972 - then - (if c <= 119969 - then (if c <= 119967 then 6 else 1) - else if c <= 119970 then 6 else 1) - else - if c <= 119976 - then (if c <= 119974 then 6 else 1) - else if c <= 119980 then 6 else 1) - else - if c <= 120070 - then - (if c <= 119996 - then - (if c <= 119994 - then (if c <= 119993 then 6 else 1) - else if c <= 119995 then 6 else 1) - else - if c <= 120004 - then (if c <= 120003 then 6 else 1) - else if c <= 120069 then 6 else 1) - else - if c <= 120085 - then - (if c <= 120076 - then (if c <= 120074 then 6 else 1) - else if c <= 120084 then 6 else 1) - else - if c <= 120093 - then (if c <= 120092 then 6 else 1) - else if c <= 120121 then 6 else 1) - else - if c <= 131071 - then - (if c <= 126468 - then - (if c <= 122623 - then - (if c <= 120571 - then - (if c <= 120145 - then - (if c <= 120133 - then - (if c <= 120127 - then (if c <= 120126 then 6 else 1) - else if c <= 120132 then 6 else 1) - else - if c <= 120137 - then (if c <= 120134 then 6 else 1) - else if c <= 120144 then 6 else 1) - else - if c <= 120513 - then - (if c <= 120487 - then (if c <= 120485 then 6 else 1) - else if c <= 120512 then 6 else 1) - else - if c <= 120539 - then (if c <= 120538 then 6 else 1) - else if c <= 120570 then 6 else 1) - else - if c <= 120687 - then - (if c <= 120629 - then - (if c <= 120597 - then (if c <= 120596 then 6 else 1) - else if c <= 120628 then 6 else 1) - else - if c <= 120655 - then (if c <= 120654 then 6 else 1) - else if c <= 120686 then 6 else 1) - else - if c <= 120745 - then - (if c <= 120713 - then (if c <= 120712 then 6 else 1) - else if c <= 120744 then 6 else 1) - else - if c <= 120771 - then (if c <= 120770 then 6 else 1) - else if c <= 120779 then 6 else 1) - else - if c <= 124895 - then - (if c <= 123190 - then - (if c <= 122654 - then 6 - else - if c <= 123135 - then 1 - else if c <= 123180 then 6 else 1) - else - if c <= 123535 - then - (if c <= 123213 - then (if c <= 123197 then 6 else 1) - else if c <= 123214 then 6 else 1) - else - if c <= 123583 - then (if c <= 123565 then 6 else 1) - else if c <= 123627 then 6 else 1) - else - if c <= 124927 - then - (if c <= 124908 - then - (if c <= 124903 - then (if c <= 124902 then 6 else 1) - else if c <= 124907 then 6 else 1) - else - if c <= 124911 - then (if c <= 124910 then 6 else 1) - else if c <= 124926 then 6 else 1) - else - if c <= 125258 - then - (if c <= 125183 - then (if c <= 125124 then 6 else 1) - else if c <= 125251 then 6 else 1) - else - if c <= 126463 - then (if c <= 125259 then 6 else 1) - else if c <= 126467 then 6 else 1) - else - if c <= 126552 - then - (if c <= 126529 - then - (if c <= 126504 - then - (if c <= 126499 - then - (if c <= 126496 - then (if c <= 126495 then 6 else 1) - else if c <= 126498 then 6 else 1) - else - if c <= 126502 - then (if c <= 126500 then 6 else 1) - else if c <= 126503 then 6 else 1) - else - if c <= 126520 - then - (if c <= 126515 - then (if c <= 126514 then 6 else 1) - else if c <= 126519 then 6 else 1) - else - if c <= 126522 - then (if c <= 126521 then 6 else 1) - else if c <= 126523 then 6 else 1) - else - if c <= 126540 - then - (if c <= 126536 - then - (if c <= 126534 - then (if c <= 126530 then 6 else 1) - else if c <= 126535 then 6 else 1) - else - if c <= 126538 - then (if c <= 126537 then 6 else 1) - else if c <= 126539 then 6 else 1) - else - if c <= 126547 - then - (if c <= 126544 - then (if c <= 126543 then 6 else 1) - else if c <= 126546 then 6 else 1) - else - if c <= 126550 - then (if c <= 126548 then 6 else 1) - else if c <= 126551 then 6 else 1) - else - if c <= 126579 - then - (if c <= 126560 - then - (if c <= 126556 - then - (if c <= 126554 - then (if c <= 126553 then 6 else 1) - else if c <= 126555 then 6 else 1) - else - if c <= 126558 - then (if c <= 126557 then 6 else 1) - else if c <= 126559 then 6 else 1) - else - if c <= 126566 - then - (if c <= 126563 - then (if c <= 126562 then 6 else 1) - else if c <= 126564 then 6 else 1) - else - if c <= 126571 - then (if c <= 126570 then 6 else 1) - else if c <= 126578 then 6 else 1) - else - if c <= 126602 - then - (if c <= 126589 - then - (if c <= 126584 - then (if c <= 126583 then 6 else 1) - else if c <= 126588 then 6 else 1) - else - if c <= 126591 - then (if c <= 126590 then 6 else 1) - else if c <= 126601 then 6 else 1) - else - if c <= 126628 - then - (if c <= 126624 - then (if c <= 126619 then 6 else 1) - else if c <= 126627 then 6 else 1) - else - if c <= 126634 - then (if c <= 126633 then 6 else 1) - else if c <= 126651 then 6 else 1) - else - if c <= 183983 - then - (if c <= 177983 - then - (if c <= 173823 - then (if c <= 173791 then 6 else 1) - else if c <= 177976 then 6 else 1) - else - if c <= 178207 - then (if c <= 178205 then 6 else 1) - else if c <= 183969 then 6 else 1) - else if c <= 191456 then 6 else 1) - else (-1) -[@@@warning "-39"] -open Token -open Lex_env -module Sedlexing = Flow_sedlexing -let lexeme = Sedlexing.Utf8.lexeme -let lexeme_to_buffer = Sedlexing.Utf8.lexeme_to_buffer -let lexeme_to_buffer2 = Sedlexing.Utf8.lexeme_to_buffer2 -let sub_lexeme = Sedlexing.Utf8.sub_lexeme -let is_whitespace = - function - | 0x0009 | 0x000B | 0x000C | 0x0020 | 0x00A0 | 0xfeff | 0x1680 | 0x2000 - | 0x2001 | 0x2002 | 0x2003 | 0x2004 | 0x2005 | 0x2006 | 0x2007 | 0x2008 - | 0x2009 | 0x200a | 0x202f | 0x205f | 0x3000 -> true - | _ -> false -let rec loop_id_continues lexbuf = - let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_1 (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) - with - | 0 -> __sedlex_state_11 lexbuf - | 1 -> 0 - | _ -> Sedlexing.backtrack lexbuf) in - Sedlexing.start lexbuf; - (match __sedlex_state_0 lexbuf with - | 0 -> loop_id_continues lexbuf - | 1 -> true - | 2 -> - let s = Sedlexing.current_code_point lexbuf in - if Js_id.is_valid_unicode_id s - 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) - 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) -let pos_at_offset env offset = - { - Loc.line = (Lex_env.line env); - column = (offset - (Lex_env.bol_offset env)) - } -let loc_of_offsets env start_offset end_offset = - { - Loc.source = (Lex_env.source env); - start = (pos_at_offset env start_offset); - _end = (pos_at_offset env end_offset) - } -let start_pos_of_lexbuf env (lexbuf : Sedlexing.lexbuf) = - let start_offset = Sedlexing.lexeme_start lexbuf in - pos_at_offset env start_offset -let end_pos_of_lexbuf env (lexbuf : Sedlexing.lexbuf) = - let end_offset = Sedlexing.lexeme_end lexbuf in - pos_at_offset env end_offset -let loc_of_lexbuf env (lexbuf : Sedlexing.lexbuf) = - let start_offset = Sedlexing.lexeme_start lexbuf in - let end_offset = Sedlexing.lexeme_end lexbuf in - loc_of_offsets env start_offset end_offset -let loc_of_token env lex_token = - match lex_token with - | T_IDENTIFIER { loc;_} | T_JSX_IDENTIFIER { loc;_} | T_STRING - (loc, _, _, _) -> loc - | T_JSX_TEXT (loc, _, _) -> loc - | 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 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 - = - lex_error env loc - (Parse_error.UnexpectedTokenWithSuggestion (value, suggest)) -let illegal (env : Lex_env.t) (loc : Loc.t) = - lex_error env loc (Parse_error.Unexpected "token ILLEGAL") -let new_line env lexbuf = - let offset = Sedlexing.lexeme_end lexbuf in - let lex_bol = { line = ((Lex_env.line env) + 1); offset } in - { env with Lex_env.lex_bol = lex_bol } -let bigint_strip_n raw = - let size = String.length raw in - let str = - if (size != 0) && ((raw.[size - 1]) == 'n') - then String.sub raw 0 (size - 1) - 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) -let split_number_type = - let rec strip_whitespace i len lexeme = - if is_whitespace (lexeme.(i)) - then ((strip_whitespace)[@tailcall ]) (i + 1) len lexeme - else Sedlexing.string_of_utf8 (Array.sub lexeme i (len - i)) in - fun (lexeme : int array) -> - if (lexeme.(0)) = (Char.code '-') - then - let num = strip_whitespace 1 (Array.length lexeme) lexeme in - let raw = Sedlexing.string_of_utf8 lexeme in (true, num, raw) - else (let raw = Sedlexing.string_of_utf8 lexeme in (false, raw, raw)) -let mk_num_singleton number_type (lexeme : int array) = - let (neg, num, raw) = split_number_type lexeme in - let value = - match number_type with - | LEGACY_OCTAL -> - (try Int64.to_float (Int64.of_string ("0o" ^ num)) - with | Failure _ -> failwith ("Invalid legacy octal " ^ num)) - | BINARY | OCTAL -> - (try Int64.to_float (Int64.of_string num) - with | Failure _ -> failwith ("Invalid binary/octal " ^ num)) - | LEGACY_NON_OCTAL | NORMAL -> - (try float_of_string num - with | Failure _ -> failwith ("Invalid number " ^ num)) in - let value = if neg then -. value else value in - T_NUMBER_SINGLETON_TYPE { kind = number_type; value; raw } -let mk_bignum_singleton kind lexeme = - let (neg, num, raw) = split_number_type lexeme in - let postraw = bigint_strip_n num in - let value = - (Int64.of_string_opt postraw) |> - (Option.map (fun value -> if neg then Int64.neg value else value)) in - T_BIGINT_SINGLETON_TYPE { kind; value; raw } -let assert_valid_unicode_in_identifier env loc code = - if Js_id.is_valid_unicode_id code - then env - else lex_error env loc Parse_error.IllegalUnicodeEscape -let decode_identifier = - let loc_and_sub_lexeme env offset lexbuf trim_start trim_end = - let start_offset = offset + (Sedlexing.lexeme_start lexbuf) in - let end_offset = offset + (Sedlexing.lexeme_end lexbuf) in - let loc = loc_of_offsets env start_offset end_offset in - (loc, - (sub_lexeme lexbuf trim_start - (((Sedlexing.lexeme_length lexbuf) - trim_start) - trim_end))) in - let rec id_char env offset buf lexbuf = - let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_7 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 2 - | 1 -> __sedlex_state_2 lexbuf - | 2 -> __sedlex_state_3 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_2 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 3; - (match __sedlex_partition_8 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_2 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_3 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 3; - (match __sedlex_partition_2 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_4 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_4 = - function - | lexbuf -> - (match __sedlex_partition_3 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_5 lexbuf - | 1 -> __sedlex_state_9 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_5 = - function - | lexbuf -> - (match __sedlex_partition_4 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_6 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 -> 0 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_9 = - function - | lexbuf -> - (match __sedlex_partition_4 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_10 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_10 = - function - | lexbuf -> - (match __sedlex_partition_5 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_10 lexbuf - | 1 -> 1 - | _ -> Sedlexing.backtrack lexbuf) in - Sedlexing.start lexbuf; - (match __sedlex_state_0 lexbuf with - | 0 -> - let (loc, hex) = loc_and_sub_lexeme env offset lexbuf 2 0 in - let code = int_of_string ("0x" ^ hex) in - let env = - if not (Uchar.is_valid code) - then lex_error env loc Parse_error.IllegalUnicodeEscape - else assert_valid_unicode_in_identifier env loc code in - (Wtf8.add_wtf_8 buf code; id_char env offset buf lexbuf) - | 1 -> - let (loc, hex) = loc_and_sub_lexeme env offset lexbuf 3 1 in - let code = int_of_string ("0x" ^ hex) in - let env = assert_valid_unicode_in_identifier env loc code in - (Wtf8.add_wtf_8 buf code; id_char env offset buf lexbuf) - | 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 = - let env = illegal env (loc_of_lexbuf env lexbuf) in - Sedlexing.rollback lexbuf; f env lexbuf -type jsx_text_mode = - | JSX_SINGLE_QUOTED_TEXT - | JSX_DOUBLE_QUOTED_TEXT - | JSX_CHILD_TEXT -type result = - | Token of Lex_env.t * Token.t - | Comment of Lex_env.t * Loc.t Flow_ast.Comment.t - | Continue of Lex_env.t -let rec comment env buf lexbuf = - let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_9 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | 1 -> 0 - | 2 -> __sedlex_state_3 lexbuf - | 3 -> __sedlex_state_5 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_1 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 3; - (match __sedlex_partition_10 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_3 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_11 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 0 - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_5 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 3; - (match __sedlex_partition_12 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_6 lexbuf - | 1 -> 1 - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_6 = - function - | lexbuf -> - (match __sedlex_partition_13 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 2 - | _ -> Sedlexing.backtrack lexbuf) in - Sedlexing.start lexbuf; - (match __sedlex_state_0 lexbuf with - | 0 -> - let env = new_line env lexbuf in - (lexeme_to_buffer lexbuf buf; comment env buf lexbuf) - | 1 -> - let env = - if is_in_comment_syntax env - then - let loc = loc_of_lexbuf env lexbuf in - unexpected_error_w_suggest env loc "*/" "*-/" - else env in - (env, (end_pos_of_lexbuf env lexbuf)) - | 2 -> - if is_in_comment_syntax env - then (env, (end_pos_of_lexbuf env lexbuf)) - else (Buffer.add_string buf "*-/"; comment env buf lexbuf) - | 3 -> (lexeme_to_buffer lexbuf buf; comment env buf lexbuf) - | _ -> - let env = illegal env (loc_of_lexbuf env lexbuf) in - (env, (end_pos_of_lexbuf env lexbuf))) -let rec line_comment env buf lexbuf = - let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_14 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 0 - | 1 -> __sedlex_state_2 lexbuf - | 2 -> 1 - | 3 -> __sedlex_state_4 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_2 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 2; - (match __sedlex_partition_15 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_2 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_4 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 1; - (match __sedlex_partition_11 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 1 - | _ -> Sedlexing.backtrack lexbuf)) in - Sedlexing.start lexbuf; - (match __sedlex_state_0 lexbuf with - | 0 -> (env, (end_pos_of_lexbuf env lexbuf)) - | 1 -> - let { Loc.line = line; column } = end_pos_of_lexbuf env lexbuf in - let env = new_line env lexbuf in - let len = Sedlexing.lexeme_length lexbuf in - let end_pos = { Loc.line = line; column = (column - len) } in - (env, end_pos) - | 2 -> (lexeme_to_buffer lexbuf buf; line_comment env buf lexbuf) - | _ -> failwith "unreachable line_comment") -let string_escape env lexbuf = - let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_16 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 0 - | 1 -> 16 - | 2 -> 15 - | 3 -> __sedlex_state_4 lexbuf - | 4 -> __sedlex_state_6 lexbuf - | 5 -> __sedlex_state_9 lexbuf - | 6 -> 0 - | 7 -> 5 - | 8 -> 6 - | 9 -> 7 - | 10 -> 8 - | 11 -> 9 - | 12 -> __sedlex_state_16 lexbuf - | 13 -> 10 - | 14 -> __sedlex_state_25 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_4 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 15; - (match __sedlex_partition_11 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 15 - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_6 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 4; - (match __sedlex_partition_17 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_7 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_7 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 3; - (match __sedlex_partition_17 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 2 - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_9 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 11; - (match __sedlex_partition_17 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_7 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_16 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 14; - (match __sedlex_partition_3 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_17 lexbuf - | 1 -> __sedlex_state_21 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_17 = - function - | lexbuf -> - (match __sedlex_partition_4 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_18 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_18 = - function - | lexbuf -> - (match __sedlex_partition_4 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_19 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_19 = - function - | lexbuf -> - (match __sedlex_partition_4 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 12 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_21 = - function - | lexbuf -> - (match __sedlex_partition_4 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_22 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_22 = - function - | lexbuf -> - (match __sedlex_partition_5 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_22 lexbuf - | 1 -> 13 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_25 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 14; - (match __sedlex_partition_4 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_26 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_26 = - function - | lexbuf -> - (match __sedlex_partition_4 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 1 - | _ -> Sedlexing.backtrack lexbuf) in - Sedlexing.start lexbuf; - (match __sedlex_state_0 lexbuf with - | 0 -> - let str = lexeme lexbuf in - let codes = Sedlexing.lexeme lexbuf in (env, str, codes, false) - | 1 -> - let str = lexeme lexbuf in - let code = int_of_string ("0" ^ str) in (env, str, [|code|], false) - | 2 -> - let str = lexeme lexbuf in - let code = int_of_string ("0o" ^ str) in - if code < 256 - then (env, str, [|code|], true) - else - (let remainder = code land 7 in - let code = code lsr 3 in - (env, str, [|code;((Char.code '0') + remainder)|], true)) - | 3 -> - let str = lexeme lexbuf in - let code = int_of_string ("0o" ^ str) in (env, str, [|code|], true) - | 4 -> (env, "0", [|0x0|], false) - | 5 -> (env, "b", [|0x8|], false) - | 6 -> (env, "f", [|0xC|], false) - | 7 -> (env, "n", [|0xA|], false) - | 8 -> (env, "r", [|0xD|], false) - | 9 -> (env, "t", [|0x9|], false) - | 10 -> (env, "v", [|0xB|], false) - | 11 -> - let str = lexeme lexbuf in - let code = int_of_string ("0o" ^ str) in (env, str, [|code|], true) - | 12 -> - let str = lexeme lexbuf in - let hex = String.sub str 1 ((String.length str) - 1) in - let code = int_of_string ("0x" ^ hex) in (env, str, [|code|], false) - | 13 -> - let str = lexeme lexbuf in - let hex = String.sub str 2 ((String.length str) - 3) in - let code = int_of_string ("0x" ^ hex) in - let env = - if code > 0x10FFFF - then illegal env (loc_of_lexbuf env lexbuf) - else env in - (env, str, [|code|], false) - | 14 -> - let str = lexeme lexbuf in - let codes = Sedlexing.lexeme lexbuf in - let env = illegal env (loc_of_lexbuf env lexbuf) in - (env, str, codes, false) - | 15 -> - let str = lexeme lexbuf in - let env = new_line env lexbuf in (env, str, [||], false) - | 16 -> - let str = lexeme lexbuf in - let codes = Sedlexing.lexeme lexbuf in (env, str, codes, false) - | _ -> failwith "unreachable string_escape") -let rec string_quote env q buf raw octal lexbuf = - let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_18 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 3 - | 1 -> __sedlex_state_2 lexbuf - | 2 -> 2 - | 3 -> 0 - | 4 -> 1 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_2 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 4; - (match __sedlex_partition_19 (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 q' = lexeme lexbuf in - (Buffer.add_string raw q'; - if q = q' - then (env, (end_pos_of_lexbuf env lexbuf), octal) - else - (Buffer.add_string buf q'; string_quote env q buf raw octal lexbuf)) - | 1 -> - (Buffer.add_string raw "\\"; - (let (env, str, codes, octal') = string_escape env lexbuf in - let octal = octal' || octal in - Buffer.add_string raw str; - Array.iter (Wtf8.add_wtf_8 buf) codes; - string_quote env q buf raw octal lexbuf)) - | 2 -> - let x = lexeme lexbuf in - (Buffer.add_string raw x; - (let env = illegal env (loc_of_lexbuf env lexbuf) in - let env = new_line env lexbuf in - Buffer.add_string buf x; - (env, (end_pos_of_lexbuf env lexbuf), octal))) - | 3 -> - let x = lexeme lexbuf in - (Buffer.add_string raw x; - (let env = illegal env (loc_of_lexbuf env lexbuf) in - Buffer.add_string buf x; - (env, (end_pos_of_lexbuf env lexbuf), octal))) - | 4 -> - (lexeme_to_buffer2 lexbuf raw buf; - string_quote env q buf raw octal lexbuf) - | _ -> failwith "unreachable string_quote") -let rec template_part env cooked raw literal lexbuf = - let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_20 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 0 - | 1 -> __sedlex_state_2 lexbuf - | 2 -> 5 - | 3 -> __sedlex_state_4 lexbuf - | 4 -> __sedlex_state_6 lexbuf - | 5 -> 3 - | 6 -> 1 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_2 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 6; - (match __sedlex_partition_21 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_2 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_4 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 5; - (match __sedlex_partition_11 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 4 - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_6 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 6; - (match __sedlex_partition_22 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 2 - | _ -> Sedlexing.backtrack lexbuf)) in - Sedlexing.start lexbuf; - (match __sedlex_state_0 lexbuf with - | 0 -> let env = illegal env (loc_of_lexbuf env lexbuf) in (env, true) - | 1 -> (Buffer.add_char literal '`'; (env, true)) - | 2 -> (Buffer.add_string literal "${"; (env, false)) - | 3 -> - (Buffer.add_char raw '\\'; - Buffer.add_char literal '\\'; - (let (env, str, codes, _) = string_escape env lexbuf in - Buffer.add_string raw str; - Buffer.add_string literal str; - Array.iter (Wtf8.add_wtf_8 cooked) codes; - template_part env cooked raw literal lexbuf)) - | 4 -> - (Buffer.add_string raw "\r\n"; - Buffer.add_string literal "\r\n"; - Buffer.add_string cooked "\n"; - (let env = new_line env lexbuf in - template_part env cooked raw literal lexbuf)) - | 5 -> - let lf = lexeme lexbuf in - (Buffer.add_string raw lf; - Buffer.add_string literal lf; - Buffer.add_char cooked '\n'; - (let env = new_line env lexbuf in - template_part env cooked raw literal lexbuf)) - | 6 -> - let c = lexeme lexbuf in - (Buffer.add_string raw c; - Buffer.add_string literal c; - Buffer.add_string cooked c; - template_part env cooked raw literal 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) - 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 (env, _) = line_comment env (Buffer.create 127) lexbuf in - Continue env - 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 cooked = Buffer.create 127 in - let raw = Buffer.create 127 in - let literal = Buffer.create 127 in - (lexeme_to_buffer lexbuf literal; - (let start = start_pos_of_lexbuf env lexbuf in - let (env, is_tail) = template_part env cooked raw literal 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, - { - cooked = (Buffer.contents cooked); - raw = (Buffer.contents raw); - literal = (Buffer.contents literal) - }, 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; - (let raw = Sedlexing.lexeme lexbuf in - let (nenv, value) = decode_identifier env raw in - match value 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) - | _ -> - 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) -let rec regexp_class env buf lexbuf = - let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_100 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 0 - | 1 -> __sedlex_state_2 lexbuf - | 2 -> 4 - | 3 -> __sedlex_state_4 lexbuf - | 4 -> __sedlex_state_6 lexbuf - | 5 -> 3 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_2 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 5; - (match __sedlex_partition_101 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_2 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_4 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 4; - (match __sedlex_partition_11 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 4 - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_6 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 5; - (match __sedlex_partition_102 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 1 - | 1 -> 2 - | _ -> Sedlexing.backtrack lexbuf)) in - Sedlexing.start lexbuf; - (match __sedlex_state_0 lexbuf with - | 0 -> env - | 1 -> (Buffer.add_string buf "\\\\"; regexp_class env buf lexbuf) - | 2 -> - (Buffer.add_char buf '\\'; - Buffer.add_char buf ']'; - regexp_class env buf lexbuf) - | 3 -> (Buffer.add_char buf ']'; env) - | 4 -> - let loc = loc_of_lexbuf env lexbuf in - let env = lex_error env loc Parse_error.UnterminatedRegExp in - let env = new_line env lexbuf in env - | 5 -> - let str = lexeme lexbuf in - (Buffer.add_string buf str; regexp_class env buf lexbuf) - | _ -> failwith "unreachable regexp_class") -let rec regexp_body env buf lexbuf = - let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_103 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 0 - | 1 -> __sedlex_state_2 lexbuf - | 2 -> 6 - | 3 -> __sedlex_state_4 lexbuf - | 4 -> __sedlex_state_6 lexbuf - | 5 -> 5 - | 6 -> __sedlex_state_9 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_2 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 7; - (match __sedlex_partition_104 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_2 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_4 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 6; - (match __sedlex_partition_11 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 6 - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_6 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 4; - (match __sedlex_partition_105 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_7 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_7 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 3; - (match __sedlex_partition_105 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_7 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_9 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 7; - (match __sedlex_partition_106 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 2 - | 1 -> 1 - | 2 -> __sedlex_state_12 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_12 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 1; - (match __sedlex_partition_11 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 1 - | _ -> 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.UnterminatedRegExp in - (env, "") - | 1 -> - let loc = loc_of_lexbuf env lexbuf in - let env = lex_error env loc Parse_error.UnterminatedRegExp in - let env = new_line env lexbuf in (env, "") - | 2 -> - let s = lexeme lexbuf in - (Buffer.add_string buf s; regexp_body env buf lexbuf) - | 3 -> - let flags = - let str = lexeme lexbuf in - String.sub str 1 ((String.length str) - 1) in - (env, flags) - | 4 -> (env, "") - | 5 -> - (Buffer.add_char buf '['; - (let env = regexp_class env buf lexbuf in regexp_body env buf lexbuf)) - | 6 -> - let loc = loc_of_lexbuf env lexbuf in - let env = lex_error env loc Parse_error.UnterminatedRegExp in - let env = new_line env lexbuf in (env, "") - | 7 -> - let str = lexeme lexbuf in - (Buffer.add_string buf str; regexp_body env buf lexbuf) - | _ -> failwith "unreachable regexp_body") -let regexp env lexbuf = - let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_107 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 0 - | 1 -> 6 - | 2 -> __sedlex_state_3 lexbuf - | 3 -> 1 - | 4 -> __sedlex_state_6 lexbuf - | 5 -> __sedlex_state_8 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_3 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 2; - (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 2; - (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 1; - (match __sedlex_partition_11 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 1 - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_8 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 5; - (match __sedlex_partition_108 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 4 - | 1 -> 3 - | _ -> Sedlexing.backtrack lexbuf)) in - Sedlexing.start lexbuf; - (match __sedlex_state_0 lexbuf with - | 0 -> Token (env, T_EOF) - | 1 -> let env = new_line env lexbuf in Continue env - | 2 -> Continue env - | 3 -> - 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)) - | 4 -> - 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)) - | 5 -> - let start = start_pos_of_lexbuf env lexbuf in - let buf = Buffer.create 127 in - let (env, flags) = regexp_body env buf 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_REGEXP (loc, (Buffer.contents buf), flags))) - | 6 -> - let env = illegal env (loc_of_lexbuf env lexbuf) in - Token (env, (T_ERROR (lexeme lexbuf))) - | _ -> failwith "unreachable regexp") -let rec jsx_text env mode buf raw lexbuf = - let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_109 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 1 - | 1 -> __sedlex_state_2 lexbuf - | 2 -> 2 - | 3 -> __sedlex_state_4 lexbuf - | 4 -> 0 - | 5 -> __sedlex_state_7 lexbuf - | 6 -> __sedlex_state_23 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_2 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 6; - (match __sedlex_partition_110 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_2 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_4 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 2; - (match __sedlex_partition_11 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 2 - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_7 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 6; - (match __sedlex_partition_111 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_8 lexbuf - | 1 -> __sedlex_state_14 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_8 = - function - | lexbuf -> - (match __sedlex_partition_112 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_9 lexbuf - | 1 -> __sedlex_state_11 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_9 = - function - | lexbuf -> - (match __sedlex_partition_113 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_9 lexbuf - | 1 -> 4 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_11 = - function - | lexbuf -> - (match __sedlex_partition_4 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_12 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_12 = - function - | lexbuf -> - (match __sedlex_partition_114 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_12 lexbuf - | 1 -> 3 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_14 = - function - | lexbuf -> - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_15 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_15 = - function - | lexbuf -> - (match __sedlex_partition_115 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_16 lexbuf - | 1 -> 5 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_16 = - function - | lexbuf -> - (match __sedlex_partition_115 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_17 lexbuf - | 1 -> 5 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_17 = - function - | lexbuf -> - (match __sedlex_partition_115 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_18 lexbuf - | 1 -> 5 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_18 = - function - | lexbuf -> - (match __sedlex_partition_115 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_19 lexbuf - | 1 -> 5 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_19 = - function - | lexbuf -> - (match __sedlex_partition_115 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_20 lexbuf - | 1 -> 5 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_20 = - function - | lexbuf -> - (match __sedlex_partition_115 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_21 lexbuf - | 1 -> 5 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_21 = - function - | lexbuf -> - (match __sedlex_partition_116 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 5 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_23 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_110 (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 c = lexeme lexbuf in - (match (mode, c) with - | (JSX_SINGLE_QUOTED_TEXT, "'") | (JSX_DOUBLE_QUOTED_TEXT, "\"") -> - env - | (JSX_CHILD_TEXT, ("<" | "{")) -> (Sedlexing.rollback lexbuf; env) - | (JSX_CHILD_TEXT, ">") -> - unexpected_error_w_suggest env (loc_of_lexbuf env lexbuf) ">" - "{'>'}" - | (JSX_CHILD_TEXT, "}") -> - unexpected_error_w_suggest env (loc_of_lexbuf env lexbuf) "}" - "{'}'}" - | _ -> - (Buffer.add_string raw c; - Buffer.add_string buf c; - jsx_text env mode buf raw lexbuf)) - | 1 -> let env = illegal env (loc_of_lexbuf env lexbuf) in env - | 2 -> - let lt = lexeme lexbuf in - (Buffer.add_string raw lt; - Buffer.add_string buf lt; - (let env = new_line env lexbuf in jsx_text env mode buf raw lexbuf)) - | 3 -> - let s = lexeme lexbuf in - let n = String.sub s 3 ((String.length s) - 4) in - (Buffer.add_string raw s; - (let code = int_of_string ("0x" ^ n) in - Wtf8.add_wtf_8 buf code; jsx_text env mode buf raw lexbuf)) - | 4 -> - let s = lexeme lexbuf in - let n = String.sub s 2 ((String.length s) - 3) in - (Buffer.add_string raw s; - (let code = int_of_string n in - Wtf8.add_wtf_8 buf code; jsx_text env mode buf raw lexbuf)) - | 5 -> - let s = lexeme lexbuf in - let entity = String.sub s 1 ((String.length s) - 2) in - (Buffer.add_string raw s; - (let code = - match entity with - | "quot" -> Some 0x0022 - | "amp" -> Some 0x0026 - | "apos" -> Some 0x0027 - | "lt" -> Some 0x003C - | "gt" -> Some 0x003E - | "nbsp" -> Some 0x00A0 - | "iexcl" -> Some 0x00A1 - | "cent" -> Some 0x00A2 - | "pound" -> Some 0x00A3 - | "curren" -> Some 0x00A4 - | "yen" -> Some 0x00A5 - | "brvbar" -> Some 0x00A6 - | "sect" -> Some 0x00A7 - | "uml" -> Some 0x00A8 - | "copy" -> Some 0x00A9 - | "ordf" -> Some 0x00AA - | "laquo" -> Some 0x00AB - | "not" -> Some 0x00AC - | "shy" -> Some 0x00AD - | "reg" -> Some 0x00AE - | "macr" -> Some 0x00AF - | "deg" -> Some 0x00B0 - | "plusmn" -> Some 0x00B1 - | "sup2" -> Some 0x00B2 - | "sup3" -> Some 0x00B3 - | "acute" -> Some 0x00B4 - | "micro" -> Some 0x00B5 - | "para" -> Some 0x00B6 - | "middot" -> Some 0x00B7 - | "cedil" -> Some 0x00B8 - | "sup1" -> Some 0x00B9 - | "ordm" -> Some 0x00BA - | "raquo" -> Some 0x00BB - | "frac14" -> Some 0x00BC - | "frac12" -> Some 0x00BD - | "frac34" -> Some 0x00BE - | "iquest" -> Some 0x00BF - | "Agrave" -> Some 0x00C0 - | "Aacute" -> Some 0x00C1 - | "Acirc" -> Some 0x00C2 - | "Atilde" -> Some 0x00C3 - | "Auml" -> Some 0x00C4 - | "Aring" -> Some 0x00C5 - | "AElig" -> Some 0x00C6 - | "Ccedil" -> Some 0x00C7 - | "Egrave" -> Some 0x00C8 - | "Eacute" -> Some 0x00C9 - | "Ecirc" -> Some 0x00CA - | "Euml" -> Some 0x00CB - | "Igrave" -> Some 0x00CC - | "Iacute" -> Some 0x00CD - | "Icirc" -> Some 0x00CE - | "Iuml" -> Some 0x00CF - | "ETH" -> Some 0x00D0 - | "Ntilde" -> Some 0x00D1 - | "Ograve" -> Some 0x00D2 - | "Oacute" -> Some 0x00D3 - | "Ocirc" -> Some 0x00D4 - | "Otilde" -> Some 0x00D5 - | "Ouml" -> Some 0x00D6 - | "times" -> Some 0x00D7 - | "Oslash" -> Some 0x00D8 - | "Ugrave" -> Some 0x00D9 - | "Uacute" -> Some 0x00DA - | "Ucirc" -> Some 0x00DB - | "Uuml" -> Some 0x00DC - | "Yacute" -> Some 0x00DD - | "THORN" -> Some 0x00DE - | "szlig" -> Some 0x00DF - | "agrave" -> Some 0x00E0 - | "aacute" -> Some 0x00E1 - | "acirc" -> Some 0x00E2 - | "atilde" -> Some 0x00E3 - | "auml" -> Some 0x00E4 - | "aring" -> Some 0x00E5 - | "aelig" -> Some 0x00E6 - | "ccedil" -> Some 0x00E7 - | "egrave" -> Some 0x00E8 - | "eacute" -> Some 0x00E9 - | "ecirc" -> Some 0x00EA - | "euml" -> Some 0x00EB - | "igrave" -> Some 0x00EC - | "iacute" -> Some 0x00ED - | "icirc" -> Some 0x00EE - | "iuml" -> Some 0x00EF - | "eth" -> Some 0x00F0 - | "ntilde" -> Some 0x00F1 - | "ograve" -> Some 0x00F2 - | "oacute" -> Some 0x00F3 - | "ocirc" -> Some 0x00F4 - | "otilde" -> Some 0x00F5 - | "ouml" -> Some 0x00F6 - | "divide" -> Some 0x00F7 - | "oslash" -> Some 0x00F8 - | "ugrave" -> Some 0x00F9 - | "uacute" -> Some 0x00FA - | "ucirc" -> Some 0x00FB - | "uuml" -> Some 0x00FC - | "yacute" -> Some 0x00FD - | "thorn" -> Some 0x00FE - | "yuml" -> Some 0x00FF - | "OElig" -> Some 0x0152 - | "oelig" -> Some 0x0153 - | "Scaron" -> Some 0x0160 - | "scaron" -> Some 0x0161 - | "Yuml" -> Some 0x0178 - | "fnof" -> Some 0x0192 - | "circ" -> Some 0x02C6 - | "tilde" -> Some 0x02DC - | "Alpha" -> Some 0x0391 - | "Beta" -> Some 0x0392 - | "Gamma" -> Some 0x0393 - | "Delta" -> Some 0x0394 - | "Epsilon" -> Some 0x0395 - | "Zeta" -> Some 0x0396 - | "Eta" -> Some 0x0397 - | "Theta" -> Some 0x0398 - | "Iota" -> Some 0x0399 - | "Kappa" -> Some 0x039A - | "Lambda" -> Some 0x039B - | "Mu" -> Some 0x039C - | "Nu" -> Some 0x039D - | "Xi" -> Some 0x039E - | "Omicron" -> Some 0x039F - | "Pi" -> Some 0x03A0 - | "Rho" -> Some 0x03A1 - | "Sigma" -> Some 0x03A3 - | "Tau" -> Some 0x03A4 - | "Upsilon" -> Some 0x03A5 - | "Phi" -> Some 0x03A6 - | "Chi" -> Some 0x03A7 - | "Psi" -> Some 0x03A8 - | "Omega" -> Some 0x03A9 - | "alpha" -> Some 0x03B1 - | "beta" -> Some 0x03B2 - | "gamma" -> Some 0x03B3 - | "delta" -> Some 0x03B4 - | "epsilon" -> Some 0x03B5 - | "zeta" -> Some 0x03B6 - | "eta" -> Some 0x03B7 - | "theta" -> Some 0x03B8 - | "iota" -> Some 0x03B9 - | "kappa" -> Some 0x03BA - | "lambda" -> Some 0x03BB - | "mu" -> Some 0x03BC - | "nu" -> Some 0x03BD - | "xi" -> Some 0x03BE - | "omicron" -> Some 0x03BF - | "pi" -> Some 0x03C0 - | "rho" -> Some 0x03C1 - | "sigmaf" -> Some 0x03C2 - | "sigma" -> Some 0x03C3 - | "tau" -> Some 0x03C4 - | "upsilon" -> Some 0x03C5 - | "phi" -> Some 0x03C6 - | "chi" -> Some 0x03C7 - | "psi" -> Some 0x03C8 - | "omega" -> Some 0x03C9 - | "thetasym" -> Some 0x03D1 - | "upsih" -> Some 0x03D2 - | "piv" -> Some 0x03D6 - | "ensp" -> Some 0x2002 - | "emsp" -> Some 0x2003 - | "thinsp" -> Some 0x2009 - | "zwnj" -> Some 0x200C - | "zwj" -> Some 0x200D - | "lrm" -> Some 0x200E - | "rlm" -> Some 0x200F - | "ndash" -> Some 0x2013 - | "mdash" -> Some 0x2014 - | "lsquo" -> Some 0x2018 - | "rsquo" -> Some 0x2019 - | "sbquo" -> Some 0x201A - | "ldquo" -> Some 0x201C - | "rdquo" -> Some 0x201D - | "bdquo" -> Some 0x201E - | "dagger" -> Some 0x2020 - | "Dagger" -> Some 0x2021 - | "bull" -> Some 0x2022 - | "hellip" -> Some 0x2026 - | "permil" -> Some 0x2030 - | "prime" -> Some 0x2032 - | "Prime" -> Some 0x2033 - | "lsaquo" -> Some 0x2039 - | "rsaquo" -> Some 0x203A - | "oline" -> Some 0x203E - | "frasl" -> Some 0x2044 - | "euro" -> Some 0x20AC - | "image" -> Some 0x2111 - | "weierp" -> Some 0x2118 - | "real" -> Some 0x211C - | "trade" -> Some 0x2122 - | "alefsym" -> Some 0x2135 - | "larr" -> Some 0x2190 - | "uarr" -> Some 0x2191 - | "rarr" -> Some 0x2192 - | "darr" -> Some 0x2193 - | "harr" -> Some 0x2194 - | "crarr" -> Some 0x21B5 - | "lArr" -> Some 0x21D0 - | "uArr" -> Some 0x21D1 - | "rArr" -> Some 0x21D2 - | "dArr" -> Some 0x21D3 - | "hArr" -> Some 0x21D4 - | "forall" -> Some 0x2200 - | "part" -> Some 0x2202 - | "exist" -> Some 0x2203 - | "empty" -> Some 0x2205 - | "nabla" -> Some 0x2207 - | "isin" -> Some 0x2208 - | "notin" -> Some 0x2209 - | "ni" -> Some 0x220B - | "prod" -> Some 0x220F - | "sum" -> Some 0x2211 - | "minus" -> Some 0x2212 - | "lowast" -> Some 0x2217 - | "radic" -> Some 0x221A - | "prop" -> Some 0x221D - | "infin" -> Some 0x221E - | "ang" -> Some 0x2220 - | "and" -> Some 0x2227 - | "or" -> Some 0x2228 - | "cap" -> Some 0x2229 - | "cup" -> Some 0x222A - | "'int'" -> Some 0x222B - | "there4" -> Some 0x2234 - | "sim" -> Some 0x223C - | "cong" -> Some 0x2245 - | "asymp" -> Some 0x2248 - | "ne" -> Some 0x2260 - | "equiv" -> Some 0x2261 - | "le" -> Some 0x2264 - | "ge" -> Some 0x2265 - | "sub" -> Some 0x2282 - | "sup" -> Some 0x2283 - | "nsub" -> Some 0x2284 - | "sube" -> Some 0x2286 - | "supe" -> Some 0x2287 - | "oplus" -> Some 0x2295 - | "otimes" -> Some 0x2297 - | "perp" -> Some 0x22A5 - | "sdot" -> Some 0x22C5 - | "lceil" -> Some 0x2308 - | "rceil" -> Some 0x2309 - | "lfloor" -> Some 0x230A - | "rfloor" -> Some 0x230B - | "lang" -> Some 0x27E8 - | "rang" -> Some 0x27E9 - | "loz" -> Some 0x25CA - | "spades" -> Some 0x2660 - | "clubs" -> Some 0x2663 - | "hearts" -> Some 0x2665 - | "diams" -> Some 0x2666 - | _ -> None in - (match code with - | Some code -> Wtf8.add_wtf_8 buf code - | None -> Buffer.add_string buf ("&" ^ (entity ^ ";"))); - jsx_text env mode buf raw lexbuf)) - | 6 -> - let c = lexeme lexbuf in - (Buffer.add_string raw c; - Buffer.add_string buf c; - jsx_text env mode buf raw lexbuf) - | _ -> failwith "unreachable jsxtext") -let jsx_tag env lexbuf = - let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_117 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 0 - | 1 -> 14 - | 2 -> __sedlex_state_3 lexbuf - | 3 -> 1 - | 4 -> __sedlex_state_6 lexbuf - | 5 -> 12 - | 6 -> 13 - | 7 -> 10 - | 8 -> __sedlex_state_11 lexbuf - | 9 -> 9 - | 10 -> 5 - | 11 -> 11 - | 12 -> 7 - | 13 -> __sedlex_state_18 lexbuf - | 14 -> 8 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_3 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 2; - (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 2; - (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 1; - (match __sedlex_partition_11 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 1 - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_11 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 6; - (match __sedlex_partition_108 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 4 - | 1 -> 3 - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_18 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 14; - (match __sedlex_partition_2 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_19 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_19 = - function - | lexbuf -> - (match __sedlex_partition_3 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_20 lexbuf - | 1 -> __sedlex_state_24 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_20 = - function - | lexbuf -> - (match __sedlex_partition_4 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_21 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_21 = - function - | lexbuf -> - (match __sedlex_partition_4 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_22 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_22 = - function - | lexbuf -> - (match __sedlex_partition_4 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 13 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_24 = - function - | lexbuf -> - (match __sedlex_partition_4 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_25 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_25 = - function - | lexbuf -> - (match __sedlex_partition_5 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_25 lexbuf - | 1 -> 13 - | _ -> Sedlexing.backtrack lexbuf) in - Sedlexing.start lexbuf; - (match __sedlex_state_0 lexbuf with - | 0 -> Token (env, T_EOF) - | 1 -> let env = new_line env lexbuf in Continue env - | 2 -> Continue env - | 3 -> - 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)) - | 4 -> - 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)) - | 5 -> Token (env, T_LESS_THAN) - | 6 -> Token (env, T_DIV) - | 7 -> Token (env, T_GREATER_THAN) - | 8 -> Token (env, T_LCURLY) - | 9 -> Token (env, T_COLON) - | 10 -> Token (env, T_PERIOD) - | 11 -> Token (env, T_ASSIGN) - | 12 -> - 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 mode = - if quote = "'" - then JSX_SINGLE_QUOTED_TEXT - else JSX_DOUBLE_QUOTED_TEXT in - let env = jsx_text env mode buf raw lexbuf in - let _end = end_pos_of_lexbuf env lexbuf in - Buffer.add_string raw quote; - (let value = Buffer.contents buf in - let raw = Buffer.contents raw in - let loc = { Loc.source = (Lex_env.source env); start; _end } in - Token (env, (T_JSX_TEXT (loc, value, raw)))))) - | 13 -> - let start_offset = Sedlexing.lexeme_start lexbuf in - (loop_jsx_id_continues lexbuf; - (let end_offset = Sedlexing.lexeme_end lexbuf in - Sedlexing.set_lexeme_start lexbuf start_offset; - (let raw = Sedlexing.lexeme lexbuf in - let loc = loc_of_offsets env start_offset end_offset in - Token - (env, - (T_JSX_IDENTIFIER { raw = (Sedlexing.string_of_utf8 raw); loc }))))) - | 14 -> Token (env, (T_ERROR (lexeme lexbuf))) - | _ -> failwith "unreachable jsx_tag") -let jsx_child env start buf raw lexbuf = - let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_118 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 1 - | 1 -> 4 - | 2 -> 0 - | 3 -> __sedlex_state_4 lexbuf - | 4 -> 2 - | 5 -> 3 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_4 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_11 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 0 - | _ -> Sedlexing.backtrack lexbuf)) in - Sedlexing.start lexbuf; - (match __sedlex_state_0 lexbuf with - | 0 -> - let lt = lexeme lexbuf in - (Buffer.add_string raw lt; - Buffer.add_string buf lt; - (let env = new_line env lexbuf in - let env = jsx_text env JSX_CHILD_TEXT buf raw lexbuf in - let _end = end_pos_of_lexbuf env lexbuf in - let value = Buffer.contents buf in - let raw = Buffer.contents raw in - let loc = { Loc.source = (Lex_env.source env); start; _end } in - (env, (T_JSX_TEXT (loc, value, raw))))) - | 1 -> (env, T_EOF) - | 2 -> (env, T_LESS_THAN) - | 3 -> (env, T_LCURLY) - | 4 -> - (Sedlexing.rollback lexbuf; - (let env = jsx_text env JSX_CHILD_TEXT buf raw lexbuf in - let _end = end_pos_of_lexbuf env lexbuf in - let value = Buffer.contents buf in - let raw = Buffer.contents raw in - let loc = { Loc.source = (Lex_env.source env); start; _end } in - (env, (T_JSX_TEXT (loc, value, raw))))) - | _ -> failwith "unreachable jsx_child") -let template_tail env lexbuf = - let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_119 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 5 - | 1 -> __sedlex_state_2 lexbuf - | 2 -> 0 - | 3 -> __sedlex_state_5 lexbuf - | 4 -> __sedlex_state_7 lexbuf - | 5 -> 4 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_2 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 1; - (match __sedlex_partition_51 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_3 lexbuf - | _ -> 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_3 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_5 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_11 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 0 - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_7 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 5; - (match __sedlex_partition_108 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 3 - | 1 -> 2 - | _ -> 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) = line_comment env buf lexbuf in - Comment (env, (mk_comment env start_pos end_pos buf false)) - | 3 -> - 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)) - | 4 -> - let start = start_pos_of_lexbuf env lexbuf in - let cooked = Buffer.create 127 in - let raw = Buffer.create 127 in - let literal = Buffer.create 127 in - (Buffer.add_string literal "}"; - (let (env, is_tail) = template_part env cooked raw literal 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, - { - cooked = (Buffer.contents cooked); - raw = (Buffer.contents raw); - literal = (Buffer.contents literal) - }, is_tail))))) - | 5 -> - let env = illegal env (loc_of_lexbuf env lexbuf) in - Token - (env, - (T_TEMPLATE_PART - ((loc_of_lexbuf env lexbuf), - { cooked = ""; raw = ""; literal = "" }, true))) - | _ -> failwith "unreachable template_tail") -let type_token env lexbuf = - let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_126 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 62 - | 1 -> 63 - | 2 -> __sedlex_state_3 lexbuf - | 3 -> 0 - | 4 -> __sedlex_state_6 lexbuf - | 5 -> 6 - | 6 -> 61 - | 7 -> __sedlex_state_10 lexbuf - | 8 -> 56 - | 9 -> 38 - | 10 -> 39 - | 11 -> __sedlex_state_20 lexbuf - | 12 -> 59 - | 13 -> 43 - | 14 -> __sedlex_state_24 lexbuf - | 15 -> __sedlex_state_97 lexbuf - | 16 -> __sedlex_state_100 lexbuf - | 17 -> __sedlex_state_117 lexbuf - | 18 -> __sedlex_state_118 lexbuf - | 19 -> 44 - | 20 -> 42 - | 21 -> 49 - | 22 -> __sedlex_state_122 lexbuf - | 23 -> 50 - | 24 -> __sedlex_state_125 lexbuf - | 25 -> 32 - | 26 -> __sedlex_state_128 lexbuf - | 27 -> 33 - | 28 -> __sedlex_state_137 lexbuf - | 29 -> __sedlex_state_139 lexbuf - | 30 -> 35 - | _ -> 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_10 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 63; - (match __sedlex_partition_73 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_11 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_11 = - function - | lexbuf -> - (match __sedlex_partition_127 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_12 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_12 = - function - | lexbuf -> - (match __sedlex_partition_75 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_13 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_13 = - function - | lexbuf -> - (match __sedlex_partition_73 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_14 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_14 = - function - | lexbuf -> - (match __sedlex_partition_128 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_15 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_15 = - function - | lexbuf -> - (match __sedlex_partition_93 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 31 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_20 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 53; - (match __sedlex_partition_13 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 4 - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_24 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 60; - (match __sedlex_partition_123 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_25 lexbuf - | 1 -> __sedlex_state_26 lexbuf - | 2 -> __sedlex_state_47 lexbuf - | 3 -> __sedlex_state_94 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_25 = - function - | lexbuf -> - (match __sedlex_partition_123 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_25 lexbuf - | 1 -> __sedlex_state_26 lexbuf - | 2 -> __sedlex_state_47 lexbuf - | 3 -> __sedlex_state_94 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_26 = - function - | lexbuf -> - (match __sedlex_partition_33 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_27 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_27 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 30; - (match __sedlex_partition_59 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_28 lexbuf - | 1 -> __sedlex_state_27 lexbuf - | 2 -> __sedlex_state_29 lexbuf - | 3 -> __sedlex_state_43 lexbuf - | 4 -> __sedlex_state_45 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_28 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 29; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_28 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_29 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 29; - (match __sedlex_partition_61 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_28 lexbuf - | 1 -> __sedlex_state_30 lexbuf - | 2 -> __sedlex_state_38 lexbuf - | 3 -> __sedlex_state_42 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_30 = - function - | lexbuf -> - (match __sedlex_partition_40 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_31 lexbuf - | 1 -> __sedlex_state_35 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_31 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 24; - (match __sedlex_partition_62 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_32 lexbuf - | 1 -> __sedlex_state_31 lexbuf - | 2 -> __sedlex_state_33 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_32 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 23; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_32 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_33 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 22; - (match __sedlex_partition_63 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_34 lexbuf - | 1 -> __sedlex_state_32 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_34 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 21; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_34 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_35 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 24; - (match __sedlex_partition_64 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_32 lexbuf - | 1 -> __sedlex_state_35 lexbuf - | 2 -> __sedlex_state_36 lexbuf - | 3 -> __sedlex_state_33 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_36 = - function - | lexbuf -> - (match __sedlex_partition_33 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_37 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_37 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 24; - (match __sedlex_partition_64 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_32 lexbuf - | 1 -> __sedlex_state_37 lexbuf - | 2 -> __sedlex_state_36 lexbuf - | 3 -> __sedlex_state_33 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_38 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 24; - (match __sedlex_partition_62 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_39 lexbuf - | 1 -> __sedlex_state_38 lexbuf - | 2 -> __sedlex_state_40 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_39 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 23; - (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 22; - (match __sedlex_partition_63 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_41 lexbuf - | 1 -> __sedlex_state_39 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_41 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 21; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_41 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_42 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 24; - (match __sedlex_partition_64 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_39 lexbuf - | 1 -> __sedlex_state_42 lexbuf - | 2 -> __sedlex_state_36 lexbuf - | 3 -> __sedlex_state_40 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_43 = - function - | lexbuf -> - (match __sedlex_partition_33 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_44 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_44 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 30; - (match __sedlex_partition_59 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_28 lexbuf - | 1 -> __sedlex_state_44 lexbuf - | 2 -> __sedlex_state_29 lexbuf - | 3 -> __sedlex_state_43 lexbuf - | 4 -> __sedlex_state_45 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_45 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 27; - (match __sedlex_partition_63 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_46 lexbuf - | 1 -> __sedlex_state_28 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_46 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 25; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_46 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_47 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 30; - (match __sedlex_partition_76 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_28 lexbuf - | 1 -> __sedlex_state_48 lexbuf - | 2 -> __sedlex_state_52 lexbuf - | 3 -> __sedlex_state_61 lexbuf - | 4 -> __sedlex_state_64 lexbuf - | 5 -> __sedlex_state_29 lexbuf - | 6 -> __sedlex_state_74 lexbuf - | 7 -> __sedlex_state_84 lexbuf - | 8 -> __sedlex_state_62 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_48 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 30; - (match __sedlex_partition_77 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_28 lexbuf - | 1 -> __sedlex_state_49 lexbuf - | 2 -> __sedlex_state_29 lexbuf - | 3 -> __sedlex_state_45 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_49 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 30; - (match __sedlex_partition_59 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_28 lexbuf - | 1 -> __sedlex_state_49 lexbuf - | 2 -> __sedlex_state_29 lexbuf - | 3 -> __sedlex_state_50 lexbuf - | 4 -> __sedlex_state_45 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_50 = - function - | lexbuf -> - (match __sedlex_partition_33 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_51 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_51 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 30; - (match __sedlex_partition_59 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_28 lexbuf - | 1 -> __sedlex_state_51 lexbuf - | 2 -> __sedlex_state_29 lexbuf - | 3 -> __sedlex_state_50 lexbuf - | 4 -> __sedlex_state_45 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_52 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 16; - (match __sedlex_partition_78 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_53 lexbuf - | 1 -> __sedlex_state_54 lexbuf - | 2 -> __sedlex_state_52 lexbuf - | 3 -> __sedlex_state_58 lexbuf - | 4 -> __sedlex_state_59 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_53 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 15; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_53 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_54 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 30; - (match __sedlex_partition_62 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_28 lexbuf - | 1 -> __sedlex_state_55 lexbuf - | 2 -> __sedlex_state_45 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_55 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 30; - (match __sedlex_partition_64 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_28 lexbuf - | 1 -> __sedlex_state_55 lexbuf - | 2 -> __sedlex_state_56 lexbuf - | 3 -> __sedlex_state_45 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_56 = - function - | lexbuf -> - (match __sedlex_partition_33 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_57 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_57 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 30; - (match __sedlex_partition_64 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_28 lexbuf - | 1 -> __sedlex_state_57 lexbuf - | 2 -> __sedlex_state_56 lexbuf - | 3 -> __sedlex_state_45 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_58 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 15; - (match __sedlex_partition_79 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_53 lexbuf - | 1 -> __sedlex_state_54 lexbuf - | 2 -> __sedlex_state_58 lexbuf - | 3 -> __sedlex_state_59 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_59 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 15; - (match __sedlex_partition_63 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_60 lexbuf - | 1 -> __sedlex_state_53 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_60 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 15; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_60 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_61 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 30; - (match __sedlex_partition_79 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_28 lexbuf - | 1 -> __sedlex_state_54 lexbuf - | 2 -> __sedlex_state_61 lexbuf - | 3 -> __sedlex_state_62 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_62 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 28; - (match __sedlex_partition_63 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_63 lexbuf - | 1 -> __sedlex_state_28 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_63 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 26; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_63 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_64 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 29; - (match __sedlex_partition_80 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_28 lexbuf - | 1 -> __sedlex_state_65 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_65 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 10; - (match __sedlex_partition_81 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_66 lexbuf - | 1 -> __sedlex_state_65 lexbuf - | 2 -> __sedlex_state_67 lexbuf - | 3 -> __sedlex_state_72 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_66 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 9; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_66 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_67 = - function - | lexbuf -> - (match __sedlex_partition_26 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_68 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_68 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 10; - (match __sedlex_partition_81 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_69 lexbuf - | 1 -> __sedlex_state_68 lexbuf - | 2 -> __sedlex_state_67 lexbuf - | 3 -> __sedlex_state_70 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_69 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 9; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_69 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_70 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 8; - (match __sedlex_partition_63 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_71 lexbuf - | 1 -> __sedlex_state_69 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_71 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 7; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_71 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_72 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 8; - (match __sedlex_partition_63 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_73 lexbuf - | 1 -> __sedlex_state_66 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_73 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 7; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_73 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_74 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 29; - (match __sedlex_partition_82 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_28 lexbuf - | 1 -> __sedlex_state_75 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_75 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 14; - (match __sedlex_partition_83 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_76 lexbuf - | 1 -> __sedlex_state_75 lexbuf - | 2 -> __sedlex_state_77 lexbuf - | 3 -> __sedlex_state_82 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_76 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 13; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_76 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_77 = - function - | lexbuf -> - (match __sedlex_partition_17 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_78 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_78 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 14; - (match __sedlex_partition_83 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_79 lexbuf - | 1 -> __sedlex_state_78 lexbuf - | 2 -> __sedlex_state_77 lexbuf - | 3 -> __sedlex_state_80 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_79 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 13; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_79 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_80 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 12; - (match __sedlex_partition_63 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_81 lexbuf - | 1 -> __sedlex_state_79 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_81 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 11; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_81 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_82 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 12; - (match __sedlex_partition_63 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_83 lexbuf - | 1 -> __sedlex_state_76 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_83 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 11; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_83 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_84 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 29; - (match __sedlex_partition_84 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_28 lexbuf - | 1 -> __sedlex_state_85 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_85 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 20; - (match __sedlex_partition_85 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_86 lexbuf - | 1 -> __sedlex_state_85 lexbuf - | 2 -> __sedlex_state_87 lexbuf - | 3 -> __sedlex_state_92 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_86 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 19; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_86 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_87 = - function - | lexbuf -> - (match __sedlex_partition_4 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_88 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_88 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 20; - (match __sedlex_partition_85 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_89 lexbuf - | 1 -> __sedlex_state_88 lexbuf - | 2 -> __sedlex_state_87 lexbuf - | 3 -> __sedlex_state_90 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_89 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 19; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_89 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_90 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 18; - (match __sedlex_partition_63 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_91 lexbuf - | 1 -> __sedlex_state_89 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_91 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 17; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_91 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_92 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 18; - (match __sedlex_partition_63 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_93 lexbuf - | 1 -> __sedlex_state_86 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_93 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 17; - (match __sedlex_partition_60 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_93 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_94 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 30; - (match __sedlex_partition_86 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_28 lexbuf - | 1 -> __sedlex_state_48 lexbuf - | 2 -> __sedlex_state_94 lexbuf - | 3 -> __sedlex_state_29 lexbuf - | 4 -> __sedlex_state_95 lexbuf - | 5 -> __sedlex_state_62 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_95 = - function - | lexbuf -> - (match __sedlex_partition_33 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_96 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_96 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 30; - (match __sedlex_partition_87 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_28 lexbuf - | 1 -> __sedlex_state_54 lexbuf - | 2 -> __sedlex_state_96 lexbuf - | 3 -> __sedlex_state_95 lexbuf - | 4 -> __sedlex_state_62 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_97 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 41; - (match __sedlex_partition_47 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_98 lexbuf - | 1 -> __sedlex_state_27 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_98 = - function - | lexbuf -> - (match __sedlex_partition_58 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 40 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_100 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 63; - (match __sedlex_partition_108 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_101 lexbuf - | 1 -> 5 - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_101 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 2; - (match __sedlex_partition_65 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_102 lexbuf - | 1 -> __sedlex_state_103 lexbuf - | 2 -> __sedlex_state_105 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_102 = - function - | lexbuf -> - (match __sedlex_partition_65 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_102 lexbuf - | 1 -> __sedlex_state_103 lexbuf - | 2 -> __sedlex_state_105 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_103 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 3; - (match __sedlex_partition_66 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 3 - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_105 = - function - | lexbuf -> - (match __sedlex_partition_67 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_106 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_106 = - function - | lexbuf -> - (match __sedlex_partition_68 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_107 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_107 = - function - | lexbuf -> - (match __sedlex_partition_69 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_108 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_108 = - function - | lexbuf -> - (match __sedlex_partition_70 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_109 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_109 = - function - | lexbuf -> - (match __sedlex_partition_71 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_110 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_110 = - function - | lexbuf -> - (match __sedlex_partition_72 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_111 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_111 = - function - | lexbuf -> - (match __sedlex_partition_73 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_112 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_112 = - function - | lexbuf -> - (match __sedlex_partition_67 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_113 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_113 = - function - | lexbuf -> - (match __sedlex_partition_2 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_114 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_114 = - function - | lexbuf -> - (match __sedlex_partition_74 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_115 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_115 = - function - | lexbuf -> - (match __sedlex_partition_75 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 3 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_117 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 30; - (match __sedlex_partition_76 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_28 lexbuf - | 1 -> __sedlex_state_48 lexbuf - | 2 -> __sedlex_state_52 lexbuf - | 3 -> __sedlex_state_61 lexbuf - | 4 -> __sedlex_state_64 lexbuf - | 5 -> __sedlex_state_29 lexbuf - | 6 -> __sedlex_state_74 lexbuf - | 7 -> __sedlex_state_84 lexbuf - | 8 -> __sedlex_state_62 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_118 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 30; - (match __sedlex_partition_86 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_28 lexbuf - | 1 -> __sedlex_state_48 lexbuf - | 2 -> __sedlex_state_94 lexbuf - | 3 -> __sedlex_state_29 lexbuf - | 4 -> __sedlex_state_95 lexbuf - | 5 -> __sedlex_state_62 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_122 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 51; - (match __sedlex_partition_129 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 57 - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_125 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 46; - (match __sedlex_partition_58 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 45 - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_128 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 63; - (match __sedlex_partition_2 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_129 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_129 = - function - | lexbuf -> - (match __sedlex_partition_3 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_130 lexbuf - | 1 -> __sedlex_state_134 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_130 = - function - | lexbuf -> - (match __sedlex_partition_4 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_131 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_131 = - function - | lexbuf -> - (match __sedlex_partition_4 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_132 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_132 = - function - | lexbuf -> - (match __sedlex_partition_4 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 61 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_134 = - function - | lexbuf -> - (match __sedlex_partition_4 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_135 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_135 = - function - | lexbuf -> - (match __sedlex_partition_5 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_135 lexbuf - | 1 -> 61 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_137 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 34; - (match __sedlex_partition_130 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 36 - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_139 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 55; - (match __sedlex_partition_131 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 37 - | _ -> 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 pattern; - (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 -> - 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))))) - | 7 -> - recover env lexbuf - ~f:(fun env -> - fun lexbuf -> - let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_120 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | 1 -> __sedlex_state_2 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_1 = - function - | lexbuf -> - (match __sedlex_partition_121 - (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 -> - (match __sedlex_partition_25 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_3 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_3 = - function - | lexbuf -> - (match __sedlex_partition_26 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_4 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_4 = - function - | lexbuf -> - (match __sedlex_partition_27 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_4 lexbuf - | 1 -> __sedlex_state_5 lexbuf - | 2 -> 0 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_5 = - function - | lexbuf -> - (match __sedlex_partition_26 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_6 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_6 = - function - | lexbuf -> - (match __sedlex_partition_27 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_6 lexbuf - | 1 -> __sedlex_state_5 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_120 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | 1 -> __sedlex_state_2 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_1 = - function - | lexbuf -> - (match __sedlex_partition_121 - (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 -> - (match __sedlex_partition_25 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_3 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_3 = - function - | lexbuf -> - (match __sedlex_partition_26 - (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_28 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_4 lexbuf - | 1 -> __sedlex_state_5 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_5 = - function - | lexbuf -> - (match __sedlex_partition_26 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_6 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_6 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_28 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_6 lexbuf - | 1 -> __sedlex_state_5 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_120 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | 1 -> __sedlex_state_2 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_1 = - function - | lexbuf -> - (match __sedlex_partition_121 - (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 -> - (match __sedlex_partition_29 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_3 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_3 = - function - | lexbuf -> - (match __sedlex_partition_17 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_4 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_4 = - function - | lexbuf -> - (match __sedlex_partition_30 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_4 lexbuf - | 1 -> __sedlex_state_5 lexbuf - | 2 -> 0 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_5 = - function - | lexbuf -> - (match __sedlex_partition_17 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_6 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_6 = - function - | lexbuf -> - (match __sedlex_partition_30 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_6 lexbuf - | 1 -> __sedlex_state_5 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_120 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | 1 -> __sedlex_state_2 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_1 = - function - | lexbuf -> - (match __sedlex_partition_121 - (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 -> - (match __sedlex_partition_29 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_3 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_3 = - function - | lexbuf -> - (match __sedlex_partition_17 - (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_31 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_4 lexbuf - | 1 -> __sedlex_state_5 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_5 = - function - | lexbuf -> - (match __sedlex_partition_17 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_6 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_6 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_31 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_6 lexbuf - | 1 -> __sedlex_state_5 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_120 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | 1 -> __sedlex_state_2 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_1 = - function - | lexbuf -> - (match __sedlex_partition_121 - (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 -> - (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_17 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __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 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_120 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | 1 -> __sedlex_state_2 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_1 = - function - | lexbuf -> - (match __sedlex_partition_121 - (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 -> - (match __sedlex_partition_34 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_3 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_3 = - function - | lexbuf -> - (match __sedlex_partition_4 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_4 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_4 = - function - | lexbuf -> - (match __sedlex_partition_35 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_4 lexbuf - | 1 -> __sedlex_state_5 lexbuf - | 2 -> 0 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_5 = - function - | lexbuf -> - (match __sedlex_partition_4 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_6 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_6 = - function - | lexbuf -> - (match __sedlex_partition_35 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_6 lexbuf - | 1 -> __sedlex_state_5 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_120 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | 1 -> __sedlex_state_2 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_1 = - function - | lexbuf -> - (match __sedlex_partition_121 - (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 -> - (match __sedlex_partition_34 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_3 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_3 = - function - | lexbuf -> - (match __sedlex_partition_4 - (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_36 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_4 lexbuf - | 1 -> __sedlex_state_5 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_5 = - function - | lexbuf -> - (match __sedlex_partition_4 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_6 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_6 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_36 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_6 lexbuf - | 1 -> __sedlex_state_5 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_122 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | 1 -> __sedlex_state_2 lexbuf - | 2 -> __sedlex_state_13 lexbuf - | 3 -> __sedlex_state_18 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_1 = - function - | lexbuf -> - (match __sedlex_partition_123 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | 1 -> __sedlex_state_2 lexbuf - | 2 -> __sedlex_state_13 lexbuf - | 3 -> __sedlex_state_18 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_2 = - function - | lexbuf -> - (match __sedlex_partition_33 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_3 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_3 = - function - | lexbuf -> - (match __sedlex_partition_38 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_3 lexbuf - | 1 -> __sedlex_state_4 lexbuf - | 2 -> __sedlex_state_11 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_4 = - function - | lexbuf -> - (match __sedlex_partition_39 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_5 lexbuf - | 1 -> __sedlex_state_6 lexbuf - | 2 -> __sedlex_state_8 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_5 = - function - | lexbuf -> - (match __sedlex_partition_40 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_6 lexbuf - | 1 -> __sedlex_state_8 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_6 = - function - | lexbuf -> - (match __sedlex_partition_41 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_6 lexbuf - | 1 -> 0 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_8 = - function - | lexbuf -> - (match __sedlex_partition_42 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_8 lexbuf - | 1 -> __sedlex_state_9 lexbuf - | 2 -> 0 - | _ -> 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_42 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_10 lexbuf - | 1 -> __sedlex_state_9 lexbuf - | 2 -> 0 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_11 = - function - | lexbuf -> - (match __sedlex_partition_33 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_12 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_12 = - function - | lexbuf -> - (match __sedlex_partition_38 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_12 lexbuf - | 1 -> __sedlex_state_4 lexbuf - | 2 -> __sedlex_state_11 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_13 = - function - | lexbuf -> - (match __sedlex_partition_43 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_14 lexbuf - | 1 -> __sedlex_state_4 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_14 = - function - | lexbuf -> - (match __sedlex_partition_44 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_15 lexbuf - | 1 -> __sedlex_state_4 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_4 lexbuf - | 2 -> __sedlex_state_16 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_16 = - function - | lexbuf -> - (match __sedlex_partition_33 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_17 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_17 = - function - | lexbuf -> - (match __sedlex_partition_38 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_17 lexbuf - | 1 -> __sedlex_state_4 lexbuf - | 2 -> __sedlex_state_16 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_18 = - function - | lexbuf -> - (match __sedlex_partition_45 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_14 lexbuf - | 1 -> __sedlex_state_18 lexbuf - | 2 -> __sedlex_state_4 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 - let env = lex_error env loc Parse_error.InvalidSciBigInt in - 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_122 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | 1 -> __sedlex_state_2 lexbuf - | 2 -> __sedlex_state_12 lexbuf - | 3 -> __sedlex_state_17 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_1 = - function - | lexbuf -> - (match __sedlex_partition_123 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | 1 -> __sedlex_state_2 lexbuf - | 2 -> __sedlex_state_12 lexbuf - | 3 -> __sedlex_state_17 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_2 = - function - | lexbuf -> - (match __sedlex_partition_33 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_3 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_3 = - function - | lexbuf -> - (match __sedlex_partition_38 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_3 lexbuf - | 1 -> __sedlex_state_4 lexbuf - | 2 -> __sedlex_state_10 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_4 = - function - | lexbuf -> - (match __sedlex_partition_39 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_5 lexbuf - | 1 -> __sedlex_state_6 lexbuf - | 2 -> __sedlex_state_7 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_5 = - function - | lexbuf -> - (match __sedlex_partition_40 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_6 lexbuf - | 1 -> __sedlex_state_7 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_6 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_7 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_46 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_7 lexbuf - | 1 -> __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_46 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_9 lexbuf - | 1 -> __sedlex_state_8 lexbuf - | _ -> 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_4 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_4 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_4 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_4 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_4 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_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 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_122 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | 1 -> __sedlex_state_2 lexbuf - | 2 -> __sedlex_state_7 lexbuf - | 3 -> __sedlex_state_9 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_1 = - function - | lexbuf -> - (match __sedlex_partition_123 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | 1 -> __sedlex_state_2 lexbuf - | 2 -> __sedlex_state_7 lexbuf - | 3 -> __sedlex_state_9 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_2 = - function - | lexbuf -> - (match __sedlex_partition_33 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_3 lexbuf - | _ -> 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) - and __sedlex_state_7 = - function - | lexbuf -> - (match __sedlex_partition_47 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_8 lexbuf - | 1 -> __sedlex_state_7 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_8 = - function - | lexbuf -> - (match __sedlex_partition_41 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_3 lexbuf - | 1 -> 0 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_9 = - function - | lexbuf -> - (match __sedlex_partition_48 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_8 lexbuf - | 1 -> __sedlex_state_9 lexbuf - | 2 -> __sedlex_state_10 lexbuf - | _ -> 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_48 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_8 lexbuf - | 1 -> __sedlex_state_11 lexbuf - | 2 -> __sedlex_state_10 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_124 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | 1 -> __sedlex_state_2 lexbuf - | 2 -> __sedlex_state_4 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_1 = - function - | lexbuf -> - (match __sedlex_partition_125 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | 1 -> __sedlex_state_2 lexbuf - | 2 -> __sedlex_state_4 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_2 = - 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_4 = - function - | lexbuf -> - (match __sedlex_partition_42 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_4 lexbuf - | 1 -> __sedlex_state_5 lexbuf - | 2 -> 0 - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_5 = - function - | lexbuf -> - (match __sedlex_partition_33 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_6 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_6 = - function - | lexbuf -> - (match __sedlex_partition_42 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_6 lexbuf - | 1 -> __sedlex_state_5 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 - let env = lex_error env loc Parse_error.InvalidFloatBigInt in - Token (env, (mk_bignum_singleton BIG_NORMAL num)) - | 28 -> - let num = Sedlexing.lexeme lexbuf in - 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_122 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | 1 -> __sedlex_state_7 lexbuf - | 2 -> __sedlex_state_11 lexbuf - | 3 -> __sedlex_state_13 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_1 = - function - | lexbuf -> - (match __sedlex_partition_125 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_1 lexbuf - | 1 -> __sedlex_state_2 lexbuf - | 2 -> __sedlex_state_4 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_2 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_47 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 0 - | 1 -> __sedlex_state_2 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_4 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_48 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 0 - | 1 -> __sedlex_state_4 lexbuf - | 2 -> __sedlex_state_5 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_5 = - function - | lexbuf -> - (match __sedlex_partition_33 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_6 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_6 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_48 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 0 - | 1 -> __sedlex_state_6 lexbuf - | 2 -> __sedlex_state_5 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_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 -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_46 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_10 lexbuf - | 1 -> __sedlex_state_9 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_11 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_47 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_12 lexbuf - | 1 -> __sedlex_state_11 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_12 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_33 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_8 lexbuf - | _ -> Sedlexing.backtrack lexbuf)) - and __sedlex_state_13 = - function - | lexbuf -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_48 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_12 lexbuf - | 1 -> __sedlex_state_13 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 -> - (Sedlexing.mark lexbuf 0; - (match __sedlex_partition_48 - (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_12 lexbuf - | 1 -> __sedlex_state_15 lexbuf - | 2 -> __sedlex_state_14 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)) - | 31 -> Token (env, T_CHECKS) - | 32 -> Token (env, T_LBRACKET) - | 33 -> Token (env, T_RBRACKET) - | 34 -> Token (env, T_LCURLY) - | 35 -> Token (env, T_RCURLY) - | 36 -> Token (env, T_LCURLYBAR) - | 37 -> Token (env, T_RCURLYBAR) - | 38 -> Token (env, T_LPAREN) - | 39 -> Token (env, T_RPAREN) - | 40 -> Token (env, T_ELLIPSIS) - | 41 -> Token (env, T_PERIOD) - | 42 -> Token (env, T_SEMICOLON) - | 43 -> Token (env, T_COMMA) - | 44 -> Token (env, T_COLON) - | 45 -> Token (env, T_PLING_PERIOD) - | 46 -> Token (env, T_PLING) - | 47 -> Token (env, T_LBRACKET) - | 48 -> Token (env, T_RBRACKET) - | 49 -> Token (env, T_LESS_THAN) - | 50 -> Token (env, T_GREATER_THAN) - | 51 -> Token (env, T_ASSIGN) - | 52 -> Token (env, T_PLING) - | 53 -> Token (env, T_MULT) - | 54 -> Token (env, T_COLON) - | 55 -> Token (env, T_BIT_OR) - | 56 -> Token (env, T_BIT_AND) - | 57 -> Token (env, T_ARROW) - | 58 -> Token (env, T_ASSIGN) - | 59 -> Token (env, T_PLUS) - | 60 -> Token (env, T_MINUS) - | 61 -> - 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; - (let raw = Sedlexing.lexeme lexbuf in - let (env, value) = decode_identifier env raw in - match value with - | "any" -> Token (env, T_ANY_TYPE) - | "bool" -> Token (env, (T_BOOLEAN_TYPE BOOL)) - | "boolean" -> Token (env, (T_BOOLEAN_TYPE BOOLEAN)) - | "empty" -> Token (env, T_EMPTY_TYPE) - | "extends" -> Token (env, T_EXTENDS) - | "false" -> Token (env, T_FALSE) - | "interface" -> Token (env, T_INTERFACE) - | "mixed" -> Token (env, T_MIXED_TYPE) - | "null" -> Token (env, T_NULL) - | "number" -> Token (env, T_NUMBER_TYPE) - | "bigint" -> Token (env, T_BIGINT_TYPE) - | "static" -> Token (env, T_STATIC) - | "string" -> Token (env, T_STRING_TYPE) - | "true" -> Token (env, T_TRUE) - | "typeof" -> Token (env, T_TYPEOF) - | "void" -> Token (env, T_VOID_TYPE) - | "symbol" -> Token (env, T_SYMBOL_TYPE) - | _ -> - Token - (env, - (T_IDENTIFIER - { loc; value; raw = (Sedlexing.string_of_utf8 raw) }))))) - | 62 -> - 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) - | 63 -> Token (env, (T_ERROR (lexeme lexbuf))) - | _ -> failwith "unreachable type_token") -let jsx_child env = - let start = end_pos_of_lexbuf env env.lex_lb in - let buf = Buffer.create 127 in - let raw = Buffer.create 127 in - let (env, child) = jsx_child env start buf raw env.lex_lb in - let loc = loc_of_token env child in - let lex_errors_acc = (env.lex_state).lex_errors_acc in - if lex_errors_acc = [] - then - (env, - { - Lex_result.lex_token = child; - lex_loc = loc; - lex_comments = []; - lex_errors = [] - }) - else - ({ env with lex_state = { lex_errors_acc = [] } }, - { - Lex_result.lex_token = child; - lex_loc = loc; - lex_comments = []; - lex_errors = (List.rev lex_errors_acc) - }) -let wrap f = - let rec helper comments env = - match f env env.lex_lb with - | Token (env, t) -> - let loc = loc_of_token env t in - let lex_comments = if comments = [] then [] else List.rev comments in - let lex_token = t in - let lex_errors_acc = (env.lex_state).lex_errors_acc in - if lex_errors_acc = [] - then - ({ env with lex_last_loc = loc }, - { - Lex_result.lex_token = lex_token; - lex_loc = loc; - lex_comments; - lex_errors = [] - }) - else - ({ env with lex_last_loc = loc; lex_state = Lex_env.empty_lex_state - }, - { - Lex_result.lex_token = lex_token; - lex_loc = loc; - lex_comments; - lex_errors = (List.rev lex_errors_acc) - }) - | Comment (env, ((loc, _) as comment)) -> - let env = { env with lex_last_loc = loc } in - helper (comment :: comments) env - | Continue env -> helper comments env in - fun env -> helper [] env -let regexp = wrap regexp -let jsx_tag = wrap jsx_tag -let template_tail = wrap template_tail -let type_token = wrap type_token -let token = wrap token -let is_valid_identifier_name lexbuf = - let rec __sedlex_state_0 = - function - | lexbuf -> - (match __sedlex_partition_132 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 0 - | 1 -> __sedlex_state_2 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_2 = - function - | lexbuf -> - (match __sedlex_partition_2 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_3 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_3 = - function - | lexbuf -> - (match __sedlex_partition_3 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_4 lexbuf - | 1 -> __sedlex_state_7 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 -> - (match __sedlex_partition_4 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_6 lexbuf - | _ -> Sedlexing.backtrack lexbuf) - and __sedlex_state_6 = - function - | lexbuf -> - (match __sedlex_partition_4 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> 0 - | _ -> 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_5 (Sedlexing.__private__next_int lexbuf) - with - | 0 -> __sedlex_state_8 lexbuf - | 1 -> 0 - | _ -> Sedlexing.backtrack lexbuf) in - Sedlexing.start lexbuf; - (match __sedlex_state_0 lexbuf with - | 0 -> loop_id_continues lexbuf - | _ -> false) \ No newline at end of file diff --git a/compiler/js_parser/flow_lexer.mli b/compiler/js_parser/flow_lexer.mli deleted file mode 100644 index 8609d22453..0000000000 --- a/compiler/js_parser/flow_lexer.mli +++ /dev/null @@ -1,20 +0,0 @@ -(* - * 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. - *) - -val jsx_child : Lex_env.t -> Lex_env.t * Lex_result.t - -val regexp : Lex_env.t -> Lex_env.t * Lex_result.t - -val jsx_tag : Lex_env.t -> Lex_env.t * Lex_result.t - -val template_tail : Lex_env.t -> Lex_env.t * Lex_result.t - -val type_token : Lex_env.t -> Lex_env.t * Lex_result.t - -val token : Lex_env.t -> Lex_env.t * Lex_result.t - -val is_valid_identifier_name : Flow_sedlexing.lexbuf -> bool diff --git a/compiler/js_parser/flow_sedlexing.ml b/compiler/js_parser/flow_sedlexing.ml deleted file mode 100644 index 1aec0e2ee5..0000000000 --- a/compiler/js_parser/flow_sedlexing.ml +++ /dev/null @@ -1,287 +0,0 @@ -(* The package sedlex is released under the terms of an MIT-like license. *) -(* See the attached LICENSE file. *) -(* Copyright 2005, 2013 by Alain Frisch and LexiFi. *) -external ( .!()<- ) : int array -> int -> int -> unit = "%array_unsafe_set" -external ( .!() ) : int array -> int -> int = "%array_unsafe_get" -external ( .![] ) : string -> int -> char = "%string_unsafe_get" -external ( .![]<- ) : bytes -> int -> char -> unit = "%bytes_unsafe_set" - -exception InvalidCodepoint of int - -exception MalFormed - -(* Absolute position from the beginning of the stream *) -type apos = int - -(* critical states: - [pos] [curr_bol] [curr_line] - The state of [curr_bol] and [curr_line] only changes when we hit a newline - [marked_pos] [marked_bol] [marked_line] - [start_pos] [start_bol] [start_line] - get reset whenever we get a new token -*) -type lexbuf = { - buf: int array; - (* Number of meaningful char in buffer *) - len: int; - (* pos is the index in the buffer *) - mutable pos: int; - (* bol is the index in the input stream but not buffer *) - mutable curr_bol: int; - (* start from 1, if it is 0, we would not track postion info for you *) - mutable curr_line: int; - (* First char we need to keep visible *) - mutable start_pos: int; - mutable start_bol: int; - mutable start_line: int; - mutable marked_pos: int; - mutable marked_bol: int; - mutable marked_line: int; - mutable marked_val: int; -} - - -let lexbuf_clone (x : lexbuf) : lexbuf = - { - buf = x.buf; - len = x.len; - pos = x.pos; - curr_bol = x.curr_bol; - curr_line = x.curr_line; - start_pos = x.start_pos; - start_bol = x.start_bol; - start_line = x.start_line; - marked_pos = x.marked_pos; - marked_bol = x.marked_bol; - marked_line = x.marked_line; - marked_val = x.marked_val; - } - -let empty_lexbuf = - { - buf = [||]; - len = 0; - pos = 0; - curr_bol = 0; - curr_line = 0; - start_pos = 0; - start_bol = 0; - start_line = 0; - marked_pos = 0; - marked_bol = 0; - marked_line = 0; - marked_val = 0; - } - -let from_int_array a = - let len = Array.length a in - { empty_lexbuf with buf = a; len } - -let from_int_sub_array a len = - { empty_lexbuf with buf = a; len } - -let new_line lexbuf = - if lexbuf.curr_line != 0 then lexbuf.curr_line <- lexbuf.curr_line + 1; - lexbuf.curr_bol <- lexbuf.pos - -let next lexbuf : Stdlib.Uchar.t option = - if lexbuf.pos = lexbuf.len then - None - else - let ret = lexbuf.buf.!(lexbuf.pos) in - lexbuf.pos <- lexbuf.pos + 1; - if ret = 10 then new_line lexbuf; - Some (Stdlib.Uchar.unsafe_of_int ret) - -let __private__next_int lexbuf : int = - if lexbuf.pos = lexbuf.len then - -1 - else - let ret = lexbuf.buf.!(lexbuf.pos) in - lexbuf.pos <- lexbuf.pos + 1; - if ret = 10 then new_line lexbuf; - ret - -let mark lexbuf i = - lexbuf.marked_pos <- lexbuf.pos; - lexbuf.marked_bol <- lexbuf.curr_bol; - lexbuf.marked_line <- lexbuf.curr_line; - lexbuf.marked_val <- i - -let start lexbuf = - lexbuf.start_pos <- lexbuf.pos; - lexbuf.start_bol <- lexbuf.curr_bol; - lexbuf.start_line <- lexbuf.curr_line; - mark lexbuf (-1) - -let backtrack lexbuf = - lexbuf.pos <- lexbuf.marked_pos; - lexbuf.curr_bol <- lexbuf.marked_bol; - lexbuf.curr_line <- lexbuf.marked_line; - lexbuf.marked_val - -let rollback lexbuf = - lexbuf.pos <- lexbuf.start_pos; - lexbuf.curr_bol <- lexbuf.start_bol; - lexbuf.curr_line <- lexbuf.start_line - -let lexeme_start lexbuf = lexbuf.start_pos -let set_lexeme_start lexbuf pos = lexbuf.start_pos <- pos -let lexeme_end lexbuf = lexbuf.pos - -let loc lexbuf = (lexbuf.start_pos , lexbuf.pos ) - -let lexeme_length lexbuf = lexbuf.pos - lexbuf.start_pos - -let sub_lexeme lexbuf pos len = Array.sub lexbuf.buf (lexbuf.start_pos + pos) len - -let lexeme lexbuf = Array.sub lexbuf.buf lexbuf.start_pos (lexbuf.pos - lexbuf.start_pos) - -let current_code_point lexbuf = lexbuf.buf.(lexbuf.start_pos) -(* Decode UTF-8 encoded [s] into codepoints in [a], returning the length of the - * decoded string. - * - * To call this function safely: - * - ensure that [slen] is not greater than the length of [s] - * - ensure that [a] has enough capacity to hold the decoded value - *) -let unsafe_utf8_of_string (s : string) slen (a : int array) : int = - let spos = ref 0 in - let apos = ref 0 in - while !spos < slen do - let spos_code = s.![!spos] in - (match spos_code with - | '\000' .. '\127' as c -> - (* U+0000 - U+007F: 0xxxxxxx *) - a.!(!apos) <- Char.code c; - incr spos - | '\192' .. '\223' as c -> - (* U+0080 - U+07FF: 110xxxxx 10xxxxxx *) - let n1 = Char.code c in - let n2 = Char.code s.![!spos + 1] in - if n2 lsr 6 != 0b10 then raise MalFormed; - a.!(!apos) <- ((n1 land 0x1f) lsl 6) lor (n2 land 0x3f); - spos := !spos + 2 - | '\224' .. '\239' as c -> - (* U+0800 - U+FFFF: 1110xxxx 10xxxxxx 10xxxxxx - U+D800 - U+DFFF are reserved for surrogate halves (RFC 3629) *) - let n1 = Char.code c in - let n2 = Char.code s.![!spos + 1] in - let n3 = Char.code s.![!spos + 2] in - let p = ((n1 land 0x0f) lsl 12) lor ((n2 land 0x3f) lsl 6) lor (n3 land 0x3f) in - if (n2 lsr 6 != 0b10 || n3 lsr 6 != 0b10) || (p >= 0xd800 && p <= 0xdfff) then raise MalFormed; - a.!(!apos) <- p; - spos := !spos + 3 - | '\240' .. '\247' as c -> - (* U+10000 - U+1FFFFF: 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx - > U+10FFFF are invalid (RFC 3629) *) - let n1 = Char.code c in - let n2 = Char.code s.![!spos + 1] in - let n3 = Char.code s.![!spos + 2] in - let n4 = Char.code s.![!spos + 3] in - if n2 lsr 6 != 0b10 || n3 lsr 6 != 0b10 || n4 lsr 6 != 0b10 then raise MalFormed; - let p = - ((n1 land 0x07) lsl 18) - lor ((n2 land 0x3f) lsl 12) - lor ((n3 land 0x3f) lsl 6) - lor (n4 land 0x3f) - in - if p > 0x10ffff then raise MalFormed; - a.!(!apos) <- p; - spos := !spos + 4 - | _ -> raise MalFormed); - incr apos - done; - !apos - -(* Encode the decoded codepoints in [a] as UTF-8 into [b], returning the length - * of the encoded string. - * - * To call this function safely: - * - ensure that [offset + len] is not greater than the length of [a] - * - ensure that [b] has sufficient capacity to hold the encoded value - *) -let unsafe_string_of_utf8 (a : int array) ~(offset : int) ~(len : int) (b : bytes) : int = - let apos = ref offset in - let len = ref len in - let i = ref 0 in - while !len > 0 do - let u = a.!(!apos) in - if u < 0 then - raise MalFormed - else if u <= 0x007F then begin - b.![!i] <- Char.unsafe_chr u; - incr i - end else if u <= 0x07FF then ( - b.![!i] <- Char.unsafe_chr (0xC0 lor (u lsr 6)); - b.![!i + 1] <- Char.unsafe_chr (0x80 lor (u land 0x3F)); - i := !i + 2 - ) else if u <= 0xFFFF then ( - b.![!i] <- Char.unsafe_chr (0xE0 lor (u lsr 12)); - b.![!i + 1] <- Char.unsafe_chr (0x80 lor ((u lsr 6) land 0x3F)); - b.![!i + 2] <- Char.unsafe_chr (0x80 lor (u land 0x3F)); - i := !i + 3 - ) else if u <= 0x10FFFF then ( - b.![!i] <- Char.unsafe_chr (0xF0 lor (u lsr 18)); - b.![!i + 1] <- Char.unsafe_chr (0x80 lor ((u lsr 12) land 0x3F)); - b.![!i + 2] <- Char.unsafe_chr (0x80 lor ((u lsr 6) land 0x3F)); - b.![!i + 3] <- Char.unsafe_chr (0x80 lor (u land 0x3F)); - i := !i + 4 - ) else - raise MalFormed; - incr apos; - decr len - done; - !i - -module Utf8 = struct - let from_string s = - let slen = String.length s in - let a = Array.make slen 0 in - let len = unsafe_utf8_of_string s slen a in - from_int_sub_array a len - - let sub_lexeme lexbuf pos len : string = - let offset = lexbuf.start_pos + pos in - let b = Bytes.create (len * 4) in - let buf = lexbuf.buf in - (* Assertion needed, since we make use of unsafe API below *) - assert (offset + len <= Array.length buf); - let i = unsafe_string_of_utf8 buf ~offset ~len b in - Bytes.sub_string b 0 i - - let lexeme lexbuf : string = - let offset = lexbuf.start_pos in - let len = lexbuf.pos - offset in - let b = Bytes.create (len * 4) in - let buf = lexbuf.buf in - let i = unsafe_string_of_utf8 buf ~offset ~len b in - Bytes.sub_string b 0 i - - let lexeme_to_buffer lexbuf buffer : unit = - let offset = lexbuf.start_pos in - let len = lexbuf.pos - offset in - let b = Bytes.create (len * 4) in - let buf = lexbuf.buf in - let i = unsafe_string_of_utf8 buf ~offset ~len b in - Buffer.add_subbytes buffer b 0 i - - let lexeme_to_buffer2 lexbuf buf1 buf2 : unit = - let offset = lexbuf.start_pos in - let len = lexbuf.pos - offset in - let b = Bytes.create (len * 4) in - let buf = lexbuf.buf in - let i = unsafe_string_of_utf8 buf ~offset ~len b in - Buffer.add_subbytes buf1 b 0 i; - Buffer.add_subbytes buf2 b 0 i -end - -let string_of_utf8 (lexbuf : int array) : string = - let offset = 0 in - let len = Array.length lexbuf in - let b = Bytes.create (len * 4) in - let i = unsafe_string_of_utf8 lexbuf ~offset ~len b in - Bytes.sub_string b 0 i - -let backoff lexbuf npos = - lexbuf.pos <- lexbuf.pos - npos diff --git a/compiler/js_parser/flow_sedlexing.mli b/compiler/js_parser/flow_sedlexing.mli deleted file mode 100644 index c0d82db378..0000000000 --- a/compiler/js_parser/flow_sedlexing.mli +++ /dev/null @@ -1,47 +0,0 @@ - -(** 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 - - Utf8.lexeme_to_buffer2 -*) -exception InvalidCodepoint of int -exception MalFormed -type apos = int -type lexbuf -val lexbuf_clone : lexbuf -> lexbuf - -val from_int_array : int array -> lexbuf -val new_line : lexbuf -> unit -val next : lexbuf -> Uchar.t option - -(**/**) -val __private__next_int : lexbuf -> int -(**/**) - -val mark : lexbuf -> int -> unit -val start : lexbuf -> unit -val backtrack : lexbuf -> int -val rollback : lexbuf -> unit -val lexeme_start : lexbuf -> int -val lexeme_end : lexbuf -> int -val loc : lexbuf -> int * int -val lexeme_length : lexbuf -> int -val sub_lexeme : lexbuf -> int -> int -> int array -val lexeme : lexbuf -> int array -module Utf8 : sig - val from_string : string -> lexbuf - val sub_lexeme : lexbuf -> int -> int -> string - val lexeme : lexbuf -> string - (** This API avoids another allocation *) - val lexeme_to_buffer : lexbuf -> Buffer.t -> unit - val lexeme_to_buffer2 : lexbuf -> Buffer.t -> Buffer.t -> unit -end - -val string_of_utf8 : int array -> string - -(** Two APIs used when we want to do customize lexing - instead of using the regex based engine -*) -val current_code_point : lexbuf -> int -val backoff : lexbuf -> int -> unit -val set_lexeme_start : lexbuf -> int -> unit diff --git a/compiler/js_parser/js_id.ml b/compiler/js_parser/js_id.ml deleted file mode 100644 index c5da8d8eb4..0000000000 --- a/compiler/js_parser/js_id.ml +++ /dev/null @@ -1,24 +0,0 @@ -(* - * 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. - *) - -external ( .!() ) : (int * int) array -> int -> int * int = "%array_unsafe_get" - -let rec search (arr : _ array) (start : int) (finish : int) target = - if start > finish then - false - else - let mid = start + ((finish - start) / 2) in - let (a, b) = arr.!(mid) in - if target < a then - search arr start (mid - 1) target - else if target >= b then - search arr (mid + 1) finish target - else - true - -let is_valid_unicode_id (i : int) = - search Js_id_unicode.id_continue 0 (Array.length Js_id_unicode.id_continue - 1) i diff --git a/compiler/js_parser/js_id.mli b/compiler/js_parser/js_id.mli deleted file mode 100644 index 8bcea4ee4e..0000000000 --- a/compiler/js_parser/js_id.mli +++ /dev/null @@ -1,9 +0,0 @@ -(* - * 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. - *) - -(* This test is applied to non-start unicode points *) -val is_valid_unicode_id : int -> bool diff --git a/compiler/js_parser/js_id_unicode.ml b/compiler/js_parser/js_id_unicode.ml deleted file mode 100644 index 0c990437d1..0000000000 --- a/compiler/js_parser/js_id_unicode.ml +++ /dev/null @@ -1,21 +0,0 @@ -(* - * 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. - *) - -(* This lists two valid unicode point ranges in tuple format. - see more details in https://mathiasbynens.be/notes/javascript-identifiers-es6 - TODO: store it in a flat array - add more docs -*) -[@@@ocamlformat "disable"] - -(* JS has stricter rules with start id *) -let id_start = [|36,37;65,91;95,96;97,123;170,171;181,182;186,187;192,215;216,247;248,706;710,722;736,741;748,749;750,751;880,885;886,888;890,894;895,896;902,903;904,907;908,909;910,930;931,1014;1015,1154;1162,1328;1329,1367;1369,1370;1376,1417;1488,1515;1519,1523;1568,1611;1646,1648;1649,1748;1749,1750;1765,1767;1774,1776;1786,1789;1791,1792;1808,1809;1810,1840;1869,1958;1969,1970;1994,2027;2036,2038;2042,2043;2048,2070;2074,2075;2084,2085;2088,2089;2112,2137;2144,2155;2208,2229;2230,2238;2308,2362;2365,2366;2384,2385;2392,2402;2417,2433;2437,2445;2447,2449;2451,2473;2474,2481;2482,2483;2486,2490;2493,2494;2510,2511;2524,2526;2527,2530;2544,2546;2556,2557;2565,2571;2575,2577;2579,2601;2602,2609;2610,2612;2613,2615;2616,2618;2649,2653;2654,2655;2674,2677;2693,2702;2703,2706;2707,2729;2730,2737;2738,2740;2741,2746;2749,2750;2768,2769;2784,2786;2809,2810;2821,2829;2831,2833;2835,2857;2858,2865;2866,2868;2869,2874;2877,2878;2908,2910;2911,2914;2929,2930;2947,2948;2949,2955;2958,2961;2962,2966;2969,2971;2972,2973;2974,2976;2979,2981;2984,2987;2990,3002;3024,3025;3077,3085;3086,3089;3090,3113;3114,3130;3133,3134;3160,3163;3168,3170;3200,3201;3205,3213;3214,3217;3218,3241;3242,3252;3253,3258;3261,3262;3294,3295;3296,3298;3313,3315;3333,3341;3342,3345;3346,3387;3389,3390;3406,3407;3412,3415;3423,3426;3450,3456;3461,3479;3482,3506;3507,3516;3517,3518;3520,3527;3585,3633;3634,3636;3648,3655;3713,3715;3716,3717;3718,3723;3724,3748;3749,3750;3751,3761;3762,3764;3773,3774;3776,3781;3782,3783;3804,3808;3840,3841;3904,3912;3913,3949;3976,3981;4096,4139;4159,4160;4176,4182;4186,4190;4193,4194;4197,4199;4206,4209;4213,4226;4238,4239;4256,4294;4295,4296;4301,4302;4304,4347;4348,4681;4682,4686;4688,4695;4696,4697;4698,4702;4704,4745;4746,4750;4752,4785;4786,4790;4792,4799;4800,4801;4802,4806;4808,4823;4824,4881;4882,4886;4888,4955;4992,5008;5024,5110;5112,5118;5121,5741;5743,5760;5761,5787;5792,5867;5870,5881;5888,5901;5902,5906;5920,5938;5952,5970;5984,5997;5998,6001;6016,6068;6103,6104;6108,6109;6176,6265;6272,6313;6314,6315;6320,6390;6400,6431;6480,6510;6512,6517;6528,6572;6576,6602;6656,6679;6688,6741;6823,6824;6917,6964;6981,6988;7043,7073;7086,7088;7098,7142;7168,7204;7245,7248;7258,7294;7296,7305;7312,7355;7357,7360;7401,7405;7406,7412;7413,7415;7418,7419;7424,7616;7680,7958;7960,7966;7968,8006;8008,8014;8016,8024;8025,8026;8027,8028;8029,8030;8031,8062;8064,8117;8118,8125;8126,8127;8130,8133;8134,8141;8144,8148;8150,8156;8160,8173;8178,8181;8182,8189;8305,8306;8319,8320;8336,8349;8450,8451;8455,8456;8458,8468;8469,8470;8472,8478;8484,8485;8486,8487;8488,8489;8490,8506;8508,8512;8517,8522;8526,8527;8544,8585;11264,11311;11312,11359;11360,11493;11499,11503;11506,11508;11520,11558;11559,11560;11565,11566;11568,11624;11631,11632;11648,11671;11680,11687;11688,11695;11696,11703;11704,11711;11712,11719;11720,11727;11728,11735;11736,11743;12293,12296;12321,12330;12337,12342;12344,12349;12353,12439;12443,12448;12449,12539;12540,12544;12549,12592;12593,12687;12704,12731;12784,12800;13312,19894;19968,40944;40960,42125;42192,42238;42240,42509;42512,42528;42538,42540;42560,42607;42623,42654;42656,42736;42775,42784;42786,42889;42891,42944;42946,42951;42999,43010;43011,43014;43015,43019;43020,43043;43072,43124;43138,43188;43250,43256;43259,43260;43261,43263;43274,43302;43312,43335;43360,43389;43396,43443;43471,43472;43488,43493;43494,43504;43514,43519;43520,43561;43584,43587;43588,43596;43616,43639;43642,43643;43646,43696;43697,43698;43701,43703;43705,43710;43712,43713;43714,43715;43739,43742;43744,43755;43762,43765;43777,43783;43785,43791;43793,43799;43808,43815;43816,43823;43824,43867;43868,43880;43888,44003;44032,55204;55216,55239;55243,55292;63744,64110;64112,64218;64256,64263;64275,64280;64285,64286;64287,64297;64298,64311;64312,64317;64318,64319;64320,64322;64323,64325;64326,64434;64467,64830;64848,64912;64914,64968;65008,65020;65136,65141;65142,65277;65313,65339;65345,65371;65382,65471;65474,65480;65482,65488;65490,65496;65498,65501;65536,65548;65549,65575;65576,65595;65596,65598;65599,65614;65616,65630;65664,65787;65856,65909;66176,66205;66208,66257;66304,66336;66349,66379;66384,66422;66432,66462;66464,66500;66504,66512;66513,66518;66560,66718;66736,66772;66776,66812;66816,66856;66864,66916;67072,67383;67392,67414;67424,67432;67584,67590;67592,67593;67594,67638;67639,67641;67644,67645;67647,67670;67680,67703;67712,67743;67808,67827;67828,67830;67840,67862;67872,67898;67968,68024;68030,68032;68096,68097;68112,68116;68117,68120;68121,68150;68192,68221;68224,68253;68288,68296;68297,68325;68352,68406;68416,68438;68448,68467;68480,68498;68608,68681;68736,68787;68800,68851;68864,68900;69376,69405;69415,69416;69424,69446;69600,69623;69635,69688;69763,69808;69840,69865;69891,69927;69956,69957;69968,70003;70006,70007;70019,70067;70081,70085;70106,70107;70108,70109;70144,70162;70163,70188;70272,70279;70280,70281;70282,70286;70287,70302;70303,70313;70320,70367;70405,70413;70415,70417;70419,70441;70442,70449;70450,70452;70453,70458;70461,70462;70480,70481;70493,70498;70656,70709;70727,70731;70751,70752;70784,70832;70852,70854;70855,70856;71040,71087;71128,71132;71168,71216;71236,71237;71296,71339;71352,71353;71424,71451;71680,71724;71840,71904;71935,71936;72096,72104;72106,72145;72161,72162;72163,72164;72192,72193;72203,72243;72250,72251;72272,72273;72284,72330;72349,72350;72384,72441;72704,72713;72714,72751;72768,72769;72818,72848;72960,72967;72968,72970;72971,73009;73030,73031;73056,73062;73063,73065;73066,73098;73112,73113;73440,73459;73728,74650;74752,74863;74880,75076;77824,78895;82944,83527;92160,92729;92736,92767;92880,92910;92928,92976;92992,92996;93027,93048;93053,93072;93760,93824;93952,94027;94032,94033;94099,94112;94176,94178;94179,94180;94208,100344;100352,101107;110592,110879;110928,110931;110948,110952;110960,111356;113664,113771;113776,113789;113792,113801;113808,113818;119808,119893;119894,119965;119966,119968;119970,119971;119973,119975;119977,119981;119982,119994;119995,119996;119997,120004;120005,120070;120071,120075;120077,120085;120086,120093;120094,120122;120123,120127;120128,120133;120134,120135;120138,120145;120146,120486;120488,120513;120514,120539;120540,120571;120572,120597;120598,120629;120630,120655;120656,120687;120688,120713;120714,120745;120746,120771;120772,120780;123136,123181;123191,123198;123214,123215;123584,123628;124928,125125;125184,125252;125259,125260;126464,126468;126469,126496;126497,126499;126500,126501;126503,126504;126505,126515;126516,126520;126521,126522;126523,126524;126530,126531;126535,126536;126537,126538;126539,126540;126541,126544;126545,126547;126548,126549;126551,126552;126553,126554;126555,126556;126557,126558;126559,126560;126561,126563;126564,126565;126567,126571;126572,126579;126580,126584;126585,126589;126590,126591;126592,126602;126603,126620;126625,126628;126629,126634;126635,126652;131072,173783;173824,177973;177984,178206;178208,183970;183984,191457;194560,195102|] - -(* The followed ID restriction is relaxed, this one - is used in our customized unicode lexing. - *) -let id_continue = [|36,37;48,58;65,91;95,96;97,123;170,171;181,182;183,184;186,187;192,215;216,247;248,706;710,722;736,741;748,749;750,751;768,885;886,888;890,894;895,896;902,907;908,909;910,930;931,1014;1015,1154;1155,1160;1162,1328;1329,1367;1369,1370;1376,1417;1425,1470;1471,1472;1473,1475;1476,1478;1479,1480;1488,1515;1519,1523;1552,1563;1568,1642;1646,1748;1749,1757;1759,1769;1770,1789;1791,1792;1808,1867;1869,1970;1984,2038;2042,2043;2045,2046;2048,2094;2112,2140;2144,2155;2208,2229;2230,2238;2259,2274;2275,2404;2406,2416;2417,2436;2437,2445;2447,2449;2451,2473;2474,2481;2482,2483;2486,2490;2492,2501;2503,2505;2507,2511;2519,2520;2524,2526;2527,2532;2534,2546;2556,2557;2558,2559;2561,2564;2565,2571;2575,2577;2579,2601;2602,2609;2610,2612;2613,2615;2616,2618;2620,2621;2622,2627;2631,2633;2635,2638;2641,2642;2649,2653;2654,2655;2662,2678;2689,2692;2693,2702;2703,2706;2707,2729;2730,2737;2738,2740;2741,2746;2748,2758;2759,2762;2763,2766;2768,2769;2784,2788;2790,2800;2809,2816;2817,2820;2821,2829;2831,2833;2835,2857;2858,2865;2866,2868;2869,2874;2876,2885;2887,2889;2891,2894;2902,2904;2908,2910;2911,2916;2918,2928;2929,2930;2946,2948;2949,2955;2958,2961;2962,2966;2969,2971;2972,2973;2974,2976;2979,2981;2984,2987;2990,3002;3006,3011;3014,3017;3018,3022;3024,3025;3031,3032;3046,3056;3072,3085;3086,3089;3090,3113;3114,3130;3133,3141;3142,3145;3146,3150;3157,3159;3160,3163;3168,3172;3174,3184;3200,3204;3205,3213;3214,3217;3218,3241;3242,3252;3253,3258;3260,3269;3270,3273;3274,3278;3285,3287;3294,3295;3296,3300;3302,3312;3313,3315;3328,3332;3333,3341;3342,3345;3346,3397;3398,3401;3402,3407;3412,3416;3423,3428;3430,3440;3450,3456;3458,3460;3461,3479;3482,3506;3507,3516;3517,3518;3520,3527;3530,3531;3535,3541;3542,3543;3544,3552;3558,3568;3570,3572;3585,3643;3648,3663;3664,3674;3713,3715;3716,3717;3718,3723;3724,3748;3749,3750;3751,3774;3776,3781;3782,3783;3784,3790;3792,3802;3804,3808;3840,3841;3864,3866;3872,3882;3893,3894;3895,3896;3897,3898;3902,3912;3913,3949;3953,3973;3974,3992;3993,4029;4038,4039;4096,4170;4176,4254;4256,4294;4295,4296;4301,4302;4304,4347;4348,4681;4682,4686;4688,4695;4696,4697;4698,4702;4704,4745;4746,4750;4752,4785;4786,4790;4792,4799;4800,4801;4802,4806;4808,4823;4824,4881;4882,4886;4888,4955;4957,4960;4969,4978;4992,5008;5024,5110;5112,5118;5121,5741;5743,5760;5761,5787;5792,5867;5870,5881;5888,5901;5902,5909;5920,5941;5952,5972;5984,5997;5998,6001;6002,6004;6016,6100;6103,6104;6108,6110;6112,6122;6155,6158;6160,6170;6176,6265;6272,6315;6320,6390;6400,6431;6432,6444;6448,6460;6470,6510;6512,6517;6528,6572;6576,6602;6608,6619;6656,6684;6688,6751;6752,6781;6783,6794;6800,6810;6823,6824;6832,6846;6912,6988;6992,7002;7019,7028;7040,7156;7168,7224;7232,7242;7245,7294;7296,7305;7312,7355;7357,7360;7376,7379;7380,7419;7424,7674;7675,7958;7960,7966;7968,8006;8008,8014;8016,8024;8025,8026;8027,8028;8029,8030;8031,8062;8064,8117;8118,8125;8126,8127;8130,8133;8134,8141;8144,8148;8150,8156;8160,8173;8178,8181;8182,8189;8204,8206;8255,8257;8276,8277;8305,8306;8319,8320;8336,8349;8400,8413;8417,8418;8421,8433;8450,8451;8455,8456;8458,8468;8469,8470;8472,8478;8484,8485;8486,8487;8488,8489;8490,8506;8508,8512;8517,8522;8526,8527;8544,8585;11264,11311;11312,11359;11360,11493;11499,11508;11520,11558;11559,11560;11565,11566;11568,11624;11631,11632;11647,11671;11680,11687;11688,11695;11696,11703;11704,11711;11712,11719;11720,11727;11728,11735;11736,11743;11744,11776;12293,12296;12321,12336;12337,12342;12344,12349;12353,12439;12441,12448;12449,12539;12540,12544;12549,12592;12593,12687;12704,12731;12784,12800;13312,19894;19968,40944;40960,42125;42192,42238;42240,42509;42512,42540;42560,42608;42612,42622;42623,42738;42775,42784;42786,42889;42891,42944;42946,42951;42999,43048;43072,43124;43136,43206;43216,43226;43232,43256;43259,43260;43261,43310;43312,43348;43360,43389;43392,43457;43471,43482;43488,43519;43520,43575;43584,43598;43600,43610;43616,43639;43642,43715;43739,43742;43744,43760;43762,43767;43777,43783;43785,43791;43793,43799;43808,43815;43816,43823;43824,43867;43868,43880;43888,44011;44012,44014;44016,44026;44032,55204;55216,55239;55243,55292;63744,64110;64112,64218;64256,64263;64275,64280;64285,64297;64298,64311;64312,64317;64318,64319;64320,64322;64323,64325;64326,64434;64467,64830;64848,64912;64914,64968;65008,65020;65024,65040;65056,65072;65075,65077;65101,65104;65136,65141;65142,65277;65296,65306;65313,65339;65343,65344;65345,65371;65382,65471;65474,65480;65482,65488;65490,65496;65498,65501;65536,65548;65549,65575;65576,65595;65596,65598;65599,65614;65616,65630;65664,65787;65856,65909;66045,66046;66176,66205;66208,66257;66272,66273;66304,66336;66349,66379;66384,66427;66432,66462;66464,66500;66504,66512;66513,66518;66560,66718;66720,66730;66736,66772;66776,66812;66816,66856;66864,66916;67072,67383;67392,67414;67424,67432;67584,67590;67592,67593;67594,67638;67639,67641;67644,67645;67647,67670;67680,67703;67712,67743;67808,67827;67828,67830;67840,67862;67872,67898;67968,68024;68030,68032;68096,68100;68101,68103;68108,68116;68117,68120;68121,68150;68152,68155;68159,68160;68192,68221;68224,68253;68288,68296;68297,68327;68352,68406;68416,68438;68448,68467;68480,68498;68608,68681;68736,68787;68800,68851;68864,68904;68912,68922;69376,69405;69415,69416;69424,69457;69600,69623;69632,69703;69734,69744;69759,69819;69840,69865;69872,69882;69888,69941;69942,69952;69956,69959;69968,70004;70006,70007;70016,70085;70089,70093;70096,70107;70108,70109;70144,70162;70163,70200;70206,70207;70272,70279;70280,70281;70282,70286;70287,70302;70303,70313;70320,70379;70384,70394;70400,70404;70405,70413;70415,70417;70419,70441;70442,70449;70450,70452;70453,70458;70459,70469;70471,70473;70475,70478;70480,70481;70487,70488;70493,70500;70502,70509;70512,70517;70656,70731;70736,70746;70750,70752;70784,70854;70855,70856;70864,70874;71040,71094;71096,71105;71128,71134;71168,71233;71236,71237;71248,71258;71296,71353;71360,71370;71424,71451;71453,71468;71472,71482;71680,71739;71840,71914;71935,71936;72096,72104;72106,72152;72154,72162;72163,72165;72192,72255;72263,72264;72272,72346;72349,72350;72384,72441;72704,72713;72714,72759;72760,72769;72784,72794;72818,72848;72850,72872;72873,72887;72960,72967;72968,72970;72971,73015;73018,73019;73020,73022;73023,73032;73040,73050;73056,73062;73063,73065;73066,73103;73104,73106;73107,73113;73120,73130;73440,73463;73728,74650;74752,74863;74880,75076;77824,78895;82944,83527;92160,92729;92736,92767;92768,92778;92880,92910;92912,92917;92928,92983;92992,92996;93008,93018;93027,93048;93053,93072;93760,93824;93952,94027;94031,94088;94095,94112;94176,94178;94179,94180;94208,100344;100352,101107;110592,110879;110928,110931;110948,110952;110960,111356;113664,113771;113776,113789;113792,113801;113808,113818;113821,113823;119141,119146;119149,119155;119163,119171;119173,119180;119210,119214;119362,119365;119808,119893;119894,119965;119966,119968;119970,119971;119973,119975;119977,119981;119982,119994;119995,119996;119997,120004;120005,120070;120071,120075;120077,120085;120086,120093;120094,120122;120123,120127;120128,120133;120134,120135;120138,120145;120146,120486;120488,120513;120514,120539;120540,120571;120572,120597;120598,120629;120630,120655;120656,120687;120688,120713;120714,120745;120746,120771;120772,120780;120782,120832;121344,121399;121403,121453;121461,121462;121476,121477;121499,121504;121505,121520;122880,122887;122888,122905;122907,122914;122915,122917;122918,122923;123136,123181;123184,123198;123200,123210;123214,123215;123584,123642;124928,125125;125136,125143;125184,125260;125264,125274;126464,126468;126469,126496;126497,126499;126500,126501;126503,126504;126505,126515;126516,126520;126521,126522;126523,126524;126530,126531;126535,126536;126537,126538;126539,126540;126541,126544;126545,126547;126548,126549;126551,126552;126553,126554;126555,126556;126557,126558;126559,126560;126561,126563;126564,126565;126567,126571;126572,126579;126580,126584;126585,126589;126590,126591;126592,126602;126603,126620;126625,126628;126629,126634;126635,126652;131072,173783;173824,177973;177984,178206;178208,183970;183984,191457;194560,195102;917760,918000|] diff --git a/compiler/js_parser/jsx_parser.ml b/compiler/js_parser/jsx_parser.ml deleted file mode 100644 index f2e2fefafc..0000000000 --- a/compiler/js_parser/jsx_parser.ml +++ /dev/null @@ -1,457 +0,0 @@ -(* - * 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 Ast = Flow_ast -open Token -open Parser_common -open Parser_env -open Flow_ast - -module JSX (Parse : Parser_common.PARSER) = struct - (* Consumes and returns the trailing comments after the end of a JSX tag name, - attribute, or spread attribute. - - If the component is followed by the end of the JSX tag, then all trailing - comments are returned. If the component is instead followed by another tag - component on another line, only trailing comments on the same line are - returned. If the component is followed by another tag component on the same - line, all trailing comments will instead be leading the next component. *) - let tag_component_trailing_comments env = - match Peek.token env with - | T_EOF - | T_DIV - | T_GREATER_THAN -> - Eat.trailing_comments env - | _ when Peek.is_line_terminator env -> Eat.comments_until_next_line env - | _ -> [] - - let spread_attribute env = - let leading = Peek.comments env in - Eat.push_lex_mode env Lex_mode.NORMAL; - let (loc, argument) = - with_loc - (fun env -> - Expect.token env T_LCURLY; - Expect.token env T_ELLIPSIS; - let argument = Parse.assignment env in - Expect.token env T_RCURLY; - argument) - env - in - Eat.pop_lex_mode env; - let trailing = tag_component_trailing_comments env in - ( loc, - { - JSX.SpreadAttribute.argument; - comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing (); - } - ) - - let expression_container_contents env = - if Peek.token env = T_RCURLY then - JSX.ExpressionContainer.EmptyExpression - else - JSX.ExpressionContainer.Expression (Parse.expression env) - - let expression_container env = - let leading = Peek.comments env in - Eat.push_lex_mode env Lex_mode.NORMAL; - let (loc, expression) = - with_loc - (fun env -> - Expect.token env T_LCURLY; - let expression = expression_container_contents env in - Expect.token env T_RCURLY; - expression) - env - in - Eat.pop_lex_mode env; - let trailing = tag_component_trailing_comments env in - ( loc, - { - JSX.ExpressionContainer.expression; - comments = Flow_ast_utils.mk_comments_with_internal_opt ~leading ~trailing ~internal:[] (); - } - ) - - let expression_container_or_spread_child env = - Eat.push_lex_mode env Lex_mode.NORMAL; - let (loc, result) = - with_loc - (fun env -> - Expect.token env T_LCURLY; - let result = - match Peek.token env with - | T_ELLIPSIS -> - let leading = Peek.comments env in - Expect.token env T_ELLIPSIS; - let expression = Parse.assignment env in - JSX.SpreadChild - { - JSX.SpreadChild.expression; - comments = Flow_ast_utils.mk_comments_opt ~leading (); - } - | _ -> - let expression = expression_container_contents env in - let internal = - match expression with - | JSX.ExpressionContainer.EmptyExpression -> Peek.comments env - | _ -> [] - in - JSX.ExpressionContainer - { - JSX.ExpressionContainer.expression; - comments = Flow_ast_utils.mk_comments_with_internal_opt ~internal (); - } - in - Expect.token env T_RCURLY; - result) - env - in - Eat.pop_lex_mode env; - (loc, result) - - let identifier env = - let loc = Peek.loc env in - let name = - match Peek.token env with - | T_JSX_IDENTIFIER { raw; _ } -> raw - | _ -> - error_unexpected ~expected:"an identifier" env; - "" - in - let leading = Peek.comments env in - Eat.token env; - (* Unless this identifier is the first part of a namespaced name, member - expression, or attribute name, it is the end of a tag component. *) - let trailing = - match Peek.token env with - (* Namespaced name *) - | T_COLON - (* Member expression *) - | T_PERIOD - (* Attribute name *) - | T_ASSIGN -> - Eat.trailing_comments env - | _ -> tag_component_trailing_comments env - in - (loc, JSX.Identifier.{ name; comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () }) - - let name = - let rec member_expression env member = - match Peek.token env with - | T_PERIOD -> - let (start_loc, _) = member in - let member = - with_loc - ~start_loc - (fun env -> - Expect.token env T_PERIOD; - let property = identifier env in - { - JSX.MemberExpression._object = JSX.MemberExpression.MemberExpression member; - property; - }) - env - in - member_expression env member - | _ -> member - in - fun env -> - match Peek.ith_token ~i:1 env with - | T_COLON -> - let namespaced_name = - with_loc - (fun env -> - let namespace = identifier env in - Expect.token env T_COLON; - let name = identifier env in - { JSX.NamespacedName.namespace; name }) - env - in - JSX.NamespacedName namespaced_name - | T_PERIOD -> - let member = - with_loc - (fun env -> - let _object = JSX.MemberExpression.Identifier (identifier env) in - Expect.token env T_PERIOD; - let property = identifier env in - { JSX.MemberExpression._object; property }) - env - in - JSX.MemberExpression (member_expression env member) - | _ -> - let name = identifier env in - JSX.Identifier name - - let attribute env = - with_loc - (fun env -> - let name = - match Peek.ith_token ~i:1 env with - | T_COLON -> - let namespaced_name = - with_loc - (fun env -> - let namespace = identifier env in - Expect.token env T_COLON; - let name = identifier env in - { JSX.NamespacedName.namespace; name }) - env - in - JSX.Attribute.NamespacedName namespaced_name - | _ -> - let name = identifier env in - JSX.Attribute.Identifier name - in - let value = - match Peek.token env with - | T_ASSIGN -> - Expect.token env T_ASSIGN; - let leading = Peek.comments env in - let tkn = Peek.token env in - begin - match tkn with - | T_LCURLY -> - let (loc, expression_container) = expression_container env in - JSX.ExpressionContainer.( - match expression_container.expression with - | EmptyExpression -> - error_at env (loc, Parse_error.JSXAttributeValueEmptyExpression) - | _ -> () - ); - Some (JSX.Attribute.ExpressionContainer (loc, expression_container)) - | T_JSX_TEXT (loc, value, raw) as token -> - Expect.token env token; - let value = Ast.Literal.String value in - let trailing = tag_component_trailing_comments env in - Some - (JSX.Attribute.Literal - ( loc, - { - Ast.Literal.value; - raw; - comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing (); - } - ) - ) - | _ -> - error env Parse_error.InvalidJSXAttributeValue; - let loc = Peek.loc env in - let raw = "" in - let value = Ast.Literal.String "" in - Some (JSX.Attribute.Literal (loc, { Ast.Literal.value; raw; comments = None })) - end - | _ -> None - in - { JSX.Attribute.name; value }) - env - - let opening_element = - let rec attributes env acc = - match Peek.token env with - | T_JSX_IDENTIFIER _ -> - let attribute = JSX.Opening.Attribute (attribute env) in - attributes env (attribute :: acc) - | T_LCURLY -> - let attribute = JSX.Opening.SpreadAttribute (spread_attribute env) in - attributes env (attribute :: acc) - | _ -> List.rev acc - in - fun env -> - with_loc - (fun env -> - Expect.token env T_LESS_THAN; - match Peek.token env with - | T_GREATER_THAN -> - Eat.token env; - Ok `Fragment - | T_JSX_IDENTIFIER _ -> - let name = name env in - let attributes = attributes env [] in - let self_closing = Eat.maybe env T_DIV in - let element = `Element { JSX.Opening.name; self_closing; attributes } in - if Eat.maybe env T_GREATER_THAN then - Ok element - else ( - Expect.error env T_GREATER_THAN; - Error element - ) - | _ -> - (* TODO: also say that we could expect an identifier, or if we're in a JSX child - then suggest escaping the < as `{'<'}` *) - Expect.error env T_GREATER_THAN; - Error `Fragment) - env - - let closing_element env = - with_loc - (fun env -> - Expect.token env T_LESS_THAN; - Expect.token env T_DIV; - match Peek.token env with - | T_GREATER_THAN -> - Eat.token env; - `Fragment - | T_JSX_IDENTIFIER _ -> - let name = name env in - Expect.token_opt env T_GREATER_THAN; - `Element { JSX.Closing.name } - | _ -> - Expect.error env T_GREATER_THAN; - `Fragment) - env - - let rec child env = - match Peek.token env with - | T_LCURLY -> expression_container_or_spread_child env - | T_JSX_TEXT (loc, value, raw) as token -> - Expect.token env token; - (loc, JSX.Text { JSX.Text.value; raw }) - | _ -> - (match element_or_fragment env with - | (loc, `Element element) -> (loc, JSX.Element element) - | (loc, `Fragment fragment) -> (loc, JSX.Fragment fragment)) - - and element = - let children_and_closing = - let rec children_and_closing env acc = - let previous_loc = last_loc env in - match Peek.token env with - | T_LESS_THAN -> - Eat.push_lex_mode env Lex_mode.JSX_TAG; - begin - match (Peek.token env, Peek.ith_token ~i:1 env) with - | (T_LESS_THAN, T_EOF) - | (T_LESS_THAN, T_DIV) -> - let closing = - match closing_element env with - | (loc, `Element ec) -> `Element (loc, ec) - | (loc, `Fragment) -> `Fragment loc - in - (* We double pop to avoid going back to childmode and re-lexing the - * lookahead *) - Eat.double_pop_lex_mode env; - (List.rev acc, previous_loc, closing) - | _ -> - let child = - match element env with - | (loc, `Element e) -> (loc, JSX.Element e) - | (loc, `Fragment f) -> (loc, JSX.Fragment f) - in - children_and_closing env (child :: acc) - end - | T_EOF -> - error_unexpected env; - (List.rev acc, previous_loc, `None) - | _ -> children_and_closing env (child env :: acc) - in - fun env -> - let start_loc = Peek.loc env in - let (children, last_child_loc, closing) = children_and_closing env [] in - let last_child_loc = - match last_child_loc with - | Some x -> x - | None -> start_loc - in - (* It's a little bit tricky to untangle the parsing of the child elements from the parsing - * of the closing element, so we can't easily use `with_loc` here. Instead, we'll use the - * same logic that `with_loc` uses, but manipulate the locations explicitly. *) - let children_loc = Loc.btwn start_loc last_child_loc in - ((children_loc, children), closing) - in - let rec normalize name = - JSX.( - match name with - | Identifier (_, { Identifier.name; comments = _ }) -> name - | NamespacedName (_, { NamespacedName.namespace; name }) -> - (snd namespace).Identifier.name ^ ":" ^ (snd name).Identifier.name - | MemberExpression (_, { MemberExpression._object; property }) -> - let _object = - match _object with - | MemberExpression.Identifier (_, { Identifier.name = id; _ }) -> id - | MemberExpression.MemberExpression e -> normalize (JSX.MemberExpression e) - in - _object ^ "." ^ (snd property).Identifier.name - ) - in - let is_self_closing = function - | (_, Ok (`Element e)) -> e.JSX.Opening.self_closing - | (_, Ok `Fragment) -> false - | (_, Error _) -> true - in - fun env -> - let leading = Peek.comments env in - let opening_element = opening_element env in - Eat.pop_lex_mode env; - let (children, closing_element) = - if is_self_closing opening_element then - (with_loc (fun _ -> []) env, `None) - else ( - Eat.push_lex_mode env Lex_mode.JSX_CHILD; - children_and_closing env - ) - in - let trailing = Eat.trailing_comments env in - let end_loc = - match closing_element with - | `Element (loc, { JSX.Closing.name }) -> - (match snd opening_element with - | Ok (`Element { JSX.Opening.name = opening_name; _ }) -> - let opening_name = normalize opening_name in - if normalize name <> opening_name then - error env (Parse_error.ExpectedJSXClosingTag opening_name) - | Ok `Fragment -> error env (Parse_error.ExpectedJSXClosingTag "JSX fragment") - | Error _ -> ()); - loc - | `Fragment loc -> - (match snd opening_element with - | Ok (`Element { JSX.Opening.name = opening_name; _ }) -> - error env (Parse_error.ExpectedJSXClosingTag (normalize opening_name)) - | Ok `Fragment -> () - | Error _ -> ()); - loc - | _ -> fst opening_element - in - let result = - match opening_element with - | (start_loc, Ok (`Element e)) - | (start_loc, Error (`Element e)) -> - `Element - JSX. - { - opening_element = (start_loc, e); - closing_element = - (match closing_element with - | `Element e -> Some e - | _ -> None); - children; - comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing (); - } - | (start_loc, Ok `Fragment) - | (start_loc, Error `Fragment) -> - `Fragment - { - JSX.frag_opening_element = start_loc; - frag_closing_element = - (match closing_element with - | `Fragment loc -> loc - (* the following are parse erros *) - | `Element (loc, _) -> loc - | _ -> end_loc); - frag_children = children; - frag_comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing (); - } - in - - (Loc.btwn (fst opening_element) end_loc, result) - - and element_or_fragment env = - Eat.push_lex_mode env Lex_mode.JSX_TAG; - element env -end diff --git a/compiler/js_parser/lex_env.ml b/compiler/js_parser/lex_env.ml deleted file mode 100644 index 00c36c4284..0000000000 --- a/compiler/js_parser/lex_env.ml +++ /dev/null @@ -1,87 +0,0 @@ -(* - * 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 Sedlexing = Flow_sedlexing - -(* bol = Beginning Of Line *) -type bol = { - line: int; - offset: int; -} - -type lex_state = { lex_errors_acc: (Loc.t * Parse_error.t) list } [@@ocaml.unboxed] - -type t = { - lex_source: File_key.t option; - lex_lb: Sedlexing.lexbuf; - lex_bol: bol; - lex_in_comment_syntax: bool; - lex_enable_comment_syntax: bool; - lex_state: lex_state; - lex_last_loc: Loc.t; -} - -let empty_lex_state = { lex_errors_acc = [] } - -(* The lex_last_loc should initially be set to the beginning of the first line, so that - comments on the first line are reported as not being on a new line. *) -let initial_last_loc = - { Loc.source = None; start = { Loc.line = 1; column = 0 }; _end = { Loc.line = 1; column = 0 } } - -let new_lex_env lex_source lex_lb ~enable_types_in_comments = - { - lex_source; - lex_lb; - lex_bol = { line = 1; offset = 0 }; - lex_in_comment_syntax = false; - lex_enable_comment_syntax = enable_types_in_comments; - lex_state = empty_lex_state; - lex_last_loc = initial_last_loc; - } - -(* copy all the mutable things so that we have a distinct lexing environment - that does not interfere with ordinary lexer operations *) -let clone env = - let lex_lb = Sedlexing.lexbuf_clone env.lex_lb in - { env with lex_lb } - -let lexbuf env = env.lex_lb - -let source env = env.lex_source - -let state env = env.lex_state - -let line env = env.lex_bol.line - -let bol_offset env = env.lex_bol.offset - -let is_in_comment_syntax env = env.lex_in_comment_syntax - -let is_comment_syntax_enabled env = env.lex_enable_comment_syntax - -let in_comment_syntax is_in env = - if is_in <> env.lex_in_comment_syntax then - { env with lex_in_comment_syntax = is_in } - else - env - -(* TODO *) -let debug_string_of_lexbuf _lb = "" - -let debug_string_of_lex_env (env : t) = - let source = - match source env with - | None -> "None" - | Some x -> Printf.sprintf "Some %S" (File_key.to_string x) - in - Printf.sprintf - "{\n lex_source = %s\n lex_lb = %s\n lex_in_comment_syntax = %b\n lex_enable_comment_syntax = %b\n lex_state = {errors = (count = %d)}\n}" - source - (debug_string_of_lexbuf env.lex_lb) - (is_in_comment_syntax env) - (is_comment_syntax_enabled env) - (List.length (state env).lex_errors_acc) diff --git a/compiler/js_parser/lex_result.ml b/compiler/js_parser/lex_result.ml deleted file mode 100644 index 06ca899845..0000000000 --- a/compiler/js_parser/lex_result.ml +++ /dev/null @@ -1,29 +0,0 @@ -(* - * 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. - *) - -type t = { - lex_token: Token.t; - lex_loc: Loc.t; - lex_errors: (Loc.t * Parse_error.t) list; - lex_comments: Loc.t Flow_ast.Comment.t list; -} - -let token result = result.lex_token - -let loc result = result.lex_loc - -let comments result = result.lex_comments - -let errors result = result.lex_errors - -let debug_string_of_lex_result lex_result = - Printf.sprintf - "{\n lex_token = %s\n lex_value = %S\n lex_errors = (length = %d)\n lex_comments = (length = %d)\n}" - (Token.token_to_string lex_result.lex_token) - (Token.value_of_token lex_result.lex_token) - (List.length lex_result.lex_errors) - (List.length lex_result.lex_comments) diff --git a/compiler/js_parser/loc.ml b/compiler/js_parser/loc.ml deleted file mode 100644 index 143f0671cc..0000000000 --- a/compiler/js_parser/loc.ml +++ /dev/null @@ -1,187 +0,0 @@ -(* - * 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 Primitive_deriving - -(* line numbers are 1-indexed; column numbers are 0-indexed *) -type position = { - line: int; - column: int; -} -[@@deriving_inline equal] -let _ = fun (_ : position) -> () -let equal_position = - (fun a__001_ -> - fun b__002_ -> - if Ppx_compare_lib.phys_equal a__001_ b__002_ - then true - else - Ppx_compare_lib.(&&) (equal_int a__001_.line b__002_.line) - (equal_int a__001_.column b__002_.column) : position -> - position -> bool) -let _ = equal_position -[@@@end] -(* start is inclusive; end is exclusive *) -(* If you are modifying this record, go look at ALoc.ml and make sure you understand the - * representation there. *) -type t = { - source: File_key.t option; - start: position; - _end: position; -} - -let none = { source = None; start = { line = 0; column = 0 }; _end = { line = 0; column = 0 } } - -let is_none (x : t) = - x == none - || - match x with - | { source = None; start = { line = 0; column = 0 }; _end = { line = 0; column = 0 } } -> true - | _ -> false - -let is_none_ignore_source (x : t) = - x == none - || - match x with - | { source = _; start = { line = 0; column = 0 }; _end = { line = 0; column = 0 } } -> true - | _ -> false - -let btwn loc1 loc2 = { source = loc1.source; start = loc1.start; _end = loc2._end } - -(* Returns the position immediately before the start of the given loc. If the - given loc is at the beginning of a line, return the position of the first - char on the same line. *) -let char_before loc = - let start = - let { line; column } = loc.start in - let column = - if column > 0 then - column - 1 - else - column - in - { line; column } - in - let _end = loc.start in - { loc with start; _end } - -(* Returns the location of the first character in the given loc. Not accurate if the - * first line is a newline character, but is still consistent with loc orderings. *) -let first_char loc = - let start = loc.start in - let _end = { start with column = start.column + 1 } in - { loc with _end } - -let pos_cmp a b = - let k = a.line - b.line in - if k = 0 then - a.column - b.column - else - k - -(** - * If `a` spans (completely contains) `b`, then returns 0. - * If `b` starts before `a` (even if it ends inside), returns < 0. - * If `b` ends after `a` (even if it starts inside), returns > 0. - *) -let span_compare a b = - let k = File_key.compare_opt a.source b.source in - if k = 0 then - let k = pos_cmp a.start b.start in - if k <= 0 then - let k = pos_cmp a._end b._end in - if k >= 0 then - 0 - else - -1 - else - 1 - else - k - -(** [contains loc1 loc2] returns true if [loc1] entirely overlaps [loc2] *) -let contains loc1 loc2 = span_compare loc1 loc2 = 0 - -(** [intersects loc1 loc2] returns true if [loc1] intersects [loc2] at all *) -let intersects loc1 loc2 = - File_key.compare_opt loc1.source loc2.source = 0 - && not (pos_cmp loc1._end loc2.start < 0 || pos_cmp loc1.start loc2._end > 0) - -(** [lines_intersect loc1 loc2] returns true if [loc1] and [loc2] cover any part of - the same line, even if they don't actually intersect. - - For example, if [loc1] ends and then [loc2] begins later on the same line, - [intersects loc1 loc2] is false, but [lines_intersect loc1 loc2] is true. *) -let lines_intersect loc1 loc2 = - File_key.compare_opt loc1.source loc2.source = 0 - && not (loc1._end.line < loc2.start.line || loc1.start.line > loc2._end.line) - -let compare_ignore_source loc1 loc2 = - match pos_cmp loc1.start loc2.start with - | 0 -> pos_cmp loc1._end loc2._end - | k -> k - -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 - -(** - * This is mostly useful for debugging purposes. - * Please don't dead-code delete this! - *) -let debug_to_string ?(include_source = false) loc = - let source = - if include_source then - Printf.sprintf - "%S: " - (match loc.source with - | Some src -> File_key.to_string src - | None -> "") - else - "" - in - let pos = - Printf.sprintf - "(%d, %d) to (%d, %d)" - loc.start.line - loc.start.column - loc._end.line - loc._end.column - in - source ^ pos - -let to_string_no_source loc = - let line = loc.start.line in - let start = loc.start.column + 1 in - let end_ = loc._end.column in - if line <= 0 then - "0:0" - else if line = loc._end.line && start = end_ then - Printf.sprintf "%d:%d" line start - else 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) = - { - source; - start = { line = start_line; column = start_column }; - _end = { line = end_line; column = end_column }; - } - -let source loc = loc.source - -(** Produces a zero-width Loc.t, where start = end *) -let cursor source line column = { source; start = { line; column }; _end = { line; column } } - -let start_loc loc = { loc with _end = loc.start } -let end_loc loc = { loc with start = loc._end } diff --git a/compiler/js_parser/loc.mli b/compiler/js_parser/loc.mli deleted file mode 100644 index 4102338a08..0000000000 --- a/compiler/js_parser/loc.mli +++ /dev/null @@ -1,77 +0,0 @@ -(* - * 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. - *) - -type position = { - line: int; - column: int; -} -[@@deriving_inline equal] -include - sig - [@@@warning "-32"] - val equal_position : position -> position -> bool - end[@@ocaml.doc "@inline"] -[@@@end] -type t = { - source: File_key.t option; - start: position; - _end: position; -} - - -val none : t - -val is_none : t -> bool - -val is_none_ignore_source : t -> bool - -val btwn : t -> t -> t - -val char_before : t -> t - -val first_char : t -> t - -(** [contains loc1 loc2] returns true if [loc1] entirely overlaps [loc2] *) -val contains : t -> t -> bool - -(** [intersects loc1 loc2] returns true if [loc1] intersects [loc2] at all *) -val intersects : t -> t -> bool - -(** [lines_intersect loc1 loc2] returns true if [loc1] and [loc2] cover any part of - the same line, even if they don't actually intersect. - - For example, if [loc1] ends and then [loc2] begins later on the same line, - [intersects loc1 loc2] is false, but [lines_intersect loc1 loc2] is true. *) -val lines_intersect : t -> t -> bool - -val pos_cmp : position -> position -> int - -val span_compare : t -> t -> int - -val compare_ignore_source : t -> t -> int - -val compare : t -> t -> int - -val equal : t -> t -> bool - -val debug_to_string : ?include_source:bool -> t -> string - -(* Relatively compact; suitable for use as a unique string identifier *) -val to_string_no_source : t -> string - -val mk_loc : ?source:File_key.t -> int * int -> int * int -> t - -val source : t -> File_key.t option - -(** Produces a zero-width Loc.t, where start = end *) -val cursor : File_key.t option -> int -> int -> t - -(* Produces a location at the start of the input location *) -val start_loc : t -> t - -(* Produces a location at the end of the input location *) -val end_loc : t -> t diff --git a/compiler/js_parser/object_parser.ml b/compiler/js_parser/object_parser.ml deleted file mode 100644 index b5ece9e386..0000000000 --- a/compiler/js_parser/object_parser.ml +++ /dev/null @@ -1,1087 +0,0 @@ -(* - * 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 Ast = Flow_ast -open Token -open Parser_env -open Flow_ast -module SMap = Map.Make (String) -open Parser_common -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 - let decorator_list = - let expression env = - let expression = Expression.left_hand_side env in - let { remove_trailing; _ } = - if Peek.is_line_terminator env then - trailing_and_remover_after_last_line env - else - trailing_and_remover_after_last_loc env - in - remove_trailing expression (fun remover expression -> remover#expression expression) - in - let decorator env = - let leading = Peek.comments env in - Eat.token env; - { - Ast.Class.Decorator.expression = expression env; - comments = Flow_ast_utils.mk_comments_opt ~leading (); - } - in - let rec decorator_list_helper env decorators = - match Peek.token env with - | T_AT -> decorator_list_helper env (with_loc decorator env :: decorators) - | _ -> decorators - in - fun env -> - if (parse_options env).esproposal_decorators then - List.rev (decorator_list_helper env []) - else - [] - - let key ?(class_body = false) env = - let open Ast.Expression.Object.Property in - let leading = Peek.comments env in - let tkn = Peek.token env in - match tkn 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 value = Literal.String value in - let trailing = Eat.trailing_comments env in - ( loc, - Literal - ( loc, - { Literal.value; raw; comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () } - ) - ) - | T_NUMBER { kind; raw } -> - let loc = Peek.loc env in - let value = Expression.number env kind raw in - let value = Literal.Number value in - let trailing = Eat.trailing_comments env in - ( loc, - Literal - ( loc, - { Literal.value; raw; comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () } - ) - ) - | T_LBRACKET -> - let (loc, key) = - with_loc - (fun env -> - let leading = Peek.comments env in - Expect.token env T_LBRACKET; - let expr = Parse.assignment (env |> with_no_in false) in - Expect.token env T_RBRACKET; - let trailing = Eat.trailing_comments env in - { - ComputedKey.expression = expr; - comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing (); - }) - env - in - (loc, Ast.Expression.Object.Property.Computed (loc, key)) - | T_POUND when class_body -> - let ((loc, { PrivateName.name; _ }) as id) = private_identifier env in - add_declared_private env name; - (loc, PrivateName id) - | T_POUND -> - let (loc, id) = - with_loc - (fun env -> - Eat.token env; - Identifier (identifier_name env)) - env - in - error_at env (loc, Parse_error.PrivateNotInClass); - (loc, id) - | _ -> - let ((loc, _) as id) = identifier_name env in - (loc, Identifier id) - - let getter_or_setter env ~in_class_body is_getter = - (* this is a getter or setter, it cannot be async *) - let async = false in - let (generator, leading) = Declaration.generator env in - let (key_loc, key) = key ~class_body:in_class_body env in - let key = object_key_remove_trailing env key in - let value = - with_loc - (fun env -> - (* #sec-function-definitions-static-semantics-early-errors *) - let env = env |> with_allow_super Super_prop in - let (sig_loc, (tparams, params, return)) = - with_loc - (fun env -> - (* It's not clear how type params on getters & setters would make sense - * in Flow's type system. Since this is a Flow syntax extension, we might - * as well disallow it until we need it *) - let tparams = None in - let params = - let params = Declaration.function_params ~await:false ~yield:false env in - if Peek.token env = T_COLON then - params - else - function_params_remove_trailing env params - in - begin - match (is_getter, params) with - | (true, (_, { Ast.Function.Params.this_ = Some _; _ })) -> - error_at env (key_loc, Parse_error.GetterMayNotHaveThisParam) - | (false, (_, { Ast.Function.Params.this_ = Some _; _ })) -> - error_at env (key_loc, Parse_error.SetterMayNotHaveThisParam) - | ( true, - ( _, - { Ast.Function.Params.params = []; rest = None; this_ = None; comments = _ } - ) - ) -> - () - | (false, (_, { Ast.Function.Params.rest = Some _; _ })) -> - (* rest params don't make sense on a setter *) - error_at env (key_loc, Parse_error.SetterArity) - | ( false, - ( _, - { - Ast.Function.Params.params = [_]; - rest = None; - this_ = None; - comments = _; - } - ) - ) -> - () - | (true, _) -> error_at env (key_loc, Parse_error.GetterArity) - | (false, _) -> error_at env (key_loc, Parse_error.SetterArity) - end; - let return = type_annotation_hint_remove_trailing env (Type.annotation_opt env) in - (tparams, params, return)) - env - in - let simple_params = is_simple_parameter_list params in - let (body, contains_use_strict) = - Declaration.function_body env ~async ~generator ~expression:false ~simple_params - in - Declaration.strict_post_check env ~contains_use_strict None params; - { - Function.id = None; - params; - body; - generator; - async; - predicate = None; - (* setters/getter are not predicates *) - return; - tparams; - sig_loc; - comments = Flow_ast_utils.mk_comments_opt ~leading (); - }) - env - in - (key, value) - - let _initializer = - let parse_assignment_cover env = - match Expression.assignment_cover env with - | Cover_expr expr -> (expr, Pattern_cover.empty_errors) - | Cover_patt (expr, errs) -> (expr, errs) - in - let get env start_loc leading = - let (loc, (key, value)) = - with_loc ~start_loc (fun env -> getter_or_setter env ~in_class_body:false true) env - in - let open Ast.Expression.Object in - Property - (loc, Property.Get { key; value; comments = Flow_ast_utils.mk_comments_opt ~leading () }) - in - let set env start_loc leading = - let (loc, (key, value)) = - with_loc ~start_loc (fun env -> getter_or_setter env ~in_class_body:false false) env - in - let open Ast.Expression.Object in - Property - (loc, Property.Set { key; value; comments = Flow_ast_utils.mk_comments_opt ~leading () }) - in - (* #prod-PropertyDefinition *) - let init = - let open Ast.Expression.Object.Property in - (* #prod-IdentifierReference *) - let parse_shorthand env key = - match key with - | Literal (loc, lit) -> - error_at env (loc, Parse_error.LiteralShorthandProperty); - (loc, Ast.Expression.Literal lit) - | Identifier ((loc, { Identifier.name; comments = _ }) as id) -> - (* #sec-identifiers-static-semantics-early-errors *) - if is_reserved name && name <> "yield" && name <> "await" then - (* it is a syntax error if `name` is a reserved word other than await or yield *) - error_at env (loc, Parse_error.UnexpectedReserved) - else if is_strict_reserved name then - (* it is a syntax error if `name` is a strict reserved word, in strict mode *) - strict_error_at env (loc, Parse_error.StrictReservedWord); - (loc, Ast.Expression.Identifier id) - | PrivateName _ -> failwith "Internal Error: private name found in object props" - | Computed (_, { ComputedKey.expression = expr; comments = _ }) -> - error_at env (fst expr, Parse_error.ComputedShorthandProperty); - expr - in - (* #prod-MethodDefinition *) - let parse_method ~async ~generator ~leading = - with_loc (fun env -> - (* #sec-function-definitions-static-semantics-early-errors *) - let env = env |> with_allow_super Super_prop in - let (sig_loc, (tparams, params, return)) = - with_loc - (fun env -> - let tparams = type_params_remove_trailing env (Type.type_params env) in - let params = - let (yield, await) = - match (async, generator) with - | (true, true) -> - (true, true) (* proposal-async-iteration/#prod-AsyncGeneratorMethod *) - | (true, false) -> (false, allow_await env) (* #prod-AsyncMethod *) - | (false, true) -> (true, false) (* #prod-GeneratorMethod *) - | (false, false) -> (false, false) - (* #prod-MethodDefinition *) - in - let params = Declaration.function_params ~await ~yield env in - if Peek.token env = T_COLON then - params - else - function_params_remove_trailing env params - in - let return = type_annotation_hint_remove_trailing env (Type.annotation_opt env) in - (tparams, params, return)) - env - in - let simple_params = is_simple_parameter_list params in - let (body, contains_use_strict) = - Declaration.function_body env ~async ~generator ~expression:false ~simple_params - in - Declaration.strict_post_check env ~contains_use_strict None params; - { - Function.id = None; - params; - body; - generator; - async; - (* TODO: add support for object method predicates *) - predicate = None; - return; - tparams; - sig_loc; - comments = Flow_ast_utils.mk_comments_opt ~leading (); - } - ) - in - (* PropertyName `:` AssignmentExpression *) - let parse_value env = - Expect.token env T_COLON; - parse_assignment_cover env - in - (* #prod-CoverInitializedName *) - let parse_assignment_pattern ~key env = - let open Ast.Expression.Object in - match key with - | Property.Identifier id -> - let assignment_loc = Peek.loc env in - let ast = - with_loc - ~start_loc:(fst id) - (fun env -> - let leading = Peek.comments env in - Expect.token env T_ASSIGN; - let trailing = Eat.trailing_comments env in - let left = Parse.pattern_from_expr env (fst id, Ast.Expression.Identifier id) in - let right = Parse.assignment env in - let comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () in - Ast.Expression.Assignment - { Ast.Expression.Assignment.operator = None; left; right; comments }) - env - in - let errs = - { - if_expr = [(assignment_loc, Parse_error.Unexpected (Token.quote_token_value "="))]; - if_patt = []; - } - in - (ast, errs) - | Property.Literal _ - | Property.PrivateName _ - | Property.Computed _ -> - parse_value env - in - let parse_init ~key ~async ~generator ~leading env = - if async || generator then - let key = object_key_remove_trailing env key in - (* the `async` and `*` modifiers are only valid on methods *) - let value = parse_method env ~async ~generator ~leading in - let prop = Method { key; value } in - (prop, Pattern_cover.empty_errors) - else - match Peek.token env with - | T_RCURLY - | T_COMMA -> - let value = parse_shorthand env key in - let prop = Init { key; value; shorthand = true } in - (prop, Pattern_cover.empty_errors) - | T_LESS_THAN - | T_LPAREN -> - let key = object_key_remove_trailing env key in - let value = parse_method env ~async ~generator ~leading in - let prop = Method { key; value } in - (prop, Pattern_cover.empty_errors) - | T_ASSIGN -> - let (value, errs) = parse_assignment_pattern ~key env in - let prop = Init { key; value; shorthand = true } in - (prop, errs) - | T_COLON -> - let (value, errs) = parse_value env in - let prop = Init { key; value; shorthand = false } in - (prop, errs) - | _ -> - (* error. we recover by treating it as a shorthand property so as to not - consume any more tokens and make the error worse. we don't error here - because we'll expect a comma before the next token. *) - let value = parse_shorthand env key in - let prop = Init { key; value; shorthand = true } in - (prop, Pattern_cover.empty_errors) - in - fun env start_loc key async generator leading -> - let (loc, (prop, errs)) = - with_loc ~start_loc (parse_init ~key ~async ~generator ~leading) env - in - (Ast.Expression.Object.Property (loc, prop), errs) - in - let property env = - let open Ast.Expression.Object in - if Peek.token env = T_ELLIPSIS then - (* Spread property *) - let leading = Peek.comments env in - let (loc, (argument, errs)) = - with_loc - (fun env -> - Expect.token env T_ELLIPSIS; - parse_assignment_cover env) - env - in - ( SpreadProperty - (loc, { SpreadProperty.argument; comments = Flow_ast_utils.mk_comments_opt ~leading () }), - errs - ) - else - let start_loc = Peek.loc env in - let (async, leading_async) = - match Peek.ith_token ~i:1 env with - | T_ASSIGN - (* { async = true } (destructuring) *) - | T_COLON - (* { async: true } *) - | T_LESS_THAN - (* { async() {} } *) - | T_LPAREN - (* { async() {} } *) - | T_COMMA - (* { async, other, shorthand } *) - | T_RCURLY (* { async } *) -> - (false, []) - | _ -> Declaration.async env - in - let (generator, leading_generator) = Declaration.generator env in - let leading = leading_async @ leading_generator in - match (async, generator, Peek.token env) with - | (false, false, T_IDENTIFIER { raw = "get"; _ }) -> - let leading = Peek.comments env in - let (_, key) = key env in - begin - match Peek.token env with - | T_ASSIGN - | T_COLON - | T_LESS_THAN - | T_LPAREN - | T_COMMA - | T_RCURLY -> - init env start_loc key false false [] - | _ -> - ignore (Comment_attachment.object_key_remove_trailing env key); - (get env start_loc leading, Pattern_cover.empty_errors) - end - | (false, false, T_IDENTIFIER { raw = "set"; _ }) -> - let leading = Peek.comments env in - let (_, key) = key env in - begin - match Peek.token env with - | T_ASSIGN - | T_COLON - | T_LESS_THAN - | T_LPAREN - | T_COMMA - | T_RCURLY -> - init env start_loc key false false [] - | _ -> - ignore (Comment_attachment.object_key_remove_trailing env key); - (set env start_loc leading, Pattern_cover.empty_errors) - end - | (async, generator, _) -> - let (_, key) = key env in - init env start_loc key async generator leading - in - let rec properties env ~rest_trailing_comma (props, errs) = - match Peek.token env with - | T_EOF - | T_RCURLY -> - let errs = - match rest_trailing_comma with - | Some loc -> - { errs with if_patt = (loc, Parse_error.TrailingCommaAfterRestElement) :: errs.if_patt } - | None -> errs - in - (List.rev props, Pattern_cover.rev_errors errs) - | _ -> - let (prop, new_errs) = property env in - let rest_trailing_comma = - match prop with - | Ast.Expression.Object.SpreadProperty _ when Peek.token env = T_COMMA -> - Some (Peek.loc env) - | _ -> None - in - let errs = Pattern_cover.rev_append_errors new_errs errs in - let errs = - match Peek.token env with - | T_RCURLY - | T_EOF -> - errs - | T_COMMA -> - Eat.token env; - errs - | _ -> - (* we could use [Expect.error env T_COMMA], but we're in a weird - cover grammar situation where we're storing errors in - [Pattern_cover]. if we used [Expect.error], the errors would - end up out of order. *) - let err = Expect.get_error env T_COMMA in - (* if the unexpected token is a semicolon, consume it to aid - recovery. using a semicolon instead of a comma is a common - mistake. *) - let _ = Eat.maybe env T_SEMICOLON in - Pattern_cover.cons_error err errs - in - properties env ~rest_trailing_comma (prop :: props, errs) - in - fun env -> - let (loc, (expr, errs)) = - with_loc - (fun env -> - let leading = Peek.comments env in - Expect.token env T_LCURLY; - let (props, errs) = - properties env ~rest_trailing_comma:None ([], Pattern_cover.empty_errors) - in - let internal = Peek.comments env in - Expect.token env T_RCURLY; - let trailing = Eat.trailing_comments env in - ( { - Ast.Expression.Object.properties = props; - comments = - Flow_ast_utils.mk_comments_with_internal_opt ~leading ~trailing ~internal (); - }, - errs - )) - env - in - (loc, expr, errs) - - let check_property_name env loc name static = - if String.equal name "constructor" || (String.equal name "prototype" && static) then - error_at - env - (loc, Parse_error.InvalidClassMemberName { name; static; method_ = false; private_ = false }) - - let check_private_names - env seen_names private_name (kind : [ `Method | `Field | `Getter | `Setter ]) = - let (loc, { PrivateName.name; comments = _ }) = private_name in - if String.equal name "constructor" then - let () = - error_at - env - ( loc, - Parse_error.InvalidClassMemberName - { name; static = false; method_ = kind = `Method; private_ = true } - ) - in - seen_names - else - match SMap.find_opt name seen_names with - | Some seen -> - begin - match (kind, seen) with - | (`Getter, `Setter) - | (`Setter, `Getter) -> - (* one getter and one setter are allowed as long as it's not used as a field *) - () - | _ -> error_at env (loc, Parse_error.DuplicatePrivateFields name) - end; - SMap.add name `Field seen_names - | None -> SMap.add name kind seen_names - - let class_implements env ~attach_leading = - let rec interfaces env acc = - let interface = - with_loc - (fun env -> - let id = - let id = Type.type_identifier env in - if Peek.token env <> T_LESS_THAN then - id - else - let { remove_trailing; _ } = trailing_and_remover env in - remove_trailing id (fun remover id -> remover#identifier id) - in - let targs = Type.type_args env in - { Ast.Class.Implements.Interface.id; targs }) - env - in - let acc = interface :: acc in - match Peek.token env with - | T_COMMA -> - Expect.token env T_COMMA; - interfaces env acc - | _ -> List.rev acc - in - with_loc - (fun env -> - let leading = - if attach_leading then - Peek.comments env - else - [] - in - Expect.token env T_IMPLEMENTS; - let interfaces = interfaces env [] in - { Ast.Class.Implements.interfaces; comments = Flow_ast_utils.mk_comments_opt ~leading () }) - env - - let class_extends ~leading = - with_loc (fun env -> - let expr = - let expr = Expression.left_hand_side (env |> with_allow_yield false) in - if Peek.token env <> T_LESS_THAN then - expr - else - let { remove_trailing; _ } = trailing_and_remover env in - remove_trailing expr (fun remover expr -> remover#expression expr) - in - let targs = Type.type_args env in - { Class.Extends.expr; targs; comments = Flow_ast_utils.mk_comments_opt ~leading () } - ) - - (* https://tc39.es/ecma262/#prod-ClassHeritage *) - let class_heritage env = - let extends = - let leading = Peek.comments env in - if Eat.maybe env T_EXTENDS then - let (loc, extends) = class_extends ~leading env in - let { remove_trailing; _ } = trailing_and_remover env in - Some - (loc, remove_trailing extends (fun remover extends -> remover#class_extends loc extends)) - else - None - in - let implements = - if Peek.token env = T_IMPLEMENTS then ( - if not (should_parse_types env) then error env Parse_error.UnexpectedTypeInterface; - Some (class_implements_remove_trailing env (class_implements env ~attach_leading:true)) - ) else - None - in - (extends, implements) - - (* In the ES6 draft, all elements are methods. No properties (though there - * are getter and setters allowed *) - let class_element = - let get env start_loc decorators static leading = - let (loc, (key, value)) = - with_loc ~start_loc (fun env -> getter_or_setter env ~in_class_body:true true) env - in - let open Ast.Class in - Body.Method - ( loc, - { - Method.key; - value; - kind = Method.Get; - static; - decorators; - comments = Flow_ast_utils.mk_comments_opt ~leading (); - } - ) - in - let set env start_loc decorators static leading = - let (loc, (key, value)) = - with_loc ~start_loc (fun env -> getter_or_setter env ~in_class_body:true false) env - in - let open Ast.Class in - Body.Method - ( loc, - { - Method.key; - value; - kind = Method.Set; - static; - decorators; - comments = Flow_ast_utils.mk_comments_opt ~leading (); - } - ) - in - let error_unsupported_variance env = function - | Some (loc, _) -> error_at env (loc, Parse_error.UnexpectedVariance) - | None -> () - (* Class property with annotation *) - in - let error_unsupported_declare env = function - | Some loc -> error_at env (loc, Parse_error.DeclareClassElement) - | None -> () - in - let property_end_and_semicolon env key annot value = - match Peek.token env with - | T_LBRACKET - | T_LPAREN -> - error_unexpected env; - (key, annot, value, []) - | T_SEMICOLON -> - Eat.token env; - let trailing = - match Peek.token env with - | T_EOF - | T_RCURLY -> - Eat.trailing_comments env - | _ when Peek.is_line_terminator env -> Eat.comments_until_next_line env - | _ -> [] - in - (key, annot, value, trailing) - | _ -> - let remover = - match Peek.token env with - | T_EOF - | T_RCURLY -> - { trailing = []; remove_trailing = (fun x _ -> x) } - | _ when Peek.is_line_terminator env -> - Comment_attachment.trailing_and_remover_after_last_line env - | _ -> Comment_attachment.trailing_and_remover_after_last_loc env - in - (* Remove trailing comments from the last node in this property *) - let (key, annot, value) = - match (annot, value) with - (* prop = init *) - | (_, Class.Property.Initialized expr) -> - ( key, - annot, - Class.Property.Initialized - (remover.remove_trailing expr (fun remover expr -> remover#expression expr)) - ) - (* prop: annot *) - | (Ast.Type.Available annot, _) -> - ( key, - Ast.Type.Available - (remover.remove_trailing annot (fun remover annot -> remover#type_annotation annot)), - value - ) - (* prop *) - | _ -> - (remover.remove_trailing key (fun remover key -> remover#object_key key), annot, value) - in - (key, annot, value, []) - in - let property env start_loc key static declare variance leading = - let (loc, (key, annot, value, comments)) = - with_loc - ~start_loc - (fun env -> - let annot = Type.annotation_opt env in - let value = - match (declare, Peek.token env) with - | (None, T_ASSIGN) -> - Eat.token env; - Ast.Class.Property.Initialized - (Parse.expression (env |> with_allow_super Super_prop)) - | (Some _, T_ASSIGN) -> - error env Parse_error.DeclareClassFieldInitializer; - Eat.token env; - Ast.Class.Property.Declared - | (None, _) -> Ast.Class.Property.Uninitialized - | (Some _, _) -> Ast.Class.Property.Declared - in - let (key, annot, value, trailing) = property_end_and_semicolon env key annot value in - (key, annot, value, Flow_ast_utils.mk_comments_opt ~leading ~trailing ())) - env - in - match key with - | Ast.Expression.Object.Property.PrivateName private_name -> - let open Ast.Class in - Body.PrivateField - (loc, { PrivateField.key = private_name; value; annot; static; variance; comments }) - | _ -> - Ast.Class.(Body.Property (loc, { Property.key; value; annot; static; variance; comments })) - in - let is_asi env = - match Peek.token env with - | T_LESS_THAN -> false - | T_LPAREN -> false - | _ when Peek.is_implicit_semicolon env -> true - | _ -> false - in - let rec init env start_loc decorators key ~async ~generator ~static ~declare variance leading = - match Peek.token env with - | T_COLON - | T_ASSIGN - | T_SEMICOLON - | T_RCURLY - when (not async) && not generator -> - property env start_loc key static declare variance leading - | T_PLING -> - (* TODO: add support for optional class properties *) - error_unexpected env; - Eat.token env; - init env start_loc decorators key ~async ~generator ~static ~declare variance leading - | _ when is_asi env -> - (* an uninitialized, unannotated property *) - property env start_loc key static declare variance leading - | _ -> - error_unsupported_declare env declare; - error_unsupported_variance env variance; - let (kind, env) = - match (static, key) with - | ( false, - Ast.Expression.Object.Property.Identifier - (_, { Identifier.name = "constructor"; comments = _ }) - ) - | ( false, - Ast.Expression.Object.Property.Literal - (_, { Literal.value = Literal.String "constructor"; _ }) - ) -> - (Ast.Class.Method.Constructor, env |> with_allow_super Super_prop_or_call) - | _ -> (Ast.Class.Method.Method, env |> with_allow_super Super_prop) - in - let key = object_key_remove_trailing env key in - let value = - with_loc - (fun env -> - let (sig_loc, (tparams, params, return)) = - with_loc - (fun env -> - let tparams = type_params_remove_trailing env (Type.type_params env) in - let params = - let (yield, await) = - match (async, generator) with - | (true, true) -> - (true, true) (* proposal-async-iteration/#prod-AsyncGeneratorMethod *) - | (true, false) -> (false, allow_await env) (* #prod-AsyncMethod *) - | (false, true) -> (true, false) (* #prod-GeneratorMethod *) - | (false, false) -> (false, false) - (* #prod-MethodDefinition *) - in - let params = Declaration.function_params ~await ~yield env in - let params = - if Peek.token env = T_COLON then - params - else - function_params_remove_trailing env params - in - Ast.Function.Params.( - match params with - | (loc, ({ this_ = Some (this_loc, _); _ } as params)) - when kind = Ast.Class.Method.Constructor -> - (* Disallow this param annotations for constructors *) - error_at env (this_loc, Parse_error.ThisParamBannedInConstructor); - (loc, { params with this_ = None }) - | params -> params - ) - in - let return = - type_annotation_hint_remove_trailing env (Type.annotation_opt env) - in - (tparams, params, return)) - env - in - let simple_params = is_simple_parameter_list params in - let (body, contains_use_strict) = - Declaration.function_body env ~async ~generator ~expression:false ~simple_params - in - Declaration.strict_post_check env ~contains_use_strict None params; - { - Function.id = None; - params; - body; - generator; - async; - (* TODO: add support for method predicates *) - predicate = None; - return; - tparams; - sig_loc; - comments = None; - }) - env - in - let open Ast.Class in - Body.Method - ( Loc.btwn start_loc (fst value), - { - Method.key; - value; - kind; - static; - decorators; - comments = Flow_ast_utils.mk_comments_opt ~leading (); - } - ) - in - let ith_implies_identifier ~i env = - match Peek.ith_token ~i env with - | T_LESS_THAN - | T_COLON - | T_ASSIGN - | T_SEMICOLON - | T_LPAREN - | T_RCURLY -> - true - | _ -> false - in - let implies_identifier = ith_implies_identifier ~i:0 in - fun env -> - let start_loc = Peek.loc env in - let decorators = decorator_list env in - let (declare, leading_declare) = - match Peek.token env with - | T_DECLARE when not (ith_implies_identifier ~i:1 env) -> - let ret = Some (Peek.loc env) in - let leading = Peek.comments env in - Eat.token env; - (ret, leading) - | _ -> (None, []) - in - let static = - Peek.ith_token ~i:1 env <> T_LPAREN - && Peek.ith_token ~i:1 env <> T_LESS_THAN - && Peek.token env = T_STATIC - in - let leading_static = - if static then ( - let leading = Peek.comments env in - Eat.token env; - leading - ) else - [] - in - let async = - Peek.token env = T_ASYNC - && (not (ith_implies_identifier ~i:1 env)) - && not (Peek.ith_is_line_terminator ~i:1 env) - in - (* consume `async` *) - let leading_async = - if async then ( - let leading = Peek.comments env in - Eat.token env; - leading - ) else - [] - in - let (generator, leading_generator) = Declaration.generator env in - let variance = Declaration.variance env async generator in - let (generator, leading_generator) = - match (generator, variance) with - | (false, Some _) -> Declaration.generator env - | _ -> (generator, leading_generator) - in - let leading = - List.concat [leading_declare; leading_static; leading_async; leading_generator] - in - match (async, generator, Peek.token env) with - | (false, false, T_IDENTIFIER { raw = "get"; _ }) -> - let leading_get = Peek.comments env in - let (_, key) = key ~class_body:true env in - if implies_identifier env then - init env start_loc decorators key ~async ~generator ~static ~declare variance leading - else ( - error_unsupported_declare env declare; - error_unsupported_variance env variance; - ignore (object_key_remove_trailing env key); - get env start_loc decorators static (leading @ leading_get) - ) - | (false, false, T_IDENTIFIER { raw = "set"; _ }) -> - let leading_set = Peek.comments env in - let (_, key) = key ~class_body:true env in - if implies_identifier env then - init env start_loc decorators key ~async ~generator ~static ~declare variance leading - else ( - error_unsupported_declare env declare; - error_unsupported_variance env variance; - ignore (object_key_remove_trailing env key); - set env start_loc decorators static (leading @ leading_set) - ) - | (_, _, _) -> - let (_, key) = key ~class_body:true env in - init env start_loc decorators key ~async ~generator ~static ~declare variance leading - - let class_body = - let rec elements env seen_constructor private_names acc = - match Peek.token env with - | T_EOF - | T_RCURLY -> - List.rev acc - | T_SEMICOLON -> - (* Skip empty elements *) - Expect.token env T_SEMICOLON; - elements env seen_constructor private_names acc - | _ -> - let element = class_element env in - let (seen_constructor', private_names') = - match element with - | Ast.Class.Body.Method (loc, m) -> - let open Ast.Class.Method in - (match m.kind with - | Constructor -> - if m.static then - (seen_constructor, private_names) - else ( - if seen_constructor then error_at env (loc, Parse_error.DuplicateConstructor); - (true, private_names) - ) - | Method -> - let private_names = - match m.key with - | Ast.Expression.Object.Property.PrivateName name -> - check_private_names env private_names name `Method - | _ -> private_names - in - (seen_constructor, private_names) - | Get -> - let open Ast.Expression.Object.Property in - let private_names = - match m.key with - | PrivateName name -> check_private_names env private_names name `Getter - | _ -> private_names - in - (seen_constructor, private_names) - | Set -> - let open Ast.Expression.Object.Property in - let private_names = - match m.key with - | PrivateName name -> check_private_names env private_names name `Setter - | _ -> private_names - in - (seen_constructor, private_names)) - | Ast.Class.Body.Property (_, { Ast.Class.Property.key; static; _ }) -> - let open Ast.Expression.Object.Property in - begin - match key with - | Identifier (loc, { Identifier.name; comments = _ }) - | Literal (loc, { Literal.value = Literal.String name; _ }) -> - check_property_name env loc name static - | Literal _ - | Computed _ -> - () - | PrivateName _ -> - failwith "unexpected PrivateName in Property, expected a PrivateField" - end; - (seen_constructor, private_names) - | Ast.Class.Body.PrivateField (_, { Ast.Class.PrivateField.key; _ }) -> - let private_names = check_private_names env private_names key `Field in - (seen_constructor, private_names) - in - elements env seen_constructor' private_names' (element :: acc) - in - fun ~expression env -> - with_loc - (fun env -> - let leading = Peek.comments env in - if Eat.maybe env T_LCURLY then ( - enter_class env; - let body = elements env false SMap.empty [] in - exit_class env; - Expect.token env T_RCURLY; - let trailing = - match (expression, Peek.token env) with - | (true, _) - | (_, (T_RCURLY | T_EOF)) -> - Eat.trailing_comments env - | _ when Peek.is_line_terminator env -> Eat.comments_until_next_line env - | _ -> [] - in - { Ast.Class.Body.body; comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () } - ) else ( - Expect.error env T_LCURLY; - { Ast.Class.Body.body = []; comments = None } - )) - env - - let _class ?(decorators = []) env ~optional_id ~expression = - (* 10.2.1 says all parts of a class definition are strict *) - let env = env |> with_strict true in - let decorators = decorators @ decorator_list env in - let leading = Peek.comments env in - Expect.token env T_CLASS; - let id = - let tmp_env = env |> with_no_let true in - match (optional_id, Peek.token tmp_env) with - | (true, (T_EXTENDS | T_IMPLEMENTS | T_LESS_THAN | T_LCURLY)) -> None - | _ when Peek.is_identifier env -> - let id = Parse.identifier tmp_env in - let { remove_trailing; _ } = trailing_and_remover env in - let id = remove_trailing id (fun remover id -> remover#identifier id) in - Some id - | _ -> - (* error, but don't consume a token like Parse.identifier does. this helps - with recovery, and the parser won't get stuck because we consumed the - `class` token above. *) - error_nameless_declaration env "class"; - Some (Peek.loc env, { Identifier.name = ""; comments = None }) - in - let tparams = - match Type.type_params env with - | None -> None - | Some tparams -> - let { remove_trailing; _ } = trailing_and_remover env in - Some (remove_trailing tparams (fun remover tparams -> remover#type_params tparams)) - in - let (extends, implements) = class_heritage env in - let body = class_body env ~expression in - let comments = Flow_ast_utils.mk_comments_opt ~leading () in - { Class.id; body; tparams; extends; implements; class_decorators = decorators; comments } - - let class_declaration env decorators = - with_loc - (fun env -> - let optional_id = in_export_default env in - Ast.Statement.ClassDeclaration (_class env ~decorators ~optional_id ~expression:false)) - env - - let class_expression = - with_loc (fun env -> Ast.Expression.Class (_class env ~optional_id:true ~expression:true)) -end diff --git a/compiler/js_parser/parse_error.ml b/compiler/js_parser/parse_error.ml deleted file mode 100644 index 93381483af..0000000000 --- a/compiler/js_parser/parse_error.ml +++ /dev/null @@ -1,941 +0,0 @@ -(* - * 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 Primitive_deriving - -type t = - | EnumBooleanMemberNotInitialized of { - enum_name: string; - member_name: string; - } - | EnumDuplicateMemberName of { - enum_name: string; - member_name: string; - } - | EnumInconsistentMemberValues of { enum_name: string } - | EnumInvalidExplicitType of { - enum_name: string; - supplied_type: string option; - } - | EnumInvalidExport - | EnumInvalidInitializerSeparator of { member_name: string } - | EnumInvalidMemberInitializer of { - enum_name: string; - explicit_type: Enum_common.explicit_type option; - member_name: string; - } - | EnumInvalidMemberName of { - enum_name: string; - member_name: string; - } - | EnumInvalidMemberSeparator - | EnumInvalidEllipsis of { trailing_comma: bool } - | EnumNumberMemberNotInitialized of { - enum_name: string; - member_name: string; - } - | EnumStringMemberInconsistentlyInitailized of { enum_name: string } - | Unexpected of string - | UnexpectedWithExpected of string * string - | UnexpectedTokenWithSuggestion of string * string - | UnexpectedReserved - | UnexpectedReservedType - | UnexpectedSuper - | UnexpectedSuperCall - | UnexpectedEOS - | UnexpectedVariance - | UnexpectedStatic - | UnexpectedProto - | UnexpectedTypeAlias - | UnexpectedOpaqueTypeAlias - | UnexpectedTypeAnnotation - | UnexpectedTypeDeclaration - | UnexpectedTypeImport - | UnexpectedTypeExport - | UnexpectedTypeInterface - | UnexpectedSpreadType - | UnexpectedExplicitInexactInObject - | InexactInsideExact - | InexactInsideNonObject - | NewlineAfterThrow - | InvalidFloatBigInt - | InvalidSciBigInt - | InvalidRegExp - | InvalidRegExpFlags of string - | UnterminatedRegExp - | InvalidLHSInAssignment - | InvalidLHSInExponentiation - | InvalidLHSInForIn - | InvalidLHSInForOf - | InvalidIndexedAccess of { has_bracket: bool } - | InvalidOptionalIndexedAccess - | ExpectedPatternFoundExpression - | MultipleDefaultsInSwitch - | NoCatchOrFinally - | UnknownLabel of string - | Redeclaration of string * string - | IllegalContinue - | IllegalBreak - | IllegalReturn - | IllegalUnicodeEscape - | StrictModeWith - | StrictCatchVariable - | StrictVarName - | StrictParamName - | StrictParamDupe - | StrictParamNotSimple - | StrictFunctionName - | StrictOctalLiteral - | StrictNonOctalLiteral - | StrictDelete - | StrictDuplicateProperty - | AccessorDataProperty - | AccessorGetSet - | InvalidTypeof - | StrictLHSAssignment - | StrictLHSPostfix - | StrictLHSPrefix - | StrictReservedWord - | JSXAttributeValueEmptyExpression - | InvalidJSXAttributeValue - | ExpectedJSXClosingTag of string - | NoUninitializedConst - | NoUninitializedDestructuring - | NewlineBeforeArrow - | FunctionAsStatement of { in_strict_mode: bool } - | AsyncFunctionAsStatement - | GeneratorFunctionAsStatement - | AdjacentJSXElements - | ParameterAfterRestParameter - | ElementAfterRestElement - | PropertyAfterRestElement - | DeclareAsync - | DeclareClassElement - | DeclareClassFieldInitializer - | DeclareOpaqueTypeInitializer - | DeclareExportLet - | DeclareExportConst - | DeclareExportType - | DeclareExportInterface - | DuplicateExport of string - | UnsupportedDecorator - | MissingTypeParamDefault - | DuplicateDeclareModuleExports - | AmbiguousDeclareModuleKind - | GetterArity - | SetterArity - | InvalidNonTypeImportInDeclareModule - | ImportTypeShorthandOnlyInPureImport - | ImportSpecifierMissingComma - | ExportSpecifierMissingComma - | MalformedUnicode - | DuplicateConstructor - | DuplicatePrivateFields of string - | InvalidClassMemberName of { - name: string; - static: bool; - method_: bool; - private_: bool; - } - | PrivateDelete - | UnboundPrivate of string - | PrivateNotInClass - | SuperPrivate - | YieldInFormalParameters - | AwaitAsIdentifierReference - | YieldAsIdentifierReference - | AmbiguousLetBracket - | LiteralShorthandProperty - | ComputedShorthandProperty - | MethodInDestructuring - | TrailingCommaAfterRestElement - | OptionalChainNew - | OptionalChainTemplate - | NullishCoalescingUnexpectedLogical of string - | WhitespaceInPrivateName - | ThisParamAnnotationRequired - | ThisParamMustBeFirst - | ThisParamMayNotBeOptional - | GetterMayNotHaveThisParam - | SetterMayNotHaveThisParam - | ThisParamBannedInArrowFunctions - | ThisParamBannedInConstructor -[@@deriving_inline compare] -let _ = fun (_ : t) -> () -let compare = - (fun a__001_ -> - fun b__002_ -> - if Ppx_compare_lib.phys_equal a__001_ b__002_ - then 0 - else - (match (a__001_, b__002_) with - | (EnumBooleanMemberNotInitialized _a__003_, - EnumBooleanMemberNotInitialized _b__004_) -> - (match compare_string _a__003_.enum_name _b__004_.enum_name - with - | 0 -> - compare_string _a__003_.member_name _b__004_.member_name - | n -> n) - | (EnumBooleanMemberNotInitialized _, _) -> (-1) - | (_, EnumBooleanMemberNotInitialized _) -> 1 - | (EnumDuplicateMemberName _a__005_, EnumDuplicateMemberName - _b__006_) -> - (match compare_string _a__005_.enum_name _b__006_.enum_name - with - | 0 -> - compare_string _a__005_.member_name _b__006_.member_name - | n -> n) - | (EnumDuplicateMemberName _, _) -> (-1) - | (_, EnumDuplicateMemberName _) -> 1 - | (EnumInconsistentMemberValues _a__007_, - EnumInconsistentMemberValues _b__008_) -> - compare_string _a__007_.enum_name _b__008_.enum_name - | (EnumInconsistentMemberValues _, _) -> (-1) - | (_, EnumInconsistentMemberValues _) -> 1 - | (EnumInvalidExplicitType _a__009_, EnumInvalidExplicitType - _b__010_) -> - (match compare_string _a__009_.enum_name _b__010_.enum_name - with - | 0 -> - compare_option compare_string _a__009_.supplied_type - _b__010_.supplied_type - | n -> n) - | (EnumInvalidExplicitType _, _) -> (-1) - | (_, EnumInvalidExplicitType _) -> 1 - | (EnumInvalidExport, EnumInvalidExport) -> 0 - | (EnumInvalidExport, _) -> (-1) - | (_, EnumInvalidExport) -> 1 - | (EnumInvalidInitializerSeparator _a__013_, - EnumInvalidInitializerSeparator _b__014_) -> - compare_string _a__013_.member_name _b__014_.member_name - | (EnumInvalidInitializerSeparator _, _) -> (-1) - | (_, EnumInvalidInitializerSeparator _) -> 1 - | (EnumInvalidMemberInitializer _a__015_, - EnumInvalidMemberInitializer _b__016_) -> - (match compare_string _a__015_.enum_name _b__016_.enum_name - with - | 0 -> - (match compare_option Enum_common.compare_explicit_type - _a__015_.explicit_type _b__016_.explicit_type - with - | 0 -> - compare_string _a__015_.member_name - _b__016_.member_name - | n -> n) - | n -> n) - | (EnumInvalidMemberInitializer _, _) -> (-1) - | (_, EnumInvalidMemberInitializer _) -> 1 - | (EnumInvalidMemberName _a__019_, EnumInvalidMemberName _b__020_) - -> - (match compare_string _a__019_.enum_name _b__020_.enum_name - with - | 0 -> - compare_string _a__019_.member_name _b__020_.member_name - | n -> n) - | (EnumInvalidMemberName _, _) -> (-1) - | (_, EnumInvalidMemberName _) -> 1 - | (EnumInvalidMemberSeparator, EnumInvalidMemberSeparator) -> 0 - | (EnumInvalidMemberSeparator, _) -> (-1) - | (_, EnumInvalidMemberSeparator) -> 1 - | (EnumInvalidEllipsis _a__021_, EnumInvalidEllipsis _b__022_) -> - compare_bool _a__021_.trailing_comma _b__022_.trailing_comma - | (EnumInvalidEllipsis _, _) -> (-1) - | (_, EnumInvalidEllipsis _) -> 1 - | (EnumNumberMemberNotInitialized _a__023_, - EnumNumberMemberNotInitialized _b__024_) -> - (match compare_string _a__023_.enum_name _b__024_.enum_name - with - | 0 -> - compare_string _a__023_.member_name _b__024_.member_name - | n -> n) - | (EnumNumberMemberNotInitialized _, _) -> (-1) - | (_, EnumNumberMemberNotInitialized _) -> 1 - | (EnumStringMemberInconsistentlyInitailized _a__025_, - EnumStringMemberInconsistentlyInitailized _b__026_) -> - compare_string _a__025_.enum_name _b__026_.enum_name - | (EnumStringMemberInconsistentlyInitailized _, _) -> (-1) - | (_, EnumStringMemberInconsistentlyInitailized _) -> 1 - | (Unexpected _a__027_, Unexpected _b__028_) -> - compare_string _a__027_ _b__028_ - | (Unexpected _, _) -> (-1) - | (_, Unexpected _) -> 1 - | (UnexpectedWithExpected (_a__029_, _a__031_), - UnexpectedWithExpected (_b__030_, _b__032_)) -> - (match compare_string _a__029_ _b__030_ with - | 0 -> compare_string _a__031_ _b__032_ - | n -> n) - | (UnexpectedWithExpected _, _) -> (-1) - | (_, UnexpectedWithExpected _) -> 1 - | (UnexpectedTokenWithSuggestion (_a__033_, _a__035_), - UnexpectedTokenWithSuggestion (_b__034_, _b__036_)) -> - (match compare_string _a__033_ _b__034_ with - | 0 -> compare_string _a__035_ _b__036_ - | n -> n) - | (UnexpectedTokenWithSuggestion _, _) -> (-1) - | (_, UnexpectedTokenWithSuggestion _) -> 1 - | (UnexpectedReserved, UnexpectedReserved) -> 0 - | (UnexpectedReserved, _) -> (-1) - | (_, UnexpectedReserved) -> 1 - | (UnexpectedReservedType, UnexpectedReservedType) -> 0 - | (UnexpectedReservedType, _) -> (-1) - | (_, UnexpectedReservedType) -> 1 - | (UnexpectedSuper, UnexpectedSuper) -> 0 - | (UnexpectedSuper, _) -> (-1) - | (_, UnexpectedSuper) -> 1 - | (UnexpectedSuperCall, UnexpectedSuperCall) -> 0 - | (UnexpectedSuperCall, _) -> (-1) - | (_, UnexpectedSuperCall) -> 1 - | (UnexpectedEOS, UnexpectedEOS) -> 0 - | (UnexpectedEOS, _) -> (-1) - | (_, UnexpectedEOS) -> 1 - | (UnexpectedVariance, UnexpectedVariance) -> 0 - | (UnexpectedVariance, _) -> (-1) - | (_, UnexpectedVariance) -> 1 - | (UnexpectedStatic, UnexpectedStatic) -> 0 - | (UnexpectedStatic, _) -> (-1) - | (_, UnexpectedStatic) -> 1 - | (UnexpectedProto, UnexpectedProto) -> 0 - | (UnexpectedProto, _) -> (-1) - | (_, UnexpectedProto) -> 1 - | (UnexpectedTypeAlias, UnexpectedTypeAlias) -> 0 - | (UnexpectedTypeAlias, _) -> (-1) - | (_, UnexpectedTypeAlias) -> 1 - | (UnexpectedOpaqueTypeAlias, UnexpectedOpaqueTypeAlias) -> 0 - | (UnexpectedOpaqueTypeAlias, _) -> (-1) - | (_, UnexpectedOpaqueTypeAlias) -> 1 - | (UnexpectedTypeAnnotation, UnexpectedTypeAnnotation) -> 0 - | (UnexpectedTypeAnnotation, _) -> (-1) - | (_, UnexpectedTypeAnnotation) -> 1 - | (UnexpectedTypeDeclaration, UnexpectedTypeDeclaration) -> 0 - | (UnexpectedTypeDeclaration, _) -> (-1) - | (_, UnexpectedTypeDeclaration) -> 1 - | (UnexpectedTypeImport, UnexpectedTypeImport) -> 0 - | (UnexpectedTypeImport, _) -> (-1) - | (_, UnexpectedTypeImport) -> 1 - | (UnexpectedTypeExport, UnexpectedTypeExport) -> 0 - | (UnexpectedTypeExport, _) -> (-1) - | (_, UnexpectedTypeExport) -> 1 - | (UnexpectedTypeInterface, UnexpectedTypeInterface) -> 0 - | (UnexpectedTypeInterface, _) -> (-1) - | (_, UnexpectedTypeInterface) -> 1 - | (UnexpectedSpreadType, UnexpectedSpreadType) -> 0 - | (UnexpectedSpreadType, _) -> (-1) - | (_, UnexpectedSpreadType) -> 1 - | (UnexpectedExplicitInexactInObject, - UnexpectedExplicitInexactInObject) -> 0 - | (UnexpectedExplicitInexactInObject, _) -> (-1) - | (_, UnexpectedExplicitInexactInObject) -> 1 - | (InexactInsideExact, InexactInsideExact) -> 0 - | (InexactInsideExact, _) -> (-1) - | (_, InexactInsideExact) -> 1 - | (InexactInsideNonObject, InexactInsideNonObject) -> 0 - | (InexactInsideNonObject, _) -> (-1) - | (_, InexactInsideNonObject) -> 1 - | (NewlineAfterThrow, NewlineAfterThrow) -> 0 - | (NewlineAfterThrow, _) -> (-1) - | (_, NewlineAfterThrow) -> 1 - | (InvalidFloatBigInt, InvalidFloatBigInt) -> 0 - | (InvalidFloatBigInt, _) -> (-1) - | (_, InvalidFloatBigInt) -> 1 - | (InvalidSciBigInt, InvalidSciBigInt) -> 0 - | (InvalidSciBigInt, _) -> (-1) - | (_, InvalidSciBigInt) -> 1 - | (InvalidRegExp, InvalidRegExp) -> 0 - | (InvalidRegExp, _) -> (-1) - | (_, InvalidRegExp) -> 1 - | (InvalidRegExpFlags _a__037_, InvalidRegExpFlags _b__038_) -> - compare_string _a__037_ _b__038_ - | (InvalidRegExpFlags _, _) -> (-1) - | (_, InvalidRegExpFlags _) -> 1 - | (UnterminatedRegExp, UnterminatedRegExp) -> 0 - | (UnterminatedRegExp, _) -> (-1) - | (_, UnterminatedRegExp) -> 1 - | (InvalidLHSInAssignment, InvalidLHSInAssignment) -> 0 - | (InvalidLHSInAssignment, _) -> (-1) - | (_, InvalidLHSInAssignment) -> 1 - | (InvalidLHSInExponentiation, InvalidLHSInExponentiation) -> 0 - | (InvalidLHSInExponentiation, _) -> (-1) - | (_, InvalidLHSInExponentiation) -> 1 - | (InvalidLHSInForIn, InvalidLHSInForIn) -> 0 - | (InvalidLHSInForIn, _) -> (-1) - | (_, InvalidLHSInForIn) -> 1 - | (InvalidLHSInForOf, InvalidLHSInForOf) -> 0 - | (InvalidLHSInForOf, _) -> (-1) - | (_, InvalidLHSInForOf) -> 1 - | (InvalidIndexedAccess _a__039_, InvalidIndexedAccess _b__040_) -> - compare_bool _a__039_.has_bracket _b__040_.has_bracket - | (InvalidIndexedAccess _, _) -> (-1) - | (_, InvalidIndexedAccess _) -> 1 - | (InvalidOptionalIndexedAccess, InvalidOptionalIndexedAccess) -> 0 - | (InvalidOptionalIndexedAccess, _) -> (-1) - | (_, InvalidOptionalIndexedAccess) -> 1 - | (ExpectedPatternFoundExpression, ExpectedPatternFoundExpression) - -> 0 - | (ExpectedPatternFoundExpression, _) -> (-1) - | (_, ExpectedPatternFoundExpression) -> 1 - | (MultipleDefaultsInSwitch, MultipleDefaultsInSwitch) -> 0 - | (MultipleDefaultsInSwitch, _) -> (-1) - | (_, MultipleDefaultsInSwitch) -> 1 - | (NoCatchOrFinally, NoCatchOrFinally) -> 0 - | (NoCatchOrFinally, _) -> (-1) - | (_, NoCatchOrFinally) -> 1 - | (UnknownLabel _a__041_, UnknownLabel _b__042_) -> - compare_string _a__041_ _b__042_ - | (UnknownLabel _, _) -> (-1) - | (_, UnknownLabel _) -> 1 - | (Redeclaration (_a__043_, _a__045_), Redeclaration - (_b__044_, _b__046_)) -> - (match compare_string _a__043_ _b__044_ with - | 0 -> compare_string _a__045_ _b__046_ - | n -> n) - | (Redeclaration _, _) -> (-1) - | (_, Redeclaration _) -> 1 - | (IllegalContinue, IllegalContinue) -> 0 - | (IllegalContinue, _) -> (-1) - | (_, IllegalContinue) -> 1 - | (IllegalBreak, IllegalBreak) -> 0 - | (IllegalBreak, _) -> (-1) - | (_, IllegalBreak) -> 1 - | (IllegalReturn, IllegalReturn) -> 0 - | (IllegalReturn, _) -> (-1) - | (_, IllegalReturn) -> 1 - | (IllegalUnicodeEscape, IllegalUnicodeEscape) -> 0 - | (IllegalUnicodeEscape, _) -> (-1) - | (_, IllegalUnicodeEscape) -> 1 - | (StrictModeWith, StrictModeWith) -> 0 - | (StrictModeWith, _) -> (-1) - | (_, StrictModeWith) -> 1 - | (StrictCatchVariable, StrictCatchVariable) -> 0 - | (StrictCatchVariable, _) -> (-1) - | (_, StrictCatchVariable) -> 1 - | (StrictVarName, StrictVarName) -> 0 - | (StrictVarName, _) -> (-1) - | (_, StrictVarName) -> 1 - | (StrictParamName, StrictParamName) -> 0 - | (StrictParamName, _) -> (-1) - | (_, StrictParamName) -> 1 - | (StrictParamDupe, StrictParamDupe) -> 0 - | (StrictParamDupe, _) -> (-1) - | (_, StrictParamDupe) -> 1 - | (StrictParamNotSimple, StrictParamNotSimple) -> 0 - | (StrictParamNotSimple, _) -> (-1) - | (_, StrictParamNotSimple) -> 1 - | (StrictFunctionName, StrictFunctionName) -> 0 - | (StrictFunctionName, _) -> (-1) - | (_, StrictFunctionName) -> 1 - | (StrictOctalLiteral, StrictOctalLiteral) -> 0 - | (StrictOctalLiteral, _) -> (-1) - | (_, StrictOctalLiteral) -> 1 - | (StrictNonOctalLiteral, StrictNonOctalLiteral) -> 0 - | (StrictNonOctalLiteral, _) -> (-1) - | (_, StrictNonOctalLiteral) -> 1 - | (StrictDelete, StrictDelete) -> 0 - | (StrictDelete, _) -> (-1) - | (_, StrictDelete) -> 1 - | (StrictDuplicateProperty, StrictDuplicateProperty) -> 0 - | (StrictDuplicateProperty, _) -> (-1) - | (_, StrictDuplicateProperty) -> 1 - | (AccessorDataProperty, AccessorDataProperty) -> 0 - | (AccessorDataProperty, _) -> (-1) - | (_, AccessorDataProperty) -> 1 - | (AccessorGetSet, AccessorGetSet) -> 0 - | (AccessorGetSet, _) -> (-1) - | (_, AccessorGetSet) -> 1 - | (InvalidTypeof, InvalidTypeof) -> 0 - | (InvalidTypeof, _) -> (-1) - | (_, InvalidTypeof) -> 1 - | (StrictLHSAssignment, StrictLHSAssignment) -> 0 - | (StrictLHSAssignment, _) -> (-1) - | (_, StrictLHSAssignment) -> 1 - | (StrictLHSPostfix, StrictLHSPostfix) -> 0 - | (StrictLHSPostfix, _) -> (-1) - | (_, StrictLHSPostfix) -> 1 - | (StrictLHSPrefix, StrictLHSPrefix) -> 0 - | (StrictLHSPrefix, _) -> (-1) - | (_, StrictLHSPrefix) -> 1 - | (StrictReservedWord, StrictReservedWord) -> 0 - | (StrictReservedWord, _) -> (-1) - | (_, StrictReservedWord) -> 1 - | (JSXAttributeValueEmptyExpression, - JSXAttributeValueEmptyExpression) -> 0 - | (JSXAttributeValueEmptyExpression, _) -> (-1) - | (_, JSXAttributeValueEmptyExpression) -> 1 - | (InvalidJSXAttributeValue, InvalidJSXAttributeValue) -> 0 - | (InvalidJSXAttributeValue, _) -> (-1) - | (_, InvalidJSXAttributeValue) -> 1 - | (ExpectedJSXClosingTag _a__047_, ExpectedJSXClosingTag _b__048_) - -> compare_string _a__047_ _b__048_ - | (ExpectedJSXClosingTag _, _) -> (-1) - | (_, ExpectedJSXClosingTag _) -> 1 - | (NoUninitializedConst, NoUninitializedConst) -> 0 - | (NoUninitializedConst, _) -> (-1) - | (_, NoUninitializedConst) -> 1 - | (NoUninitializedDestructuring, NoUninitializedDestructuring) -> 0 - | (NoUninitializedDestructuring, _) -> (-1) - | (_, NoUninitializedDestructuring) -> 1 - | (NewlineBeforeArrow, NewlineBeforeArrow) -> 0 - | (NewlineBeforeArrow, _) -> (-1) - | (_, NewlineBeforeArrow) -> 1 - | (FunctionAsStatement _a__049_, FunctionAsStatement _b__050_) -> - compare_bool _a__049_.in_strict_mode _b__050_.in_strict_mode - | (FunctionAsStatement _, _) -> (-1) - | (_, FunctionAsStatement _) -> 1 - | (AsyncFunctionAsStatement, AsyncFunctionAsStatement) -> 0 - | (AsyncFunctionAsStatement, _) -> (-1) - | (_, AsyncFunctionAsStatement) -> 1 - | (GeneratorFunctionAsStatement, GeneratorFunctionAsStatement) -> 0 - | (GeneratorFunctionAsStatement, _) -> (-1) - | (_, GeneratorFunctionAsStatement) -> 1 - | (AdjacentJSXElements, AdjacentJSXElements) -> 0 - | (AdjacentJSXElements, _) -> (-1) - | (_, AdjacentJSXElements) -> 1 - | (ParameterAfterRestParameter, ParameterAfterRestParameter) -> 0 - | (ParameterAfterRestParameter, _) -> (-1) - | (_, ParameterAfterRestParameter) -> 1 - | (ElementAfterRestElement, ElementAfterRestElement) -> 0 - | (ElementAfterRestElement, _) -> (-1) - | (_, ElementAfterRestElement) -> 1 - | (PropertyAfterRestElement, PropertyAfterRestElement) -> 0 - | (PropertyAfterRestElement, _) -> (-1) - | (_, PropertyAfterRestElement) -> 1 - | (DeclareAsync, DeclareAsync) -> 0 - | (DeclareAsync, _) -> (-1) - | (_, DeclareAsync) -> 1 - | (DeclareClassElement, DeclareClassElement) -> 0 - | (DeclareClassElement, _) -> (-1) - | (_, DeclareClassElement) -> 1 - | (DeclareClassFieldInitializer, DeclareClassFieldInitializer) -> 0 - | (DeclareClassFieldInitializer, _) -> (-1) - | (_, DeclareClassFieldInitializer) -> 1 - | (DeclareOpaqueTypeInitializer, DeclareOpaqueTypeInitializer) -> 0 - | (DeclareOpaqueTypeInitializer, _) -> (-1) - | (_, DeclareOpaqueTypeInitializer) -> 1 - | (DeclareExportLet, DeclareExportLet) -> 0 - | (DeclareExportLet, _) -> (-1) - | (_, DeclareExportLet) -> 1 - | (DeclareExportConst, DeclareExportConst) -> 0 - | (DeclareExportConst, _) -> (-1) - | (_, DeclareExportConst) -> 1 - | (DeclareExportType, DeclareExportType) -> 0 - | (DeclareExportType, _) -> (-1) - | (_, DeclareExportType) -> 1 - | (DeclareExportInterface, DeclareExportInterface) -> 0 - | (DeclareExportInterface, _) -> (-1) - | (_, DeclareExportInterface) -> 1 - | (DuplicateExport _a__051_, DuplicateExport _b__052_) -> - compare_string _a__051_ _b__052_ - | (DuplicateExport _, _) -> (-1) - | (_, DuplicateExport _) -> 1 - | (UnsupportedDecorator, UnsupportedDecorator) -> 0 - | (UnsupportedDecorator, _) -> (-1) - | (_, UnsupportedDecorator) -> 1 - | (MissingTypeParamDefault, MissingTypeParamDefault) -> 0 - | (MissingTypeParamDefault, _) -> (-1) - | (_, MissingTypeParamDefault) -> 1 - | (DuplicateDeclareModuleExports, DuplicateDeclareModuleExports) -> - 0 - | (DuplicateDeclareModuleExports, _) -> (-1) - | (_, DuplicateDeclareModuleExports) -> 1 - | (AmbiguousDeclareModuleKind, AmbiguousDeclareModuleKind) -> 0 - | (AmbiguousDeclareModuleKind, _) -> (-1) - | (_, AmbiguousDeclareModuleKind) -> 1 - | (GetterArity, GetterArity) -> 0 - | (GetterArity, _) -> (-1) - | (_, GetterArity) -> 1 - | (SetterArity, SetterArity) -> 0 - | (SetterArity, _) -> (-1) - | (_, SetterArity) -> 1 - | (InvalidNonTypeImportInDeclareModule, - InvalidNonTypeImportInDeclareModule) -> 0 - | (InvalidNonTypeImportInDeclareModule, _) -> (-1) - | (_, InvalidNonTypeImportInDeclareModule) -> 1 - | (ImportTypeShorthandOnlyInPureImport, - ImportTypeShorthandOnlyInPureImport) -> 0 - | (ImportTypeShorthandOnlyInPureImport, _) -> (-1) - | (_, ImportTypeShorthandOnlyInPureImport) -> 1 - | (ImportSpecifierMissingComma, ImportSpecifierMissingComma) -> 0 - | (ImportSpecifierMissingComma, _) -> (-1) - | (_, ImportSpecifierMissingComma) -> 1 - | (ExportSpecifierMissingComma, ExportSpecifierMissingComma) -> 0 - | (ExportSpecifierMissingComma, _) -> (-1) - | (_, ExportSpecifierMissingComma) -> 1 - | (MalformedUnicode, MalformedUnicode) -> 0 - | (MalformedUnicode, _) -> (-1) - | (_, MalformedUnicode) -> 1 - | (DuplicateConstructor, DuplicateConstructor) -> 0 - | (DuplicateConstructor, _) -> (-1) - | (_, DuplicateConstructor) -> 1 - | (DuplicatePrivateFields _a__053_, DuplicatePrivateFields - _b__054_) -> compare_string _a__053_ _b__054_ - | (DuplicatePrivateFields _, _) -> (-1) - | (_, DuplicatePrivateFields _) -> 1 - | (InvalidClassMemberName _a__055_, InvalidClassMemberName - _b__056_) -> - (match compare_string _a__055_.name _b__056_.name with - | 0 -> - (match compare_bool _a__055_.static _b__056_.static with - | 0 -> - (match compare_bool _a__055_.method_ _b__056_.method_ - with - | 0 -> - compare_bool _a__055_.private_ _b__056_.private_ - | n -> n) - | n -> n) - | n -> n) - | (InvalidClassMemberName _, _) -> (-1) - | (_, InvalidClassMemberName _) -> 1 - | (PrivateDelete, PrivateDelete) -> 0 - | (PrivateDelete, _) -> (-1) - | (_, PrivateDelete) -> 1 - | (UnboundPrivate _a__057_, UnboundPrivate _b__058_) -> - compare_string _a__057_ _b__058_ - | (UnboundPrivate _, _) -> (-1) - | (_, UnboundPrivate _) -> 1 - | (PrivateNotInClass, PrivateNotInClass) -> 0 - | (PrivateNotInClass, _) -> (-1) - | (_, PrivateNotInClass) -> 1 - | (SuperPrivate, SuperPrivate) -> 0 - | (SuperPrivate, _) -> (-1) - | (_, SuperPrivate) -> 1 - | (YieldInFormalParameters, YieldInFormalParameters) -> 0 - | (YieldInFormalParameters, _) -> (-1) - | (_, YieldInFormalParameters) -> 1 - | (AwaitAsIdentifierReference, AwaitAsIdentifierReference) -> 0 - | (AwaitAsIdentifierReference, _) -> (-1) - | (_, AwaitAsIdentifierReference) -> 1 - | (YieldAsIdentifierReference, YieldAsIdentifierReference) -> 0 - | (YieldAsIdentifierReference, _) -> (-1) - | (_, YieldAsIdentifierReference) -> 1 - | (AmbiguousLetBracket, AmbiguousLetBracket) -> 0 - | (AmbiguousLetBracket, _) -> (-1) - | (_, AmbiguousLetBracket) -> 1 - | (LiteralShorthandProperty, LiteralShorthandProperty) -> 0 - | (LiteralShorthandProperty, _) -> (-1) - | (_, LiteralShorthandProperty) -> 1 - | (ComputedShorthandProperty, ComputedShorthandProperty) -> 0 - | (ComputedShorthandProperty, _) -> (-1) - | (_, ComputedShorthandProperty) -> 1 - | (MethodInDestructuring, MethodInDestructuring) -> 0 - | (MethodInDestructuring, _) -> (-1) - | (_, MethodInDestructuring) -> 1 - | (TrailingCommaAfterRestElement, TrailingCommaAfterRestElement) -> - 0 - | (TrailingCommaAfterRestElement, _) -> (-1) - | (_, TrailingCommaAfterRestElement) -> 1 - | (OptionalChainNew, OptionalChainNew) -> 0 - | (OptionalChainNew, _) -> (-1) - | (_, OptionalChainNew) -> 1 - | (OptionalChainTemplate, OptionalChainTemplate) -> 0 - | (OptionalChainTemplate, _) -> (-1) - | (_, OptionalChainTemplate) -> 1 - | (NullishCoalescingUnexpectedLogical _a__059_, - NullishCoalescingUnexpectedLogical _b__060_) -> - compare_string _a__059_ _b__060_ - | (NullishCoalescingUnexpectedLogical _, _) -> (-1) - | (_, NullishCoalescingUnexpectedLogical _) -> 1 - | (WhitespaceInPrivateName, WhitespaceInPrivateName) -> 0 - | (WhitespaceInPrivateName, _) -> (-1) - | (_, WhitespaceInPrivateName) -> 1 - | (ThisParamAnnotationRequired, ThisParamAnnotationRequired) -> 0 - | (ThisParamAnnotationRequired, _) -> (-1) - | (_, ThisParamAnnotationRequired) -> 1 - | (ThisParamMustBeFirst, ThisParamMustBeFirst) -> 0 - | (ThisParamMustBeFirst, _) -> (-1) - | (_, ThisParamMustBeFirst) -> 1 - | (ThisParamMayNotBeOptional, ThisParamMayNotBeOptional) -> 0 - | (ThisParamMayNotBeOptional, _) -> (-1) - | (_, ThisParamMayNotBeOptional) -> 1 - | (GetterMayNotHaveThisParam, GetterMayNotHaveThisParam) -> 0 - | (GetterMayNotHaveThisParam, _) -> (-1) - | (_, GetterMayNotHaveThisParam) -> 1 - | (SetterMayNotHaveThisParam, SetterMayNotHaveThisParam) -> 0 - | (SetterMayNotHaveThisParam, _) -> (-1) - | (_, SetterMayNotHaveThisParam) -> 1 - | (ThisParamBannedInArrowFunctions, - ThisParamBannedInArrowFunctions) -> 0 - | (ThisParamBannedInArrowFunctions, _) -> (-1) - | (_, ThisParamBannedInArrowFunctions) -> 1 - | (ThisParamBannedInConstructor, ThisParamBannedInConstructor) -> 0) : - t -> t -> int) -let _ = compare -[@@@end] -exception Error of (Loc.t * t) * (Loc.t * t) list - -let error loc e = raise (Error ((loc, e), [])) - -module PP = struct - let error = function - | EnumBooleanMemberNotInitialized { enum_name; member_name } -> - Printf.sprintf - "Boolean enum members need to be initialized. Use either `%s = true,` or `%s = false,` in enum `%s`." - member_name - member_name - enum_name - | EnumDuplicateMemberName { enum_name; member_name } -> - Printf.sprintf - "Enum member names need to be unique, but the name `%s` has already been used before in enum `%s`." - member_name - enum_name - | EnumInconsistentMemberValues { enum_name } -> - Printf.sprintf - "Enum `%s` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers." - enum_name - | EnumInvalidExplicitType { enum_name; supplied_type } -> - let suggestion = - Printf.sprintf - "Use one of `boolean`, `number`, `string`, or `symbol` in enum `%s`." - enum_name - in - begin - match supplied_type with - | Some supplied_type -> - Printf.sprintf "Enum type `%s` is not valid. %s" supplied_type suggestion - | None -> Printf.sprintf "Supplied enum type is not valid. %s" suggestion - end - | EnumInvalidExport -> - "Cannot export an enum with `export type`, try `export enum E {}` or `module.exports = E;` instead." - | EnumInvalidInitializerSeparator { member_name } -> - Printf.sprintf - "Enum member names and initializers are separated with `=`. Replace `%s:` with `%s =`." - member_name - member_name - | EnumInvalidMemberInitializer { enum_name; explicit_type; member_name } -> begin - match explicit_type with - | Some (Enum_common.Boolean as explicit_type) - | Some (Enum_common.Number as explicit_type) - | Some (Enum_common.String as explicit_type) -> - let explicit_type_str = Enum_common.string_of_explicit_type explicit_type in - Printf.sprintf - "Enum `%s` has type `%s`, so the initializer of `%s` needs to be a %s literal." - enum_name - explicit_type_str - member_name - explicit_type_str - | Some Enum_common.Symbol -> - Printf.sprintf - "Symbol enum members cannot be initialized. Use `%s,` in enum `%s`." - member_name - enum_name - | None -> - Printf.sprintf - "The enum member initializer for `%s` needs to be a literal (either a boolean, number, or string) in enum `%s`." - member_name - enum_name - end - | EnumInvalidMemberName { enum_name; member_name } -> - (* Based on the error condition, we will only receive member names starting with [a-z] *) - let suggestion = String.capitalize_ascii member_name in - Printf.sprintf - "Enum member names cannot start with lowercase 'a' through 'z'. Instead of using `%s`, consider using `%s`, in enum `%s`." - member_name - suggestion - enum_name - | EnumInvalidMemberSeparator -> "Enum members are separated with `,`. Replace `;` with `,`." - | EnumInvalidEllipsis { trailing_comma } -> - if trailing_comma then - "The `...` must come at the end of the enum body. Remove the trailing comma." - else - "The `...` must come after all enum members. Move it to the end of the enum body." - | EnumNumberMemberNotInitialized { enum_name; member_name } -> - Printf.sprintf - "Number enum members need to be initialized, e.g. `%s = 1,` in enum `%s`." - member_name - enum_name - | EnumStringMemberInconsistentlyInitailized { enum_name } -> - Printf.sprintf - "String enum members need to consistently either all use initializers, or use no initializers, in enum %s." - enum_name - | Unexpected unexpected -> Printf.sprintf "Unexpected %s" unexpected - | UnexpectedWithExpected (unexpected, expected) -> - Printf.sprintf "Unexpected %s, expected %s" unexpected expected - | UnexpectedTokenWithSuggestion (token, suggestion) -> - Printf.sprintf "Unexpected token `%s`. Did you mean `%s`?" token suggestion - | UnexpectedReserved -> "Unexpected reserved word" - | UnexpectedReservedType -> "Unexpected reserved type" - | UnexpectedSuper -> "Unexpected `super` outside of a class method" - | UnexpectedSuperCall -> "`super()` is only valid in a class constructor" - | UnexpectedEOS -> "Unexpected end of input" - | UnexpectedVariance -> "Unexpected variance sigil" - | UnexpectedStatic -> "Unexpected static modifier" - | UnexpectedProto -> "Unexpected proto modifier" - | UnexpectedTypeAlias -> "Type aliases are not allowed in untyped mode" - | UnexpectedOpaqueTypeAlias -> "Opaque type aliases are not allowed in untyped mode" - | UnexpectedTypeAnnotation -> "Type annotations are not allowed in untyped mode" - | UnexpectedTypeDeclaration -> "Type declarations are not allowed in untyped mode" - | UnexpectedTypeImport -> "Type imports are not allowed in untyped mode" - | UnexpectedTypeExport -> "Type exports are not allowed in untyped mode" - | UnexpectedTypeInterface -> "Interfaces are not allowed in untyped mode" - | UnexpectedSpreadType -> "Spreading a type is only allowed inside an object type" - | UnexpectedExplicitInexactInObject -> - "Explicit inexact syntax must come at the end of an object type" - | InexactInsideExact -> - "Explicit inexact syntax cannot appear inside an explicit exact object type" - | InexactInsideNonObject -> "Explicit inexact syntax can only appear inside an object type" - | NewlineAfterThrow -> "Illegal newline after throw" - | InvalidFloatBigInt -> "A bigint literal must be an integer" - | InvalidSciBigInt -> "A bigint literal cannot use exponential notation" - | InvalidRegExp -> "Invalid regular expression" - | InvalidRegExpFlags flags -> "Invalid flags supplied to RegExp constructor '" ^ flags ^ "'" - | UnterminatedRegExp -> "Invalid regular expression: missing /" - | InvalidLHSInAssignment -> "Invalid left-hand side in assignment" - | InvalidLHSInExponentiation -> "Invalid left-hand side in exponentiation expression" - | InvalidLHSInForIn -> "Invalid left-hand side in for-in" - | InvalidLHSInForOf -> "Invalid left-hand side in for-of" - | InvalidIndexedAccess { has_bracket } -> - let msg = - if has_bracket then - "Remove the period." - else - "Indexed access uses bracket notation." - in - Printf.sprintf "Invalid indexed access. %s Use the format `T[K]`." msg - | InvalidOptionalIndexedAccess -> - "Invalid optional indexed access. Indexed access uses bracket notation. Use the format `T?.[K]`." - | ExpectedPatternFoundExpression -> - "Expected an object pattern, array pattern, or an identifier but " - ^ "found an expression instead" - | MultipleDefaultsInSwitch -> "More than one default clause in switch statement" - | NoCatchOrFinally -> "Missing catch or finally after try" - | UnknownLabel label -> "Undefined label '" ^ label ^ "'" - | Redeclaration (what, name) -> what ^ " '" ^ name ^ "' has already been declared" - | IllegalContinue -> "Illegal continue statement" - | IllegalBreak -> "Illegal break statement" - | IllegalReturn -> "Illegal return statement" - | IllegalUnicodeEscape -> "Illegal Unicode escape" - | StrictModeWith -> "Strict mode code may not include a with statement" - | StrictCatchVariable -> "Catch variable may not be eval or arguments in strict mode" - | StrictVarName -> "Variable name may not be eval or arguments in strict mode" - | StrictParamName -> "Parameter name eval or arguments is not allowed in strict mode" - | StrictParamDupe -> "Strict mode function may not have duplicate parameter names" - | StrictParamNotSimple -> - "Illegal \"use strict\" directive in function with non-simple parameter list" - | StrictFunctionName -> "Function name may not be eval or arguments in strict mode" - | StrictOctalLiteral -> "Octal literals are not allowed in strict mode." - | StrictNonOctalLiteral -> "Number literals with leading zeros are not allowed in strict mode." - | StrictDelete -> "Delete of an unqualified identifier in strict mode." - | StrictDuplicateProperty -> - "Duplicate data property in object literal not allowed in strict mode" - | AccessorDataProperty -> - "Object literal may not have data and accessor property with the same name" - | AccessorGetSet -> "Object literal may not have multiple get/set accessors with the same name" - | StrictLHSAssignment -> "Assignment to eval or arguments is not allowed in strict mode" - | StrictLHSPostfix -> - "Postfix increment/decrement may not have eval or arguments operand in strict mode" - | StrictLHSPrefix -> - "Prefix increment/decrement may not have eval or arguments operand in strict mode" - | StrictReservedWord -> "Use of future reserved word in strict mode" - | JSXAttributeValueEmptyExpression -> - "JSX attributes must only be assigned a non-empty expression" - | InvalidJSXAttributeValue -> "JSX value should be either an expression or a quoted JSX text" - | ExpectedJSXClosingTag name -> "Expected corresponding JSX closing tag for " ^ name - | NoUninitializedConst -> "Const must be initialized" - | NoUninitializedDestructuring -> "Destructuring assignment must be initialized" - | NewlineBeforeArrow -> "Illegal newline before arrow" - | FunctionAsStatement { in_strict_mode } -> - if in_strict_mode then - "In strict mode code, functions can only be declared at top level or " - ^ "immediately within another function." - else - "In non-strict mode code, functions can only be declared at top level, " - ^ "inside a block, or as the body of an if statement." - | AsyncFunctionAsStatement -> - "Async functions can only be declared at top level or " - ^ "immediately within another function." - | GeneratorFunctionAsStatement -> - "Generators can only be declared at top level or " ^ "immediately within another function." - | AdjacentJSXElements -> - "Unexpected token <. Remember, adjacent JSX " - ^ "elements must be wrapped in an enclosing parent tag" - | ParameterAfterRestParameter -> "Rest parameter must be final parameter of an argument list" - | ElementAfterRestElement -> "Rest element must be final element of an array pattern" - | PropertyAfterRestElement -> "Rest property must be final property of an object pattern" - | DeclareAsync -> - "async is an implementation detail and isn't necessary for your declare function statement. It is sufficient for your declare function to just have a Promise return type." - | DeclareClassElement -> "`declare` modifier can only appear on class fields." - | DeclareClassFieldInitializer -> - "Unexpected token `=`. Initializers are not allowed in a `declare`." - | DeclareOpaqueTypeInitializer -> - "Unexpected token `=`. Initializers are not allowed in a `declare opaque type`." - | DeclareExportLet -> "`declare export let` is not supported. Use `declare export var` instead." - | DeclareExportConst -> - "`declare export const` is not supported. Use `declare export var` instead." - | DeclareExportType -> "`declare export type` is not supported. Use `export type` instead." - | DeclareExportInterface -> - "`declare export interface` is not supported. Use `export interface` instead." - | DuplicateExport export -> Printf.sprintf "Duplicate export for `%s`" export - | UnsupportedDecorator -> "Found a decorator in an unsupported position." - | MissingTypeParamDefault -> - "Type parameter declaration needs a default, since a preceding type parameter declaration has a default." - | DuplicateDeclareModuleExports -> "Duplicate `declare module.exports` statement!" - | 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." - | GetterArity -> "Getter should have zero parameters" - | SetterArity -> "Setter should have exactly one parameter" - | InvalidNonTypeImportInDeclareModule -> - "Imports within a `declare module` body must always be " ^ "`import type` or `import typeof`!" - | ImportTypeShorthandOnlyInPureImport -> - "The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements" - | ImportSpecifierMissingComma -> "Missing comma between import specifiers" - | ExportSpecifierMissingComma -> "Missing comma between export specifiers" - | MalformedUnicode -> "Malformed unicode" - | DuplicateConstructor -> "Classes may only have one constructor" - | DuplicatePrivateFields name -> - "Private fields may only be declared once. `#" ^ name ^ "` is declared more than once." - | InvalidClassMemberName { name; static; method_; private_ } -> - let static_modifier = - if static then - "static " - else - "" - in - let name = - if private_ then - "#" ^ name - else - name - in - let category = - if method_ then - "methods" - else - "fields" - in - "Classes may not have " ^ static_modifier ^ category ^ " named `" ^ name ^ "`." - | PrivateDelete -> "Private fields may not be deleted." - | UnboundPrivate name -> - "Private fields must be declared before they can be referenced. `#" - ^ name - ^ "` has not been declared." - | PrivateNotInClass -> "Private fields can only be referenced from within a class." - | SuperPrivate -> "You may not access a private field through the `super` keyword." - | YieldInFormalParameters -> "Yield expression not allowed in formal parameter" - | AwaitAsIdentifierReference -> "`await` is an invalid identifier in async functions" - | YieldAsIdentifierReference -> "`yield` is an invalid identifier in generators" - | AmbiguousLetBracket -> - "`let [` is ambiguous in this position because it is " - ^ "either a `let` binding pattern, or a member expression." - | LiteralShorthandProperty -> "Literals cannot be used as shorthand properties." - | ComputedShorthandProperty -> "Computed properties must have a value." - | MethodInDestructuring -> "Object pattern can't contain methods" - | TrailingCommaAfterRestElement -> "A trailing comma is not permitted after the rest element" - | OptionalChainNew -> "An optional chain may not be used in a `new` expression." - | OptionalChainTemplate -> "Template literals may not be used in an optional chain." - | NullishCoalescingUnexpectedLogical operator -> - Printf.sprintf - "Unexpected token `%s`. Parentheses are required to combine `??` with `&&` or `||` expressions." - operator - | WhitespaceInPrivateName -> "Unexpected whitespace between `#` and identifier" - | ThisParamAnnotationRequired -> "A type annotation is required for the `this` parameter." - | ThisParamMustBeFirst -> "The `this` parameter must be the first function parameter." - | ThisParamMayNotBeOptional -> "The `this` parameter cannot be optional." - | GetterMayNotHaveThisParam -> "A getter cannot have a `this` parameter." - | SetterMayNotHaveThisParam -> "A setter cannot have a `this` parameter." - | ThisParamBannedInArrowFunctions -> - "Arrow functions cannot have a `this` parameter; arrow functions automatically bind `this` when declared." - | ThisParamBannedInConstructor -> - "Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions." - | InvalidTypeof -> "`typeof` can only be used to get the type of variables." -end diff --git a/compiler/js_parser/parser_common.ml b/compiler/js_parser/parser_common.ml deleted file mode 100644 index 8da6dae3f3..0000000000 --- a/compiler/js_parser/parser_common.ml +++ /dev/null @@ -1,232 +0,0 @@ -(* - * 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 Parser_env -open Flow_ast - -type pattern_errors = { - if_expr: (Loc.t * Parse_error.t) list; - if_patt: (Loc.t * Parse_error.t) list; -} - -type pattern_cover = - | Cover_expr of (Loc.t, Loc.t) Expression.t - | Cover_patt of (Loc.t, Loc.t) Expression.t * pattern_errors - -module type PARSER = sig - val program : env -> (Loc.t, Loc.t) Program.t - - val statement : 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 - - val statement_list : term_fn:(Token.t -> bool) -> env -> (Loc.t, Loc.t) Statement.t list - - val statement_list_with_directives : - term_fn:(Token.t -> bool) -> env -> (Loc.t, Loc.t) Statement.t list * bool - - val module_body : term_fn:(Token.t -> bool) -> env -> (Loc.t, Loc.t) Statement.t list - - val expression : env -> (Loc.t, Loc.t) Expression.t - - val expression_or_pattern : env -> pattern_cover - - val conditional : env -> (Loc.t, Loc.t) Expression.t - - val assignment : env -> (Loc.t, Loc.t) Expression.t - - val left_hand_side : env -> (Loc.t, Loc.t) Expression.t - - val object_initializer : env -> Loc.t * (Loc.t, Loc.t) Expression.Object.t * pattern_errors - - val identifier : ?restricted_error:Parse_error.t -> env -> (Loc.t, Loc.t) Identifier.t - - val identifier_with_type : - env -> ?no_optional:bool -> Parse_error.t -> Loc.t * (Loc.t, Loc.t) Pattern.Identifier.t - - val block_body : env -> Loc.t * (Loc.t, Loc.t) Statement.Block.t - - val function_block_body : - expression:bool -> env -> (Loc.t * (Loc.t, Loc.t) Statement.Block.t) * bool - - val jsx_element_or_fragment : - env -> - Loc.t * [ `Element of (Loc.t, Loc.t) JSX.element | `Fragment of (Loc.t, Loc.t) JSX.fragment ] - - val pattern : env -> Parse_error.t -> (Loc.t, Loc.t) Pattern.t - - val pattern_from_expr : env -> (Loc.t, Loc.t) Expression.t -> (Loc.t, Loc.t) Pattern.t - - val object_key : ?class_body:bool -> env -> Loc.t * (Loc.t, Loc.t) Expression.Object.Property.key - - 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 is_assignable_lhs : (Loc.t, Loc.t) Expression.t -> bool - - val number : env -> Token.number_type -> string -> float - - val annot : env -> (Loc.t, Loc.t) Type.annotation -end - -let identifier_name_raw env = - let open Token in - let name = - match Peek.token env with - (* obviously, Identifier is a valid IdentifierName *) - | T_IDENTIFIER { value; _ } -> value - (* keywords are also IdentifierNames *) - | T_AWAIT -> "await" - | T_BREAK -> "break" - | T_CASE -> "case" - | T_CATCH -> "catch" - | T_CLASS -> "class" - | T_CONST -> "const" - | T_CONTINUE -> "continue" - | T_DEBUGGER -> "debugger" - | T_DEFAULT -> "default" - | T_DELETE -> "delete" - | T_DO -> "do" - | T_ELSE -> "else" - | T_EXPORT -> "export" - | T_EXTENDS -> "extends" - | T_FINALLY -> "finally" - | T_FOR -> "for" - | T_FUNCTION -> "function" - | T_IF -> "if" - | T_IMPORT -> "import" - | T_IN -> "in" - | T_INSTANCEOF -> "instanceof" - | T_NEW -> "new" - | T_RETURN -> "return" - | T_SUPER -> "super" - | T_SWITCH -> "switch" - | T_THIS -> "this" - | T_THROW -> "throw" - | T_TRY -> "try" - | T_TYPEOF -> "typeof" - | T_VAR -> "var" - | T_VOID -> "void" - | T_WHILE -> "while" - | T_WITH -> "with" - | T_YIELD -> "yield" - (* FutureReservedWord *) - | T_ENUM -> "enum" - | T_LET -> "let" - | T_STATIC -> "static" - | T_INTERFACE -> "interface" - | T_IMPLEMENTS -> "implements" - | T_PACKAGE -> "package" - | T_PRIVATE -> "private" - | T_PROTECTED -> "protected" - | T_PUBLIC -> "public" - (* NullLiteral *) - | T_NULL -> "null" - (* BooleanLiteral *) - | T_TRUE -> "true" - | T_FALSE -> "false" - (* Flow-specific stuff *) - | T_DECLARE -> "declare" - | T_TYPE -> "type" - | T_OPAQUE -> "opaque" - | T_ANY_TYPE -> "any" - | T_MIXED_TYPE -> "mixed" - | T_EMPTY_TYPE -> "empty" - | T_BOOLEAN_TYPE BOOL -> "bool" - | T_BOOLEAN_TYPE BOOLEAN -> "boolean" - | T_NUMBER_TYPE -> "number" - | T_BIGINT_TYPE -> "bigint" - | T_STRING_TYPE -> "string" - | T_VOID_TYPE -> "void" - | T_SYMBOL_TYPE -> "symbol" - (* Contextual stuff *) - | T_OF -> "of" - | T_ASYNC -> "async" - (* punctuators, types, literals, etc are not identifiers *) - | _ -> - error_unexpected ~expected:"an identifier" env; - "" - in - Eat.token env; - name - -(* IdentifierName - https://tc39.github.io/ecma262/#prod-IdentifierName *) -let identifier_name env = - let loc = Peek.loc env in - let leading = Peek.comments env in - let name = identifier_name_raw env in - let trailing = Eat.trailing_comments env in - let comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () in - (loc, { Identifier.name; comments }) - -(** PrivateIdentifier - https://tc39.es/ecma262/#prod-PrivateIdentifier - - N.B.: whitespace, line terminators, and comments are not allowed - between the # and IdentifierName because PrivateIdentifier is a - CommonToken which is considered a single token. See also - https://tc39.es/ecma262/#prod-InputElementDiv *) -let private_identifier env = - let start_loc = Peek.loc env in - let leading = Peek.comments env in - Expect.token env Token.T_POUND; - let name_loc = Peek.loc env in - let name = identifier_name_raw env in - let trailing = Eat.trailing_comments env in - let comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () in - let loc = Loc.btwn start_loc name_loc in - if not (Loc.equal_position start_loc.Loc._end name_loc.Loc.start) then - error_at env (loc, Parse_error.WhitespaceInPrivateName); - (loc, { PrivateName.name; comments }) - -(** The operation IsSimpleParamterList - https://tc39.es/ecma262/#sec-static-semantics-issimpleparameterlist *) -let is_simple_parameter_list = - let is_simple_param = function - | (_, { Flow_ast.Function.Param.argument = (_, Pattern.Identifier _); default = None }) -> true - | _ -> false - in - fun (_, { Flow_ast.Function.Params.params; rest; comments = _; this_ = _ }) -> - rest = None && List.for_all is_simple_param params - -(** - * The abstract operation IsLabelledFunction - * - * https://tc39.github.io/ecma262/#sec-islabelledfunction - *) -let rec is_labelled_function = function - | (_, Flow_ast.Statement.Labeled { Flow_ast.Statement.Labeled.body; _ }) -> - begin - match body with - | (_, Flow_ast.Statement.FunctionDeclaration _) -> true - | _ -> is_labelled_function body - end - | _ -> false - -let with_loc ?start_loc fn env = - let start_loc = - match start_loc with - | Some x -> x - | None -> Peek.loc env - in - let result = fn env in - let loc = - match last_loc env with - | Some end_loc -> Loc.btwn start_loc end_loc - | None -> start_loc - in - (loc, result) - -let with_loc_opt ?start_loc fn env = - match with_loc ?start_loc fn env with - | (loc, Some x) -> Some (loc, x) - | (_, None) -> None - -let with_loc_extra ?start_loc fn env = - let (loc, (x, extra)) = with_loc ?start_loc fn env in - ((loc, x), extra) diff --git a/compiler/js_parser/parser_env.ml b/compiler/js_parser/parser_env.ml deleted file mode 100644 index 939761d318..0000000000 --- a/compiler/js_parser/parser_env.ml +++ /dev/null @@ -1,1184 +0,0 @@ -(* - * 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 Sedlexing = Flow_sedlexing -open Flow_ast -module SSet = Set.Make (String) - -module Lex_mode = struct - type t = - | NORMAL - | TYPE - | JSX_TAG - | JSX_CHILD - | TEMPLATE - | REGEXP - - let debug_string_of_lex_mode (mode : t) = - match mode with - | NORMAL -> "NORMAL" - | TYPE -> "TYPE" - | JSX_TAG -> "JSX_TAG" - | JSX_CHILD -> "JSX_CHILD" - | TEMPLATE -> "TEMPLATE" - | REGEXP -> "REGEXP" -end - -(* READ THIS BEFORE YOU MODIFY: - * - * The current implementation for lookahead beyond a single token is - * inefficient. If you believe you need to increase this constant, do one of the - * following: - * - Find another way - * - Benchmark your change and provide convincing evidence that it doesn't - * actually have a significant perf impact. - * - Refactor this to memoize all requested lookahead, so we aren't lexing the - * same token multiple times. - *) - -module Lookahead : sig - type t - - val create : Lex_env.t -> Lex_mode.t -> t - val peek_0 : t -> Lex_result.t - val peek_1 : t -> Lex_result.t - val lex_env_0 : t -> Lex_env.t - val junk : t -> unit -end = struct - type la_result = (Lex_env.t * Lex_result.t) option - - type t = { - mutable la_results_0: la_result; - mutable la_results_1: la_result; - la_lex_mode: Lex_mode.t; - mutable la_lex_env: Lex_env.t; - } - - let create lex_env mode = - let lex_env = Lex_env.clone lex_env in - { la_results_0 = None; la_results_1 = None; la_lex_mode = mode; la_lex_env = lex_env } - - (* precondition: there is enough room in t.la_results for the result *) - let lex t = - let lex_env = t.la_lex_env in - let (lex_env, lex_result) = - match t.la_lex_mode with - | Lex_mode.NORMAL -> Flow_lexer.token lex_env - | Lex_mode.TYPE -> Flow_lexer.type_token lex_env - | Lex_mode.JSX_TAG -> Flow_lexer.jsx_tag lex_env - | Lex_mode.JSX_CHILD -> Flow_lexer.jsx_child lex_env - | Lex_mode.TEMPLATE -> Flow_lexer.template_tail lex_env - | Lex_mode.REGEXP -> Flow_lexer.regexp lex_env - in - let cloned_env = Lex_env.clone lex_env in - let result = (cloned_env, lex_result) in - t.la_lex_env <- lex_env; - begin - match t.la_results_0 with - | None -> t.la_results_0 <- Some result - | Some _ -> t.la_results_1 <- Some result - end; - result - - let peek_0 t = - match t.la_results_0 with - | Some (_, result) -> result - | None -> snd (lex t) - - let peek_1 t = - (match t.la_results_0 with - | None -> ignore (lex t) - | Some _ -> ()); - match t.la_results_1 with - | None -> snd (lex t) - | Some (_, result) -> result - - let lex_env_0 t = - match t.la_results_0 with - | Some (lex_env, _) -> lex_env - | None -> fst (lex t) - - (* Throws away the first peeked-at token, shifting any subsequent tokens up *) - let junk t = - match t.la_results_1 with - | None -> - ignore (peek_0 t); - t.la_results_0 <- None - | Some _ -> - t.la_results_0 <- t.la_results_1; - t.la_results_1 <- None -end - -type token_sink_result = { - token_loc: Loc.t; - token: Token.t; - token_context: Lex_mode.t; -} - -type parse_options = { - enums: bool; (** enable parsing of Flow enums *) - 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 *) -} - -let default_parse_options = - { enums = false; esproposal_decorators = false; types = true; use_strict = false } - -type allowed_super = - | No_super - | Super_prop - | Super_prop_or_call - -type env = { - errors: (Loc.t * Parse_error.t) list ref; - comments: Loc.t Comment.t list ref; - labels: SSet.t; - last_lex_result: Lex_result.t option ref; - in_strict_mode: bool; - in_export: bool; - in_export_default: bool; - in_loop: bool; - in_switch: bool; - in_formal_parameters: bool; - in_function: bool; - no_in: bool; - no_call: bool; - no_let: bool; - no_anon_function_type: bool; - no_new: bool; - allow_yield: bool; - allow_await: bool; - allow_directive: bool; - has_simple_parameters: bool; - allow_super: allowed_super; - error_callback: (env -> Parse_error.t -> unit) option; - lex_mode_stack: Lex_mode.t list ref; - (* lex_env is the lex_env after the single lookahead has been lexed *) - lex_env: Lex_env.t ref; - (* This needs to be cleared whenever we advance. *) - lookahead: Lookahead.t ref; - token_sink: (token_sink_result -> unit) option ref; - parse_options: parse_options; - source: File_key.t option; - (* It is a syntax error to reference private fields not in scope. In order to enforce this, - * we keep track of the privates we've seen declared and used. *) - privates: (SSet.t * (string * Loc.t) list) list ref; - (* The position up to which comments have been consumed, exclusive. *) - consumed_comments_pos: Loc.position ref; -} - -(* constructor *) -let init_env ?(token_sink = None) ?(parse_options = None) source content = - (* let lb = Sedlexing.Utf16.from_string - content (Some Sedlexing.Utf16.Little_endian) in *) - let (lb, errors) = - try (Sedlexing.Utf8.from_string content, []) with - | Sedlexing.MalFormed -> - (Sedlexing.Utf8.from_string "", [({ Loc.none with Loc.source }, Parse_error.MalformedUnicode)]) - in - let parse_options = - match parse_options with - | Some opts -> opts - | None -> default_parse_options - in - let enable_types_in_comments = parse_options.types in - let lex_env = Lex_env.new_lex_env source lb ~enable_types_in_comments in - { - errors = ref errors; - comments = ref []; - labels = SSet.empty; - last_lex_result = ref None; - has_simple_parameters = true; - in_strict_mode = parse_options.use_strict; - in_export = false; - in_export_default = false; - in_loop = false; - in_switch = false; - in_formal_parameters = false; - in_function = false; - no_in = false; - no_call = false; - no_let = false; - no_anon_function_type = false; - no_new = false; - allow_yield = false; - allow_await = false; - allow_directive = false; - allow_super = No_super; - error_callback = None; - lex_mode_stack = ref [Lex_mode.NORMAL]; - lex_env = ref lex_env; - lookahead = ref (Lookahead.create lex_env Lex_mode.NORMAL); - token_sink = ref token_sink; - parse_options; - source; - privates = ref []; - consumed_comments_pos = ref { Loc.line = 0; column = 0 }; - } - -(* getters: *) -let in_strict_mode env = env.in_strict_mode -let lex_mode env = List.hd !(env.lex_mode_stack) -let in_export env = env.in_export -let in_export_default env = env.in_export_default -let comments env = !(env.comments) -let labels env = env.labels -let in_loop env = env.in_loop -let in_switch env = env.in_switch -let in_formal_parameters env = env.in_formal_parameters -let in_function env = env.in_function -let allow_yield env = env.allow_yield -let allow_await env = env.allow_await -let allow_directive env = env.allow_directive -let allow_super env = env.allow_super -let has_simple_parameters env = env.has_simple_parameters -let no_in env = env.no_in -let no_call env = env.no_call -let no_let env = env.no_let -let no_anon_function_type env = env.no_anon_function_type -let no_new env = env.no_new -let errors env = !(env.errors) -let parse_options env = env.parse_options -let source env = env.source -let should_parse_types env = env.parse_options.types - -(* mutators: *) -let error_at env (loc, e) = - env.errors := (loc, e) :: !(env.errors); - match env.error_callback with - | None -> () - | Some callback -> callback env e - -(* Since private fields out of scope are a parse error, we keep track of the declared and used - * private fields. - * - * Whenever we enter a class, we push new empty lists of declared and used privates. - * When we encounter a new declared private, we add it to the top of the declared_privates list - * via add_declared_private. We do the same with used_privates via add_used_private. - * - * When we exit a class, we look for all the unbound private variables. Since class fields - * are hoisted to the scope of the class, we may need to look further before we conclude that - * a field is out of scope. To do that, we add all of the unbound private fields to the - * next used_private list. Once we run out of declared private lists, any leftover used_privates - * are unbound private variables. *) -let enter_class env = env.privates := (SSet.empty, []) :: !(env.privates) - -let exit_class env = - let get_unbound_privates declared_privates used_privates = - List.filter (fun x -> not (SSet.mem (fst x) declared_privates)) used_privates - in - match !(env.privates) with - | [(declared_privates, used_privates)] -> - let unbound_privates = get_unbound_privates declared_privates used_privates in - List.iter - (fun (name, loc) -> error_at env (loc, Parse_error.UnboundPrivate name)) - unbound_privates; - env.privates := [] - | (loc_declared_privates, loc_used_privates) :: privates -> - let unbound_privates = get_unbound_privates loc_declared_privates loc_used_privates in - let (decl_head, used_head) = List.hd privates in - env.privates := (decl_head, used_head @ unbound_privates) :: List.tl privates - | _ -> failwith "Internal Error: `exit_class` called before a matching `enter_class`" - -let add_declared_private env name = - match !(env.privates) with - | [] -> failwith "Internal Error: Tried to add_declared_private with outside of class scope." - | (declared, used) :: xs -> env.privates := (SSet.add name declared, used) :: xs - -let add_used_private env name loc = - match !(env.privates) with - | [] -> error_at env (loc, Parse_error.PrivateNotInClass) - | (declared, used) :: xs -> env.privates := (declared, (name, loc) :: used) :: xs - -let consume_comments_until env pos = env.consumed_comments_pos := pos - -(* lookahead: *) -let lookahead_0 env = Lookahead.peek_0 !(env.lookahead) -let lookahead_1 env = Lookahead.peek_1 !(env.lookahead) - -let lookahead ~i env = - match i with - | 0 -> lookahead_0 env - | 1 -> lookahead_1 env - | _ -> assert false - -(* functional operations: *) -let with_strict in_strict_mode env = - if in_strict_mode = env.in_strict_mode then - env - else - { env with in_strict_mode } - -let with_in_formal_parameters in_formal_parameters env = - if in_formal_parameters = env.in_formal_parameters then - env - else - { env with in_formal_parameters } - -let with_in_function in_function env = - if in_function = env.in_function then - env - else - { env with in_function } - -let with_allow_yield allow_yield env = - if allow_yield = env.allow_yield then - env - else - { env with allow_yield } - -let with_allow_await allow_await env = - if allow_await = env.allow_await then - env - else - { env with allow_await } - -let with_allow_directive allow_directive env = - if allow_directive = env.allow_directive then - env - else - { env with allow_directive } - -let with_allow_super allow_super env = - if allow_super = env.allow_super then - env - else - { env with allow_super } - -let with_no_let no_let env = - if no_let = env.no_let then - env - else - { env with no_let } - -let with_in_loop in_loop env = - if in_loop = env.in_loop then - env - else - { env with in_loop } - -let with_no_in no_in env = - if no_in = env.no_in then - env - else - { env with no_in } - -let with_no_anon_function_type no_anon_function_type env = - if no_anon_function_type = env.no_anon_function_type then - env - else - { env with no_anon_function_type } - -let with_no_new no_new env = - if no_new = env.no_new then - env - else - { env with no_new } - -let with_in_switch in_switch env = - if in_switch = env.in_switch then - env - else - { env with in_switch } - -let with_in_export in_export env = - if in_export = env.in_export then - env - else - { env with in_export } - -let with_in_export_default in_export_default env = - if in_export_default = env.in_export_default then - env - else - { env with in_export_default } - -let with_no_call no_call env = - if no_call = env.no_call then - env - else - { env with no_call } - -let with_error_callback error_callback env = { env with error_callback = Some error_callback } - -(* other helper functions: *) -let error_list env = List.iter (error_at env) - -let last_loc env = - match !(env.last_lex_result) with - | Some lex_result -> Some (Lex_result.loc lex_result) - | None -> None - -let last_token env = - match !(env.last_lex_result) with - | Some lex_result -> Some (Lex_result.token lex_result) - | None -> None - -let without_error_callback env = { env with error_callback = None } -let add_label env label = { env with labels = SSet.add label env.labels } - -let enter_function env ~async ~generator ~simple_params = - { - env with - in_formal_parameters = false; - has_simple_parameters = simple_params; - in_function = true; - in_loop = false; - in_switch = false; - in_export = false; - in_export_default = false; - labels = SSet.empty; - allow_await = async; - allow_yield = generator; - } - -(* #sec-keywords *) -let is_keyword = function - | "await" - | "break" - | "case" - | "catch" - | "class" - | "const" - | "continue" - | "debugger" - | "default" - | "delete" - | "do" - | "else" - | "export" - | "extends" - | "finally" - | "for" - | "function" - | "if" - | "import" - | "in" - | "instanceof" - | "new" - | "return" - | "super" - | "switch" - | "this" - | "throw" - | "try" - | "typeof" - | "var" - | "void" - | "while" - | "with" - | "yield" -> - true - | _ -> false - -let token_is_keyword = - Token.( - function - | T_IDENTIFIER { raw; _ } when is_keyword raw -> true - | T_AWAIT - | T_BREAK - | T_CASE - | T_CATCH - | T_CLASS - | T_CONST - | T_CONTINUE - | T_DEBUGGER - | T_DEFAULT - | T_DELETE - | T_DO - | T_ELSE - | T_EXPORT - | T_EXTENDS - | T_FINALLY - | T_FOR - | T_FUNCTION - | T_IF - | T_IMPORT - | T_IN - | T_INSTANCEOF - | T_NEW - | T_RETURN - | T_SUPER - | T_SWITCH - | T_THIS - | T_THROW - | T_TRY - | T_TYPEOF - | T_VAR - | T_VOID - | T_WHILE - | T_WITH - | T_YIELD -> - true - | _ -> false - ) - -(* #sec-future-reserved-words *) -let is_future_reserved = function - | "enum" -> true - | _ -> false - -let token_is_future_reserved = - Token.( - function - | T_IDENTIFIER { raw; _ } when is_future_reserved raw -> true - | T_ENUM -> true - | _ -> false - ) - -(* #sec-strict-mode-of-ecmascript *) -let is_strict_reserved = function - | "interface" - | "implements" - | "package" - | "private" - | "protected" - | "public" - | "static" - | "yield" -> - true - | _ -> false - -let token_is_strict_reserved = - Token.( - function - | T_IDENTIFIER { raw; _ } when is_strict_reserved raw -> true - | T_INTERFACE - | T_IMPLEMENTS - | T_PACKAGE - | T_PRIVATE - | T_PROTECTED - | T_PUBLIC - | T_STATIC - | T_YIELD -> - true - | _ -> false - ) - -(* #sec-strict-mode-of-ecmascript *) -let is_restricted = function - | "eval" - | "arguments" -> - true - | _ -> false - -let token_is_restricted = - Token.( - function - | T_IDENTIFIER { raw; _ } when is_restricted raw -> true - | _ -> false - ) - -(* #sec-reserved-words *) -let is_reserved str_val = - is_keyword str_val - || is_future_reserved str_val - || - match str_val with - | "null" - | "true" - | "false" -> - true - | _ -> false - -let token_is_reserved t = - token_is_keyword t - || token_is_future_reserved t - || - match t with - | Token.T_IDENTIFIER { raw = "null" | "true" | "false"; _ } - | Token.T_NULL - | Token.T_TRUE - | Token.T_FALSE -> - true - | _ -> false - -let is_reserved_type str_val = - match str_val with - | "any" - | "bool" - | "boolean" - | "empty" - | "false" - | "mixed" - | "null" - | "number" - | "bigint" - | "static" - | "string" - | "true" - | "typeof" - | "void" - | "interface" - | "extends" - | "_" -> - true - | _ -> false - -(* Answer questions about what comes next *) -module Peek = struct - open Loc - open Token - - let ith_token ~i env = Lex_result.token (lookahead ~i env) - let ith_loc ~i env = Lex_result.loc (lookahead ~i env) - let ith_errors ~i env = Lex_result.errors (lookahead ~i env) - - let ith_comments ~i env = - let comments = Lex_result.comments (lookahead ~i env) in - match comments with - | [] -> [] - | _ -> - List.filter - (fun ({ Loc.start; _ }, _) -> Loc.pos_cmp !(env.consumed_comments_pos) start <= 0) - comments - - let token env = ith_token ~i:0 env - let loc env = ith_loc ~i:0 env - - (* loc_skip_lookahead is used to give a loc hint to optional tokens such as type annotations *) - let loc_skip_lookahead env = - let loc = - match last_loc env with - | Some loc -> loc - | None -> failwith "Peeking current location when not available" - in - Loc.{ loc with start = loc._end } - - let errors env = ith_errors ~i:0 env - let comments env = ith_comments ~i:0 env - - let has_eaten_comments env = - let comments = Lex_result.comments (lookahead ~i:0 env) in - List.exists - (fun ({ Loc.start; _ }, _) -> Loc.pos_cmp start !(env.consumed_comments_pos) < 0) - comments - - let lex_env env = Lookahead.lex_env_0 !(env.lookahead) - - (* True if there is a line terminator before the next token *) - let ith_is_line_terminator ~i env = - let loc = - if i > 0 then - Some (ith_loc ~i:(i - 1) env) - else - last_loc env - in - match loc with - | None -> false - | Some loc' -> (ith_loc ~i env).start.line > loc'.start.line - - let is_line_terminator env = ith_is_line_terminator ~i:0 env - - let ith_is_implicit_semicolon ~i env = - match ith_token ~i env with - | T_EOF - | T_RCURLY -> - true - | T_SEMICOLON -> false - | _ -> ith_is_line_terminator ~i env - - let is_implicit_semicolon env = ith_is_implicit_semicolon ~i:0 env - - let ith_is_identifier ~i env = - match ith_token ~i env with - | t when token_is_strict_reserved t -> true - | t when token_is_future_reserved t -> true - | t when token_is_restricted t -> true - | T_LET - | T_TYPE - | T_OPAQUE - | T_OF - | T_DECLARE - | T_ASYNC - | T_AWAIT - | T_POUND - | T_IDENTIFIER _ -> - true - | _ -> false - - let ith_is_type_identifier ~i env = - match lex_mode env with - | Lex_mode.TYPE -> begin - match ith_token ~i env with - | T_IDENTIFIER _ -> true - | _ -> false - end - | Lex_mode.NORMAL -> begin - (* Sometimes we peek at type identifiers while in normal lex mode. For - example, when deciding whether a `type` token is an identifier or the - start of a type declaration, based on whether the following token - `is_type_identifier`. *) - match ith_token ~i env with - | T_IDENTIFIER { raw; _ } when is_reserved_type raw -> false - (* reserved type identifiers, but these don't appear in NORMAL mode *) - | T_ANY_TYPE - | T_MIXED_TYPE - | T_EMPTY_TYPE - | T_NUMBER_TYPE - | T_BIGINT_TYPE - | T_STRING_TYPE - | T_VOID_TYPE - | T_SYMBOL_TYPE - | T_BOOLEAN_TYPE _ - | T_NUMBER_SINGLETON_TYPE _ - | T_BIGINT_SINGLETON_TYPE _ - (* identifier-ish *) - | T_ASYNC - | T_AWAIT - | T_BREAK - | T_CASE - | T_CATCH - | T_CLASS - | T_CONST - | T_CONTINUE - | T_DEBUGGER - | T_DECLARE - | T_DEFAULT - | T_DELETE - | T_DO - | T_ELSE - | T_ENUM - | T_EXPORT - | T_EXTENDS - | T_FALSE - | T_FINALLY - | T_FOR - | T_FUNCTION - | T_IDENTIFIER _ - | T_IF - | T_IMPLEMENTS - | T_IMPORT - | T_IN - | T_INSTANCEOF - | T_INTERFACE - | T_LET - | T_NEW - | T_NULL - | T_OF - | T_OPAQUE - | T_PACKAGE - | T_PRIVATE - | T_PROTECTED - | T_PUBLIC - | T_RETURN - | T_SUPER - | T_SWITCH - | T_THIS - | T_THROW - | T_TRUE - | T_TRY - | T_TYPE - | T_VAR - | T_WHILE - | T_WITH - | T_YIELD -> - true - (* identifier-ish, but not valid types *) - | T_STATIC - | T_TYPEOF - | T_VOID -> - false - (* syntax *) - | T_LCURLY - | T_RCURLY - | T_LCURLYBAR - | T_RCURLYBAR - | T_LPAREN - | T_RPAREN - | T_LBRACKET - | T_RBRACKET - | T_SEMICOLON - | T_COMMA - | T_PERIOD - | T_ARROW - | T_ELLIPSIS - | T_AT - | T_POUND - | T_CHECKS - | T_RSHIFT3_ASSIGN - | T_RSHIFT_ASSIGN - | T_LSHIFT_ASSIGN - | T_BIT_XOR_ASSIGN - | T_BIT_OR_ASSIGN - | T_BIT_AND_ASSIGN - | T_MOD_ASSIGN - | T_DIV_ASSIGN - | T_MULT_ASSIGN - | T_EXP_ASSIGN - | T_MINUS_ASSIGN - | T_PLUS_ASSIGN - | T_NULLISH_ASSIGN - | T_AND_ASSIGN - | T_OR_ASSIGN - | T_ASSIGN - | T_PLING_PERIOD - | T_PLING_PLING - | T_PLING - | T_COLON - | T_OR - | T_AND - | T_BIT_OR - | T_BIT_XOR - | T_BIT_AND - | T_EQUAL - | T_NOT_EQUAL - | T_STRICT_EQUAL - | T_STRICT_NOT_EQUAL - | T_LESS_THAN_EQUAL - | T_GREATER_THAN_EQUAL - | T_LESS_THAN - | T_GREATER_THAN - | T_LSHIFT - | T_RSHIFT - | T_RSHIFT3 - | T_PLUS - | T_MINUS - | T_DIV - | T_MULT - | T_EXP - | T_MOD - | T_NOT - | T_BIT_NOT - | T_INCR - | T_DECR - | T_EOF -> - false - (* literals *) - | T_NUMBER _ - | T_BIGINT _ - | T_STRING _ - | T_TEMPLATE_PART _ - | T_REGEXP _ - (* misc that shouldn't appear in NORMAL mode *) - | T_JSX_IDENTIFIER _ - | T_JSX_TEXT _ - | T_ERROR _ -> - false - end - | Lex_mode.JSX_TAG - | Lex_mode.JSX_CHILD - | Lex_mode.TEMPLATE - | Lex_mode.REGEXP -> - false - - let ith_is_identifier_name ~i env = ith_is_identifier ~i env || ith_is_type_identifier ~i env - - (* This returns true if the next token is identifier-ish (even if it is an - error) *) - let is_identifier env = ith_is_identifier ~i:0 env - let is_identifier_name env = ith_is_identifier_name ~i:0 env - let is_type_identifier env = ith_is_type_identifier ~i:0 env - - let is_function env = - token env = T_FUNCTION - || token env = T_ASYNC - && ith_token ~i:1 env = T_FUNCTION - && (loc env)._end.line = (ith_loc ~i:1 env).start.line - - let is_class env = - match token env with - | T_CLASS - | T_AT -> - true - | _ -> false -end - -(*****************************************************************************) -(* Errors *) -(*****************************************************************************) - -(* Complains about an error at the location of the lookahead *) -let error env e = - let loc = Peek.loc env in - error_at env (loc, e) - -let get_unexpected_error ?expected token = - if token_is_future_reserved token then - Parse_error.UnexpectedReserved - else if token_is_strict_reserved token then - Parse_error.StrictReservedWord - else - let unexpected = Token.explanation_of_token token in - match expected with - | Some expected_msg -> Parse_error.UnexpectedWithExpected (unexpected, expected_msg) - | None -> Parse_error.Unexpected unexpected - -let error_unexpected ?expected env = - (* So normally we consume the lookahead lex result when Eat.token calls - * Parser_env.advance, which will add any lexing errors to our list of errors. - * However, raising an unexpected error for a lookahead is kind of like - * consuming that token, so we should process any lexing errors before - * complaining about the unexpected token *) - error_list env (Peek.errors env); - error env (get_unexpected_error ?expected (Peek.token env)) - -let error_on_decorators env = - List.iter (fun decorator -> error_at env (fst decorator, Parse_error.UnsupportedDecorator)) - -let error_nameless_declaration env kind = - let expected = - if in_export env then - Printf.sprintf - "an identifier. When exporting a %s as a named export, you must specify a %s name. Did you mean `export default %s ...`?" - kind - kind - kind - else - "an identifier" - in - error_unexpected ~expected env - -let strict_error env e = if in_strict_mode env then error env e -let strict_error_at env (loc, e) = if in_strict_mode env then error_at env (loc, e) - -let function_as_statement_error_at env loc = - error_at env (loc, Parse_error.FunctionAsStatement { in_strict_mode = in_strict_mode env }) - -(* Consume zero or more tokens *) -module Eat = struct - (* Consume a single token *) - let token env = - (* If there's a token_sink, emit the lexed token before moving forward *) - (match !(env.token_sink) with - | None -> () - | Some token_sink -> - token_sink - { - token_loc = Peek.loc env; - token = Peek.token env; - (* - * The lex mode is useful because it gives context to some - * context-sensitive tokens. - * - * Some examples of such tokens include: - * - * `=>` - Part of an arrow function? or part of a type annotation? - * `<` - A less-than? Or an opening to a JSX element? - * ...etc... - *) - token_context = lex_mode env; - }); - - env.lex_env := Peek.lex_env env; - - error_list env (Peek.errors env); - env.comments := List.rev_append (Lex_result.comments (lookahead ~i:0 env)) !(env.comments); - env.last_lex_result := Some (lookahead ~i:0 env); - - Lookahead.junk !(env.lookahead) - - (** [maybe env t] eats the next token and returns [true] if it is [t], else return [false] *) - let maybe env t = - let is_t = Token.equal (Peek.token env) t in - if is_t then token env; - is_t - - let push_lex_mode env mode = - env.lex_mode_stack := mode :: !(env.lex_mode_stack); - env.lookahead := Lookahead.create !(env.lex_env) (lex_mode env) - - let pop_lex_mode env = - let new_stack = - match !(env.lex_mode_stack) with - | _mode :: stack -> stack - | _ -> failwith "Popping lex mode from empty stack" - in - env.lex_mode_stack := new_stack; - env.lookahead := Lookahead.create !(env.lex_env) (lex_mode env) - - let double_pop_lex_mode env = - let new_stack = - match !(env.lex_mode_stack) with - | _ :: _ :: stack -> stack - | _ -> failwith "Popping lex mode from empty stack" - in - env.lex_mode_stack := new_stack; - env.lookahead := Lookahead.create !(env.lex_env) (lex_mode env) - - let trailing_comments env = - let open Loc in - let loc = Peek.loc env in - if Peek.token env = Token.T_COMMA && Peek.ith_is_line_terminator ~i:1 env then ( - let trailing_before_comma = Peek.comments env in - let trailing_after_comma = - List.filter - (fun (comment_loc, _) -> comment_loc.start.line <= loc._end.line) - (Lex_result.comments (lookahead ~i:1 env)) - in - let trailing = trailing_before_comma @ trailing_after_comma in - consume_comments_until env { Loc.line = loc._end.line + 1; column = 0 }; - trailing - ) else - let trailing = Peek.comments env in - consume_comments_until env loc._end; - trailing - - let comments_until_next_line env = - let open Loc in - match !(env.last_lex_result) with - | None -> [] - | Some { Lex_result.lex_loc = last_loc; _ } -> - let comments = Peek.comments env in - let comments = List.filter (fun (loc, _) -> loc.start.line <= last_loc._end.line) comments in - consume_comments_until env { line = last_loc._end.line + 1; column = 0 }; - comments - - let program_comments env = - let open Flow_ast.Comment in - let comments = Peek.comments env in - let flow_directive = "@flow" in - let flow_directive_length = String.length flow_directive in - let contains_flow_directive { text; _ } = - let text_length = String.length text in - let rec contains_flow_directive_after_offset off = - if off + flow_directive_length > text_length then - false - else - String.sub text off flow_directive_length = flow_directive - || contains_flow_directive_after_offset (off + 1) - in - contains_flow_directive_after_offset 0 - in - (* Comments up through the last comment with an @flow directive are considered program comments *) - let rec flow_directive_comments comments = - match comments with - | [] -> [] - | (loc, comment) :: rest -> - if contains_flow_directive comment then ( - (env.consumed_comments_pos := Loc.(loc._end)); - List.rev ((loc, comment) :: rest) - ) else - flow_directive_comments rest - in - let program_comments = flow_directive_comments (List.rev comments) in - let program_comments = - if program_comments <> [] then - program_comments - else - (* If there is no @flow directive, consider the first block comment a program comment if - it starts with "/**" *) - match comments with - | ((loc, { kind = Block; text; _ }) as first_comment) :: _ - when String.length text >= 1 && text.[0] = '*' -> - (env.consumed_comments_pos := Loc.(loc._end)); - [first_comment] - | _ -> [] - in - program_comments -end - -module Expect = struct - let get_error env t = - let expected = Token.explanation_of_token ~use_article:true t in - (Peek.loc env, get_unexpected_error ~expected (Peek.token env)) - - let error env t = - let expected = Token.explanation_of_token ~use_article:true t in - error_unexpected ~expected env - - let token env t = - if not (Token.equal (Peek.token env) t) then error env t; - Eat.token env - - (** [token_maybe env T_FOO] eats a token if it is [T_FOO], and errors without consuming if - not. Returns whether it consumed a token, like [Eat.maybe]. *) - let token_maybe env t = - let ate = Eat.maybe env t in - if not ate then error env t; - ate - - (** [token_opt env T_FOO] eats a token if it is [T_FOO], and errors without consuming if not. - This differs from [token], which always consumes. Only use [token_opt] when it's ok for - the parser to not advance, like if you are guaranteed that something else has eaten a - token. *) - let token_opt env t = ignore (token_maybe env t) - - let identifier env name = - let t = Peek.token env in - begin - match t with - | Token.T_IDENTIFIER { raw; _ } when raw = name -> () - | _ -> - let expected = Printf.sprintf "the identifier `%s`" name in - error_unexpected ~expected env - end; - Eat.token env -end - -(* This module allows you to try parsing and rollback if you need. This is not - * cheap and its usage is strongly discouraged *) -module Try = struct - type 'a parse_result = - | ParsedSuccessfully of 'a - | FailedToParse - - exception Rollback - - type saved_state = { - saved_errors: (Loc.t * Parse_error.t) list; - saved_comments: Loc.t Flow_ast.Comment.t list; - saved_last_lex_result: Lex_result.t option; - saved_lex_mode_stack: Lex_mode.t list; - saved_lex_env: Lex_env.t; - saved_consumed_comments_pos: Loc.position; - token_buffer: ((token_sink_result -> unit) * token_sink_result Queue.t) option; - } - - let save_state env = - let token_buffer = - match !(env.token_sink) with - | None -> None - | Some orig_token_sink -> - let buffer = Queue.create () in - env.token_sink := Some (fun token_data -> Queue.add token_data buffer); - Some (orig_token_sink, buffer) - in - { - saved_errors = !(env.errors); - saved_comments = !(env.comments); - saved_last_lex_result = !(env.last_lex_result); - saved_lex_mode_stack = !(env.lex_mode_stack); - saved_lex_env = !(env.lex_env); - saved_consumed_comments_pos = !(env.consumed_comments_pos); - token_buffer; - } - - let reset_token_sink ~flush env token_buffer_info = - match token_buffer_info with - | None -> () - | Some (orig_token_sink, token_buffer) -> - env.token_sink := Some orig_token_sink; - if flush then Queue.iter orig_token_sink token_buffer - - let rollback_state env saved_state = - reset_token_sink ~flush:false env saved_state.token_buffer; - env.errors := saved_state.saved_errors; - env.comments := saved_state.saved_comments; - env.last_lex_result := saved_state.saved_last_lex_result; - env.lex_mode_stack := saved_state.saved_lex_mode_stack; - env.lex_env := saved_state.saved_lex_env; - env.consumed_comments_pos := saved_state.saved_consumed_comments_pos; - env.lookahead := Lookahead.create !(env.lex_env) (lex_mode env); - - FailedToParse - - let success env saved_state result = - reset_token_sink ~flush:true env saved_state.token_buffer; - ParsedSuccessfully result - - let to_parse env parse = - let saved_state = save_state env in - try success env saved_state (parse env) with - | Rollback -> rollback_state env saved_state - - let or_else env ~fallback parse = - match to_parse env parse with - | ParsedSuccessfully result -> result - | FailedToParse -> fallback -end diff --git a/compiler/js_parser/parser_env.mli b/compiler/js_parser/parser_env.mli deleted file mode 100644 index 7cc424ef86..0000000000 --- a/compiler/js_parser/parser_env.mli +++ /dev/null @@ -1,283 +0,0 @@ -(* - * 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. - *) - -(* This module provides a layer between the lexer and the parser which includes - * some parser state and some lexer state *) - -module SSet : Set.S with type elt = string - -module Lex_mode : sig - type t = - | NORMAL - | TYPE - | JSX_TAG - | JSX_CHILD - | TEMPLATE - | REGEXP - - val debug_string_of_lex_mode : t -> string -end - -type token_sink_result = { - token_loc: Loc.t; - token: Token.t; - token_context: Lex_mode.t; -} - -type parse_options = { - enums: bool; (** enable parsing of Flow enums *) - 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 *) -} - -val default_parse_options : parse_options - -type env - -type allowed_super = - | No_super - | Super_prop - | Super_prop_or_call - -(* constructor: *) -val init_env : - ?token_sink:(token_sink_result -> unit) option -> - ?parse_options:parse_options option -> - File_key.t option -> - string -> - env - -(* getters: *) -val in_strict_mode : env -> bool - -val last_loc : env -> Loc.t option - -val last_token : env -> Token.t option - -val in_export : env -> bool - -val in_export_default : env -> bool - -val labels : env -> SSet.t - -val comments : env -> Loc.t Flow_ast.Comment.t list - -val in_loop : env -> bool - -val in_switch : env -> bool - -val in_formal_parameters : env -> bool - -val in_function : env -> bool - -val allow_yield : env -> bool - -val allow_await : env -> bool - -val allow_directive : env -> bool - -val allow_super : env -> allowed_super - -val has_simple_parameters : env -> bool - -val no_in : env -> bool - -val no_call : env -> bool - -val no_let : env -> bool - -val no_anon_function_type : env -> bool - -val no_new : env -> bool - -val errors : env -> (Loc.t * Parse_error.t) list - -val parse_options : env -> parse_options - -val source : env -> File_key.t option - -val should_parse_types : env -> bool - -val get_unexpected_error : ?expected:string -> Token.t -> Parse_error.t - -(* mutators: *) -val error_at : env -> Loc.t * Parse_error.t -> unit - -val error : env -> Parse_error.t -> unit - -val error_unexpected : ?expected:string -> env -> unit - -val error_on_decorators : env -> (Loc.t * 'a) list -> unit - -val error_nameless_declaration : env -> string -> unit - -val strict_error : env -> Parse_error.t -> unit - -val strict_error_at : env -> Loc.t * Parse_error.t -> unit - -val function_as_statement_error_at : env -> Loc.t -> unit - -val error_list : env -> (Loc.t * Parse_error.t) list -> unit - -val enter_class : env -> unit - -val exit_class : env -> unit - -val add_declared_private : env -> string -> unit - -val add_used_private : env -> string -> Loc.t -> unit - -val consume_comments_until : env -> Loc.position -> unit - -(* functional operations -- these return shallow copies, so future mutations to - * the returned env will also affect the original: *) -val with_strict : bool -> env -> env - -val with_in_formal_parameters : bool -> env -> env - -val with_in_function : bool -> env -> env - -val with_allow_yield : bool -> env -> env - -val with_allow_await : bool -> env -> env - -val with_allow_directive : bool -> env -> env - -val with_allow_super : allowed_super -> env -> env - -val with_no_let : bool -> env -> env - -val with_in_loop : bool -> env -> env - -val with_no_in : bool -> env -> env - -val with_no_anon_function_type : bool -> env -> env - -val with_no_new : bool -> env -> env - -val with_in_switch : bool -> env -> env - -val with_in_export : bool -> env -> env - -val with_in_export_default : bool -> env -> env - -val with_no_call : bool -> env -> env - -val with_error_callback : (env -> Parse_error.t -> unit) -> env -> env - -val without_error_callback : env -> env - -val add_label : env -> string -> env - -val enter_function : env -> async:bool -> generator:bool -> simple_params:bool -> env - -val is_reserved : string -> bool - -val token_is_reserved : Token.t -> bool - -val is_future_reserved : string -> bool - -val is_strict_reserved : string -> bool - -val token_is_strict_reserved : Token.t -> bool - -val is_restricted : string -> bool - -val is_reserved_type : string -> bool - -val token_is_restricted : Token.t -> bool - -module Peek : sig - val token : env -> Token.t - - val loc : env -> Loc.t - - val loc_skip_lookahead : env -> Loc.t - - val errors : env -> (Loc.t * Parse_error.t) list - - val comments : env -> Loc.t Flow_ast.Comment.t list - - val has_eaten_comments : env -> bool - - val is_line_terminator : env -> bool - - val is_implicit_semicolon : env -> bool - - val is_identifier : env -> bool - - val is_type_identifier : env -> bool - - val is_identifier_name : env -> bool - - val is_function : env -> bool - - val is_class : env -> bool - - val ith_token : i:int -> env -> Token.t - - val ith_loc : i:int -> env -> Loc.t - - val ith_errors : i:int -> env -> (Loc.t * Parse_error.t) list - - val ith_comments : i:int -> env -> Loc.t Flow_ast.Comment.t list - - val ith_is_line_terminator : i:int -> env -> bool - - val ith_is_implicit_semicolon : i:int -> env -> bool - - val ith_is_identifier : i:int -> env -> bool - - val ith_is_identifier_name : i:int -> env -> bool - - val ith_is_type_identifier : i:int -> env -> bool -end - -module Eat : sig - val token : env -> unit - - val maybe : env -> Token.t -> bool - - val push_lex_mode : env -> Lex_mode.t -> unit - - val pop_lex_mode : env -> unit - - val double_pop_lex_mode : env -> unit - - val trailing_comments : env -> Loc.t Flow_ast.Comment.t list - - val comments_until_next_line : env -> Loc.t Flow_ast.Comment.t list - - val program_comments : env -> Loc.t Flow_ast.Comment.t list -end - -module Expect : sig - val get_error : env -> Token.t -> Loc.t * Parse_error.t - - val error : env -> Token.t -> unit - - val token : env -> Token.t -> unit - - val token_opt : env -> Token.t -> unit - - val token_maybe : env -> Token.t -> bool - - val identifier : env -> string -> unit -end - -module Try : sig - type 'a parse_result = - | ParsedSuccessfully of 'a - | FailedToParse - - exception Rollback - - val to_parse : env -> (env -> 'a) -> 'a parse_result - - val or_else : env -> fallback:'a -> (env -> 'a) -> 'a -end diff --git a/compiler/js_parser/parser_flow.ml b/compiler/js_parser/parser_flow.ml deleted file mode 100644 index f31f7c7977..0000000000 --- a/compiler/js_parser/parser_flow.ml +++ /dev/null @@ -1,588 +0,0 @@ -(* - * 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 Sedlexing = Flow_sedlexing -module Ast = Flow_ast -open Token -open Parser_env -open Parser_common - -(* Sometimes we add the same error for multiple different reasons. This is hard - to avoid, so instead we just filter the duplicates out. This function takes - a reversed list of errors and returns the list in forward order with dupes - removed. This differs from a set because the original order is preserved. *) -let filter_duplicate_errors = - let module PrintableErrorSet = Set.Make (struct - type t = Loc.t * Parse_error.t - - let compare (a_loc, a_error) (b_loc, b_error) = - let loc = Loc.compare a_loc b_loc in - if loc = 0 then - Parse_error.compare a_error b_error - else - loc - end) in - fun errs -> - let errs = List.rev errs in - let (_, deduped) = - List.fold_left - (fun (set, deduped) err -> - if PrintableErrorSet.mem err set then - (set, deduped) - else - (PrintableErrorSet.add err set, err :: deduped)) - (PrintableErrorSet.empty, []) - errs - in - List.rev deduped - -let check_for_duplicate_exports = - let open Ast in - let record_export env seen (loc, { Identifier.name = export_name; comments = _ }) = - if export_name = "" then - (* empty identifiers signify an error, don't export it *) - seen - else if SSet.mem export_name seen then ( - error_at env (loc, Parse_error.DuplicateExport export_name); - seen - ) else - SSet.add export_name seen - in - let extract_pattern_binding_names = - let rec fold acc = - let open Pattern in - function - | (_, Object { Object.properties; _ }) -> - List.fold_left - (fun acc prop -> - match prop with - | Object.Property (_, { Object.Property.pattern; _ }) - | Object.RestElement (_, { RestElement.argument = pattern; comments = _ }) -> - fold acc pattern) - acc - properties - | (_, Array { Array.elements; _ }) -> - List.fold_left - (fun acc elem -> - match elem with - | Array.Element (_, { Array.Element.argument = pattern; default = _ }) - | Array.RestElement (_, { RestElement.argument = pattern; comments = _ }) -> - fold acc pattern - | Array.Hole _ -> acc) - acc - elements - | (_, Identifier { Pattern.Identifier.name; _ }) -> name :: acc - | (_, Expression _) -> failwith "Parser error: No such thing as an expression pattern!" - in - List.fold_left fold - in - let record_export_of_statement env seen decl = - match decl with - | (_, Statement.ExportDefaultDeclaration { Statement.ExportDefaultDeclaration.default; _ }) -> - record_export env seen (Flow_ast_utils.ident_of_source (default, "default")) - | ( _, - Statement.ExportNamedDeclaration - { Statement.ExportNamedDeclaration.specifiers = Some specifiers; declaration = None; _ } - ) -> - let open Statement.ExportNamedDeclaration in - (match specifiers with - | ExportSpecifiers specifiers -> - List.fold_left - (fun seen (_, { Statement.ExportNamedDeclaration.ExportSpecifier.local; exported }) -> - match exported with - | Some exported -> record_export env seen exported - | None -> record_export env seen local) - seen - specifiers - | ExportBatchSpecifier _ -> - (* doesn't export specific names *) - seen) - | ( _, - Statement.ExportNamedDeclaration - { Statement.ExportNamedDeclaration.specifiers = None; declaration = Some declaration; _ } - ) -> - (match declaration with - | ( loc, - ( Statement.TypeAlias { Statement.TypeAlias.id; _ } - | Statement.OpaqueType { Statement.OpaqueType.id; _ } - | Statement.InterfaceDeclaration { Statement.Interface.id; _ } - | Statement.ClassDeclaration { Class.id = Some id; _ } - | Statement.FunctionDeclaration { Function.id = Some id; _ } - | Statement.EnumDeclaration { Statement.EnumDeclaration.id; _ } ) - ) -> - record_export - env - seen - (Flow_ast_utils.ident_of_source (loc, Flow_ast_utils.name_of_ident id)) - | (_, Statement.VariableDeclaration { Statement.VariableDeclaration.declarations; _ }) -> - declarations - |> List.fold_left - (fun names (_, { Statement.VariableDeclaration.Declarator.id; _ }) -> - extract_pattern_binding_names names [id]) - [] - |> List.fold_left (record_export env) seen - | ( _, - Statement.( - ( Block _ | Break _ - | ClassDeclaration { Class.id = None; _ } - | Continue _ | Debugger _ | DeclareClass _ | DeclareExportDeclaration _ - | DeclareFunction _ | DeclareInterface _ | DeclareModule _ | DeclareModuleExports _ - | DeclareTypeAlias _ | DeclareOpaqueType _ | DeclareVariable _ | DoWhile _ | Empty _ - | ExportDefaultDeclaration _ | ExportNamedDeclaration _ | Expression _ | For _ | ForIn _ - | ForOf _ - | FunctionDeclaration { Function.id = None; _ } - | If _ | ImportDeclaration _ | Labeled _ | Return _ | Switch _ | Throw _ | Try _ - | While _ | With _ )) - ) -> - (* these don't export names -- some are invalid, but the AST allows them *) - seen) - | ( _, - Statement.ExportNamedDeclaration - { Statement.ExportNamedDeclaration.declaration = None; specifiers = None; _ } - ) - | ( _, - Statement.ExportNamedDeclaration - { Statement.ExportNamedDeclaration.declaration = Some _; specifiers = Some _; _ } - ) -> - (* impossible *) - seen - | ( _, - Statement.( - ( Block _ | Break _ | ClassDeclaration _ | Continue _ | Debugger _ | DeclareClass _ - | DeclareExportDeclaration _ | DeclareFunction _ | DeclareInterface _ | DeclareModule _ - | DeclareModuleExports _ | DeclareTypeAlias _ | DeclareOpaqueType _ | DeclareVariable _ - | DoWhile _ | Empty _ | EnumDeclaration _ | Expression _ | For _ | ForIn _ | ForOf _ - | FunctionDeclaration _ | If _ | ImportDeclaration _ | InterfaceDeclaration _ | Labeled _ - | Return _ | Switch _ | Throw _ | Try _ | TypeAlias _ | OpaqueType _ - | VariableDeclaration _ | While _ | With _ )) - ) -> - seen - in - (fun env stmts -> ignore (List.fold_left (record_export_of_statement env) SSet.empty stmts)) - -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 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) - - module Pattern = Pattern_parser.Pattern (Parse) (Type) - module JSX = Jsx_parser.JSX (Parse) - - let annot = Type.annotation - - let identifier ?restricted_error env = - (match Peek.token env with - (* "let" is disallowed as an identifier in a few situations. 11.6.2.1 - lists them out. It is always disallowed in strict mode *) - | T_LET when in_strict_mode env -> error env Parse_error.StrictReservedWord - | T_LET when no_let env -> error_unexpected env - | T_LET -> () - (* `allow_await` means that `await` is allowed to be a keyword, - which makes it illegal to use as an identifier. - https://tc39.github.io/ecma262/#sec-identifiers-static-semantics-early-errors *) - | T_AWAIT when allow_await env -> error env Parse_error.UnexpectedReserved - | T_AWAIT -> () - (* `allow_yield` means that `yield` is allowed to be a keyword, - which makes it illegal to use as an identifier. - https://tc39.github.io/ecma262/#sec-identifiers-static-semantics-early-errors *) - | T_YIELD when allow_yield env -> error env Parse_error.UnexpectedReserved - | T_YIELD when in_strict_mode env -> error env Parse_error.StrictReservedWord - | T_YIELD -> () - | t when token_is_strict_reserved t -> strict_error env Parse_error.StrictReservedWord - | t when token_is_reserved t -> error_unexpected env - | t -> - (match restricted_error with - | Some err when token_is_restricted t -> strict_error env err - | _ -> ())); - identifier_name env - - let rec program env = - let leading = Eat.program_comments env in - let stmts = module_body_with_directives env (fun _ -> false) in - let end_loc = Peek.loc env in - Expect.token env T_EOF; - check_for_duplicate_exports env stmts; - let loc = - match stmts with - | [] -> end_loc - | _ -> Loc.btwn (fst (List.hd stmts)) (fst (List.hd (List.rev stmts))) - in - let all_comments = List.rev (comments env) in - ( loc, - { - Ast.Program.statements = stmts; - comments = Flow_ast_utils.mk_comments_opt ~leading (); - all_comments; - } - ) - - and directives = - let check env token = - match token with - | T_STRING (loc, _, _, octal) -> - if octal then strict_error_at env (loc, Parse_error.StrictOctalLiteral) - | _ -> failwith ("Nooo: " ^ token_to_string token ^ "\n") - in - let rec statement_list env term_fn item_fn (string_tokens, stmts, contains_use_strict) = - match Peek.token env with - | T_EOF -> (env, string_tokens, stmts, contains_use_strict) - | t when term_fn t -> (env, string_tokens, stmts, contains_use_strict) - | T_STRING _ as string_token -> - let possible_directive = item_fn env in - let stmts = possible_directive :: stmts in - (match possible_directive with - | (loc, Ast.Statement.Expression { Ast.Statement.Expression.directive = Some raw; _ }) -> - (* 14.1.1 says that it has to be "use strict" without any - escapes, so "use\x20strict" is disallowed. *) - let strict = raw = "use strict" in - if strict && not (has_simple_parameters env) then - error_at env (loc, Parse_error.StrictParamNotSimple); - let env = - if strict then - with_strict true env - else - env - in - let string_tokens = string_token :: string_tokens in - statement_list env term_fn item_fn (string_tokens, stmts, contains_use_strict || strict) - | _ -> (env, string_tokens, stmts, contains_use_strict)) - | _ -> (env, string_tokens, stmts, contains_use_strict) - in - fun env term_fn item_fn -> - let env = with_allow_directive true env in - let (env, string_tokens, stmts, contains_use_strict) = - statement_list env term_fn item_fn ([], [], false) - in - let env = with_allow_directive false env in - List.iter (check env) (List.rev string_tokens); - (env, stmts, contains_use_strict) - - (* 15.2 *) - and module_item env = - let decorators = Object.decorator_list env in - match Peek.token env with - | T_EXPORT -> Statement.export_declaration ~decorators env - | T_IMPORT -> - error_on_decorators env decorators; - let statement = - match Peek.ith_token ~i:1 env with - | T_LPAREN (* import(...) *) - | T_PERIOD (* import.meta *) -> - Statement.expression env - | _ -> Statement.import_declaration env - in - statement - | T_DECLARE when Peek.ith_token ~i:1 env = T_EXPORT -> - error_on_decorators env decorators; - Statement.declare_export_declaration env - | _ -> statement_list_item env ~decorators - - and module_body_with_directives env term_fn = - let (env, directives, _contains_use_strict) = directives env term_fn module_item in - let stmts = module_body ~term_fn env in - (* Prepend the directives *) - List.fold_left (fun acc stmt -> stmt :: acc) stmts directives - - and module_body = - let rec module_item_list env term_fn acc = - match Peek.token env with - | T_EOF -> List.rev acc - | t when term_fn t -> List.rev acc - | _ -> module_item_list env term_fn (module_item env :: acc) - in - (fun ~term_fn env -> module_item_list env term_fn []) - - and statement_list_with_directives ~term_fn env = - let (env, directives, contains_use_strict) = directives env term_fn statement_list_item in - let stmts = statement_list ~term_fn env in - (* Prepend the directives *) - let stmts = List.fold_left (fun acc stmt -> stmt :: acc) stmts directives in - (stmts, contains_use_strict) - - and statement_list = - let rec statements env term_fn acc = - match Peek.token env with - | T_EOF -> List.rev acc - | t when term_fn t -> List.rev acc - | _ -> statements env term_fn (statement_list_item env :: acc) - in - (fun ~term_fn env -> statements env term_fn []) - - and statement_list_item ?(decorators = []) env = - if not (Peek.is_class env) then error_on_decorators env decorators; - let open Statement in - match Peek.token env with - (* Remember kids, these look like statements but they're not - * statements... (see section 13) *) - | T_LET -> let_ env - | T_CONST -> const env - | _ when Peek.is_function env -> Declaration._function env - | _ when Peek.is_class env -> class_declaration env decorators - | T_INTERFACE -> interface env - | T_DECLARE -> declare env - | T_TYPE -> type_alias env - | T_OPAQUE -> opaque_type env - | T_ENUM when (parse_options env).enums -> Declaration.enum_declaration env - | _ -> statement env - - and statement env = - let open Statement in - match Peek.token env with - | T_EOF -> - error_unexpected ~expected:"the start of a statement" env; - (Peek.loc env, Ast.Statement.Empty { Ast.Statement.Empty.comments = None }) - | T_SEMICOLON -> empty env - | T_LCURLY -> block env - | T_VAR -> var env - | T_BREAK -> break env - | T_CONTINUE -> continue env - | T_DEBUGGER -> debugger env - | T_DO -> do_while env - | T_FOR -> for_ env - | T_IF -> if_ env - | T_RETURN -> return env - | T_SWITCH -> switch env - | T_THROW -> throw env - | T_TRY -> try_ env - | T_WHILE -> while_ env - | T_WITH -> with_ env - (* If we see an else then it's definitely an error, but we can probably - * assume that this is a malformed if statement that is missing the if *) - | T_ELSE -> if_ env - (* There are a bunch of tokens that aren't the start of any valid - * statement. We list them here in order to skip over them, rather than - * getting stuck *) - | T_COLON - | T_RPAREN - | T_RCURLY - | T_RBRACKET - | T_COMMA - | T_PERIOD - | T_PLING_PERIOD - | T_ARROW - | T_IN - | T_INSTANCEOF - | T_CATCH - | T_FINALLY - | T_CASE - | T_DEFAULT - | T_EXTENDS - | T_STATIC - | T_EXPORT - (* TODO *) - | T_ELLIPSIS -> - error_unexpected ~expected:"the start of a statement" env; - Eat.token env; - statement env - (* 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 -> - let func = Declaration._function env in - function_as_statement_error_at env (fst func); - func - | T_LET when Peek.ith_token ~i:1 env = T_LBRACKET -> - (* `let [foo]` is ambiguous: either a let binding pattern, or a - 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 - (* 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 - - and expression env = - let start_loc = Peek.loc env in - let expr = Expression.assignment env in - match Peek.token env with - | T_COMMA -> Expression.sequence env ~start_loc [expr] - | _ -> expr - - and expression_or_pattern env = - let start_loc = Peek.loc env in - let expr_or_pattern = Expression.assignment_cover env in - match Peek.token env with - | T_COMMA -> - let expr = Pattern_cover.as_expression env expr_or_pattern in - let seq = Expression.sequence env ~start_loc [expr] in - Cover_expr seq - | _ -> expr_or_pattern - - and conditional = Expression.conditional - and assignment = Expression.assignment - and left_hand_side = Expression.left_hand_side - and object_initializer = Object._initializer - and object_key = Object.key - and class_declaration = Object.class_declaration - and class_expression = Object.class_expression - and is_assignable_lhs = Expression.is_assignable_lhs - and number = Expression.number - - and identifier_with_type = - let with_loc_helper no_optional restricted_error env = - let name = identifier ~restricted_error env in - let optional = (not no_optional) && Peek.token env = T_PLING in - if optional then ( - if not (should_parse_types env) then error env Parse_error.UnexpectedTypeAnnotation; - Expect.token env T_PLING - ); - let annot = Type.annotation_opt env in - Ast.Pattern.Identifier.{ name; optional; annot } - in - fun env ?(no_optional = false) restricted_error -> - with_loc (with_loc_helper no_optional restricted_error) env - - and block_body env = - let start_loc = Peek.loc env in - let leading = Peek.comments env in - Expect.token env T_LCURLY; - let term_fn t = t = T_RCURLY in - let body = statement_list ~term_fn env in - let end_loc = Peek.loc env in - let internal = - if body = [] then - Peek.comments env - else - [] - in - Expect.token env T_RCURLY; - let trailing = Eat.trailing_comments env in - ( Loc.btwn start_loc end_loc, - { - Ast.Statement.Block.body; - comments = Flow_ast_utils.mk_comments_with_internal_opt ~leading ~trailing ~internal (); - } - ) - - and function_block_body ~expression = - with_loc_extra (fun env -> - let leading = Peek.comments env in - Expect.token env T_LCURLY; - let term_fn t = t = T_RCURLY in - let (body, contains_use_strict) = statement_list_with_directives ~term_fn env in - let internal = - if body = [] then - Peek.comments env - else - [] - in - Expect.token env T_RCURLY; - let trailing = - match (expression, Peek.token env) with - | (true, _) - | (_, (T_RCURLY | T_EOF)) -> - Eat.trailing_comments env - | _ when Peek.is_line_terminator env -> Eat.comments_until_next_line env - | _ -> [] - in - let comments = - Flow_ast_utils.mk_comments_with_internal_opt ~leading ~trailing ~internal () - in - ({ Ast.Statement.Block.body; comments }, contains_use_strict) - ) - - and jsx_element_or_fragment = JSX.element_or_fragment - and pattern = Pattern.pattern - and pattern_from_expr = Pattern.from_expr -end - -(*****************************************************************************) -(* Entry points *) -(*****************************************************************************) -let do_parse env parser fail = - let ast = parser env in - let error_list = filter_duplicate_errors (errors env) in - match error_list with - | e :: es when fail -> raise (Parse_error.Error (e, es)) - | _ -> (ast, error_list) - -(* Makes the input parser expect EOF at the end. Use this to error on trailing - * junk when parsing non-Program nodes. *) -let with_eof parser env = - let ast = parser env in - Expect.token env T_EOF; - ast - -let parse_statement env fail = do_parse env (with_eof Parse.statement_list_item) fail -let parse_expression env fail = do_parse env (with_eof Parse.expression) fail - -let parse_program fail ?(token_sink = None) ?(parse_options = None) filename content = - let env = init_env ~token_sink ~parse_options filename content in - do_parse env Parse.program fail - -let program ?(fail = true) ?(token_sink = None) ?(parse_options = None) content = - parse_program fail ~token_sink ~parse_options None content - -let program_file ?(fail = true) ?(token_sink = None) ?(parse_options = None) content filename = - parse_program fail ~token_sink ~parse_options filename content - -let parse_annot ?(parse_options = None) filename content = - let env = init_env ~token_sink:None ~parse_options filename content in - do_parse env Parse.annot false - -let package_json_file = - let parser env = - let (loc, obj, { if_expr; _ }) = Parse.object_initializer env in - List.iter (error_at env) if_expr; - (loc, obj) - in - fun ?(fail = true) ?(token_sink = None) ?(parse_options = None) content filename -> - let env = init_env ~token_sink ~parse_options filename content in - do_parse env parser fail - -(* even if fail=false, still raises an error on a totally invalid token, since - there's no legitimate fallback. *) -let json_file = - let null_fallback _env = - Ast.Expression.Literal { Ast.Literal.value = Ast.Literal.Null; raw = "null"; comments = None } - in - let parser env = - match Peek.token env with - | T_LBRACKET - | T_LCURLY - | T_STRING _ - | T_NUMBER _ - | T_TRUE - | T_FALSE - | T_NULL -> - Parse.expression env - | T_MINUS -> - (match Peek.ith_token ~i:1 env with - | T_NUMBER _ -> Parse.expression env - | _ -> - error_unexpected ~expected:"a number" env; - with_loc null_fallback env) - | _ -> - error_unexpected ~expected:"a valid JSON value" env; - with_loc null_fallback env - in - fun ?(fail = true) ?(token_sink = None) ?(parse_options = None) content filename -> - let env = init_env ~token_sink ~parse_options filename content in - do_parse env parser fail - -let jsx_pragma_expression = - let left_hand_side env = - let ast = Parse.left_hand_side (with_no_new true env) in - Expect.token env T_EOF; - ast - in - fun content filename -> - let env = init_env ~token_sink:None ~parse_options:None filename content in - do_parse env left_hand_side true - -let string_is_valid_identifier_name str = - let lexbuf = Sedlexing.Utf8.from_string str in - Flow_lexer.is_valid_identifier_name lexbuf diff --git a/compiler/js_parser/pattern_cover.ml b/compiler/js_parser/pattern_cover.ml deleted file mode 100644 index bf307e4b58..0000000000 --- a/compiler/js_parser/pattern_cover.ml +++ /dev/null @@ -1,59 +0,0 @@ -(* - * 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 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 - let as_expression env = function - | Cover_expr expr -> expr - | Cover_patt (expr, { if_expr; if_patt = _ }) -> - List.iter (error_at env) if_expr; - expr - - let as_pattern ?(err = Parse_error.InvalidLHSInAssignment) env cover = - let expr = - match cover with - | Cover_expr expr -> expr - | Cover_patt (expr, { if_expr = _; if_patt }) -> - List.iter (error_at env) if_patt; - expr - in - if not (Parse.is_assignable_lhs expr) then error_at env (fst expr, err); - - (match expr with - | (loc, Flow_ast.Expression.Identifier (_, { Flow_ast.Identifier.name; comments = _ })) - when is_restricted name -> - strict_error_at env (loc, Parse_error.StrictLHSAssignment) - | _ -> ()); - - Parse.pattern_from_expr env expr - - let empty_errors = { if_patt = []; if_expr = [] } - - let cons_error err { if_patt; if_expr } = { if_patt = err :: if_patt; if_expr = err :: if_expr } - - let rev_append_errors a b = - { if_patt = List.rev_append a.if_patt b.if_patt; if_expr = List.rev_append a.if_expr b.if_expr } - - let rev_errors a = { if_patt = List.rev a.if_patt; if_expr = List.rev a.if_expr } -end diff --git a/compiler/js_parser/pattern_parser.ml b/compiler/js_parser/pattern_parser.ml deleted file mode 100644 index 74a4abac24..0000000000 --- a/compiler/js_parser/pattern_parser.ml +++ /dev/null @@ -1,397 +0,0 @@ -(* - * 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 Ast = Flow_ast -open Token -open Parser_common -open Parser_env -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 - (* 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. - *) - let rec object_from_expr = - let rec properties env acc = - let open Ast.Expression.Object in - function - | [] -> List.rev acc - | Property (loc, prop) :: remaining -> - let acc = - match prop with - | Property.Init { key; value; shorthand } -> - let open Ast.Expression in - let key = - match key with - | Property.Literal lit -> Pattern.Object.Property.Literal lit - | Property.Identifier id -> Pattern.Object.Property.Identifier id - | Property.PrivateName _ -> failwith "Internal Error: Found object private prop" - | Property.Computed key -> Pattern.Object.Property.Computed key - in - let (pattern, default) = - match value with - | (_loc, Assignment { Assignment.operator = None; left; right; comments = _ }) -> - (left, Some right) - | _ -> (from_expr env value, None) - in - Pattern.Object.Property - (loc, { Pattern.Object.Property.key; pattern; default; shorthand }) - :: acc - | Property.Method { key = _; value = (loc, _) } -> - error_at env (loc, Parse_error.MethodInDestructuring); - acc - | Property.Get { key = _; value = (loc, _); comments = _ } - | Property.Set { key = _; value = (loc, _); comments = _ } -> - (* these should never happen *) - error_at env (loc, Parse_error.Unexpected "identifier"); - acc - in - properties env acc remaining - | [SpreadProperty (loc, { SpreadProperty.argument; comments })] -> - let acc = - Pattern.Object.RestElement - (loc, { Pattern.RestElement.argument = from_expr env argument; comments }) - :: acc - in - properties env acc [] - | SpreadProperty (loc, _) :: remaining -> - error_at env (loc, Parse_error.PropertyAfterRestElement); - properties env acc remaining - in - fun env (loc, { Ast.Expression.Object.properties = props; comments }) -> - ( loc, - Pattern.( - Object - { Object.properties = properties env [] props; annot = missing_annot env; comments } - ) - ) - - and array_from_expr = - (* Convert an Expression to a Pattern if it is a valid - DestructuringAssignmentTarget, which must be an Object, Array or - IsValidSimpleAssignmentTarget. - #sec-destructuring-assignment-static-semantics-early-errors *) - let assignment_target env ((loc, _) as expr) = - if Parse.is_assignable_lhs expr then - Some (from_expr env expr) - else ( - error_at env (loc, Parse_error.InvalidLHSInAssignment); - None - ) - in - let rec elements env acc = - let open Ast.Expression in - function - | [] -> List.rev acc - | [Array.Spread (loc, { SpreadElement.argument; comments })] -> - (* AssignmentRestElement is a DestructuringAssignmentTarget, see - #prod-AssignmentRestElement *) - let acc = - match assignment_target env argument with - | Some argument -> - Pattern.Array.RestElement (loc, { Pattern.RestElement.argument; comments }) :: acc - | None -> acc - in - elements env acc [] - | Array.Spread (loc, _) :: remaining -> - error_at env (loc, Parse_error.ElementAfterRestElement); - elements env acc remaining - | Array.Expression (loc, Assignment { Assignment.operator = None; left; right; comments = _ }) - :: remaining -> - (* AssignmentElement is a `DestructuringAssignmentTarget Initializer`, see - #prod-AssignmentElement *) - let acc = - Pattern.Array.Element - (loc, { Pattern.Array.Element.argument = left; default = Some right }) - :: acc - in - elements env acc remaining - | Array.Expression expr :: remaining -> - (* AssignmentElement is a DestructuringAssignmentTarget, see - #prod-AssignmentElement *) - let acc = - match assignment_target env expr with - | Some ((loc, _) as expr) -> - let element = - Pattern.Array.Element (loc, { Pattern.Array.Element.argument = expr; default = None }) - in - element :: acc - | None -> acc - in - elements env acc remaining - | Array.Hole loc :: remaining -> elements env (Pattern.Array.Hole loc :: acc) remaining - in - fun env (loc, { Ast.Expression.Array.elements = elems; comments }) -> - ( loc, - Pattern.Array - { Pattern.Array.elements = elements env [] elems; annot = missing_annot env; comments } - ) - - and from_expr env (loc, expr) = - let open Ast.Expression in - match expr with - | Object obj -> object_from_expr env (loc, obj) - | Array arr -> array_from_expr env (loc, arr) - | Identifier ((id_loc, { Identifier.name = string_val; comments = _ }) as name) -> - (* per #sec-destructuring-assignment-static-semantics-early-errors, - it is a syntax error if IsValidSimpleAssignmentTarget of this - IdentifierReference is false. That happens when `string_val` is - "eval" or "arguments" in strict mode. *) - if in_strict_mode env && is_restricted string_val then - error_at env (id_loc, Parse_error.StrictLHSAssignment) - (* per #prod-IdentifierReference, yield is only a valid - IdentifierReference when [~Yield], and await is only valid - when [~Await]. but per #sec-identifiers-static-semantics-early-errors, - they are already invalid in strict mode, which we should have - already errored about when parsing the expression that we're now - converting into a pattern. *) - else if not (in_strict_mode env) then - if allow_yield env && string_val = "yield" then - error_at env (id_loc, Parse_error.YieldAsIdentifierReference) - else if allow_await env && string_val = "await" then - error_at env (id_loc, Parse_error.AwaitAsIdentifierReference); - ( loc, - Pattern.Identifier { Pattern.Identifier.name; annot = missing_annot env; optional = false } - ) - | expr -> (loc, Pattern.Expression (loc, expr)) - - (* Parse object destructuring pattern *) - let rec object_ restricted_error = - let rest_property env = - let leading = Peek.comments env in - let (loc, argument) = - with_loc - (fun env -> - Expect.token env T_ELLIPSIS; - pattern env restricted_error) - env - in - Pattern.Object.RestElement - ( loc, - { Pattern.RestElement.argument; comments = Flow_ast_utils.mk_comments_opt ~leading () } - ) - in - let property_default env = - match Peek.token env with - | T_ASSIGN -> - Expect.token env T_ASSIGN; - Some (Parse.assignment env) - | _ -> None - in - let rec property env = - if Peek.token env = T_ELLIPSIS then - Some (rest_property env) - else - let start_loc = Peek.loc env in - let raw_key = Parse.object_key env in - match Peek.token env with - | T_COLON -> - Expect.token env T_COLON; - let (loc, (pattern, default)) = - with_loc - ~start_loc - (fun env -> - let pattern = pattern env restricted_error in - let default = property_default env in - (pattern, default)) - env - in - let key = - let open Ast.Expression.Object.Property in - match raw_key with - | (_, Literal lit) -> Pattern.Object.Property.Literal lit - | (_, Identifier id) -> Pattern.Object.Property.Identifier id - | (_, PrivateName _) -> failwith "Internal Error: Found object private prop" - | (_, Computed key) -> Pattern.Object.Property.Computed key - in - Some - Pattern.Object.(Property (loc, Property.{ key; pattern; default; shorthand = false })) - | _ -> - (match raw_key with - | ( _, - Ast.Expression.Object.Property.Identifier - ((id_loc, { Identifier.name = string_val; comments = _ }) as name) - ) -> - (* #sec-identifiers-static-semantics-early-errors *) - if is_reserved string_val && string_val <> "yield" && string_val <> "await" then - (* it is a syntax error if `name` is a reserved word other than await or yield *) - error_at env (id_loc, Parse_error.UnexpectedReserved) - else if is_strict_reserved string_val then - (* it is a syntax error if `name` is a strict reserved word, in strict mode *) - strict_error_at env (id_loc, Parse_error.StrictReservedWord); - let (loc, (pattern, default)) = - with_loc - ~start_loc - (fun env -> - let pattern = - ( id_loc, - Pattern.Identifier - { Pattern.Identifier.name; annot = missing_annot env; optional = false } - ) - in - let default = property_default env in - (pattern, default)) - env - in - Some - Pattern.Object.( - Property - ( loc, - { Property.key = Property.Identifier name; pattern; default; shorthand = true } - ) - ) - | _ -> - error_unexpected ~expected:"an identifier" env; - - (* invalid shorthand destructuring *) - None) - (* seen_rest is true when we've seen a rest element. rest_trailing_comma is the location of - * the rest element's trailing command - * Trailing comma: `let { ...rest, } = obj` - * Still invalid, but not a trailing comma: `let { ...rest, x } = obj` *) - and properties env ~seen_rest ~rest_trailing_comma acc = - match Peek.token env with - | T_EOF - | T_RCURLY -> - begin - match rest_trailing_comma with - | Some loc -> error_at env (loc, Parse_error.TrailingCommaAfterRestElement) - | None -> () - end; - List.rev acc - | _ -> - (match property env with - | Some ((Pattern.Object.Property (loc, _) | Pattern.Object.RestElement (loc, _)) as prop) -> - let rest_trailing_comma = - if seen_rest then ( - error_at env (loc, Parse_error.PropertyAfterRestElement); - None - ) else - rest_trailing_comma - in - let (seen_rest, rest_trailing_comma) = - match prop with - | Pattern.Object.RestElement _ -> - ( true, - if Peek.token env = T_COMMA then - Some (Peek.loc env) - else - None - ) - | _ -> (seen_rest, rest_trailing_comma) - in - if Peek.token env <> T_RCURLY then Expect.token env T_COMMA; - properties env ~seen_rest ~rest_trailing_comma (prop :: acc) - | None -> properties env ~seen_rest ~rest_trailing_comma acc) - in - with_loc (fun env -> - let leading = Peek.comments env in - Expect.token env T_LCURLY; - let properties = properties env ~seen_rest:false ~rest_trailing_comma:None [] in - let internal = Peek.comments env in - Expect.token env T_RCURLY; - let trailing = Eat.trailing_comments env in - let annot = - if Peek.token env = T_COLON then - Ast.Type.Available (Type.annotation env) - else - missing_annot env - in - Pattern.Object - { - Pattern.Object.properties; - annot; - comments = Flow_ast_utils.mk_comments_with_internal_opt ~leading ~trailing ~internal (); - } - ) - - (* Parse array destructuring pattern *) - and array_ restricted_error = - let rec elements env acc = - match Peek.token env with - | T_EOF - | T_RBRACKET -> - List.rev acc - | T_COMMA -> - let loc = Peek.loc env in - Expect.token env T_COMMA; - elements env (Pattern.Array.Hole loc :: acc) - | T_ELLIPSIS -> - let leading = Peek.comments env in - let (loc, argument) = - with_loc - (fun env -> - Expect.token env T_ELLIPSIS; - pattern env restricted_error) - env - in - let element = - Pattern.Array.RestElement - ( loc, - { - Pattern.RestElement.argument; - comments = Flow_ast_utils.mk_comments_opt ~leading (); - } - ) - in - (* rest elements are always last, the closing ] should be next. but if not, - error and keep going so we recover gracefully by parsing the rest of the - elements. *) - if Peek.token env <> T_RBRACKET then ( - error_at env (loc, Parse_error.ElementAfterRestElement); - if Peek.token env = T_COMMA then Eat.token env - ); - elements env (element :: acc) - | _ -> - let (loc, (pattern, default)) = - with_loc - (fun env -> - let pattern = pattern env restricted_error in - let default = - match Peek.token env with - | T_ASSIGN -> - Expect.token env T_ASSIGN; - Some (Parse.assignment env) - | _ -> None - in - (pattern, default)) - env - in - let element = Pattern.Array.(Element (loc, { Element.argument = pattern; default })) in - if Peek.token env <> T_RBRACKET then Expect.token env T_COMMA; - elements env (element :: acc) - in - with_loc (fun env -> - let leading = Peek.comments env in - Expect.token env T_LBRACKET; - let elements = elements env [] in - let internal = Peek.comments env in - Expect.token env T_RBRACKET; - let annot = - if Peek.token env = T_COLON then - Ast.Type.Available (Type.annotation env) - else - missing_annot env - in - let trailing = Eat.trailing_comments env in - let comments = - Flow_ast_utils.mk_comments_with_internal_opt ~leading ~trailing ~internal () - in - Pattern.Array { Pattern.Array.elements; annot; comments } - ) - - and pattern env restricted_error = - match Peek.token env with - | T_LCURLY -> object_ restricted_error env - | T_LBRACKET -> array_ restricted_error env - | _ -> - let (loc, id) = Parse.identifier_with_type env restricted_error in - (loc, Pattern.Identifier id) -end diff --git a/compiler/js_parser/primitive_deriving.ml b/compiler/js_parser/primitive_deriving.ml deleted file mode 100644 index db77258f9d..0000000000 --- a/compiler/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/compiler/js_parser/sedlex_LICENSE b/compiler/js_parser/sedlex_LICENSE deleted file mode 100644 index 630eb99d84..0000000000 --- a/compiler/js_parser/sedlex_LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright 2005, 2014 by Alain Frisch and LexiFi. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/compiler/js_parser/statement_parser.ml b/compiler/js_parser/statement_parser.ml deleted file mode 100644 index d9d41beb91..0000000000 --- a/compiler/js_parser/statement_parser.ml +++ /dev/null @@ -1,2189 +0,0 @@ -(* - * 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 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 for_lhs = - | For_expression of pattern_cover - | For_declaration of (Loc.t * (Loc.t, Loc.t) Ast.Statement.VariableDeclaration.t) - - type semicolon_type = - | Explicit of Loc.t Comment.t list - | Implicit of Comment_attachment.trailing_and_remover_result - - (* FunctionDeclaration is not a valid Statement, but Annex B sometimes allows it. - However, AsyncFunctionDeclaration and GeneratorFunctionDeclaration are never - allowed as statements. We still parse them as statements (and raise an error) to - recover gracefully. *) - let function_as_statement env = - let func = Declaration._function env in - ( if in_strict_mode env then - function_as_statement_error_at env (fst func) - else - let open Ast.Statement in - match func with - | (loc, FunctionDeclaration { Ast.Function.async = true; _ }) -> - error_at env (loc, Parse_error.AsyncFunctionAsStatement) - | (loc, FunctionDeclaration { Ast.Function.generator = true; _ }) -> - error_at env (loc, Parse_error.GeneratorFunctionAsStatement) - | _ -> () - ); - func - - (* https://tc39.es/ecma262/#sec-exports-static-semantics-early-errors *) - let assert_identifier_name_is_identifier - ?restricted_error env (loc, { Ast.Identifier.name; comments = _ }) = - match name with - | "let" -> - (* "let" is disallowed as an identifier in a few situations. 11.6.2.1 - lists them out. It is always disallowed in strict mode *) - if in_strict_mode env then - strict_error_at env (loc, Parse_error.StrictReservedWord) - else if no_let env then - error_at env (loc, Parse_error.Unexpected (Token.quote_token_value name)) - | "await" -> - (* `allow_await` means that `await` is allowed to be a keyword, - which makes it illegal to use as an identifier. - https://tc39.github.io/ecma262/#sec-identifiers-static-semantics-early-errors *) - if allow_await env then error_at env (loc, Parse_error.UnexpectedReserved) - | "yield" -> - (* `allow_yield` means that `yield` is allowed to be a keyword, - which makes it illegal to use as an identifier. - https://tc39.github.io/ecma262/#sec-identifiers-static-semantics-early-errors *) - if allow_yield env then - error_at env (loc, Parse_error.UnexpectedReserved) - else - strict_error_at env (loc, Parse_error.StrictReservedWord) - | _ when is_strict_reserved name -> strict_error_at env (loc, Parse_error.StrictReservedWord) - | _ when is_reserved name -> - error_at env (loc, Parse_error.Unexpected (Token.quote_token_value name)) - | _ -> - begin - match restricted_error with - | Some err when is_restricted name -> strict_error_at env (loc, err) - | _ -> () - end - - let string_literal env (loc, value, raw, octal) = - if octal then strict_error env Parse_error.StrictOctalLiteral; - let leading = Peek.comments env in - Expect.token env (T_STRING (loc, value, raw, octal)); - let trailing = Eat.trailing_comments env in - ( loc, - { StringLiteral.value; raw; comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () } - ) - - (* Semicolon insertion is handled here :(. There seem to be 2 cases where - * semicolons are inserted. First, if we reach the EOF. Second, if the next - * token is } or is separated by a LineTerminator. - *) - let semicolon ?(expected = "the token `;`") ?(required = true) env = - match Peek.token env with - | T_EOF - | T_RCURLY -> - Implicit { trailing = Eat.trailing_comments env; remove_trailing = (fun x _ -> x) } - | T_SEMICOLON -> - Eat.token env; - (match Peek.token env with - | T_EOF - | T_RCURLY -> - Explicit (Eat.trailing_comments env) - | _ when Peek.is_line_terminator env -> Explicit (Eat.comments_until_next_line env) - | _ -> Explicit []) - | _ when Peek.is_line_terminator env -> - Implicit (Comment_attachment.trailing_and_remover_after_last_line env) - | _ -> - if required then error_unexpected ~expected env; - Explicit [] - - (* Consumes and returns the trailing comments after the end of a statement. Also returns - a remover that can remove all comments that are not trailing the previous token. - - If a statement is the end of a block or file, all comments are trailing. - Otherwise, if a statement is followed by a new line, only comments on the current - line are trailing. If a statement is not followed by a new line, it does not have - trailing comments as they are instead leading comments for the next statement. *) - let statement_end_trailing_comments env = - match Peek.token env with - | T_EOF - | T_RCURLY -> - { trailing = Eat.trailing_comments env; remove_trailing = (fun x _ -> x) } - | _ when Peek.is_line_terminator env -> - Comment_attachment.trailing_and_remover_after_last_line env - | _ -> Comment_attachment.trailing_and_remover_after_last_loc env - - let variable_declaration_end ~kind env declarations = - match semicolon env with - | Explicit comments -> (comments, declarations) - | Implicit { remove_trailing; _ } -> - (* Remove trailing comments from the last declarator *) - let declarations = - match List.rev declarations with - | [] -> [] - | decl :: decls -> - let decl' = - remove_trailing decl (fun remover decl -> remover#variable_declarator ~kind decl) - in - List.rev (decl' :: decls) - in - ([], declarations) - - let rec empty env = - let loc = Peek.loc env in - let leading = Peek.comments env in - Expect.token env T_SEMICOLON; - let { trailing; _ } = statement_end_trailing_comments env in - ( loc, - Statement.Empty - { Statement.Empty.comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () } - ) - - and break env = - let leading = Peek.comments env in - let (loc, (label, trailing)) = - with_loc - (fun env -> - Expect.token env T_BREAK; - let label = - if Peek.token env = T_SEMICOLON || Peek.is_implicit_semicolon env then - None - else - let ((_, { Identifier.name; comments = _ }) as label) = Parse.identifier env in - if not (SSet.mem name (labels env)) then error env (Parse_error.UnknownLabel name); - Some label - in - let (trailing, label) = - match (semicolon env, label) with - | (Explicit trailing, _) - | (Implicit { trailing; _ }, None) -> - (trailing, label) - | (Implicit { remove_trailing; _ }, Some label) -> - ([], Some (remove_trailing label (fun remover label -> remover#identifier label))) - in - (label, trailing)) - env - in - if label = None && not (in_loop env || in_switch env) then - error_at env (loc, Parse_error.IllegalBreak); - let comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () in - (loc, Statement.Break { Statement.Break.label; comments }) - - and continue env = - let leading = Peek.comments env in - let (loc, (label, trailing)) = - with_loc - (fun env -> - Expect.token env T_CONTINUE; - let label = - if Peek.token env = T_SEMICOLON || Peek.is_implicit_semicolon env then - None - else - let ((_, { Identifier.name; comments = _ }) as label) = Parse.identifier env in - if not (SSet.mem name (labels env)) then error env (Parse_error.UnknownLabel name); - Some label - in - let (trailing, label) = - match (semicolon env, label) with - | (Explicit trailing, _) - | (Implicit { trailing; _ }, None) -> - (trailing, label) - | (Implicit { remove_trailing; _ }, Some label) -> - ([], Some (remove_trailing label (fun remover label -> remover#identifier label))) - in - (label, trailing)) - env - in - if not (in_loop env) then error_at env (loc, Parse_error.IllegalContinue); - ( loc, - Statement.Continue - { - Statement.Continue.label; - comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing (); - } - ) - - and debugger = - with_loc (fun env -> - let leading = Peek.comments env in - Expect.token env T_DEBUGGER; - let pre_semicolon_trailing = - if Peek.token env = T_SEMICOLON then - Eat.trailing_comments env - else - [] - in - let trailing = - match semicolon env with - | Explicit trailing - | Implicit { trailing; _ } -> - pre_semicolon_trailing @ trailing - in - Statement.Debugger - { Statement.Debugger.comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () } - ) - - and do_while = - with_loc (fun env -> - let leading = Peek.comments env in - Expect.token env T_DO; - let body = Parse.statement (env |> with_in_loop true) in - (* Annex B allows labelled FunctionDeclarations (see - sec-labelled-function-declarations), but not in IterationStatement - (see sec-semantics-static-semantics-early-errors). *) - if (not (in_strict_mode env)) && is_labelled_function body then - function_as_statement_error_at env (fst body); - let pre_keyword_trailing = Eat.trailing_comments env in - Expect.token env T_WHILE; - let pre_cond_trailing = Eat.trailing_comments env in - Expect.token env T_LPAREN; - let test = Parse.expression env in - Expect.token env T_RPAREN; - let past_cond_trailing = - if Peek.token env = T_SEMICOLON then - Eat.trailing_comments env - else - [] - in - (* The rules of automatic semicolon insertion in ES5 don't mention this, - * but the semicolon after a do-while loop is optional. This is properly - * specified in ES6 *) - let past_cond_trailing = - match semicolon ~required:false env with - | Explicit trailing -> past_cond_trailing @ trailing - | Implicit { trailing; _ } -> trailing - in - let trailing = pre_keyword_trailing @ pre_cond_trailing @ past_cond_trailing in - Statement.DoWhile - { - Statement.DoWhile.body; - test; - comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing (); - } - ) - - and for_ = - let assert_can_be_forin_or_forof env err = function - | (loc, { Statement.VariableDeclaration.declarations; _ }) -> - (* Only a single declarator is allowed, without an init. So - * something like - * - * for (var x in y) {} - * - * is allowed, but we disallow - * - * for (var x, y in z) {} - * for (var x = 42 in y) {} - *) - (match declarations with - | [(_, { Statement.VariableDeclaration.Declarator.init = None; _ })] -> () - | _ -> error_at env (loc, err)) - in - (* Annex B allows labelled FunctionDeclarations (see - sec-labelled-function-declarations), but not in IterationStatement - (see sec-semantics-static-semantics-early-errors). *) - let assert_not_labelled_function env body = - if (not (in_strict_mode env)) && is_labelled_function body then - function_as_statement_error_at env (fst body) - else - () - in - with_loc (fun env -> - let leading = Peek.comments env in - Expect.token env T_FOR; - let async = allow_await env && Eat.maybe env T_AWAIT in - let leading = leading @ Peek.comments env in - Expect.token env T_LPAREN; - let comments = Flow_ast_utils.mk_comments_opt ~leading () in - let (init, errs) = - let env = env |> with_no_in true in - match Peek.token env with - | T_SEMICOLON -> (None, []) - | T_LET -> - let (loc, (declarations, leading, errs)) = with_loc Declaration.let_ env in - ( Some - (For_declaration - ( loc, - { - Statement.VariableDeclaration.kind = Statement.VariableDeclaration.Let; - declarations; - comments = Flow_ast_utils.mk_comments_opt ~leading (); - } - ) - ), - errs - ) - | T_CONST -> - let (loc, (declarations, leading, errs)) = with_loc Declaration.const env in - ( Some - (For_declaration - ( loc, - { - Statement.VariableDeclaration.kind = Statement.VariableDeclaration.Const; - declarations; - comments = Flow_ast_utils.mk_comments_opt ~leading (); - } - ) - ), - errs - ) - | T_VAR -> - let (loc, (declarations, leading, errs)) = with_loc Declaration.var env in - ( Some - (For_declaration - ( loc, - { - Statement.VariableDeclaration.kind = Statement.VariableDeclaration.Var; - declarations; - comments = Flow_ast_utils.mk_comments_opt ~leading (); - } - ) - ), - errs - ) - | _ -> - let expr = Parse.expression_or_pattern (env |> with_no_let true) in - (Some (For_expression expr), []) - in - match Peek.token env with - | T_OF -> - (* This is a for of loop *) - let left = - match init with - | Some (For_declaration decl) -> - assert_can_be_forin_or_forof env Parse_error.InvalidLHSInForOf decl; - Statement.ForOf.LeftDeclaration decl - | Some (For_expression expr) -> - (* #sec-for-in-and-for-of-statements-static-semantics-early-errors *) - let patt = Pattern_cover.as_pattern ~err:Parse_error.InvalidLHSInForOf env expr in - Statement.ForOf.LeftPattern patt - | None -> assert false - in - Expect.token env T_OF; - let right = Parse.assignment env in - Expect.token env T_RPAREN; - let body = Parse.statement (env |> with_in_loop true) in - assert_not_labelled_function env body; - Statement.ForOf { Statement.ForOf.left; right; body; await = async; comments } - | T_IN -> - (* This is a for in loop *) - let left = - match init with - | Some (For_declaration decl) -> - assert_can_be_forin_or_forof env Parse_error.InvalidLHSInForIn decl; - Statement.ForIn.LeftDeclaration decl - | Some (For_expression expr) -> - (* #sec-for-in-and-for-of-statements-static-semantics-early-errors *) - let patt = Pattern_cover.as_pattern ~err:Parse_error.InvalidLHSInForIn env expr in - Statement.ForIn.LeftPattern patt - | None -> assert false - in - if async then - (* If `async` is true, this should have been a for-await-of loop, but we - recover by trying to parse like a for-in loop. *) - Expect.token env T_OF - else - Expect.token env T_IN; - let right = Parse.expression env in - Expect.token env T_RPAREN; - let body = Parse.statement (env |> with_in_loop true) in - assert_not_labelled_function env body; - Statement.ForIn { Statement.ForIn.left; right; body; each = false; comments } - | _ -> - (* This is a for loop *) - errs |> List.iter (error_at env); - if async then - (* If `async` is true, this should have been a for-await-of loop, but we - recover by trying to parse like a normal loop. *) - Expect.token env T_OF - else - Expect.token env T_SEMICOLON; - let init = - match init with - | Some (For_declaration decl) -> Some (Statement.For.InitDeclaration decl) - | Some (For_expression expr) -> - Some (Statement.For.InitExpression (Pattern_cover.as_expression env expr)) - | None -> None - in - let test = - match Peek.token env with - | T_SEMICOLON -> None - | _ -> Some (Parse.expression env) - in - Expect.token env T_SEMICOLON; - let update = - match Peek.token env with - | T_RPAREN -> None - | _ -> Some (Parse.expression env) - in - Expect.token env T_RPAREN; - let body = Parse.statement (env |> with_in_loop true) in - assert_not_labelled_function env body; - Statement.For { Statement.For.init; test; update; body; comments } - ) - - and if_ = - (* - * Either the consequent or alternate of an if statement - *) - let if_branch env = - (* Normally this would just be a Statement, but Annex B allows - FunctionDeclarations in non-strict mode. See - sec-functiondeclarations-in-ifstatement-statement-clauses *) - let stmt = - if Peek.is_function env then - function_as_statement env - else - Parse.statement env - in - (* Annex B allows labelled FunctionDeclarations in non-strict mode - (see sec-labelled-function-declarations), but not in IfStatement - (see sec-if-statement-static-semantics-early-errors). *) - if (not (in_strict_mode env)) && is_labelled_function stmt then - function_as_statement_error_at env (fst stmt); - - stmt - in - let alternate env = - let leading = Peek.comments env in - Expect.token env T_ELSE; - let body = if_branch env in - { Statement.If.Alternate.body; comments = Flow_ast_utils.mk_comments_opt ~leading () } - in - with_loc (fun env -> - let pre_if_leading = Peek.comments env in - Expect.token env T_IF; - let pre_cond_leading = Peek.comments env in - let leading = pre_if_leading @ pre_cond_leading in - Expect.token env T_LPAREN; - let test = Parse.expression env in - Expect.token env T_RPAREN; - let consequent = if_branch env in - let alternate = - if Peek.token env = T_ELSE then - Some (with_loc alternate env) - else - None - in - Statement.If - { - Statement.If.test; - consequent; - alternate; - comments = Flow_ast_utils.mk_comments_opt ~leading (); - } - ) - - and return = - with_loc (fun env -> - if not (in_function env) then error env Parse_error.IllegalReturn; - let leading = Peek.comments env in - let start_loc = Peek.loc env in - Expect.token env T_RETURN; - let trailing = - if Peek.token env = T_SEMICOLON then - Eat.trailing_comments env - else - [] - in - let argument = - if Peek.token env = T_SEMICOLON || Peek.is_implicit_semicolon env then - None - else - Some (Parse.expression env) - in - let return_out = Loc.btwn start_loc (Peek.loc env) in - let (trailing, argument) = - match (semicolon env, argument) with - | (Explicit comments, _) - | (Implicit { trailing = comments; _ }, None) -> - (trailing @ comments, argument) - | (Implicit { remove_trailing; _ }, Some arg) -> - (trailing, Some (remove_trailing arg (fun remover arg -> remover#expression arg))) - in - Statement.Return - { - Statement.Return.argument; - return_out; - comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing (); - } - ) - - and switch = - let case ~seen_default env = - let leading = Peek.comments env in - let (test, trailing) = - match Peek.token env with - | T_DEFAULT -> - if seen_default then error env Parse_error.MultipleDefaultsInSwitch; - Expect.token env T_DEFAULT; - (None, Eat.trailing_comments env) - | _ -> - Expect.token env T_CASE; - (Some (Parse.expression env), []) - in - let seen_default = seen_default || test = None in - Expect.token env T_COLON; - let { trailing = line_end_trailing; _ } = statement_end_trailing_comments env in - let trailing = trailing @ line_end_trailing in - let term_fn = function - | T_RCURLY - | T_DEFAULT - | T_CASE -> - true - | _ -> false - in - let consequent = Parse.statement_list ~term_fn (env |> with_in_switch true) in - let comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () in - let case = { Statement.Switch.Case.test; consequent; comments } in - (case, seen_default) - in - let rec case_list env (seen_default, acc) = - match Peek.token env with - | T_EOF - | T_RCURLY -> - List.rev acc - | _ -> - let (case_, seen_default) = with_loc_extra (case ~seen_default) env in - let acc = case_ :: acc in - case_list env (seen_default, acc) - in - with_loc (fun env -> - let leading = Peek.comments env in - Expect.token env T_SWITCH; - Expect.token env T_LPAREN; - let discriminant = Parse.expression env in - Expect.token env T_RPAREN; - Expect.token env T_LCURLY; - let cases = case_list env (false, []) in - Expect.token env T_RCURLY; - let { trailing; _ } = statement_end_trailing_comments env in - Statement.Switch - { - Statement.Switch.discriminant; - cases; - comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing (); - exhaustive_out = fst discriminant; - } - ) - - and throw = - with_loc (fun env -> - let leading = Peek.comments env in - let start_loc = Peek.loc env in - Expect.token env T_THROW; - if Peek.is_line_terminator env then error_at env (start_loc, Parse_error.NewlineAfterThrow); - let argument = Parse.expression env in - let (trailing, argument) = - match semicolon env with - | Explicit trailing -> (trailing, argument) - | Implicit { remove_trailing; _ } -> - ([], remove_trailing argument (fun remover arg -> remover#expression arg)) - in - let open Statement in - Throw { Throw.argument; comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () } - ) - - and try_ = - with_loc (fun env -> - let leading = Peek.comments env in - Expect.token env T_TRY; - let block = - let block = Parse.block_body env in - if Peek.token env = T_CATCH then - block_remove_trailing env block - else - block - in - let handler = - match Peek.token env with - | T_CATCH -> - let catch = - with_loc - (fun env -> - let leading = Peek.comments env in - Expect.token env T_CATCH; - let trailing = Eat.trailing_comments env in - let param = - if Peek.token env = T_LPAREN then ( - Expect.token env T_LPAREN; - let p = Some (Parse.pattern env Parse_error.StrictCatchVariable) in - Expect.token env T_RPAREN; - p - ) else - None - in - let body = Parse.block_body env in - (* Fix trailing comment attachment if catch block is end of statement *) - let body = - if Peek.token env <> T_FINALLY then - let { remove_trailing; _ } = statement_end_trailing_comments env in - remove_trailing body (fun remover (loc, body) -> (loc, remover#block loc body)) - else - body - in - { - Ast.Statement.Try.CatchClause.param; - body; - comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing (); - }) - env - in - Some catch - | _ -> None - in - let finalizer = - match Peek.token env with - | T_FINALLY -> - Expect.token env T_FINALLY; - let (loc, body) = Parse.block_body env in - let { remove_trailing; _ } = statement_end_trailing_comments env in - let body = remove_trailing body (fun remover body -> remover#block loc body) in - Some (loc, body) - | _ -> None - in - (* No catch or finally? That's an error! *) - if handler = None && finalizer = None then - error_at env (fst block, Parse_error.NoCatchOrFinally); - - Statement.Try - { - Statement.Try.block; - handler; - finalizer; - comments = Flow_ast_utils.mk_comments_opt ~leading (); - } - ) - - and var = - with_loc (fun env -> - let kind = Statement.VariableDeclaration.Var in - let (declarations, leading, errs) = Declaration.var env in - let (trailing, declarations) = variable_declaration_end ~kind env declarations in - errs |> List.iter (error_at env); - Statement.VariableDeclaration - { - Statement.VariableDeclaration.kind; - declarations; - comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing (); - } - ) - - and const = - with_loc (fun env -> - let kind = Statement.VariableDeclaration.Const in - let (declarations, leading, errs) = Declaration.const env in - let (trailing, declarations) = variable_declaration_end ~kind env declarations in - errs |> List.iter (error_at env); - Statement.VariableDeclaration - { - Statement.VariableDeclaration.kind; - declarations; - comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing (); - } - ) - - and let_ = - with_loc (fun env -> - let kind = Statement.VariableDeclaration.Let in - let (declarations, leading, errs) = Declaration.let_ env in - let (trailing, declarations) = variable_declaration_end ~kind env declarations in - errs |> List.iter (error_at env); - Statement.VariableDeclaration - { - Statement.VariableDeclaration.kind; - declarations; - comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing (); - } - ) - - and while_ = - with_loc (fun env -> - let leading = Peek.comments env in - Expect.token env T_WHILE; - let leading = leading @ Peek.comments env in - Expect.token env T_LPAREN; - let test = Parse.expression env in - Expect.token env T_RPAREN; - let body = Parse.statement (env |> with_in_loop true) in - (* Annex B allows labelled FunctionDeclarations in non-strict mode - (see sec-labelled-function-declarations), but not in IterationStatement - (see sec-semantics-static-semantics-early-errors). *) - if (not (in_strict_mode env)) && is_labelled_function body then - function_as_statement_error_at env (fst body); - Statement.While - { Statement.While.test; body; comments = Flow_ast_utils.mk_comments_opt ~leading () } - ) - - and with_ env = - let (loc, stmt) = - with_loc - (fun env -> - let leading = Peek.comments env in - Expect.token env T_WITH; - let leading = leading @ Peek.comments env in - Expect.token env T_LPAREN; - let _object = Parse.expression env in - Expect.token env T_RPAREN; - let body = Parse.statement env in - (* Annex B allows labelled FunctionDeclarations in non-strict mode - (see sec-labelled-function-declarations), but not in WithStatement - (see sec-with-statement-static-semantics-early-errors). *) - if (not (in_strict_mode env)) && is_labelled_function body then - function_as_statement_error_at env (fst body); - Statement.With - { Statement.With._object; body; comments = Flow_ast_utils.mk_comments_opt ~leading () }) - env - in - strict_error_at env (loc, Parse_error.StrictModeWith); - (loc, stmt) - - and block env = - let (loc, block) = Parse.block_body env in - let { remove_trailing; _ } = statement_end_trailing_comments env in - let block = remove_trailing block (fun remover block -> remover#block loc block) in - (loc, Statement.Block block) - - and maybe_labeled = - with_loc (fun env -> - let leading = Peek.comments env in - match (Parse.expression env, Peek.token env) with - | ((loc, Ast.Expression.Identifier label), T_COLON) -> - let (_, { Identifier.name; comments = _ }) = label in - Expect.token env T_COLON; - if SSet.mem name (labels env) then - error_at env (loc, Parse_error.Redeclaration ("Label", name)); - let env = add_label env name in - let body = - (* labelled FunctionDeclarations are allowed in non-strict mode - (see #sec-labelled-function-declarations) *) - if Peek.is_function env then - function_as_statement env - else - Parse.statement env - in - Statement.Labeled - { Statement.Labeled.label; body; comments = Flow_ast_utils.mk_comments_opt ~leading () } - | (expression, _) -> - let (trailing, expression) = - match semicolon ~expected:"the end of an expression statement (`;`)" env with - | Explicit comments -> (comments, expression) - | Implicit { remove_trailing; _ } -> - ([], remove_trailing expression (fun remover expr -> remover#expression expr)) - in - let open Statement in - Expression - { - Expression.expression; - directive = None; - comments = Flow_ast_utils.mk_comments_opt ~trailing (); - } - ) - - and expression = - with_loc (fun env -> - let expression = Parse.expression env in - let (trailing, expression) = - match semicolon ~expected:"the end of an expression statement (`;`)" env with - | Explicit comments -> (comments, expression) - | Implicit { remove_trailing; _ } -> - ([], remove_trailing expression (fun remover expr -> remover#expression expr)) - in - let directive = - if allow_directive env then - match expression with - | (_, Ast.Expression.Literal { Ast.Literal.value = Ast.Literal.String _; raw; _ }) -> - (* the parser may recover from errors and generate unclosed strings, where - the opening quote should be reliable but the closing one might not exist. - be defensive. *) - if String.length raw > 1 && raw.[0] = raw.[String.length raw - 1] then - Some (String.sub raw 1 (String.length raw - 2)) - else - None - | _ -> None - else - None - in - Statement.Expression - { - Statement.Expression.expression; - directive; - comments = Flow_ast_utils.mk_comments_opt ~trailing (); - } - ) - - and type_alias_helper ~leading env = - if not (should_parse_types env) then error env Parse_error.UnexpectedTypeAlias; - let leading = leading @ Peek.comments env in - Expect.token env T_TYPE; - Eat.push_lex_mode env Lex_mode.TYPE; - let id = - let id = Type.type_identifier env in - if Peek.token env = T_LESS_THAN then - id_remove_trailing env id - else - id - in - let tparams = Type.type_params env in - Expect.token env T_ASSIGN; - let right = Type._type env in - Eat.pop_lex_mode env; - let (trailing, right) = - match semicolon env with - | Explicit comments -> (comments, right) - | Implicit { remove_trailing; _ } -> - ([], remove_trailing right (fun remover right -> remover#type_ right)) - in - - { - Statement.TypeAlias.id; - tparams; - right; - comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing (); - } - - and declare_type_alias env = - with_loc - (fun env -> - let leading = Peek.comments env in - Expect.token env T_DECLARE; - let type_alias = type_alias_helper ~leading env in - Statement.DeclareTypeAlias type_alias) - env - - (** Type aliases squeeze into an unambiguous unused portion of the grammar: `type` is not a - reserved word, so `type T` is otherwise two identifiers in a row and that's never valid JS. - However, if there's a line separator between the two, ASI makes it valid JS, so line - separators are disallowed. *) - and type_alias env = - if Peek.ith_is_identifier ~i:1 env && not (Peek.ith_is_implicit_semicolon ~i:1 env) then - let (loc, type_alias) = with_loc (type_alias_helper ~leading:[]) env in - (loc, Statement.TypeAlias type_alias) - else - Parse.statement env - - and opaque_type_helper ?(declare = false) ~leading env = - if not (should_parse_types env) then error env Parse_error.UnexpectedOpaqueTypeAlias; - let leading_opaque = leading @ Peek.comments env in - Expect.token env T_OPAQUE; - let leading_type = Peek.comments env in - Expect.token env T_TYPE; - let leading = leading_opaque @ leading_type in - Eat.push_lex_mode env Lex_mode.TYPE; - let id = - let id = Type.type_identifier env in - if Peek.token env = T_LESS_THAN then - id_remove_trailing env id - else - id - in - let tparams = Type.type_params env in - let supertype = - match Peek.token env with - | T_COLON -> - Expect.token env T_COLON; - Some (Type._type env) - | _ -> None - in - let impltype = - if declare then - match Peek.token env with - | T_ASSIGN -> - error env Parse_error.DeclareOpaqueTypeInitializer; - Eat.token env; - if Peek.token env = T_SEMICOLON || Peek.is_implicit_semicolon env then - None - else - Some (Type._type env) - | _ -> None - else ( - Expect.token env T_ASSIGN; - Some (Type._type env) - ) - in - Eat.pop_lex_mode env; - let (trailing, id, tparams, supertype, impltype) = - match (semicolon env, tparams, supertype, impltype) with - (* opaque type Foo = Bar; *) - | (Explicit comments, _, _, _) -> (comments, id, tparams, supertype, impltype) - (* opaque type Foo = Bar *) - | (Implicit { remove_trailing; _ }, _, _, Some impl) -> - ( [], - id, - tparams, - supertype, - Some (remove_trailing impl (fun remover impl -> remover#type_ impl)) - ) - (* opaque type Foo: Super *) - | (Implicit { remove_trailing; _ }, _, Some super, None) -> - ( [], - id, - tparams, - Some (remove_trailing super (fun remover super -> remover#type_ super)), - None - ) - (* opaque type Foo *) - | (Implicit { remove_trailing; _ }, Some tparams, None, None) -> - ( [], - id, - Some (remove_trailing tparams (fun remover tparams -> remover#type_params tparams)), - None, - None - ) - (* declare opaque type Foo *) - | (Implicit { remove_trailing; _ }, None, None, None) -> - ([], remove_trailing id (fun remover id -> remover#identifier id), None, None, None) - in - - { - Statement.OpaqueType.id; - tparams; - impltype; - supertype; - comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing (); - } - - and declare_opaque_type env = - with_loc - (fun env -> - let leading = Peek.comments env in - Expect.token env T_DECLARE; - let opaque_t = opaque_type_helper ~declare:true ~leading env in - Statement.DeclareOpaqueType opaque_t) - env - - and opaque_type env = - match Peek.ith_token ~i:1 env with - | T_TYPE -> - let (loc, opaque_t) = with_loc (opaque_type_helper ~declare:false ~leading:[]) env in - (loc, Statement.OpaqueType opaque_t) - | _ -> Parse.statement env - - and interface_helper ~leading env = - if not (should_parse_types env) then error env Parse_error.UnexpectedTypeInterface; - let leading = leading @ Peek.comments env in - Expect.token env T_INTERFACE; - let id = - let id = Type.type_identifier env in - if Peek.token env = T_EXTENDS then - id - else - id_remove_trailing env id - in - let tparams = - let tparams = Type.type_params env in - if Peek.token env = T_EXTENDS then - tparams - else - type_params_remove_trailing env tparams - in - let (extends, body) = Type.interface_helper env in - let { remove_trailing; _ } = statement_end_trailing_comments env in - let body = - remove_trailing body (fun remover (loc, body) -> (loc, remover#object_type loc body)) - in - - { - Statement.Interface.id; - tparams; - body; - extends; - comments = Flow_ast_utils.mk_comments_opt ~leading (); - } - - and declare_interface env = - with_loc - (fun env -> - let leading = Peek.comments env in - Expect.token env T_DECLARE; - let iface = interface_helper ~leading env in - Statement.DeclareInterface iface) - env - - and interface env = - (* disambiguate between a value named `interface`, like `var interface = 1; interface++`, - and an interface declaration like `interface Foo {}`.` *) - if Peek.ith_is_identifier_name ~i:1 env then - let (loc, iface) = with_loc (interface_helper ~leading:[]) env in - (loc, Statement.InterfaceDeclaration iface) - else - expression env - - and declare_class = - let rec mixins env acc = - let super = Type.generic env in - let acc = super :: acc in - match Peek.token env with - | T_COMMA -> - Expect.token env T_COMMA; - mixins env acc - | _ -> List.rev acc - (* This is identical to `interface`, except that mixins are allowed *) - in - fun ~leading env -> - let env = env |> with_strict true in - let leading = leading @ Peek.comments env in - Expect.token env T_CLASS; - let id = - let id = Parse.identifier env in - match Peek.token env with - | T_LESS_THAN - | T_LCURLY -> - id_remove_trailing env id - | _ -> id - in - let tparams = - let tparams = Type.type_params env in - match Peek.token env with - | T_LCURLY -> type_params_remove_trailing env tparams - | _ -> tparams - in - let extends = - if Eat.maybe env T_EXTENDS then - let extends = Type.generic env in - match Peek.token env with - | T_LCURLY -> Some (generic_type_remove_trailing env extends) - | _ -> Some extends - else - None - in - let mixins = - match Peek.token env with - | T_IDENTIFIER { raw = "mixins"; _ } -> - Eat.token env; - let mixins = mixins env [] in - (match Peek.token env with - | T_LCURLY -> generic_type_list_remove_trailing env mixins - | _ -> mixins) - | _ -> [] - in - let implements = - match Peek.token env with - | T_IMPLEMENTS -> - let implements = Object.class_implements env ~attach_leading:false in - (match Peek.token env with - | T_LCURLY -> Some (class_implements_remove_trailing env implements) - | _ -> Some implements) - | _ -> None - in - let body = Type._object ~is_class:true env in - let { remove_trailing; _ } = statement_end_trailing_comments env in - let body = - remove_trailing body (fun remover (loc, body) -> (loc, remover#object_type loc body)) - in - let comments = Flow_ast_utils.mk_comments_opt ~leading () in - Statement.DeclareClass.{ id; tparams; body; extends; mixins; implements; comments } - - and declare_class_statement env = - with_loc - (fun env -> - let leading = Peek.comments env in - Expect.token env T_DECLARE; - let fn = declare_class ~leading env in - Statement.DeclareClass fn) - env - - and declare_function ?(leading = []) env = - let leading = leading @ Peek.comments env in - Expect.token env T_FUNCTION; - let id = id_remove_trailing env (Parse.identifier env) in - let annot = - with_loc - (fun env -> - let tparams = type_params_remove_trailing env (Type.type_params env) in - let params = Type.function_param_list env in - Expect.token env T_COLON; - let return = - let return = Type._type env in - let has_predicate = - Eat.push_lex_mode env Lex_mode.TYPE; - let type_token = Peek.token env in - Eat.pop_lex_mode env; - type_token = T_CHECKS - in - if has_predicate then - type_remove_trailing env return - else - return - in - Ast.Type.(Function { Function.params; return; tparams; comments = None })) - env - in - let predicate = Type.predicate_opt env in - let (trailing, annot, predicate) = - match (semicolon env, predicate) with - | (Explicit comments, _) -> (comments, annot, predicate) - | (Implicit { remove_trailing; _ }, None) -> - ([], remove_trailing annot (fun remover annot -> remover#type_ annot), None) - | (Implicit { remove_trailing; _ }, Some pred) -> - ([], annot, Some (remove_trailing pred (fun remover pred -> remover#predicate pred))) - in - let annot = (fst annot, annot) in - - { - Statement.DeclareFunction.id; - annot; - predicate; - comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing (); - } - - and declare_function_statement env = - with_loc - (fun env -> - let leading = Peek.comments env in - Expect.token env T_DECLARE; - begin - 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 - Statement.DeclareFunction fn) - env - - and declare_var env leading = - let leading = leading @ Peek.comments env in - Expect.token env T_VAR; - let name = Parse.identifier ~restricted_error:Parse_error.StrictVarName env in - let annot = Type.annotation env in - let (trailing, name, annot) = - match semicolon env with - (* declare var x; *) - | Explicit trailing -> (trailing, name, annot) - (* declare var x *) - | Implicit { remove_trailing; _ } -> - ([], name, remove_trailing annot (fun remover annot -> remover#type_annotation annot)) - in - - { - Statement.DeclareVariable.id = name; - annot; - comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing (); - } - - and declare_var_statement env = - with_loc - (fun env -> - let leading = Peek.comments env in - Expect.token env T_DECLARE; - let var = declare_var env leading in - 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 - in - module_items env ~module_kind (stmt :: acc) - in - let declare_module_ ~leading env = - let id = - match Peek.token env with - | T_STRING str -> - Statement.DeclareModule.Literal - (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 comments = Flow_ast_utils.mk_comments_opt ~leading () in - Statement.(DeclareModule DeclareModule.{ id; body; kind; comments }) - in - fun ~in_module 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 - with_loc ~start_loc (declare_module_exports ~leading) env - else - with_loc ~start_loc (declare_module_ ~leading) env - - and declare_module_exports ~leading env = - let leading_period = Peek.comments env in - Expect.token env T_PERIOD; - let leading_exports = Peek.comments env in - Expect.identifier env "exports"; - let leading_annot = Peek.comments env in - let leading = List.concat [leading; leading_period; leading_exports; leading_annot] in - let annot = Type.annotation env in - let (annot, trailing) = - match semicolon env with - | Explicit trailing -> (annot, trailing) - | Implicit { remove_trailing; _ } -> - (remove_trailing annot (fun remover annot -> remover#type_annotation annot), []) - in - let comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () in - Statement.DeclareModuleExports { Statement.DeclareModuleExports.annot; comments } - - and declare ?(in_module = false) env = - if not (should_parse_types env) then error env Parse_error.UnexpectedTypeDeclaration; - - (* eventually, just emit a wrapper AST node *) - match Peek.ith_token ~i:1 env with - | T_CLASS -> declare_class_statement env - | T_INTERFACE -> declare_interface env - | T_TYPE -> - (match Peek.token env with - | T_IMPORT when in_module -> 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_VAR -> declare_var_statement env - | T_EXPORT when in_module -> declare_export_declaration ~allow_export_type:in_module env - | T_IDENTIFIER { raw = "module"; _ } -> declare_module ~in_module env - | _ when in_module -> - (match Peek.token env with - | T_IMPORT -> - error env Parse_error.InvalidNonTypeImportInDeclareModule; - Parse.statement env - | _ -> - (* Oh boy, found some bad stuff in a declare module. Let's just - * pretend it's a declare var (arbitrary choice) *) - declare_var_statement env) - | _ -> Parse.statement env - - and export_source env = - Expect.identifier env "from"; - match Peek.token env with - | T_STRING str -> string_literal env str - | _ -> - (* Just make up a string for the error case *) - let ret = (Peek.loc env, { StringLiteral.value = ""; raw = ""; comments = None }) in - error_unexpected ~expected:"a string" env; - ret - - and export_source_and_semicolon env = - let (source_loc, source) = export_source env in - match semicolon env with - | Explicit trailing -> ((source_loc, source), trailing) - | Implicit { remove_trailing; _ } -> - ( ( source_loc, - remove_trailing source (fun remover source -> - remover#string_literal_type source_loc source - ) - ), - [] - ) - - and export_specifiers ?(preceding_comma = true) env specifiers = - match Peek.token env with - | T_EOF - | T_RCURLY -> - List.rev specifiers - | _ -> - if not preceding_comma then error env Parse_error.ExportSpecifierMissingComma; - let specifier = - with_loc - (fun env -> - let local = identifier_name env in - let exported = - match Peek.token env with - | T_IDENTIFIER { raw = "as"; _ } -> - Eat.token env; - Some (identifier_name env) - | _ -> None - in - { Statement.ExportNamedDeclaration.ExportSpecifier.local; exported }) - env - in - let preceding_comma = Eat.maybe env T_COMMA in - export_specifiers ~preceding_comma env (specifier :: specifiers) - - and assert_export_specifier_identifiers env specifiers = - Statement.ExportNamedDeclaration.ExportSpecifier.( - List.iter - (function - | (_, { local = id; exported = None }) -> - assert_identifier_name_is_identifier ~restricted_error:Parse_error.StrictVarName env id - | _ -> ()) - specifiers - ) - - and export_declaration ~decorators env = - let env = env |> with_strict true |> with_in_export true in - let leading = Peek.comments env in - let start_loc = Peek.loc env in - Expect.token env T_EXPORT; - match Peek.token env with - | T_DEFAULT -> - (* export default ... *) - with_loc - ~start_loc - (fun env -> - let open Statement.ExportDefaultDeclaration in - let leading = leading @ Peek.comments env in - 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 - (* export default [async] function [foo] (...) { ... } *) - let fn = Declaration._function env in - (Declaration fn, []) - else if Peek.is_class env then - (* export default class foo { ... } *) - let _class = Object.class_declaration env decorators in - (Declaration _class, []) - else if Peek.token env = T_ENUM then - (* export default enum foo { ... } *) - (Declaration (Declaration.enum_declaration env), []) - else - (* export default [assignment expression]; *) - let expr = Parse.assignment env in - let (expr, trailing) = - match semicolon env with - | Explicit trailing -> (expr, trailing) - | Implicit { remove_trailing; _ } -> - (remove_trailing expr (fun remover expr -> remover#expression expr), []) - in - (Expression expr, trailing) - in - Statement.ExportDefaultDeclaration - { - default; - declaration; - comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing (); - }) - env - | T_TYPE when Peek.ith_token ~i:1 env <> T_LCURLY -> - (* export type ... *) - with_loc - ~start_loc - (fun env -> - let open Statement.ExportNamedDeclaration in - if not (should_parse_types env) then error env Parse_error.UnexpectedTypeExport; - match Peek.ith_token ~i:1 env with - | T_MULT -> - Expect.token env T_TYPE; - let specifier_loc = Peek.loc env in - Expect.token env T_MULT; - let (source, trailing) = export_source_and_semicolon env in - Statement.ExportNamedDeclaration - { - declaration = None; - specifiers = Some (ExportBatchSpecifier (specifier_loc, None)); - source = Some source; - export_kind = Statement.ExportType; - comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing (); - } - | T_ENUM -> - error env Parse_error.EnumInvalidExport; - Expect.token env T_TYPE; - Statement.ExportNamedDeclaration - { - declaration = None; - specifiers = None; - source = None; - export_kind = Statement.ExportType; - comments = Flow_ast_utils.mk_comments_opt ~leading (); - } - | _ -> - let (loc, type_alias) = with_loc (type_alias_helper ~leading:[]) env in - let type_alias = (loc, Statement.TypeAlias type_alias) in - Statement.ExportNamedDeclaration - { - declaration = Some type_alias; - specifiers = None; - source = None; - export_kind = Statement.ExportType; - comments = Flow_ast_utils.mk_comments_opt ~leading (); - }) - env - | T_OPAQUE -> - (* export opaque type ... *) - with_loc - ~start_loc - (fun env -> - let open Statement.ExportNamedDeclaration in - let (loc, opaque_t) = with_loc (opaque_type_helper ~leading:[]) env in - let opaque_t = (loc, Statement.OpaqueType opaque_t) in - Statement.ExportNamedDeclaration - { - declaration = Some opaque_t; - specifiers = None; - source = None; - export_kind = Statement.ExportType; - comments = Flow_ast_utils.mk_comments_opt ~leading (); - }) - env - | T_INTERFACE -> - (* export interface I { ... } *) - with_loc - ~start_loc - (fun env -> - let open Statement.ExportNamedDeclaration in - if not (should_parse_types env) then error env Parse_error.UnexpectedTypeExport; - let interface = - let (loc, iface) = with_loc (interface_helper ~leading:[]) env in - (loc, Statement.InterfaceDeclaration iface) - in - Statement.ExportNamedDeclaration - { - declaration = Some interface; - specifiers = None; - source = None; - export_kind = Statement.ExportType; - comments = Flow_ast_utils.mk_comments_opt ~leading (); - }) - env - | _ when Peek.is_class env -> - with_loc - ~start_loc - (fun env -> - let stmt = Object.class_declaration env decorators in - Statement.ExportNamedDeclaration - { - Statement.ExportNamedDeclaration.declaration = Some stmt; - specifiers = None; - source = None; - export_kind = Statement.ExportValue; - comments = Flow_ast_utils.mk_comments_opt ~leading (); - }) - env - | _ when Peek.is_function env -> - with_loc - ~start_loc - (fun env -> - error_on_decorators env decorators; - let stmt = Declaration._function env in - Statement.ExportNamedDeclaration - { - Statement.ExportNamedDeclaration.declaration = Some stmt; - specifiers = None; - source = None; - export_kind = Statement.ExportValue; - comments = Flow_ast_utils.mk_comments_opt ~leading (); - }) - env - | T_LET - | T_CONST - | T_VAR -> - with_loc - ~start_loc - (fun env -> - let stmt = Parse.statement_list_item env ~decorators in - Statement.ExportNamedDeclaration - { - Statement.ExportNamedDeclaration.declaration = Some stmt; - specifiers = None; - source = None; - export_kind = Statement.ExportValue; - comments = Flow_ast_utils.mk_comments_opt ~leading (); - }) - env - | T_ENUM when (parse_options env).enums -> - with_loc - ~start_loc - (fun env -> - let stmt = Parse.statement_list_item env ~decorators in - Statement.ExportNamedDeclaration - { - Statement.ExportNamedDeclaration.declaration = Some stmt; - specifiers = None; - source = None; - export_kind = Statement.ExportValue; - comments = Flow_ast_utils.mk_comments_opt ~leading (); - }) - env - | T_MULT -> - with_loc - ~start_loc - (fun env -> - let open Statement.ExportNamedDeclaration in - let loc = Peek.loc env in - Expect.token env T_MULT; - let local_name = - match Peek.token env with - | T_IDENTIFIER { raw = "as"; _ } -> - Eat.token env; - Some (Parse.identifier env) - | _ -> None - in - let specifiers = Some (ExportBatchSpecifier (loc, local_name)) in - let (source, trailing) = export_source_and_semicolon env in - Statement.ExportNamedDeclaration - { - declaration = None; - specifiers; - source = Some source; - export_kind = Statement.ExportValue; - comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing (); - }) - env - | _ -> - let open Statement.ExportNamedDeclaration in - let export_kind = - if Eat.maybe env T_TYPE then - Statement.ExportType - else - Statement.ExportValue - in - if Eat.maybe env T_LCURLY then - with_loc - ~start_loc - (fun env -> - let specifiers = export_specifiers env [] in - Expect.token env T_RCURLY; - let (source, trailing) = - match Peek.token env with - | T_IDENTIFIER { raw = "from"; _ } -> - let (source, trailing) = export_source_and_semicolon env in - (Some source, trailing) - | _ -> - assert_export_specifier_identifiers env specifiers; - let trailing = - match semicolon env with - | Explicit trailing -> trailing - | Implicit { trailing; _ } -> trailing - in - (None, trailing) - in - Statement.ExportNamedDeclaration - { - declaration = None; - specifiers = Some (ExportSpecifiers specifiers); - source; - export_kind; - comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing (); - }) - env - else ( - (* error. recover by ignoring the `export` *) - error_unexpected ~expected:"a declaration, statement or export specifiers" env; - Parse.statement_list_item env ~decorators - ) - - and declare_export_declaration ?(allow_export_type = false) = - 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; - let env = env |> with_strict true |> with_in_export true in - let leading = leading @ Peek.comments env in - Expect.token env T_EXPORT; - Statement.DeclareExportDeclaration.( - match Peek.token env with - | T_DEFAULT -> - (* declare export default ... *) - let leading = leading @ Peek.comments env in - 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) = - match Peek.token env with - | T_FUNCTION -> - (* declare export default function foo (...): ... *) - let fn = with_loc declare_function env in - (Some (Function fn), []) - | T_CLASS -> - (* declare export default class foo { ... } *) - let class_ = with_loc (declare_class ~leading:[]) env in - (Some (Class class_), []) - | _ -> - (* declare export default [type]; *) - let type_ = Type._type env in - let (type_, trailing) = - match semicolon env with - | Explicit trailing -> (type_, trailing) - | Implicit { remove_trailing; _ } -> - (remove_trailing type_ (fun remover type_ -> remover#type_ type_), []) - in - (Some (DefaultType type_), trailing) - in - let comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () in - Statement.DeclareExportDeclaration - { default = Some default; declaration; specifiers = None; source = None; comments } - | T_LET - | T_CONST - | T_VAR - | T_CLASS - | T_FUNCTION -> - let declaration = - match Peek.token env with - | T_FUNCTION -> - (* declare export function foo (...): ... *) - let fn = with_loc declare_function env in - Some (Function fn) - | T_CLASS -> - (* declare export class foo { ... } *) - let class_ = with_loc (declare_class ~leading:[]) env in - Some (Class class_) - | (T_LET | T_CONST | T_VAR) as token -> - (match token with - | T_LET -> error env Parse_error.DeclareExportLet - | T_CONST -> error env Parse_error.DeclareExportConst - | _ -> ()); - - (* declare export var foo: ... *) - let var = with_loc (fun env -> declare_var env []) env in - Some (Variable var) - | _ -> assert false - in - let comments = Flow_ast_utils.mk_comments_opt ~leading () in - Statement.DeclareExportDeclaration - { default = None; declaration; specifiers = None; source = None; comments } - | T_MULT -> - (* declare export * from 'foo' *) - let loc = Peek.loc env in - Expect.token env T_MULT; - let local_name = - match Peek.token env with - | T_IDENTIFIER { raw = "as"; _ } -> - Eat.token env; - Some (Parse.identifier env) - | _ -> None - in - let specifiers = - Statement.ExportNamedDeclaration.(Some (ExportBatchSpecifier (loc, local_name))) - in - let (source, trailing) = export_source_and_semicolon env in - 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 -> - (* declare export type = ... *) - let alias = with_loc (type_alias_helper ~leading:[]) env in - let comments = Flow_ast_utils.mk_comments_opt ~leading () in - Statement.DeclareExportDeclaration - { - default = None; - declaration = Some (NamedType alias); - specifiers = None; - source = None; - comments; - } - | T_OPAQUE -> - (* declare export opaque type = ... *) - let opaque = with_loc (opaque_type_helper ~declare:true ~leading:[]) env in - let comments = Flow_ast_utils.mk_comments_opt ~leading () in - Statement.DeclareExportDeclaration - { - default = None; - declaration = Some (NamedOpaqueType opaque); - specifiers = None; - source = None; - comments; - } - | T_INTERFACE when allow_export_type -> - (* declare export interface ... *) - let iface = with_loc (interface_helper ~leading:[]) env in - let comments = Flow_ast_utils.mk_comments_opt ~leading () in - Statement.DeclareExportDeclaration - { - default = None; - declaration = Some (Interface iface); - specifiers = None; - source = None; - 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; - let (source, trailing) = - match Peek.token env with - | T_IDENTIFIER { raw = "from"; _ } -> - let (source, trailing) = export_source_and_semicolon env in - (Some source, trailing) - | _ -> - assert_export_specifier_identifiers env specifiers; - let trailing = - match semicolon env with - | Explicit trailing -> trailing - | Implicit { trailing; _ } -> trailing - in - (None, trailing) - in - let comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () in - Statement.DeclareExportDeclaration - { - default = None; - declaration = None; - specifiers = Some (Statement.ExportNamedDeclaration.ExportSpecifiers specifiers); - source; - comments; - } - ) - ) - - and import_declaration = - Statement.ImportDeclaration.( - let missing_source env = - (* Just make up a string for the error case *) - let loc = Peek.loc_skip_lookahead env in - (loc, { StringLiteral.value = ""; raw = ""; comments = None }) - in - let source env = - match Peek.token env with - | T_IDENTIFIER { raw = "from"; _ } -> - Eat.token env; - (match Peek.token env with - | T_STRING str -> string_literal env str - | _ -> - error_unexpected ~expected:"a string" env; - missing_source env) - | _ -> - error_unexpected ~expected:"the keyword `from`" env; - missing_source env - in - let is_type_import = function - | T_TYPE - | T_TYPEOF -> - true - | _ -> false - (* `x` or `x as y` in a specifier *) - in - let with_maybe_as ~for_type ?error_if_type env = - let identifier env = - if for_type then - Type.type_identifier env - else - Parse.identifier env - in - match Peek.ith_token ~i:1 env with - | T_IDENTIFIER { raw = "as"; _ } -> - let remote = identifier_name env in - Eat.token env; - - (* as *) - let local = Some (identifier env) in - (remote, local) - | T_EOF - | T_COMMA - | T_RCURLY -> - (identifier env, None) - | _ -> - begin - match (error_if_type, Peek.token env) with - | (Some error_if_type, T_TYPE) - | (Some error_if_type, T_TYPEOF) -> - error env error_if_type; - Eat.token env; - - (* consume `type` or `typeof` *) - (Type.type_identifier env, None) - | _ -> (identifier env, None) - end - (* - ImportSpecifier[Type]: - [~Type] ImportedBinding - [~Type] IdentifierName ImportedTypeBinding - [~Type] IdentifierName IdentifierName ImportedBinding - [~Type] IdentifierName IdentifierName IdentifierName ImportedTypeBinding - [+Type] ImportedTypeBinding - [+Type] IdentifierName IdentifierName ImportedTypeBinding - - Static Semantics: - - `IdentifierName ImportedTypeBinding`: - - It is a Syntax Error if IdentifierName's StringValue is not "type" or "typeof" - - `IdentifierName IdentifierName ImportedBinding`: - - It is a Syntax Error if the second IdentifierName's StringValue is not "as" - - `IdentifierName IdentifierName IdentifierName ImportedTypeBinding`: - - It is a Syntax Error if the first IdentifierName's StringValue is not "type" - or "typeof", and the third IdentifierName's StringValue is not "as" - *) - in - - let specifier env = - let kind = - match Peek.token env with - | T_TYPE -> Some ImportType - | T_TYPEOF -> Some ImportTypeof - | _ -> None - in - if is_type_import (Peek.token env) then - (* consume `type`, but we don't know yet whether this is `type foo` or - `type as foo`. *) - let type_keyword_or_remote = identifier_name env in - match Peek.token env with - (* `type` (a value) *) - | T_EOF - | T_RCURLY - | T_COMMA -> - let remote = type_keyword_or_remote in - (* `type` becomes a value *) - assert_identifier_name_is_identifier env remote; - { remote; local = None; kind = None } - (* `type as foo` (value named `type`) or `type as,` (type named `as`) *) - | T_IDENTIFIER { raw = "as"; _ } -> - begin - match Peek.ith_token ~i:1 env with - | T_EOF - | T_RCURLY - | T_COMMA -> - (* `type as` *) - { remote = Type.type_identifier env; local = None; kind } - | T_IDENTIFIER { raw = "as"; _ } -> - (* `type as as foo` *) - let remote = identifier_name env in - (* first `as` *) - Eat.token env; - - (* second `as` *) - let local = Some (Type.type_identifier env) in - (* `foo` *) - { remote; local; kind } - | _ -> - (* `type as foo` *) - let remote = type_keyword_or_remote in - (* `type` becomes a value *) - assert_identifier_name_is_identifier env remote; - Eat.token env; - - (* `as` *) - let local = Some (Parse.identifier env) in - { remote; local; kind = None } - end - (* `type x`, or `type x as y` *) - | _ -> - let (remote, local) = with_maybe_as ~for_type:true env in - { remote; local; kind } - else - (* standard `x` or `x as y` *) - let (remote, local) = with_maybe_as ~for_type:false env in - { remote; local; kind = None } - (* specifier in an `import type { ... }` *) - in - let type_specifier env = - let (remote, local) = - with_maybe_as - env - ~for_type:true - ~error_if_type:Parse_error.ImportTypeShorthandOnlyInPureImport - in - { remote; local; kind = None } - (* specifier in an `import typeof { ... }` *) - in - let typeof_specifier env = - let (remote, local) = - with_maybe_as - env - ~for_type:true - ~error_if_type:Parse_error.ImportTypeShorthandOnlyInPureImport - in - { remote; local; kind = None } - in - let rec specifier_list ?(preceding_comma = true) env statement_kind acc = - match Peek.token env with - | T_EOF - | T_RCURLY -> - List.rev acc - | _ -> - if not preceding_comma then error env Parse_error.ImportSpecifierMissingComma; - let specifier = - match statement_kind with - | ImportType -> type_specifier env - | ImportTypeof -> typeof_specifier env - | ImportValue -> specifier env - in - let preceding_comma = Eat.maybe env T_COMMA in - specifier_list ~preceding_comma env statement_kind (specifier :: acc) - in - let named_or_namespace_specifier env import_kind = - match Peek.token env with - | T_MULT -> - let id = - with_loc_opt - (fun env -> - (* consume T_MULT *) - Eat.token env; - match Peek.token env with - | T_IDENTIFIER { raw = "as"; _ } -> - (* consume "as" *) - Eat.token env; - (match import_kind with - | ImportType - | ImportTypeof -> - Some (Type.type_identifier env) - | ImportValue -> Some (Parse.identifier env)) - | _ -> - error_unexpected ~expected:"the keyword `as`" env; - None) - env - in - (match id with - | Some id -> Some (ImportNamespaceSpecifier id) - | None -> None) - | _ -> - Expect.token env T_LCURLY; - let specifiers = specifier_list env import_kind [] in - Expect.token env T_RCURLY; - Some (ImportNamedSpecifiers specifiers) - in - let semicolon_and_trailing env source = - match semicolon env with - | Explicit trailing -> (trailing, source) - | Implicit { remove_trailing; _ } -> - ( [], - remove_trailing source (fun remover (loc, source) -> - (loc, remover#string_literal_type loc source) - ) - ) - in - let with_specifiers import_kind env leading = - let specifiers = named_or_namespace_specifier env import_kind in - let source = source env in - let (trailing, source) = semicolon_and_trailing env source in - Statement.ImportDeclaration - { - import_kind; - source; - specifiers; - default = None; - comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing (); - } - in - let with_default import_kind env leading = - let default_specifier = - match import_kind with - | ImportType - | ImportTypeof -> - Type.type_identifier env - | ImportValue -> Parse.identifier env - in - let additional_specifiers = - match Peek.token env with - | T_COMMA -> - (* `import Foo, ...` *) - Expect.token env T_COMMA; - named_or_namespace_specifier env import_kind - | _ -> None - in - let source = source env in - let (trailing, source) = semicolon_and_trailing env source in - Statement.ImportDeclaration - { - import_kind; - source; - specifiers = additional_specifiers; - default = Some default_specifier; - comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing (); - } - in - with_loc (fun env -> - let env = env |> with_strict true in - let leading = Peek.comments env in - Expect.token env T_IMPORT; - - match Peek.token env with - (* `import * as ns from "ModuleName";` *) - | T_MULT -> with_specifiers ImportValue env leading - (* `import { ... } from "ModuleName";` *) - | T_LCURLY -> with_specifiers ImportValue env leading - (* `import "ModuleName";` *) - | T_STRING str -> - let source = string_literal env str in - let (trailing, source) = semicolon_and_trailing env source in - Statement.ImportDeclaration - { - import_kind = ImportValue; - source; - specifiers = None; - default = None; - comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing (); - } - (* `import type [...] from "ModuleName";` - note that if [...] is missing, we're importing a value named `type`! *) - | T_TYPE when should_parse_types env -> - begin - match Peek.ith_token ~i:1 env with - (* `import type, { other, names } from "ModuleName";` *) - | T_COMMA - (* `import type from "ModuleName";` *) - | T_IDENTIFIER { raw = "from"; _ } -> - (* Importing the exported value named "type". This is not a type-import.*) - with_default ImportValue env leading - (* `import type *` is invalid, since the namespace can't be a type *) - | T_MULT -> - (* consume `type` *) - Eat.token env; - - (* unexpected `*` *) - error_unexpected env; - - with_specifiers ImportType env leading - | T_LCURLY -> - (* consume `type` *) - Eat.token env; - - with_specifiers ImportType env leading - | _ -> - (* consume `type` *) - Eat.token env; - - with_default ImportType env leading - end - (* `import typeof ... from "ModuleName";` *) - | T_TYPEOF when should_parse_types env -> - Expect.token env T_TYPEOF; - begin - match Peek.token env with - | T_MULT - | T_LCURLY -> - with_specifiers ImportTypeof env leading - | _ -> with_default ImportTypeof env leading - end - (* import Foo from "ModuleName"; *) - | _ -> with_default ImportValue env leading - ) - ) -end diff --git a/compiler/js_parser/token.ml b/compiler/js_parser/token.ml deleted file mode 100644 index fe5c667d3f..0000000000 --- a/compiler/js_parser/token.ml +++ /dev/null @@ -1,996 +0,0 @@ -(* - * 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 Primitive_deriving - -type t = - | T_NUMBER of { - kind: number_type; - raw: string; - } - | T_BIGINT of { - kind: bigint_type; - raw: string; - } - | T_STRING of (Loc.t * string * string * bool) (* loc, value, raw, octal *) - | T_TEMPLATE_PART of (Loc.t * template_part * bool) (* loc, value, is_tail *) - | T_IDENTIFIER of { - loc: Loc.t; - value: string; - raw: string; - } - | T_REGEXP of Loc.t * string * string (* /pattern/flags *) - (* Syntax *) - | T_LCURLY - | T_RCURLY - | T_LCURLYBAR - | T_RCURLYBAR - | T_LPAREN - | T_RPAREN - | T_LBRACKET - | T_RBRACKET - | T_SEMICOLON - | T_COMMA - | T_PERIOD - | T_ARROW - | T_ELLIPSIS - | T_AT - | T_POUND - (* Keywords *) - | T_FUNCTION - | T_IF - | T_IN - | T_INSTANCEOF - | T_RETURN - | T_SWITCH - | T_THIS - | T_THROW - | T_TRY - | T_VAR - | T_WHILE - | T_WITH - | T_CONST - | T_LET - | T_NULL - | T_FALSE - | T_TRUE - | T_BREAK - | T_CASE - | T_CATCH - | T_CONTINUE - | T_DEFAULT - | T_DO - | T_FINALLY - | T_FOR - | T_CLASS - | T_EXTENDS - | T_STATIC - | T_ELSE - | T_NEW - | T_DELETE - | T_TYPEOF - | T_VOID - | T_ENUM - | T_EXPORT - | T_IMPORT - | T_SUPER - | T_IMPLEMENTS - | T_INTERFACE - | T_PACKAGE - | T_PRIVATE - | T_PROTECTED - | T_PUBLIC - | T_YIELD - | T_DEBUGGER - | T_DECLARE - | T_TYPE - | T_OPAQUE - | T_OF - | T_ASYNC - | T_AWAIT - | T_CHECKS - (* Operators *) - | T_RSHIFT3_ASSIGN - | T_RSHIFT_ASSIGN - | T_LSHIFT_ASSIGN - | T_BIT_XOR_ASSIGN - | T_BIT_OR_ASSIGN - | T_BIT_AND_ASSIGN - | T_MOD_ASSIGN - | T_DIV_ASSIGN - | T_MULT_ASSIGN - | T_EXP_ASSIGN - | T_MINUS_ASSIGN - | T_PLUS_ASSIGN - | T_NULLISH_ASSIGN - | T_AND_ASSIGN - | T_OR_ASSIGN - | T_ASSIGN - | T_PLING_PERIOD - | T_PLING_PLING - | T_PLING - | T_COLON - | T_OR - | T_AND - | T_BIT_OR - | T_BIT_XOR - | T_BIT_AND - | T_EQUAL - | T_NOT_EQUAL - | T_STRICT_EQUAL - | T_STRICT_NOT_EQUAL - | T_LESS_THAN_EQUAL - | T_GREATER_THAN_EQUAL - | T_LESS_THAN - | T_GREATER_THAN - | T_LSHIFT - | T_RSHIFT - | T_RSHIFT3 - | T_PLUS - | T_MINUS - | T_DIV - | T_MULT - | T_EXP - | T_MOD - | T_NOT - | T_BIT_NOT - | T_INCR - | T_DECR - (* Extra tokens *) - | T_ERROR of string - | T_EOF - (* JSX *) - | T_JSX_IDENTIFIER of { - raw: string; - loc: Loc.t; - } - | T_JSX_TEXT of Loc.t * string * string (* loc, value, raw *) - (* Type primitives *) - | T_ANY_TYPE - | T_MIXED_TYPE - | T_EMPTY_TYPE - | T_BOOLEAN_TYPE of bool_or_boolean - | T_NUMBER_TYPE - | T_BIGINT_TYPE - | T_NUMBER_SINGLETON_TYPE of { - kind: number_type; - value: float; - raw: string; - } - | T_BIGINT_SINGLETON_TYPE of { - kind: bigint_type; - value: int64 option; - raw: string; - } - | T_STRING_TYPE - | T_VOID_TYPE - | T_SYMBOL_TYPE - -(* `bool` and `boolean` are equivalent annotations, but we need to track - which one was used for when it might be an identifier, as in - `(bool: boolean) => void`. It's lexed as two T_BOOLEAN_TYPEs, then the - first one is converted into an identifier. *) -and bool_or_boolean = - | BOOL - | BOOLEAN - -and number_type = - | BINARY - | LEGACY_OCTAL - | LEGACY_NON_OCTAL (* NonOctalDecimalIntegerLiteral in Annex B *) - | OCTAL - | NORMAL - -and bigint_type = - | BIG_BINARY - | BIG_OCTAL - | BIG_NORMAL - -and template_part = { - cooked: string; - (* string after processing special chars *) - raw: string; - (* string as specified in source *) - literal: string; (* same as raw, plus characters like ` and ${ *) -} -[@@deriving_inline equal] -let _ = fun (_ : t) -> () -let _ = fun (_ : bool_or_boolean) -> () -let _ = fun (_ : number_type) -> () -let _ = fun (_ : bigint_type) -> () -let _ = fun (_ : template_part) -> () -let rec equal = - (fun a__001_ -> - fun b__002_ -> - if Ppx_compare_lib.phys_equal a__001_ b__002_ - then true - else - (match (a__001_, b__002_) with - | (T_NUMBER _a__003_, T_NUMBER _b__004_) -> - Ppx_compare_lib.(&&) - (equal_number_type _a__003_.kind _b__004_.kind) - (equal_string _a__003_.raw _b__004_.raw) - | (T_NUMBER _, _) -> false - | (_, T_NUMBER _) -> false - | (T_BIGINT _a__005_, T_BIGINT _b__006_) -> - Ppx_compare_lib.(&&) - (equal_bigint_type _a__005_.kind _b__006_.kind) - (equal_string _a__005_.raw _b__006_.raw) - | (T_BIGINT _, _) -> false - | (_, T_BIGINT _) -> false - | (T_STRING _a__007_, T_STRING _b__008_) -> - let (t__009_, t__010_, t__011_, t__012_) = _a__007_ in - let (t__013_, t__014_, t__015_, t__016_) = _b__008_ in - Ppx_compare_lib.(&&) (Loc.equal t__009_ t__013_) - (Ppx_compare_lib.(&&) (equal_string t__010_ t__014_) - (Ppx_compare_lib.(&&) (equal_string t__011_ t__015_) - (equal_bool t__012_ t__016_))) - | (T_STRING _, _) -> false - | (_, T_STRING _) -> false - | (T_TEMPLATE_PART _a__017_, T_TEMPLATE_PART _b__018_) -> - let (t__019_, t__020_, t__021_) = _a__017_ in - let (t__022_, t__023_, t__024_) = _b__018_ in - Ppx_compare_lib.(&&) (Loc.equal t__019_ t__022_) - (Ppx_compare_lib.(&&) (equal_template_part t__020_ t__023_) - (equal_bool t__021_ t__024_)) - | (T_TEMPLATE_PART _, _) -> false - | (_, T_TEMPLATE_PART _) -> false - | (T_IDENTIFIER _a__025_, T_IDENTIFIER _b__026_) -> - Ppx_compare_lib.(&&) (Loc.equal _a__025_.loc _b__026_.loc) - (Ppx_compare_lib.(&&) - (equal_string _a__025_.value _b__026_.value) - (equal_string _a__025_.raw _b__026_.raw)) - | (T_IDENTIFIER _, _) -> false - | (_, T_IDENTIFIER _) -> false - | (T_REGEXP (_a__027_, _a__029_, _a__031_), T_REGEXP - (_b__028_, _b__030_, _b__032_)) -> - Ppx_compare_lib.(&&) (Loc.equal _a__027_ _b__028_) - (Ppx_compare_lib.(&&) (equal_string _a__029_ _b__030_) - (equal_string _a__031_ _b__032_)) - | (T_REGEXP _, _) -> false - | (_, T_REGEXP _) -> false - | (T_LCURLY, T_LCURLY) -> true - | (T_LCURLY, _) -> false - | (_, T_LCURLY) -> false - | (T_RCURLY, T_RCURLY) -> true - | (T_RCURLY, _) -> false - | (_, T_RCURLY) -> false - | (T_LCURLYBAR, T_LCURLYBAR) -> true - | (T_LCURLYBAR, _) -> false - | (_, T_LCURLYBAR) -> false - | (T_RCURLYBAR, T_RCURLYBAR) -> true - | (T_RCURLYBAR, _) -> false - | (_, T_RCURLYBAR) -> false - | (T_LPAREN, T_LPAREN) -> true - | (T_LPAREN, _) -> false - | (_, T_LPAREN) -> false - | (T_RPAREN, T_RPAREN) -> true - | (T_RPAREN, _) -> false - | (_, T_RPAREN) -> false - | (T_LBRACKET, T_LBRACKET) -> true - | (T_LBRACKET, _) -> false - | (_, T_LBRACKET) -> false - | (T_RBRACKET, T_RBRACKET) -> true - | (T_RBRACKET, _) -> false - | (_, T_RBRACKET) -> false - | (T_SEMICOLON, T_SEMICOLON) -> true - | (T_SEMICOLON, _) -> false - | (_, T_SEMICOLON) -> false - | (T_COMMA, T_COMMA) -> true - | (T_COMMA, _) -> false - | (_, T_COMMA) -> false - | (T_PERIOD, T_PERIOD) -> true - | (T_PERIOD, _) -> false - | (_, T_PERIOD) -> false - | (T_ARROW, T_ARROW) -> true - | (T_ARROW, _) -> false - | (_, T_ARROW) -> false - | (T_ELLIPSIS, T_ELLIPSIS) -> true - | (T_ELLIPSIS, _) -> false - | (_, T_ELLIPSIS) -> false - | (T_AT, T_AT) -> true - | (T_AT, _) -> false - | (_, T_AT) -> false - | (T_POUND, T_POUND) -> true - | (T_POUND, _) -> false - | (_, T_POUND) -> false - | (T_FUNCTION, T_FUNCTION) -> true - | (T_FUNCTION, _) -> false - | (_, T_FUNCTION) -> false - | (T_IF, T_IF) -> true - | (T_IF, _) -> false - | (_, T_IF) -> false - | (T_IN, T_IN) -> true - | (T_IN, _) -> false - | (_, T_IN) -> false - | (T_INSTANCEOF, T_INSTANCEOF) -> true - | (T_INSTANCEOF, _) -> false - | (_, T_INSTANCEOF) -> false - | (T_RETURN, T_RETURN) -> true - | (T_RETURN, _) -> false - | (_, T_RETURN) -> false - | (T_SWITCH, T_SWITCH) -> true - | (T_SWITCH, _) -> false - | (_, T_SWITCH) -> false - | (T_THIS, T_THIS) -> true - | (T_THIS, _) -> false - | (_, T_THIS) -> false - | (T_THROW, T_THROW) -> true - | (T_THROW, _) -> false - | (_, T_THROW) -> false - | (T_TRY, T_TRY) -> true - | (T_TRY, _) -> false - | (_, T_TRY) -> false - | (T_VAR, T_VAR) -> true - | (T_VAR, _) -> false - | (_, T_VAR) -> false - | (T_WHILE, T_WHILE) -> true - | (T_WHILE, _) -> false - | (_, T_WHILE) -> false - | (T_WITH, T_WITH) -> true - | (T_WITH, _) -> false - | (_, T_WITH) -> false - | (T_CONST, T_CONST) -> true - | (T_CONST, _) -> false - | (_, T_CONST) -> false - | (T_LET, T_LET) -> true - | (T_LET, _) -> false - | (_, T_LET) -> false - | (T_NULL, T_NULL) -> true - | (T_NULL, _) -> false - | (_, T_NULL) -> false - | (T_FALSE, T_FALSE) -> true - | (T_FALSE, _) -> false - | (_, T_FALSE) -> false - | (T_TRUE, T_TRUE) -> true - | (T_TRUE, _) -> false - | (_, T_TRUE) -> false - | (T_BREAK, T_BREAK) -> true - | (T_BREAK, _) -> false - | (_, T_BREAK) -> false - | (T_CASE, T_CASE) -> true - | (T_CASE, _) -> false - | (_, T_CASE) -> false - | (T_CATCH, T_CATCH) -> true - | (T_CATCH, _) -> false - | (_, T_CATCH) -> false - | (T_CONTINUE, T_CONTINUE) -> true - | (T_CONTINUE, _) -> false - | (_, T_CONTINUE) -> false - | (T_DEFAULT, T_DEFAULT) -> true - | (T_DEFAULT, _) -> false - | (_, T_DEFAULT) -> false - | (T_DO, T_DO) -> true - | (T_DO, _) -> false - | (_, T_DO) -> false - | (T_FINALLY, T_FINALLY) -> true - | (T_FINALLY, _) -> false - | (_, T_FINALLY) -> false - | (T_FOR, T_FOR) -> true - | (T_FOR, _) -> false - | (_, T_FOR) -> false - | (T_CLASS, T_CLASS) -> true - | (T_CLASS, _) -> false - | (_, T_CLASS) -> false - | (T_EXTENDS, T_EXTENDS) -> true - | (T_EXTENDS, _) -> false - | (_, T_EXTENDS) -> false - | (T_STATIC, T_STATIC) -> true - | (T_STATIC, _) -> false - | (_, T_STATIC) -> false - | (T_ELSE, T_ELSE) -> true - | (T_ELSE, _) -> false - | (_, T_ELSE) -> false - | (T_NEW, T_NEW) -> true - | (T_NEW, _) -> false - | (_, T_NEW) -> false - | (T_DELETE, T_DELETE) -> true - | (T_DELETE, _) -> false - | (_, T_DELETE) -> false - | (T_TYPEOF, T_TYPEOF) -> true - | (T_TYPEOF, _) -> false - | (_, T_TYPEOF) -> false - | (T_VOID, T_VOID) -> true - | (T_VOID, _) -> false - | (_, T_VOID) -> false - | (T_ENUM, T_ENUM) -> true - | (T_ENUM, _) -> false - | (_, T_ENUM) -> false - | (T_EXPORT, T_EXPORT) -> true - | (T_EXPORT, _) -> false - | (_, T_EXPORT) -> false - | (T_IMPORT, T_IMPORT) -> true - | (T_IMPORT, _) -> false - | (_, T_IMPORT) -> false - | (T_SUPER, T_SUPER) -> true - | (T_SUPER, _) -> false - | (_, T_SUPER) -> false - | (T_IMPLEMENTS, T_IMPLEMENTS) -> true - | (T_IMPLEMENTS, _) -> false - | (_, T_IMPLEMENTS) -> false - | (T_INTERFACE, T_INTERFACE) -> true - | (T_INTERFACE, _) -> false - | (_, T_INTERFACE) -> false - | (T_PACKAGE, T_PACKAGE) -> true - | (T_PACKAGE, _) -> false - | (_, T_PACKAGE) -> false - | (T_PRIVATE, T_PRIVATE) -> true - | (T_PRIVATE, _) -> false - | (_, T_PRIVATE) -> false - | (T_PROTECTED, T_PROTECTED) -> true - | (T_PROTECTED, _) -> false - | (_, T_PROTECTED) -> false - | (T_PUBLIC, T_PUBLIC) -> true - | (T_PUBLIC, _) -> false - | (_, T_PUBLIC) -> false - | (T_YIELD, T_YIELD) -> true - | (T_YIELD, _) -> false - | (_, T_YIELD) -> false - | (T_DEBUGGER, T_DEBUGGER) -> true - | (T_DEBUGGER, _) -> false - | (_, T_DEBUGGER) -> false - | (T_DECLARE, T_DECLARE) -> true - | (T_DECLARE, _) -> false - | (_, T_DECLARE) -> false - | (T_TYPE, T_TYPE) -> true - | (T_TYPE, _) -> false - | (_, T_TYPE) -> false - | (T_OPAQUE, T_OPAQUE) -> true - | (T_OPAQUE, _) -> false - | (_, T_OPAQUE) -> false - | (T_OF, T_OF) -> true - | (T_OF, _) -> false - | (_, T_OF) -> false - | (T_ASYNC, T_ASYNC) -> true - | (T_ASYNC, _) -> false - | (_, T_ASYNC) -> false - | (T_AWAIT, T_AWAIT) -> true - | (T_AWAIT, _) -> false - | (_, T_AWAIT) -> false - | (T_CHECKS, T_CHECKS) -> true - | (T_CHECKS, _) -> false - | (_, T_CHECKS) -> false - | (T_RSHIFT3_ASSIGN, T_RSHIFT3_ASSIGN) -> true - | (T_RSHIFT3_ASSIGN, _) -> false - | (_, T_RSHIFT3_ASSIGN) -> false - | (T_RSHIFT_ASSIGN, T_RSHIFT_ASSIGN) -> true - | (T_RSHIFT_ASSIGN, _) -> false - | (_, T_RSHIFT_ASSIGN) -> false - | (T_LSHIFT_ASSIGN, T_LSHIFT_ASSIGN) -> true - | (T_LSHIFT_ASSIGN, _) -> false - | (_, T_LSHIFT_ASSIGN) -> false - | (T_BIT_XOR_ASSIGN, T_BIT_XOR_ASSIGN) -> true - | (T_BIT_XOR_ASSIGN, _) -> false - | (_, T_BIT_XOR_ASSIGN) -> false - | (T_BIT_OR_ASSIGN, T_BIT_OR_ASSIGN) -> true - | (T_BIT_OR_ASSIGN, _) -> false - | (_, T_BIT_OR_ASSIGN) -> false - | (T_BIT_AND_ASSIGN, T_BIT_AND_ASSIGN) -> true - | (T_BIT_AND_ASSIGN, _) -> false - | (_, T_BIT_AND_ASSIGN) -> false - | (T_MOD_ASSIGN, T_MOD_ASSIGN) -> true - | (T_MOD_ASSIGN, _) -> false - | (_, T_MOD_ASSIGN) -> false - | (T_DIV_ASSIGN, T_DIV_ASSIGN) -> true - | (T_DIV_ASSIGN, _) -> false - | (_, T_DIV_ASSIGN) -> false - | (T_MULT_ASSIGN, T_MULT_ASSIGN) -> true - | (T_MULT_ASSIGN, _) -> false - | (_, T_MULT_ASSIGN) -> false - | (T_EXP_ASSIGN, T_EXP_ASSIGN) -> true - | (T_EXP_ASSIGN, _) -> false - | (_, T_EXP_ASSIGN) -> false - | (T_MINUS_ASSIGN, T_MINUS_ASSIGN) -> true - | (T_MINUS_ASSIGN, _) -> false - | (_, T_MINUS_ASSIGN) -> false - | (T_PLUS_ASSIGN, T_PLUS_ASSIGN) -> true - | (T_PLUS_ASSIGN, _) -> false - | (_, T_PLUS_ASSIGN) -> false - | (T_NULLISH_ASSIGN, T_NULLISH_ASSIGN) -> true - | (T_NULLISH_ASSIGN, _) -> false - | (_, T_NULLISH_ASSIGN) -> false - | (T_AND_ASSIGN, T_AND_ASSIGN) -> true - | (T_AND_ASSIGN, _) -> false - | (_, T_AND_ASSIGN) -> false - | (T_OR_ASSIGN, T_OR_ASSIGN) -> true - | (T_OR_ASSIGN, _) -> false - | (_, T_OR_ASSIGN) -> false - | (T_ASSIGN, T_ASSIGN) -> true - | (T_ASSIGN, _) -> false - | (_, T_ASSIGN) -> false - | (T_PLING_PERIOD, T_PLING_PERIOD) -> true - | (T_PLING_PERIOD, _) -> false - | (_, T_PLING_PERIOD) -> false - | (T_PLING_PLING, T_PLING_PLING) -> true - | (T_PLING_PLING, _) -> false - | (_, T_PLING_PLING) -> false - | (T_PLING, T_PLING) -> true - | (T_PLING, _) -> false - | (_, T_PLING) -> false - | (T_COLON, T_COLON) -> true - | (T_COLON, _) -> false - | (_, T_COLON) -> false - | (T_OR, T_OR) -> true - | (T_OR, _) -> false - | (_, T_OR) -> false - | (T_AND, T_AND) -> true - | (T_AND, _) -> false - | (_, T_AND) -> false - | (T_BIT_OR, T_BIT_OR) -> true - | (T_BIT_OR, _) -> false - | (_, T_BIT_OR) -> false - | (T_BIT_XOR, T_BIT_XOR) -> true - | (T_BIT_XOR, _) -> false - | (_, T_BIT_XOR) -> false - | (T_BIT_AND, T_BIT_AND) -> true - | (T_BIT_AND, _) -> false - | (_, T_BIT_AND) -> false - | (T_EQUAL, T_EQUAL) -> true - | (T_EQUAL, _) -> false - | (_, T_EQUAL) -> false - | (T_NOT_EQUAL, T_NOT_EQUAL) -> true - | (T_NOT_EQUAL, _) -> false - | (_, T_NOT_EQUAL) -> false - | (T_STRICT_EQUAL, T_STRICT_EQUAL) -> true - | (T_STRICT_EQUAL, _) -> false - | (_, T_STRICT_EQUAL) -> false - | (T_STRICT_NOT_EQUAL, T_STRICT_NOT_EQUAL) -> true - | (T_STRICT_NOT_EQUAL, _) -> false - | (_, T_STRICT_NOT_EQUAL) -> false - | (T_LESS_THAN_EQUAL, T_LESS_THAN_EQUAL) -> true - | (T_LESS_THAN_EQUAL, _) -> false - | (_, T_LESS_THAN_EQUAL) -> false - | (T_GREATER_THAN_EQUAL, T_GREATER_THAN_EQUAL) -> true - | (T_GREATER_THAN_EQUAL, _) -> false - | (_, T_GREATER_THAN_EQUAL) -> false - | (T_LESS_THAN, T_LESS_THAN) -> true - | (T_LESS_THAN, _) -> false - | (_, T_LESS_THAN) -> false - | (T_GREATER_THAN, T_GREATER_THAN) -> true - | (T_GREATER_THAN, _) -> false - | (_, T_GREATER_THAN) -> false - | (T_LSHIFT, T_LSHIFT) -> true - | (T_LSHIFT, _) -> false - | (_, T_LSHIFT) -> false - | (T_RSHIFT, T_RSHIFT) -> true - | (T_RSHIFT, _) -> false - | (_, T_RSHIFT) -> false - | (T_RSHIFT3, T_RSHIFT3) -> true - | (T_RSHIFT3, _) -> false - | (_, T_RSHIFT3) -> false - | (T_PLUS, T_PLUS) -> true - | (T_PLUS, _) -> false - | (_, T_PLUS) -> false - | (T_MINUS, T_MINUS) -> true - | (T_MINUS, _) -> false - | (_, T_MINUS) -> false - | (T_DIV, T_DIV) -> true - | (T_DIV, _) -> false - | (_, T_DIV) -> false - | (T_MULT, T_MULT) -> true - | (T_MULT, _) -> false - | (_, T_MULT) -> false - | (T_EXP, T_EXP) -> true - | (T_EXP, _) -> false - | (_, T_EXP) -> false - | (T_MOD, T_MOD) -> true - | (T_MOD, _) -> false - | (_, T_MOD) -> false - | (T_NOT, T_NOT) -> true - | (T_NOT, _) -> false - | (_, T_NOT) -> false - | (T_BIT_NOT, T_BIT_NOT) -> true - | (T_BIT_NOT, _) -> false - | (_, T_BIT_NOT) -> false - | (T_INCR, T_INCR) -> true - | (T_INCR, _) -> false - | (_, T_INCR) -> false - | (T_DECR, T_DECR) -> true - | (T_DECR, _) -> false - | (_, T_DECR) -> false - | (T_ERROR _a__033_, T_ERROR _b__034_) -> - equal_string _a__033_ _b__034_ - | (T_ERROR _, _) -> false - | (_, T_ERROR _) -> false - | (T_EOF, T_EOF) -> true - | (T_EOF, _) -> false - | (_, T_EOF) -> false - | (T_JSX_IDENTIFIER _a__035_, T_JSX_IDENTIFIER _b__036_) -> - Ppx_compare_lib.(&&) (equal_string _a__035_.raw _b__036_.raw) - (Loc.equal _a__035_.loc _b__036_.loc) - | (T_JSX_IDENTIFIER _, _) -> false - | (_, T_JSX_IDENTIFIER _) -> false - | (T_JSX_TEXT (_a__037_, _a__039_, _a__041_), T_JSX_TEXT - (_b__038_, _b__040_, _b__042_)) -> - Ppx_compare_lib.(&&) (Loc.equal _a__037_ _b__038_) - (Ppx_compare_lib.(&&) (equal_string _a__039_ _b__040_) - (equal_string _a__041_ _b__042_)) - | (T_JSX_TEXT _, _) -> false - | (_, T_JSX_TEXT _) -> false - | (T_ANY_TYPE, T_ANY_TYPE) -> true - | (T_ANY_TYPE, _) -> false - | (_, T_ANY_TYPE) -> false - | (T_MIXED_TYPE, T_MIXED_TYPE) -> true - | (T_MIXED_TYPE, _) -> false - | (_, T_MIXED_TYPE) -> false - | (T_EMPTY_TYPE, T_EMPTY_TYPE) -> true - | (T_EMPTY_TYPE, _) -> false - | (_, T_EMPTY_TYPE) -> false - | (T_BOOLEAN_TYPE _a__043_, T_BOOLEAN_TYPE _b__044_) -> - equal_bool_or_boolean _a__043_ _b__044_ - | (T_BOOLEAN_TYPE _, _) -> false - | (_, T_BOOLEAN_TYPE _) -> false - | (T_NUMBER_TYPE, T_NUMBER_TYPE) -> true - | (T_NUMBER_TYPE, _) -> false - | (_, T_NUMBER_TYPE) -> false - | (T_BIGINT_TYPE, T_BIGINT_TYPE) -> true - | (T_BIGINT_TYPE, _) -> false - | (_, T_BIGINT_TYPE) -> false - | (T_NUMBER_SINGLETON_TYPE _a__045_, T_NUMBER_SINGLETON_TYPE - _b__046_) -> - Ppx_compare_lib.(&&) - (equal_number_type _a__045_.kind _b__046_.kind) - (Ppx_compare_lib.(&&) - (equal_float _a__045_.value _b__046_.value) - (equal_string _a__045_.raw _b__046_.raw)) - | (T_NUMBER_SINGLETON_TYPE _, _) -> false - | (_, T_NUMBER_SINGLETON_TYPE _) -> false - | (T_BIGINT_SINGLETON_TYPE _a__047_, T_BIGINT_SINGLETON_TYPE - _b__048_) -> - Ppx_compare_lib.(&&) - (equal_bigint_type _a__047_.kind _b__048_.kind) - (Ppx_compare_lib.(&&) - (equal_option equal_int64 _a__047_.value _b__048_.value) - (equal_string _a__047_.raw _b__048_.raw)) - | (T_BIGINT_SINGLETON_TYPE _, _) -> false - | (_, T_BIGINT_SINGLETON_TYPE _) -> false - | (T_STRING_TYPE, T_STRING_TYPE) -> true - | (T_STRING_TYPE, _) -> false - | (_, T_STRING_TYPE) -> false - | (T_VOID_TYPE, T_VOID_TYPE) -> true - | (T_VOID_TYPE, _) -> false - | (_, T_VOID_TYPE) -> false - | (T_SYMBOL_TYPE, T_SYMBOL_TYPE) -> true) : t -> t -> bool) -and equal_bool_or_boolean = - (fun a__051_ -> - fun b__052_ -> Ppx_compare_lib.polymorphic_equal a__051_ b__052_ : - bool_or_boolean -> bool_or_boolean -> bool) -and equal_number_type = - (fun a__053_ -> - fun b__054_ -> Ppx_compare_lib.polymorphic_equal a__053_ b__054_ : - number_type -> number_type -> bool) -and equal_bigint_type = - (fun a__055_ -> - fun b__056_ -> Ppx_compare_lib.polymorphic_equal a__055_ b__056_ : - bigint_type -> bigint_type -> bool) -and equal_template_part = - (fun a__057_ -> - fun b__058_ -> - if Ppx_compare_lib.phys_equal a__057_ b__058_ - then true - else - Ppx_compare_lib.(&&) (equal_string a__057_.cooked b__058_.cooked) - (Ppx_compare_lib.(&&) (equal_string a__057_.raw b__058_.raw) - (equal_string a__057_.literal b__058_.literal)) : template_part - -> - template_part - -> - bool) -let _ = equal -and _ = equal_bool_or_boolean -and _ = equal_number_type -and _ = equal_bigint_type -and _ = equal_template_part -[@@@end] -(*****************************************************************************) -(* Pretty printer (pretty?) *) -(*****************************************************************************) -let token_to_string = function - | T_NUMBER _ -> "T_NUMBER" - | T_BIGINT _ -> "T_BIGINT" - | T_STRING _ -> "T_STRING" - | T_TEMPLATE_PART _ -> "T_TEMPLATE_PART" - | T_IDENTIFIER _ -> "T_IDENTIFIER" - | T_REGEXP _ -> "T_REGEXP" - | T_FUNCTION -> "T_FUNCTION" - | T_IF -> "T_IF" - | T_IN -> "T_IN" - | T_INSTANCEOF -> "T_INSTANCEOF" - | T_RETURN -> "T_RETURN" - | T_SWITCH -> "T_SWITCH" - | T_THIS -> "T_THIS" - | T_THROW -> "T_THROW" - | T_TRY -> "T_TRY" - | T_VAR -> "T_VAR" - | T_WHILE -> "T_WHILE" - | T_WITH -> "T_WITH" - | T_CONST -> "T_CONST" - | T_LET -> "T_LET" - | T_NULL -> "T_NULL" - | T_FALSE -> "T_FALSE" - | T_TRUE -> "T_TRUE" - | T_BREAK -> "T_BREAK" - | T_CASE -> "T_CASE" - | T_CATCH -> "T_CATCH" - | T_CONTINUE -> "T_CONTINUE" - | T_DEFAULT -> "T_DEFAULT" - | T_DO -> "T_DO" - | T_FINALLY -> "T_FINALLY" - | T_FOR -> "T_FOR" - | T_CLASS -> "T_CLASS" - | T_EXTENDS -> "T_EXTENDS" - | T_STATIC -> "T_STATIC" - | T_ELSE -> "T_ELSE" - | T_NEW -> "T_NEW" - | T_DELETE -> "T_DELETE" - | T_TYPEOF -> "T_TYPEOF" - | T_VOID -> "T_VOID" - | T_ENUM -> "T_ENUM" - | T_EXPORT -> "T_EXPORT" - | T_IMPORT -> "T_IMPORT" - | T_SUPER -> "T_SUPER" - | T_IMPLEMENTS -> "T_IMPLEMENTS" - | T_INTERFACE -> "T_INTERFACE" - | T_PACKAGE -> "T_PACKAGE" - | T_PRIVATE -> "T_PRIVATE" - | T_PROTECTED -> "T_PROTECTED" - | T_PUBLIC -> "T_PUBLIC" - | T_YIELD -> "T_YIELD" - | T_DEBUGGER -> "T_DEBUGGER" - | T_DECLARE -> "T_DECLARE" - | T_TYPE -> "T_TYPE" - | T_OPAQUE -> "T_OPAQUE" - | T_OF -> "T_OF" - | T_ASYNC -> "T_ASYNC" - | T_AWAIT -> "T_AWAIT" - | T_CHECKS -> "T_CHECKS" - | T_LCURLY -> "T_LCURLY" - | T_RCURLY -> "T_RCURLY" - | T_LCURLYBAR -> "T_LCURLYBAR" - | T_RCURLYBAR -> "T_RCURLYBAR" - | T_LPAREN -> "T_LPAREN" - | T_RPAREN -> "T_RPAREN" - | T_LBRACKET -> "T_LBRACKET" - | T_RBRACKET -> "T_RBRACKET" - | T_SEMICOLON -> "T_SEMICOLON" - | T_COMMA -> "T_COMMA" - | T_PERIOD -> "T_PERIOD" - | T_ARROW -> "T_ARROW" - | T_ELLIPSIS -> "T_ELLIPSIS" - | T_AT -> "T_AT" - | T_POUND -> "T_POUND" - | T_RSHIFT3_ASSIGN -> "T_RSHIFT3_ASSIGN" - | T_RSHIFT_ASSIGN -> "T_RSHIFT_ASSIGN" - | T_LSHIFT_ASSIGN -> "T_LSHIFT_ASSIGN" - | T_BIT_XOR_ASSIGN -> "T_BIT_XOR_ASSIGN" - | T_BIT_OR_ASSIGN -> "T_BIT_OR_ASSIGN" - | T_BIT_AND_ASSIGN -> "T_BIT_AND_ASSIGN" - | T_MOD_ASSIGN -> "T_MOD_ASSIGN" - | T_DIV_ASSIGN -> "T_DIV_ASSIGN" - | T_MULT_ASSIGN -> "T_MULT_ASSIGN" - | T_EXP_ASSIGN -> "T_EXP_ASSIGN" - | T_MINUS_ASSIGN -> "T_MINUS_ASSIGN" - | T_PLUS_ASSIGN -> "T_PLUS_ASSIGN" - | T_NULLISH_ASSIGN -> "T_NULLISH_ASSIGN" - | T_AND_ASSIGN -> "T_AND_ASSIGN" - | T_OR_ASSIGN -> "T_OR_ASSIGN" - | T_ASSIGN -> "T_ASSIGN" - | T_PLING_PERIOD -> "T_PLING_PERIOD" - | T_PLING_PLING -> "T_PLING_PLING" - | T_PLING -> "T_PLING" - | T_COLON -> "T_COLON" - | T_OR -> "T_OR" - | T_AND -> "T_AND" - | T_BIT_OR -> "T_BIT_OR" - | T_BIT_XOR -> "T_BIT_XOR" - | T_BIT_AND -> "T_BIT_AND" - | T_EQUAL -> "T_EQUAL" - | T_NOT_EQUAL -> "T_NOT_EQUAL" - | T_STRICT_EQUAL -> "T_STRICT_EQUAL" - | T_STRICT_NOT_EQUAL -> "T_STRICT_NOT_EQUAL" - | T_LESS_THAN_EQUAL -> "T_LESS_THAN_EQUAL" - | T_GREATER_THAN_EQUAL -> "T_GREATER_THAN_EQUAL" - | T_LESS_THAN -> "T_LESS_THAN" - | T_GREATER_THAN -> "T_GREATER_THAN" - | T_LSHIFT -> "T_LSHIFT" - | T_RSHIFT -> "T_RSHIFT" - | T_RSHIFT3 -> "T_RSHIFT3" - | T_PLUS -> "T_PLUS" - | T_MINUS -> "T_MINUS" - | T_DIV -> "T_DIV" - | T_MULT -> "T_MULT" - | T_EXP -> "T_EXP" - | T_MOD -> "T_MOD" - | T_NOT -> "T_NOT" - | T_BIT_NOT -> "T_BIT_NOT" - | T_INCR -> "T_INCR" - | T_DECR -> "T_DECR" - (* Extra tokens *) - | T_ERROR _ -> "T_ERROR" - | T_EOF -> "T_EOF" - | T_JSX_IDENTIFIER _ -> "T_JSX_IDENTIFIER" - | T_JSX_TEXT _ -> "T_JSX_TEXT" - (* Type primitives *) - | T_ANY_TYPE -> "T_ANY_TYPE" - | T_MIXED_TYPE -> "T_MIXED_TYPE" - | T_EMPTY_TYPE -> "T_EMPTY_TYPE" - | T_BOOLEAN_TYPE _ -> "T_BOOLEAN_TYPE" - | T_NUMBER_TYPE -> "T_NUMBER_TYPE" - | T_BIGINT_TYPE -> "T_BIGINT_TYPE" - | T_NUMBER_SINGLETON_TYPE _ -> "T_NUMBER_SINGLETON_TYPE" - | T_BIGINT_SINGLETON_TYPE _ -> "T_BIGINT_SINGLETON_TYPE" - | T_STRING_TYPE -> "T_STRING_TYPE" - | T_VOID_TYPE -> "T_VOID_TYPE" - | T_SYMBOL_TYPE -> "T_SYMBOL_TYPE" - -let value_of_token = function - | T_NUMBER { raw; _ } -> raw - | T_BIGINT { raw; _ } -> raw - | T_STRING (_, _, raw, _) -> raw - | T_TEMPLATE_PART (_, { literal; _ }, _) -> literal - | T_IDENTIFIER { raw; _ } -> raw - | T_REGEXP (_, pattern, flags) -> "/" ^ pattern ^ "/" ^ flags - | T_LCURLY -> "{" - | T_RCURLY -> "}" - | T_LCURLYBAR -> "{|" - | T_RCURLYBAR -> "|}" - | T_LPAREN -> "(" - | T_RPAREN -> ")" - | T_LBRACKET -> "[" - | T_RBRACKET -> "]" - | T_SEMICOLON -> ";" - | T_COMMA -> "," - | T_PERIOD -> "." - | T_ARROW -> "=>" - | T_ELLIPSIS -> "..." - | T_AT -> "@" - | T_POUND -> "#" - | T_FUNCTION -> "function" - | T_IF -> "if" - | T_IN -> "in" - | T_INSTANCEOF -> "instanceof" - | T_RETURN -> "return" - | T_SWITCH -> "switch" - | T_THIS -> "this" - | T_THROW -> "throw" - | T_TRY -> "try" - | T_VAR -> "var" - | T_WHILE -> "while" - | T_WITH -> "with" - | T_CONST -> "const" - | T_LET -> "let" - | T_NULL -> "null" - | T_FALSE -> "false" - | T_TRUE -> "true" - | T_BREAK -> "break" - | T_CASE -> "case" - | T_CATCH -> "catch" - | T_CONTINUE -> "continue" - | T_DEFAULT -> "default" - | T_DO -> "do" - | T_FINALLY -> "finally" - | T_FOR -> "for" - | T_CLASS -> "class" - | T_EXTENDS -> "extends" - | T_STATIC -> "static" - | T_ELSE -> "else" - | T_NEW -> "new" - | T_DELETE -> "delete" - | T_TYPEOF -> "typeof" - | T_VOID -> "void" - | T_ENUM -> "enum" - | T_EXPORT -> "export" - | T_IMPORT -> "import" - | T_SUPER -> "super" - | T_IMPLEMENTS -> "implements" - | T_INTERFACE -> "interface" - | T_PACKAGE -> "package" - | T_PRIVATE -> "private" - | T_PROTECTED -> "protected" - | T_PUBLIC -> "public" - | T_YIELD -> "yield" - | T_DEBUGGER -> "debugger" - | T_DECLARE -> "declare" - | T_TYPE -> "type" - | T_OPAQUE -> "opaque" - | T_OF -> "of" - | T_ASYNC -> "async" - | T_AWAIT -> "await" - | T_CHECKS -> "%checks" - | T_RSHIFT3_ASSIGN -> ">>>=" - | T_RSHIFT_ASSIGN -> ">>=" - | T_LSHIFT_ASSIGN -> "<<=" - | T_BIT_XOR_ASSIGN -> "^=" - | T_BIT_OR_ASSIGN -> "|=" - | T_BIT_AND_ASSIGN -> "&=" - | T_MOD_ASSIGN -> "%=" - | T_DIV_ASSIGN -> "/=" - | T_MULT_ASSIGN -> "*=" - | T_EXP_ASSIGN -> "**=" - | T_MINUS_ASSIGN -> "-=" - | T_PLUS_ASSIGN -> "+=" - | T_NULLISH_ASSIGN -> "??=" - | T_AND_ASSIGN -> "&&=" - | T_OR_ASSIGN -> "||=" - | T_ASSIGN -> "=" - | T_PLING_PERIOD -> "?." - | T_PLING_PLING -> "??" - | T_PLING -> "?" - | T_COLON -> ":" - | T_OR -> "||" - | T_AND -> "&&" - | T_BIT_OR -> "|" - | T_BIT_XOR -> "^" - | T_BIT_AND -> "&" - | T_EQUAL -> "==" - | T_NOT_EQUAL -> "!=" - | T_STRICT_EQUAL -> "===" - | T_STRICT_NOT_EQUAL -> "!==" - | T_LESS_THAN_EQUAL -> "<=" - | T_GREATER_THAN_EQUAL -> ">=" - | T_LESS_THAN -> "<" - | T_GREATER_THAN -> ">" - | T_LSHIFT -> "<<" - | T_RSHIFT -> ">>" - | T_RSHIFT3 -> ">>>" - | T_PLUS -> "+" - | T_MINUS -> "-" - | T_DIV -> "/" - | T_MULT -> "*" - | T_EXP -> "**" - | T_MOD -> "%" - | T_NOT -> "!" - | T_BIT_NOT -> "~" - | T_INCR -> "++" - | T_DECR -> "--" - (* Extra tokens *) - | T_ERROR raw -> raw - | T_EOF -> "" - | T_JSX_IDENTIFIER { raw; _ } -> raw - | T_JSX_TEXT (_, _, raw) -> raw - (* Type primitives *) - | T_ANY_TYPE -> "any" - | T_MIXED_TYPE -> "mixed" - | T_EMPTY_TYPE -> "empty" - | T_BOOLEAN_TYPE kind -> begin - match kind with - | BOOL -> "bool" - | BOOLEAN -> "boolean" - end - | T_NUMBER_TYPE -> "number" - | T_BIGINT_TYPE -> "bigint" - | T_NUMBER_SINGLETON_TYPE { raw; _ } -> raw - | T_BIGINT_SINGLETON_TYPE { raw; _ } -> raw - | T_STRING_TYPE -> "string" - | T_VOID_TYPE -> "void" - | T_SYMBOL_TYPE -> "symbol" - -let quote_token_value value = Printf.sprintf "token `%s`" value - -let explanation_of_token ?(use_article = false) token = - let (value, article) = - match token with - | T_NUMBER_SINGLETON_TYPE _ - | T_NUMBER _ -> - ("number", "a") - | T_BIGINT_SINGLETON_TYPE _ - | T_BIGINT _ -> - ("bigint", "a") - | T_JSX_TEXT _ - | T_STRING _ -> - ("string", "a") - | T_TEMPLATE_PART _ -> ("template literal part", "a") - | T_JSX_IDENTIFIER _ - | T_IDENTIFIER _ -> - ("identifier", "an") - | T_REGEXP _ -> ("regexp", "a") - | T_EOF -> ("end of input", "the") - | _ -> (quote_token_value (value_of_token token), "the") - in - if use_article then - article ^ " " ^ value - else - value diff --git a/compiler/js_parser/type_parser.ml b/compiler/js_parser/type_parser.ml deleted file mode 100644 index ba898a1bfa..0000000000 --- a/compiler/js_parser/type_parser.ml +++ /dev/null @@ -1,1487 +0,0 @@ -(* - * 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 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 annotation : env -> (Loc.t, Loc.t) Ast.Type.annotation - - val annotation_opt : env -> (Loc.t, Loc.t) Ast.Type.annotation_or_hint - - val predicate_opt : env -> (Loc.t, Loc.t) Ast.Type.Predicate.t option - - val annotation_and_predicate_opt : - env -> (Loc.t, Loc.t) Ast.Type.annotation_or_hint * (Loc.t, Loc.t) Ast.Type.Predicate.t option -end - -module Type (Parse : Parser_common.PARSER) : 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 - - let maybe_variance env = - let loc = Peek.loc env in - match Peek.token env with - | T_PLUS -> - let leading = Peek.comments env in - Eat.token env; - Some - ( loc, - { Variance.kind = Variance.Plus; comments = Flow_ast_utils.mk_comments_opt ~leading () } - ) - | T_MINUS -> - let leading = Peek.comments env in - Eat.token env; - Some - ( loc, - { Variance.kind = Variance.Minus; comments = Flow_ast_utils.mk_comments_opt ~leading () } - ) - | _ -> None - - let rec _type env = union env - - and annotation env = - if not (should_parse_types env) then error env Parse_error.UnexpectedTypeAnnotation; - with_loc - (fun env -> - Expect.token env T_COLON; - _type env) - env - - and union env = - let leading = - if Peek.token env = T_BIT_OR then ( - let leading = Peek.comments env in - Eat.token env; - leading - ) else - [] - in - let left = intersection env in - union_with env ~leading left - - and union_with = - let rec unions leading acc env = - match Peek.token env with - | T_BIT_OR -> - Expect.token env T_BIT_OR; - unions leading (intersection env :: acc) env - | _ -> - (match List.rev acc with - | t0 :: t1 :: ts -> - Type.Union - { - Type.Union.types = (t0, t1, ts); - comments = Flow_ast_utils.mk_comments_opt ~leading (); - } - | _ -> assert false) - in - fun env ?(leading = []) left -> - if Peek.token env = T_BIT_OR then - with_loc ~start_loc:(fst left) (unions leading [left]) env - else - left - - and intersection env = - let leading = - if Peek.token env = T_BIT_AND then ( - let leading = Peek.comments env in - Eat.token env; - leading - ) else - [] - in - let left = anon_function_without_parens env in - intersection_with env ~leading left - - and intersection_with = - let rec intersections leading acc env = - match Peek.token env with - | T_BIT_AND -> - Expect.token env T_BIT_AND; - intersections leading (anon_function_without_parens env :: acc) env - | _ -> - (match List.rev acc with - | t0 :: t1 :: ts -> - Type.Intersection - { - Type.Intersection.types = (t0, t1, ts); - comments = Flow_ast_utils.mk_comments_opt ~leading (); - } - | _ -> assert false) - in - fun env ?(leading = []) left -> - if Peek.token env = T_BIT_AND then - with_loc ~start_loc:(fst left) (intersections leading [left]) env - else - left - - and anon_function_without_parens env = - let param = prefix env in - anon_function_without_parens_with env param - - and anon_function_without_parens_with env param = - match Peek.token env with - | T_ARROW when not (no_anon_function_type env) -> - let (start_loc, tparams, params) = - let param = anonymous_function_param env param in - ( fst param, - None, - ( fst param, - { - Ast.Type.Function.Params.params = [param]; - this_ = None; - rest = None; - comments = None; - } - ) - ) - in - function_with_params env start_loc tparams params - | _ -> param - - and prefix env = - match Peek.token env with - | T_PLING -> - with_loc - (fun env -> - let leading = Peek.comments env in - Expect.token env T_PLING; - Type.Nullable - { - Type.Nullable.argument = prefix env; - comments = Flow_ast_utils.mk_comments_opt ~leading (); - }) - env - | _ -> postfix env - - and postfix env = - let t = primary env in - postfix_with env t - - and postfix_with ?(in_optional_indexed_access = false) env t = - if Peek.is_line_terminator env then - t - else - match Peek.token env with - | T_PLING_PERIOD -> - Eat.token env; - if Peek.token env <> T_LBRACKET then error env Parse_error.InvalidOptionalIndexedAccess; - Expect.token env T_LBRACKET; - postfix_brackets ~in_optional_indexed_access:true ~optional_indexed_access:true env t - | T_LBRACKET -> - Eat.token env; - postfix_brackets ~in_optional_indexed_access ~optional_indexed_access:false env t - | T_PERIOD -> - (match Peek.ith_token ~i:1 env with - | T_LBRACKET -> - error env (Parse_error.InvalidIndexedAccess { has_bracket = true }); - Expect.token env T_PERIOD; - Expect.token env T_LBRACKET; - postfix_brackets ~in_optional_indexed_access ~optional_indexed_access:false env t - | _ -> - error env (Parse_error.InvalidIndexedAccess { has_bracket = false }); - t) - | _ -> t - - and postfix_brackets ~in_optional_indexed_access ~optional_indexed_access env t = - let t = - with_loc - ~start_loc:(fst t) - (fun env -> - (* Legacy Array syntax `Foo[]` *) - if (not optional_indexed_access) && Eat.maybe env T_RBRACKET then - let trailing = Eat.trailing_comments env in - Type.Array - { Type.Array.argument = t; comments = Flow_ast_utils.mk_comments_opt ~trailing () } - else - let index = _type env in - Expect.token env T_RBRACKET; - let trailing = Eat.trailing_comments env in - let indexed_access = - { - Type.IndexedAccess._object = t; - index; - comments = Flow_ast_utils.mk_comments_opt ~trailing (); - } - in - if in_optional_indexed_access then - Type.OptionalIndexedAccess - { Type.OptionalIndexedAccess.indexed_access; optional = optional_indexed_access } - else - Type.IndexedAccess indexed_access) - env - in - postfix_with env ~in_optional_indexed_access t - - and typeof_expr env = raw_typeof_expr_with_identifier env (Parse.identifier env) - - and raw_typeof_expr_with_identifier = - let rec identifier env (q_loc, qualification) = - if Peek.token env = T_PERIOD && Peek.ith_is_identifier ~i:1 env then - let (loc, q) = - with_loc - ~start_loc:q_loc - (fun env -> - Expect.token env T_PERIOD; - let id = identifier_name env in - { Type.Typeof.Target.qualification; id }) - env - in - let qualification = Type.Typeof.Target.Qualified (loc, q) in - identifier env (loc, qualification) - else - qualification - in - fun env ((loc, _) as id) -> - let id = Type.Typeof.Target.Unqualified id in - identifier env (loc, id) - - and typeof_arg env = - match Peek.token env with - | T_LPAREN -> - Eat.token env; - let typeof = typeof_arg env in - Expect.token env T_RPAREN; - typeof - | T_IDENTIFIER _ (* `static` is reserved in strict mode, but still an identifier *) -> - Some (typeof_expr env) - | _ -> - error env Parse_error.InvalidTypeof; - None - - and typeof env = - with_loc - (fun env -> - let leading = Peek.comments env in - Expect.token env T_TYPEOF; - match typeof_arg env with - | None -> Type.Any None - | Some argument -> - Type.Typeof - { Type.Typeof.argument; comments = Flow_ast_utils.mk_comments_opt ~leading () }) - env - - and primary env = - let loc = Peek.loc env in - match Peek.token env with - | T_MULT -> - let leading = Peek.comments env in - Expect.token env T_MULT; - let trailing = Eat.trailing_comments env in - (loc, Type.Exists (Flow_ast_utils.mk_comments_opt ~leading ~trailing ())) - | T_LESS_THAN -> _function env - | T_LPAREN -> function_or_group env - | T_LCURLY - | T_LCURLYBAR -> - let (loc, o) = _object env ~is_class:false ~allow_exact:true ~allow_spread:true in - (loc, Type.Object o) - | T_INTERFACE -> - with_loc - (fun env -> - let leading = Peek.comments env in - Expect.token env T_INTERFACE; - let (extends, body) = interface_helper env in - Type.Interface - { Type.Interface.extends; body; comments = Flow_ast_utils.mk_comments_opt ~leading () }) - env - | T_TYPEOF -> typeof env - | T_LBRACKET -> tuple env - | T_IDENTIFIER _ - | T_STATIC (* `static` is reserved in strict mode, but still an identifier *) -> - let (loc, g) = generic env in - (loc, Type.Generic g) - | T_STRING (loc, value, raw, octal) -> - if octal then strict_error env Parse_error.StrictOctalLiteral; - let leading = Peek.comments env in - Expect.token env (T_STRING (loc, value, raw, octal)); - let trailing = Eat.trailing_comments env in - ( loc, - Type.StringLiteral - { - Ast.StringLiteral.value; - raw; - comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing (); - } - ) - | T_NUMBER_SINGLETON_TYPE { kind; value; raw } -> - if kind = LEGACY_OCTAL then strict_error env Parse_error.StrictOctalLiteral; - let leading = Peek.comments env in - Expect.token env (T_NUMBER_SINGLETON_TYPE { kind; value; raw }); - let trailing = Eat.trailing_comments env in - ( loc, - Type.NumberLiteral - { - Ast.NumberLiteral.value; - raw; - comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing (); - } - ) - | T_BIGINT_SINGLETON_TYPE { kind; value; raw } -> - let leading = Peek.comments env in - Expect.token env (T_BIGINT_SINGLETON_TYPE { kind; value; raw }); - let trailing = Eat.trailing_comments env in - ( loc, - Type.BigIntLiteral - { - Ast.BigIntLiteral.value; - raw; - comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing (); - } - ) - | (T_TRUE | T_FALSE) as token -> - let leading = Peek.comments env in - Expect.token env token; - let trailing = Eat.trailing_comments env in - let value = token = T_TRUE in - ( loc, - Type.BooleanLiteral - { BooleanLiteral.value; comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () } - ) - | _ -> - (match primitive env with - | Some t -> (loc, t) - | None -> - error_unexpected ~expected:"a type" env; - (loc, Type.Any None)) - - and is_primitive = function - | T_ANY_TYPE - | T_MIXED_TYPE - | T_EMPTY_TYPE - | T_BOOLEAN_TYPE _ - | T_NUMBER_TYPE - | T_BIGINT_TYPE - | T_STRING_TYPE - | T_SYMBOL_TYPE - | T_VOID_TYPE - | T_NULL -> - true - | _ -> false - - and primitive env = - let leading = Peek.comments env in - let token = Peek.token env in - match token with - | T_ANY_TYPE -> - Eat.token env; - let trailing = Eat.trailing_comments env in - Some (Type.Any (Flow_ast_utils.mk_comments_opt ~leading ~trailing ())) - | T_MIXED_TYPE -> - Eat.token env; - let trailing = Eat.trailing_comments env in - Some (Type.Mixed (Flow_ast_utils.mk_comments_opt ~leading ~trailing ())) - | T_EMPTY_TYPE -> - Eat.token env; - let trailing = Eat.trailing_comments env in - Some (Type.Empty (Flow_ast_utils.mk_comments_opt ~leading ~trailing ())) - | T_BOOLEAN_TYPE _ -> - Eat.token env; - let trailing = Eat.trailing_comments env in - Some (Type.Boolean (Flow_ast_utils.mk_comments_opt ~leading ~trailing ())) - | T_NUMBER_TYPE -> - Eat.token env; - let trailing = Eat.trailing_comments env in - Some (Type.Number (Flow_ast_utils.mk_comments_opt ~leading ~trailing ())) - | T_BIGINT_TYPE -> - Eat.token env; - let trailing = Eat.trailing_comments env in - Some (Type.BigInt (Flow_ast_utils.mk_comments_opt ~leading ~trailing ())) - | T_STRING_TYPE -> - Eat.token env; - let trailing = Eat.trailing_comments env in - Some (Type.String (Flow_ast_utils.mk_comments_opt ~leading ~trailing ())) - | T_SYMBOL_TYPE -> - Eat.token env; - let trailing = Eat.trailing_comments env in - Some (Type.Symbol (Flow_ast_utils.mk_comments_opt ~leading ~trailing ())) - | T_VOID_TYPE -> - Eat.token env; - let trailing = Eat.trailing_comments env in - Some (Type.Void (Flow_ast_utils.mk_comments_opt ~leading ~trailing ())) - | T_NULL -> - Eat.token env; - let trailing = Eat.trailing_comments env in - Some (Type.Null (Flow_ast_utils.mk_comments_opt ~leading ~trailing ())) - | _ -> None - - and tuple = - let rec types env acc = - match Peek.token env with - | T_EOF - | T_RBRACKET -> - List.rev acc - | _ -> - let acc = _type env :: acc in - (* Trailing comma support (like [number, string,]) *) - if Peek.token env <> T_RBRACKET then Expect.token env T_COMMA; - types env acc - in - fun env -> - with_loc - (fun env -> - let leading = Peek.comments env in - Expect.token env T_LBRACKET; - let tl = types (with_no_anon_function_type false env) [] in - Expect.token env T_RBRACKET; - let trailing = Eat.trailing_comments env in - Type.Tuple - { - Type.Tuple.types = tl; - comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing (); - }) - env - - and anonymous_function_param _env annot = - (fst annot, Type.Function.Param.{ name = None; annot; optional = false }) - - and function_param_with_id env = - with_loc - (fun env -> - Eat.push_lex_mode env Lex_mode.NORMAL; - let name = Parse.identifier env in - Eat.pop_lex_mode env; - if not (should_parse_types env) then error env Parse_error.UnexpectedTypeAnnotation; - let optional = Eat.maybe env T_PLING in - Expect.token env T_COLON; - let annot = _type env in - { Type.Function.Param.name = Some name; annot; optional }) - env - - and function_param_list_without_parens = - let param env = - match Peek.ith_token ~i:1 env with - | T_COLON - | T_PLING -> - function_param_with_id env - | _ -> - let annot = _type env in - anonymous_function_param env annot - in - let rec param_list env this_ acc = - match Peek.token env with - | (T_EOF | T_ELLIPSIS | T_RPAREN) as t -> - let rest = - if t = T_ELLIPSIS then - let rest = - with_loc - (fun env -> - let leading = Peek.comments env in - Expect.token env T_ELLIPSIS; - { - Type.Function.RestParam.argument = param env; - comments = Flow_ast_utils.mk_comments_opt ~leading (); - }) - env - in - Some rest - else - None - in - { Ast.Type.Function.Params.params = List.rev acc; rest; this_; comments = None } - | T_IDENTIFIER { raw = "this"; _ } - when Peek.ith_token ~i:1 env == T_COLON || Peek.ith_token ~i:1 env == T_PLING -> - if this_ <> None || acc <> [] then error env Parse_error.ThisParamMustBeFirst; - let this_ = - with_loc - (fun env -> - let leading = Peek.comments env in - Eat.token env; - if Peek.token env == T_PLING then error env Parse_error.ThisParamMayNotBeOptional; - { - Type.Function.ThisParam.annot = annotation env; - comments = Flow_ast_utils.mk_comments_opt ~leading (); - }) - env - in - if Peek.token env <> T_RPAREN then Expect.token env T_COMMA; - param_list env (Some this_) acc - | _ -> - let acc = param env :: acc in - if Peek.token env <> T_RPAREN then Expect.token env T_COMMA; - param_list env this_ acc - in - (fun env -> param_list env None) - - and function_param_list env = - with_loc - (fun env -> - let leading = Peek.comments env in - Expect.token env T_LPAREN; - let params = function_param_list_without_parens env [] in - let internal = Peek.comments env in - Expect.token env T_RPAREN; - let trailing = Eat.trailing_comments env in - { - params with - Ast.Type.Function.Params.comments = - Flow_ast_utils.mk_comments_with_internal_opt ~leading ~trailing ~internal (); - }) - env - - and param_list_or_type env = - let leading = Peek.comments env in - Expect.token env T_LPAREN; - let ret = - let env = with_no_anon_function_type false env in - match Peek.token env with - | T_EOF - | T_ELLIPSIS -> - (* (... is definitely the beginning of a param list *) - ParamList (function_param_list_without_parens env []) - | T_RPAREN -> - (* () or is definitely a param list *) - ParamList - { Ast.Type.Function.Params.this_ = None; params = []; rest = None; comments = None } - | T_IDENTIFIER _ - | T_STATIC (* `static` is reserved in strict mode, but still an identifier *) -> - (* This could be a function parameter or a generic type *) - function_param_or_generic_type env - | token when is_primitive token -> - (* Don't know if this is (number) or (number: number). The first - * is a type, the second is a param. *) - (match Peek.ith_token ~i:1 env with - | T_PLING - | T_COLON -> - (* Ok this is definitely a parameter *) - ParamList (function_param_list_without_parens env []) - | _ -> Type (_type env)) - | _ -> - (* All params start with an identifier or `...` *) - Type (_type env) - in - (* Now that we allow anonymous parameters in function types, we need to - * disambiguate a little bit more *) - let ret = - match ret with - | ParamList _ -> ret - | Type _ when no_anon_function_type env -> ret - | Type t -> - (match Peek.token env with - | T_RPAREN -> - (* Reinterpret `(type) =>` as a ParamList *) - if Peek.ith_token ~i:1 env = T_ARROW then - let param = anonymous_function_param env t in - ParamList (function_param_list_without_parens env [param]) - else - Type t - | T_COMMA -> - (* Reinterpret `(type,` as a ParamList *) - Expect.token env T_COMMA; - let param = anonymous_function_param env t in - ParamList (function_param_list_without_parens env [param]) - | _ -> ret) - in - let internal = Peek.comments env in - Expect.token env T_RPAREN; - let trailing = Eat.trailing_comments env in - let ret = - match ret with - | ParamList params -> - ParamList - { - params with - Ast.Type.Function.Params.comments = - Flow_ast_utils.mk_comments_with_internal_opt ~leading ~trailing ~internal (); - } - | Type t -> Type (add_comments t leading trailing) - in - ret - - and function_param_or_generic_type env = - match Peek.ith_token ~i:1 env with - | T_PLING - (* optional param *) - | T_COLON -> - ParamList (function_param_list_without_parens env []) - | _ -> - let id = type_identifier env in - Type - (generic_type_with_identifier env id - |> postfix_with env - |> anon_function_without_parens_with env - |> intersection_with env - |> union_with env - ) - - 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) - | (_, 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 - - and function_with_params 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 = _type env in - Type.(Function { Function.params; return; tparams; comments = None })) - env - - and _object = - let methodish env start_loc tparams = - with_loc - ~start_loc - (fun env -> - let params = function_param_list env in - Expect.token env T_COLON; - let return = _type env in - { Type.Function.params; return; tparams; comments = None }) - env - in - let method_property env start_loc static key ~leading = - let key = object_key_remove_trailing env key in - let tparams = type_params_remove_trailing env (type_params env) in - let value = methodish env start_loc tparams in - let value = (fst value, Type.Function (snd value)) in - Type.Object.( - Property - ( fst value, - { - Property.key; - value = Property.Init value; - optional = false; - static = static <> None; - proto = false; - _method = true; - variance = None; - comments = Flow_ast_utils.mk_comments_opt ~leading (); - } - ) - ) - in - let call_property env start_loc static ~leading = - let prop = - with_loc - ~start_loc - (fun env -> - let start_loc = Peek.loc env in - let tparams = type_params_remove_trailing env (type_params env) in - let value = methodish env start_loc tparams in - Type.Object.CallProperty. - { - value; - static = static <> None; - comments = Flow_ast_utils.mk_comments_opt ~leading (); - } - ) - env - in - Type.Object.CallProperty prop - in - let init_property env start_loc ~variance ~static ~proto ~leading (key_loc, key) = - ignore proto; - if not (should_parse_types env) then error env Parse_error.UnexpectedTypeAnnotation; - let prop = - with_loc - ~start_loc - (fun env -> - let optional = Eat.maybe env T_PLING in - let value = - if Expect.token_maybe env T_COLON then - _type env - else - (key_loc, Type.Any None) - in - Type.Object.Property. - { - key; - value = Init value; - optional; - static = static <> None; - proto = proto <> None; - _method = false; - variance; - comments = Flow_ast_utils.mk_comments_opt ~leading (); - } - ) - env - in - Type.Object.Property prop - in - let getter_or_setter ~is_getter ~leading env start_loc static key = - let prop = - with_loc - ~start_loc - (fun env -> - let (key_loc, key) = key in - let key = object_key_remove_trailing env key in - let value = methodish env start_loc None in - let (_, { Type.Function.params; _ }) = value in - begin - match (is_getter, params) with - | (true, (_, { Type.Function.Params.this_ = Some _; _ })) -> - error_at env (key_loc, Parse_error.GetterMayNotHaveThisParam) - | (false, (_, { Type.Function.Params.this_ = Some _; _ })) -> - error_at env (key_loc, Parse_error.SetterMayNotHaveThisParam) - | ( true, - (_, { Type.Function.Params.params = []; rest = None; this_ = None; comments = _ }) - ) -> - () - | (false, (_, { Type.Function.Params.rest = Some _; _ })) -> - (* rest params don't make sense on a setter *) - error_at env (key_loc, Parse_error.SetterArity) - | (false, (_, { Type.Function.Params.params = [_]; _ })) -> () - | (true, _) -> error_at env (key_loc, Parse_error.GetterArity) - | (false, _) -> error_at env (key_loc, Parse_error.SetterArity) - end; - Type.Object.Property. - { - key; - value = - ( if is_getter then - Get value - else - Set value - ); - optional = false; - static = static <> None; - proto = false; - _method = false; - variance = None; - comments = Flow_ast_utils.mk_comments_opt ~leading (); - } - ) - env - in - Type.Object.Property prop - in - let indexer_property env start_loc static variance ~leading = - let indexer = - with_loc - ~start_loc - (fun env -> - let leading = leading @ Peek.comments env in - Expect.token env T_LBRACKET; - let id = - if Peek.ith_token ~i:1 env = T_COLON then ( - let id = identifier_name env in - Expect.token env T_COLON; - Some id - ) else - None - in - let key = _type env in - Expect.token env T_RBRACKET; - let trailing = Eat.trailing_comments env in - Expect.token env T_COLON; - let value = _type env in - { - Type.Object.Indexer.id; - key; - value; - static = static <> None; - variance; - comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing (); - }) - env - in - Type.Object.Indexer indexer - in - let internal_slot env start_loc static ~leading = - let islot = - with_loc - ~start_loc - (fun env -> - let leading = leading @ Peek.comments env in - Expect.token env T_LBRACKET; - Expect.token env T_LBRACKET; - let id = identifier_name env in - Expect.token env T_RBRACKET; - Expect.token env T_RBRACKET; - let (optional, _method, value, trailing) = - match Peek.token env with - | T_LESS_THAN - | T_LPAREN -> - let tparams = type_params_remove_trailing env (type_params env) in - let value = - let (fn_loc, fn) = methodish env start_loc tparams in - (fn_loc, Type.Function fn) - in - (false, true, value, []) - | _ -> - let optional = Eat.maybe env T_PLING in - let trailing = Eat.trailing_comments env in - Expect.token env T_COLON; - let value = _type env in - (optional, false, value, trailing) - in - { - Type.Object.InternalSlot.id; - value; - optional; - static = static <> None; - _method; - comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing (); - }) - env - in - Type.Object.InternalSlot islot - (* Expects the T_ELLIPSIS has already been eaten *) - in - let spread_property env start_loc ~leading = - let spread = - with_loc - ~start_loc - (fun env -> - { - Type.Object.SpreadProperty.argument = _type env; - comments = Flow_ast_utils.mk_comments_opt ~leading (); - }) - env - in - Type.Object.SpreadProperty spread - in - let semicolon exact env = - match Peek.token env with - | T_COMMA - | T_SEMICOLON -> - Eat.token env - | T_RCURLYBAR when exact -> () - | T_RCURLY when not exact -> () - | _ -> Expect.error env T_COMMA - in - let error_unexpected_variance env = function - | Some (loc, _) -> error_at env (loc, Parse_error.UnexpectedVariance) - | None -> () - in - let error_unexpected_proto env = function - | Some loc -> error_at env (loc, Parse_error.UnexpectedProto) - | None -> () - in - let error_invalid_property_name env is_class static key = - let is_static = static <> None in - let is_constructor = String.equal "constructor" in - let is_prototype = String.equal "prototype" in - match key with - | Expression.Object.Property.Identifier (loc, { Identifier.name; comments = _ }) - when is_class && (is_constructor name || (is_static && is_prototype name)) -> - error_at - env - ( loc, - Parse_error.InvalidClassMemberName - { name; static = is_static; method_ = false; private_ = false } - ) - | _ -> () - in - let rec properties - ~is_class ~allow_inexact ~allow_spread ~exact env ((props, inexact, internal) as acc) = - (* no `static ...A` *) - assert (not (is_class && allow_spread)); - - (* allow_inexact implies allow_spread *) - assert ((not allow_inexact) || allow_spread); - - let start_loc = Peek.loc env in - match Peek.token env with - | T_EOF -> (List.rev props, inexact, internal) - | T_RCURLYBAR when exact -> (List.rev props, inexact, internal) - | T_RCURLY when not exact -> (List.rev props, inexact, internal) - | T_ELLIPSIS when allow_spread -> - let leading = Peek.comments env in - Eat.token env; - begin - match Peek.token env with - | T_COMMA - | T_SEMICOLON - | T_RCURLY - | T_RCURLYBAR -> - semicolon exact env; - begin - match Peek.token env with - | T_RCURLY when allow_inexact -> (List.rev props, true, leading) - | T_RCURLYBAR -> - error_at env (start_loc, Parse_error.InexactInsideExact); - (List.rev props, inexact, internal) - | _ -> - error_at env (start_loc, Parse_error.UnexpectedExplicitInexactInObject); - properties ~is_class ~allow_inexact ~allow_spread ~exact env acc - end - | _ -> - let prop = spread_property env start_loc ~leading in - semicolon exact env; - properties - ~is_class - ~allow_inexact - ~allow_spread - ~exact - env - (prop :: props, inexact, internal) - end - (* In this case, allow_spread is false, so we may assume allow_inexact is false based on our - * assertion at the top of this function. Thus, any T_ELLIPSIS here is not allowed. - *) - | T_ELLIPSIS -> - Eat.token env; - begin - match Peek.token env with - | T_COMMA - | T_SEMICOLON - | T_RCURLY - | T_RCURLYBAR -> - error_at env (start_loc, Parse_error.InexactInsideNonObject); - semicolon exact env; - properties ~is_class ~allow_inexact ~allow_spread ~exact env acc - | _ -> - error_list env (Peek.errors env); - error_at env (start_loc, Parse_error.UnexpectedSpreadType); - - (* It's likely the user is trying to spread something here, so we can - * eat what they try to spread to try to continue parsing the remaining - * properties. - *) - Eat.token env; - semicolon exact env; - properties ~is_class ~allow_inexact ~allow_spread ~exact env acc - end - | _ -> - let prop = - property - env - start_loc - ~is_class - ~allow_static:is_class - ~allow_proto:is_class - ~variance:None - ~static:None - ~proto:None - ~leading:[] - in - semicolon exact env; - properties - ~is_class - ~allow_inexact - ~allow_spread - ~exact - env - (prop :: props, inexact, internal) - and property - env ~is_class ~allow_static ~allow_proto ~variance ~static ~proto ~leading start_loc = - match Peek.token env with - | T_PLUS - | T_MINUS - when variance = None -> - let variance = maybe_variance env in - property - env - ~is_class - ~allow_static:false - ~allow_proto:false - ~variance - ~static - ~proto - ~leading - start_loc - | T_STATIC when allow_static -> - assert (variance = None); - - (* if we parsed variance, allow_static = false *) - let static = Some (Peek.loc env) in - let leading = leading @ Peek.comments env in - Eat.token env; - property - env - ~is_class - ~allow_static:false - ~allow_proto:false - ~variance - ~static - ~proto - ~leading - start_loc - | T_IDENTIFIER { raw = "proto"; _ } when allow_proto -> - assert (variance = None); - - (* if we parsed variance, allow_proto = false *) - let proto = Some (Peek.loc env) in - let leading = leading @ Peek.comments env in - Eat.token env; - property - env - ~is_class - ~allow_static:false - ~allow_proto:false - ~variance - ~static - ~proto - ~leading - start_loc - | T_LBRACKET -> - error_unexpected_proto env proto; - (match Peek.ith_token ~i:1 env with - | T_LBRACKET -> - error_unexpected_variance env variance; - internal_slot env start_loc static ~leading - | _ -> indexer_property env start_loc static variance ~leading) - | T_LESS_THAN - | T_LPAREN -> - (* Note that `static(): void` is a static callable property if we - successfully parsed the static modifier above. *) - error_unexpected_proto env proto; - error_unexpected_variance env variance; - call_property env start_loc static ~leading - | token -> - (match (static, proto, token) with - | (Some _, Some _, _) -> failwith "Can not have both `static` and `proto`" - | (Some static_loc, None, (T_PLING | T_COLON)) -> - (* We speculatively parsed `static` as a static modifier, but now - that we've parsed the next token, we changed our minds and want - to parse `static` as the key of a named property. *) - let key = - Expression.Object.Property.Identifier - (Flow_ast_utils.ident_of_source - (static_loc, "static") - ?comments:(Flow_ast_utils.mk_comments_opt ~leading ()) - ) - in - let static = None in - init_property env start_loc ~variance ~static ~proto ~leading:[] (static_loc, key) - | (None, Some proto_loc, (T_PLING | T_COLON)) -> - (* We speculatively parsed `proto` as a proto modifier, but now - that we've parsed the next token, we changed our minds and want - to parse `proto` as the key of a named property. *) - let key = - Expression.Object.Property.Identifier - (Flow_ast_utils.ident_of_source - (proto_loc, "proto") - ?comments:(Flow_ast_utils.mk_comments_opt ~leading ()) - ) - in - let proto = None in - init_property env start_loc ~variance ~static ~proto ~leading:[] (proto_loc, key) - | _ -> - let object_key env = - Eat.push_lex_mode env Lex_mode.NORMAL; - let result = Parse.object_key env in - Eat.pop_lex_mode env; - result - in - let leading_key = Peek.comments env in - (match object_key env with - | ( key_loc, - ( Expression.Object.Property.Identifier - (_, { Identifier.name = ("get" | "set") as name; comments = _ }) as key - ) - ) -> - begin - match Peek.token env with - | T_LESS_THAN - | T_LPAREN -> - error_unexpected_proto env proto; - error_unexpected_variance env variance; - method_property env start_loc static key ~leading - | T_COLON - | T_PLING -> - init_property env start_loc ~variance ~static ~proto ~leading (key_loc, key) - | _ -> - ignore (object_key_remove_trailing env key); - let key = object_key env in - let is_getter = name = "get" in - let leading = leading @ leading_key in - error_unexpected_proto env proto; - error_unexpected_variance env variance; - getter_or_setter ~is_getter ~leading env start_loc static key - end - | (key_loc, key) -> - begin - match Peek.token env with - | T_LESS_THAN - | T_LPAREN -> - error_unexpected_proto env proto; - error_unexpected_variance env variance; - method_property env start_loc static key ~leading - | _ -> - error_invalid_property_name env is_class static key; - init_property env start_loc ~variance ~static ~proto ~leading (key_loc, key) - end)) - in - fun ~is_class ~allow_exact ~allow_spread env -> - let exact = allow_exact && Peek.token env = T_LCURLYBAR in - let allow_inexact = allow_exact && not exact in - with_loc - (fun env -> - let leading = Peek.comments env in - Expect.token - env - ( if exact then - T_LCURLYBAR - else - T_LCURLY - ); - let (properties, inexact, internal) = - let env = with_no_anon_function_type false env in - properties ~is_class ~allow_inexact ~exact ~allow_spread env ([], false, []) - in - let internal = internal @ Peek.comments env in - Expect.token - env - ( if exact then - T_RCURLYBAR - else - T_RCURLY - ); - let trailing = Eat.trailing_comments env in - - (* inexact = true iff `...` was used to indicate inexactnes *) - { - Type.Object.exact; - properties; - inexact; - comments = Flow_ast_utils.mk_comments_with_internal_opt ~leading ~trailing ~internal (); - }) - env - - and interface_helper = - let rec supers env acc = - let super = generic env in - let acc = super :: acc in - match Peek.token env with - | T_COMMA -> - Expect.token env T_COMMA; - supers env acc - | _ -> List.rev acc - in - fun env -> - let extends = - if Peek.token env = T_EXTENDS then ( - Expect.token env T_EXTENDS; - let extends = supers env [] in - generic_type_list_remove_trailing env extends - ) else - [] - in - let body = _object env ~allow_exact:false ~allow_spread:false ~is_class:false in - (extends, body) - - and type_identifier env = - let (loc, { Identifier.name; comments }) = identifier_name env in - if is_reserved_type name then error_at env (loc, Parse_error.UnexpectedReservedType); - (loc, { Identifier.name; comments }) - - and bounded_type env = - with_loc - (fun env -> - let name = type_identifier env in - let bound = - if Peek.token env = T_COLON then - Ast.Type.Available (annotation env) - else - Ast.Type.Missing (Peek.loc_skip_lookahead env) - in - (name, bound)) - env - - and type_params = - let rec params env ~require_default acc = - Type.TypeParam.( - let (loc, (variance, name, bound, default, require_default)) = - with_loc - (fun env -> - let variance = maybe_variance env in - let (loc, (name, bound)) = bounded_type env in - let (default, require_default) = - match Peek.token env with - | T_ASSIGN -> - Eat.token env; - (Some (_type env), true) - | _ -> - if require_default then error_at env (loc, Parse_error.MissingTypeParamDefault); - (None, require_default) - in - (variance, name, bound, default, require_default)) - env - in - let param = (loc, { name; bound; variance; default }) in - let acc = param :: acc in - match Peek.token env with - | T_EOF - | T_GREATER_THAN -> - List.rev acc - | _ -> - Expect.token env T_COMMA; - if Peek.token env = T_GREATER_THAN then - List.rev acc - else - params env ~require_default acc - ) - in - fun env -> - if Peek.token env = T_LESS_THAN then ( - if not (should_parse_types env) then error env Parse_error.UnexpectedTypeAnnotation; - Some - (with_loc - (fun env -> - let leading = Peek.comments env in - Expect.token env T_LESS_THAN; - let params = params env ~require_default:false [] in - let internal = Peek.comments env in - Expect.token env T_GREATER_THAN; - let trailing = Eat.trailing_comments env in - { - Type.TypeParams.params; - comments = - Flow_ast_utils.mk_comments_with_internal_opt ~leading ~trailing ~internal (); - }) - env - ) - ) else - None - - and type_args = - let rec args env acc = - match Peek.token env with - | T_EOF - | T_GREATER_THAN -> - List.rev acc - | _ -> - let acc = _type env :: acc in - if Peek.token env <> T_GREATER_THAN then Expect.token env T_COMMA; - args env acc - in - fun env -> - if Peek.token env = T_LESS_THAN then - Some - (with_loc - (fun env -> - let leading = Peek.comments env in - Expect.token env T_LESS_THAN; - let env = with_no_anon_function_type false env in - let arguments = args env [] in - let internal = Peek.comments env in - Expect.token env T_GREATER_THAN; - let trailing = Eat.trailing_comments env in - { - Type.TypeArgs.arguments; - comments = - Flow_ast_utils.mk_comments_with_internal_opt ~leading ~trailing ~internal (); - }) - env - ) - else - None - - and generic env = raw_generic_with_identifier env (type_identifier env) - - and raw_generic_with_identifier = - let rec identifier env (q_loc, qualification) = - if Peek.token env = T_PERIOD && Peek.ith_is_type_identifier ~i:1 env then - let (loc, q) = - with_loc - ~start_loc:q_loc - (fun env -> - Expect.token env T_PERIOD; - let id = type_identifier env in - { Type.Generic.Identifier.qualification; id }) - env - in - let qualification = Type.Generic.Identifier.Qualified (loc, q) in - identifier env (loc, qualification) - else - (q_loc, qualification) - in - fun env id -> - with_loc - ~start_loc:(fst id) - (fun env -> - let id = (fst id, Type.Generic.Identifier.Unqualified id) in - let id = - let (_id_loc, id) = identifier env id in - if Peek.token env <> T_LESS_THAN then - id - else - let { remove_trailing; _ } = trailing_and_remover env in - remove_trailing id (fun remover id -> remover#generic_identifier_type id) - in - let targs = type_args env in - { Type.Generic.id; targs; comments = None }) - env - - and generic_type_with_identifier env id = - let (loc, generic) = raw_generic_with_identifier env id in - (loc, Type.Generic generic) - - and annotation_opt env = - match Peek.token env with - | T_COLON -> Type.Available (annotation env) - | _ -> Type.Missing (Peek.loc_skip_lookahead env) - - and add_comments (loc, t) leading trailing = - 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 - let open Ast.Type in - ( loc, - match t with - | Any comments -> Any (merge_comments comments) - | Mixed comments -> Mixed (merge_comments comments) - | Empty comments -> Empty (merge_comments comments) - | Void comments -> Void (merge_comments comments) - | Null comments -> Null (merge_comments comments) - | Number comments -> Number (merge_comments comments) - | BigInt comments -> BigInt (merge_comments comments) - | String comments -> String (merge_comments comments) - | Boolean comments -> Boolean (merge_comments comments) - | Symbol comments -> Symbol (merge_comments comments) - | Exists comments -> Exists (merge_comments comments) - | Nullable ({ Nullable.comments; _ } as t) -> - Nullable { t with Nullable.comments = merge_comments comments } - | Function ({ Function.comments; _ } as t) -> - Function { t with Function.comments = merge_comments comments } - | Object ({ Object.comments; _ } as t) -> - Object { t with Object.comments = merge_comments_with_internal comments } - | Interface ({ Interface.comments; _ } as t) -> - Interface { t with Interface.comments = merge_comments comments } - | Array ({ Array.comments; _ } as t) -> - Array { t with Array.comments = merge_comments comments } - | Generic ({ Generic.comments; _ } as t) -> - Generic { t with Generic.comments = merge_comments comments } - | IndexedAccess ({ IndexedAccess.comments; _ } as t) -> - IndexedAccess { t with IndexedAccess.comments = merge_comments comments } - | OptionalIndexedAccess - { - OptionalIndexedAccess.indexed_access = { IndexedAccess.comments; _ } as indexed_access; - optional; - } -> - OptionalIndexedAccess - { - OptionalIndexedAccess.indexed_access = - { indexed_access with IndexedAccess.comments = merge_comments comments }; - optional; - } - | Union ({ Union.comments; _ } as t) -> - Union { t with Union.comments = merge_comments comments } - | Intersection ({ Intersection.comments; _ } as t) -> - Intersection { t with Intersection.comments = merge_comments comments } - | Typeof ({ Typeof.comments; _ } as t) -> - Typeof { t with Typeof.comments = merge_comments comments } - | Tuple ({ Tuple.comments; _ } as t) -> - Tuple { t with Tuple.comments = merge_comments comments } - | StringLiteral ({ StringLiteral.comments; _ } as t) -> - StringLiteral { t with StringLiteral.comments = merge_comments comments } - | NumberLiteral ({ NumberLiteral.comments; _ } as t) -> - NumberLiteral { t with NumberLiteral.comments = merge_comments comments } - | BigIntLiteral ({ BigIntLiteral.comments; _ } as t) -> - BigIntLiteral { t with BigIntLiteral.comments = merge_comments comments } - | BooleanLiteral ({ BooleanLiteral.comments; _ } as t) -> - BooleanLiteral { t with BooleanLiteral.comments = merge_comments comments } - ) - - let predicate = - with_loc (fun env -> - let open Ast.Type.Predicate in - let leading = Peek.comments env in - Expect.token env T_CHECKS; - if Peek.token env = T_LPAREN then ( - let leading = leading @ Peek.comments env in - Expect.token env T_LPAREN; - Eat.push_lex_mode env Lex_mode.NORMAL; - let exp = Parse.conditional env in - Eat.pop_lex_mode env; - Expect.token env T_RPAREN; - let trailing = Eat.trailing_comments env in - { kind = Declared exp; comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing () } - ) else - let trailing = Eat.trailing_comments env in - { - kind = Ast.Type.Predicate.Inferred; - comments = Flow_ast_utils.mk_comments_opt ~leading ~trailing (); - } - ) - - let predicate_opt env = - let env = with_no_anon_function_type false env in - match Peek.token env with - | T_CHECKS -> Some (predicate env) - | _ -> None - - let annotation_and_predicate_opt env = - let open Ast.Type in - match (Peek.token env, Peek.ith_token ~i:1 env) with - | (T_COLON, T_CHECKS) -> - Expect.token env T_COLON; - (Missing (Peek.loc_skip_lookahead env), predicate_opt env) - | (T_COLON, _) -> - let annotation = - let annotation = annotation_opt env in - if Peek.token env = T_CHECKS then - type_annotation_hint_remove_trailing env annotation - else - annotation - in - let predicate = predicate_opt env in - (annotation, predicate) - | _ -> (Missing (Peek.loc_skip_lookahead env), None) - - let wrap f env = - let env = env |> with_strict true in - Eat.push_lex_mode env Lex_mode.TYPE; - let ret = f env in - Eat.pop_lex_mode env; - ret - - let _type = wrap _type - - let type_identifier = wrap type_identifier - - let type_params = wrap type_params - - let type_args = wrap type_args - - let _object ~is_class env = wrap (_object ~is_class ~allow_exact:false ~allow_spread:false) env - - let interface_helper = wrap interface_helper - - let function_param_list = wrap function_param_list - - let annotation = wrap annotation - - let annotation_opt = wrap annotation_opt - - let predicate_opt = wrap predicate_opt - - let annotation_and_predicate_opt = wrap annotation_and_predicate_opt - - let generic = wrap generic -end diff --git a/compiler/js_parser/wtf8.ml b/compiler/js_parser/wtf8.ml deleted file mode 100644 index be7d3718fd..0000000000 --- a/compiler/js_parser/wtf8.ml +++ /dev/null @@ -1,103 +0,0 @@ -(** - * Copyright (c) 2017-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - *) - -(* - * WTF-8 is a superset of UTF-8 that allows unpaired surrogates. - * - * From ES6 6.1.4, "The String Type": - * - * Where ECMAScript operations interpret String values, each element is - * interpreted as a single UTF-16 code unit. However, ECMAScript does not - * place any restrictions or requirements on the sequence of code units in - * a String value, so they may be ill-formed when interpreted as UTF-16 code - * unit sequences. Operations that do not interpret String contents treat - * them as sequences of undifferentiated 16-bit unsigned integers. - * - * If we try to encode these ill-formed code units into UTF-8, we similarly - * get ill-formed UTF-8. WTF-8 is a fun name for that encoding. - * - * https://simonsapin.github.io/wtf-8/ - *) - -type codepoint = - | Point of int - | Malformed - -type 'a folder = 'a -> int -> codepoint -> 'a - -(* WTF-8 is a variable length encoding. The first byte in each codepoint - determines how many other bytes follow. *) -let needed_bytes c = - if 0x00 <= c && c <= 0x7F then 1 else - if 0xC2 <= c && c <= 0xDF then 2 else - if 0xE0 <= c && c <= 0xEF then 3 else - if 0xF0 <= c && c <= 0xF4 then 4 else - 0 - -let unsafe_char s i = Char.code (Bytes.unsafe_get s i) - -let codepoint s i = function - | 1 -> unsafe_char s i - | 2 -> - let b0 = unsafe_char s i in - let b1 = unsafe_char s (i + 1) in - ((b0 land 0x1F) lsl 6) lor (b1 land 0x3F) - | 3 -> - let b0 = unsafe_char s (i) in - let b1 = unsafe_char s (i + 1) in - let b2 = unsafe_char s (i + 2) in - ((b0 land 0x0F) lsl 12) lor - ((b1 land 0x3F) lsl 6) lor - (b2 land 0x3F) - | 4 -> - let b0 = unsafe_char s (i) in - let b1 = unsafe_char s (i + 1) in - let b2 = unsafe_char s (i + 2) in - let b3 = unsafe_char s (i + 3) in - ((b0 land 0x07) lsl 18) lor - ((b1 land 0x3F) lsl 12) lor - ((b2 land 0x3F) lsl 6) lor - (b3 land 0x3F) - | _ -> assert false - -(* Fold over the WTF-8 code units in a string *) -let fold_wtf_8 ?(pos = 0) ?len f acc s = - let rec loop acc f s i l = - if i = l then acc else - let need = needed_bytes (unsafe_char s i) in - if need = 0 then (loop [@tailcall]) (f acc i Malformed) f s (i + 1) l else - let rem = l - i in - if rem < need then f acc i Malformed else - (loop [@tailcall]) (f acc i (Point (codepoint s i need))) f s (i + need) l - in - let len = match len with - | None -> String.length s - pos - | Some l -> l - in - loop acc f (Bytes.unsafe_of_string s) pos len - -(* Add a UTF-16 code unit to a buffer, encoded in WTF-8. *) -let add_wtf_8 buf code = - let[@inline] w byte = Buffer.add_char buf (Char.unsafe_chr byte) in - if code >= 0x10000 then begin - (* 4 bytes *) - w (0xf0 lor (code lsr 18)); - w (0x80 lor ((code lsr 12) land 0x3F)); - w (0x80 lor ((code lsr 6) land 0x3F)); - w (0x80 lor (code land 0x3F)) - end else if code >= 0x800 then begin - (* 3 bytes *) - w (0xe0 lor (code lsr 12)); - w (0x80 lor ((code lsr 6) land 0x3F)); - w (0x80 lor (code land 0x3F)) - end else if code >= 0x80 then begin - (* 2 bytes *) - w (0xc0 lor (code lsr 6)); - w (0x80 lor (code land 0x3F)) - end else - (* 1 byte *) - w code diff --git a/compiler/js_parser/wtf8.mli b/compiler/js_parser/wtf8.mli deleted file mode 100644 index 8aac2e983f..0000000000 --- a/compiler/js_parser/wtf8.mli +++ /dev/null @@ -1,19 +0,0 @@ -(* - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - *) - -[@@@ocaml.text -"\n * Copyright (c) 2017-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n "] - -type codepoint = - | Point of int - | Malformed - -type 'a folder = 'a -> int -> codepoint -> 'a - -val fold_wtf_8 : ?pos:int -> ?len:int -> 'a folder -> 'a -> string -> 'a - -val add_wtf_8 : Buffer.t -> int -> unit diff --git a/compiler/ml/ast_payload.ml b/compiler/ml/ast_payload.ml index a2142f3af0..66317e1c0f 100644 --- a/compiler/ml/ast_payload.ml +++ b/compiler/ml/ast_payload.ml @@ -147,11 +147,13 @@ let raw_as_string_exp_exn ~(kind : Js_raw_info.raw_kind) ?is_function (x : t) : (match kind with | Raw_re | Raw_exp -> let ((_loc, e) as prog), errors = - Parser_flow.parse_expression (Parser_env.init_env None str) false + let open Parser_flow in + let env = Parser_env.init_env None str in + do_parse env Parse.expression false in (if kind = Raw_re then match e with - | Literal {value = RegExp _} -> () + | RegExpLiteral _ -> () | _ -> Location.raise_errorf ~loc "Syntax error: a valid JS regex literal expected"); diff --git a/compiler/ml/classify_function.ml b/compiler/ml/classify_function.ml index 5565b230bc..1a7b0f4f5e 100644 --- a/compiler/ml/classify_function.ml +++ b/compiler/ml/classify_function.ml @@ -24,7 +24,10 @@ let rec is_obj_literal (x : _ Flow_ast.Expression.t) : bool = match snd x with - | Identifier (_, {name = "undefined"}) | Literal _ -> true + | Identifier (_, {name = "undefined"}) + | StringLiteral _ | BooleanLiteral _ | NullLiteral _ | NumberLiteral _ + | BigIntLiteral _ | RegExpLiteral _ | ModuleRefLiteral _ -> + true | Unary {operator = Minus; argument} -> is_obj_literal argument | Object {properties} -> Ext_list.for_all properties is_literal_kv | Array {elements} -> @@ -61,7 +64,13 @@ let classify_exp (prog : _ Flow_ast.Expression.t) : Js_raw_info.exp = predicate = None; } ) -> Js_function {arity = List.length params; arrow = true} - | _, Literal {comments} -> + | _, StringLiteral {comments} + | _, BooleanLiteral {comments} + | _, NullLiteral comments + | _, NumberLiteral {comments} + | _, BigIntLiteral {comments} + | _, RegExpLiteral {comments} + | _, ModuleRefLiteral {comments} -> let comment = match comments with | None -> None @@ -84,7 +93,9 @@ let classify_exp (prog : _ Flow_ast.Expression.t) : Js_raw_info.exp = let classify ?(check : (Location.t * int) option) (prog : string) : Js_raw_info.exp = let prog, errors = - Parser_flow.parse_expression (Parser_env.init_env None prog) false + let open Parser_flow in + let env = Parser_env.init_env None prog in + do_parse env Parse.expression false in match (check, errors) with | Some (loc, offset), _ :: _ -> diff --git a/compiler/ml/dune b/compiler/ml/dune index c260df229a..f4dde0ef5b 100644 --- a/compiler/ml/dune +++ b/compiler/ml/dune @@ -6,4 +6,4 @@ (run %{bin:cppo} %{env:CPPO_FLAGS=} %{input-file}))) (flags (:standard -w +a-4-42-40-41-44-45-9-48-67-70)) - (libraries ext js_parser)) + (libraries ext flow_parser)) diff --git a/rescript.opam b/rescript.opam index 377f144adf..fe8dd954c8 100644 --- a/rescript.opam +++ b/rescript.opam @@ -24,6 +24,7 @@ depends: [ "ocaml" {>= "4.14"} "cppo" {= "1.8.0"} "dune" {>= "3.17"} + "flow_parser" {= "0.267.0"} "ocamlformat" {with-test & = "0.27.0"} "yojson" {with-test & = "2.2.2"} "ounit2" {with-test & = "2.2.7"} @@ -35,3 +36,6 @@ depends: [ "js_of_ocaml-ppx" {os != "win32" & with-test & = "6.0.1"} "wasm_of_ocaml-compiler" {os != "win32" & with-test & = "6.0.1"} ] +pin-depends: [ + ["flow_parser.0.267.0" "git+https://github.com/rescript-lang/flow.git#9ea4062c0b7e037415c4413a7634c459ebd5c31b"] +] diff --git a/rescript.opam.template b/rescript.opam.template index be3ee9d345..e0345025a8 100644 --- a/rescript.opam.template +++ b/rescript.opam.template @@ -2,6 +2,7 @@ depends: [ "ocaml" {>= "4.14"} "cppo" {= "1.8.0"} "dune" {>= "3.17"} + "flow_parser" {= "0.267.0"} "ocamlformat" {with-test & = "0.27.0"} "yojson" {with-test & = "2.2.2"} "ounit2" {with-test & = "2.2.7"} @@ -13,3 +14,6 @@ depends: [ "js_of_ocaml-ppx" {os != "win32" & with-test & = "6.0.1"} "wasm_of_ocaml-compiler" {os != "win32" & with-test & = "6.0.1"} ] +pin-depends: [ + ["flow_parser.0.267.0" "git+https://github.com/rescript-lang/flow.git#9ea4062c0b7e037415c4413a7634c459ebd5c31b"] +]