From bbeddaa6f7ecf3b720615afb24c7a90c1d9d692a Mon Sep 17 00:00:00 2001 From: IWANABETHATGUY Date: Sun, 8 May 2022 19:09:27 +0800 Subject: [PATCH 01/22] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20init?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/rome_js_formatter/src/format.rs | 5 + .../rome_js_formatter/src/ts/bindings/mod.rs | 1 + .../ts/bindings/type_parameter_modifier.rs | 17 + crates/rome_js_parser/src/lexer/mod.rs | 1 + .../src/syntax/typescript/types.rs | 102 +++ .../err/ts_constructor_type_parameters.rast | 6 +- .../err/ts_declare_function_with_body.rast | 6 +- .../err/ts_getter_setter_type_parameters.rast | 12 +- .../err/ts_object_getter_type_parameters.rast | 6 +- .../err/ts_object_setter_type_parameters.rast | 6 +- .../err/ts_type_parameters_incomplete.rast | 6 +- .../inline/err/type_parameter_modifier.rast | 761 ++++++++++++++++++ .../inline/err/type_parameter_modifier.ts | 8 + .../ok/ts_arrow_function_type_parameters.rast | 34 +- .../test_data/inline/ok/ts_as_assignment.rast | 6 +- .../ok/ts_call_expr_with_type_arguments.rast | 30 +- .../inline/ok/ts_call_signature_member.rast | 12 +- .../inline/ok/ts_class_type_parameters.rast | 18 +- ...s_conditional_type_call_signature_lhs.rast | 6 +- .../ok/ts_construct_signature_member.rast | 12 +- .../inline/ok/ts_constructor_type.rast | 24 +- .../inline/ok/ts_declare_function.rast | 18 +- .../inline/ok/ts_default_type_clause.rast | 16 +- .../inline/ok/ts_function_statement.rast | 22 +- .../test_data/inline/ok/ts_function_type.rast | 12 +- .../ok/ts_interface_extends_clause.rast | 6 +- .../test_data/inline/ok/ts_mapped_type.rast | 24 +- .../inline/ok/ts_method_class_member.rast | 20 +- .../ok/ts_method_object_member_body.rast | 12 +- .../inline/ok/ts_new_with_type_arguments.rast | 18 +- .../inline/ok/ts_optional_chain_call.rast | 12 +- ...s_property_or_method_signature_member.rast | 12 +- .../inline/ok/ts_template_literal_type.rast | 8 +- .../ok/ts_type_arguments_left_shift.rast | 12 +- .../inline/ok/ts_type_constraint_clause.rast | 16 +- .../inline/ok/ts_type_parameters.rast | 24 +- .../inline/ok/tsx_type_arguments.rast | 36 +- .../inline/ok/type_parameter_modifier.rast | 581 +++++++++++++ crates/rome_js_syntax/src/generated/kind.rs | 6 +- crates/rome_js_syntax/src/generated/macros.rs | 4 + crates/rome_js_syntax/src/generated/nodes.rs | 81 +- .../src/generated/syntax_factory.rs | 35 +- xtask/codegen/js.ungram | 5 + xtask/codegen/src/kinds_src.rs | 2 + 44 files changed, 1900 insertions(+), 161 deletions(-) create mode 100644 crates/rome_js_formatter/src/ts/bindings/type_parameter_modifier.rs create mode 100644 crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.rast create mode 100644 crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.ts create mode 100644 crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.rast diff --git a/crates/rome_js_formatter/src/format.rs b/crates/rome_js_formatter/src/format.rs index 5700c5d629a..bb4d590c07a 100644 --- a/crates/rome_js_formatter/src/format.rs +++ b/crates/rome_js_formatter/src/format.rs @@ -1152,6 +1152,11 @@ impl Format for rome_js_syntax::TsTypeParameterName { self.format_node(formatter) } } +impl Format for rome_js_syntax::TsTypeParameterModifier { + fn format(&self, formatter: &Formatter) -> FormatResult { + self.format_node(formatter) + } +} impl Format for rome_js_syntax::TsPredicateReturnType { fn format(&self, formatter: &Formatter) -> FormatResult { self.format_node(formatter) diff --git a/crates/rome_js_formatter/src/ts/bindings/mod.rs b/crates/rome_js_formatter/src/ts/bindings/mod.rs index 06e7985c8dd..8a1b24886c8 100644 --- a/crates/rome_js_formatter/src/ts/bindings/mod.rs +++ b/crates/rome_js_formatter/src/ts/bindings/mod.rs @@ -6,3 +6,4 @@ mod property_parameter; mod this_parameter; mod type_parameter; mod type_parameters; +mod type_parameter_modifier; \ No newline at end of file diff --git a/crates/rome_js_formatter/src/ts/bindings/type_parameter_modifier.rs b/crates/rome_js_formatter/src/ts/bindings/type_parameter_modifier.rs new file mode 100644 index 00000000000..4b032e03f98 --- /dev/null +++ b/crates/rome_js_formatter/src/ts/bindings/type_parameter_modifier.rs @@ -0,0 +1,17 @@ +use crate::format_traits::FormatOptional; +use crate::{format_elements, space_token, Format, FormatElement, FormatNode, Formatter}; +use rome_formatter::{empty_element, FormatResult}; +use rome_js_syntax::{TsTypeParameterModifier, TsTypeParameterModifierFields}; + +impl FormatNode for TsTypeParameterModifier { + fn format_fields(&self, formatter: &Formatter) -> FormatResult { + let TsTypeParameterModifierFields { + in_token, + out_token, + } = self.as_fields(); + Ok(format_elements![ + in_token.format_or_empty(formatter)?, + out_token.format_or_empty(formatter)? + ]) + } +} diff --git a/crates/rome_js_parser/src/lexer/mod.rs b/crates/rome_js_parser/src/lexer/mod.rs index 535874241a2..2206180ca71 100644 --- a/crates/rome_js_parser/src/lexer/mod.rs +++ b/crates/rome_js_parser/src/lexer/mod.rs @@ -1124,6 +1124,7 @@ impl<'src> Lexer<'src> { b"bigint" => BIGINT_KW, b"override" => OVERRIDE_KW, b"of" => OF_KW, + b"out" => OUT_KW, _ => T![ident], } } diff --git a/crates/rome_js_parser/src/syntax/typescript/types.rs b/crates/rome_js_parser/src/syntax/typescript/types.rs index 2594c95a86c..61f955c286d 100644 --- a/crates/rome_js_parser/src/syntax/typescript/types.rs +++ b/crates/rome_js_parser/src/syntax/typescript/types.rs @@ -85,7 +85,13 @@ fn parse_ts_call_signature(p: &mut Parser) { parse_ts_return_type_annotation(p).ok(); } +/// in current context, out keyword we count as identifier fn parse_ts_type_parameter_name(p: &mut Parser) -> ParsedSyntax { + if p.at(T![out]) { + let m = p.start(); + p.bump_remap(T![ident]); + return Present(m.complete(p, TS_TYPE_PARAMETER_NAME)); + } parse_identifier(p, TS_TYPE_PARAMETER_NAME) } @@ -146,6 +152,33 @@ impl ParseSeparatedList for TsTypeParameterList { } } +// test_err ts type_parameter_modifier +// type Foo = T +// type Foo = T +// type Foo = T +// type Foo = T +// type Foo = T +// type Foo = [X, Y] +// type Foo = [X, Y] +// type Foo = [X, Y] +fn parse_ts_type_parameter_modifier(p: &mut Parser) -> ParsedSyntax { + let m = p.start(); + let mut has_any = false; + if p.at(T![in]) { + p.expect(T![in]); + has_any = true; + } + if p.at(T![out]) { + p.expect(T![out]); + has_any = true; + } + if !has_any { + m.abandon(p); + return Absent; + } + Present(m.complete(p, TS_TYPE_PARAMETER_MODIFIER)) +} + fn parse_ts_type_parameter(p: &mut Parser) -> ParsedSyntax { parse_ts_type_parameter_name(p).map(|name| { let m = name.precede(p); @@ -1344,3 +1377,72 @@ fn parse_ts_type_member_semi(p: &mut Parser) { p.error(err); } } + +// TODO: finish all this testing + +// expectPrintedTS(t, "class Foo {}", "class Foo {\n}\n") +// expectPrintedTS(t, "class Foo {}", "class Foo {\n}\n") +// expectPrintedTS(t, "export default class Foo {}", "export default class Foo {\n}\n") +// expectPrintedTS(t, "export default class Foo {}", "export default class Foo {\n}\n") +// expectPrintedTS(t, "export default class {}", "export default class {\n}\n") +// expectPrintedTS(t, "export default class {}", "export default class {\n}\n") +// expectPrintedTS(t, "interface Foo {}", "") +// expectPrintedTS(t, "interface Foo {}", "") +// expectPrintedTS(t, "declare class Foo {}", "") +// expectPrintedTS(t, "declare class Foo {}", "") +// expectPrintedTS(t, "declare interface Foo {}", "") +// expectPrintedTS(t, "declare interface Foo {}", "") + +// expectParseErrorTS(t, "type Foo = T", ": ERROR: Expected identifier but found \"i\\\\u006E\"\n") +// expectParseErrorTS(t, "type Foo = T", ": ERROR: Expected \">\" but found \"T\"\n") +// expectParseErrorTS(t, "type Foo = T", ": ERROR: The modifier \"in\" is not valid here:\n: ERROR: Expected identifier but found \">\"\n") +// expectParseErrorTS(t, "type Foo = T", ": ERROR: The modifier \"in\" is not valid here:\n: ERROR: Expected identifier but found \">\"\n") +// expectParseErrorTS(t, "type Foo = T", ": ERROR: The modifier \"in\" is not valid here:\n") +// expectParseErrorTS(t, "type Foo = T", ": ERROR: Expected \">\" but found \"T\"\n") +// expectParseErrorTS(t, "type Foo = T", ": ERROR: The modifier \"in\" is not valid here:\n") +// expectParseErrorTS(t, "type Foo = T", ": ERROR: The modifier \"out\" is not valid here:\n") +// expectParseErrorTS(t, "function foo() {}", ": ERROR: The modifier \"in\" is not valid here:\n") +// expectParseErrorTS(t, "function foo() {}", ": ERROR: The modifier \"out\" is not valid here:\n") +// expectParseErrorTS(t, "export default function foo() {}", ": ERROR: The modifier \"in\" is not valid here:\n") +// expectParseErrorTS(t, "export default function foo() {}", ": ERROR: The modifier \"out\" is not valid here:\n") +// expectParseErrorTS(t, "export default function () {}", ": ERROR: The modifier \"in\" is not valid here:\n") +// expectParseErrorTS(t, "export default function () {}", ": ERROR: The modifier \"out\" is not valid here:\n") +// expectParseErrorTS(t, "let foo: Foo", ": ERROR: Unexpected \"in\"\n") +// expectParseErrorTS(t, "let foo: Foo", ": ERROR: Expected \">\" but found \"T\"\n") +// expectParseErrorTS(t, "declare function foo()", ": ERROR: The modifier \"in\" is not valid here:\n") +// expectParseErrorTS(t, "declare function foo()", ": ERROR: The modifier \"out\" is not valid here:\n") +// expectParseErrorTS(t, "declare let foo: Foo", ": ERROR: Unexpected \"in\"\n") +// expectParseErrorTS(t, "declare let foo: Foo", ": ERROR: Expected \">\" but found \"T\"\n") +// expectParseErrorTS(t, "Foo = class {}", ": ERROR: The modifier \"in\" is not valid here:\n") +// expectParseErrorTS(t, "Foo = class {}", ": ERROR: The modifier \"out\" is not valid here:\n") +// expectParseErrorTS(t, "foo = function () {}", ": ERROR: The modifier \"in\" is not valid here:\n") +// expectParseErrorTS(t, "foo = function () {}", ": ERROR: The modifier \"out\" is not valid here:\n") +// expectParseErrorTS(t, "class Foo { foo(): T {} }", ": ERROR: The modifier \"in\" is not valid here:\n") +// expectParseErrorTS(t, "class Foo { foo(): T {} }", ": ERROR: The modifier \"out\" is not valid here:\n") +// expectParseErrorTS(t, "foo = { foo(): T {} }", ": ERROR: The modifier \"in\" is not valid here:\n") +// expectParseErrorTS(t, "foo = { foo(): T {} }", ": ERROR: The modifier \"out\" is not valid here:\n") +// expectParseErrorTS(t, "() => {}", ": ERROR: The modifier \"in\" is not valid here:\n") +// expectParseErrorTS(t, "() => {}", ": ERROR: The modifier \"out\" is not valid here:\n") +// expectParseErrorTS(t, "() => {}", ": ERROR: The modifier \"in\" is not valid here:\n: ERROR: The modifier \"out\" is not valid here:\n") +// expectParseErrorTS(t, "let x: () => {}", ": ERROR: The modifier \"in\" is not valid here:\n") +// expectParseErrorTS(t, "let x: () => {}", ": ERROR: The modifier \"out\" is not valid here:\n") +// expectParseErrorTS(t, "let x: () => {}", ": ERROR: The modifier \"in\" is not valid here:\n: ERROR: The modifier \"out\" is not valid here:\n") +// expectParseErrorTS(t, "let x: new () => {}", ": ERROR: The modifier \"in\" is not valid here:\n") +// expectParseErrorTS(t, "let x: new () => {}", ": ERROR: The modifier \"out\" is not valid here:\n") +// expectParseErrorTS(t, "let x: new () => {}", ": ERROR: The modifier \"in\" is not valid here:\n: ERROR: The modifier \"out\" is not valid here:\n") +// expectParseErrorTS(t, "let x: { y(): any }", ": ERROR: The modifier \"in\" is not valid here:\n") +// expectParseErrorTS(t, "let x: { y(): any }", ": ERROR: The modifier \"out\" is not valid here:\n") +// expectParseErrorTS(t, "let x: { y(): any }", ": ERROR: The modifier \"in\" is not valid here:\n: ERROR: The modifier \"out\" is not valid here:\n") +// expectPrintedTSX(t, "", "/* @__PURE__ */ React.createElement(\"in\", {\n T: true\n});\n") +// expectPrintedTSX(t, "", "/* @__PURE__ */ React.createElement(\"out\", {\n T: true\n});\n") +// expectPrintedTSX(t, "", "/* @__PURE__ */ React.createElement(\"in\", {\n out: true,\n T: true\n});\n") +// expectPrintedTSX(t, "", "/* @__PURE__ */ React.createElement(\"out\", {\n in: true,\n T: true\n});\n") +// expectPrintedTSX(t, "", "/* @__PURE__ */ React.createElement(\"in\", {\n T: true,\n extends: true\n});\n") +// expectPrintedTSX(t, "", "/* @__PURE__ */ React.createElement(\"out\", {\n T: true,\n extends: true\n});\n") +// expectPrintedTSX(t, "", "/* @__PURE__ */ React.createElement(\"in\", {\n out: true,\n T: true,\n extends: true\n});\n") +// expectParseErrorTSX(t, "() => {}", ": ERROR: Expected \">\" but found \",\"\n") +// expectParseErrorTSX(t, "() => {}", ": ERROR: Expected \">\" but found \",\"\n") +// expectParseErrorTSX(t, "() => {}", ": ERROR: Expected \">\" but found \",\"\n") +// expectParseErrorTSX(t, "() => {}", jsxErrorArrow) +// expectParseErrorTSX(t, "() => {}", jsxErrorArrow) +// expectParseErrorTSX(t, "() => {}", jsxErrorArrow) diff --git a/crates/rome_js_parser/test_data/inline/err/ts_constructor_type_parameters.rast b/crates/rome_js_parser/test_data/inline/err/ts_constructor_type_parameters.rast index 7c89aaff886..10c453815f6 100644 --- a/crates/rome_js_parser/test_data/inline/err/ts_constructor_type_parameters.rast +++ b/crates/rome_js_parser/test_data/inline/err/ts_constructor_type_parameters.rast @@ -23,6 +23,7 @@ JsModule { l_angle_token: L_ANGLE@21..22 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@22..23 "A" [] [], }, @@ -83,10 +84,11 @@ JsModule { 0: L_ANGLE@21..22 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@22..23 0: TS_TYPE_PARAMETER@22..23 - 0: TS_TYPE_PARAMETER_NAME@22..23 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@22..23 0: IDENT@22..23 "A" [] [] - 1: (empty) 2: (empty) + 3: (empty) 2: R_ANGLE@23..24 ">" [] [] 3: JS_CONSTRUCTOR_PARAMETERS@24..28 0: L_PAREN@24..25 "(" [] [] diff --git a/crates/rome_js_parser/test_data/inline/err/ts_declare_function_with_body.rast b/crates/rome_js_parser/test_data/inline/err/ts_declare_function_with_body.rast index 5d75d6aa4df..112272ae042 100644 --- a/crates/rome_js_parser/test_data/inline/err/ts_declare_function_with_body.rast +++ b/crates/rome_js_parser/test_data/inline/err/ts_declare_function_with_body.rast @@ -15,6 +15,7 @@ JsModule { l_angle_token: L_ANGLE@21..22 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@22..23 "A" [] [], }, @@ -88,10 +89,11 @@ JsModule { 0: L_ANGLE@21..22 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@22..23 0: TS_TYPE_PARAMETER@22..23 - 0: TS_TYPE_PARAMETER_NAME@22..23 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@22..23 0: IDENT@22..23 "A" [] [] - 1: (empty) 2: (empty) + 3: (empty) 2: R_ANGLE@23..24 ">" [] [] 3: JS_PARAMETERS@24..30 0: L_PAREN@24..25 "(" [] [] diff --git a/crates/rome_js_parser/test_data/inline/err/ts_getter_setter_type_parameters.rast b/crates/rome_js_parser/test_data/inline/err/ts_getter_setter_type_parameters.rast index ff88db2af7b..a1896fdc9dd 100644 --- a/crates/rome_js_parser/test_data/inline/err/ts_getter_setter_type_parameters.rast +++ b/crates/rome_js_parser/test_data/inline/err/ts_getter_setter_type_parameters.rast @@ -24,6 +24,7 @@ JsModule { l_angle_token: L_ANGLE@19..20 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@20..21 "A" [] [], }, @@ -63,6 +64,7 @@ JsModule { l_angle_token: L_ANGLE@37..38 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@38..39 "A" [] [], }, @@ -128,10 +130,11 @@ JsModule { 0: L_ANGLE@19..20 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@20..21 0: TS_TYPE_PARAMETER@20..21 - 0: TS_TYPE_PARAMETER_NAME@20..21 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@20..21 0: IDENT@20..21 "A" [] [] - 1: (empty) 2: (empty) + 3: (empty) 2: R_ANGLE@21..22 ">" [] [] 4: L_PAREN@22..23 "(" [] [] 5: R_PAREN@23..24 ")" [] [] @@ -155,10 +158,11 @@ JsModule { 0: L_ANGLE@37..38 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@38..39 0: TS_TYPE_PARAMETER@38..39 - 0: TS_TYPE_PARAMETER_NAME@38..39 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@38..39 0: IDENT@38..39 "A" [] [] - 1: (empty) 2: (empty) + 3: (empty) 2: R_ANGLE@39..40 ">" [] [] 4: L_PAREN@40..41 "(" [] [] 5: JS_FORMAL_PARAMETER@41..49 diff --git a/crates/rome_js_parser/test_data/inline/err/ts_object_getter_type_parameters.rast b/crates/rome_js_parser/test_data/inline/err/ts_object_getter_type_parameters.rast index 73b7ee473b9..2a8a557079c 100644 --- a/crates/rome_js_parser/test_data/inline/err/ts_object_getter_type_parameters.rast +++ b/crates/rome_js_parser/test_data/inline/err/ts_object_getter_type_parameters.rast @@ -18,6 +18,7 @@ JsModule { l_angle_token: L_ANGLE@8..9 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@9..10 "A" [] [], }, @@ -75,10 +76,11 @@ JsModule { 0: L_ANGLE@8..9 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@9..10 0: TS_TYPE_PARAMETER@9..10 - 0: TS_TYPE_PARAMETER_NAME@9..10 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@9..10 0: IDENT@9..10 "A" [] [] - 1: (empty) 2: (empty) + 3: (empty) 2: R_ANGLE@10..11 ">" [] [] 3: L_PAREN@11..12 "(" [] [] 4: R_PAREN@12..13 ")" [] [] diff --git a/crates/rome_js_parser/test_data/inline/err/ts_object_setter_type_parameters.rast b/crates/rome_js_parser/test_data/inline/err/ts_object_setter_type_parameters.rast index 26ef2a96e1b..c8d9d574eaf 100644 --- a/crates/rome_js_parser/test_data/inline/err/ts_object_setter_type_parameters.rast +++ b/crates/rome_js_parser/test_data/inline/err/ts_object_setter_type_parameters.rast @@ -18,6 +18,7 @@ JsModule { l_angle_token: L_ANGLE@8..9 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@9..10 "A" [] [], }, @@ -82,10 +83,11 @@ JsModule { 0: L_ANGLE@8..9 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@9..10 0: TS_TYPE_PARAMETER@9..10 - 0: TS_TYPE_PARAMETER_NAME@9..10 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@9..10 0: IDENT@9..10 "A" [] [] - 1: (empty) 2: (empty) + 3: (empty) 2: R_ANGLE@10..11 ">" [] [] 3: L_PAREN@11..12 "(" [] [] 4: JS_FORMAL_PARAMETER@12..20 diff --git a/crates/rome_js_parser/test_data/inline/err/ts_type_parameters_incomplete.rast b/crates/rome_js_parser/test_data/inline/err/ts_type_parameters_incomplete.rast index 3c2a72a6cf4..84e11924292 100644 --- a/crates/rome_js_parser/test_data/inline/err/ts_type_parameters_incomplete.rast +++ b/crates/rome_js_parser/test_data/inline/err/ts_type_parameters_incomplete.rast @@ -11,6 +11,7 @@ JsModule { l_angle_token: L_ANGLE@6..7 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@7..8 "T" [] [], }, @@ -40,10 +41,11 @@ JsModule { 0: L_ANGLE@6..7 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@7..8 0: TS_TYPE_PARAMETER@7..8 - 0: TS_TYPE_PARAMETER_NAME@7..8 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@7..8 0: IDENT@7..8 "T" [] [] - 1: (empty) 2: (empty) + 3: (empty) 2: (empty) 3: (empty) 4: (empty) diff --git a/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.rast b/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.rast new file mode 100644 index 00000000000..df66e850434 --- /dev/null +++ b/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.rast @@ -0,0 +1,761 @@ +JsModule { + interpreter_token: missing (optional), + directives: JsDirectiveList [], + items: JsModuleItemList [ + JsUnknownStatement { + items: [ + TYPE_KW@0..5 "type" [] [Whitespace(" ")], + TsIdentifierBinding { + name_token: IDENT@5..8 "Foo" [] [], + }, + JsUnknown { + items: [ + L_ANGLE@8..9 "<" [] [], + JsUnknown { + items: [ + JsUnknown { + items: [ + IN_KW@9..12 "in" [] [Whitespace(" ")], + ], + }, + TsTypeParameter { + modifier: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@12..13 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + }, + R_ANGLE@13..15 ">" [] [Whitespace(" ")], + ], + }, + EQ@15..17 "=" [] [Whitespace(" ")], + TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@17..18 "T" [] [], + }, + type_arguments: missing (optional), + }, + ], + }, + TsTypeAliasDeclaration { + type_token: TYPE_KW@18..24 "type" [Newline("\n")] [Whitespace(" ")], + binding_identifier: TsIdentifierBinding { + name_token: IDENT@24..27 "Foo" [] [], + }, + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@27..28 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@28..32 "out" [] [Whitespace(" ")], + }, + constraint: missing (optional), + default: missing (optional), + }, + missing separator, + TsTypeParameter { + modifier: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@32..33 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@33..35 ">" [] [Whitespace(" ")], + }, + eq_token: EQ@35..37 "=" [] [Whitespace(" ")], + ty: TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@37..38 "T" [] [], + }, + type_arguments: missing (optional), + }, + semicolon_token: missing (optional), + }, + JsUnknownStatement { + items: [ + TYPE_KW@38..44 "type" [Newline("\n")] [Whitespace(" ")], + TsIdentifierBinding { + name_token: IDENT@44..47 "Foo" [] [], + }, + JsUnknown { + items: [ + L_ANGLE@47..48 "<" [] [], + JsUnknown { + items: [ + JsUnknown { + items: [ + IN_KW@48..51 "in" [] [Whitespace(" ")], + OUT_KW@51..54 "out" [] [], + ], + }, + ], + }, + R_ANGLE@54..56 ">" [] [Whitespace(" ")], + ], + }, + EQ@56..58 "=" [] [Whitespace(" ")], + TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@58..59 "T" [] [], + }, + type_arguments: missing (optional), + }, + ], + }, + TsTypeAliasDeclaration { + type_token: TYPE_KW@59..65 "type" [Newline("\n")] [Whitespace(" ")], + binding_identifier: TsIdentifierBinding { + name_token: IDENT@65..68 "Foo" [] [], + }, + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@68..69 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@69..73 "out" [] [Whitespace(" ")], + }, + constraint: missing (optional), + default: missing (optional), + }, + missing separator, + TsTypeParameter { + modifier: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@73..76 "out" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@76..78 ">" [] [Whitespace(" ")], + }, + eq_token: EQ@78..80 "=" [] [Whitespace(" ")], + ty: TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@80..81 "T" [] [], + }, + type_arguments: missing (optional), + }, + semicolon_token: missing (optional), + }, + JsUnknownStatement { + items: [ + TYPE_KW@81..87 "type" [Newline("\n")] [Whitespace(" ")], + TsIdentifierBinding { + name_token: IDENT@87..90 "Foo" [] [], + }, + JsUnknown { + items: [ + L_ANGLE@90..91 "<" [] [], + JsUnknown { + items: [ + JsUnknown { + items: [ + IN_KW@91..94 "in" [] [Whitespace(" ")], + OUT_KW@94..98 "out" [] [Whitespace(" ")], + OUT_KW@98..101 "out" [] [], + ], + }, + ], + }, + R_ANGLE@101..103 ">" [] [Whitespace(" ")], + ], + }, + EQ@103..105 "=" [] [Whitespace(" ")], + TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@105..106 "T" [] [], + }, + type_arguments: missing (optional), + }, + ], + }, + JsUnknownStatement { + items: [ + TYPE_KW@106..112 "type" [Newline("\n")] [Whitespace(" ")], + TsIdentifierBinding { + name_token: IDENT@112..115 "Foo" [] [], + }, + JsUnknown { + items: [ + L_ANGLE@115..116 "<" [] [], + JsUnknown { + items: [ + JsUnknown { + items: [ + IN_KW@116..119 "in" [] [Whitespace(" ")], + ], + }, + TsTypeParameter { + modifier: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@119..120 "X" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + COMMA@120..122 "," [] [Whitespace(" ")], + TsTypeParameter { + modifier: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@122..126 "out" [] [Whitespace(" ")], + }, + constraint: missing (optional), + default: missing (optional), + }, + TsTypeParameter { + modifier: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@126..127 "Y" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + }, + R_ANGLE@127..129 ">" [] [Whitespace(" ")], + ], + }, + EQ@129..131 "=" [] [Whitespace(" ")], + TsTupleType { + l_brack_token: L_BRACK@131..132 "[" [] [], + elements: TsTupleTypeElementList [ + TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@132..133 "X" [] [], + }, + type_arguments: missing (optional), + }, + COMMA@133..135 "," [] [Whitespace(" ")], + TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@135..136 "Y" [] [], + }, + type_arguments: missing (optional), + }, + ], + r_brack_token: R_BRACK@136..137 "]" [] [], + }, + ], + }, + JsUnknownStatement { + items: [ + TYPE_KW@137..143 "type" [Newline("\n")] [Whitespace(" ")], + TsIdentifierBinding { + name_token: IDENT@143..146 "Foo" [] [], + }, + JsUnknown { + items: [ + L_ANGLE@146..147 "<" [] [], + JsUnknown { + items: [ + TsTypeParameter { + modifier: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@147..151 "out" [] [Whitespace(" ")], + }, + constraint: missing (optional), + default: missing (optional), + }, + TsTypeParameter { + modifier: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@151..152 "X" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + COMMA@152..154 "," [] [Whitespace(" ")], + JsUnknown { + items: [ + IN_KW@154..157 "in" [] [Whitespace(" ")], + ], + }, + TsTypeParameter { + modifier: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@157..158 "Y" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + }, + R_ANGLE@158..160 ">" [] [Whitespace(" ")], + ], + }, + EQ@160..162 "=" [] [Whitespace(" ")], + TsTupleType { + l_brack_token: L_BRACK@162..163 "[" [] [], + elements: TsTupleTypeElementList [ + TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@163..164 "X" [] [], + }, + type_arguments: missing (optional), + }, + COMMA@164..166 "," [] [Whitespace(" ")], + TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@166..167 "Y" [] [], + }, + type_arguments: missing (optional), + }, + ], + r_brack_token: R_BRACK@167..168 "]" [] [], + }, + ], + }, + TsTypeAliasDeclaration { + type_token: TYPE_KW@168..174 "type" [Newline("\n")] [Whitespace(" ")], + binding_identifier: TsIdentifierBinding { + name_token: IDENT@174..177 "Foo" [] [], + }, + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@177..178 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@178..182 "out" [] [Whitespace(" ")], + }, + constraint: missing (optional), + default: missing (optional), + }, + missing separator, + TsTypeParameter { + modifier: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@182..183 "X" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + COMMA@183..185 "," [] [Whitespace(" ")], + TsTypeParameter { + modifier: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@185..189 "out" [] [Whitespace(" ")], + }, + constraint: missing (optional), + default: missing (optional), + }, + missing separator, + TsTypeParameter { + modifier: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@189..191 "Y" [] [Whitespace(" ")], + }, + constraint: TsTypeConstraintClause { + extends_token: EXTENDS_KW@191..199 "extends" [] [Whitespace(" ")], + ty: TsTypeOperatorType { + operator_token: KEYOF_KW@199..205 "keyof" [] [Whitespace(" ")], + ty: TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@205..206 "X" [] [], + }, + type_arguments: missing (optional), + }, + }, + }, + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@206..208 ">" [] [Whitespace(" ")], + }, + eq_token: EQ@208..210 "=" [] [Whitespace(" ")], + ty: TsTupleType { + l_brack_token: L_BRACK@210..211 "[" [] [], + elements: TsTupleTypeElementList [ + TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@211..212 "X" [] [], + }, + type_arguments: missing (optional), + }, + COMMA@212..214 "," [] [Whitespace(" ")], + TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@214..215 "Y" [] [], + }, + type_arguments: missing (optional), + }, + ], + r_brack_token: R_BRACK@215..216 "]" [] [], + }, + semicolon_token: missing (optional), + }, + ], + eof_token: EOF@216..217 "" [Newline("\n")] [], +} + +0: JS_MODULE@0..217 + 0: (empty) + 1: JS_DIRECTIVE_LIST@0..0 + 2: JS_MODULE_ITEM_LIST@0..216 + 0: JS_UNKNOWN_STATEMENT@0..18 + 0: TYPE_KW@0..5 "type" [] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@5..8 + 0: IDENT@5..8 "Foo" [] [] + 2: JS_UNKNOWN@8..15 + 0: L_ANGLE@8..9 "<" [] [] + 1: JS_UNKNOWN@9..13 + 0: JS_UNKNOWN@9..12 + 0: IN_KW@9..12 "in" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER@12..13 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@12..13 + 0: IDENT@12..13 "T" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@13..15 ">" [] [Whitespace(" ")] + 3: EQ@15..17 "=" [] [Whitespace(" ")] + 4: TS_REFERENCE_TYPE@17..18 + 0: JS_REFERENCE_IDENTIFIER@17..18 + 0: IDENT@17..18 "T" [] [] + 1: (empty) + 1: TS_TYPE_ALIAS_DECLARATION@18..38 + 0: TYPE_KW@18..24 "type" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@24..27 + 0: IDENT@24..27 "Foo" [] [] + 2: TS_TYPE_PARAMETERS@27..35 + 0: L_ANGLE@27..28 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@28..33 + 0: TS_TYPE_PARAMETER@28..32 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@28..32 + 0: IDENT@28..32 "out" [] [Whitespace(" ")] + 2: (empty) + 3: (empty) + 1: (empty) + 2: TS_TYPE_PARAMETER@32..33 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@32..33 + 0: IDENT@32..33 "T" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@33..35 ">" [] [Whitespace(" ")] + 3: EQ@35..37 "=" [] [Whitespace(" ")] + 4: TS_REFERENCE_TYPE@37..38 + 0: JS_REFERENCE_IDENTIFIER@37..38 + 0: IDENT@37..38 "T" [] [] + 1: (empty) + 5: (empty) + 2: JS_UNKNOWN_STATEMENT@38..59 + 0: TYPE_KW@38..44 "type" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@44..47 + 0: IDENT@44..47 "Foo" [] [] + 2: JS_UNKNOWN@47..56 + 0: L_ANGLE@47..48 "<" [] [] + 1: JS_UNKNOWN@48..54 + 0: JS_UNKNOWN@48..54 + 0: IN_KW@48..51 "in" [] [Whitespace(" ")] + 1: OUT_KW@51..54 "out" [] [] + 2: R_ANGLE@54..56 ">" [] [Whitespace(" ")] + 3: EQ@56..58 "=" [] [Whitespace(" ")] + 4: TS_REFERENCE_TYPE@58..59 + 0: JS_REFERENCE_IDENTIFIER@58..59 + 0: IDENT@58..59 "T" [] [] + 1: (empty) + 3: TS_TYPE_ALIAS_DECLARATION@59..81 + 0: TYPE_KW@59..65 "type" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@65..68 + 0: IDENT@65..68 "Foo" [] [] + 2: TS_TYPE_PARAMETERS@68..78 + 0: L_ANGLE@68..69 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@69..76 + 0: TS_TYPE_PARAMETER@69..73 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@69..73 + 0: IDENT@69..73 "out" [] [Whitespace(" ")] + 2: (empty) + 3: (empty) + 1: (empty) + 2: TS_TYPE_PARAMETER@73..76 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@73..76 + 0: IDENT@73..76 "out" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@76..78 ">" [] [Whitespace(" ")] + 3: EQ@78..80 "=" [] [Whitespace(" ")] + 4: TS_REFERENCE_TYPE@80..81 + 0: JS_REFERENCE_IDENTIFIER@80..81 + 0: IDENT@80..81 "T" [] [] + 1: (empty) + 5: (empty) + 4: JS_UNKNOWN_STATEMENT@81..106 + 0: TYPE_KW@81..87 "type" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@87..90 + 0: IDENT@87..90 "Foo" [] [] + 2: JS_UNKNOWN@90..103 + 0: L_ANGLE@90..91 "<" [] [] + 1: JS_UNKNOWN@91..101 + 0: JS_UNKNOWN@91..101 + 0: IN_KW@91..94 "in" [] [Whitespace(" ")] + 1: OUT_KW@94..98 "out" [] [Whitespace(" ")] + 2: OUT_KW@98..101 "out" [] [] + 2: R_ANGLE@101..103 ">" [] [Whitespace(" ")] + 3: EQ@103..105 "=" [] [Whitespace(" ")] + 4: TS_REFERENCE_TYPE@105..106 + 0: JS_REFERENCE_IDENTIFIER@105..106 + 0: IDENT@105..106 "T" [] [] + 1: (empty) + 5: JS_UNKNOWN_STATEMENT@106..137 + 0: TYPE_KW@106..112 "type" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@112..115 + 0: IDENT@112..115 "Foo" [] [] + 2: JS_UNKNOWN@115..129 + 0: L_ANGLE@115..116 "<" [] [] + 1: JS_UNKNOWN@116..127 + 0: JS_UNKNOWN@116..119 + 0: IN_KW@116..119 "in" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER@119..120 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@119..120 + 0: IDENT@119..120 "X" [] [] + 2: (empty) + 3: (empty) + 2: COMMA@120..122 "," [] [Whitespace(" ")] + 3: TS_TYPE_PARAMETER@122..126 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@122..126 + 0: IDENT@122..126 "out" [] [Whitespace(" ")] + 2: (empty) + 3: (empty) + 4: TS_TYPE_PARAMETER@126..127 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@126..127 + 0: IDENT@126..127 "Y" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@127..129 ">" [] [Whitespace(" ")] + 3: EQ@129..131 "=" [] [Whitespace(" ")] + 4: TS_TUPLE_TYPE@131..137 + 0: L_BRACK@131..132 "[" [] [] + 1: TS_TUPLE_TYPE_ELEMENT_LIST@132..136 + 0: TS_REFERENCE_TYPE@132..133 + 0: JS_REFERENCE_IDENTIFIER@132..133 + 0: IDENT@132..133 "X" [] [] + 1: (empty) + 1: COMMA@133..135 "," [] [Whitespace(" ")] + 2: TS_REFERENCE_TYPE@135..136 + 0: JS_REFERENCE_IDENTIFIER@135..136 + 0: IDENT@135..136 "Y" [] [] + 1: (empty) + 2: R_BRACK@136..137 "]" [] [] + 6: JS_UNKNOWN_STATEMENT@137..168 + 0: TYPE_KW@137..143 "type" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@143..146 + 0: IDENT@143..146 "Foo" [] [] + 2: JS_UNKNOWN@146..160 + 0: L_ANGLE@146..147 "<" [] [] + 1: JS_UNKNOWN@147..158 + 0: TS_TYPE_PARAMETER@147..151 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@147..151 + 0: IDENT@147..151 "out" [] [Whitespace(" ")] + 2: (empty) + 3: (empty) + 1: TS_TYPE_PARAMETER@151..152 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@151..152 + 0: IDENT@151..152 "X" [] [] + 2: (empty) + 3: (empty) + 2: COMMA@152..154 "," [] [Whitespace(" ")] + 3: JS_UNKNOWN@154..157 + 0: IN_KW@154..157 "in" [] [Whitespace(" ")] + 4: TS_TYPE_PARAMETER@157..158 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@157..158 + 0: IDENT@157..158 "Y" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@158..160 ">" [] [Whitespace(" ")] + 3: EQ@160..162 "=" [] [Whitespace(" ")] + 4: TS_TUPLE_TYPE@162..168 + 0: L_BRACK@162..163 "[" [] [] + 1: TS_TUPLE_TYPE_ELEMENT_LIST@163..167 + 0: TS_REFERENCE_TYPE@163..164 + 0: JS_REFERENCE_IDENTIFIER@163..164 + 0: IDENT@163..164 "X" [] [] + 1: (empty) + 1: COMMA@164..166 "," [] [Whitespace(" ")] + 2: TS_REFERENCE_TYPE@166..167 + 0: JS_REFERENCE_IDENTIFIER@166..167 + 0: IDENT@166..167 "Y" [] [] + 1: (empty) + 2: R_BRACK@167..168 "]" [] [] + 7: TS_TYPE_ALIAS_DECLARATION@168..216 + 0: TYPE_KW@168..174 "type" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@174..177 + 0: IDENT@174..177 "Foo" [] [] + 2: TS_TYPE_PARAMETERS@177..208 + 0: L_ANGLE@177..178 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@178..206 + 0: TS_TYPE_PARAMETER@178..182 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@178..182 + 0: IDENT@178..182 "out" [] [Whitespace(" ")] + 2: (empty) + 3: (empty) + 1: (empty) + 2: TS_TYPE_PARAMETER@182..183 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@182..183 + 0: IDENT@182..183 "X" [] [] + 2: (empty) + 3: (empty) + 3: COMMA@183..185 "," [] [Whitespace(" ")] + 4: TS_TYPE_PARAMETER@185..189 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@185..189 + 0: IDENT@185..189 "out" [] [Whitespace(" ")] + 2: (empty) + 3: (empty) + 5: (empty) + 6: TS_TYPE_PARAMETER@189..206 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@189..191 + 0: IDENT@189..191 "Y" [] [Whitespace(" ")] + 2: TS_TYPE_CONSTRAINT_CLAUSE@191..206 + 0: EXTENDS_KW@191..199 "extends" [] [Whitespace(" ")] + 1: TS_TYPE_OPERATOR_TYPE@199..206 + 0: KEYOF_KW@199..205 "keyof" [] [Whitespace(" ")] + 1: TS_REFERENCE_TYPE@205..206 + 0: JS_REFERENCE_IDENTIFIER@205..206 + 0: IDENT@205..206 "X" [] [] + 1: (empty) + 3: (empty) + 2: R_ANGLE@206..208 ">" [] [Whitespace(" ")] + 3: EQ@208..210 "=" [] [Whitespace(" ")] + 4: TS_TUPLE_TYPE@210..216 + 0: L_BRACK@210..211 "[" [] [] + 1: TS_TUPLE_TYPE_ELEMENT_LIST@211..215 + 0: TS_REFERENCE_TYPE@211..212 + 0: JS_REFERENCE_IDENTIFIER@211..212 + 0: IDENT@211..212 "X" [] [] + 1: (empty) + 1: COMMA@212..214 "," [] [Whitespace(" ")] + 2: TS_REFERENCE_TYPE@214..215 + 0: JS_REFERENCE_IDENTIFIER@214..215 + 0: IDENT@214..215 "Y" [] [] + 1: (empty) + 2: R_BRACK@215..216 "]" [] [] + 5: (empty) + 3: EOF@216..217 "" [Newline("\n")] [] +-- +error[SyntaxError]: expected a type parameter but instead found 'in' + ┌─ type_parameter_modifier.ts:1:10 + │ +1 │ type Foo = T + │ ^^ Expected a type parameter here + +-- +error[SyntaxError]: expected `,` but instead found `T` + ┌─ type_parameter_modifier.ts:1:13 + │ +1 │ type Foo = T + │ ^ unexpected + +-- +error[SyntaxError]: expected `,` but instead found `T` + ┌─ type_parameter_modifier.ts:2:14 + │ +2 │ type Foo = T + │ ^ unexpected + +-- +error[SyntaxError]: expected a type parameter but instead found 'in out' + ┌─ type_parameter_modifier.ts:3:10 + │ +3 │ type Foo = T + │ ^^^^^^ Expected a type parameter here + +-- +error[SyntaxError]: expected `,` but instead found `out` + ┌─ type_parameter_modifier.ts:4:14 + │ +4 │ type Foo = T + │ ^^^ unexpected + +-- +error[SyntaxError]: expected a type parameter but instead found 'in out out' + ┌─ type_parameter_modifier.ts:5:10 + │ +5 │ type Foo = T + │ ^^^^^^^^^^ Expected a type parameter here + +-- +error[SyntaxError]: expected a type parameter but instead found 'in' + ┌─ type_parameter_modifier.ts:6:10 + │ +6 │ type Foo = [X, Y] + │ ^^ Expected a type parameter here + +-- +error[SyntaxError]: expected `,` but instead found `X` + ┌─ type_parameter_modifier.ts:6:13 + │ +6 │ type Foo = [X, Y] + │ ^ unexpected + +-- +error[SyntaxError]: expected `,` but instead found `Y` + ┌─ type_parameter_modifier.ts:6:20 + │ +6 │ type Foo = [X, Y] + │ ^ unexpected + +-- +error[SyntaxError]: expected `,` but instead found `X` + ┌─ type_parameter_modifier.ts:7:14 + │ +7 │ type Foo = [X, Y] + │ ^ unexpected + +-- +error[SyntaxError]: expected a type parameter but instead found 'in' + ┌─ type_parameter_modifier.ts:7:17 + │ +7 │ type Foo = [X, Y] + │ ^^ Expected a type parameter here + +-- +error[SyntaxError]: expected `,` but instead found `Y` + ┌─ type_parameter_modifier.ts:7:20 + │ +7 │ type Foo = [X, Y] + │ ^ unexpected + +-- +error[SyntaxError]: expected `,` but instead found `X` + ┌─ type_parameter_modifier.ts:8:14 + │ +8 │ type Foo = [X, Y] + │ ^ unexpected + +-- +error[SyntaxError]: expected `,` but instead found `Y` + ┌─ type_parameter_modifier.ts:8:21 + │ +8 │ type Foo = [X, Y] + │ ^ unexpected + +-- +type Foo = T +type Foo = T +type Foo = T +type Foo = T +type Foo = T +type Foo = [X, Y] +type Foo = [X, Y] +type Foo = [X, Y] diff --git a/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.ts b/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.ts new file mode 100644 index 00000000000..48c8601f746 --- /dev/null +++ b/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.ts @@ -0,0 +1,8 @@ +type Foo = T +type Foo = T +type Foo = T +type Foo = T +type Foo = T +type Foo = [X, Y] +type Foo = [X, Y] +type Foo = [X, Y] diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_arrow_function_type_parameters.rast b/crates/rome_js_parser/test_data/inline/ok/ts_arrow_function_type_parameters.rast index 4766714e0d1..5080690573b 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_arrow_function_type_parameters.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_arrow_function_type_parameters.rast @@ -19,6 +19,7 @@ JsModule { l_angle_token: L_ANGLE@8..9 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@9..10 "A" [] [], }, @@ -27,6 +28,7 @@ JsModule { }, COMMA@10..12 "," [] [Whitespace(" ")], TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@12..14 "B" [] [Whitespace(" ")], }, @@ -43,6 +45,7 @@ JsModule { }, COMMA@23..25 "," [] [Whitespace(" ")], TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@25..27 "C" [] [Whitespace(" ")], }, @@ -142,6 +145,7 @@ JsModule { l_angle_token: L_ANGLE@81..82 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@82..83 "A" [] [], }, @@ -150,6 +154,7 @@ JsModule { }, COMMA@83..85 "," [] [Whitespace(" ")], TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@85..86 "B" [] [], }, @@ -250,27 +255,30 @@ JsModule { 0: L_ANGLE@8..9 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@9..35 0: TS_TYPE_PARAMETER@9..10 - 0: TS_TYPE_PARAMETER_NAME@9..10 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@9..10 0: IDENT@9..10 "A" [] [] - 1: (empty) 2: (empty) + 3: (empty) 1: COMMA@10..12 "," [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER@12..23 - 0: TS_TYPE_PARAMETER_NAME@12..14 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@12..14 0: IDENT@12..14 "B" [] [Whitespace(" ")] - 1: TS_TYPE_CONSTRAINT_CLAUSE@14..23 + 2: TS_TYPE_CONSTRAINT_CLAUSE@14..23 0: EXTENDS_KW@14..22 "extends" [] [Whitespace(" ")] 1: TS_REFERENCE_TYPE@22..23 0: JS_REFERENCE_IDENTIFIER@22..23 0: IDENT@22..23 "A" [] [] 1: (empty) - 2: (empty) + 3: (empty) 3: COMMA@23..25 "," [] [Whitespace(" ")] 4: TS_TYPE_PARAMETER@25..35 - 0: TS_TYPE_PARAMETER_NAME@25..27 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@25..27 0: IDENT@25..27 "C" [] [Whitespace(" ")] - 1: (empty) - 2: TS_DEFAULT_TYPE_CLAUSE@27..35 + 2: (empty) + 3: TS_DEFAULT_TYPE_CLAUSE@27..35 0: EQ@27..29 "=" [] [Whitespace(" ")] 1: TS_STRING_TYPE@29..35 0: STRING_KW@29..35 "string" [] [] @@ -335,16 +343,18 @@ JsModule { 0: L_ANGLE@81..82 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@82..86 0: TS_TYPE_PARAMETER@82..83 - 0: TS_TYPE_PARAMETER_NAME@82..83 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@82..83 0: IDENT@82..83 "A" [] [] - 1: (empty) 2: (empty) + 3: (empty) 1: COMMA@83..85 "," [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER@85..86 - 0: TS_TYPE_PARAMETER_NAME@85..86 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@85..86 0: IDENT@85..86 "B" [] [] - 1: (empty) 2: (empty) + 3: (empty) 2: R_ANGLE@86..87 ">" [] [] 2: JS_PARAMETERS@87..99 0: L_PAREN@87..88 "(" [] [] diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_as_assignment.rast b/crates/rome_js_parser/test_data/inline/ok/ts_as_assignment.rast index a38cecaa99a..0a34ba2e3df 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_as_assignment.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_as_assignment.rast @@ -31,6 +31,7 @@ JsModule { l_angle_token: L_ANGLE@18..19 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@19..20 "A" [] [], }, @@ -323,10 +324,11 @@ JsModule { 0: L_ANGLE@18..19 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@19..20 0: TS_TYPE_PARAMETER@19..20 - 0: TS_TYPE_PARAMETER_NAME@19..20 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@19..20 0: IDENT@19..20 "A" [] [] - 1: (empty) 2: (empty) + 3: (empty) 2: R_ANGLE@20..22 ">" [] [Whitespace(" ")] 3: EQ@22..24 "=" [] [Whitespace(" ")] 4: TS_OBJECT_TYPE@24..32 diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_call_expr_with_type_arguments.rast b/crates/rome_js_parser/test_data/inline/ok/ts_call_expr_with_type_arguments.rast index c096a83e3a0..9b40401a600 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_call_expr_with_type_arguments.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_call_expr_with_type_arguments.rast @@ -13,6 +13,7 @@ JsModule { l_angle_token: L_ANGLE@10..11 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@11..12 "A" [] [], }, @@ -21,6 +22,7 @@ JsModule { }, COMMA@12..14 "," [] [Whitespace(" ")], TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@14..15 "B" [] [], }, @@ -29,6 +31,7 @@ JsModule { }, COMMA@15..17 "," [] [Whitespace(" ")], TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@17..18 "C" [] [], }, @@ -235,6 +238,7 @@ JsModule { l_angle_token: L_ANGLE@94..95 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@95..96 "T" [] [], }, @@ -269,6 +273,7 @@ JsModule { l_angle_token: L_ANGLE@105..106 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@106..107 "T" [] [], }, @@ -342,22 +347,25 @@ JsModule { 0: L_ANGLE@10..11 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@11..18 0: TS_TYPE_PARAMETER@11..12 - 0: TS_TYPE_PARAMETER_NAME@11..12 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@11..12 0: IDENT@11..12 "A" [] [] - 1: (empty) 2: (empty) + 3: (empty) 1: COMMA@12..14 "," [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER@14..15 - 0: TS_TYPE_PARAMETER_NAME@14..15 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@14..15 0: IDENT@14..15 "B" [] [] - 1: (empty) 2: (empty) + 3: (empty) 3: COMMA@15..17 "," [] [Whitespace(" ")] 4: TS_TYPE_PARAMETER@17..18 - 0: TS_TYPE_PARAMETER_NAME@17..18 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@17..18 0: IDENT@17..18 "C" [] [] - 1: (empty) 2: (empty) + 3: (empty) 2: R_ANGLE@18..19 ">" [] [] 5: JS_PARAMETERS@19..22 0: L_PAREN@19..20 "(" [] [] @@ -501,10 +509,11 @@ JsModule { 0: L_ANGLE@94..95 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@95..96 0: TS_TYPE_PARAMETER@95..96 - 0: TS_TYPE_PARAMETER_NAME@95..96 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@95..96 0: IDENT@95..96 "T" [] [] - 1: (empty) 2: (empty) + 3: (empty) 2: R_ANGLE@96..98 ">" [] [Whitespace(" ")] 3: EQ@98..100 "=" [] [Whitespace(" ")] 4: TS_REFERENCE_TYPE@100..101 @@ -526,10 +535,11 @@ JsModule { 0: L_ANGLE@105..106 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@106..107 0: TS_TYPE_PARAMETER@106..107 - 0: TS_TYPE_PARAMETER_NAME@106..107 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@106..107 0: IDENT@106..107 "T" [] [] - 1: (empty) 2: (empty) + 3: (empty) 2: R_ANGLE@107..108 ">" [] [] 1: JS_PARAMETERS@108..117 0: L_PAREN@108..109 "(" [] [] diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_call_signature_member.rast b/crates/rome_js_parser/test_data/inline/ok/ts_call_signature_member.rast index aea2964997f..d3305c9d0a1 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_call_signature_member.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_call_signature_member.rast @@ -104,6 +104,7 @@ JsModule { l_angle_token: L_ANGLE@67..68 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@68..69 "A" [] [], }, @@ -112,6 +113,7 @@ JsModule { }, COMMA@69..71 "," [] [Whitespace(" ")], TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@71..72 "B" [] [], }, @@ -259,16 +261,18 @@ JsModule { 0: L_ANGLE@67..68 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@68..72 0: TS_TYPE_PARAMETER@68..69 - 0: TS_TYPE_PARAMETER_NAME@68..69 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@68..69 0: IDENT@68..69 "A" [] [] - 1: (empty) 2: (empty) + 3: (empty) 1: COMMA@69..71 "," [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER@71..72 - 0: TS_TYPE_PARAMETER_NAME@71..72 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@71..72 0: IDENT@71..72 "B" [] [] - 1: (empty) 2: (empty) + 3: (empty) 2: R_ANGLE@72..73 ">" [] [] 1: JS_PARAMETERS@73..85 0: L_PAREN@73..74 "(" [] [] diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_class_type_parameters.rast b/crates/rome_js_parser/test_data/inline/ok/ts_class_type_parameters.rast index a463965ef6b..1cd5d112396 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_class_type_parameters.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_class_type_parameters.rast @@ -12,6 +12,7 @@ JsModule { l_angle_token: L_ANGLE@16..17 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@17..18 "A" [] [], }, @@ -20,6 +21,7 @@ JsModule { }, COMMA@18..20 "," [] [Whitespace(" ")], TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@20..21 "B" [] [], }, @@ -28,6 +30,7 @@ JsModule { }, COMMA@21..23 "," [] [Whitespace(" ")], TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@23..24 "C" [] [], }, @@ -60,22 +63,25 @@ JsModule { 0: L_ANGLE@16..17 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@17..24 0: TS_TYPE_PARAMETER@17..18 - 0: TS_TYPE_PARAMETER_NAME@17..18 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@17..18 0: IDENT@17..18 "A" [] [] - 1: (empty) 2: (empty) + 3: (empty) 1: COMMA@18..20 "," [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER@20..21 - 0: TS_TYPE_PARAMETER_NAME@20..21 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@20..21 0: IDENT@20..21 "B" [] [] - 1: (empty) 2: (empty) + 3: (empty) 3: COMMA@21..23 "," [] [Whitespace(" ")] 4: TS_TYPE_PARAMETER@23..24 - 0: TS_TYPE_PARAMETER_NAME@23..24 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@23..24 0: IDENT@23..24 "C" [] [] - 1: (empty) 2: (empty) + 3: (empty) 2: R_ANGLE@24..26 ">" [] [Whitespace(" ")] 4: (empty) 5: (empty) diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_conditional_type_call_signature_lhs.rast b/crates/rome_js_parser/test_data/inline/ok/ts_conditional_type_call_signature_lhs.rast index 913eeddc64e..9385b4bf36b 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_conditional_type_call_signature_lhs.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_conditional_type_call_signature_lhs.rast @@ -11,6 +11,7 @@ JsModule { l_angle_token: L_ANGLE@6..7 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@7..8 "V" [] [], }, @@ -124,10 +125,11 @@ JsModule { 0: L_ANGLE@6..7 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@7..8 0: TS_TYPE_PARAMETER@7..8 - 0: TS_TYPE_PARAMETER_NAME@7..8 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@7..8 0: IDENT@7..8 "V" [] [] - 1: (empty) 2: (empty) + 3: (empty) 2: R_ANGLE@8..10 ">" [] [Whitespace(" ")] 3: EQ@10..12 "=" [] [Whitespace(" ")] 4: TS_CONDITIONAL_TYPE@12..91 diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_construct_signature_member.rast b/crates/rome_js_parser/test_data/inline/ok/ts_construct_signature_member.rast index 40c8f51a633..ee62d943c37 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_construct_signature_member.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_construct_signature_member.rast @@ -103,6 +103,7 @@ JsModule { l_angle_token: L_ANGLE@84..85 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@85..86 "A" [] [], }, @@ -111,6 +112,7 @@ JsModule { }, COMMA@86..88 "," [] [Whitespace(" ")], TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@88..89 "B" [] [], }, @@ -257,16 +259,18 @@ JsModule { 0: L_ANGLE@84..85 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@85..89 0: TS_TYPE_PARAMETER@85..86 - 0: TS_TYPE_PARAMETER_NAME@85..86 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@85..86 0: IDENT@85..86 "A" [] [] - 1: (empty) 2: (empty) + 3: (empty) 1: COMMA@86..88 "," [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER@88..89 - 0: TS_TYPE_PARAMETER_NAME@88..89 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@88..89 0: IDENT@88..89 "B" [] [] - 1: (empty) 2: (empty) + 3: (empty) 2: R_ANGLE@89..90 ">" [] [] 2: JS_PARAMETERS@90..102 0: L_PAREN@90..91 "(" [] [] diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_constructor_type.rast b/crates/rome_js_parser/test_data/inline/ok/ts_constructor_type.rast index fd741ad8483..988f5686557 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_constructor_type.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_constructor_type.rast @@ -118,6 +118,7 @@ JsModule { l_angle_token: L_ANGLE@113..114 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@114..115 "A" [] [], }, @@ -126,6 +127,7 @@ JsModule { }, COMMA@115..117 "," [] [Whitespace(" ")], TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@117..118 "B" [] [], }, @@ -195,6 +197,7 @@ JsModule { l_angle_token: L_ANGLE@164..165 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@165..166 "A" [] [], }, @@ -203,6 +206,7 @@ JsModule { }, COMMA@166..168 "," [] [Whitespace(" ")], TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@168..169 "B" [] [], }, @@ -353,16 +357,18 @@ JsModule { 0: L_ANGLE@113..114 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@114..118 0: TS_TYPE_PARAMETER@114..115 - 0: TS_TYPE_PARAMETER_NAME@114..115 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@114..115 0: IDENT@114..115 "A" [] [] - 1: (empty) 2: (empty) + 3: (empty) 1: COMMA@115..117 "," [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER@117..118 - 0: TS_TYPE_PARAMETER_NAME@117..118 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@117..118 0: IDENT@117..118 "B" [] [] - 1: (empty) 2: (empty) + 3: (empty) 2: R_ANGLE@118..119 ">" [] [] 3: JS_PARAMETERS@119..132 0: L_PAREN@119..120 "(" [] [] @@ -408,16 +414,18 @@ JsModule { 0: L_ANGLE@164..165 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@165..169 0: TS_TYPE_PARAMETER@165..166 - 0: TS_TYPE_PARAMETER_NAME@165..166 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@165..166 0: IDENT@165..166 "A" [] [] - 1: (empty) 2: (empty) + 3: (empty) 1: COMMA@166..168 "," [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER@168..169 - 0: TS_TYPE_PARAMETER_NAME@168..169 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@168..169 0: IDENT@168..169 "B" [] [] - 1: (empty) 2: (empty) + 3: (empty) 2: R_ANGLE@169..170 ">" [] [] 3: JS_PARAMETERS@170..183 0: L_PAREN@170..171 "(" [] [] diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_declare_function.rast b/crates/rome_js_parser/test_data/inline/ok/ts_declare_function.rast index ef823c77d8f..40b4299205d 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_declare_function.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_declare_function.rast @@ -14,6 +14,7 @@ JsModule { l_angle_token: L_ANGLE@21..22 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@22..23 "A" [] [], }, @@ -22,6 +23,7 @@ JsModule { }, COMMA@23..25 "," [] [Whitespace(" ")], TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@25..26 "B" [] [], }, @@ -30,6 +32,7 @@ JsModule { }, COMMA@26..28 "," [] [Whitespace(" ")], TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@28..29 "R" [] [], }, @@ -196,22 +199,25 @@ JsModule { 0: L_ANGLE@21..22 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@22..29 0: TS_TYPE_PARAMETER@22..23 - 0: TS_TYPE_PARAMETER_NAME@22..23 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@22..23 0: IDENT@22..23 "A" [] [] - 1: (empty) 2: (empty) + 3: (empty) 1: COMMA@23..25 "," [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER@25..26 - 0: TS_TYPE_PARAMETER_NAME@25..26 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@25..26 0: IDENT@25..26 "B" [] [] - 1: (empty) 2: (empty) + 3: (empty) 3: COMMA@26..28 "," [] [Whitespace(" ")] 4: TS_TYPE_PARAMETER@28..29 - 0: TS_TYPE_PARAMETER_NAME@28..29 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@28..29 0: IDENT@28..29 "R" [] [] - 1: (empty) 2: (empty) + 3: (empty) 2: R_ANGLE@29..30 ">" [] [] 4: JS_PARAMETERS@30..42 0: L_PAREN@30..31 "(" [] [] diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_default_type_clause.rast b/crates/rome_js_parser/test_data/inline/ok/ts_default_type_clause.rast index 0064e7fb5aa..42513c3a1b2 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_default_type_clause.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_default_type_clause.rast @@ -11,6 +11,7 @@ JsModule { l_angle_token: L_ANGLE@6..7 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@7..8 "X" [] [], }, @@ -43,6 +44,7 @@ JsModule { l_angle_token: L_ANGLE@28..29 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@29..31 "X" [] [Whitespace(" ")], }, @@ -113,10 +115,11 @@ JsModule { 0: L_ANGLE@6..7 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@7..15 0: TS_TYPE_PARAMETER@7..15 - 0: TS_TYPE_PARAMETER_NAME@7..8 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@7..8 0: IDENT@7..8 "X" [] [] - 1: (empty) - 2: TS_DEFAULT_TYPE_CLAUSE@8..15 + 2: (empty) + 3: TS_DEFAULT_TYPE_CLAUSE@8..15 0: EQ@8..9 "=" [] [] 1: TS_STRING_TYPE@9..15 0: STRING_KW@9..15 "string" [] [] @@ -135,9 +138,10 @@ JsModule { 0: L_ANGLE@28..29 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@29..63 0: TS_TYPE_PARAMETER@29..63 - 0: TS_TYPE_PARAMETER_NAME@29..31 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@29..31 0: IDENT@29..31 "X" [] [Whitespace(" ")] - 1: TS_TYPE_CONSTRAINT_CLAUSE@31..55 + 2: TS_TYPE_CONSTRAINT_CLAUSE@31..55 0: EXTENDS_KW@31..39 "extends" [] [Whitespace(" ")] 1: TS_UNION_TYPE@39..55 0: (empty) @@ -147,7 +151,7 @@ JsModule { 1: PIPE@46..48 "|" [] [Whitespace(" ")] 2: TS_STRING_TYPE@48..55 0: STRING_KW@48..55 "string" [] [Whitespace(" ")] - 2: TS_DEFAULT_TYPE_CLAUSE@55..63 + 3: TS_DEFAULT_TYPE_CLAUSE@55..63 0: EQ@55..57 "=" [] [Whitespace(" ")] 1: TS_STRING_TYPE@57..63 0: STRING_KW@57..63 "string" [] [] diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_function_statement.rast b/crates/rome_js_parser/test_data/inline/ok/ts_function_statement.rast index 5f431e8eb7d..fabbee4490f 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_function_statement.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_function_statement.rast @@ -76,6 +76,7 @@ JsModule { l_angle_token: L_ANGLE@67..68 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@68..69 "A" [] [], }, @@ -84,6 +85,7 @@ JsModule { }, COMMA@69..71 "," [] [Whitespace(" ")], TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@71..73 "B" [] [Whitespace(" ")], }, @@ -100,6 +102,7 @@ JsModule { }, COMMA@82..84 "," [] [Whitespace(" ")], TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@84..86 "C" [] [Whitespace(" ")], }, @@ -245,27 +248,30 @@ JsModule { 0: L_ANGLE@67..68 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@68..89 0: TS_TYPE_PARAMETER@68..69 - 0: TS_TYPE_PARAMETER_NAME@68..69 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@68..69 0: IDENT@68..69 "A" [] [] - 1: (empty) 2: (empty) + 3: (empty) 1: COMMA@69..71 "," [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER@71..82 - 0: TS_TYPE_PARAMETER_NAME@71..73 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@71..73 0: IDENT@71..73 "B" [] [Whitespace(" ")] - 1: TS_TYPE_CONSTRAINT_CLAUSE@73..82 + 2: TS_TYPE_CONSTRAINT_CLAUSE@73..82 0: EXTENDS_KW@73..81 "extends" [] [Whitespace(" ")] 1: TS_REFERENCE_TYPE@81..82 0: JS_REFERENCE_IDENTIFIER@81..82 0: IDENT@81..82 "A" [] [] 1: (empty) - 2: (empty) + 3: (empty) 3: COMMA@82..84 "," [] [Whitespace(" ")] 4: TS_TYPE_PARAMETER@84..89 - 0: TS_TYPE_PARAMETER_NAME@84..86 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@84..86 0: IDENT@84..86 "C" [] [Whitespace(" ")] - 1: (empty) - 2: TS_DEFAULT_TYPE_CLAUSE@86..89 + 2: (empty) + 3: TS_DEFAULT_TYPE_CLAUSE@86..89 0: EQ@86..88 "=" [] [Whitespace(" ")] 1: TS_REFERENCE_TYPE@88..89 0: JS_REFERENCE_IDENTIFIER@88..89 diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_function_type.rast b/crates/rome_js_parser/test_data/inline/ok/ts_function_type.rast index 2b9eadf0202..ea3e7153d73 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_function_type.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_function_type.rast @@ -219,6 +219,7 @@ JsModule { l_angle_token: L_ANGLE@173..174 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@174..175 "A" [] [], }, @@ -227,6 +228,7 @@ JsModule { }, COMMA@175..177 "," [] [Whitespace(" ")], TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@177..178 "B" [] [], }, @@ -537,16 +539,18 @@ JsModule { 0: L_ANGLE@173..174 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@174..178 0: TS_TYPE_PARAMETER@174..175 - 0: TS_TYPE_PARAMETER_NAME@174..175 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@174..175 0: IDENT@174..175 "A" [] [] - 1: (empty) 2: (empty) + 3: (empty) 1: COMMA@175..177 "," [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER@177..178 - 0: TS_TYPE_PARAMETER_NAME@177..178 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@177..178 0: IDENT@177..178 "B" [] [] - 1: (empty) 2: (empty) + 3: (empty) 2: R_ANGLE@178..179 ">" [] [] 1: JS_PARAMETERS@179..192 0: L_PAREN@179..180 "(" [] [] diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_interface_extends_clause.rast b/crates/rome_js_parser/test_data/inline/ok/ts_interface_extends_clause.rast index 5a9acd827db..cab4eb32699 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_interface_extends_clause.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_interface_extends_clause.rast @@ -11,6 +11,7 @@ JsModule { l_angle_token: L_ANGLE@11..12 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@12..16 "Prop" [] [], }, @@ -124,10 +125,11 @@ JsModule { 0: L_ANGLE@11..12 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@12..16 0: TS_TYPE_PARAMETER@12..16 - 0: TS_TYPE_PARAMETER_NAME@12..16 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@12..16 0: IDENT@12..16 "Prop" [] [] - 1: (empty) 2: (empty) + 3: (empty) 2: R_ANGLE@16..18 ">" [] [Whitespace(" ")] 3: (empty) 4: L_CURLY@18..20 "{" [] [Whitespace(" ")] diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_mapped_type.rast b/crates/rome_js_parser/test_data/inline/ok/ts_mapped_type.rast index 1087db47ddd..fad2ac0d55a 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_mapped_type.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_mapped_type.rast @@ -47,6 +47,7 @@ JsModule { l_angle_token: L_ANGLE@50..51 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@51..55 "Type" [] [], }, @@ -97,6 +98,7 @@ JsModule { l_angle_token: L_ANGLE@119..120 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@120..124 "Type" [] [], }, @@ -163,6 +165,7 @@ JsModule { l_angle_token: L_ANGLE@199..200 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@200..204 "Type" [] [], }, @@ -229,6 +232,7 @@ JsModule { l_angle_token: L_ANGLE@270..271 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@271..275 "Type" [] [], }, @@ -377,10 +381,11 @@ JsModule { 0: L_ANGLE@50..51 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@51..55 0: TS_TYPE_PARAMETER@51..55 - 0: TS_TYPE_PARAMETER_NAME@51..55 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@51..55 0: IDENT@51..55 "Type" [] [] - 1: (empty) 2: (empty) + 3: (empty) 2: R_ANGLE@55..57 ">" [] [Whitespace(" ")] 3: EQ@57..59 "=" [] [Whitespace(" ")] 4: TS_MAPPED_TYPE@59..99 @@ -414,10 +419,11 @@ JsModule { 0: L_ANGLE@119..120 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@120..124 0: TS_TYPE_PARAMETER@120..124 - 0: TS_TYPE_PARAMETER_NAME@120..124 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@120..124 0: IDENT@120..124 "Type" [] [] - 1: (empty) 2: (empty) + 3: (empty) 2: R_ANGLE@124..126 ">" [] [Whitespace(" ")] 3: EQ@126..128 "=" [] [Whitespace(" ")] 4: TS_MAPPED_TYPE@128..184 @@ -462,10 +468,11 @@ JsModule { 0: L_ANGLE@199..200 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@200..204 0: TS_TYPE_PARAMETER@200..204 - 0: TS_TYPE_PARAMETER_NAME@200..204 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@200..204 0: IDENT@200..204 "Type" [] [] - 1: (empty) 2: (empty) + 3: (empty) 2: R_ANGLE@204..206 ">" [] [Whitespace(" ")] 3: EQ@206..208 "=" [] [Whitespace(" ")] 4: TS_MAPPED_TYPE@208..256 @@ -510,10 +517,11 @@ JsModule { 0: L_ANGLE@270..271 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@271..275 0: TS_TYPE_PARAMETER@271..275 - 0: TS_TYPE_PARAMETER_NAME@271..275 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@271..275 0: IDENT@271..275 "Type" [] [] - 1: (empty) 2: (empty) + 3: (empty) 2: R_ANGLE@275..277 ">" [] [Whitespace(" ")] 3: EQ@277..279 "=" [] [Whitespace(" ")] 4: TS_MAPPED_TYPE@279..374 diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_method_class_member.rast b/crates/rome_js_parser/test_data/inline/ok/ts_method_class_member.rast index e1cb9b64d2d..4ad8b9c1130 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_method_class_member.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_method_class_member.rast @@ -25,6 +25,7 @@ JsModule { l_angle_token: L_ANGLE@19..20 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@20..21 "A" [] [], }, @@ -33,6 +34,7 @@ JsModule { }, COMMA@21..23 "," [] [Whitespace(" ")], TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@23..25 "B" [] [Whitespace(" ")], }, @@ -49,6 +51,7 @@ JsModule { }, COMMA@34..36 "," [] [Whitespace(" ")], TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@36..37 "R" [] [], }, @@ -145,27 +148,30 @@ JsModule { 0: L_ANGLE@19..20 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@20..37 0: TS_TYPE_PARAMETER@20..21 - 0: TS_TYPE_PARAMETER_NAME@20..21 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@20..21 0: IDENT@20..21 "A" [] [] - 1: (empty) 2: (empty) + 3: (empty) 1: COMMA@21..23 "," [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER@23..34 - 0: TS_TYPE_PARAMETER_NAME@23..25 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@23..25 0: IDENT@23..25 "B" [] [Whitespace(" ")] - 1: TS_TYPE_CONSTRAINT_CLAUSE@25..34 + 2: TS_TYPE_CONSTRAINT_CLAUSE@25..34 0: EXTENDS_KW@25..33 "extends" [] [Whitespace(" ")] 1: TS_REFERENCE_TYPE@33..34 0: JS_REFERENCE_IDENTIFIER@33..34 0: IDENT@33..34 "A" [] [] 1: (empty) - 2: (empty) + 3: (empty) 3: COMMA@34..36 "," [] [Whitespace(" ")] 4: TS_TYPE_PARAMETER@36..37 - 0: TS_TYPE_PARAMETER_NAME@36..37 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@36..37 0: IDENT@36..37 "R" [] [] - 1: (empty) 2: (empty) + 3: (empty) 2: R_ANGLE@37..38 ">" [] [] 6: JS_PARAMETERS@38..50 0: L_PAREN@38..39 "(" [] [] diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_method_object_member_body.rast b/crates/rome_js_parser/test_data/inline/ok/ts_method_object_member_body.rast index 40125384ad0..286b3edd66a 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_method_object_member_body.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_method_object_member_body.rast @@ -18,6 +18,7 @@ JsModule { l_angle_token: L_ANGLE@8..9 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@9..10 "A" [] [], }, @@ -135,6 +136,7 @@ JsModule { l_angle_token: L_ANGLE@115..116 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@116..117 "R" [] [], }, @@ -253,10 +255,11 @@ JsModule { 0: L_ANGLE@8..9 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@9..10 0: TS_TYPE_PARAMETER@9..10 - 0: TS_TYPE_PARAMETER_NAME@9..10 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@9..10 0: IDENT@9..10 "A" [] [] - 1: (empty) 2: (empty) + 3: (empty) 2: R_ANGLE@10..11 ">" [] [] 4: JS_PARAMETERS@11..24 0: L_PAREN@11..12 "(" [] [] @@ -335,10 +338,11 @@ JsModule { 0: L_ANGLE@115..116 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@116..117 0: TS_TYPE_PARAMETER@116..117 - 0: TS_TYPE_PARAMETER_NAME@116..117 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@116..117 0: IDENT@116..117 "R" [] [] - 1: (empty) 2: (empty) + 3: (empty) 2: R_ANGLE@117..118 ">" [] [] 4: JS_PARAMETERS@118..137 0: L_PAREN@118..119 "(" [] [] diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_new_with_type_arguments.rast b/crates/rome_js_parser/test_data/inline/ok/ts_new_with_type_arguments.rast index 553b15e03f1..e1cd9a54158 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_new_with_type_arguments.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_new_with_type_arguments.rast @@ -12,6 +12,7 @@ JsModule { l_angle_token: L_ANGLE@10..11 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@11..12 "A" [] [], }, @@ -20,6 +21,7 @@ JsModule { }, COMMA@12..14 "," [] [Whitespace(" ")], TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@14..15 "B" [] [], }, @@ -28,6 +30,7 @@ JsModule { }, COMMA@15..17 "," [] [Whitespace(" ")], TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@17..18 "C" [] [], }, @@ -102,22 +105,25 @@ JsModule { 0: L_ANGLE@10..11 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@11..18 0: TS_TYPE_PARAMETER@11..12 - 0: TS_TYPE_PARAMETER_NAME@11..12 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@11..12 0: IDENT@11..12 "A" [] [] - 1: (empty) 2: (empty) + 3: (empty) 1: COMMA@12..14 "," [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER@14..15 - 0: TS_TYPE_PARAMETER_NAME@14..15 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@14..15 0: IDENT@14..15 "B" [] [] - 1: (empty) 2: (empty) + 3: (empty) 3: COMMA@15..17 "," [] [Whitespace(" ")] 4: TS_TYPE_PARAMETER@17..18 - 0: TS_TYPE_PARAMETER_NAME@17..18 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@17..18 0: IDENT@17..18 "C" [] [] - 1: (empty) 2: (empty) + 3: (empty) 2: R_ANGLE@18..20 ">" [] [Whitespace(" ")] 4: (empty) 5: (empty) diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_optional_chain_call.rast b/crates/rome_js_parser/test_data/inline/ok/ts_optional_chain_call.rast index c2955b49372..ae7cd57054f 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_optional_chain_call.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_optional_chain_call.rast @@ -12,6 +12,7 @@ JsModule { l_angle_token: L_ANGLE@1..2 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@2..3 "A" [] [], }, @@ -20,6 +21,7 @@ JsModule { }, COMMA@3..5 "," [] [Whitespace(" ")], TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@5..6 "B" [] [], }, @@ -91,16 +93,18 @@ JsModule { 0: L_ANGLE@1..2 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@2..6 0: TS_TYPE_PARAMETER@2..3 - 0: TS_TYPE_PARAMETER_NAME@2..3 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@2..3 0: IDENT@2..3 "A" [] [] - 1: (empty) 2: (empty) + 3: (empty) 1: COMMA@3..5 "," [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER@5..6 - 0: TS_TYPE_PARAMETER_NAME@5..6 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@5..6 0: IDENT@5..6 "B" [] [] - 1: (empty) 2: (empty) + 3: (empty) 2: R_ANGLE@6..7 ">" [] [] 2: JS_PARAMETERS@7..10 0: L_PAREN@7..8 "(" [] [] diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_property_or_method_signature_member.rast b/crates/rome_js_parser/test_data/inline/ok/ts_property_or_method_signature_member.rast index a99e3b39611..0558abba90e 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_property_or_method_signature_member.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_property_or_method_signature_member.rast @@ -236,6 +236,7 @@ JsModule { l_angle_token: L_ANGLE@189..190 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@190..191 "A" [] [], }, @@ -244,6 +245,7 @@ JsModule { }, COMMA@191..193 "," [] [Whitespace(" ")], TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@193..194 "B" [] [], }, @@ -485,16 +487,18 @@ JsModule { 0: L_ANGLE@189..190 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@190..194 0: TS_TYPE_PARAMETER@190..191 - 0: TS_TYPE_PARAMETER_NAME@190..191 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@190..191 0: IDENT@190..191 "A" [] [] - 1: (empty) 2: (empty) + 3: (empty) 1: COMMA@191..193 "," [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER@193..194 - 0: TS_TYPE_PARAMETER_NAME@193..194 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@193..194 0: IDENT@193..194 "B" [] [] - 1: (empty) 2: (empty) + 3: (empty) 2: R_ANGLE@194..195 ">" [] [] 3: JS_PARAMETERS@195..207 0: L_PAREN@195..196 "(" [] [] diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_template_literal_type.rast b/crates/rome_js_parser/test_data/inline/ok/ts_template_literal_type.rast index ca002c0ad6c..79d2e3034ce 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_template_literal_type.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_template_literal_type.rast @@ -57,6 +57,7 @@ JsModule { l_angle_token: L_ANGLE@39..40 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@40..42 "X" [] [Whitespace(" ")], }, @@ -142,13 +143,14 @@ JsModule { 0: L_ANGLE@39..40 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@40..56 0: TS_TYPE_PARAMETER@40..56 - 0: TS_TYPE_PARAMETER_NAME@40..42 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@40..42 0: IDENT@40..42 "X" [] [Whitespace(" ")] - 1: TS_TYPE_CONSTRAINT_CLAUSE@42..56 + 2: TS_TYPE_CONSTRAINT_CLAUSE@42..56 0: EXTENDS_KW@42..50 "extends" [] [Whitespace(" ")] 1: TS_STRING_TYPE@50..56 0: STRING_KW@50..56 "string" [] [] - 2: (empty) + 3: (empty) 2: R_ANGLE@56..58 ">" [] [Whitespace(" ")] 3: EQ@58..60 "=" [] [Whitespace(" ")] 4: TS_TEMPLATE_LITERAL_TYPE@60..67 diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_type_arguments_left_shift.rast b/crates/rome_js_parser/test_data/inline/ok/ts_type_arguments_left_shift.rast index b75828febe2..a03be322c18 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_type_arguments_left_shift.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_type_arguments_left_shift.rast @@ -11,6 +11,7 @@ JsModule { l_angle_token: L_ANGLE@6..7 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@7..8 "T" [] [], }, @@ -48,6 +49,7 @@ JsModule { l_angle_token: L_ANGLE@26..27 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@27..28 "C" [] [], }, @@ -106,10 +108,11 @@ JsModule { 0: L_ANGLE@6..7 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@7..8 0: TS_TYPE_PARAMETER@7..8 - 0: TS_TYPE_PARAMETER_NAME@7..8 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@7..8 0: IDENT@7..8 "T" [] [] - 1: (empty) 2: (empty) + 3: (empty) 2: R_ANGLE@8..10 ">" [] [Whitespace(" ")] 3: EQ@10..12 "=" [] [Whitespace(" ")] 4: TS_REFERENCE_TYPE@12..13 @@ -134,10 +137,11 @@ JsModule { 0: L_ANGLE@26..27 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@27..28 0: TS_TYPE_PARAMETER@27..28 - 0: TS_TYPE_PARAMETER_NAME@27..28 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@27..28 0: IDENT@27..28 "C" [] [] - 1: (empty) 2: (empty) + 3: (empty) 2: R_ANGLE@28..29 ">" [] [] 1: JS_PARAMETERS@29..36 0: L_PAREN@29..30 "(" [] [] diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_type_constraint_clause.rast b/crates/rome_js_parser/test_data/inline/ok/ts_type_constraint_clause.rast index ba49e5afc91..f9a2d442ed5 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_type_constraint_clause.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_type_constraint_clause.rast @@ -11,6 +11,7 @@ JsModule { l_angle_token: L_ANGLE@6..7 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@7..9 "X" [] [Whitespace(" ")], }, @@ -43,6 +44,7 @@ JsModule { l_angle_token: L_ANGLE@36..37 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@37..39 "X" [] [Whitespace(" ")], }, @@ -108,13 +110,14 @@ JsModule { 0: L_ANGLE@6..7 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@7..23 0: TS_TYPE_PARAMETER@7..23 - 0: TS_TYPE_PARAMETER_NAME@7..9 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@7..9 0: IDENT@7..9 "X" [] [Whitespace(" ")] - 1: TS_TYPE_CONSTRAINT_CLAUSE@9..23 + 2: TS_TYPE_CONSTRAINT_CLAUSE@9..23 0: EXTENDS_KW@9..17 "extends" [] [Whitespace(" ")] 1: TS_NUMBER_TYPE@17..23 0: NUMBER_KW@17..23 "number" [] [] - 2: (empty) + 3: (empty) 2: R_ANGLE@23..25 ">" [] [Whitespace(" ")] 3: EQ@25..27 "=" [] [Whitespace(" ")] 4: TS_REFERENCE_TYPE@27..28 @@ -130,9 +133,10 @@ JsModule { 0: L_ANGLE@36..37 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@37..62 0: TS_TYPE_PARAMETER@37..62 - 0: TS_TYPE_PARAMETER_NAME@37..39 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@37..39 0: IDENT@37..39 "X" [] [Whitespace(" ")] - 1: TS_TYPE_CONSTRAINT_CLAUSE@39..62 + 2: TS_TYPE_CONSTRAINT_CLAUSE@39..62 0: EXTENDS_KW@39..47 "extends" [] [Whitespace(" ")] 1: TS_UNION_TYPE@47..62 0: (empty) @@ -142,7 +146,7 @@ JsModule { 1: PIPE@54..56 "|" [] [Whitespace(" ")] 2: TS_STRING_TYPE@56..62 0: STRING_KW@56..62 "string" [] [] - 2: (empty) + 3: (empty) 2: R_ANGLE@62..64 ">" [] [Whitespace(" ")] 3: EQ@64..66 "=" [] [Whitespace(" ")] 4: TS_OBJECT_TYPE@66..74 diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_type_parameters.rast b/crates/rome_js_parser/test_data/inline/ok/ts_type_parameters.rast index de569ab355b..666d7c01eed 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_type_parameters.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_type_parameters.rast @@ -11,6 +11,7 @@ JsModule { l_angle_token: L_ANGLE@6..7 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@7..9 "X" [] [Whitespace(" ")], }, @@ -24,6 +25,7 @@ JsModule { }, COMMA@23..25 "," [] [Whitespace(" ")], TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@25..27 "Y" [] [Whitespace(" ")], }, @@ -37,6 +39,7 @@ JsModule { }, COMMA@35..37 "," [] [Whitespace(" ")], TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@37..39 "Z" [] [Whitespace(" ")], }, @@ -141,27 +144,30 @@ JsModule { 0: L_ANGLE@6..7 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@7..71 0: TS_TYPE_PARAMETER@7..23 - 0: TS_TYPE_PARAMETER_NAME@7..9 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@7..9 0: IDENT@7..9 "X" [] [Whitespace(" ")] - 1: TS_TYPE_CONSTRAINT_CLAUSE@9..23 + 2: TS_TYPE_CONSTRAINT_CLAUSE@9..23 0: EXTENDS_KW@9..17 "extends" [] [Whitespace(" ")] 1: TS_STRING_TYPE@17..23 0: STRING_KW@17..23 "string" [] [] - 2: (empty) + 3: (empty) 1: COMMA@23..25 "," [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER@25..35 - 0: TS_TYPE_PARAMETER_NAME@25..27 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@25..27 0: IDENT@25..27 "Y" [] [Whitespace(" ")] - 1: (empty) - 2: TS_DEFAULT_TYPE_CLAUSE@27..35 + 2: (empty) + 3: TS_DEFAULT_TYPE_CLAUSE@27..35 0: EQ@27..29 "=" [] [Whitespace(" ")] 1: TS_NUMBER_TYPE@29..35 0: NUMBER_KW@29..35 "number" [] [] 3: COMMA@35..37 "," [] [Whitespace(" ")] 4: TS_TYPE_PARAMETER@37..71 - 0: TS_TYPE_PARAMETER_NAME@37..39 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@37..39 0: IDENT@37..39 "Z" [] [Whitespace(" ")] - 1: TS_TYPE_CONSTRAINT_CLAUSE@39..63 + 2: TS_TYPE_CONSTRAINT_CLAUSE@39..63 0: EXTENDS_KW@39..47 "extends" [] [Whitespace(" ")] 1: TS_UNION_TYPE@47..63 0: (empty) @@ -171,7 +177,7 @@ JsModule { 1: PIPE@54..56 "|" [] [Whitespace(" ")] 2: TS_NUMBER_TYPE@56..63 0: NUMBER_KW@56..63 "number" [] [Whitespace(" ")] - 2: TS_DEFAULT_TYPE_CLAUSE@63..71 + 3: TS_DEFAULT_TYPE_CLAUSE@63..71 0: EQ@63..65 "=" [] [Whitespace(" ")] 1: TS_NUMBER_TYPE@65..71 0: NUMBER_KW@65..71 "number" [] [] diff --git a/crates/rome_js_parser/test_data/inline/ok/tsx_type_arguments.rast b/crates/rome_js_parser/test_data/inline/ok/tsx_type_arguments.rast index 2e403f071e3..6874db5c508 100644 --- a/crates/rome_js_parser/test_data/inline/ok/tsx_type_arguments.rast +++ b/crates/rome_js_parser/test_data/inline/ok/tsx_type_arguments.rast @@ -9,6 +9,7 @@ JsModule { l_angle_token: L_ANGLE@0..35 "<" [Comments("// These are valid ty ..."), Newline("\n")] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@35..37 "A" [] [Whitespace(" ")], }, @@ -49,6 +50,7 @@ JsModule { l_angle_token: L_ANGLE@56..58 "<" [Newline("\n")] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@58..59 "A" [] [], }, @@ -86,6 +88,7 @@ JsModule { l_angle_token: L_ANGLE@76..78 "<" [Newline("\n")] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@78..79 "A" [] [], }, @@ -94,6 +97,7 @@ JsModule { }, COMMA@79..81 "," [] [Whitespace(" ")], TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@81..82 "B" [] [], }, @@ -126,6 +130,7 @@ JsModule { l_angle_token: L_ANGLE@92..94 "<" [Newline("\n")] [], items: TsTypeParameterList [ TsTypeParameter { + modifier: missing (optional), name: TsTypeParameterName { ident_token: IDENT@94..96 "A" [] [Whitespace(" ")], }, @@ -185,15 +190,16 @@ JsModule { 0: L_ANGLE@0..35 "<" [Comments("// These are valid ty ..."), Newline("\n")] [] 1: TS_TYPE_PARAMETER_LIST@35..46 0: TS_TYPE_PARAMETER@35..46 - 0: TS_TYPE_PARAMETER_NAME@35..37 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@35..37 0: IDENT@35..37 "A" [] [Whitespace(" ")] - 1: TS_TYPE_CONSTRAINT_CLAUSE@37..46 + 2: TS_TYPE_CONSTRAINT_CLAUSE@37..46 0: EXTENDS_KW@37..45 "extends" [] [Whitespace(" ")] 1: TS_REFERENCE_TYPE@45..46 0: JS_REFERENCE_IDENTIFIER@45..46 0: IDENT@45..46 "B" [] [] 1: (empty) - 2: (empty) + 3: (empty) 2: R_ANGLE@46..47 ">" [] [] 2: JS_PARAMETERS@47..50 0: L_PAREN@47..48 "(" [] [] @@ -214,10 +220,11 @@ JsModule { 0: L_ANGLE@56..58 "<" [Newline("\n")] [] 1: TS_TYPE_PARAMETER_LIST@58..66 0: TS_TYPE_PARAMETER@58..66 - 0: TS_TYPE_PARAMETER_NAME@58..59 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@58..59 0: IDENT@58..59 "A" [] [] - 1: (empty) - 2: TS_DEFAULT_TYPE_CLAUSE@59..66 + 2: (empty) + 3: TS_DEFAULT_TYPE_CLAUSE@59..66 0: EQ@59..60 "=" [] [] 1: TS_STRING_TYPE@60..66 0: STRING_KW@60..66 "string" [] [] @@ -241,16 +248,18 @@ JsModule { 0: L_ANGLE@76..78 "<" [Newline("\n")] [] 1: TS_TYPE_PARAMETER_LIST@78..82 0: TS_TYPE_PARAMETER@78..79 - 0: TS_TYPE_PARAMETER_NAME@78..79 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@78..79 0: IDENT@78..79 "A" [] [] - 1: (empty) 2: (empty) + 3: (empty) 1: COMMA@79..81 "," [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER@81..82 - 0: TS_TYPE_PARAMETER_NAME@81..82 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@81..82 0: IDENT@81..82 "B" [] [] - 1: (empty) 2: (empty) + 3: (empty) 2: R_ANGLE@82..83 ">" [] [] 2: JS_PARAMETERS@83..86 0: L_PAREN@83..84 "(" [] [] @@ -271,9 +280,10 @@ JsModule { 0: L_ANGLE@92..94 "<" [Newline("\n")] [] 1: TS_TYPE_PARAMETER_LIST@94..108 0: TS_TYPE_PARAMETER@94..108 - 0: TS_TYPE_PARAMETER_NAME@94..96 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@94..96 0: IDENT@94..96 "A" [] [Whitespace(" ")] - 1: TS_TYPE_CONSTRAINT_CLAUSE@96..108 + 2: TS_TYPE_CONSTRAINT_CLAUSE@96..108 0: EXTENDS_KW@96..104 "extends" [] [Whitespace(" ")] 1: TS_REFERENCE_TYPE@104..108 0: JS_REFERENCE_IDENTIFIER@104..105 @@ -286,7 +296,7 @@ JsModule { 0: IDENT@106..107 "C" [] [] 1: (empty) 2: R_ANGLE@107..108 ">" [] [] - 2: (empty) + 3: (empty) 2: R_ANGLE@108..109 ">" [] [] 2: JS_PARAMETERS@109..112 0: L_PAREN@109..110 "(" [] [] diff --git a/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.rast b/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.rast new file mode 100644 index 00000000000..c19c9b4c7f2 --- /dev/null +++ b/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.rast @@ -0,0 +1,581 @@ +JsModule { + interpreter_token: missing (optional), + directives: JsDirectiveList [], + items: JsModuleItemList [ + TsTypeAliasDeclaration { + type_token: TYPE_KW@0..5 "type" [] [Whitespace(" ")], + binding_identifier: TsIdentifierBinding { + name_token: IDENT@5..8 "Foo" [] [], + }, + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@8..9 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: IN_KW@9..12 "in" [] [Whitespace(" ")], + out_token: missing (optional), + }, + name: TsTypeParameterName { + ident_token: IDENT@12..13 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@13..15 ">" [] [Whitespace(" ")], + }, + eq_token: EQ@15..17 "=" [] [Whitespace(" ")], + ty: TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@17..18 "T" [] [], + }, + type_arguments: missing (optional), + }, + semicolon_token: missing (optional), + }, + TsTypeAliasDeclaration { + type_token: TYPE_KW@18..24 "type" [Newline("\n")] [Whitespace(" ")], + binding_identifier: TsIdentifierBinding { + name_token: IDENT@24..27 "Foo" [] [], + }, + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@27..28 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: missing (optional), + out_token: OUT_KW@28..32 "out" [] [Whitespace(" ")], + }, + name: TsTypeParameterName { + ident_token: IDENT@32..33 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@33..35 ">" [] [Whitespace(" ")], + }, + eq_token: EQ@35..37 "=" [] [Whitespace(" ")], + ty: TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@37..38 "T" [] [], + }, + type_arguments: missing (optional), + }, + semicolon_token: missing (optional), + }, + TsTypeAliasDeclaration { + type_token: TYPE_KW@38..44 "type" [Newline("\n")] [Whitespace(" ")], + binding_identifier: TsIdentifierBinding { + name_token: IDENT@44..47 "Foo" [] [], + }, + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@47..48 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: IN_KW@48..51 "in" [] [Whitespace(" ")], + out_token: OUT_KW@51..54 "out" [] [], + }, + name: missing (required), + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@54..56 ">" [] [Whitespace(" ")], + }, + eq_token: EQ@56..58 "=" [] [Whitespace(" ")], + ty: TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@58..59 "T" [] [], + }, + type_arguments: missing (optional), + }, + semicolon_token: missing (optional), + }, + TsTypeAliasDeclaration { + type_token: TYPE_KW@59..65 "type" [Newline("\n")] [Whitespace(" ")], + binding_identifier: TsIdentifierBinding { + name_token: IDENT@65..68 "Foo" [] [], + }, + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@68..69 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: missing (optional), + out_token: OUT_KW@69..73 "out" [] [Whitespace(" ")], + }, + name: TsTypeParameterName { + ident_token: IDENT@73..76 "out" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@76..78 ">" [] [Whitespace(" ")], + }, + eq_token: EQ@78..80 "=" [] [Whitespace(" ")], + ty: TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@80..81 "T" [] [], + }, + type_arguments: missing (optional), + }, + semicolon_token: missing (optional), + }, + TsTypeAliasDeclaration { + type_token: TYPE_KW@81..87 "type" [Newline("\n")] [Whitespace(" ")], + binding_identifier: TsIdentifierBinding { + name_token: IDENT@87..90 "Foo" [] [], + }, + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@90..91 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: IN_KW@91..94 "in" [] [Whitespace(" ")], + out_token: OUT_KW@94..98 "out" [] [Whitespace(" ")], + }, + name: TsTypeParameterName { + ident_token: IDENT@98..101 "out" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@101..103 ">" [] [Whitespace(" ")], + }, + eq_token: EQ@103..105 "=" [] [Whitespace(" ")], + ty: TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@105..106 "T" [] [], + }, + type_arguments: missing (optional), + }, + semicolon_token: missing (optional), + }, + TsTypeAliasDeclaration { + type_token: TYPE_KW@106..112 "type" [Newline("\n")] [Whitespace(" ")], + binding_identifier: TsIdentifierBinding { + name_token: IDENT@112..115 "Foo" [] [], + }, + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@115..116 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: IN_KW@116..119 "in" [] [Whitespace(" ")], + out_token: missing (optional), + }, + name: TsTypeParameterName { + ident_token: IDENT@119..120 "X" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + COMMA@120..122 "," [] [Whitespace(" ")], + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: missing (optional), + out_token: OUT_KW@122..126 "out" [] [Whitespace(" ")], + }, + name: TsTypeParameterName { + ident_token: IDENT@126..127 "Y" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@127..129 ">" [] [Whitespace(" ")], + }, + eq_token: EQ@129..131 "=" [] [Whitespace(" ")], + ty: TsTupleType { + l_brack_token: L_BRACK@131..132 "[" [] [], + elements: TsTupleTypeElementList [ + TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@132..133 "X" [] [], + }, + type_arguments: missing (optional), + }, + COMMA@133..135 "," [] [Whitespace(" ")], + TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@135..136 "Y" [] [], + }, + type_arguments: missing (optional), + }, + ], + r_brack_token: R_BRACK@136..137 "]" [] [], + }, + semicolon_token: missing (optional), + }, + TsTypeAliasDeclaration { + type_token: TYPE_KW@137..143 "type" [Newline("\n")] [Whitespace(" ")], + binding_identifier: TsIdentifierBinding { + name_token: IDENT@143..146 "Foo" [] [], + }, + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@146..147 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: missing (optional), + out_token: OUT_KW@147..151 "out" [] [Whitespace(" ")], + }, + name: TsTypeParameterName { + ident_token: IDENT@151..152 "X" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + COMMA@152..154 "," [] [Whitespace(" ")], + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: IN_KW@154..157 "in" [] [Whitespace(" ")], + out_token: missing (optional), + }, + name: TsTypeParameterName { + ident_token: IDENT@157..158 "Y" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@158..160 ">" [] [Whitespace(" ")], + }, + eq_token: EQ@160..162 "=" [] [Whitespace(" ")], + ty: TsTupleType { + l_brack_token: L_BRACK@162..163 "[" [] [], + elements: TsTupleTypeElementList [ + TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@163..164 "X" [] [], + }, + type_arguments: missing (optional), + }, + COMMA@164..166 "," [] [Whitespace(" ")], + TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@166..167 "Y" [] [], + }, + type_arguments: missing (optional), + }, + ], + r_brack_token: R_BRACK@167..168 "]" [] [], + }, + semicolon_token: missing (optional), + }, + TsTypeAliasDeclaration { + type_token: TYPE_KW@168..174 "type" [Newline("\n")] [Whitespace(" ")], + binding_identifier: TsIdentifierBinding { + name_token: IDENT@174..177 "Foo" [] [], + }, + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@177..178 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: missing (optional), + out_token: OUT_KW@178..182 "out" [] [Whitespace(" ")], + }, + name: TsTypeParameterName { + ident_token: IDENT@182..183 "X" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + COMMA@183..185 "," [] [Whitespace(" ")], + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: missing (optional), + out_token: OUT_KW@185..189 "out" [] [Whitespace(" ")], + }, + name: TsTypeParameterName { + ident_token: IDENT@189..191 "Y" [] [Whitespace(" ")], + }, + constraint: TsTypeConstraintClause { + extends_token: EXTENDS_KW@191..199 "extends" [] [Whitespace(" ")], + ty: TsTypeOperatorType { + operator_token: KEYOF_KW@199..205 "keyof" [] [Whitespace(" ")], + ty: TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@205..206 "X" [] [], + }, + type_arguments: missing (optional), + }, + }, + }, + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@206..208 ">" [] [Whitespace(" ")], + }, + eq_token: EQ@208..210 "=" [] [Whitespace(" ")], + ty: TsTupleType { + l_brack_token: L_BRACK@210..211 "[" [] [], + elements: TsTupleTypeElementList [ + TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@211..212 "X" [] [], + }, + type_arguments: missing (optional), + }, + COMMA@212..214 "," [] [Whitespace(" ")], + TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@214..215 "Y" [] [], + }, + type_arguments: missing (optional), + }, + ], + r_brack_token: R_BRACK@215..216 "]" [] [], + }, + semicolon_token: missing (optional), + }, + ], + eof_token: EOF@216..217 "" [Newline("\n")] [], +} + +0: JS_MODULE@0..217 + 0: (empty) + 1: JS_DIRECTIVE_LIST@0..0 + 2: JS_MODULE_ITEM_LIST@0..216 + 0: TS_TYPE_ALIAS_DECLARATION@0..18 + 0: TYPE_KW@0..5 "type" [] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@5..8 + 0: IDENT@5..8 "Foo" [] [] + 2: TS_TYPE_PARAMETERS@8..15 + 0: L_ANGLE@8..9 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@9..13 + 0: TS_TYPE_PARAMETER@9..13 + 0: TS_TYPE_PARAMETER_MODIFIER@9..12 + 0: IN_KW@9..12 "in" [] [Whitespace(" ")] + 1: (empty) + 1: TS_TYPE_PARAMETER_NAME@12..13 + 0: IDENT@12..13 "T" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@13..15 ">" [] [Whitespace(" ")] + 3: EQ@15..17 "=" [] [Whitespace(" ")] + 4: TS_REFERENCE_TYPE@17..18 + 0: JS_REFERENCE_IDENTIFIER@17..18 + 0: IDENT@17..18 "T" [] [] + 1: (empty) + 5: (empty) + 1: TS_TYPE_ALIAS_DECLARATION@18..38 + 0: TYPE_KW@18..24 "type" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@24..27 + 0: IDENT@24..27 "Foo" [] [] + 2: TS_TYPE_PARAMETERS@27..35 + 0: L_ANGLE@27..28 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@28..33 + 0: TS_TYPE_PARAMETER@28..33 + 0: TS_TYPE_PARAMETER_MODIFIER@28..32 + 0: (empty) + 1: OUT_KW@28..32 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@32..33 + 0: IDENT@32..33 "T" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@33..35 ">" [] [Whitespace(" ")] + 3: EQ@35..37 "=" [] [Whitespace(" ")] + 4: TS_REFERENCE_TYPE@37..38 + 0: JS_REFERENCE_IDENTIFIER@37..38 + 0: IDENT@37..38 "T" [] [] + 1: (empty) + 5: (empty) + 2: TS_TYPE_ALIAS_DECLARATION@38..59 + 0: TYPE_KW@38..44 "type" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@44..47 + 0: IDENT@44..47 "Foo" [] [] + 2: TS_TYPE_PARAMETERS@47..56 + 0: L_ANGLE@47..48 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@48..54 + 0: TS_TYPE_PARAMETER@48..54 + 0: TS_TYPE_PARAMETER_MODIFIER@48..54 + 0: IN_KW@48..51 "in" [] [Whitespace(" ")] + 1: OUT_KW@51..54 "out" [] [] + 1: (empty) + 2: (empty) + 3: (empty) + 2: R_ANGLE@54..56 ">" [] [Whitespace(" ")] + 3: EQ@56..58 "=" [] [Whitespace(" ")] + 4: TS_REFERENCE_TYPE@58..59 + 0: JS_REFERENCE_IDENTIFIER@58..59 + 0: IDENT@58..59 "T" [] [] + 1: (empty) + 5: (empty) + 3: TS_TYPE_ALIAS_DECLARATION@59..81 + 0: TYPE_KW@59..65 "type" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@65..68 + 0: IDENT@65..68 "Foo" [] [] + 2: TS_TYPE_PARAMETERS@68..78 + 0: L_ANGLE@68..69 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@69..76 + 0: TS_TYPE_PARAMETER@69..76 + 0: TS_TYPE_PARAMETER_MODIFIER@69..73 + 0: (empty) + 1: OUT_KW@69..73 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@73..76 + 0: IDENT@73..76 "out" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@76..78 ">" [] [Whitespace(" ")] + 3: EQ@78..80 "=" [] [Whitespace(" ")] + 4: TS_REFERENCE_TYPE@80..81 + 0: JS_REFERENCE_IDENTIFIER@80..81 + 0: IDENT@80..81 "T" [] [] + 1: (empty) + 5: (empty) + 4: TS_TYPE_ALIAS_DECLARATION@81..106 + 0: TYPE_KW@81..87 "type" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@87..90 + 0: IDENT@87..90 "Foo" [] [] + 2: TS_TYPE_PARAMETERS@90..103 + 0: L_ANGLE@90..91 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@91..101 + 0: TS_TYPE_PARAMETER@91..101 + 0: TS_TYPE_PARAMETER_MODIFIER@91..98 + 0: IN_KW@91..94 "in" [] [Whitespace(" ")] + 1: OUT_KW@94..98 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@98..101 + 0: IDENT@98..101 "out" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@101..103 ">" [] [Whitespace(" ")] + 3: EQ@103..105 "=" [] [Whitespace(" ")] + 4: TS_REFERENCE_TYPE@105..106 + 0: JS_REFERENCE_IDENTIFIER@105..106 + 0: IDENT@105..106 "T" [] [] + 1: (empty) + 5: (empty) + 5: TS_TYPE_ALIAS_DECLARATION@106..137 + 0: TYPE_KW@106..112 "type" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@112..115 + 0: IDENT@112..115 "Foo" [] [] + 2: TS_TYPE_PARAMETERS@115..129 + 0: L_ANGLE@115..116 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@116..127 + 0: TS_TYPE_PARAMETER@116..120 + 0: TS_TYPE_PARAMETER_MODIFIER@116..119 + 0: IN_KW@116..119 "in" [] [Whitespace(" ")] + 1: (empty) + 1: TS_TYPE_PARAMETER_NAME@119..120 + 0: IDENT@119..120 "X" [] [] + 2: (empty) + 3: (empty) + 1: COMMA@120..122 "," [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER@122..127 + 0: TS_TYPE_PARAMETER_MODIFIER@122..126 + 0: (empty) + 1: OUT_KW@122..126 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@126..127 + 0: IDENT@126..127 "Y" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@127..129 ">" [] [Whitespace(" ")] + 3: EQ@129..131 "=" [] [Whitespace(" ")] + 4: TS_TUPLE_TYPE@131..137 + 0: L_BRACK@131..132 "[" [] [] + 1: TS_TUPLE_TYPE_ELEMENT_LIST@132..136 + 0: TS_REFERENCE_TYPE@132..133 + 0: JS_REFERENCE_IDENTIFIER@132..133 + 0: IDENT@132..133 "X" [] [] + 1: (empty) + 1: COMMA@133..135 "," [] [Whitespace(" ")] + 2: TS_REFERENCE_TYPE@135..136 + 0: JS_REFERENCE_IDENTIFIER@135..136 + 0: IDENT@135..136 "Y" [] [] + 1: (empty) + 2: R_BRACK@136..137 "]" [] [] + 5: (empty) + 6: TS_TYPE_ALIAS_DECLARATION@137..168 + 0: TYPE_KW@137..143 "type" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@143..146 + 0: IDENT@143..146 "Foo" [] [] + 2: TS_TYPE_PARAMETERS@146..160 + 0: L_ANGLE@146..147 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@147..158 + 0: TS_TYPE_PARAMETER@147..152 + 0: TS_TYPE_PARAMETER_MODIFIER@147..151 + 0: (empty) + 1: OUT_KW@147..151 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@151..152 + 0: IDENT@151..152 "X" [] [] + 2: (empty) + 3: (empty) + 1: COMMA@152..154 "," [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER@154..158 + 0: TS_TYPE_PARAMETER_MODIFIER@154..157 + 0: IN_KW@154..157 "in" [] [Whitespace(" ")] + 1: (empty) + 1: TS_TYPE_PARAMETER_NAME@157..158 + 0: IDENT@157..158 "Y" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@158..160 ">" [] [Whitespace(" ")] + 3: EQ@160..162 "=" [] [Whitespace(" ")] + 4: TS_TUPLE_TYPE@162..168 + 0: L_BRACK@162..163 "[" [] [] + 1: TS_TUPLE_TYPE_ELEMENT_LIST@163..167 + 0: TS_REFERENCE_TYPE@163..164 + 0: JS_REFERENCE_IDENTIFIER@163..164 + 0: IDENT@163..164 "X" [] [] + 1: (empty) + 1: COMMA@164..166 "," [] [Whitespace(" ")] + 2: TS_REFERENCE_TYPE@166..167 + 0: JS_REFERENCE_IDENTIFIER@166..167 + 0: IDENT@166..167 "Y" [] [] + 1: (empty) + 2: R_BRACK@167..168 "]" [] [] + 5: (empty) + 7: TS_TYPE_ALIAS_DECLARATION@168..216 + 0: TYPE_KW@168..174 "type" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@174..177 + 0: IDENT@174..177 "Foo" [] [] + 2: TS_TYPE_PARAMETERS@177..208 + 0: L_ANGLE@177..178 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@178..206 + 0: TS_TYPE_PARAMETER@178..183 + 0: TS_TYPE_PARAMETER_MODIFIER@178..182 + 0: (empty) + 1: OUT_KW@178..182 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@182..183 + 0: IDENT@182..183 "X" [] [] + 2: (empty) + 3: (empty) + 1: COMMA@183..185 "," [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER@185..206 + 0: TS_TYPE_PARAMETER_MODIFIER@185..189 + 0: (empty) + 1: OUT_KW@185..189 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@189..191 + 0: IDENT@189..191 "Y" [] [Whitespace(" ")] + 2: TS_TYPE_CONSTRAINT_CLAUSE@191..206 + 0: EXTENDS_KW@191..199 "extends" [] [Whitespace(" ")] + 1: TS_TYPE_OPERATOR_TYPE@199..206 + 0: KEYOF_KW@199..205 "keyof" [] [Whitespace(" ")] + 1: TS_REFERENCE_TYPE@205..206 + 0: JS_REFERENCE_IDENTIFIER@205..206 + 0: IDENT@205..206 "X" [] [] + 1: (empty) + 3: (empty) + 2: R_ANGLE@206..208 ">" [] [Whitespace(" ")] + 3: EQ@208..210 "=" [] [Whitespace(" ")] + 4: TS_TUPLE_TYPE@210..216 + 0: L_BRACK@210..211 "[" [] [] + 1: TS_TUPLE_TYPE_ELEMENT_LIST@211..215 + 0: TS_REFERENCE_TYPE@211..212 + 0: JS_REFERENCE_IDENTIFIER@211..212 + 0: IDENT@211..212 "X" [] [] + 1: (empty) + 1: COMMA@212..214 "," [] [Whitespace(" ")] + 2: TS_REFERENCE_TYPE@214..215 + 0: JS_REFERENCE_IDENTIFIER@214..215 + 0: IDENT@214..215 "Y" [] [] + 1: (empty) + 2: R_BRACK@215..216 "]" [] [] + 5: (empty) + 3: EOF@216..217 "" [Newline("\n")] [] diff --git a/crates/rome_js_syntax/src/generated/kind.rs b/crates/rome_js_syntax/src/generated/kind.rs index a9994788b92..fc573c8e0e2 100644 --- a/crates/rome_js_syntax/src/generated/kind.rs +++ b/crates/rome_js_syntax/src/generated/kind.rs @@ -147,6 +147,7 @@ pub enum JsSyntaxKind { BIGINT_KW, OVERRIDE_KW, OF_KW, + OUT_KW, JS_NUMBER_LITERAL, JS_BIG_INT_LITERAL, JS_STRING_LITERAL, @@ -421,6 +422,7 @@ pub enum JsSyntaxKind { TS_TYPE_PARAMETERS, TS_TYPE_PARAMETER_LIST, TS_TYPE_PARAMETER, + TS_TYPE_PARAMETER_MODIFIER, TS_TYPE_PARAMETER_NAME, TS_TYPE_CONSTRAINT_CLAUSE, TS_DEFAULT_TYPE_CLAUSE, @@ -636,6 +638,7 @@ impl JsSyntaxKind { "bigint" => BIGINT_KW, "override" => OVERRIDE_KW, "of" => OF_KW, + "out" => OUT_KW, _ => return None, }; Some(kw) @@ -779,6 +782,7 @@ impl JsSyntaxKind { BIGINT_KW => "bigint", OVERRIDE_KW => "override", OF_KW => "of", + OUT_KW => "out", JS_STRING_LITERAL => "string literal", _ => return None, }; @@ -787,4 +791,4 @@ impl JsSyntaxKind { } #[doc = r" Utility macro for creating a SyntaxKind through simple macro syntax"] #[macro_export] -macro_rules ! T { [;] => { $ crate :: JsSyntaxKind :: SEMICOLON } ; [,] => { $ crate :: JsSyntaxKind :: COMMA } ; ['('] => { $ crate :: JsSyntaxKind :: L_PAREN } ; [')'] => { $ crate :: JsSyntaxKind :: R_PAREN } ; ['{'] => { $ crate :: JsSyntaxKind :: L_CURLY } ; ['}'] => { $ crate :: JsSyntaxKind :: R_CURLY } ; ['['] => { $ crate :: JsSyntaxKind :: L_BRACK } ; [']'] => { $ crate :: JsSyntaxKind :: R_BRACK } ; [<] => { $ crate :: JsSyntaxKind :: L_ANGLE } ; [>] => { $ crate :: JsSyntaxKind :: R_ANGLE } ; [~] => { $ crate :: JsSyntaxKind :: TILDE } ; [?] => { $ crate :: JsSyntaxKind :: QUESTION } ; [??] => { $ crate :: JsSyntaxKind :: QUESTION2 } ; [?.] => { $ crate :: JsSyntaxKind :: QUESTIONDOT } ; [&] => { $ crate :: JsSyntaxKind :: AMP } ; [|] => { $ crate :: JsSyntaxKind :: PIPE } ; [+] => { $ crate :: JsSyntaxKind :: PLUS } ; [++] => { $ crate :: JsSyntaxKind :: PLUS2 } ; [*] => { $ crate :: JsSyntaxKind :: STAR } ; [**] => { $ crate :: JsSyntaxKind :: STAR2 } ; [/] => { $ crate :: JsSyntaxKind :: SLASH } ; [^] => { $ crate :: JsSyntaxKind :: CARET } ; [%] => { $ crate :: JsSyntaxKind :: PERCENT } ; [.] => { $ crate :: JsSyntaxKind :: DOT } ; [...] => { $ crate :: JsSyntaxKind :: DOT3 } ; [:] => { $ crate :: JsSyntaxKind :: COLON } ; [=] => { $ crate :: JsSyntaxKind :: EQ } ; [==] => { $ crate :: JsSyntaxKind :: EQ2 } ; [===] => { $ crate :: JsSyntaxKind :: EQ3 } ; [=>] => { $ crate :: JsSyntaxKind :: FAT_ARROW } ; [!] => { $ crate :: JsSyntaxKind :: BANG } ; [!=] => { $ crate :: JsSyntaxKind :: NEQ } ; [!==] => { $ crate :: JsSyntaxKind :: NEQ2 } ; [-] => { $ crate :: JsSyntaxKind :: MINUS } ; [--] => { $ crate :: JsSyntaxKind :: MINUS2 } ; [<=] => { $ crate :: JsSyntaxKind :: LTEQ } ; [>=] => { $ crate :: JsSyntaxKind :: GTEQ } ; [+=] => { $ crate :: JsSyntaxKind :: PLUSEQ } ; [-=] => { $ crate :: JsSyntaxKind :: MINUSEQ } ; [|=] => { $ crate :: JsSyntaxKind :: PIPEEQ } ; [&=] => { $ crate :: JsSyntaxKind :: AMPEQ } ; [^=] => { $ crate :: JsSyntaxKind :: CARETEQ } ; [/=] => { $ crate :: JsSyntaxKind :: SLASHEQ } ; [*=] => { $ crate :: JsSyntaxKind :: STAREQ } ; [%=] => { $ crate :: JsSyntaxKind :: PERCENTEQ } ; [&&] => { $ crate :: JsSyntaxKind :: AMP2 } ; [||] => { $ crate :: JsSyntaxKind :: PIPE2 } ; [<<] => { $ crate :: JsSyntaxKind :: SHL } ; [>>] => { $ crate :: JsSyntaxKind :: SHR } ; [>>>] => { $ crate :: JsSyntaxKind :: USHR } ; [<<=] => { $ crate :: JsSyntaxKind :: SHLEQ } ; [>>=] => { $ crate :: JsSyntaxKind :: SHREQ } ; [>>>=] => { $ crate :: JsSyntaxKind :: USHREQ } ; [&&=] => { $ crate :: JsSyntaxKind :: AMP2EQ } ; [||=] => { $ crate :: JsSyntaxKind :: PIPE2EQ } ; [**=] => { $ crate :: JsSyntaxKind :: STAR2EQ } ; [??=] => { $ crate :: JsSyntaxKind :: QUESTION2EQ } ; [@] => { $ crate :: JsSyntaxKind :: AT } ; ['`'] => { $ crate :: JsSyntaxKind :: BACKTICK } ; [break] => { $ crate :: JsSyntaxKind :: BREAK_KW } ; [case] => { $ crate :: JsSyntaxKind :: CASE_KW } ; [catch] => { $ crate :: JsSyntaxKind :: CATCH_KW } ; [class] => { $ crate :: JsSyntaxKind :: CLASS_KW } ; [const] => { $ crate :: JsSyntaxKind :: CONST_KW } ; [continue] => { $ crate :: JsSyntaxKind :: CONTINUE_KW } ; [debugger] => { $ crate :: JsSyntaxKind :: DEBUGGER_KW } ; [default] => { $ crate :: JsSyntaxKind :: DEFAULT_KW } ; [delete] => { $ crate :: JsSyntaxKind :: DELETE_KW } ; [do] => { $ crate :: JsSyntaxKind :: DO_KW } ; [else] => { $ crate :: JsSyntaxKind :: ELSE_KW } ; [enum] => { $ crate :: JsSyntaxKind :: ENUM_KW } ; [export] => { $ crate :: JsSyntaxKind :: EXPORT_KW } ; [extends] => { $ crate :: JsSyntaxKind :: EXTENDS_KW } ; [false] => { $ crate :: JsSyntaxKind :: FALSE_KW } ; [finally] => { $ crate :: JsSyntaxKind :: FINALLY_KW } ; [for] => { $ crate :: JsSyntaxKind :: FOR_KW } ; [function] => { $ crate :: JsSyntaxKind :: FUNCTION_KW } ; [if] => { $ crate :: JsSyntaxKind :: IF_KW } ; [in] => { $ crate :: JsSyntaxKind :: IN_KW } ; [instanceof] => { $ crate :: JsSyntaxKind :: INSTANCEOF_KW } ; [import] => { $ crate :: JsSyntaxKind :: IMPORT_KW } ; [new] => { $ crate :: JsSyntaxKind :: NEW_KW } ; [null] => { $ crate :: JsSyntaxKind :: NULL_KW } ; [return] => { $ crate :: JsSyntaxKind :: RETURN_KW } ; [super] => { $ crate :: JsSyntaxKind :: SUPER_KW } ; [switch] => { $ crate :: JsSyntaxKind :: SWITCH_KW } ; [this] => { $ crate :: JsSyntaxKind :: THIS_KW } ; [throw] => { $ crate :: JsSyntaxKind :: THROW_KW } ; [try] => { $ crate :: JsSyntaxKind :: TRY_KW } ; [true] => { $ crate :: JsSyntaxKind :: TRUE_KW } ; [typeof] => { $ crate :: JsSyntaxKind :: TYPEOF_KW } ; [var] => { $ crate :: JsSyntaxKind :: VAR_KW } ; [void] => { $ crate :: JsSyntaxKind :: VOID_KW } ; [while] => { $ crate :: JsSyntaxKind :: WHILE_KW } ; [with] => { $ crate :: JsSyntaxKind :: WITH_KW } ; [implements] => { $ crate :: JsSyntaxKind :: IMPLEMENTS_KW } ; [interface] => { $ crate :: JsSyntaxKind :: INTERFACE_KW } ; [let] => { $ crate :: JsSyntaxKind :: LET_KW } ; [package] => { $ crate :: JsSyntaxKind :: PACKAGE_KW } ; [private] => { $ crate :: JsSyntaxKind :: PRIVATE_KW } ; [protected] => { $ crate :: JsSyntaxKind :: PROTECTED_KW } ; [public] => { $ crate :: JsSyntaxKind :: PUBLIC_KW } ; [static] => { $ crate :: JsSyntaxKind :: STATIC_KW } ; [yield] => { $ crate :: JsSyntaxKind :: YIELD_KW } ; [abstract] => { $ crate :: JsSyntaxKind :: ABSTRACT_KW } ; [as] => { $ crate :: JsSyntaxKind :: AS_KW } ; [asserts] => { $ crate :: JsSyntaxKind :: ASSERTS_KW } ; [assert] => { $ crate :: JsSyntaxKind :: ASSERT_KW } ; [any] => { $ crate :: JsSyntaxKind :: ANY_KW } ; [async] => { $ crate :: JsSyntaxKind :: ASYNC_KW } ; [await] => { $ crate :: JsSyntaxKind :: AWAIT_KW } ; [boolean] => { $ crate :: JsSyntaxKind :: BOOLEAN_KW } ; [constructor] => { $ crate :: JsSyntaxKind :: CONSTRUCTOR_KW } ; [declare] => { $ crate :: JsSyntaxKind :: DECLARE_KW } ; [get] => { $ crate :: JsSyntaxKind :: GET_KW } ; [infer] => { $ crate :: JsSyntaxKind :: INFER_KW } ; [is] => { $ crate :: JsSyntaxKind :: IS_KW } ; [keyof] => { $ crate :: JsSyntaxKind :: KEYOF_KW } ; [module] => { $ crate :: JsSyntaxKind :: MODULE_KW } ; [namespace] => { $ crate :: JsSyntaxKind :: NAMESPACE_KW } ; [never] => { $ crate :: JsSyntaxKind :: NEVER_KW } ; [readonly] => { $ crate :: JsSyntaxKind :: READONLY_KW } ; [require] => { $ crate :: JsSyntaxKind :: REQUIRE_KW } ; [number] => { $ crate :: JsSyntaxKind :: NUMBER_KW } ; [object] => { $ crate :: JsSyntaxKind :: OBJECT_KW } ; [set] => { $ crate :: JsSyntaxKind :: SET_KW } ; [string] => { $ crate :: JsSyntaxKind :: STRING_KW } ; [symbol] => { $ crate :: JsSyntaxKind :: SYMBOL_KW } ; [type] => { $ crate :: JsSyntaxKind :: TYPE_KW } ; [undefined] => { $ crate :: JsSyntaxKind :: UNDEFINED_KW } ; [unique] => { $ crate :: JsSyntaxKind :: UNIQUE_KW } ; [unknown] => { $ crate :: JsSyntaxKind :: UNKNOWN_KW } ; [from] => { $ crate :: JsSyntaxKind :: FROM_KW } ; [global] => { $ crate :: JsSyntaxKind :: GLOBAL_KW } ; [bigint] => { $ crate :: JsSyntaxKind :: BIGINT_KW } ; [override] => { $ crate :: JsSyntaxKind :: OVERRIDE_KW } ; [of] => { $ crate :: JsSyntaxKind :: OF_KW } ; [ident] => { $ crate :: JsSyntaxKind :: IDENT } ; [EOF] => { $ crate :: JsSyntaxKind :: EOF } ; [#] => { $ crate :: JsSyntaxKind :: HASH } ; } +macro_rules ! T { [;] => { $ crate :: JsSyntaxKind :: SEMICOLON } ; [,] => { $ crate :: JsSyntaxKind :: COMMA } ; ['('] => { $ crate :: JsSyntaxKind :: L_PAREN } ; [')'] => { $ crate :: JsSyntaxKind :: R_PAREN } ; ['{'] => { $ crate :: JsSyntaxKind :: L_CURLY } ; ['}'] => { $ crate :: JsSyntaxKind :: R_CURLY } ; ['['] => { $ crate :: JsSyntaxKind :: L_BRACK } ; [']'] => { $ crate :: JsSyntaxKind :: R_BRACK } ; [<] => { $ crate :: JsSyntaxKind :: L_ANGLE } ; [>] => { $ crate :: JsSyntaxKind :: R_ANGLE } ; [~] => { $ crate :: JsSyntaxKind :: TILDE } ; [?] => { $ crate :: JsSyntaxKind :: QUESTION } ; [??] => { $ crate :: JsSyntaxKind :: QUESTION2 } ; [?.] => { $ crate :: JsSyntaxKind :: QUESTIONDOT } ; [&] => { $ crate :: JsSyntaxKind :: AMP } ; [|] => { $ crate :: JsSyntaxKind :: PIPE } ; [+] => { $ crate :: JsSyntaxKind :: PLUS } ; [++] => { $ crate :: JsSyntaxKind :: PLUS2 } ; [*] => { $ crate :: JsSyntaxKind :: STAR } ; [**] => { $ crate :: JsSyntaxKind :: STAR2 } ; [/] => { $ crate :: JsSyntaxKind :: SLASH } ; [^] => { $ crate :: JsSyntaxKind :: CARET } ; [%] => { $ crate :: JsSyntaxKind :: PERCENT } ; [.] => { $ crate :: JsSyntaxKind :: DOT } ; [...] => { $ crate :: JsSyntaxKind :: DOT3 } ; [:] => { $ crate :: JsSyntaxKind :: COLON } ; [=] => { $ crate :: JsSyntaxKind :: EQ } ; [==] => { $ crate :: JsSyntaxKind :: EQ2 } ; [===] => { $ crate :: JsSyntaxKind :: EQ3 } ; [=>] => { $ crate :: JsSyntaxKind :: FAT_ARROW } ; [!] => { $ crate :: JsSyntaxKind :: BANG } ; [!=] => { $ crate :: JsSyntaxKind :: NEQ } ; [!==] => { $ crate :: JsSyntaxKind :: NEQ2 } ; [-] => { $ crate :: JsSyntaxKind :: MINUS } ; [--] => { $ crate :: JsSyntaxKind :: MINUS2 } ; [<=] => { $ crate :: JsSyntaxKind :: LTEQ } ; [>=] => { $ crate :: JsSyntaxKind :: GTEQ } ; [+=] => { $ crate :: JsSyntaxKind :: PLUSEQ } ; [-=] => { $ crate :: JsSyntaxKind :: MINUSEQ } ; [|=] => { $ crate :: JsSyntaxKind :: PIPEEQ } ; [&=] => { $ crate :: JsSyntaxKind :: AMPEQ } ; [^=] => { $ crate :: JsSyntaxKind :: CARETEQ } ; [/=] => { $ crate :: JsSyntaxKind :: SLASHEQ } ; [*=] => { $ crate :: JsSyntaxKind :: STAREQ } ; [%=] => { $ crate :: JsSyntaxKind :: PERCENTEQ } ; [&&] => { $ crate :: JsSyntaxKind :: AMP2 } ; [||] => { $ crate :: JsSyntaxKind :: PIPE2 } ; [<<] => { $ crate :: JsSyntaxKind :: SHL } ; [>>] => { $ crate :: JsSyntaxKind :: SHR } ; [>>>] => { $ crate :: JsSyntaxKind :: USHR } ; [<<=] => { $ crate :: JsSyntaxKind :: SHLEQ } ; [>>=] => { $ crate :: JsSyntaxKind :: SHREQ } ; [>>>=] => { $ crate :: JsSyntaxKind :: USHREQ } ; [&&=] => { $ crate :: JsSyntaxKind :: AMP2EQ } ; [||=] => { $ crate :: JsSyntaxKind :: PIPE2EQ } ; [**=] => { $ crate :: JsSyntaxKind :: STAR2EQ } ; [??=] => { $ crate :: JsSyntaxKind :: QUESTION2EQ } ; [@] => { $ crate :: JsSyntaxKind :: AT } ; ['`'] => { $ crate :: JsSyntaxKind :: BACKTICK } ; [break] => { $ crate :: JsSyntaxKind :: BREAK_KW } ; [case] => { $ crate :: JsSyntaxKind :: CASE_KW } ; [catch] => { $ crate :: JsSyntaxKind :: CATCH_KW } ; [class] => { $ crate :: JsSyntaxKind :: CLASS_KW } ; [const] => { $ crate :: JsSyntaxKind :: CONST_KW } ; [continue] => { $ crate :: JsSyntaxKind :: CONTINUE_KW } ; [debugger] => { $ crate :: JsSyntaxKind :: DEBUGGER_KW } ; [default] => { $ crate :: JsSyntaxKind :: DEFAULT_KW } ; [delete] => { $ crate :: JsSyntaxKind :: DELETE_KW } ; [do] => { $ crate :: JsSyntaxKind :: DO_KW } ; [else] => { $ crate :: JsSyntaxKind :: ELSE_KW } ; [enum] => { $ crate :: JsSyntaxKind :: ENUM_KW } ; [export] => { $ crate :: JsSyntaxKind :: EXPORT_KW } ; [extends] => { $ crate :: JsSyntaxKind :: EXTENDS_KW } ; [false] => { $ crate :: JsSyntaxKind :: FALSE_KW } ; [finally] => { $ crate :: JsSyntaxKind :: FINALLY_KW } ; [for] => { $ crate :: JsSyntaxKind :: FOR_KW } ; [function] => { $ crate :: JsSyntaxKind :: FUNCTION_KW } ; [if] => { $ crate :: JsSyntaxKind :: IF_KW } ; [in] => { $ crate :: JsSyntaxKind :: IN_KW } ; [instanceof] => { $ crate :: JsSyntaxKind :: INSTANCEOF_KW } ; [import] => { $ crate :: JsSyntaxKind :: IMPORT_KW } ; [new] => { $ crate :: JsSyntaxKind :: NEW_KW } ; [null] => { $ crate :: JsSyntaxKind :: NULL_KW } ; [return] => { $ crate :: JsSyntaxKind :: RETURN_KW } ; [super] => { $ crate :: JsSyntaxKind :: SUPER_KW } ; [switch] => { $ crate :: JsSyntaxKind :: SWITCH_KW } ; [this] => { $ crate :: JsSyntaxKind :: THIS_KW } ; [throw] => { $ crate :: JsSyntaxKind :: THROW_KW } ; [try] => { $ crate :: JsSyntaxKind :: TRY_KW } ; [true] => { $ crate :: JsSyntaxKind :: TRUE_KW } ; [typeof] => { $ crate :: JsSyntaxKind :: TYPEOF_KW } ; [var] => { $ crate :: JsSyntaxKind :: VAR_KW } ; [void] => { $ crate :: JsSyntaxKind :: VOID_KW } ; [while] => { $ crate :: JsSyntaxKind :: WHILE_KW } ; [with] => { $ crate :: JsSyntaxKind :: WITH_KW } ; [implements] => { $ crate :: JsSyntaxKind :: IMPLEMENTS_KW } ; [interface] => { $ crate :: JsSyntaxKind :: INTERFACE_KW } ; [let] => { $ crate :: JsSyntaxKind :: LET_KW } ; [package] => { $ crate :: JsSyntaxKind :: PACKAGE_KW } ; [private] => { $ crate :: JsSyntaxKind :: PRIVATE_KW } ; [protected] => { $ crate :: JsSyntaxKind :: PROTECTED_KW } ; [public] => { $ crate :: JsSyntaxKind :: PUBLIC_KW } ; [static] => { $ crate :: JsSyntaxKind :: STATIC_KW } ; [yield] => { $ crate :: JsSyntaxKind :: YIELD_KW } ; [abstract] => { $ crate :: JsSyntaxKind :: ABSTRACT_KW } ; [as] => { $ crate :: JsSyntaxKind :: AS_KW } ; [asserts] => { $ crate :: JsSyntaxKind :: ASSERTS_KW } ; [assert] => { $ crate :: JsSyntaxKind :: ASSERT_KW } ; [any] => { $ crate :: JsSyntaxKind :: ANY_KW } ; [async] => { $ crate :: JsSyntaxKind :: ASYNC_KW } ; [await] => { $ crate :: JsSyntaxKind :: AWAIT_KW } ; [boolean] => { $ crate :: JsSyntaxKind :: BOOLEAN_KW } ; [constructor] => { $ crate :: JsSyntaxKind :: CONSTRUCTOR_KW } ; [declare] => { $ crate :: JsSyntaxKind :: DECLARE_KW } ; [get] => { $ crate :: JsSyntaxKind :: GET_KW } ; [infer] => { $ crate :: JsSyntaxKind :: INFER_KW } ; [is] => { $ crate :: JsSyntaxKind :: IS_KW } ; [keyof] => { $ crate :: JsSyntaxKind :: KEYOF_KW } ; [module] => { $ crate :: JsSyntaxKind :: MODULE_KW } ; [namespace] => { $ crate :: JsSyntaxKind :: NAMESPACE_KW } ; [never] => { $ crate :: JsSyntaxKind :: NEVER_KW } ; [readonly] => { $ crate :: JsSyntaxKind :: READONLY_KW } ; [require] => { $ crate :: JsSyntaxKind :: REQUIRE_KW } ; [number] => { $ crate :: JsSyntaxKind :: NUMBER_KW } ; [object] => { $ crate :: JsSyntaxKind :: OBJECT_KW } ; [set] => { $ crate :: JsSyntaxKind :: SET_KW } ; [string] => { $ crate :: JsSyntaxKind :: STRING_KW } ; [symbol] => { $ crate :: JsSyntaxKind :: SYMBOL_KW } ; [type] => { $ crate :: JsSyntaxKind :: TYPE_KW } ; [undefined] => { $ crate :: JsSyntaxKind :: UNDEFINED_KW } ; [unique] => { $ crate :: JsSyntaxKind :: UNIQUE_KW } ; [unknown] => { $ crate :: JsSyntaxKind :: UNKNOWN_KW } ; [from] => { $ crate :: JsSyntaxKind :: FROM_KW } ; [global] => { $ crate :: JsSyntaxKind :: GLOBAL_KW } ; [bigint] => { $ crate :: JsSyntaxKind :: BIGINT_KW } ; [override] => { $ crate :: JsSyntaxKind :: OVERRIDE_KW } ; [of] => { $ crate :: JsSyntaxKind :: OF_KW } ; [out] => { $ crate :: JsSyntaxKind :: OUT_KW } ; [ident] => { $ crate :: JsSyntaxKind :: IDENT } ; [EOF] => { $ crate :: JsSyntaxKind :: EOF } ; [#] => { $ crate :: JsSyntaxKind :: HASH } ; } diff --git a/crates/rome_js_syntax/src/generated/macros.rs b/crates/rome_js_syntax/src/generated/macros.rs index e73d92ffdf1..7665110de5d 100644 --- a/crates/rome_js_syntax/src/generated/macros.rs +++ b/crates/rome_js_syntax/src/generated/macros.rs @@ -1150,6 +1150,10 @@ macro_rules! map_syntax_node { let $pattern = unsafe { $crate::TsTypeParameter::new_unchecked(node) }; $body } + $crate::JsSyntaxKind::TS_TYPE_PARAMETER_MODIFIER => { + let $pattern = unsafe { $crate::TsTypeParameterModifier::new_unchecked(node) }; + $body + } $crate::JsSyntaxKind::TS_TYPE_PARAMETER_NAME => { let $pattern = unsafe { $crate::TsTypeParameterName::new_unchecked(node) }; $body diff --git a/crates/rome_js_syntax/src/generated/nodes.rs b/crates/rome_js_syntax/src/generated/nodes.rs index d973b681f4e..620c9cfa931 100644 --- a/crates/rome_js_syntax/src/generated/nodes.rs +++ b/crates/rome_js_syntax/src/generated/nodes.rs @@ -11589,18 +11589,22 @@ impl TsTypeParameter { pub const unsafe fn new_unchecked(syntax: SyntaxNode) -> Self { Self { syntax } } pub fn as_fields(&self) -> TsTypeParameterFields { TsTypeParameterFields { + modifier: self.modifier(), name: self.name(), constraint: self.constraint(), default: self.default(), } } + pub fn modifier(&self) -> Option { + support::node(&self.syntax, 0usize) + } pub fn name(&self) -> SyntaxResult { - support::required_node(&self.syntax, 0usize) + support::required_node(&self.syntax, 1usize) } pub fn constraint(&self) -> Option { - support::node(&self.syntax, 1usize) + support::node(&self.syntax, 2usize) } - pub fn default(&self) -> Option { support::node(&self.syntax, 2usize) } + pub fn default(&self) -> Option { support::node(&self.syntax, 3usize) } } #[cfg(feature = "serde")] impl Serialize for TsTypeParameter { @@ -11613,11 +11617,47 @@ impl Serialize for TsTypeParameter { } #[cfg_attr(feature = "serde", derive(Serialize), serde(crate = "serde_crate"))] pub struct TsTypeParameterFields { + pub modifier: Option, pub name: SyntaxResult, pub constraint: Option, pub default: Option, } #[derive(Clone, PartialEq, Eq, Hash)] +pub struct TsTypeParameterModifier { + pub(crate) syntax: SyntaxNode, +} +impl TsTypeParameterModifier { + #[doc = r" Create an AstNode from a SyntaxNode without checking its kind"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r" This function must be guarded with a call to [AstNode::can_cast]"] + #[doc = r" or a match on [SyntaxNode::kind]"] + #[inline] + pub const unsafe fn new_unchecked(syntax: SyntaxNode) -> Self { Self { syntax } } + pub fn as_fields(&self) -> TsTypeParameterModifierFields { + TsTypeParameterModifierFields { + in_token: self.in_token(), + out_token: self.out_token(), + } + } + pub fn in_token(&self) -> Option { support::token(&self.syntax, 0usize) } + pub fn out_token(&self) -> Option { support::token(&self.syntax, 1usize) } +} +#[cfg(feature = "serde")] +impl Serialize for TsTypeParameterModifier { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + self.as_fields().serialize(serializer) + } +} +#[cfg_attr(feature = "serde", derive(Serialize), serde(crate = "serde_crate"))] +pub struct TsTypeParameterModifierFields { + pub in_token: Option, + pub out_token: Option, +} +#[derive(Clone, PartialEq, Eq, Hash)] pub struct TsTypeParameterName { pub(crate) syntax: SyntaxNode, } @@ -23464,6 +23504,7 @@ impl AstNode for TsTypeParameter { impl std::fmt::Debug for TsTypeParameter { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.debug_struct("TsTypeParameter") + .field("modifier", &support::DebugOptionalElement(self.modifier())) .field("name", &support::DebugSyntaxResult(self.name())) .field( "constraint", @@ -23479,6 +23520,35 @@ impl From for SyntaxNode { impl From for SyntaxElement { fn from(n: TsTypeParameter) -> SyntaxElement { n.syntax.into() } } +impl AstNode for TsTypeParameterModifier { + type Language = Language; + fn can_cast(kind: SyntaxKind) -> bool { kind == TS_TYPE_PARAMETER_MODIFIER } + fn cast(syntax: SyntaxNode) -> Option { + if Self::can_cast(syntax.kind()) { + Some(Self { syntax }) + } else { + None + } + } + fn syntax(&self) -> &SyntaxNode { &self.syntax } +} +impl std::fmt::Debug for TsTypeParameterModifier { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("TsTypeParameterModifier") + .field("in_token", &support::DebugOptionalElement(self.in_token())) + .field( + "out_token", + &support::DebugOptionalElement(self.out_token()), + ) + .finish() + } +} +impl From for SyntaxNode { + fn from(n: TsTypeParameterModifier) -> SyntaxNode { n.syntax } +} +impl From for SyntaxElement { + fn from(n: TsTypeParameterModifier) -> SyntaxElement { n.syntax.into() } +} impl AstNode for TsTypeParameterName { type Language = Language; fn can_cast(kind: SyntaxKind) -> bool { kind == TS_TYPE_PARAMETER_NAME } @@ -31454,6 +31524,11 @@ impl std::fmt::Display for TsTypeParameter { std::fmt::Display::fmt(self.syntax(), f) } } +impl std::fmt::Display for TsTypeParameterModifier { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + std::fmt::Display::fmt(self.syntax(), f) + } +} impl std::fmt::Display for TsTypeParameterName { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { std::fmt::Display::fmt(self.syntax(), f) diff --git a/crates/rome_js_syntax/src/generated/syntax_factory.rs b/crates/rome_js_syntax/src/generated/syntax_factory.rs index 4fc150eeb58..340c616ad53 100644 --- a/crates/rome_js_syntax/src/generated/syntax_factory.rs +++ b/crates/rome_js_syntax/src/generated/syntax_factory.rs @@ -9253,8 +9253,15 @@ impl SyntaxFactory for JsSyntaxFactory { } TS_TYPE_PARAMETER => { let mut elements = (&children).into_iter(); - let mut slots: RawNodeSlots<3usize> = RawNodeSlots::default(); + let mut slots: RawNodeSlots<4usize> = RawNodeSlots::default(); let mut current_element = elements.next(); + if let Some(element) = ¤t_element { + if TsTypeParameterModifier::can_cast(element.kind()) { + slots.mark_present(); + current_element = elements.next(); + } + } + slots.next_slot(); if let Some(element) = ¤t_element { if TsTypeParameterName::can_cast(element.kind()) { slots.mark_present(); @@ -9284,6 +9291,32 @@ impl SyntaxFactory for JsSyntaxFactory { } slots.into_node(TS_TYPE_PARAMETER, children) } + TS_TYPE_PARAMETER_MODIFIER => { + let mut elements = (&children).into_iter(); + let mut slots: RawNodeSlots<2usize> = RawNodeSlots::default(); + let mut current_element = elements.next(); + if let Some(element) = ¤t_element { + if element.kind() == T![in] { + slots.mark_present(); + current_element = elements.next(); + } + } + slots.next_slot(); + if let Some(element) = ¤t_element { + if element.kind() == T![out] { + slots.mark_present(); + current_element = elements.next(); + } + } + slots.next_slot(); + if current_element.is_some() { + return RawSyntaxNode::new( + TS_TYPE_PARAMETER_MODIFIER.to_unknown(), + children.into_iter().map(Some), + ); + } + slots.into_node(TS_TYPE_PARAMETER_MODIFIER, children) + } TS_TYPE_PARAMETER_NAME => { let mut elements = (&children).into_iter(); let mut slots: RawNodeSlots<1usize> = RawNodeSlots::default(); diff --git a/xtask/codegen/js.ungram b/xtask/codegen/js.ungram index b6070ea410f..79f9b628dc7 100644 --- a/xtask/codegen/js.ungram +++ b/xtask/codegen/js.ungram @@ -1880,10 +1880,15 @@ TsTypeParameterList = (TsTypeParameter (',' TsTypeParameter)* ','?) // type A = { b: B } // ^^^^^^^^^^^^^^^^^^^^^^ TsTypeParameter = + modifier: TsTypeParameterModifier? name: TsTypeParameterName constraint: TsTypeConstraintClause? default: TsDefaultTypeClause? +TsTypeParameterModifier = + 'in'? + 'out'? + TsTypeParameterName = 'ident' TsTypeConstraintClause = diff --git a/xtask/codegen/src/kinds_src.rs b/xtask/codegen/src/kinds_src.rs index f6bf168e29a..eb4c0e09896 100644 --- a/xtask/codegen/src/kinds_src.rs +++ b/xtask/codegen/src/kinds_src.rs @@ -160,6 +160,7 @@ pub const JS_KINDS_SRC: KindsSrc = KindsSrc { "bigint", "override", "of", + "out" ], literals: &[ "JS_NUMBER_LITERAL", @@ -441,6 +442,7 @@ pub const JS_KINDS_SRC: KindsSrc = KindsSrc { "TS_TYPE_PARAMETERS", "TS_TYPE_PARAMETER_LIST", "TS_TYPE_PARAMETER", + "TS_TYPE_PARAMETER_MODIFIER", "TS_TYPE_PARAMETER_NAME", "TS_TYPE_CONSTRAINT_CLAUSE", "TS_DEFAULT_TYPE_CLAUSE", From 65500faa066d5d54e7f9c0a11967209e35c1689d Mon Sep 17 00:00:00 2001 From: IWANABETHATGUY Date: Sun, 8 May 2022 22:37:04 +0800 Subject: [PATCH 02/22] =?UTF-8?q?fix:=20=F0=9F=90=9B=20parse=20error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ts/bindings/type_parameter_modifier.rs | 5 ++- .../src/syntax/typescript/types.rs | 42 +++++++++---------- .../inline/ok/type_parameter_modifier.rast | 13 +++--- .../{err => ok}/type_parameter_modifier.ts | 0 crates/rome_js_syntax/src/lib.rs | 2 +- 5 files changed, 32 insertions(+), 30 deletions(-) rename crates/rome_js_parser/test_data/inline/{err => ok}/type_parameter_modifier.ts (100%) diff --git a/crates/rome_js_formatter/src/ts/bindings/type_parameter_modifier.rs b/crates/rome_js_formatter/src/ts/bindings/type_parameter_modifier.rs index 4b032e03f98..29504a53869 100644 --- a/crates/rome_js_formatter/src/ts/bindings/type_parameter_modifier.rs +++ b/crates/rome_js_formatter/src/ts/bindings/type_parameter_modifier.rs @@ -10,8 +10,9 @@ impl FormatNode for TsTypeParameterModifier { out_token, } = self.as_fields(); Ok(format_elements![ - in_token.format_or_empty(formatter)?, - out_token.format_or_empty(formatter)? + empty_element() + // in_token.format_or_empty(formatter)?, + // out_token.format_or_empty(formatter)? ]) } } diff --git a/crates/rome_js_parser/src/syntax/typescript/types.rs b/crates/rome_js_parser/src/syntax/typescript/types.rs index 61f955c286d..6a0a276dabd 100644 --- a/crates/rome_js_parser/src/syntax/typescript/types.rs +++ b/crates/rome_js_parser/src/syntax/typescript/types.rs @@ -85,13 +85,7 @@ fn parse_ts_call_signature(p: &mut Parser) { parse_ts_return_type_annotation(p).ok(); } -/// in current context, out keyword we count as identifier fn parse_ts_type_parameter_name(p: &mut Parser) -> ParsedSyntax { - if p.at(T![out]) { - let m = p.start(); - p.bump_remap(T![ident]); - return Present(m.complete(p, TS_TYPE_PARAMETER_NAME)); - } parse_identifier(p, TS_TYPE_PARAMETER_NAME) } @@ -152,7 +146,7 @@ impl ParseSeparatedList for TsTypeParameterList { } } -// test_err ts type_parameter_modifier +// test ts type_parameter_modifier // type Foo = T // type Foo = T // type Foo = T @@ -163,16 +157,15 @@ impl ParseSeparatedList for TsTypeParameterList { // type Foo = [X, Y] fn parse_ts_type_parameter_modifier(p: &mut Parser) -> ParsedSyntax { let m = p.start(); - let mut has_any = false; - if p.at(T![in]) { - p.expect(T![in]); - has_any = true; - } - if p.at(T![out]) { - p.expect(T![out]); - has_any = true; + + // try to eat `in` modifier + let mut has_any_modifier = p.eat(T![in]); + + if p.at(T![out]) && !p.nth_at(1, T![,]) && !p.nth_at(1, T![>]) { + p.bump(T![out]); + has_any_modifier = true; } - if !has_any { + if !has_any_modifier { m.abandon(p); return Absent; } @@ -180,12 +173,17 @@ fn parse_ts_type_parameter_modifier(p: &mut Parser) -> ParsedSyntax { } fn parse_ts_type_parameter(p: &mut Parser) -> ParsedSyntax { - parse_ts_type_parameter_name(p).map(|name| { - let m = name.precede(p); - parse_ts_type_constraint_clause(p).ok(); - parse_ts_default_type_clause(p).ok(); - m.complete(p, TS_TYPE_PARAMETER) - }) + let m = p.start(); + parse_ts_type_parameter_modifier(p).ok(); + let name = parse_ts_type_parameter_name(p); + parse_ts_type_constraint_clause(p).ok(); + parse_ts_default_type_clause(p).ok(); + if name.is_absent() { + m.abandon(p); + Absent + } else { + Present(m.complete(p, TS_TYPE_PARAMETER)) + } } // test ts ts_type_constraint_clause diff --git a/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.rast b/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.rast index c19c9b4c7f2..15ba189372e 100644 --- a/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.rast +++ b/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.rast @@ -75,9 +75,11 @@ JsModule { TsTypeParameter { modifier: TsTypeParameterModifier { in_token: IN_KW@48..51 "in" [] [Whitespace(" ")], - out_token: OUT_KW@51..54 "out" [] [], + out_token: missing (optional), + }, + name: TsTypeParameterName { + ident_token: IDENT@51..54 "out" [] [], }, - name: missing (required), constraint: missing (optional), default: missing (optional), }, @@ -394,10 +396,11 @@ JsModule { 0: L_ANGLE@47..48 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@48..54 0: TS_TYPE_PARAMETER@48..54 - 0: TS_TYPE_PARAMETER_MODIFIER@48..54 + 0: TS_TYPE_PARAMETER_MODIFIER@48..51 0: IN_KW@48..51 "in" [] [Whitespace(" ")] - 1: OUT_KW@51..54 "out" [] [] - 1: (empty) + 1: (empty) + 1: TS_TYPE_PARAMETER_NAME@51..54 + 0: IDENT@51..54 "out" [] [] 2: (empty) 3: (empty) 2: R_ANGLE@54..56 ">" [] [Whitespace(" ")] diff --git a/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.ts b/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.ts similarity index 100% rename from crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.ts rename to crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.ts diff --git a/crates/rome_js_syntax/src/lib.rs b/crates/rome_js_syntax/src/lib.rs index 82325d82f92..ea6aa1f259e 100644 --- a/crates/rome_js_syntax/src/lib.rs +++ b/crates/rome_js_syntax/src/lib.rs @@ -58,7 +58,7 @@ impl JsSyntaxKind { #[inline] pub const fn is_contextual_keyword(self) -> bool { (self as u16) >= (JsSyntaxKind::ABSTRACT_KW as u16) - && (self as u16) <= (JsSyntaxKind::OF_KW as u16) + && (self as u16) <= (JsSyntaxKind::OUT_KW as u16) } /// Returns true for all non-contextual keywords (includes future reserved keywords) From c4f8eaeee9b4a8999a41b1b81c380b8a811812c4 Mon Sep 17 00:00:00 2001 From: IWANABETHATGUY Date: Sun, 8 May 2022 22:56:06 +0800 Subject: [PATCH 03/22] =?UTF-8?q?test:=20=F0=9F=92=8D=20update=20more=20te?= =?UTF-8?q?st=20case?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/syntax/typescript/types.rs | 24 +- .../inline/ok/type_parameter_modifier.rast | 534 +++++++++++++++++- .../inline/ok/type_parameter_modifier.ts | 11 + 3 files changed, 552 insertions(+), 17 deletions(-) diff --git a/crates/rome_js_parser/src/syntax/typescript/types.rs b/crates/rome_js_parser/src/syntax/typescript/types.rs index 6a0a276dabd..8e979a890d3 100644 --- a/crates/rome_js_parser/src/syntax/typescript/types.rs +++ b/crates/rome_js_parser/src/syntax/typescript/types.rs @@ -155,6 +155,17 @@ impl ParseSeparatedList for TsTypeParameterList { // type Foo = [X, Y] // type Foo = [X, Y] // type Foo = [X, Y] +// +// class Foo {} +// class Foo {} +// export default class Foo {} +// class Foo {} +// interface Foo {} +// interface Foo {} +// declare class Foo {} +// declare class Foo {} +// declare interface Foo {} +// declare interface Foo {} fn parse_ts_type_parameter_modifier(p: &mut Parser) -> ParsedSyntax { let m = p.start(); @@ -1378,19 +1389,6 @@ fn parse_ts_type_member_semi(p: &mut Parser) { // TODO: finish all this testing -// expectPrintedTS(t, "class Foo {}", "class Foo {\n}\n") -// expectPrintedTS(t, "class Foo {}", "class Foo {\n}\n") -// expectPrintedTS(t, "export default class Foo {}", "export default class Foo {\n}\n") -// expectPrintedTS(t, "export default class Foo {}", "export default class Foo {\n}\n") -// expectPrintedTS(t, "export default class {}", "export default class {\n}\n") -// expectPrintedTS(t, "export default class {}", "export default class {\n}\n") -// expectPrintedTS(t, "interface Foo {}", "") -// expectPrintedTS(t, "interface Foo {}", "") -// expectPrintedTS(t, "declare class Foo {}", "") -// expectPrintedTS(t, "declare class Foo {}", "") -// expectPrintedTS(t, "declare interface Foo {}", "") -// expectPrintedTS(t, "declare interface Foo {}", "") - // expectParseErrorTS(t, "type Foo = T", ": ERROR: Expected identifier but found \"i\\\\u006E\"\n") // expectParseErrorTS(t, "type Foo = T", ": ERROR: Expected \">\" but found \"T\"\n") // expectParseErrorTS(t, "type Foo = T", ": ERROR: The modifier \"in\" is not valid here:\n: ERROR: Expected identifier but found \">\"\n") diff --git a/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.rast b/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.rast index 15ba189372e..ae134c726bc 100644 --- a/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.rast +++ b/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.rast @@ -336,14 +336,315 @@ JsModule { }, semicolon_token: missing (optional), }, + JsClassDeclaration { + abstract_token: missing (optional), + class_token: CLASS_KW@216..262 "class" [Newline("\n"), Whitespace(" ..."), Newline("\n")] [Whitespace(" ")], + id: JsIdentifierBinding { + name_token: IDENT@262..265 "Foo" [] [], + }, + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@265..266 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: IN_KW@266..269 "in" [] [Whitespace(" ")], + out_token: missing (optional), + }, + name: TsTypeParameterName { + ident_token: IDENT@269..270 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@270..272 ">" [] [Whitespace(" ")], + }, + extends_clause: missing (optional), + implements_clause: missing (optional), + l_curly_token: L_CURLY@272..273 "{" [] [], + members: JsClassMemberList [], + r_curly_token: R_CURLY@273..274 "}" [] [], + }, + JsClassDeclaration { + abstract_token: missing (optional), + class_token: CLASS_KW@274..281 "class" [Newline("\n")] [Whitespace(" ")], + id: JsIdentifierBinding { + name_token: IDENT@281..284 "Foo" [] [], + }, + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@284..285 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: missing (optional), + out_token: OUT_KW@285..289 "out" [] [Whitespace(" ")], + }, + name: TsTypeParameterName { + ident_token: IDENT@289..290 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@290..292 ">" [] [Whitespace(" ")], + }, + extends_clause: missing (optional), + implements_clause: missing (optional), + l_curly_token: L_CURLY@292..293 "{" [] [], + members: JsClassMemberList [], + r_curly_token: R_CURLY@293..294 "}" [] [], + }, + JsExport { + export_token: EXPORT_KW@294..302 "export" [Newline("\n")] [Whitespace(" ")], + export_clause: JsExportDefaultDeclarationClause { + default_token: DEFAULT_KW@302..310 "default" [] [Whitespace(" ")], + declaration: JsClassExportDefaultDeclaration { + abstract_token: missing (optional), + class_token: CLASS_KW@310..316 "class" [] [Whitespace(" ")], + id: JsIdentifierBinding { + name_token: IDENT@316..319 "Foo" [] [], + }, + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@319..320 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: IN_KW@320..323 "in" [] [Whitespace(" ")], + out_token: missing (optional), + }, + name: TsTypeParameterName { + ident_token: IDENT@323..324 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@324..326 ">" [] [Whitespace(" ")], + }, + extends_clause: missing (optional), + implements_clause: missing (optional), + l_curly_token: L_CURLY@326..327 "{" [] [], + members: JsClassMemberList [], + r_curly_token: R_CURLY@327..328 "}" [] [], + }, + semicolon_token: missing (optional), + }, + }, + JsClassDeclaration { + abstract_token: missing (optional), + class_token: CLASS_KW@328..335 "class" [Newline("\n")] [Whitespace(" ")], + id: JsIdentifierBinding { + name_token: IDENT@335..338 "Foo" [] [], + }, + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@338..339 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: missing (optional), + out_token: OUT_KW@339..343 "out" [] [Whitespace(" ")], + }, + name: TsTypeParameterName { + ident_token: IDENT@343..344 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@344..346 ">" [] [Whitespace(" ")], + }, + extends_clause: missing (optional), + implements_clause: missing (optional), + l_curly_token: L_CURLY@346..347 "{" [] [], + members: JsClassMemberList [], + r_curly_token: R_CURLY@347..348 "}" [] [], + }, + TsInterfaceDeclaration { + interface_token: INTERFACE_KW@348..359 "interface" [Newline("\n")] [Whitespace(" ")], + id: TsIdentifierBinding { + name_token: IDENT@359..362 "Foo" [] [], + }, + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@362..363 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: IN_KW@363..366 "in" [] [Whitespace(" ")], + out_token: missing (optional), + }, + name: TsTypeParameterName { + ident_token: IDENT@366..367 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@367..369 ">" [] [Whitespace(" ")], + }, + extends_clause: missing (optional), + l_curly_token: L_CURLY@369..370 "{" [] [], + members: TsTypeMemberList [], + r_curly_token: R_CURLY@370..371 "}" [] [], + }, + TsInterfaceDeclaration { + interface_token: INTERFACE_KW@371..382 "interface" [Newline("\n")] [Whitespace(" ")], + id: TsIdentifierBinding { + name_token: IDENT@382..385 "Foo" [] [], + }, + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@385..386 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: missing (optional), + out_token: OUT_KW@386..390 "out" [] [Whitespace(" ")], + }, + name: TsTypeParameterName { + ident_token: IDENT@390..391 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@391..393 ">" [] [Whitespace(" ")], + }, + extends_clause: missing (optional), + l_curly_token: L_CURLY@393..394 "{" [] [], + members: TsTypeMemberList [], + r_curly_token: R_CURLY@394..395 "}" [] [], + }, + TsDeclareStatement { + declare_token: DECLARE_KW@395..404 "declare" [Newline("\n")] [Whitespace(" ")], + declaration: JsClassDeclaration { + abstract_token: missing (optional), + class_token: CLASS_KW@404..410 "class" [] [Whitespace(" ")], + id: JsIdentifierBinding { + name_token: IDENT@410..413 "Foo" [] [], + }, + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@413..414 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: IN_KW@414..417 "in" [] [Whitespace(" ")], + out_token: missing (optional), + }, + name: TsTypeParameterName { + ident_token: IDENT@417..418 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@418..420 ">" [] [Whitespace(" ")], + }, + extends_clause: missing (optional), + implements_clause: missing (optional), + l_curly_token: L_CURLY@420..421 "{" [] [], + members: JsClassMemberList [], + r_curly_token: R_CURLY@421..422 "}" [] [], + }, + }, + TsDeclareStatement { + declare_token: DECLARE_KW@422..431 "declare" [Newline("\n")] [Whitespace(" ")], + declaration: JsClassDeclaration { + abstract_token: missing (optional), + class_token: CLASS_KW@431..437 "class" [] [Whitespace(" ")], + id: JsIdentifierBinding { + name_token: IDENT@437..440 "Foo" [] [], + }, + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@440..441 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: missing (optional), + out_token: OUT_KW@441..445 "out" [] [Whitespace(" ")], + }, + name: TsTypeParameterName { + ident_token: IDENT@445..446 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@446..448 ">" [] [Whitespace(" ")], + }, + extends_clause: missing (optional), + implements_clause: missing (optional), + l_curly_token: L_CURLY@448..449 "{" [] [], + members: JsClassMemberList [], + r_curly_token: R_CURLY@449..450 "}" [] [], + }, + }, + TsDeclareStatement { + declare_token: DECLARE_KW@450..459 "declare" [Newline("\n")] [Whitespace(" ")], + declaration: TsInterfaceDeclaration { + interface_token: INTERFACE_KW@459..469 "interface" [] [Whitespace(" ")], + id: TsIdentifierBinding { + name_token: IDENT@469..472 "Foo" [] [], + }, + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@472..473 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: IN_KW@473..476 "in" [] [Whitespace(" ")], + out_token: missing (optional), + }, + name: TsTypeParameterName { + ident_token: IDENT@476..477 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@477..479 ">" [] [Whitespace(" ")], + }, + extends_clause: missing (optional), + l_curly_token: L_CURLY@479..480 "{" [] [], + members: TsTypeMemberList [], + r_curly_token: R_CURLY@480..481 "}" [] [], + }, + }, + TsDeclareStatement { + declare_token: DECLARE_KW@481..490 "declare" [Newline("\n")] [Whitespace(" ")], + declaration: TsInterfaceDeclaration { + interface_token: INTERFACE_KW@490..500 "interface" [] [Whitespace(" ")], + id: TsIdentifierBinding { + name_token: IDENT@500..503 "Foo" [] [], + }, + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@503..504 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: missing (optional), + out_token: OUT_KW@504..508 "out" [] [Whitespace(" ")], + }, + name: TsTypeParameterName { + ident_token: IDENT@508..509 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@509..511 ">" [] [Whitespace(" ")], + }, + extends_clause: missing (optional), + l_curly_token: L_CURLY@511..512 "{" [] [], + members: TsTypeMemberList [], + r_curly_token: R_CURLY@512..513 "}" [] [], + }, + }, ], - eof_token: EOF@216..217 "" [Newline("\n")] [], + eof_token: EOF@513..514 "" [Newline("\n")] [], } -0: JS_MODULE@0..217 +0: JS_MODULE@0..514 0: (empty) 1: JS_DIRECTIVE_LIST@0..0 - 2: JS_MODULE_ITEM_LIST@0..216 + 2: JS_MODULE_ITEM_LIST@0..513 0: TS_TYPE_ALIAS_DECLARATION@0..18 0: TYPE_KW@0..5 "type" [] [Whitespace(" ")] 1: TS_IDENTIFIER_BINDING@5..8 @@ -581,4 +882,229 @@ JsModule { 1: (empty) 2: R_BRACK@215..216 "]" [] [] 5: (empty) - 3: EOF@216..217 "" [Newline("\n")] [] + 8: JS_CLASS_DECLARATION@216..274 + 0: (empty) + 1: CLASS_KW@216..262 "class" [Newline("\n"), Whitespace(" ..."), Newline("\n")] [Whitespace(" ")] + 2: JS_IDENTIFIER_BINDING@262..265 + 0: IDENT@262..265 "Foo" [] [] + 3: TS_TYPE_PARAMETERS@265..272 + 0: L_ANGLE@265..266 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@266..270 + 0: TS_TYPE_PARAMETER@266..270 + 0: TS_TYPE_PARAMETER_MODIFIER@266..269 + 0: IN_KW@266..269 "in" [] [Whitespace(" ")] + 1: (empty) + 1: TS_TYPE_PARAMETER_NAME@269..270 + 0: IDENT@269..270 "T" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@270..272 ">" [] [Whitespace(" ")] + 4: (empty) + 5: (empty) + 6: L_CURLY@272..273 "{" [] [] + 7: JS_CLASS_MEMBER_LIST@273..273 + 8: R_CURLY@273..274 "}" [] [] + 9: JS_CLASS_DECLARATION@274..294 + 0: (empty) + 1: CLASS_KW@274..281 "class" [Newline("\n")] [Whitespace(" ")] + 2: JS_IDENTIFIER_BINDING@281..284 + 0: IDENT@281..284 "Foo" [] [] + 3: TS_TYPE_PARAMETERS@284..292 + 0: L_ANGLE@284..285 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@285..290 + 0: TS_TYPE_PARAMETER@285..290 + 0: TS_TYPE_PARAMETER_MODIFIER@285..289 + 0: (empty) + 1: OUT_KW@285..289 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@289..290 + 0: IDENT@289..290 "T" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@290..292 ">" [] [Whitespace(" ")] + 4: (empty) + 5: (empty) + 6: L_CURLY@292..293 "{" [] [] + 7: JS_CLASS_MEMBER_LIST@293..293 + 8: R_CURLY@293..294 "}" [] [] + 10: JS_EXPORT@294..328 + 0: EXPORT_KW@294..302 "export" [Newline("\n")] [Whitespace(" ")] + 1: JS_EXPORT_DEFAULT_DECLARATION_CLAUSE@302..328 + 0: DEFAULT_KW@302..310 "default" [] [Whitespace(" ")] + 1: JS_CLASS_EXPORT_DEFAULT_DECLARATION@310..328 + 0: (empty) + 1: CLASS_KW@310..316 "class" [] [Whitespace(" ")] + 2: JS_IDENTIFIER_BINDING@316..319 + 0: IDENT@316..319 "Foo" [] [] + 3: TS_TYPE_PARAMETERS@319..326 + 0: L_ANGLE@319..320 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@320..324 + 0: TS_TYPE_PARAMETER@320..324 + 0: TS_TYPE_PARAMETER_MODIFIER@320..323 + 0: IN_KW@320..323 "in" [] [Whitespace(" ")] + 1: (empty) + 1: TS_TYPE_PARAMETER_NAME@323..324 + 0: IDENT@323..324 "T" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@324..326 ">" [] [Whitespace(" ")] + 4: (empty) + 5: (empty) + 6: L_CURLY@326..327 "{" [] [] + 7: JS_CLASS_MEMBER_LIST@327..327 + 8: R_CURLY@327..328 "}" [] [] + 2: (empty) + 11: JS_CLASS_DECLARATION@328..348 + 0: (empty) + 1: CLASS_KW@328..335 "class" [Newline("\n")] [Whitespace(" ")] + 2: JS_IDENTIFIER_BINDING@335..338 + 0: IDENT@335..338 "Foo" [] [] + 3: TS_TYPE_PARAMETERS@338..346 + 0: L_ANGLE@338..339 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@339..344 + 0: TS_TYPE_PARAMETER@339..344 + 0: TS_TYPE_PARAMETER_MODIFIER@339..343 + 0: (empty) + 1: OUT_KW@339..343 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@343..344 + 0: IDENT@343..344 "T" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@344..346 ">" [] [Whitespace(" ")] + 4: (empty) + 5: (empty) + 6: L_CURLY@346..347 "{" [] [] + 7: JS_CLASS_MEMBER_LIST@347..347 + 8: R_CURLY@347..348 "}" [] [] + 12: TS_INTERFACE_DECLARATION@348..371 + 0: INTERFACE_KW@348..359 "interface" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@359..362 + 0: IDENT@359..362 "Foo" [] [] + 2: TS_TYPE_PARAMETERS@362..369 + 0: L_ANGLE@362..363 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@363..367 + 0: TS_TYPE_PARAMETER@363..367 + 0: TS_TYPE_PARAMETER_MODIFIER@363..366 + 0: IN_KW@363..366 "in" [] [Whitespace(" ")] + 1: (empty) + 1: TS_TYPE_PARAMETER_NAME@366..367 + 0: IDENT@366..367 "T" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@367..369 ">" [] [Whitespace(" ")] + 3: (empty) + 4: L_CURLY@369..370 "{" [] [] + 5: TS_TYPE_MEMBER_LIST@370..370 + 6: R_CURLY@370..371 "}" [] [] + 13: TS_INTERFACE_DECLARATION@371..395 + 0: INTERFACE_KW@371..382 "interface" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@382..385 + 0: IDENT@382..385 "Foo" [] [] + 2: TS_TYPE_PARAMETERS@385..393 + 0: L_ANGLE@385..386 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@386..391 + 0: TS_TYPE_PARAMETER@386..391 + 0: TS_TYPE_PARAMETER_MODIFIER@386..390 + 0: (empty) + 1: OUT_KW@386..390 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@390..391 + 0: IDENT@390..391 "T" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@391..393 ">" [] [Whitespace(" ")] + 3: (empty) + 4: L_CURLY@393..394 "{" [] [] + 5: TS_TYPE_MEMBER_LIST@394..394 + 6: R_CURLY@394..395 "}" [] [] + 14: TS_DECLARE_STATEMENT@395..422 + 0: DECLARE_KW@395..404 "declare" [Newline("\n")] [Whitespace(" ")] + 1: JS_CLASS_DECLARATION@404..422 + 0: (empty) + 1: CLASS_KW@404..410 "class" [] [Whitespace(" ")] + 2: JS_IDENTIFIER_BINDING@410..413 + 0: IDENT@410..413 "Foo" [] [] + 3: TS_TYPE_PARAMETERS@413..420 + 0: L_ANGLE@413..414 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@414..418 + 0: TS_TYPE_PARAMETER@414..418 + 0: TS_TYPE_PARAMETER_MODIFIER@414..417 + 0: IN_KW@414..417 "in" [] [Whitespace(" ")] + 1: (empty) + 1: TS_TYPE_PARAMETER_NAME@417..418 + 0: IDENT@417..418 "T" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@418..420 ">" [] [Whitespace(" ")] + 4: (empty) + 5: (empty) + 6: L_CURLY@420..421 "{" [] [] + 7: JS_CLASS_MEMBER_LIST@421..421 + 8: R_CURLY@421..422 "}" [] [] + 15: TS_DECLARE_STATEMENT@422..450 + 0: DECLARE_KW@422..431 "declare" [Newline("\n")] [Whitespace(" ")] + 1: JS_CLASS_DECLARATION@431..450 + 0: (empty) + 1: CLASS_KW@431..437 "class" [] [Whitespace(" ")] + 2: JS_IDENTIFIER_BINDING@437..440 + 0: IDENT@437..440 "Foo" [] [] + 3: TS_TYPE_PARAMETERS@440..448 + 0: L_ANGLE@440..441 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@441..446 + 0: TS_TYPE_PARAMETER@441..446 + 0: TS_TYPE_PARAMETER_MODIFIER@441..445 + 0: (empty) + 1: OUT_KW@441..445 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@445..446 + 0: IDENT@445..446 "T" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@446..448 ">" [] [Whitespace(" ")] + 4: (empty) + 5: (empty) + 6: L_CURLY@448..449 "{" [] [] + 7: JS_CLASS_MEMBER_LIST@449..449 + 8: R_CURLY@449..450 "}" [] [] + 16: TS_DECLARE_STATEMENT@450..481 + 0: DECLARE_KW@450..459 "declare" [Newline("\n")] [Whitespace(" ")] + 1: TS_INTERFACE_DECLARATION@459..481 + 0: INTERFACE_KW@459..469 "interface" [] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@469..472 + 0: IDENT@469..472 "Foo" [] [] + 2: TS_TYPE_PARAMETERS@472..479 + 0: L_ANGLE@472..473 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@473..477 + 0: TS_TYPE_PARAMETER@473..477 + 0: TS_TYPE_PARAMETER_MODIFIER@473..476 + 0: IN_KW@473..476 "in" [] [Whitespace(" ")] + 1: (empty) + 1: TS_TYPE_PARAMETER_NAME@476..477 + 0: IDENT@476..477 "T" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@477..479 ">" [] [Whitespace(" ")] + 3: (empty) + 4: L_CURLY@479..480 "{" [] [] + 5: TS_TYPE_MEMBER_LIST@480..480 + 6: R_CURLY@480..481 "}" [] [] + 17: TS_DECLARE_STATEMENT@481..513 + 0: DECLARE_KW@481..490 "declare" [Newline("\n")] [Whitespace(" ")] + 1: TS_INTERFACE_DECLARATION@490..513 + 0: INTERFACE_KW@490..500 "interface" [] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@500..503 + 0: IDENT@500..503 "Foo" [] [] + 2: TS_TYPE_PARAMETERS@503..511 + 0: L_ANGLE@503..504 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@504..509 + 0: TS_TYPE_PARAMETER@504..509 + 0: TS_TYPE_PARAMETER_MODIFIER@504..508 + 0: (empty) + 1: OUT_KW@504..508 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@508..509 + 0: IDENT@508..509 "T" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@509..511 ">" [] [Whitespace(" ")] + 3: (empty) + 4: L_CURLY@511..512 "{" [] [] + 5: TS_TYPE_MEMBER_LIST@512..512 + 6: R_CURLY@512..513 "}" [] [] + 3: EOF@513..514 "" [Newline("\n")] [] diff --git a/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.ts b/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.ts index 48c8601f746..f024d40e884 100644 --- a/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.ts +++ b/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.ts @@ -6,3 +6,14 @@ type Foo = T type Foo = [X, Y] type Foo = [X, Y] type Foo = [X, Y] + +class Foo {} +class Foo {} +export default class Foo {} +class Foo {} +interface Foo {} +interface Foo {} +declare class Foo {} +declare class Foo {} +declare interface Foo {} +declare interface Foo {} From 48b654c8447f91fe89bb3cd6f44e23319e921942 Mon Sep 17 00:00:00 2001 From: IWANABETHATGUY Date: Sun, 8 May 2022 23:47:20 +0800 Subject: [PATCH 04/22] =?UTF-8?q?test:=20=F0=9F=92=8D=20update=20test=20ca?= =?UTF-8?q?se?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rome_js_formatter/src/ts/bindings/mod.rs | 2 +- .../ts/bindings/type_parameter_modifier.rs | 5 +- crates/rome_js_parser/src/syntax/class.rs | 22 +- crates/rome_js_parser/src/syntax/function.rs | 16 +- crates/rome_js_parser/src/syntax/object.rs | 14 +- .../src/syntax/typescript/statement.rs | 4 +- .../src/syntax/typescript/types.rs | 93 +- .../inline/err/type_parameter_modifier.rast | 1003 +++++++++-------- .../inline/err/type_parameter_modifier.ts | 10 + .../inline/ok/type_parameter_modifier.rast | 524 ++++----- .../inline/ok/type_parameter_modifier.ts | 1 - xtask/codegen/src/kinds_src.rs | 2 +- 12 files changed, 911 insertions(+), 785 deletions(-) create mode 100644 crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.ts diff --git a/crates/rome_js_formatter/src/ts/bindings/mod.rs b/crates/rome_js_formatter/src/ts/bindings/mod.rs index 8a1b24886c8..671c7ea99b5 100644 --- a/crates/rome_js_formatter/src/ts/bindings/mod.rs +++ b/crates/rome_js_formatter/src/ts/bindings/mod.rs @@ -5,5 +5,5 @@ mod index_signature_parameter; mod property_parameter; mod this_parameter; mod type_parameter; +mod type_parameter_modifier; mod type_parameters; -mod type_parameter_modifier; \ No newline at end of file diff --git a/crates/rome_js_formatter/src/ts/bindings/type_parameter_modifier.rs b/crates/rome_js_formatter/src/ts/bindings/type_parameter_modifier.rs index 29504a53869..642b8033884 100644 --- a/crates/rome_js_formatter/src/ts/bindings/type_parameter_modifier.rs +++ b/crates/rome_js_formatter/src/ts/bindings/type_parameter_modifier.rs @@ -10,9 +10,8 @@ impl FormatNode for TsTypeParameterModifier { out_token, } = self.as_fields(); Ok(format_elements![ - empty_element() - // in_token.format_or_empty(formatter)?, - // out_token.format_or_empty(formatter)? + empty_element() // in_token.format_or_empty(formatter)?, + // out_token.format_or_empty(formatter)? ]) } } diff --git a/crates/rome_js_parser/src/syntax/class.rs b/crates/rome_js_parser/src/syntax/class.rs index c4a93181994..49d8ba426a2 100644 --- a/crates/rome_js_parser/src/syntax/class.rs +++ b/crates/rome_js_parser/src/syntax/class.rs @@ -249,9 +249,13 @@ fn parse_class(p: &mut Parser, kind: ClassKind) -> CompletedMarker { // test ts ts_class_type_parameters // class BuildError {} TypeScript - .parse_exclusive_syntax(p, parse_ts_type_parameters, |p, type_parameters| { - ts_only_syntax_error(p, "class type parameters", type_parameters.range(p)) - }) + .parse_exclusive_syntax( + p, + |p| parse_ts_type_parameters(p, true), + |p, type_parameters| { + ts_only_syntax_error(p, "class type parameters", type_parameters.range(p)) + }, + ) .ok(); eat_class_heritage_clause(p); @@ -685,7 +689,7 @@ fn parse_class_member_impl( // get a(): A {} // set a(value: A) {} // } - if let Present(type_parameters) = parse_ts_type_parameters(p) { + if let Present(type_parameters) = parse_ts_type_parameters(p, false) { p.error(ts_accessor_type_parameters_error(p, &type_parameters)) } @@ -1149,9 +1153,11 @@ fn parse_method_class_member_rest( let optional = optional_member_token(p); TypeScript - .parse_exclusive_syntax(p, parse_ts_type_parameters, |p, marker| { - ts_only_syntax_error(p, "type parameters", marker.range(p)) - }) + .parse_exclusive_syntax( + p, + |p| parse_ts_type_parameters(p, false), + |p, marker| ts_only_syntax_error(p, "type parameters", marker.range(p)), + ) .ok(); let parameter_context = if modifiers.is_signature() { @@ -1434,7 +1440,7 @@ fn parse_constructor_class_member_body( // test_err ts ts_constructor_type_parameters // class A { constructor(b) {} } - if let Present(type_parameters) = parse_ts_type_parameters(p) { + if let Present(type_parameters) = parse_ts_type_parameters(p, false) { p.error(ts_constructor_type_parameters_error(p, &type_parameters)); } diff --git a/crates/rome_js_parser/src/syntax/function.rs b/crates/rome_js_parser/src/syntax/function.rs index dfe40d54477..b98ef68fcb9 100644 --- a/crates/rome_js_parser/src/syntax/function.rs +++ b/crates/rome_js_parser/src/syntax/function.rs @@ -207,10 +207,14 @@ fn parse_function(p: &mut Parser, m: Marker, kind: FunctionKind) -> CompletedMar } TypeScript - .parse_exclusive_syntax(p, parse_ts_type_parameters, |p, marker| { - p.err_builder("type parameters can only be used in TypeScript files") - .primary(marker.range(p), "") - }) + .parse_exclusive_syntax( + p, + |parser| parse_ts_type_parameters(parser, false), + |p, marker| { + p.err_builder("type parameters can only be used in TypeScript files") + .primary(marker.range(p), "") + }, + ) .ok(); let parameter_context = if !kind.is_expression() && TypeScript.is_supported(p) { @@ -356,7 +360,7 @@ pub(crate) fn parse_ambient_function(p: &mut Parser, m: Marker) -> CompletedMark p.expect(T![function]); parse_binding(p).or_add_diagnostic(p, expected_binding); - parse_ts_type_parameters(p).ok(); + parse_ts_type_parameters(p, false).ok(); parse_parameter_list(p, ParameterContext::Declaration, SignatureFlags::empty()) .or_add_diagnostic(p, expected_parameters); parse_ts_return_type_annotation(p).ok(); @@ -459,7 +463,7 @@ fn try_parse_parenthesized_arrow_function_head( }; if p.at(T![<]) { - parse_ts_type_parameters(p).ok(); + parse_ts_type_parameters(p, false).ok(); if ambiguity.is_disallowed() && p.last() != Some(T![>]) { return Err(m); diff --git a/crates/rome_js_parser/src/syntax/object.rs b/crates/rome_js_parser/src/syntax/object.rs index f0416d5e8ce..0417e13dec4 100644 --- a/crates/rome_js_parser/src/syntax/object.rs +++ b/crates/rome_js_parser/src/syntax/object.rs @@ -255,7 +255,7 @@ fn parse_getter_object_member(p: &mut Parser) -> ParsedSyntax { // test_err ts ts_object_getter_type_parameters // ({ get a(): A {} }); - if let Present(type_parameters) = parse_ts_type_parameters(p) { + if let Present(type_parameters) = parse_ts_type_parameters(p, false) { p.error(ts_accessor_type_parameters_error(p, &type_parameters)) } @@ -287,7 +287,7 @@ fn parse_setter_object_member(p: &mut Parser) -> ParsedSyntax { // test_err ts ts_object_setter_type_parameters // ({ set a(value: A) {} }); - if let Present(type_parameters) = parse_ts_type_parameters(p) { + if let Present(type_parameters) = parse_ts_type_parameters(p, false) { p.error(ts_accessor_type_parameters_error(p, &type_parameters)) } @@ -429,9 +429,13 @@ fn parse_method_object_member(p: &mut Parser) -> ParsedSyntax { /// Parses the body of a method object member starting right after the member name. fn parse_method_object_member_body(p: &mut Parser, flags: SignatureFlags) { TypeScript - .parse_exclusive_syntax(p, parse_ts_type_parameters, |p, type_parameters| { - ts_only_syntax_error(p, "type parameters", type_parameters.range(p)) - }) + .parse_exclusive_syntax( + p, + |p| parse_ts_type_parameters(p, false), + |p, type_parameters| { + ts_only_syntax_error(p, "type parameters", type_parameters.range(p)) + }, + ) .ok(); parse_parameter_list(p, ParameterContext::Implementation, flags) diff --git a/crates/rome_js_parser/src/syntax/typescript/statement.rs b/crates/rome_js_parser/src/syntax/typescript/statement.rs index d497e898c7b..24b54a48598 100644 --- a/crates/rome_js_parser/src/syntax/typescript/statement.rs +++ b/crates/rome_js_parser/src/syntax/typescript/statement.rs @@ -208,7 +208,7 @@ pub(crate) fn parse_ts_type_alias_declaration(p: &mut Parser) -> ParsedSyntax { let m = p.start(); p.expect(T![type]); parse_ts_identifier_binding(p).or_add_diagnostic(p, expected_identifier); - parse_ts_type_parameters(p).ok(); + parse_ts_type_parameters(p, true).ok(); p.expect(T![=]); parse_ts_type(p).or_add_diagnostic(p, expected_ts_type); @@ -298,7 +298,7 @@ pub(crate) fn parse_ts_interface_declaration(p: &mut Parser) -> ParsedSyntax { let m = p.start(); p.expect(T![interface]); parse_ts_identifier_binding(p).or_add_diagnostic(p, expected_identifier); - parse_ts_type_parameters(p).ok(); + parse_ts_type_parameters(p, true).ok(); eat_interface_heritage_clause(p); p.expect(T!['{']); TypeMembers.parse_list(p); diff --git a/crates/rome_js_parser/src/syntax/typescript/types.rs b/crates/rome_js_parser/src/syntax/typescript/types.rs index 8e979a890d3..4f9fed7f96f 100644 --- a/crates/rome_js_parser/src/syntax/typescript/types.rs +++ b/crates/rome_js_parser/src/syntax/typescript/types.rs @@ -26,7 +26,7 @@ use crate::{ Absent, CompletedMarker, ParseNodeList, ParseRecovery, ParseSeparatedList, ParsedSyntax, Parser, Present, SyntaxFeature, }; -use rome_diagnostics::Span; +use rome_diagnostics::{Diagnostic, Span}; use rome_js_syntax::JsSyntaxKind::TS_TYPE_ANNOTATION; use rome_js_syntax::T; use rome_js_syntax::{JsSyntaxKind::*, *}; @@ -78,8 +78,8 @@ pub(crate) fn parse_ts_return_type_annotation(p: &mut Parser) -> ParsedSyntax { Present(m.complete(p, TS_RETURN_TYPE_ANNOTATION)) } -fn parse_ts_call_signature(p: &mut Parser) { - parse_ts_type_parameters(p).ok(); +fn parse_ts_call_signature(p: &mut Parser, could_use_parameter_modifier: bool) { + parse_ts_type_parameters(p, could_use_parameter_modifier).ok(); parse_parameter_list(p, ParameterContext::Declaration, SignatureFlags::empty()) .or_add_diagnostic(p, expected_parameters); parse_ts_return_type_annotation(p).ok(); @@ -94,7 +94,10 @@ fn parse_ts_type_parameter_name(p: &mut Parser) -> ParsedSyntax { // // test_err ts ts_type_parameters_incomplete // type A ParsedSyntax { +pub(crate) fn parse_ts_type_parameters( + p: &mut Parser, + could_use_parameter_modifier: bool, +) -> ParsedSyntax { if !is_nth_at_ts_type_parameters(p, 0) { return Absent; } @@ -104,17 +107,26 @@ pub(crate) fn parse_ts_type_parameters(p: &mut Parser) -> ParsedSyntax { if p.at(T![>]) { p.error(expected_ts_type_parameter(p, p.cur_range())); } - TsTypeParameterList.parse_list(p); + TsTypeParameterList::new(could_use_parameter_modifier).parse_list(p); p.expect(T![>]); Present(m.complete(p, TS_TYPE_PARAMETERS)) } -struct TsTypeParameterList; +struct TsTypeParameterList { + could_use_parameter_modifier: bool, +} +impl TsTypeParameterList { + pub fn new(could_use_parameter_modifier: bool) -> Self { + Self { + could_use_parameter_modifier, + } + } +} impl ParseSeparatedList for TsTypeParameterList { fn parse_element(&mut self, p: &mut Parser) -> ParsedSyntax { - parse_ts_type_parameter(p) + parse_ts_type_parameter(p, self.could_use_parameter_modifier) } fn is_at_list_end(&self, p: &mut Parser) -> bool { @@ -145,6 +157,17 @@ impl ParseSeparatedList for TsTypeParameterList { true } } +// test_err ts type_parameter_modifier +// type Foo = T +// type Foo = T +// type Foo = T +// type Foo = T +// type Foo = T +// type Foo = T +// type Foo = T +// type Foo = T +// function foo() {} +// function foo() {} // test ts type_parameter_modifier // type Foo = T @@ -155,7 +178,6 @@ impl ParseSeparatedList for TsTypeParameterList { // type Foo = [X, Y] // type Foo = [X, Y] // type Foo = [X, Y] -// // class Foo {} // class Foo {} // export default class Foo {} @@ -166,15 +188,38 @@ impl ParseSeparatedList for TsTypeParameterList { // declare class Foo {} // declare interface Foo {} // declare interface Foo {} -fn parse_ts_type_parameter_modifier(p: &mut Parser) -> ParsedSyntax { +fn parse_ts_type_parameter_modifier( + p: &mut Parser, + could_use_parameter_modifier: bool, +) -> ParsedSyntax { let m = p.start(); - + let mut has_any_modifier = false; // try to eat `in` modifier - let mut has_any_modifier = p.eat(T![in]); + if p.at(T![in]) { + has_any_modifier = true; + if could_use_parameter_modifier { + p.bump(T![in]); + } else { + // TODO: I am not sure if bump here is properly, but it is good for error recover + let err = p + .err_builder(&format!("TypeParameterModifier `in` is not valid here",)) + .primary(p.cur_range(), ""); + p.error(err); + p.bump(T![in]); + } + } if p.at(T![out]) && !p.nth_at(1, T![,]) && !p.nth_at(1, T![>]) { - p.bump(T![out]); has_any_modifier = true; + if could_use_parameter_modifier { + p.bump(T![out]); + } else { + let err = p + .err_builder(&format!("TypeParameterModifier `out` is not valid here",)) + .primary(p.cur_range(), ""); + p.error(err); + p.bump(T![out]); + } } if !has_any_modifier { m.abandon(p); @@ -183,9 +228,9 @@ fn parse_ts_type_parameter_modifier(p: &mut Parser) -> ParsedSyntax { Present(m.complete(p, TS_TYPE_PARAMETER_MODIFIER)) } -fn parse_ts_type_parameter(p: &mut Parser) -> ParsedSyntax { +fn parse_ts_type_parameter(p: &mut Parser, could_use_parameter_modifier: bool) -> ParsedSyntax { let m = p.start(); - parse_ts_type_parameter_modifier(p).ok(); + parse_ts_type_parameter_modifier(p, could_use_parameter_modifier).ok(); let name = parse_ts_type_parameter_name(p); parse_ts_type_constraint_clause(p).ok(); parse_ts_default_type_clause(p).ok(); @@ -824,7 +869,7 @@ fn parse_ts_property_or_method_signature_type_member(p: &mut Parser) -> ParsedSy p.eat(T![?]); if p.at(T!['(']) || p.at(T![<]) { - parse_ts_call_signature(p); + parse_ts_call_signature(p, false); parse_ts_type_member_semi(p); let method = m.complete(p, TS_METHOD_SIGNATURE_TYPE_MEMBER); @@ -855,7 +900,7 @@ fn parse_ts_call_signature_type_member(p: &mut Parser) -> ParsedSyntax { } let m = p.start(); - parse_ts_call_signature(p); + parse_ts_call_signature(p, false); parse_ts_type_member_semi(p); Present(m.complete(p, TS_CALL_SIGNATURE_TYPE_MEMBER)) } @@ -871,7 +916,7 @@ fn parse_ts_construct_signature_type_member(p: &mut Parser) -> ParsedSyntax { let m = p.start(); p.expect(T![new]); - parse_ts_type_parameters(p).ok(); + parse_ts_type_parameters(p, true).ok(); parse_parameter_list(p, ParameterContext::Declaration, SignatureFlags::empty()) .or_add_diagnostic(p, expected_parameters); parse_ts_type_annotation(p).ok(); @@ -1138,7 +1183,7 @@ fn parse_ts_constructor_type(p: &mut Parser) -> ParsedSyntax { p.eat(T![abstract]); p.expect(T![new]); - parse_ts_type_parameters(p).ok(); + parse_ts_type_parameters(p, false).ok(); parse_parameter_list(p, ParameterContext::Declaration, SignatureFlags::empty()) .or_add_diagnostic(p, expected_parameters); p.expect(T![=>]); @@ -1201,7 +1246,7 @@ fn parse_ts_function_type(p: &mut Parser) -> ParsedSyntax { } let m = p.start(); - parse_ts_type_parameters(p).ok(); + parse_ts_type_parameters(p, false).ok(); parse_parameter_list(p, ParameterContext::Declaration, SignatureFlags::empty()) .or_add_diagnostic(p, expected_parameters); p.expect(T![=>]); @@ -1389,16 +1434,6 @@ fn parse_ts_type_member_semi(p: &mut Parser) { // TODO: finish all this testing -// expectParseErrorTS(t, "type Foo = T", ": ERROR: Expected identifier but found \"i\\\\u006E\"\n") -// expectParseErrorTS(t, "type Foo = T", ": ERROR: Expected \">\" but found \"T\"\n") -// expectParseErrorTS(t, "type Foo = T", ": ERROR: The modifier \"in\" is not valid here:\n: ERROR: Expected identifier but found \">\"\n") -// expectParseErrorTS(t, "type Foo = T", ": ERROR: The modifier \"in\" is not valid here:\n: ERROR: Expected identifier but found \">\"\n") -// expectParseErrorTS(t, "type Foo = T", ": ERROR: The modifier \"in\" is not valid here:\n") -// expectParseErrorTS(t, "type Foo = T", ": ERROR: Expected \">\" but found \"T\"\n") -// expectParseErrorTS(t, "type Foo = T", ": ERROR: The modifier \"in\" is not valid here:\n") -// expectParseErrorTS(t, "type Foo = T", ": ERROR: The modifier \"out\" is not valid here:\n") -// expectParseErrorTS(t, "function foo() {}", ": ERROR: The modifier \"in\" is not valid here:\n") -// expectParseErrorTS(t, "function foo() {}", ": ERROR: The modifier \"out\" is not valid here:\n") // expectParseErrorTS(t, "export default function foo() {}", ": ERROR: The modifier \"in\" is not valid here:\n") // expectParseErrorTS(t, "export default function foo() {}", ": ERROR: The modifier \"out\" is not valid here:\n") // expectParseErrorTS(t, "export default function () {}", ": ERROR: The modifier \"in\" is not valid here:\n") diff --git a/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.rast b/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.rast index df66e850434..61b8c64ae7a 100644 --- a/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.rast +++ b/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.rast @@ -13,165 +13,166 @@ JsModule { L_ANGLE@8..9 "<" [] [], JsUnknown { items: [ + TsTypeParameter { + modifier: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@9..10 "i" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, JsUnknown { items: [ - IN_KW@9..12 "in" [] [Whitespace(" ")], + ERROR_TOKEN@10..11 "\\" [] [], ], }, TsTypeParameter { modifier: missing (optional), name: TsTypeParameterName { - ident_token: IDENT@12..13 "T" [] [], + ident_token: IDENT@11..18 "\\u006E" [] [Whitespace(" ")], + }, + constraint: missing (optional), + default: missing (optional), + }, + TsTypeParameter { + modifier: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@18..19 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], }, - R_ANGLE@13..15 ">" [] [Whitespace(" ")], + R_ANGLE@19..21 ">" [] [Whitespace(" ")], ], }, - EQ@15..17 "=" [] [Whitespace(" ")], + EQ@21..23 "=" [] [Whitespace(" ")], TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@17..18 "T" [] [], + value_token: IDENT@23..24 "T" [] [], }, type_arguments: missing (optional), }, ], }, - TsTypeAliasDeclaration { - type_token: TYPE_KW@18..24 "type" [Newline("\n")] [Whitespace(" ")], - binding_identifier: TsIdentifierBinding { - name_token: IDENT@24..27 "Foo" [] [], - }, - type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@27..28 "<" [] [], - items: TsTypeParameterList [ - TsTypeParameter { - modifier: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@28..32 "out" [] [Whitespace(" ")], - }, - constraint: missing (optional), - default: missing (optional), - }, - missing separator, - TsTypeParameter { - modifier: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@32..33 "T" [] [], - }, - constraint: missing (optional), - default: missing (optional), - }, - ], - r_angle_token: R_ANGLE@33..35 ">" [] [Whitespace(" ")], - }, - eq_token: EQ@35..37 "=" [] [Whitespace(" ")], - ty: TsReferenceType { - name: JsReferenceIdentifier { - value_token: IDENT@37..38 "T" [] [], - }, - type_arguments: missing (optional), - }, - semicolon_token: missing (optional), - }, JsUnknownStatement { items: [ - TYPE_KW@38..44 "type" [Newline("\n")] [Whitespace(" ")], + TYPE_KW@24..30 "type" [Newline("\n")] [Whitespace(" ")], TsIdentifierBinding { - name_token: IDENT@44..47 "Foo" [] [], + name_token: IDENT@30..33 "Foo" [] [], }, JsUnknown { items: [ - L_ANGLE@47..48 "<" [] [], + L_ANGLE@33..34 "<" [] [], JsUnknown { items: [ + TsTypeParameter { + modifier: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@34..36 "ou" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, JsUnknown { items: [ - IN_KW@48..51 "in" [] [Whitespace(" ")], - OUT_KW@51..54 "out" [] [], + ERROR_TOKEN@36..37 "\\" [] [], ], }, + TsTypeParameter { + modifier: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@37..44 "\\u0074" [] [Whitespace(" ")], + }, + constraint: missing (optional), + default: missing (optional), + }, + TsTypeParameter { + modifier: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@44..45 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, ], }, - R_ANGLE@54..56 ">" [] [Whitespace(" ")], + R_ANGLE@45..47 ">" [] [Whitespace(" ")], ], }, - EQ@56..58 "=" [] [Whitespace(" ")], + EQ@47..49 "=" [] [Whitespace(" ")], TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@58..59 "T" [] [], + value_token: IDENT@49..50 "T" [] [], }, type_arguments: missing (optional), }, ], }, - TsTypeAliasDeclaration { - type_token: TYPE_KW@59..65 "type" [Newline("\n")] [Whitespace(" ")], - binding_identifier: TsIdentifierBinding { - name_token: IDENT@65..68 "Foo" [] [], - }, - type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@68..69 "<" [] [], - items: TsTypeParameterList [ - TsTypeParameter { - modifier: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@69..73 "out" [] [Whitespace(" ")], - }, - constraint: missing (optional), - default: missing (optional), - }, - missing separator, - TsTypeParameter { - modifier: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@73..76 "out" [] [], + JsUnknownStatement { + items: [ + TYPE_KW@50..56 "type" [Newline("\n")] [Whitespace(" ")], + TsIdentifierBinding { + name_token: IDENT@56..59 "Foo" [] [], + }, + JsUnknown { + items: [ + L_ANGLE@59..60 "<" [] [], + JsUnknown { + items: [ + TsTypeParameterModifier { + in_token: IN_KW@60..63 "in" [] [Whitespace(" ")], + out_token: missing (optional), + }, + JsUnknown { + items: [ + IN_KW@63..65 "in" [] [], + ], + }, + ], }, - constraint: missing (optional), - default: missing (optional), + R_ANGLE@65..67 ">" [] [Whitespace(" ")], + ], + }, + EQ@67..69 "=" [] [Whitespace(" ")], + TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@69..70 "T" [] [], }, - ], - r_angle_token: R_ANGLE@76..78 ">" [] [Whitespace(" ")], - }, - eq_token: EQ@78..80 "=" [] [Whitespace(" ")], - ty: TsReferenceType { - name: JsReferenceIdentifier { - value_token: IDENT@80..81 "T" [] [], + type_arguments: missing (optional), }, - type_arguments: missing (optional), - }, - semicolon_token: missing (optional), + ], }, JsUnknownStatement { items: [ - TYPE_KW@81..87 "type" [Newline("\n")] [Whitespace(" ")], + TYPE_KW@70..76 "type" [Newline("\n")] [Whitespace(" ")], TsIdentifierBinding { - name_token: IDENT@87..90 "Foo" [] [], + name_token: IDENT@76..79 "Foo" [] [], }, JsUnknown { items: [ - L_ANGLE@90..91 "<" [] [], + L_ANGLE@79..80 "<" [] [], JsUnknown { items: [ + TsTypeParameterModifier { + in_token: missing (optional), + out_token: OUT_KW@80..84 "out" [] [Whitespace(" ")], + }, JsUnknown { items: [ - IN_KW@91..94 "in" [] [Whitespace(" ")], - OUT_KW@94..98 "out" [] [Whitespace(" ")], - OUT_KW@98..101 "out" [] [], + IN_KW@84..86 "in" [] [], ], }, ], }, - R_ANGLE@101..103 ">" [] [Whitespace(" ")], + R_ANGLE@86..88 ">" [] [Whitespace(" ")], ], }, - EQ@103..105 "=" [] [Whitespace(" ")], + EQ@88..90 "=" [] [Whitespace(" ")], TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@105..106 "T" [] [], + value_token: IDENT@90..91 "T" [] [], }, type_arguments: missing (optional), }, @@ -179,69 +180,85 @@ JsModule { }, JsUnknownStatement { items: [ - TYPE_KW@106..112 "type" [Newline("\n")] [Whitespace(" ")], + TYPE_KW@91..97 "type" [Newline("\n")] [Whitespace(" ")], TsIdentifierBinding { - name_token: IDENT@112..115 "Foo" [] [], + name_token: IDENT@97..100 "Foo" [] [], }, JsUnknown { items: [ - L_ANGLE@115..116 "<" [] [], + L_ANGLE@100..101 "<" [] [], JsUnknown { items: [ + TsTypeParameterModifier { + in_token: missing (optional), + out_token: OUT_KW@101..105 "out" [] [Whitespace(" ")], + }, JsUnknown { items: [ - IN_KW@116..119 "in" [] [Whitespace(" ")], + IN_KW@105..108 "in" [] [Whitespace(" ")], ], }, TsTypeParameter { modifier: missing (optional), name: TsTypeParameterName { - ident_token: IDENT@119..120 "X" [] [], + ident_token: IDENT@108..109 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, - COMMA@120..122 "," [] [Whitespace(" ")], - TsTypeParameter { - modifier: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@122..126 "out" [] [Whitespace(" ")], - }, - constraint: missing (optional), - default: missing (optional), + ], + }, + R_ANGLE@109..111 ">" [] [Whitespace(" ")], + ], + }, + EQ@111..113 "=" [] [Whitespace(" ")], + TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@113..114 "T" [] [], + }, + type_arguments: missing (optional), + }, + ], + }, + JsUnknownStatement { + items: [ + TYPE_KW@114..120 "type" [Newline("\n")] [Whitespace(" ")], + TsIdentifierBinding { + name_token: IDENT@120..123 "Foo" [] [], + }, + JsUnknown { + items: [ + L_ANGLE@123..124 "<" [] [], + JsUnknown { + items: [ + JsUnknown { + items: [ + JsUnknown { + items: [ + IDENT@124..131 "public" [] [Whitespace(" ")], + ], + }, + ], }, TsTypeParameter { modifier: missing (optional), name: TsTypeParameterName { - ident_token: IDENT@126..127 "Y" [] [], + ident_token: IDENT@131..132 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], }, - R_ANGLE@127..129 ">" [] [Whitespace(" ")], + R_ANGLE@132..134 ">" [] [Whitespace(" ")], ], }, - EQ@129..131 "=" [] [Whitespace(" ")], - TsTupleType { - l_brack_token: L_BRACK@131..132 "[" [] [], - elements: TsTupleTypeElementList [ - TsReferenceType { - name: JsReferenceIdentifier { - value_token: IDENT@132..133 "X" [] [], - }, - type_arguments: missing (optional), - }, - COMMA@133..135 "," [] [Whitespace(" ")], - TsReferenceType { - name: JsReferenceIdentifier { - value_token: IDENT@135..136 "Y" [] [], - }, - type_arguments: missing (optional), - }, - ], - r_brack_token: R_BRACK@136..137 "]" [] [], + EQ@134..136 "=" [] [Whitespace(" ")], + TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@136..137 "T" [] [], + }, + type_arguments: missing (optional), }, ], }, @@ -256,23 +273,10 @@ JsModule { L_ANGLE@146..147 "<" [] [], JsUnknown { items: [ - TsTypeParameter { - modifier: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@147..151 "out" [] [Whitespace(" ")], - }, - constraint: missing (optional), - default: missing (optional), - }, - TsTypeParameter { - modifier: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@151..152 "X" [] [], - }, - constraint: missing (optional), - default: missing (optional), + TsTypeParameterModifier { + in_token: IN_KW@147..150 "in" [] [Whitespace(" ")], + out_token: OUT_KW@150..154 "out" [] [Whitespace(" ")], }, - COMMA@152..154 "," [] [Whitespace(" ")], JsUnknown { items: [ IN_KW@154..157 "in" [] [Whitespace(" ")], @@ -281,7 +285,7 @@ JsModule { TsTypeParameter { modifier: missing (optional), name: TsTypeParameterName { - ident_token: IDENT@157..158 "Y" [] [], + ident_token: IDENT@157..158 "T" [] [], }, constraint: missing (optional), default: missing (optional), @@ -292,39 +296,29 @@ JsModule { ], }, EQ@160..162 "=" [] [Whitespace(" ")], - TsTupleType { - l_brack_token: L_BRACK@162..163 "[" [] [], - elements: TsTupleTypeElementList [ - TsReferenceType { - name: JsReferenceIdentifier { - value_token: IDENT@163..164 "X" [] [], - }, - type_arguments: missing (optional), - }, - COMMA@164..166 "," [] [Whitespace(" ")], - TsReferenceType { - name: JsReferenceIdentifier { - value_token: IDENT@166..167 "Y" [] [], - }, - type_arguments: missing (optional), - }, - ], - r_brack_token: R_BRACK@167..168 "]" [] [], + TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@162..163 "T" [] [], + }, + type_arguments: missing (optional), }, ], }, TsTypeAliasDeclaration { - type_token: TYPE_KW@168..174 "type" [Newline("\n")] [Whitespace(" ")], + type_token: TYPE_KW@163..169 "type" [Newline("\n")] [Whitespace(" ")], binding_identifier: TsIdentifierBinding { - name_token: IDENT@174..177 "Foo" [] [], + name_token: IDENT@169..172 "Foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@177..178 "<" [] [], + l_angle_token: L_ANGLE@172..173 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + modifier: TsTypeParameterModifier { + in_token: IN_KW@173..176 "in" [] [Whitespace(" ")], + out_token: OUT_KW@176..180 "out" [] [Whitespace(" ")], + }, name: TsTypeParameterName { - ident_token: IDENT@178..182 "out" [] [Whitespace(" ")], + ident_token: IDENT@180..184 "out" [] [Whitespace(" ")], }, constraint: missing (optional), default: missing (optional), @@ -333,429 +327,504 @@ JsModule { TsTypeParameter { modifier: missing (optional), name: TsTypeParameterName { - ident_token: IDENT@182..183 "X" [] [], + ident_token: IDENT@184..185 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, - COMMA@183..185 "," [] [Whitespace(" ")], + ], + r_angle_token: R_ANGLE@185..187 ">" [] [Whitespace(" ")], + }, + eq_token: EQ@187..189 "=" [] [Whitespace(" ")], + ty: TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@189..190 "T" [] [], + }, + type_arguments: missing (optional), + }, + semicolon_token: missing (optional), + }, + JsFunctionDeclaration { + async_token: missing (optional), + function_token: FUNCTION_KW@190..200 "function" [Newline("\n")] [Whitespace(" ")], + star_token: missing (optional), + id: JsIdentifierBinding { + name_token: IDENT@200..203 "foo" [] [], + }, + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@203..204 "<" [] [], + items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + modifier: TsTypeParameterModifier { + in_token: IN_KW@204..207 "in" [] [Whitespace(" ")], + out_token: missing (optional), + }, name: TsTypeParameterName { - ident_token: IDENT@185..189 "out" [] [Whitespace(" ")], + ident_token: IDENT@207..208 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, - missing separator, + ], + r_angle_token: R_ANGLE@208..209 ">" [] [], + }, + parameters: JsParameters { + l_paren_token: L_PAREN@209..210 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@210..212 ")" [] [Whitespace(" ")], + }, + return_type_annotation: missing (optional), + body: JsFunctionBody { + l_curly_token: L_CURLY@212..213 "{" [] [], + directives: JsDirectiveList [], + statements: JsStatementList [], + r_curly_token: R_CURLY@213..214 "}" [] [], + }, + }, + JsFunctionDeclaration { + async_token: missing (optional), + function_token: FUNCTION_KW@214..224 "function" [Newline("\n")] [Whitespace(" ")], + star_token: missing (optional), + id: JsIdentifierBinding { + name_token: IDENT@224..227 "foo" [] [], + }, + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@227..228 "<" [] [], + items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@189..191 "Y" [] [Whitespace(" ")], + modifier: TsTypeParameterModifier { + in_token: missing (optional), + out_token: OUT_KW@228..232 "out" [] [Whitespace(" ")], }, - constraint: TsTypeConstraintClause { - extends_token: EXTENDS_KW@191..199 "extends" [] [Whitespace(" ")], - ty: TsTypeOperatorType { - operator_token: KEYOF_KW@199..205 "keyof" [] [Whitespace(" ")], - ty: TsReferenceType { - name: JsReferenceIdentifier { - value_token: IDENT@205..206 "X" [] [], - }, - type_arguments: missing (optional), - }, - }, + name: TsTypeParameterName { + ident_token: IDENT@232..233 "T" [] [], }, + constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@206..208 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@233..234 ">" [] [], }, - eq_token: EQ@208..210 "=" [] [Whitespace(" ")], - ty: TsTupleType { - l_brack_token: L_BRACK@210..211 "[" [] [], - elements: TsTupleTypeElementList [ - TsReferenceType { - name: JsReferenceIdentifier { - value_token: IDENT@211..212 "X" [] [], - }, - type_arguments: missing (optional), - }, - COMMA@212..214 "," [] [Whitespace(" ")], - TsReferenceType { - name: JsReferenceIdentifier { - value_token: IDENT@214..215 "Y" [] [], - }, - type_arguments: missing (optional), - }, - ], - r_brack_token: R_BRACK@215..216 "]" [] [], + parameters: JsParameters { + l_paren_token: L_PAREN@234..235 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@235..237 ")" [] [Whitespace(" ")], + }, + return_type_annotation: missing (optional), + body: JsFunctionBody { + l_curly_token: L_CURLY@237..238 "{" [] [], + directives: JsDirectiveList [], + statements: JsStatementList [], + r_curly_token: R_CURLY@238..239 "}" [] [], }, - semicolon_token: missing (optional), }, ], - eof_token: EOF@216..217 "" [Newline("\n")] [], + eof_token: EOF@239..240 "" [Newline("\n")] [], } -0: JS_MODULE@0..217 +0: JS_MODULE@0..240 0: (empty) 1: JS_DIRECTIVE_LIST@0..0 - 2: JS_MODULE_ITEM_LIST@0..216 - 0: JS_UNKNOWN_STATEMENT@0..18 + 2: JS_MODULE_ITEM_LIST@0..239 + 0: JS_UNKNOWN_STATEMENT@0..24 0: TYPE_KW@0..5 "type" [] [Whitespace(" ")] 1: TS_IDENTIFIER_BINDING@5..8 0: IDENT@5..8 "Foo" [] [] - 2: JS_UNKNOWN@8..15 + 2: JS_UNKNOWN@8..21 0: L_ANGLE@8..9 "<" [] [] - 1: JS_UNKNOWN@9..13 - 0: JS_UNKNOWN@9..12 - 0: IN_KW@9..12 "in" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER@12..13 + 1: JS_UNKNOWN@9..19 + 0: TS_TYPE_PARAMETER@9..10 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@12..13 - 0: IDENT@12..13 "T" [] [] + 1: TS_TYPE_PARAMETER_NAME@9..10 + 0: IDENT@9..10 "i" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@13..15 ">" [] [Whitespace(" ")] - 3: EQ@15..17 "=" [] [Whitespace(" ")] - 4: TS_REFERENCE_TYPE@17..18 - 0: JS_REFERENCE_IDENTIFIER@17..18 - 0: IDENT@17..18 "T" [] [] - 1: (empty) - 1: TS_TYPE_ALIAS_DECLARATION@18..38 - 0: TYPE_KW@18..24 "type" [Newline("\n")] [Whitespace(" ")] - 1: TS_IDENTIFIER_BINDING@24..27 - 0: IDENT@24..27 "Foo" [] [] - 2: TS_TYPE_PARAMETERS@27..35 - 0: L_ANGLE@27..28 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@28..33 - 0: TS_TYPE_PARAMETER@28..32 + 1: JS_UNKNOWN@10..11 + 0: ERROR_TOKEN@10..11 "\\" [] [] + 2: TS_TYPE_PARAMETER@11..18 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@28..32 - 0: IDENT@28..32 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@11..18 + 0: IDENT@11..18 "\\u006E" [] [Whitespace(" ")] 2: (empty) 3: (empty) - 1: (empty) - 2: TS_TYPE_PARAMETER@32..33 + 3: TS_TYPE_PARAMETER@18..19 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@32..33 - 0: IDENT@32..33 "T" [] [] + 1: TS_TYPE_PARAMETER_NAME@18..19 + 0: IDENT@18..19 "T" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@33..35 ">" [] [Whitespace(" ")] - 3: EQ@35..37 "=" [] [Whitespace(" ")] - 4: TS_REFERENCE_TYPE@37..38 - 0: JS_REFERENCE_IDENTIFIER@37..38 - 0: IDENT@37..38 "T" [] [] - 1: (empty) - 5: (empty) - 2: JS_UNKNOWN_STATEMENT@38..59 - 0: TYPE_KW@38..44 "type" [Newline("\n")] [Whitespace(" ")] - 1: TS_IDENTIFIER_BINDING@44..47 - 0: IDENT@44..47 "Foo" [] [] - 2: JS_UNKNOWN@47..56 - 0: L_ANGLE@47..48 "<" [] [] - 1: JS_UNKNOWN@48..54 - 0: JS_UNKNOWN@48..54 - 0: IN_KW@48..51 "in" [] [Whitespace(" ")] - 1: OUT_KW@51..54 "out" [] [] - 2: R_ANGLE@54..56 ">" [] [Whitespace(" ")] - 3: EQ@56..58 "=" [] [Whitespace(" ")] - 4: TS_REFERENCE_TYPE@58..59 - 0: JS_REFERENCE_IDENTIFIER@58..59 - 0: IDENT@58..59 "T" [] [] + 2: R_ANGLE@19..21 ">" [] [Whitespace(" ")] + 3: EQ@21..23 "=" [] [Whitespace(" ")] + 4: TS_REFERENCE_TYPE@23..24 + 0: JS_REFERENCE_IDENTIFIER@23..24 + 0: IDENT@23..24 "T" [] [] 1: (empty) - 3: TS_TYPE_ALIAS_DECLARATION@59..81 - 0: TYPE_KW@59..65 "type" [Newline("\n")] [Whitespace(" ")] - 1: TS_IDENTIFIER_BINDING@65..68 - 0: IDENT@65..68 "Foo" [] [] - 2: TS_TYPE_PARAMETERS@68..78 - 0: L_ANGLE@68..69 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@69..76 - 0: TS_TYPE_PARAMETER@69..73 + 1: JS_UNKNOWN_STATEMENT@24..50 + 0: TYPE_KW@24..30 "type" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@30..33 + 0: IDENT@30..33 "Foo" [] [] + 2: JS_UNKNOWN@33..47 + 0: L_ANGLE@33..34 "<" [] [] + 1: JS_UNKNOWN@34..45 + 0: TS_TYPE_PARAMETER@34..36 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@69..73 - 0: IDENT@69..73 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@34..36 + 0: IDENT@34..36 "ou" [] [] 2: (empty) 3: (empty) - 1: (empty) - 2: TS_TYPE_PARAMETER@73..76 + 1: JS_UNKNOWN@36..37 + 0: ERROR_TOKEN@36..37 "\\" [] [] + 2: TS_TYPE_PARAMETER@37..44 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@73..76 - 0: IDENT@73..76 "out" [] [] + 1: TS_TYPE_PARAMETER_NAME@37..44 + 0: IDENT@37..44 "\\u0074" [] [Whitespace(" ")] 2: (empty) 3: (empty) - 2: R_ANGLE@76..78 ">" [] [Whitespace(" ")] - 3: EQ@78..80 "=" [] [Whitespace(" ")] - 4: TS_REFERENCE_TYPE@80..81 - 0: JS_REFERENCE_IDENTIFIER@80..81 - 0: IDENT@80..81 "T" [] [] - 1: (empty) - 5: (empty) - 4: JS_UNKNOWN_STATEMENT@81..106 - 0: TYPE_KW@81..87 "type" [Newline("\n")] [Whitespace(" ")] - 1: TS_IDENTIFIER_BINDING@87..90 - 0: IDENT@87..90 "Foo" [] [] - 2: JS_UNKNOWN@90..103 - 0: L_ANGLE@90..91 "<" [] [] - 1: JS_UNKNOWN@91..101 - 0: JS_UNKNOWN@91..101 - 0: IN_KW@91..94 "in" [] [Whitespace(" ")] - 1: OUT_KW@94..98 "out" [] [Whitespace(" ")] - 2: OUT_KW@98..101 "out" [] [] - 2: R_ANGLE@101..103 ">" [] [Whitespace(" ")] - 3: EQ@103..105 "=" [] [Whitespace(" ")] - 4: TS_REFERENCE_TYPE@105..106 - 0: JS_REFERENCE_IDENTIFIER@105..106 - 0: IDENT@105..106 "T" [] [] - 1: (empty) - 5: JS_UNKNOWN_STATEMENT@106..137 - 0: TYPE_KW@106..112 "type" [Newline("\n")] [Whitespace(" ")] - 1: TS_IDENTIFIER_BINDING@112..115 - 0: IDENT@112..115 "Foo" [] [] - 2: JS_UNKNOWN@115..129 - 0: L_ANGLE@115..116 "<" [] [] - 1: JS_UNKNOWN@116..127 - 0: JS_UNKNOWN@116..119 - 0: IN_KW@116..119 "in" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER@119..120 + 3: TS_TYPE_PARAMETER@44..45 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@119..120 - 0: IDENT@119..120 "X" [] [] + 1: TS_TYPE_PARAMETER_NAME@44..45 + 0: IDENT@44..45 "T" [] [] 2: (empty) 3: (empty) - 2: COMMA@120..122 "," [] [Whitespace(" ")] - 3: TS_TYPE_PARAMETER@122..126 + 2: R_ANGLE@45..47 ">" [] [Whitespace(" ")] + 3: EQ@47..49 "=" [] [Whitespace(" ")] + 4: TS_REFERENCE_TYPE@49..50 + 0: JS_REFERENCE_IDENTIFIER@49..50 + 0: IDENT@49..50 "T" [] [] + 1: (empty) + 2: JS_UNKNOWN_STATEMENT@50..70 + 0: TYPE_KW@50..56 "type" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@56..59 + 0: IDENT@56..59 "Foo" [] [] + 2: JS_UNKNOWN@59..67 + 0: L_ANGLE@59..60 "<" [] [] + 1: JS_UNKNOWN@60..65 + 0: TS_TYPE_PARAMETER_MODIFIER@60..63 + 0: IN_KW@60..63 "in" [] [Whitespace(" ")] + 1: (empty) + 1: JS_UNKNOWN@63..65 + 0: IN_KW@63..65 "in" [] [] + 2: R_ANGLE@65..67 ">" [] [Whitespace(" ")] + 3: EQ@67..69 "=" [] [Whitespace(" ")] + 4: TS_REFERENCE_TYPE@69..70 + 0: JS_REFERENCE_IDENTIFIER@69..70 + 0: IDENT@69..70 "T" [] [] + 1: (empty) + 3: JS_UNKNOWN_STATEMENT@70..91 + 0: TYPE_KW@70..76 "type" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@76..79 + 0: IDENT@76..79 "Foo" [] [] + 2: JS_UNKNOWN@79..88 + 0: L_ANGLE@79..80 "<" [] [] + 1: JS_UNKNOWN@80..86 + 0: TS_TYPE_PARAMETER_MODIFIER@80..84 + 0: (empty) + 1: OUT_KW@80..84 "out" [] [Whitespace(" ")] + 1: JS_UNKNOWN@84..86 + 0: IN_KW@84..86 "in" [] [] + 2: R_ANGLE@86..88 ">" [] [Whitespace(" ")] + 3: EQ@88..90 "=" [] [Whitespace(" ")] + 4: TS_REFERENCE_TYPE@90..91 + 0: JS_REFERENCE_IDENTIFIER@90..91 + 0: IDENT@90..91 "T" [] [] + 1: (empty) + 4: JS_UNKNOWN_STATEMENT@91..114 + 0: TYPE_KW@91..97 "type" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@97..100 + 0: IDENT@97..100 "Foo" [] [] + 2: JS_UNKNOWN@100..111 + 0: L_ANGLE@100..101 "<" [] [] + 1: JS_UNKNOWN@101..109 + 0: TS_TYPE_PARAMETER_MODIFIER@101..105 + 0: (empty) + 1: OUT_KW@101..105 "out" [] [Whitespace(" ")] + 1: JS_UNKNOWN@105..108 + 0: IN_KW@105..108 "in" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER@108..109 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@122..126 - 0: IDENT@122..126 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@108..109 + 0: IDENT@108..109 "T" [] [] 2: (empty) 3: (empty) - 4: TS_TYPE_PARAMETER@126..127 + 2: R_ANGLE@109..111 ">" [] [Whitespace(" ")] + 3: EQ@111..113 "=" [] [Whitespace(" ")] + 4: TS_REFERENCE_TYPE@113..114 + 0: JS_REFERENCE_IDENTIFIER@113..114 + 0: IDENT@113..114 "T" [] [] + 1: (empty) + 5: JS_UNKNOWN_STATEMENT@114..137 + 0: TYPE_KW@114..120 "type" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@120..123 + 0: IDENT@120..123 "Foo" [] [] + 2: JS_UNKNOWN@123..134 + 0: L_ANGLE@123..124 "<" [] [] + 1: JS_UNKNOWN@124..132 + 0: JS_UNKNOWN@124..131 + 0: JS_UNKNOWN@124..131 + 0: IDENT@124..131 "public" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER@131..132 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@126..127 - 0: IDENT@126..127 "Y" [] [] + 1: TS_TYPE_PARAMETER_NAME@131..132 + 0: IDENT@131..132 "T" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@127..129 ">" [] [Whitespace(" ")] - 3: EQ@129..131 "=" [] [Whitespace(" ")] - 4: TS_TUPLE_TYPE@131..137 - 0: L_BRACK@131..132 "[" [] [] - 1: TS_TUPLE_TYPE_ELEMENT_LIST@132..136 - 0: TS_REFERENCE_TYPE@132..133 - 0: JS_REFERENCE_IDENTIFIER@132..133 - 0: IDENT@132..133 "X" [] [] - 1: (empty) - 1: COMMA@133..135 "," [] [Whitespace(" ")] - 2: TS_REFERENCE_TYPE@135..136 - 0: JS_REFERENCE_IDENTIFIER@135..136 - 0: IDENT@135..136 "Y" [] [] - 1: (empty) - 2: R_BRACK@136..137 "]" [] [] - 6: JS_UNKNOWN_STATEMENT@137..168 + 2: R_ANGLE@132..134 ">" [] [Whitespace(" ")] + 3: EQ@134..136 "=" [] [Whitespace(" ")] + 4: TS_REFERENCE_TYPE@136..137 + 0: JS_REFERENCE_IDENTIFIER@136..137 + 0: IDENT@136..137 "T" [] [] + 1: (empty) + 6: JS_UNKNOWN_STATEMENT@137..163 0: TYPE_KW@137..143 "type" [Newline("\n")] [Whitespace(" ")] 1: TS_IDENTIFIER_BINDING@143..146 0: IDENT@143..146 "Foo" [] [] 2: JS_UNKNOWN@146..160 0: L_ANGLE@146..147 "<" [] [] 1: JS_UNKNOWN@147..158 - 0: TS_TYPE_PARAMETER@147..151 - 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@147..151 - 0: IDENT@147..151 "out" [] [Whitespace(" ")] - 2: (empty) - 3: (empty) - 1: TS_TYPE_PARAMETER@151..152 - 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@151..152 - 0: IDENT@151..152 "X" [] [] - 2: (empty) - 3: (empty) - 2: COMMA@152..154 "," [] [Whitespace(" ")] - 3: JS_UNKNOWN@154..157 + 0: TS_TYPE_PARAMETER_MODIFIER@147..154 + 0: IN_KW@147..150 "in" [] [Whitespace(" ")] + 1: OUT_KW@150..154 "out" [] [Whitespace(" ")] + 1: JS_UNKNOWN@154..157 0: IN_KW@154..157 "in" [] [Whitespace(" ")] - 4: TS_TYPE_PARAMETER@157..158 + 2: TS_TYPE_PARAMETER@157..158 0: (empty) 1: TS_TYPE_PARAMETER_NAME@157..158 - 0: IDENT@157..158 "Y" [] [] + 0: IDENT@157..158 "T" [] [] 2: (empty) 3: (empty) 2: R_ANGLE@158..160 ">" [] [Whitespace(" ")] 3: EQ@160..162 "=" [] [Whitespace(" ")] - 4: TS_TUPLE_TYPE@162..168 - 0: L_BRACK@162..163 "[" [] [] - 1: TS_TUPLE_TYPE_ELEMENT_LIST@163..167 - 0: TS_REFERENCE_TYPE@163..164 - 0: JS_REFERENCE_IDENTIFIER@163..164 - 0: IDENT@163..164 "X" [] [] - 1: (empty) - 1: COMMA@164..166 "," [] [Whitespace(" ")] - 2: TS_REFERENCE_TYPE@166..167 - 0: JS_REFERENCE_IDENTIFIER@166..167 - 0: IDENT@166..167 "Y" [] [] - 1: (empty) - 2: R_BRACK@167..168 "]" [] [] - 7: TS_TYPE_ALIAS_DECLARATION@168..216 - 0: TYPE_KW@168..174 "type" [Newline("\n")] [Whitespace(" ")] - 1: TS_IDENTIFIER_BINDING@174..177 - 0: IDENT@174..177 "Foo" [] [] - 2: TS_TYPE_PARAMETERS@177..208 - 0: L_ANGLE@177..178 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@178..206 - 0: TS_TYPE_PARAMETER@178..182 - 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@178..182 - 0: IDENT@178..182 "out" [] [Whitespace(" ")] + 4: TS_REFERENCE_TYPE@162..163 + 0: JS_REFERENCE_IDENTIFIER@162..163 + 0: IDENT@162..163 "T" [] [] + 1: (empty) + 7: TS_TYPE_ALIAS_DECLARATION@163..190 + 0: TYPE_KW@163..169 "type" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@169..172 + 0: IDENT@169..172 "Foo" [] [] + 2: TS_TYPE_PARAMETERS@172..187 + 0: L_ANGLE@172..173 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@173..185 + 0: TS_TYPE_PARAMETER@173..184 + 0: TS_TYPE_PARAMETER_MODIFIER@173..180 + 0: IN_KW@173..176 "in" [] [Whitespace(" ")] + 1: OUT_KW@176..180 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@180..184 + 0: IDENT@180..184 "out" [] [Whitespace(" ")] 2: (empty) 3: (empty) 1: (empty) - 2: TS_TYPE_PARAMETER@182..183 + 2: TS_TYPE_PARAMETER@184..185 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@182..183 - 0: IDENT@182..183 "X" [] [] + 1: TS_TYPE_PARAMETER_NAME@184..185 + 0: IDENT@184..185 "T" [] [] 2: (empty) 3: (empty) - 3: COMMA@183..185 "," [] [Whitespace(" ")] - 4: TS_TYPE_PARAMETER@185..189 - 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@185..189 - 0: IDENT@185..189 "out" [] [Whitespace(" ")] + 2: R_ANGLE@185..187 ">" [] [Whitespace(" ")] + 3: EQ@187..189 "=" [] [Whitespace(" ")] + 4: TS_REFERENCE_TYPE@189..190 + 0: JS_REFERENCE_IDENTIFIER@189..190 + 0: IDENT@189..190 "T" [] [] + 1: (empty) + 5: (empty) + 8: JS_FUNCTION_DECLARATION@190..214 + 0: (empty) + 1: FUNCTION_KW@190..200 "function" [Newline("\n")] [Whitespace(" ")] + 2: (empty) + 3: JS_IDENTIFIER_BINDING@200..203 + 0: IDENT@200..203 "foo" [] [] + 4: TS_TYPE_PARAMETERS@203..209 + 0: L_ANGLE@203..204 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@204..208 + 0: TS_TYPE_PARAMETER@204..208 + 0: TS_TYPE_PARAMETER_MODIFIER@204..207 + 0: IN_KW@204..207 "in" [] [Whitespace(" ")] + 1: (empty) + 1: TS_TYPE_PARAMETER_NAME@207..208 + 0: IDENT@207..208 "T" [] [] 2: (empty) 3: (empty) - 5: (empty) - 6: TS_TYPE_PARAMETER@189..206 - 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@189..191 - 0: IDENT@189..191 "Y" [] [Whitespace(" ")] - 2: TS_TYPE_CONSTRAINT_CLAUSE@191..206 - 0: EXTENDS_KW@191..199 "extends" [] [Whitespace(" ")] - 1: TS_TYPE_OPERATOR_TYPE@199..206 - 0: KEYOF_KW@199..205 "keyof" [] [Whitespace(" ")] - 1: TS_REFERENCE_TYPE@205..206 - 0: JS_REFERENCE_IDENTIFIER@205..206 - 0: IDENT@205..206 "X" [] [] - 1: (empty) + 2: R_ANGLE@208..209 ">" [] [] + 5: JS_PARAMETERS@209..212 + 0: L_PAREN@209..210 "(" [] [] + 1: JS_PARAMETER_LIST@210..210 + 2: R_PAREN@210..212 ")" [] [Whitespace(" ")] + 6: (empty) + 7: JS_FUNCTION_BODY@212..214 + 0: L_CURLY@212..213 "{" [] [] + 1: JS_DIRECTIVE_LIST@213..213 + 2: JS_STATEMENT_LIST@213..213 + 3: R_CURLY@213..214 "}" [] [] + 9: JS_FUNCTION_DECLARATION@214..239 + 0: (empty) + 1: FUNCTION_KW@214..224 "function" [Newline("\n")] [Whitespace(" ")] + 2: (empty) + 3: JS_IDENTIFIER_BINDING@224..227 + 0: IDENT@224..227 "foo" [] [] + 4: TS_TYPE_PARAMETERS@227..234 + 0: L_ANGLE@227..228 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@228..233 + 0: TS_TYPE_PARAMETER@228..233 + 0: TS_TYPE_PARAMETER_MODIFIER@228..232 + 0: (empty) + 1: OUT_KW@228..232 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@232..233 + 0: IDENT@232..233 "T" [] [] + 2: (empty) 3: (empty) - 2: R_ANGLE@206..208 ">" [] [Whitespace(" ")] - 3: EQ@208..210 "=" [] [Whitespace(" ")] - 4: TS_TUPLE_TYPE@210..216 - 0: L_BRACK@210..211 "[" [] [] - 1: TS_TUPLE_TYPE_ELEMENT_LIST@211..215 - 0: TS_REFERENCE_TYPE@211..212 - 0: JS_REFERENCE_IDENTIFIER@211..212 - 0: IDENT@211..212 "X" [] [] - 1: (empty) - 1: COMMA@212..214 "," [] [Whitespace(" ")] - 2: TS_REFERENCE_TYPE@214..215 - 0: JS_REFERENCE_IDENTIFIER@214..215 - 0: IDENT@214..215 "Y" [] [] - 1: (empty) - 2: R_BRACK@215..216 "]" [] [] - 5: (empty) - 3: EOF@216..217 "" [Newline("\n")] [] + 2: R_ANGLE@233..234 ">" [] [] + 5: JS_PARAMETERS@234..237 + 0: L_PAREN@234..235 "(" [] [] + 1: JS_PARAMETER_LIST@235..235 + 2: R_PAREN@235..237 ")" [] [Whitespace(" ")] + 6: (empty) + 7: JS_FUNCTION_BODY@237..239 + 0: L_CURLY@237..238 "{" [] [] + 1: JS_DIRECTIVE_LIST@238..238 + 2: JS_STATEMENT_LIST@238..238 + 3: R_CURLY@238..239 "}" [] [] + 3: EOF@239..240 "" [Newline("\n")] [] -- -error[SyntaxError]: expected a type parameter but instead found 'in' - ┌─ type_parameter_modifier.ts:1:10 +error[SyntaxError]: expected `,` but instead found `\` + ┌─ type_parameter_modifier.ts:1:11 │ -1 │ type Foo = T - │ ^^ Expected a type parameter here +1 │ type Foo = T + │ ^ unexpected -- -error[SyntaxError]: expected `,` but instead found `T` - ┌─ type_parameter_modifier.ts:1:13 +error[SyntaxError]: expected `,` but instead found `\u006E` + ┌─ type_parameter_modifier.ts:1:12 │ -1 │ type Foo = T - │ ^ unexpected +1 │ type Foo = T + │ ^^^^^^ unexpected -- error[SyntaxError]: expected `,` but instead found `T` - ┌─ type_parameter_modifier.ts:2:14 + ┌─ type_parameter_modifier.ts:1:19 │ -2 │ type Foo = T - │ ^ unexpected +1 │ type Foo = T + │ ^ unexpected -- -error[SyntaxError]: expected a type parameter but instead found 'in out' - ┌─ type_parameter_modifier.ts:3:10 +error[SyntaxError]: expected `,` but instead found `\` + ┌─ type_parameter_modifier.ts:2:12 │ -3 │ type Foo = T - │ ^^^^^^ Expected a type parameter here +2 │ type Foo = T + │ ^ unexpected -- -error[SyntaxError]: expected `,` but instead found `out` - ┌─ type_parameter_modifier.ts:4:14 +error[SyntaxError]: expected `,` but instead found `\u0074` + ┌─ type_parameter_modifier.ts:2:13 │ -4 │ type Foo = T - │ ^^^ unexpected +2 │ type Foo = T + │ ^^^^^^ unexpected -- -error[SyntaxError]: expected a type parameter but instead found 'in out out' - ┌─ type_parameter_modifier.ts:5:10 +error[SyntaxError]: expected `,` but instead found `T` + ┌─ type_parameter_modifier.ts:2:20 │ -5 │ type Foo = T - │ ^^^^^^^^^^ Expected a type parameter here +2 │ type Foo = T + │ ^ unexpected -- error[SyntaxError]: expected a type parameter but instead found 'in' - ┌─ type_parameter_modifier.ts:6:10 + ┌─ type_parameter_modifier.ts:3:13 │ -6 │ type Foo = [X, Y] - │ ^^ Expected a type parameter here +3 │ type Foo = T + │ ^^ Expected a type parameter here -- -error[SyntaxError]: expected `,` but instead found `X` - ┌─ type_parameter_modifier.ts:6:13 +error[SyntaxError]: expected a type parameter but instead found 'in' + ┌─ type_parameter_modifier.ts:4:14 │ -6 │ type Foo = [X, Y] - │ ^ unexpected +4 │ type Foo = T + │ ^^ Expected a type parameter here -- -error[SyntaxError]: expected `,` but instead found `Y` - ┌─ type_parameter_modifier.ts:6:20 +error[SyntaxError]: expected a type parameter but instead found 'in' + ┌─ type_parameter_modifier.ts:5:14 │ -6 │ type Foo = [X, Y] - │ ^ unexpected +5 │ type Foo = T + │ ^^ Expected a type parameter here + +-- +error[SyntaxError]: expected `,` but instead found `T` + ┌─ type_parameter_modifier.ts:5:17 + │ +5 │ type Foo = T + │ ^ unexpected + +-- +error[SyntaxError]: Illegal use of reserved keyword `public` as an identifier in strict mode + ┌─ type_parameter_modifier.ts:6:10 + │ +6 │ type Foo = T + │ ^^^^^^ -- -error[SyntaxError]: expected `,` but instead found `X` - ┌─ type_parameter_modifier.ts:7:14 +error[SyntaxError]: expected `,` but instead found `T` + ┌─ type_parameter_modifier.ts:6:17 │ -7 │ type Foo = [X, Y] - │ ^ unexpected +6 │ type Foo = T + │ ^ unexpected -- error[SyntaxError]: expected a type parameter but instead found 'in' ┌─ type_parameter_modifier.ts:7:17 │ -7 │ type Foo = [X, Y] +7 │ type Foo = T │ ^^ Expected a type parameter here -- -error[SyntaxError]: expected `,` but instead found `Y` +error[SyntaxError]: expected `,` but instead found `T` ┌─ type_parameter_modifier.ts:7:20 │ -7 │ type Foo = [X, Y] +7 │ type Foo = T │ ^ unexpected -- -error[SyntaxError]: expected `,` but instead found `X` - ┌─ type_parameter_modifier.ts:8:14 +error[SyntaxError]: expected `,` but instead found `T` + ┌─ type_parameter_modifier.ts:8:21 │ -8 │ type Foo = [X, Y] - │ ^ unexpected +8 │ type Foo = T + │ ^ unexpected -- -error[SyntaxError]: expected `,` but instead found `Y` - ┌─ type_parameter_modifier.ts:8:21 +error[SyntaxError]: TypeParameterModifier `in` is not valid here + ┌─ type_parameter_modifier.ts:9:14 │ -8 │ type Foo = [X, Y] - │ ^ unexpected +9 │ function foo() {} + │ ^^ + +-- +error[SyntaxError]: TypeParameterModifier `out` is not valid here + ┌─ type_parameter_modifier.ts:10:14 + │ +10 │ function foo() {} + │ ^^^ + +-- +error: unexpected token `\` + ┌─ type_parameter_modifier.ts:1:11 + │ +1 │ type Foo = T + │ ^ + +-- +error: unexpected token `\` + ┌─ type_parameter_modifier.ts:2:12 + │ +2 │ type Foo = T + │ ^ -- -type Foo = T -type Foo = T -type Foo = T -type Foo = T -type Foo = T -type Foo = [X, Y] -type Foo = [X, Y] -type Foo = [X, Y] +type Foo = T +type Foo = T +type Foo = T +type Foo = T +type Foo = T +type Foo = T +type Foo = T +type Foo = T +function foo() {} +function foo() {} diff --git a/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.ts b/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.ts new file mode 100644 index 00000000000..569a018a919 --- /dev/null +++ b/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.ts @@ -0,0 +1,10 @@ +type Foo = T +type Foo = T +type Foo = T +type Foo = T +type Foo = T +type Foo = T +type Foo = T +type Foo = T +function foo() {} +function foo() {} diff --git a/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.rast b/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.rast index ae134c726bc..7471315dcea 100644 --- a/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.rast +++ b/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.rast @@ -338,313 +338,313 @@ JsModule { }, JsClassDeclaration { abstract_token: missing (optional), - class_token: CLASS_KW@216..262 "class" [Newline("\n"), Whitespace(" ..."), Newline("\n")] [Whitespace(" ")], + class_token: CLASS_KW@216..223 "class" [Newline("\n")] [Whitespace(" ")], id: JsIdentifierBinding { - name_token: IDENT@262..265 "Foo" [] [], + name_token: IDENT@223..226 "Foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@265..266 "<" [] [], + l_angle_token: L_ANGLE@226..227 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { - in_token: IN_KW@266..269 "in" [] [Whitespace(" ")], + in_token: IN_KW@227..230 "in" [] [Whitespace(" ")], out_token: missing (optional), }, name: TsTypeParameterName { - ident_token: IDENT@269..270 "T" [] [], + ident_token: IDENT@230..231 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@270..272 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@231..233 ">" [] [Whitespace(" ")], }, extends_clause: missing (optional), implements_clause: missing (optional), - l_curly_token: L_CURLY@272..273 "{" [] [], + l_curly_token: L_CURLY@233..234 "{" [] [], members: JsClassMemberList [], - r_curly_token: R_CURLY@273..274 "}" [] [], + r_curly_token: R_CURLY@234..235 "}" [] [], }, JsClassDeclaration { abstract_token: missing (optional), - class_token: CLASS_KW@274..281 "class" [Newline("\n")] [Whitespace(" ")], + class_token: CLASS_KW@235..242 "class" [Newline("\n")] [Whitespace(" ")], id: JsIdentifierBinding { - name_token: IDENT@281..284 "Foo" [] [], + name_token: IDENT@242..245 "Foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@284..285 "<" [] [], + l_angle_token: L_ANGLE@245..246 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { in_token: missing (optional), - out_token: OUT_KW@285..289 "out" [] [Whitespace(" ")], + out_token: OUT_KW@246..250 "out" [] [Whitespace(" ")], }, name: TsTypeParameterName { - ident_token: IDENT@289..290 "T" [] [], + ident_token: IDENT@250..251 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@290..292 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@251..253 ">" [] [Whitespace(" ")], }, extends_clause: missing (optional), implements_clause: missing (optional), - l_curly_token: L_CURLY@292..293 "{" [] [], + l_curly_token: L_CURLY@253..254 "{" [] [], members: JsClassMemberList [], - r_curly_token: R_CURLY@293..294 "}" [] [], + r_curly_token: R_CURLY@254..255 "}" [] [], }, JsExport { - export_token: EXPORT_KW@294..302 "export" [Newline("\n")] [Whitespace(" ")], + export_token: EXPORT_KW@255..263 "export" [Newline("\n")] [Whitespace(" ")], export_clause: JsExportDefaultDeclarationClause { - default_token: DEFAULT_KW@302..310 "default" [] [Whitespace(" ")], + default_token: DEFAULT_KW@263..271 "default" [] [Whitespace(" ")], declaration: JsClassExportDefaultDeclaration { abstract_token: missing (optional), - class_token: CLASS_KW@310..316 "class" [] [Whitespace(" ")], + class_token: CLASS_KW@271..277 "class" [] [Whitespace(" ")], id: JsIdentifierBinding { - name_token: IDENT@316..319 "Foo" [] [], + name_token: IDENT@277..280 "Foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@319..320 "<" [] [], + l_angle_token: L_ANGLE@280..281 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { - in_token: IN_KW@320..323 "in" [] [Whitespace(" ")], + in_token: IN_KW@281..284 "in" [] [Whitespace(" ")], out_token: missing (optional), }, name: TsTypeParameterName { - ident_token: IDENT@323..324 "T" [] [], + ident_token: IDENT@284..285 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@324..326 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@285..287 ">" [] [Whitespace(" ")], }, extends_clause: missing (optional), implements_clause: missing (optional), - l_curly_token: L_CURLY@326..327 "{" [] [], + l_curly_token: L_CURLY@287..288 "{" [] [], members: JsClassMemberList [], - r_curly_token: R_CURLY@327..328 "}" [] [], + r_curly_token: R_CURLY@288..289 "}" [] [], }, semicolon_token: missing (optional), }, }, JsClassDeclaration { abstract_token: missing (optional), - class_token: CLASS_KW@328..335 "class" [Newline("\n")] [Whitespace(" ")], + class_token: CLASS_KW@289..296 "class" [Newline("\n")] [Whitespace(" ")], id: JsIdentifierBinding { - name_token: IDENT@335..338 "Foo" [] [], + name_token: IDENT@296..299 "Foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@338..339 "<" [] [], + l_angle_token: L_ANGLE@299..300 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { in_token: missing (optional), - out_token: OUT_KW@339..343 "out" [] [Whitespace(" ")], + out_token: OUT_KW@300..304 "out" [] [Whitespace(" ")], }, name: TsTypeParameterName { - ident_token: IDENT@343..344 "T" [] [], + ident_token: IDENT@304..305 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@344..346 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@305..307 ">" [] [Whitespace(" ")], }, extends_clause: missing (optional), implements_clause: missing (optional), - l_curly_token: L_CURLY@346..347 "{" [] [], + l_curly_token: L_CURLY@307..308 "{" [] [], members: JsClassMemberList [], - r_curly_token: R_CURLY@347..348 "}" [] [], + r_curly_token: R_CURLY@308..309 "}" [] [], }, TsInterfaceDeclaration { - interface_token: INTERFACE_KW@348..359 "interface" [Newline("\n")] [Whitespace(" ")], + interface_token: INTERFACE_KW@309..320 "interface" [Newline("\n")] [Whitespace(" ")], id: TsIdentifierBinding { - name_token: IDENT@359..362 "Foo" [] [], + name_token: IDENT@320..323 "Foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@362..363 "<" [] [], + l_angle_token: L_ANGLE@323..324 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { - in_token: IN_KW@363..366 "in" [] [Whitespace(" ")], + in_token: IN_KW@324..327 "in" [] [Whitespace(" ")], out_token: missing (optional), }, name: TsTypeParameterName { - ident_token: IDENT@366..367 "T" [] [], + ident_token: IDENT@327..328 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@367..369 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@328..330 ">" [] [Whitespace(" ")], }, extends_clause: missing (optional), - l_curly_token: L_CURLY@369..370 "{" [] [], + l_curly_token: L_CURLY@330..331 "{" [] [], members: TsTypeMemberList [], - r_curly_token: R_CURLY@370..371 "}" [] [], + r_curly_token: R_CURLY@331..332 "}" [] [], }, TsInterfaceDeclaration { - interface_token: INTERFACE_KW@371..382 "interface" [Newline("\n")] [Whitespace(" ")], + interface_token: INTERFACE_KW@332..343 "interface" [Newline("\n")] [Whitespace(" ")], id: TsIdentifierBinding { - name_token: IDENT@382..385 "Foo" [] [], + name_token: IDENT@343..346 "Foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@385..386 "<" [] [], + l_angle_token: L_ANGLE@346..347 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { in_token: missing (optional), - out_token: OUT_KW@386..390 "out" [] [Whitespace(" ")], + out_token: OUT_KW@347..351 "out" [] [Whitespace(" ")], }, name: TsTypeParameterName { - ident_token: IDENT@390..391 "T" [] [], + ident_token: IDENT@351..352 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@391..393 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@352..354 ">" [] [Whitespace(" ")], }, extends_clause: missing (optional), - l_curly_token: L_CURLY@393..394 "{" [] [], + l_curly_token: L_CURLY@354..355 "{" [] [], members: TsTypeMemberList [], - r_curly_token: R_CURLY@394..395 "}" [] [], + r_curly_token: R_CURLY@355..356 "}" [] [], }, TsDeclareStatement { - declare_token: DECLARE_KW@395..404 "declare" [Newline("\n")] [Whitespace(" ")], + declare_token: DECLARE_KW@356..365 "declare" [Newline("\n")] [Whitespace(" ")], declaration: JsClassDeclaration { abstract_token: missing (optional), - class_token: CLASS_KW@404..410 "class" [] [Whitespace(" ")], + class_token: CLASS_KW@365..371 "class" [] [Whitespace(" ")], id: JsIdentifierBinding { - name_token: IDENT@410..413 "Foo" [] [], + name_token: IDENT@371..374 "Foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@413..414 "<" [] [], + l_angle_token: L_ANGLE@374..375 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { - in_token: IN_KW@414..417 "in" [] [Whitespace(" ")], + in_token: IN_KW@375..378 "in" [] [Whitespace(" ")], out_token: missing (optional), }, name: TsTypeParameterName { - ident_token: IDENT@417..418 "T" [] [], + ident_token: IDENT@378..379 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@418..420 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@379..381 ">" [] [Whitespace(" ")], }, extends_clause: missing (optional), implements_clause: missing (optional), - l_curly_token: L_CURLY@420..421 "{" [] [], + l_curly_token: L_CURLY@381..382 "{" [] [], members: JsClassMemberList [], - r_curly_token: R_CURLY@421..422 "}" [] [], + r_curly_token: R_CURLY@382..383 "}" [] [], }, }, TsDeclareStatement { - declare_token: DECLARE_KW@422..431 "declare" [Newline("\n")] [Whitespace(" ")], + declare_token: DECLARE_KW@383..392 "declare" [Newline("\n")] [Whitespace(" ")], declaration: JsClassDeclaration { abstract_token: missing (optional), - class_token: CLASS_KW@431..437 "class" [] [Whitespace(" ")], + class_token: CLASS_KW@392..398 "class" [] [Whitespace(" ")], id: JsIdentifierBinding { - name_token: IDENT@437..440 "Foo" [] [], + name_token: IDENT@398..401 "Foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@440..441 "<" [] [], + l_angle_token: L_ANGLE@401..402 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { in_token: missing (optional), - out_token: OUT_KW@441..445 "out" [] [Whitespace(" ")], + out_token: OUT_KW@402..406 "out" [] [Whitespace(" ")], }, name: TsTypeParameterName { - ident_token: IDENT@445..446 "T" [] [], + ident_token: IDENT@406..407 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@446..448 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@407..409 ">" [] [Whitespace(" ")], }, extends_clause: missing (optional), implements_clause: missing (optional), - l_curly_token: L_CURLY@448..449 "{" [] [], + l_curly_token: L_CURLY@409..410 "{" [] [], members: JsClassMemberList [], - r_curly_token: R_CURLY@449..450 "}" [] [], + r_curly_token: R_CURLY@410..411 "}" [] [], }, }, TsDeclareStatement { - declare_token: DECLARE_KW@450..459 "declare" [Newline("\n")] [Whitespace(" ")], + declare_token: DECLARE_KW@411..420 "declare" [Newline("\n")] [Whitespace(" ")], declaration: TsInterfaceDeclaration { - interface_token: INTERFACE_KW@459..469 "interface" [] [Whitespace(" ")], + interface_token: INTERFACE_KW@420..430 "interface" [] [Whitespace(" ")], id: TsIdentifierBinding { - name_token: IDENT@469..472 "Foo" [] [], + name_token: IDENT@430..433 "Foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@472..473 "<" [] [], + l_angle_token: L_ANGLE@433..434 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { - in_token: IN_KW@473..476 "in" [] [Whitespace(" ")], + in_token: IN_KW@434..437 "in" [] [Whitespace(" ")], out_token: missing (optional), }, name: TsTypeParameterName { - ident_token: IDENT@476..477 "T" [] [], + ident_token: IDENT@437..438 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@477..479 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@438..440 ">" [] [Whitespace(" ")], }, extends_clause: missing (optional), - l_curly_token: L_CURLY@479..480 "{" [] [], + l_curly_token: L_CURLY@440..441 "{" [] [], members: TsTypeMemberList [], - r_curly_token: R_CURLY@480..481 "}" [] [], + r_curly_token: R_CURLY@441..442 "}" [] [], }, }, TsDeclareStatement { - declare_token: DECLARE_KW@481..490 "declare" [Newline("\n")] [Whitespace(" ")], + declare_token: DECLARE_KW@442..451 "declare" [Newline("\n")] [Whitespace(" ")], declaration: TsInterfaceDeclaration { - interface_token: INTERFACE_KW@490..500 "interface" [] [Whitespace(" ")], + interface_token: INTERFACE_KW@451..461 "interface" [] [Whitespace(" ")], id: TsIdentifierBinding { - name_token: IDENT@500..503 "Foo" [] [], + name_token: IDENT@461..464 "Foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@503..504 "<" [] [], + l_angle_token: L_ANGLE@464..465 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { in_token: missing (optional), - out_token: OUT_KW@504..508 "out" [] [Whitespace(" ")], + out_token: OUT_KW@465..469 "out" [] [Whitespace(" ")], }, name: TsTypeParameterName { - ident_token: IDENT@508..509 "T" [] [], + ident_token: IDENT@469..470 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@509..511 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@470..472 ">" [] [Whitespace(" ")], }, extends_clause: missing (optional), - l_curly_token: L_CURLY@511..512 "{" [] [], + l_curly_token: L_CURLY@472..473 "{" [] [], members: TsTypeMemberList [], - r_curly_token: R_CURLY@512..513 "}" [] [], + r_curly_token: R_CURLY@473..474 "}" [] [], }, }, ], - eof_token: EOF@513..514 "" [Newline("\n")] [], + eof_token: EOF@474..475 "" [Newline("\n")] [], } -0: JS_MODULE@0..514 +0: JS_MODULE@0..475 0: (empty) 1: JS_DIRECTIVE_LIST@0..0 - 2: JS_MODULE_ITEM_LIST@0..513 + 2: JS_MODULE_ITEM_LIST@0..474 0: TS_TYPE_ALIAS_DECLARATION@0..18 0: TYPE_KW@0..5 "type" [] [Whitespace(" ")] 1: TS_IDENTIFIER_BINDING@5..8 @@ -882,229 +882,229 @@ JsModule { 1: (empty) 2: R_BRACK@215..216 "]" [] [] 5: (empty) - 8: JS_CLASS_DECLARATION@216..274 + 8: JS_CLASS_DECLARATION@216..235 0: (empty) - 1: CLASS_KW@216..262 "class" [Newline("\n"), Whitespace(" ..."), Newline("\n")] [Whitespace(" ")] - 2: JS_IDENTIFIER_BINDING@262..265 - 0: IDENT@262..265 "Foo" [] [] - 3: TS_TYPE_PARAMETERS@265..272 - 0: L_ANGLE@265..266 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@266..270 - 0: TS_TYPE_PARAMETER@266..270 - 0: TS_TYPE_PARAMETER_MODIFIER@266..269 - 0: IN_KW@266..269 "in" [] [Whitespace(" ")] + 1: CLASS_KW@216..223 "class" [Newline("\n")] [Whitespace(" ")] + 2: JS_IDENTIFIER_BINDING@223..226 + 0: IDENT@223..226 "Foo" [] [] + 3: TS_TYPE_PARAMETERS@226..233 + 0: L_ANGLE@226..227 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@227..231 + 0: TS_TYPE_PARAMETER@227..231 + 0: TS_TYPE_PARAMETER_MODIFIER@227..230 + 0: IN_KW@227..230 "in" [] [Whitespace(" ")] 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@269..270 - 0: IDENT@269..270 "T" [] [] + 1: TS_TYPE_PARAMETER_NAME@230..231 + 0: IDENT@230..231 "T" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@270..272 ">" [] [Whitespace(" ")] + 2: R_ANGLE@231..233 ">" [] [Whitespace(" ")] 4: (empty) 5: (empty) - 6: L_CURLY@272..273 "{" [] [] - 7: JS_CLASS_MEMBER_LIST@273..273 - 8: R_CURLY@273..274 "}" [] [] - 9: JS_CLASS_DECLARATION@274..294 + 6: L_CURLY@233..234 "{" [] [] + 7: JS_CLASS_MEMBER_LIST@234..234 + 8: R_CURLY@234..235 "}" [] [] + 9: JS_CLASS_DECLARATION@235..255 0: (empty) - 1: CLASS_KW@274..281 "class" [Newline("\n")] [Whitespace(" ")] - 2: JS_IDENTIFIER_BINDING@281..284 - 0: IDENT@281..284 "Foo" [] [] - 3: TS_TYPE_PARAMETERS@284..292 - 0: L_ANGLE@284..285 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@285..290 - 0: TS_TYPE_PARAMETER@285..290 - 0: TS_TYPE_PARAMETER_MODIFIER@285..289 + 1: CLASS_KW@235..242 "class" [Newline("\n")] [Whitespace(" ")] + 2: JS_IDENTIFIER_BINDING@242..245 + 0: IDENT@242..245 "Foo" [] [] + 3: TS_TYPE_PARAMETERS@245..253 + 0: L_ANGLE@245..246 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@246..251 + 0: TS_TYPE_PARAMETER@246..251 + 0: TS_TYPE_PARAMETER_MODIFIER@246..250 0: (empty) - 1: OUT_KW@285..289 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@289..290 - 0: IDENT@289..290 "T" [] [] + 1: OUT_KW@246..250 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@250..251 + 0: IDENT@250..251 "T" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@290..292 ">" [] [Whitespace(" ")] + 2: R_ANGLE@251..253 ">" [] [Whitespace(" ")] 4: (empty) 5: (empty) - 6: L_CURLY@292..293 "{" [] [] - 7: JS_CLASS_MEMBER_LIST@293..293 - 8: R_CURLY@293..294 "}" [] [] - 10: JS_EXPORT@294..328 - 0: EXPORT_KW@294..302 "export" [Newline("\n")] [Whitespace(" ")] - 1: JS_EXPORT_DEFAULT_DECLARATION_CLAUSE@302..328 - 0: DEFAULT_KW@302..310 "default" [] [Whitespace(" ")] - 1: JS_CLASS_EXPORT_DEFAULT_DECLARATION@310..328 + 6: L_CURLY@253..254 "{" [] [] + 7: JS_CLASS_MEMBER_LIST@254..254 + 8: R_CURLY@254..255 "}" [] [] + 10: JS_EXPORT@255..289 + 0: EXPORT_KW@255..263 "export" [Newline("\n")] [Whitespace(" ")] + 1: JS_EXPORT_DEFAULT_DECLARATION_CLAUSE@263..289 + 0: DEFAULT_KW@263..271 "default" [] [Whitespace(" ")] + 1: JS_CLASS_EXPORT_DEFAULT_DECLARATION@271..289 0: (empty) - 1: CLASS_KW@310..316 "class" [] [Whitespace(" ")] - 2: JS_IDENTIFIER_BINDING@316..319 - 0: IDENT@316..319 "Foo" [] [] - 3: TS_TYPE_PARAMETERS@319..326 - 0: L_ANGLE@319..320 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@320..324 - 0: TS_TYPE_PARAMETER@320..324 - 0: TS_TYPE_PARAMETER_MODIFIER@320..323 - 0: IN_KW@320..323 "in" [] [Whitespace(" ")] + 1: CLASS_KW@271..277 "class" [] [Whitespace(" ")] + 2: JS_IDENTIFIER_BINDING@277..280 + 0: IDENT@277..280 "Foo" [] [] + 3: TS_TYPE_PARAMETERS@280..287 + 0: L_ANGLE@280..281 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@281..285 + 0: TS_TYPE_PARAMETER@281..285 + 0: TS_TYPE_PARAMETER_MODIFIER@281..284 + 0: IN_KW@281..284 "in" [] [Whitespace(" ")] 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@323..324 - 0: IDENT@323..324 "T" [] [] + 1: TS_TYPE_PARAMETER_NAME@284..285 + 0: IDENT@284..285 "T" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@324..326 ">" [] [Whitespace(" ")] + 2: R_ANGLE@285..287 ">" [] [Whitespace(" ")] 4: (empty) 5: (empty) - 6: L_CURLY@326..327 "{" [] [] - 7: JS_CLASS_MEMBER_LIST@327..327 - 8: R_CURLY@327..328 "}" [] [] + 6: L_CURLY@287..288 "{" [] [] + 7: JS_CLASS_MEMBER_LIST@288..288 + 8: R_CURLY@288..289 "}" [] [] 2: (empty) - 11: JS_CLASS_DECLARATION@328..348 + 11: JS_CLASS_DECLARATION@289..309 0: (empty) - 1: CLASS_KW@328..335 "class" [Newline("\n")] [Whitespace(" ")] - 2: JS_IDENTIFIER_BINDING@335..338 - 0: IDENT@335..338 "Foo" [] [] - 3: TS_TYPE_PARAMETERS@338..346 - 0: L_ANGLE@338..339 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@339..344 - 0: TS_TYPE_PARAMETER@339..344 - 0: TS_TYPE_PARAMETER_MODIFIER@339..343 + 1: CLASS_KW@289..296 "class" [Newline("\n")] [Whitespace(" ")] + 2: JS_IDENTIFIER_BINDING@296..299 + 0: IDENT@296..299 "Foo" [] [] + 3: TS_TYPE_PARAMETERS@299..307 + 0: L_ANGLE@299..300 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@300..305 + 0: TS_TYPE_PARAMETER@300..305 + 0: TS_TYPE_PARAMETER_MODIFIER@300..304 0: (empty) - 1: OUT_KW@339..343 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@343..344 - 0: IDENT@343..344 "T" [] [] + 1: OUT_KW@300..304 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@304..305 + 0: IDENT@304..305 "T" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@344..346 ">" [] [Whitespace(" ")] + 2: R_ANGLE@305..307 ">" [] [Whitespace(" ")] 4: (empty) 5: (empty) - 6: L_CURLY@346..347 "{" [] [] - 7: JS_CLASS_MEMBER_LIST@347..347 - 8: R_CURLY@347..348 "}" [] [] - 12: TS_INTERFACE_DECLARATION@348..371 - 0: INTERFACE_KW@348..359 "interface" [Newline("\n")] [Whitespace(" ")] - 1: TS_IDENTIFIER_BINDING@359..362 - 0: IDENT@359..362 "Foo" [] [] - 2: TS_TYPE_PARAMETERS@362..369 - 0: L_ANGLE@362..363 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@363..367 - 0: TS_TYPE_PARAMETER@363..367 - 0: TS_TYPE_PARAMETER_MODIFIER@363..366 - 0: IN_KW@363..366 "in" [] [Whitespace(" ")] + 6: L_CURLY@307..308 "{" [] [] + 7: JS_CLASS_MEMBER_LIST@308..308 + 8: R_CURLY@308..309 "}" [] [] + 12: TS_INTERFACE_DECLARATION@309..332 + 0: INTERFACE_KW@309..320 "interface" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@320..323 + 0: IDENT@320..323 "Foo" [] [] + 2: TS_TYPE_PARAMETERS@323..330 + 0: L_ANGLE@323..324 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@324..328 + 0: TS_TYPE_PARAMETER@324..328 + 0: TS_TYPE_PARAMETER_MODIFIER@324..327 + 0: IN_KW@324..327 "in" [] [Whitespace(" ")] 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@366..367 - 0: IDENT@366..367 "T" [] [] + 1: TS_TYPE_PARAMETER_NAME@327..328 + 0: IDENT@327..328 "T" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@367..369 ">" [] [Whitespace(" ")] + 2: R_ANGLE@328..330 ">" [] [Whitespace(" ")] 3: (empty) - 4: L_CURLY@369..370 "{" [] [] - 5: TS_TYPE_MEMBER_LIST@370..370 - 6: R_CURLY@370..371 "}" [] [] - 13: TS_INTERFACE_DECLARATION@371..395 - 0: INTERFACE_KW@371..382 "interface" [Newline("\n")] [Whitespace(" ")] - 1: TS_IDENTIFIER_BINDING@382..385 - 0: IDENT@382..385 "Foo" [] [] - 2: TS_TYPE_PARAMETERS@385..393 - 0: L_ANGLE@385..386 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@386..391 - 0: TS_TYPE_PARAMETER@386..391 - 0: TS_TYPE_PARAMETER_MODIFIER@386..390 + 4: L_CURLY@330..331 "{" [] [] + 5: TS_TYPE_MEMBER_LIST@331..331 + 6: R_CURLY@331..332 "}" [] [] + 13: TS_INTERFACE_DECLARATION@332..356 + 0: INTERFACE_KW@332..343 "interface" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@343..346 + 0: IDENT@343..346 "Foo" [] [] + 2: TS_TYPE_PARAMETERS@346..354 + 0: L_ANGLE@346..347 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@347..352 + 0: TS_TYPE_PARAMETER@347..352 + 0: TS_TYPE_PARAMETER_MODIFIER@347..351 0: (empty) - 1: OUT_KW@386..390 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@390..391 - 0: IDENT@390..391 "T" [] [] + 1: OUT_KW@347..351 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@351..352 + 0: IDENT@351..352 "T" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@391..393 ">" [] [Whitespace(" ")] + 2: R_ANGLE@352..354 ">" [] [Whitespace(" ")] 3: (empty) - 4: L_CURLY@393..394 "{" [] [] - 5: TS_TYPE_MEMBER_LIST@394..394 - 6: R_CURLY@394..395 "}" [] [] - 14: TS_DECLARE_STATEMENT@395..422 - 0: DECLARE_KW@395..404 "declare" [Newline("\n")] [Whitespace(" ")] - 1: JS_CLASS_DECLARATION@404..422 + 4: L_CURLY@354..355 "{" [] [] + 5: TS_TYPE_MEMBER_LIST@355..355 + 6: R_CURLY@355..356 "}" [] [] + 14: TS_DECLARE_STATEMENT@356..383 + 0: DECLARE_KW@356..365 "declare" [Newline("\n")] [Whitespace(" ")] + 1: JS_CLASS_DECLARATION@365..383 0: (empty) - 1: CLASS_KW@404..410 "class" [] [Whitespace(" ")] - 2: JS_IDENTIFIER_BINDING@410..413 - 0: IDENT@410..413 "Foo" [] [] - 3: TS_TYPE_PARAMETERS@413..420 - 0: L_ANGLE@413..414 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@414..418 - 0: TS_TYPE_PARAMETER@414..418 - 0: TS_TYPE_PARAMETER_MODIFIER@414..417 - 0: IN_KW@414..417 "in" [] [Whitespace(" ")] + 1: CLASS_KW@365..371 "class" [] [Whitespace(" ")] + 2: JS_IDENTIFIER_BINDING@371..374 + 0: IDENT@371..374 "Foo" [] [] + 3: TS_TYPE_PARAMETERS@374..381 + 0: L_ANGLE@374..375 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@375..379 + 0: TS_TYPE_PARAMETER@375..379 + 0: TS_TYPE_PARAMETER_MODIFIER@375..378 + 0: IN_KW@375..378 "in" [] [Whitespace(" ")] 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@417..418 - 0: IDENT@417..418 "T" [] [] + 1: TS_TYPE_PARAMETER_NAME@378..379 + 0: IDENT@378..379 "T" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@418..420 ">" [] [Whitespace(" ")] + 2: R_ANGLE@379..381 ">" [] [Whitespace(" ")] 4: (empty) 5: (empty) - 6: L_CURLY@420..421 "{" [] [] - 7: JS_CLASS_MEMBER_LIST@421..421 - 8: R_CURLY@421..422 "}" [] [] - 15: TS_DECLARE_STATEMENT@422..450 - 0: DECLARE_KW@422..431 "declare" [Newline("\n")] [Whitespace(" ")] - 1: JS_CLASS_DECLARATION@431..450 + 6: L_CURLY@381..382 "{" [] [] + 7: JS_CLASS_MEMBER_LIST@382..382 + 8: R_CURLY@382..383 "}" [] [] + 15: TS_DECLARE_STATEMENT@383..411 + 0: DECLARE_KW@383..392 "declare" [Newline("\n")] [Whitespace(" ")] + 1: JS_CLASS_DECLARATION@392..411 0: (empty) - 1: CLASS_KW@431..437 "class" [] [Whitespace(" ")] - 2: JS_IDENTIFIER_BINDING@437..440 - 0: IDENT@437..440 "Foo" [] [] - 3: TS_TYPE_PARAMETERS@440..448 - 0: L_ANGLE@440..441 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@441..446 - 0: TS_TYPE_PARAMETER@441..446 - 0: TS_TYPE_PARAMETER_MODIFIER@441..445 + 1: CLASS_KW@392..398 "class" [] [Whitespace(" ")] + 2: JS_IDENTIFIER_BINDING@398..401 + 0: IDENT@398..401 "Foo" [] [] + 3: TS_TYPE_PARAMETERS@401..409 + 0: L_ANGLE@401..402 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@402..407 + 0: TS_TYPE_PARAMETER@402..407 + 0: TS_TYPE_PARAMETER_MODIFIER@402..406 0: (empty) - 1: OUT_KW@441..445 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@445..446 - 0: IDENT@445..446 "T" [] [] + 1: OUT_KW@402..406 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@406..407 + 0: IDENT@406..407 "T" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@446..448 ">" [] [Whitespace(" ")] + 2: R_ANGLE@407..409 ">" [] [Whitespace(" ")] 4: (empty) 5: (empty) - 6: L_CURLY@448..449 "{" [] [] - 7: JS_CLASS_MEMBER_LIST@449..449 - 8: R_CURLY@449..450 "}" [] [] - 16: TS_DECLARE_STATEMENT@450..481 - 0: DECLARE_KW@450..459 "declare" [Newline("\n")] [Whitespace(" ")] - 1: TS_INTERFACE_DECLARATION@459..481 - 0: INTERFACE_KW@459..469 "interface" [] [Whitespace(" ")] - 1: TS_IDENTIFIER_BINDING@469..472 - 0: IDENT@469..472 "Foo" [] [] - 2: TS_TYPE_PARAMETERS@472..479 - 0: L_ANGLE@472..473 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@473..477 - 0: TS_TYPE_PARAMETER@473..477 - 0: TS_TYPE_PARAMETER_MODIFIER@473..476 - 0: IN_KW@473..476 "in" [] [Whitespace(" ")] + 6: L_CURLY@409..410 "{" [] [] + 7: JS_CLASS_MEMBER_LIST@410..410 + 8: R_CURLY@410..411 "}" [] [] + 16: TS_DECLARE_STATEMENT@411..442 + 0: DECLARE_KW@411..420 "declare" [Newline("\n")] [Whitespace(" ")] + 1: TS_INTERFACE_DECLARATION@420..442 + 0: INTERFACE_KW@420..430 "interface" [] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@430..433 + 0: IDENT@430..433 "Foo" [] [] + 2: TS_TYPE_PARAMETERS@433..440 + 0: L_ANGLE@433..434 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@434..438 + 0: TS_TYPE_PARAMETER@434..438 + 0: TS_TYPE_PARAMETER_MODIFIER@434..437 + 0: IN_KW@434..437 "in" [] [Whitespace(" ")] 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@476..477 - 0: IDENT@476..477 "T" [] [] + 1: TS_TYPE_PARAMETER_NAME@437..438 + 0: IDENT@437..438 "T" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@477..479 ">" [] [Whitespace(" ")] + 2: R_ANGLE@438..440 ">" [] [Whitespace(" ")] 3: (empty) - 4: L_CURLY@479..480 "{" [] [] - 5: TS_TYPE_MEMBER_LIST@480..480 - 6: R_CURLY@480..481 "}" [] [] - 17: TS_DECLARE_STATEMENT@481..513 - 0: DECLARE_KW@481..490 "declare" [Newline("\n")] [Whitespace(" ")] - 1: TS_INTERFACE_DECLARATION@490..513 - 0: INTERFACE_KW@490..500 "interface" [] [Whitespace(" ")] - 1: TS_IDENTIFIER_BINDING@500..503 - 0: IDENT@500..503 "Foo" [] [] - 2: TS_TYPE_PARAMETERS@503..511 - 0: L_ANGLE@503..504 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@504..509 - 0: TS_TYPE_PARAMETER@504..509 - 0: TS_TYPE_PARAMETER_MODIFIER@504..508 + 4: L_CURLY@440..441 "{" [] [] + 5: TS_TYPE_MEMBER_LIST@441..441 + 6: R_CURLY@441..442 "}" [] [] + 17: TS_DECLARE_STATEMENT@442..474 + 0: DECLARE_KW@442..451 "declare" [Newline("\n")] [Whitespace(" ")] + 1: TS_INTERFACE_DECLARATION@451..474 + 0: INTERFACE_KW@451..461 "interface" [] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@461..464 + 0: IDENT@461..464 "Foo" [] [] + 2: TS_TYPE_PARAMETERS@464..472 + 0: L_ANGLE@464..465 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@465..470 + 0: TS_TYPE_PARAMETER@465..470 + 0: TS_TYPE_PARAMETER_MODIFIER@465..469 0: (empty) - 1: OUT_KW@504..508 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@508..509 - 0: IDENT@508..509 "T" [] [] + 1: OUT_KW@465..469 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@469..470 + 0: IDENT@469..470 "T" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@509..511 ">" [] [Whitespace(" ")] + 2: R_ANGLE@470..472 ">" [] [Whitespace(" ")] 3: (empty) - 4: L_CURLY@511..512 "{" [] [] - 5: TS_TYPE_MEMBER_LIST@512..512 - 6: R_CURLY@512..513 "}" [] [] - 3: EOF@513..514 "" [Newline("\n")] [] + 4: L_CURLY@472..473 "{" [] [] + 5: TS_TYPE_MEMBER_LIST@473..473 + 6: R_CURLY@473..474 "}" [] [] + 3: EOF@474..475 "" [Newline("\n")] [] diff --git a/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.ts b/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.ts index f024d40e884..203be309dd6 100644 --- a/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.ts +++ b/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.ts @@ -6,7 +6,6 @@ type Foo = T type Foo = [X, Y] type Foo = [X, Y] type Foo = [X, Y] - class Foo {} class Foo {} export default class Foo {} diff --git a/xtask/codegen/src/kinds_src.rs b/xtask/codegen/src/kinds_src.rs index eb4c0e09896..00cdcc93fb2 100644 --- a/xtask/codegen/src/kinds_src.rs +++ b/xtask/codegen/src/kinds_src.rs @@ -160,7 +160,7 @@ pub const JS_KINDS_SRC: KindsSrc = KindsSrc { "bigint", "override", "of", - "out" + "out", ], literals: &[ "JS_NUMBER_LITERAL", From e226f1a1dca475c0312b0b087bdd3a264ebbfe39 Mon Sep 17 00:00:00 2001 From: IWANABETHATGUY Date: Sun, 8 May 2022 23:57:50 +0800 Subject: [PATCH 05/22] =?UTF-8?q?test:=20=F0=9F=92=8D=20update=20error=20t?= =?UTF-8?q?est=20case?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/syntax/typescript/types.rs | 63 +- .../inline/err/type_parameter_modifier1.rast | 2748 +++++++++++++++++ .../inline/err/type_parameter_modifier1.ts | 30 + 3 files changed, 2811 insertions(+), 30 deletions(-) create mode 100644 crates/rome_js_parser/test_data/inline/err/type_parameter_modifier1.rast create mode 100644 crates/rome_js_parser/test_data/inline/err/type_parameter_modifier1.ts diff --git a/crates/rome_js_parser/src/syntax/typescript/types.rs b/crates/rome_js_parser/src/syntax/typescript/types.rs index 4f9fed7f96f..3e4ac6f8939 100644 --- a/crates/rome_js_parser/src/syntax/typescript/types.rs +++ b/crates/rome_js_parser/src/syntax/typescript/types.rs @@ -157,6 +157,39 @@ impl ParseSeparatedList for TsTypeParameterList { true } } + +// test_err ts type_parameter_modifier1 +// export default function foo() {} +// export function foo() {} +// export function foo1() {} +// export function foo2() {} +// let foo: Foo +// let foo: Foo +// declare function foo() +// declare function foo() +// declare let foo: Foo +// declare let foo: Foo +// Foo = class {} +// Foo = class {} +// foo = function () {} +// foo = function () {} +// class Foo { foo(): T {} } +// class Foo { foo(): T {} } +// foo = { foo(): T {} }; +// foo = { foo(): T {} }; +// () => {}; +// () => {}; +// () => {}; +// let x: () => {}; +// let x: () => {}; +// let x: () => {}; +// let x: new () => {}; +// let x: new () => {}; +// let x: new () => {}; +// let x: { y(): any }; +// let x: { y(): any }; +// let x: { y(): any }; + // test_err ts type_parameter_modifier // type Foo = T // type Foo = T @@ -1434,36 +1467,6 @@ fn parse_ts_type_member_semi(p: &mut Parser) { // TODO: finish all this testing -// expectParseErrorTS(t, "export default function foo() {}", ": ERROR: The modifier \"in\" is not valid here:\n") -// expectParseErrorTS(t, "export default function foo() {}", ": ERROR: The modifier \"out\" is not valid here:\n") -// expectParseErrorTS(t, "export default function () {}", ": ERROR: The modifier \"in\" is not valid here:\n") -// expectParseErrorTS(t, "export default function () {}", ": ERROR: The modifier \"out\" is not valid here:\n") -// expectParseErrorTS(t, "let foo: Foo", ": ERROR: Unexpected \"in\"\n") -// expectParseErrorTS(t, "let foo: Foo", ": ERROR: Expected \">\" but found \"T\"\n") -// expectParseErrorTS(t, "declare function foo()", ": ERROR: The modifier \"in\" is not valid here:\n") -// expectParseErrorTS(t, "declare function foo()", ": ERROR: The modifier \"out\" is not valid here:\n") -// expectParseErrorTS(t, "declare let foo: Foo", ": ERROR: Unexpected \"in\"\n") -// expectParseErrorTS(t, "declare let foo: Foo", ": ERROR: Expected \">\" but found \"T\"\n") -// expectParseErrorTS(t, "Foo = class {}", ": ERROR: The modifier \"in\" is not valid here:\n") -// expectParseErrorTS(t, "Foo = class {}", ": ERROR: The modifier \"out\" is not valid here:\n") -// expectParseErrorTS(t, "foo = function () {}", ": ERROR: The modifier \"in\" is not valid here:\n") -// expectParseErrorTS(t, "foo = function () {}", ": ERROR: The modifier \"out\" is not valid here:\n") -// expectParseErrorTS(t, "class Foo { foo(): T {} }", ": ERROR: The modifier \"in\" is not valid here:\n") -// expectParseErrorTS(t, "class Foo { foo(): T {} }", ": ERROR: The modifier \"out\" is not valid here:\n") -// expectParseErrorTS(t, "foo = { foo(): T {} }", ": ERROR: The modifier \"in\" is not valid here:\n") -// expectParseErrorTS(t, "foo = { foo(): T {} }", ": ERROR: The modifier \"out\" is not valid here:\n") -// expectParseErrorTS(t, "() => {}", ": ERROR: The modifier \"in\" is not valid here:\n") -// expectParseErrorTS(t, "() => {}", ": ERROR: The modifier \"out\" is not valid here:\n") -// expectParseErrorTS(t, "() => {}", ": ERROR: The modifier \"in\" is not valid here:\n: ERROR: The modifier \"out\" is not valid here:\n") -// expectParseErrorTS(t, "let x: () => {}", ": ERROR: The modifier \"in\" is not valid here:\n") -// expectParseErrorTS(t, "let x: () => {}", ": ERROR: The modifier \"out\" is not valid here:\n") -// expectParseErrorTS(t, "let x: () => {}", ": ERROR: The modifier \"in\" is not valid here:\n: ERROR: The modifier \"out\" is not valid here:\n") -// expectParseErrorTS(t, "let x: new () => {}", ": ERROR: The modifier \"in\" is not valid here:\n") -// expectParseErrorTS(t, "let x: new () => {}", ": ERROR: The modifier \"out\" is not valid here:\n") -// expectParseErrorTS(t, "let x: new () => {}", ": ERROR: The modifier \"in\" is not valid here:\n: ERROR: The modifier \"out\" is not valid here:\n") -// expectParseErrorTS(t, "let x: { y(): any }", ": ERROR: The modifier \"in\" is not valid here:\n") -// expectParseErrorTS(t, "let x: { y(): any }", ": ERROR: The modifier \"out\" is not valid here:\n") -// expectParseErrorTS(t, "let x: { y(): any }", ": ERROR: The modifier \"in\" is not valid here:\n: ERROR: The modifier \"out\" is not valid here:\n") // expectPrintedTSX(t, "", "/* @__PURE__ */ React.createElement(\"in\", {\n T: true\n});\n") // expectPrintedTSX(t, "", "/* @__PURE__ */ React.createElement(\"out\", {\n T: true\n});\n") // expectPrintedTSX(t, "", "/* @__PURE__ */ React.createElement(\"in\", {\n out: true,\n T: true\n});\n") diff --git a/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier1.rast b/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier1.rast new file mode 100644 index 00000000000..1f6028a04cb --- /dev/null +++ b/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier1.rast @@ -0,0 +1,2748 @@ +JsModule { + interpreter_token: missing (optional), + directives: JsDirectiveList [], + items: JsModuleItemList [ + JsExport { + export_token: EXPORT_KW@0..8 "export" [Whitespace("\t")] [Whitespace(" ")], + export_clause: JsExportDefaultDeclarationClause { + default_token: DEFAULT_KW@8..16 "default" [] [Whitespace(" ")], + declaration: JsFunctionExportDefaultDeclaration { + async_token: missing (optional), + function_token: FUNCTION_KW@16..25 "function" [] [Whitespace(" ")], + star_token: missing (optional), + id: JsIdentifierBinding { + name_token: IDENT@25..28 "foo" [] [], + }, + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@28..29 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: IN_KW@29..32 "in" [] [Whitespace(" ")], + out_token: missing (optional), + }, + name: TsTypeParameterName { + ident_token: IDENT@32..33 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@33..34 ">" [] [], + }, + parameters: JsParameters { + l_paren_token: L_PAREN@34..35 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@35..37 ")" [] [Whitespace(" ")], + }, + return_type_annotation: missing (optional), + body: JsFunctionBody { + l_curly_token: L_CURLY@37..38 "{" [] [], + directives: JsDirectiveList [], + statements: JsStatementList [], + r_curly_token: R_CURLY@38..39 "}" [] [], + }, + }, + semicolon_token: missing (optional), + }, + }, + JsExport { + export_token: EXPORT_KW@39..48 "export" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + export_clause: JsFunctionDeclaration { + async_token: missing (optional), + function_token: FUNCTION_KW@48..57 "function" [] [Whitespace(" ")], + star_token: missing (optional), + id: JsIdentifierBinding { + name_token: IDENT@57..60 "foo" [] [], + }, + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@60..61 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: missing (optional), + out_token: OUT_KW@61..65 "out" [] [Whitespace(" ")], + }, + name: TsTypeParameterName { + ident_token: IDENT@65..66 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@66..67 ">" [] [], + }, + parameters: JsParameters { + l_paren_token: L_PAREN@67..68 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@68..70 ")" [] [Whitespace(" ")], + }, + return_type_annotation: missing (optional), + body: JsFunctionBody { + l_curly_token: L_CURLY@70..71 "{" [] [], + directives: JsDirectiveList [], + statements: JsStatementList [], + r_curly_token: R_CURLY@71..72 "}" [] [], + }, + }, + }, + JsExport { + export_token: EXPORT_KW@72..81 "export" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + export_clause: JsFunctionDeclaration { + async_token: missing (optional), + function_token: FUNCTION_KW@81..90 "function" [] [Whitespace(" ")], + star_token: missing (optional), + id: JsIdentifierBinding { + name_token: IDENT@90..94 "foo1" [] [], + }, + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@94..95 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: IN_KW@95..98 "in" [] [Whitespace(" ")], + out_token: missing (optional), + }, + name: TsTypeParameterName { + ident_token: IDENT@98..99 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@99..100 ">" [] [], + }, + parameters: JsParameters { + l_paren_token: L_PAREN@100..101 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@101..103 ")" [] [Whitespace(" ")], + }, + return_type_annotation: missing (optional), + body: JsFunctionBody { + l_curly_token: L_CURLY@103..104 "{" [] [], + directives: JsDirectiveList [], + statements: JsStatementList [], + r_curly_token: R_CURLY@104..106 "}" [] [Whitespace(" ")], + }, + }, + }, + JsExport { + export_token: EXPORT_KW@106..115 "export" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + export_clause: JsFunctionDeclaration { + async_token: missing (optional), + function_token: FUNCTION_KW@115..124 "function" [] [Whitespace(" ")], + star_token: missing (optional), + id: JsIdentifierBinding { + name_token: IDENT@124..128 "foo2" [] [], + }, + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@128..129 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: missing (optional), + out_token: OUT_KW@129..133 "out" [] [Whitespace(" ")], + }, + name: TsTypeParameterName { + ident_token: IDENT@133..134 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@134..135 ">" [] [], + }, + parameters: JsParameters { + l_paren_token: L_PAREN@135..136 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@136..138 ")" [] [Whitespace(" ")], + }, + return_type_annotation: missing (optional), + body: JsFunctionBody { + l_curly_token: L_CURLY@138..139 "{" [] [], + directives: JsDirectiveList [], + statements: JsStatementList [], + r_curly_token: R_CURLY@139..141 "}" [] [Whitespace(" ")], + }, + }, + }, + JsVariableStatement { + declaration: JsVariableDeclaration { + kind: LET_KW@141..147 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + declarators: JsVariableDeclaratorList [ + JsVariableDeclarator { + id: JsIdentifierBinding { + name_token: IDENT@147..150 "foo" [] [], + }, + variable_annotation: TsTypeAnnotation { + colon_token: COLON@150..152 ":" [] [Whitespace(" ")], + ty: TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@152..155 "Foo" [] [], + }, + type_arguments: TsTypeArguments { + l_angle_token: L_ANGLE@155..156 "<" [] [], + ts_type_argument_list: TsTypeArgumentList [ + TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@156..159 "in" [] [Whitespace(" ")], + }, + type_arguments: missing (optional), + }, + missing separator, + TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@159..160 "T" [] [], + }, + type_arguments: missing (optional), + }, + ], + r_angle_token: R_ANGLE@160..161 ">" [] [], + }, + }, + }, + initializer: missing (optional), + }, + ], + }, + semicolon_token: missing (optional), + }, + JsVariableStatement { + declaration: JsVariableDeclaration { + kind: LET_KW@161..167 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + declarators: JsVariableDeclaratorList [ + JsVariableDeclarator { + id: JsIdentifierBinding { + name_token: IDENT@167..170 "foo" [] [], + }, + variable_annotation: TsTypeAnnotation { + colon_token: COLON@170..172 ":" [] [Whitespace(" ")], + ty: TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@172..175 "Foo" [] [], + }, + type_arguments: TsTypeArguments { + l_angle_token: L_ANGLE@175..176 "<" [] [], + ts_type_argument_list: TsTypeArgumentList [ + TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@176..180 "out" [] [Whitespace(" ")], + }, + type_arguments: missing (optional), + }, + missing separator, + TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@180..181 "T" [] [], + }, + type_arguments: missing (optional), + }, + ], + r_angle_token: R_ANGLE@181..182 ">" [] [], + }, + }, + }, + initializer: missing (optional), + }, + ], + }, + semicolon_token: missing (optional), + }, + TsDeclareStatement { + declare_token: DECLARE_KW@182..192 "declare" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + declaration: TsDeclareFunctionDeclaration { + async_token: missing (optional), + function_token: FUNCTION_KW@192..201 "function" [] [Whitespace(" ")], + id: JsIdentifierBinding { + name_token: IDENT@201..204 "foo" [] [], + }, + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@204..205 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: IN_KW@205..208 "in" [] [Whitespace(" ")], + out_token: missing (optional), + }, + name: TsTypeParameterName { + ident_token: IDENT@208..209 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@209..210 ">" [] [], + }, + parameters: JsParameters { + l_paren_token: L_PAREN@210..211 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@211..212 ")" [] [], + }, + return_type_annotation: missing (optional), + semicolon_token: missing (optional), + }, + }, + TsDeclareStatement { + declare_token: DECLARE_KW@212..222 "declare" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + declaration: TsDeclareFunctionDeclaration { + async_token: missing (optional), + function_token: FUNCTION_KW@222..231 "function" [] [Whitespace(" ")], + id: JsIdentifierBinding { + name_token: IDENT@231..234 "foo" [] [], + }, + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@234..235 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: missing (optional), + out_token: OUT_KW@235..239 "out" [] [Whitespace(" ")], + }, + name: TsTypeParameterName { + ident_token: IDENT@239..240 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@240..241 ">" [] [], + }, + parameters: JsParameters { + l_paren_token: L_PAREN@241..242 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@242..243 ")" [] [], + }, + return_type_annotation: missing (optional), + semicolon_token: missing (optional), + }, + }, + TsDeclareStatement { + declare_token: DECLARE_KW@243..253 "declare" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + declaration: JsVariableDeclarationClause { + declaration: JsVariableDeclaration { + kind: LET_KW@253..257 "let" [] [Whitespace(" ")], + declarators: JsVariableDeclaratorList [ + JsVariableDeclarator { + id: JsIdentifierBinding { + name_token: IDENT@257..260 "foo" [] [], + }, + variable_annotation: TsTypeAnnotation { + colon_token: COLON@260..262 ":" [] [Whitespace(" ")], + ty: TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@262..265 "Foo" [] [], + }, + type_arguments: TsTypeArguments { + l_angle_token: L_ANGLE@265..266 "<" [] [], + ts_type_argument_list: TsTypeArgumentList [ + TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@266..269 "in" [] [Whitespace(" ")], + }, + type_arguments: missing (optional), + }, + missing separator, + TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@269..270 "T" [] [], + }, + type_arguments: missing (optional), + }, + ], + r_angle_token: R_ANGLE@270..271 ">" [] [], + }, + }, + }, + initializer: missing (optional), + }, + ], + }, + semicolon_token: missing (optional), + }, + }, + TsDeclareStatement { + declare_token: DECLARE_KW@271..281 "declare" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + declaration: JsVariableDeclarationClause { + declaration: JsVariableDeclaration { + kind: LET_KW@281..285 "let" [] [Whitespace(" ")], + declarators: JsVariableDeclaratorList [ + JsVariableDeclarator { + id: JsIdentifierBinding { + name_token: IDENT@285..288 "foo" [] [], + }, + variable_annotation: TsTypeAnnotation { + colon_token: COLON@288..290 ":" [] [Whitespace(" ")], + ty: TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@290..293 "Foo" [] [], + }, + type_arguments: TsTypeArguments { + l_angle_token: L_ANGLE@293..294 "<" [] [], + ts_type_argument_list: TsTypeArgumentList [ + TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@294..298 "out" [] [Whitespace(" ")], + }, + type_arguments: missing (optional), + }, + missing separator, + TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@298..299 "T" [] [], + }, + type_arguments: missing (optional), + }, + ], + r_angle_token: R_ANGLE@299..300 ">" [] [], + }, + }, + }, + initializer: missing (optional), + }, + ], + }, + semicolon_token: missing (optional), + }, + }, + JsExpressionStatement { + expression: JsAssignmentExpression { + left: JsIdentifierAssignment { + name_token: IDENT@300..306 "Foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + }, + operator_token: EQ@306..308 "=" [] [Whitespace(" ")], + right: JsClassExpression { + class_token: CLASS_KW@308..314 "class" [] [Whitespace(" ")], + id: missing (optional), + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@314..315 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: IN_KW@315..318 "in" [] [Whitespace(" ")], + out_token: missing (optional), + }, + name: TsTypeParameterName { + ident_token: IDENT@318..319 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@319..321 ">" [] [Whitespace(" ")], + }, + extends_clause: missing (optional), + implements_clause: missing (optional), + l_curly_token: L_CURLY@321..322 "{" [] [], + members: JsClassMemberList [], + r_curly_token: R_CURLY@322..323 "}" [] [], + }, + }, + semicolon_token: missing (optional), + }, + JsExpressionStatement { + expression: JsAssignmentExpression { + left: JsIdentifierAssignment { + name_token: IDENT@323..329 "Foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + }, + operator_token: EQ@329..331 "=" [] [Whitespace(" ")], + right: JsClassExpression { + class_token: CLASS_KW@331..337 "class" [] [Whitespace(" ")], + id: missing (optional), + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@337..338 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: missing (optional), + out_token: OUT_KW@338..342 "out" [] [Whitespace(" ")], + }, + name: TsTypeParameterName { + ident_token: IDENT@342..343 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@343..345 ">" [] [Whitespace(" ")], + }, + extends_clause: missing (optional), + implements_clause: missing (optional), + l_curly_token: L_CURLY@345..346 "{" [] [], + members: JsClassMemberList [], + r_curly_token: R_CURLY@346..347 "}" [] [], + }, + }, + semicolon_token: missing (optional), + }, + JsExpressionStatement { + expression: JsAssignmentExpression { + left: JsIdentifierAssignment { + name_token: IDENT@347..353 "foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + }, + operator_token: EQ@353..355 "=" [] [Whitespace(" ")], + right: JsFunctionExpression { + async_token: missing (optional), + function_token: FUNCTION_KW@355..364 "function" [] [Whitespace(" ")], + star_token: missing (optional), + id: missing (optional), + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@364..365 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: IN_KW@365..368 "in" [] [Whitespace(" ")], + out_token: missing (optional), + }, + name: TsTypeParameterName { + ident_token: IDENT@368..369 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@369..370 ">" [] [], + }, + parameters: JsParameters { + l_paren_token: L_PAREN@370..371 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@371..373 ")" [] [Whitespace(" ")], + }, + return_type_annotation: missing (optional), + body: JsFunctionBody { + l_curly_token: L_CURLY@373..374 "{" [] [], + directives: JsDirectiveList [], + statements: JsStatementList [], + r_curly_token: R_CURLY@374..375 "}" [] [], + }, + }, + }, + semicolon_token: missing (optional), + }, + JsExpressionStatement { + expression: JsAssignmentExpression { + left: JsIdentifierAssignment { + name_token: IDENT@375..381 "foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + }, + operator_token: EQ@381..383 "=" [] [Whitespace(" ")], + right: JsFunctionExpression { + async_token: missing (optional), + function_token: FUNCTION_KW@383..392 "function" [] [Whitespace(" ")], + star_token: missing (optional), + id: missing (optional), + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@392..393 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: missing (optional), + out_token: OUT_KW@393..397 "out" [] [Whitespace(" ")], + }, + name: TsTypeParameterName { + ident_token: IDENT@397..398 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@398..399 ">" [] [], + }, + parameters: JsParameters { + l_paren_token: L_PAREN@399..400 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@400..402 ")" [] [Whitespace(" ")], + }, + return_type_annotation: missing (optional), + body: JsFunctionBody { + l_curly_token: L_CURLY@402..403 "{" [] [], + directives: JsDirectiveList [], + statements: JsStatementList [], + r_curly_token: R_CURLY@403..404 "}" [] [], + }, + }, + }, + semicolon_token: missing (optional), + }, + JsClassDeclaration { + abstract_token: missing (optional), + class_token: CLASS_KW@404..412 "class" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + id: JsIdentifierBinding { + name_token: IDENT@412..416 "Foo" [] [Whitespace(" ")], + }, + type_parameters: missing (optional), + extends_clause: missing (optional), + implements_clause: missing (optional), + l_curly_token: L_CURLY@416..418 "{" [] [Whitespace(" ")], + members: JsClassMemberList [ + JsMethodClassMember { + modifiers: JsMethodModifierList [], + async_token: missing (optional), + star_token: missing (optional), + name: JsLiteralMemberName { + value: IDENT@418..421 "foo" [] [], + }, + question_mark_token: missing (optional), + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@421..422 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: IN_KW@422..425 "in" [] [Whitespace(" ")], + out_token: missing (optional), + }, + name: TsTypeParameterName { + ident_token: IDENT@425..426 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@426..427 ">" [] [], + }, + parameters: JsParameters { + l_paren_token: L_PAREN@427..428 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@428..429 ")" [] [], + }, + return_type_annotation: TsReturnTypeAnnotation { + colon_token: COLON@429..431 ":" [] [Whitespace(" ")], + ty: TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@431..433 "T" [] [Whitespace(" ")], + }, + type_arguments: missing (optional), + }, + }, + body: JsFunctionBody { + l_curly_token: L_CURLY@433..434 "{" [] [], + directives: JsDirectiveList [], + statements: JsStatementList [], + r_curly_token: R_CURLY@434..436 "}" [] [Whitespace(" ")], + }, + }, + ], + r_curly_token: R_CURLY@436..437 "}" [] [], + }, + JsClassDeclaration { + abstract_token: missing (optional), + class_token: CLASS_KW@437..445 "class" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + id: JsIdentifierBinding { + name_token: IDENT@445..449 "Foo" [] [Whitespace(" ")], + }, + type_parameters: missing (optional), + extends_clause: missing (optional), + implements_clause: missing (optional), + l_curly_token: L_CURLY@449..451 "{" [] [Whitespace(" ")], + members: JsClassMemberList [ + JsMethodClassMember { + modifiers: JsMethodModifierList [], + async_token: missing (optional), + star_token: missing (optional), + name: JsLiteralMemberName { + value: IDENT@451..454 "foo" [] [], + }, + question_mark_token: missing (optional), + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@454..455 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: missing (optional), + out_token: OUT_KW@455..459 "out" [] [Whitespace(" ")], + }, + name: TsTypeParameterName { + ident_token: IDENT@459..460 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@460..461 ">" [] [], + }, + parameters: JsParameters { + l_paren_token: L_PAREN@461..462 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@462..463 ")" [] [], + }, + return_type_annotation: TsReturnTypeAnnotation { + colon_token: COLON@463..465 ":" [] [Whitespace(" ")], + ty: TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@465..467 "T" [] [Whitespace(" ")], + }, + type_arguments: missing (optional), + }, + }, + body: JsFunctionBody { + l_curly_token: L_CURLY@467..468 "{" [] [], + directives: JsDirectiveList [], + statements: JsStatementList [], + r_curly_token: R_CURLY@468..470 "}" [] [Whitespace(" ")], + }, + }, + ], + r_curly_token: R_CURLY@470..471 "}" [] [], + }, + JsExpressionStatement { + expression: JsAssignmentExpression { + left: JsIdentifierAssignment { + name_token: IDENT@471..477 "foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + }, + operator_token: EQ@477..479 "=" [] [Whitespace(" ")], + right: JsObjectExpression { + l_curly_token: L_CURLY@479..481 "{" [] [Whitespace(" ")], + members: JsObjectMemberList [ + JsMethodObjectMember { + async_token: missing (optional), + star_token: missing (optional), + name: JsLiteralMemberName { + value: IDENT@481..484 "foo" [] [], + }, + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@484..485 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: IN_KW@485..488 "in" [] [Whitespace(" ")], + out_token: missing (optional), + }, + name: TsTypeParameterName { + ident_token: IDENT@488..489 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@489..490 ">" [] [], + }, + parameters: JsParameters { + l_paren_token: L_PAREN@490..491 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@491..492 ")" [] [], + }, + return_type_annotation: TsReturnTypeAnnotation { + colon_token: COLON@492..494 ":" [] [Whitespace(" ")], + ty: TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@494..496 "T" [] [Whitespace(" ")], + }, + type_arguments: missing (optional), + }, + }, + body: JsFunctionBody { + l_curly_token: L_CURLY@496..497 "{" [] [], + directives: JsDirectiveList [], + statements: JsStatementList [], + r_curly_token: R_CURLY@497..499 "}" [] [Whitespace(" ")], + }, + }, + ], + r_curly_token: R_CURLY@499..500 "}" [] [], + }, + }, + semicolon_token: SEMICOLON@500..501 ";" [] [], + }, + JsExpressionStatement { + expression: JsAssignmentExpression { + left: JsIdentifierAssignment { + name_token: IDENT@501..507 "foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + }, + operator_token: EQ@507..509 "=" [] [Whitespace(" ")], + right: JsObjectExpression { + l_curly_token: L_CURLY@509..511 "{" [] [Whitespace(" ")], + members: JsObjectMemberList [ + JsMethodObjectMember { + async_token: missing (optional), + star_token: missing (optional), + name: JsLiteralMemberName { + value: IDENT@511..514 "foo" [] [], + }, + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@514..515 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: missing (optional), + out_token: OUT_KW@515..519 "out" [] [Whitespace(" ")], + }, + name: TsTypeParameterName { + ident_token: IDENT@519..520 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@520..521 ">" [] [], + }, + parameters: JsParameters { + l_paren_token: L_PAREN@521..522 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@522..523 ")" [] [], + }, + return_type_annotation: TsReturnTypeAnnotation { + colon_token: COLON@523..525 ":" [] [Whitespace(" ")], + ty: TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@525..527 "T" [] [Whitespace(" ")], + }, + type_arguments: missing (optional), + }, + }, + body: JsFunctionBody { + l_curly_token: L_CURLY@527..528 "{" [] [], + directives: JsDirectiveList [], + statements: JsStatementList [], + r_curly_token: R_CURLY@528..530 "}" [] [Whitespace(" ")], + }, + }, + ], + r_curly_token: R_CURLY@530..531 "}" [] [], + }, + }, + semicolon_token: SEMICOLON@531..532 ";" [] [], + }, + JsExpressionStatement { + expression: JsBinaryExpression { + left: TsTypeAssertionExpression { + l_angle_token: L_ANGLE@532..535 "<" [Newline("\n"), Whitespace("\t")] [], + ty: TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@535..538 "in" [] [Whitespace(" ")], + }, + type_arguments: missing (optional), + }, + r_angle_token: missing (required), + expression: JsIdentifierExpression { + name: JsReferenceIdentifier { + value_token: IDENT@538..539 "T" [] [], + }, + }, + }, + operator_token: R_ANGLE@539..540 ">" [] [], + right: JsParenthesizedExpression { + l_paren_token: L_PAREN@540..541 "(" [] [], + expression: missing (required), + r_paren_token: R_PAREN@541..543 ")" [] [Whitespace(" ")], + }, + }, + semicolon_token: missing (optional), + }, + JsUnknownStatement { + items: [ + FAT_ARROW@543..546 "=>" [] [Whitespace(" ")], + ], + }, + JsBlockStatement { + l_curly_token: L_CURLY@546..547 "{" [] [], + statements: JsStatementList [], + r_curly_token: R_CURLY@547..548 "}" [] [], + }, + JsEmptyStatement { + semicolon_token: SEMICOLON@548..549 ";" [] [], + }, + JsExpressionStatement { + expression: JsArrowFunctionExpression { + async_token: missing (optional), + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@549..552 "<" [Newline("\n"), Whitespace("\t")] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: missing (optional), + out_token: OUT_KW@552..556 "out" [] [Whitespace(" ")], + }, + name: TsTypeParameterName { + ident_token: IDENT@556..557 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@557..558 ">" [] [], + }, + parameters: JsParameters { + l_paren_token: L_PAREN@558..559 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@559..561 ")" [] [Whitespace(" ")], + }, + return_type_annotation: missing (optional), + fat_arrow_token: FAT_ARROW@561..564 "=>" [] [Whitespace(" ")], + body: JsFunctionBody { + l_curly_token: L_CURLY@564..565 "{" [] [], + directives: JsDirectiveList [], + statements: JsStatementList [], + r_curly_token: R_CURLY@565..566 "}" [] [], + }, + }, + semicolon_token: SEMICOLON@566..567 ";" [] [], + }, + JsExpressionStatement { + expression: JsSequenceExpression { + left: TsTypeAssertionExpression { + l_angle_token: L_ANGLE@567..570 "<" [Newline("\n"), Whitespace("\t")] [], + ty: TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@570..573 "in" [] [Whitespace(" ")], + }, + type_arguments: missing (optional), + }, + r_angle_token: missing (required), + expression: JsIdentifierExpression { + name: JsReferenceIdentifier { + value_token: IDENT@573..574 "T" [] [], + }, + }, + }, + comma_token: COMMA@574..576 "," [] [Whitespace(" ")], + right: JsIdentifierExpression { + name: JsReferenceIdentifier { + value_token: IDENT@576..580 "out" [] [Whitespace(" ")], + }, + }, + }, + semicolon_token: missing (optional), + }, + JsExpressionStatement { + expression: JsBinaryExpression { + left: JsIdentifierExpression { + name: JsReferenceIdentifier { + value_token: IDENT@580..581 "T" [] [], + }, + }, + operator_token: R_ANGLE@581..582 ">" [] [], + right: JsParenthesizedExpression { + l_paren_token: L_PAREN@582..583 "(" [] [], + expression: missing (required), + r_paren_token: R_PAREN@583..585 ")" [] [Whitespace(" ")], + }, + }, + semicolon_token: missing (optional), + }, + JsUnknownStatement { + items: [ + FAT_ARROW@585..588 "=>" [] [Whitespace(" ")], + ], + }, + JsBlockStatement { + l_curly_token: L_CURLY@588..589 "{" [] [], + statements: JsStatementList [], + r_curly_token: R_CURLY@589..590 "}" [] [], + }, + JsEmptyStatement { + semicolon_token: SEMICOLON@590..591 ";" [] [], + }, + JsVariableStatement { + declaration: JsVariableDeclaration { + kind: LET_KW@591..597 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + declarators: JsVariableDeclaratorList [ + JsVariableDeclarator { + id: JsIdentifierBinding { + name_token: IDENT@597..598 "x" [] [], + }, + variable_annotation: TsTypeAnnotation { + colon_token: COLON@598..600 ":" [] [Whitespace(" ")], + ty: TsFunctionType { + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@600..601 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: IN_KW@601..604 "in" [] [Whitespace(" ")], + out_token: missing (optional), + }, + name: TsTypeParameterName { + ident_token: IDENT@604..605 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@605..606 ">" [] [], + }, + parameters: JsParameters { + l_paren_token: L_PAREN@606..607 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@607..609 ")" [] [Whitespace(" ")], + }, + fat_arrow_token: FAT_ARROW@609..612 "=>" [] [Whitespace(" ")], + return_type: TsObjectType { + l_curly_token: L_CURLY@612..613 "{" [] [], + members: TsTypeMemberList [], + r_curly_token: R_CURLY@613..614 "}" [] [], + }, + }, + }, + initializer: missing (optional), + }, + ], + }, + semicolon_token: SEMICOLON@614..615 ";" [] [], + }, + JsVariableStatement { + declaration: JsVariableDeclaration { + kind: LET_KW@615..621 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + declarators: JsVariableDeclaratorList [ + JsVariableDeclarator { + id: JsIdentifierBinding { + name_token: IDENT@621..622 "x" [] [], + }, + variable_annotation: TsTypeAnnotation { + colon_token: COLON@622..624 ":" [] [Whitespace(" ")], + ty: TsFunctionType { + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@624..625 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: missing (optional), + out_token: OUT_KW@625..629 "out" [] [Whitespace(" ")], + }, + name: TsTypeParameterName { + ident_token: IDENT@629..630 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@630..631 ">" [] [], + }, + parameters: JsParameters { + l_paren_token: L_PAREN@631..632 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@632..634 ")" [] [Whitespace(" ")], + }, + fat_arrow_token: FAT_ARROW@634..637 "=>" [] [Whitespace(" ")], + return_type: TsObjectType { + l_curly_token: L_CURLY@637..638 "{" [] [], + members: TsTypeMemberList [], + r_curly_token: R_CURLY@638..639 "}" [] [], + }, + }, + }, + initializer: missing (optional), + }, + ], + }, + semicolon_token: SEMICOLON@639..640 ";" [] [], + }, + JsVariableStatement { + declaration: JsVariableDeclaration { + kind: LET_KW@640..646 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + declarators: JsVariableDeclaratorList [ + JsVariableDeclarator { + id: JsIdentifierBinding { + name_token: IDENT@646..647 "x" [] [], + }, + variable_annotation: TsTypeAnnotation { + colon_token: COLON@647..649 ":" [] [Whitespace(" ")], + ty: TsFunctionType { + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@649..650 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: IN_KW@650..653 "in" [] [Whitespace(" ")], + out_token: missing (optional), + }, + name: TsTypeParameterName { + ident_token: IDENT@653..654 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + COMMA@654..656 "," [] [Whitespace(" ")], + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: missing (optional), + out_token: OUT_KW@656..660 "out" [] [Whitespace(" ")], + }, + name: TsTypeParameterName { + ident_token: IDENT@660..661 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@661..662 ">" [] [], + }, + parameters: JsParameters { + l_paren_token: L_PAREN@662..663 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@663..665 ")" [] [Whitespace(" ")], + }, + fat_arrow_token: FAT_ARROW@665..668 "=>" [] [Whitespace(" ")], + return_type: TsObjectType { + l_curly_token: L_CURLY@668..669 "{" [] [], + members: TsTypeMemberList [], + r_curly_token: R_CURLY@669..670 "}" [] [], + }, + }, + }, + initializer: missing (optional), + }, + ], + }, + semicolon_token: SEMICOLON@670..671 ";" [] [], + }, + JsVariableStatement { + declaration: JsVariableDeclaration { + kind: LET_KW@671..677 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + declarators: JsVariableDeclaratorList [ + JsVariableDeclarator { + id: JsIdentifierBinding { + name_token: IDENT@677..678 "x" [] [], + }, + variable_annotation: TsTypeAnnotation { + colon_token: COLON@678..680 ":" [] [Whitespace(" ")], + ty: TsConstructorType { + abstract_token: missing (optional), + new_token: NEW_KW@680..684 "new" [] [Whitespace(" ")], + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@684..685 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: IN_KW@685..688 "in" [] [Whitespace(" ")], + out_token: missing (optional), + }, + name: TsTypeParameterName { + ident_token: IDENT@688..689 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@689..690 ">" [] [], + }, + parameters: JsParameters { + l_paren_token: L_PAREN@690..691 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@691..693 ")" [] [Whitespace(" ")], + }, + fat_arrow_token: FAT_ARROW@693..696 "=>" [] [Whitespace(" ")], + return_type: TsObjectType { + l_curly_token: L_CURLY@696..697 "{" [] [], + members: TsTypeMemberList [], + r_curly_token: R_CURLY@697..698 "}" [] [], + }, + }, + }, + initializer: missing (optional), + }, + ], + }, + semicolon_token: SEMICOLON@698..699 ";" [] [], + }, + JsVariableStatement { + declaration: JsVariableDeclaration { + kind: LET_KW@699..705 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + declarators: JsVariableDeclaratorList [ + JsVariableDeclarator { + id: JsIdentifierBinding { + name_token: IDENT@705..706 "x" [] [], + }, + variable_annotation: TsTypeAnnotation { + colon_token: COLON@706..708 ":" [] [Whitespace(" ")], + ty: TsConstructorType { + abstract_token: missing (optional), + new_token: NEW_KW@708..712 "new" [] [Whitespace(" ")], + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@712..713 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: missing (optional), + out_token: OUT_KW@713..717 "out" [] [Whitespace(" ")], + }, + name: TsTypeParameterName { + ident_token: IDENT@717..718 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@718..719 ">" [] [], + }, + parameters: JsParameters { + l_paren_token: L_PAREN@719..720 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@720..722 ")" [] [Whitespace(" ")], + }, + fat_arrow_token: FAT_ARROW@722..725 "=>" [] [Whitespace(" ")], + return_type: TsObjectType { + l_curly_token: L_CURLY@725..726 "{" [] [], + members: TsTypeMemberList [], + r_curly_token: R_CURLY@726..727 "}" [] [], + }, + }, + }, + initializer: missing (optional), + }, + ], + }, + semicolon_token: SEMICOLON@727..728 ";" [] [], + }, + JsVariableStatement { + declaration: JsVariableDeclaration { + kind: LET_KW@728..734 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + declarators: JsVariableDeclaratorList [ + JsVariableDeclarator { + id: JsIdentifierBinding { + name_token: IDENT@734..735 "x" [] [], + }, + variable_annotation: TsTypeAnnotation { + colon_token: COLON@735..737 ":" [] [Whitespace(" ")], + ty: TsConstructorType { + abstract_token: missing (optional), + new_token: NEW_KW@737..741 "new" [] [Whitespace(" ")], + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@741..742 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: IN_KW@742..745 "in" [] [Whitespace(" ")], + out_token: missing (optional), + }, + name: TsTypeParameterName { + ident_token: IDENT@745..746 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + COMMA@746..748 "," [] [Whitespace(" ")], + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: missing (optional), + out_token: OUT_KW@748..752 "out" [] [Whitespace(" ")], + }, + name: TsTypeParameterName { + ident_token: IDENT@752..753 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@753..754 ">" [] [], + }, + parameters: JsParameters { + l_paren_token: L_PAREN@754..755 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@755..757 ")" [] [Whitespace(" ")], + }, + fat_arrow_token: FAT_ARROW@757..760 "=>" [] [Whitespace(" ")], + return_type: TsObjectType { + l_curly_token: L_CURLY@760..761 "{" [] [], + members: TsTypeMemberList [], + r_curly_token: R_CURLY@761..762 "}" [] [], + }, + }, + }, + initializer: missing (optional), + }, + ], + }, + semicolon_token: SEMICOLON@762..763 ";" [] [], + }, + JsVariableStatement { + declaration: JsVariableDeclaration { + kind: LET_KW@763..769 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + declarators: JsVariableDeclaratorList [ + JsVariableDeclarator { + id: JsIdentifierBinding { + name_token: IDENT@769..770 "x" [] [], + }, + variable_annotation: TsTypeAnnotation { + colon_token: COLON@770..772 ":" [] [Whitespace(" ")], + ty: TsObjectType { + l_curly_token: L_CURLY@772..774 "{" [] [Whitespace(" ")], + members: TsTypeMemberList [ + TsMethodSignatureTypeMember { + name: JsLiteralMemberName { + value: IDENT@774..775 "y" [] [], + }, + optional_token: missing (optional), + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@775..776 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: IN_KW@776..779 "in" [] [Whitespace(" ")], + out_token: missing (optional), + }, + name: TsTypeParameterName { + ident_token: IDENT@779..780 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@780..781 ">" [] [], + }, + parameters: JsParameters { + l_paren_token: L_PAREN@781..782 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@782..783 ")" [] [], + }, + return_type_annotation: TsReturnTypeAnnotation { + colon_token: COLON@783..785 ":" [] [Whitespace(" ")], + ty: TsAnyType { + any_token: ANY_KW@785..789 "any" [] [Whitespace(" ")], + }, + }, + separator_token: missing (optional), + }, + ], + r_curly_token: R_CURLY@789..790 "}" [] [], + }, + }, + initializer: missing (optional), + }, + ], + }, + semicolon_token: SEMICOLON@790..791 ";" [] [], + }, + JsVariableStatement { + declaration: JsVariableDeclaration { + kind: LET_KW@791..797 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + declarators: JsVariableDeclaratorList [ + JsVariableDeclarator { + id: JsIdentifierBinding { + name_token: IDENT@797..798 "x" [] [], + }, + variable_annotation: TsTypeAnnotation { + colon_token: COLON@798..800 ":" [] [Whitespace(" ")], + ty: TsObjectType { + l_curly_token: L_CURLY@800..802 "{" [] [Whitespace(" ")], + members: TsTypeMemberList [ + TsMethodSignatureTypeMember { + name: JsLiteralMemberName { + value: IDENT@802..803 "y" [] [], + }, + optional_token: missing (optional), + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@803..804 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: missing (optional), + out_token: OUT_KW@804..808 "out" [] [Whitespace(" ")], + }, + name: TsTypeParameterName { + ident_token: IDENT@808..809 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@809..810 ">" [] [], + }, + parameters: JsParameters { + l_paren_token: L_PAREN@810..811 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@811..812 ")" [] [], + }, + return_type_annotation: TsReturnTypeAnnotation { + colon_token: COLON@812..814 ":" [] [Whitespace(" ")], + ty: TsAnyType { + any_token: ANY_KW@814..818 "any" [] [Whitespace(" ")], + }, + }, + separator_token: missing (optional), + }, + ], + r_curly_token: R_CURLY@818..819 "}" [] [], + }, + }, + initializer: missing (optional), + }, + ], + }, + semicolon_token: SEMICOLON@819..820 ";" [] [], + }, + JsVariableStatement { + declaration: JsVariableDeclaration { + kind: LET_KW@820..826 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + declarators: JsVariableDeclaratorList [ + JsVariableDeclarator { + id: JsIdentifierBinding { + name_token: IDENT@826..827 "x" [] [], + }, + variable_annotation: TsTypeAnnotation { + colon_token: COLON@827..829 ":" [] [Whitespace(" ")], + ty: TsObjectType { + l_curly_token: L_CURLY@829..831 "{" [] [Whitespace(" ")], + members: TsTypeMemberList [ + TsMethodSignatureTypeMember { + name: JsLiteralMemberName { + value: IDENT@831..832 "y" [] [], + }, + optional_token: missing (optional), + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@832..833 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: IN_KW@833..836 "in" [] [Whitespace(" ")], + out_token: missing (optional), + }, + name: TsTypeParameterName { + ident_token: IDENT@836..837 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + COMMA@837..839 "," [] [Whitespace(" ")], + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: missing (optional), + out_token: OUT_KW@839..843 "out" [] [Whitespace(" ")], + }, + name: TsTypeParameterName { + ident_token: IDENT@843..844 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@844..845 ">" [] [], + }, + parameters: JsParameters { + l_paren_token: L_PAREN@845..846 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@846..847 ")" [] [], + }, + return_type_annotation: TsReturnTypeAnnotation { + colon_token: COLON@847..849 ":" [] [Whitespace(" ")], + ty: TsAnyType { + any_token: ANY_KW@849..853 "any" [] [Whitespace(" ")], + }, + }, + separator_token: missing (optional), + }, + ], + r_curly_token: R_CURLY@853..854 "}" [] [], + }, + }, + initializer: missing (optional), + }, + ], + }, + semicolon_token: SEMICOLON@854..855 ";" [] [], + }, + ], + eof_token: EOF@855..856 "" [Newline("\n")] [], +} + +0: JS_MODULE@0..856 + 0: (empty) + 1: JS_DIRECTIVE_LIST@0..0 + 2: JS_MODULE_ITEM_LIST@0..855 + 0: JS_EXPORT@0..39 + 0: EXPORT_KW@0..8 "export" [Whitespace("\t")] [Whitespace(" ")] + 1: JS_EXPORT_DEFAULT_DECLARATION_CLAUSE@8..39 + 0: DEFAULT_KW@8..16 "default" [] [Whitespace(" ")] + 1: JS_FUNCTION_EXPORT_DEFAULT_DECLARATION@16..39 + 0: (empty) + 1: FUNCTION_KW@16..25 "function" [] [Whitespace(" ")] + 2: (empty) + 3: JS_IDENTIFIER_BINDING@25..28 + 0: IDENT@25..28 "foo" [] [] + 4: TS_TYPE_PARAMETERS@28..34 + 0: L_ANGLE@28..29 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@29..33 + 0: TS_TYPE_PARAMETER@29..33 + 0: TS_TYPE_PARAMETER_MODIFIER@29..32 + 0: IN_KW@29..32 "in" [] [Whitespace(" ")] + 1: (empty) + 1: TS_TYPE_PARAMETER_NAME@32..33 + 0: IDENT@32..33 "T" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@33..34 ">" [] [] + 5: JS_PARAMETERS@34..37 + 0: L_PAREN@34..35 "(" [] [] + 1: JS_PARAMETER_LIST@35..35 + 2: R_PAREN@35..37 ")" [] [Whitespace(" ")] + 6: (empty) + 7: JS_FUNCTION_BODY@37..39 + 0: L_CURLY@37..38 "{" [] [] + 1: JS_DIRECTIVE_LIST@38..38 + 2: JS_STATEMENT_LIST@38..38 + 3: R_CURLY@38..39 "}" [] [] + 2: (empty) + 1: JS_EXPORT@39..72 + 0: EXPORT_KW@39..48 "export" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: JS_FUNCTION_DECLARATION@48..72 + 0: (empty) + 1: FUNCTION_KW@48..57 "function" [] [Whitespace(" ")] + 2: (empty) + 3: JS_IDENTIFIER_BINDING@57..60 + 0: IDENT@57..60 "foo" [] [] + 4: TS_TYPE_PARAMETERS@60..67 + 0: L_ANGLE@60..61 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@61..66 + 0: TS_TYPE_PARAMETER@61..66 + 0: TS_TYPE_PARAMETER_MODIFIER@61..65 + 0: (empty) + 1: OUT_KW@61..65 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@65..66 + 0: IDENT@65..66 "T" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@66..67 ">" [] [] + 5: JS_PARAMETERS@67..70 + 0: L_PAREN@67..68 "(" [] [] + 1: JS_PARAMETER_LIST@68..68 + 2: R_PAREN@68..70 ")" [] [Whitespace(" ")] + 6: (empty) + 7: JS_FUNCTION_BODY@70..72 + 0: L_CURLY@70..71 "{" [] [] + 1: JS_DIRECTIVE_LIST@71..71 + 2: JS_STATEMENT_LIST@71..71 + 3: R_CURLY@71..72 "}" [] [] + 2: JS_EXPORT@72..106 + 0: EXPORT_KW@72..81 "export" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: JS_FUNCTION_DECLARATION@81..106 + 0: (empty) + 1: FUNCTION_KW@81..90 "function" [] [Whitespace(" ")] + 2: (empty) + 3: JS_IDENTIFIER_BINDING@90..94 + 0: IDENT@90..94 "foo1" [] [] + 4: TS_TYPE_PARAMETERS@94..100 + 0: L_ANGLE@94..95 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@95..99 + 0: TS_TYPE_PARAMETER@95..99 + 0: TS_TYPE_PARAMETER_MODIFIER@95..98 + 0: IN_KW@95..98 "in" [] [Whitespace(" ")] + 1: (empty) + 1: TS_TYPE_PARAMETER_NAME@98..99 + 0: IDENT@98..99 "T" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@99..100 ">" [] [] + 5: JS_PARAMETERS@100..103 + 0: L_PAREN@100..101 "(" [] [] + 1: JS_PARAMETER_LIST@101..101 + 2: R_PAREN@101..103 ")" [] [Whitespace(" ")] + 6: (empty) + 7: JS_FUNCTION_BODY@103..106 + 0: L_CURLY@103..104 "{" [] [] + 1: JS_DIRECTIVE_LIST@104..104 + 2: JS_STATEMENT_LIST@104..104 + 3: R_CURLY@104..106 "}" [] [Whitespace(" ")] + 3: JS_EXPORT@106..141 + 0: EXPORT_KW@106..115 "export" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: JS_FUNCTION_DECLARATION@115..141 + 0: (empty) + 1: FUNCTION_KW@115..124 "function" [] [Whitespace(" ")] + 2: (empty) + 3: JS_IDENTIFIER_BINDING@124..128 + 0: IDENT@124..128 "foo2" [] [] + 4: TS_TYPE_PARAMETERS@128..135 + 0: L_ANGLE@128..129 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@129..134 + 0: TS_TYPE_PARAMETER@129..134 + 0: TS_TYPE_PARAMETER_MODIFIER@129..133 + 0: (empty) + 1: OUT_KW@129..133 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@133..134 + 0: IDENT@133..134 "T" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@134..135 ">" [] [] + 5: JS_PARAMETERS@135..138 + 0: L_PAREN@135..136 "(" [] [] + 1: JS_PARAMETER_LIST@136..136 + 2: R_PAREN@136..138 ")" [] [Whitespace(" ")] + 6: (empty) + 7: JS_FUNCTION_BODY@138..141 + 0: L_CURLY@138..139 "{" [] [] + 1: JS_DIRECTIVE_LIST@139..139 + 2: JS_STATEMENT_LIST@139..139 + 3: R_CURLY@139..141 "}" [] [Whitespace(" ")] + 4: JS_VARIABLE_STATEMENT@141..161 + 0: JS_VARIABLE_DECLARATION@141..161 + 0: LET_KW@141..147 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATOR_LIST@147..161 + 0: JS_VARIABLE_DECLARATOR@147..161 + 0: JS_IDENTIFIER_BINDING@147..150 + 0: IDENT@147..150 "foo" [] [] + 1: TS_TYPE_ANNOTATION@150..161 + 0: COLON@150..152 ":" [] [Whitespace(" ")] + 1: TS_REFERENCE_TYPE@152..161 + 0: JS_REFERENCE_IDENTIFIER@152..155 + 0: IDENT@152..155 "Foo" [] [] + 1: TS_TYPE_ARGUMENTS@155..161 + 0: L_ANGLE@155..156 "<" [] [] + 1: TS_TYPE_ARGUMENT_LIST@156..160 + 0: TS_REFERENCE_TYPE@156..159 + 0: JS_REFERENCE_IDENTIFIER@156..159 + 0: IDENT@156..159 "in" [] [Whitespace(" ")] + 1: (empty) + 1: (empty) + 2: TS_REFERENCE_TYPE@159..160 + 0: JS_REFERENCE_IDENTIFIER@159..160 + 0: IDENT@159..160 "T" [] [] + 1: (empty) + 2: R_ANGLE@160..161 ">" [] [] + 2: (empty) + 1: (empty) + 5: JS_VARIABLE_STATEMENT@161..182 + 0: JS_VARIABLE_DECLARATION@161..182 + 0: LET_KW@161..167 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATOR_LIST@167..182 + 0: JS_VARIABLE_DECLARATOR@167..182 + 0: JS_IDENTIFIER_BINDING@167..170 + 0: IDENT@167..170 "foo" [] [] + 1: TS_TYPE_ANNOTATION@170..182 + 0: COLON@170..172 ":" [] [Whitespace(" ")] + 1: TS_REFERENCE_TYPE@172..182 + 0: JS_REFERENCE_IDENTIFIER@172..175 + 0: IDENT@172..175 "Foo" [] [] + 1: TS_TYPE_ARGUMENTS@175..182 + 0: L_ANGLE@175..176 "<" [] [] + 1: TS_TYPE_ARGUMENT_LIST@176..181 + 0: TS_REFERENCE_TYPE@176..180 + 0: JS_REFERENCE_IDENTIFIER@176..180 + 0: IDENT@176..180 "out" [] [Whitespace(" ")] + 1: (empty) + 1: (empty) + 2: TS_REFERENCE_TYPE@180..181 + 0: JS_REFERENCE_IDENTIFIER@180..181 + 0: IDENT@180..181 "T" [] [] + 1: (empty) + 2: R_ANGLE@181..182 ">" [] [] + 2: (empty) + 1: (empty) + 6: TS_DECLARE_STATEMENT@182..212 + 0: DECLARE_KW@182..192 "declare" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: TS_DECLARE_FUNCTION_DECLARATION@192..212 + 0: (empty) + 1: FUNCTION_KW@192..201 "function" [] [Whitespace(" ")] + 2: JS_IDENTIFIER_BINDING@201..204 + 0: IDENT@201..204 "foo" [] [] + 3: TS_TYPE_PARAMETERS@204..210 + 0: L_ANGLE@204..205 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@205..209 + 0: TS_TYPE_PARAMETER@205..209 + 0: TS_TYPE_PARAMETER_MODIFIER@205..208 + 0: IN_KW@205..208 "in" [] [Whitespace(" ")] + 1: (empty) + 1: TS_TYPE_PARAMETER_NAME@208..209 + 0: IDENT@208..209 "T" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@209..210 ">" [] [] + 4: JS_PARAMETERS@210..212 + 0: L_PAREN@210..211 "(" [] [] + 1: JS_PARAMETER_LIST@211..211 + 2: R_PAREN@211..212 ")" [] [] + 5: (empty) + 6: (empty) + 7: TS_DECLARE_STATEMENT@212..243 + 0: DECLARE_KW@212..222 "declare" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: TS_DECLARE_FUNCTION_DECLARATION@222..243 + 0: (empty) + 1: FUNCTION_KW@222..231 "function" [] [Whitespace(" ")] + 2: JS_IDENTIFIER_BINDING@231..234 + 0: IDENT@231..234 "foo" [] [] + 3: TS_TYPE_PARAMETERS@234..241 + 0: L_ANGLE@234..235 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@235..240 + 0: TS_TYPE_PARAMETER@235..240 + 0: TS_TYPE_PARAMETER_MODIFIER@235..239 + 0: (empty) + 1: OUT_KW@235..239 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@239..240 + 0: IDENT@239..240 "T" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@240..241 ">" [] [] + 4: JS_PARAMETERS@241..243 + 0: L_PAREN@241..242 "(" [] [] + 1: JS_PARAMETER_LIST@242..242 + 2: R_PAREN@242..243 ")" [] [] + 5: (empty) + 6: (empty) + 8: TS_DECLARE_STATEMENT@243..271 + 0: DECLARE_KW@243..253 "declare" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATION_CLAUSE@253..271 + 0: JS_VARIABLE_DECLARATION@253..271 + 0: LET_KW@253..257 "let" [] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATOR_LIST@257..271 + 0: JS_VARIABLE_DECLARATOR@257..271 + 0: JS_IDENTIFIER_BINDING@257..260 + 0: IDENT@257..260 "foo" [] [] + 1: TS_TYPE_ANNOTATION@260..271 + 0: COLON@260..262 ":" [] [Whitespace(" ")] + 1: TS_REFERENCE_TYPE@262..271 + 0: JS_REFERENCE_IDENTIFIER@262..265 + 0: IDENT@262..265 "Foo" [] [] + 1: TS_TYPE_ARGUMENTS@265..271 + 0: L_ANGLE@265..266 "<" [] [] + 1: TS_TYPE_ARGUMENT_LIST@266..270 + 0: TS_REFERENCE_TYPE@266..269 + 0: JS_REFERENCE_IDENTIFIER@266..269 + 0: IDENT@266..269 "in" [] [Whitespace(" ")] + 1: (empty) + 1: (empty) + 2: TS_REFERENCE_TYPE@269..270 + 0: JS_REFERENCE_IDENTIFIER@269..270 + 0: IDENT@269..270 "T" [] [] + 1: (empty) + 2: R_ANGLE@270..271 ">" [] [] + 2: (empty) + 1: (empty) + 9: TS_DECLARE_STATEMENT@271..300 + 0: DECLARE_KW@271..281 "declare" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATION_CLAUSE@281..300 + 0: JS_VARIABLE_DECLARATION@281..300 + 0: LET_KW@281..285 "let" [] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATOR_LIST@285..300 + 0: JS_VARIABLE_DECLARATOR@285..300 + 0: JS_IDENTIFIER_BINDING@285..288 + 0: IDENT@285..288 "foo" [] [] + 1: TS_TYPE_ANNOTATION@288..300 + 0: COLON@288..290 ":" [] [Whitespace(" ")] + 1: TS_REFERENCE_TYPE@290..300 + 0: JS_REFERENCE_IDENTIFIER@290..293 + 0: IDENT@290..293 "Foo" [] [] + 1: TS_TYPE_ARGUMENTS@293..300 + 0: L_ANGLE@293..294 "<" [] [] + 1: TS_TYPE_ARGUMENT_LIST@294..299 + 0: TS_REFERENCE_TYPE@294..298 + 0: JS_REFERENCE_IDENTIFIER@294..298 + 0: IDENT@294..298 "out" [] [Whitespace(" ")] + 1: (empty) + 1: (empty) + 2: TS_REFERENCE_TYPE@298..299 + 0: JS_REFERENCE_IDENTIFIER@298..299 + 0: IDENT@298..299 "T" [] [] + 1: (empty) + 2: R_ANGLE@299..300 ">" [] [] + 2: (empty) + 1: (empty) + 10: JS_EXPRESSION_STATEMENT@300..323 + 0: JS_ASSIGNMENT_EXPRESSION@300..323 + 0: JS_IDENTIFIER_ASSIGNMENT@300..306 + 0: IDENT@300..306 "Foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: EQ@306..308 "=" [] [Whitespace(" ")] + 2: JS_CLASS_EXPRESSION@308..323 + 0: CLASS_KW@308..314 "class" [] [Whitespace(" ")] + 1: (empty) + 2: TS_TYPE_PARAMETERS@314..321 + 0: L_ANGLE@314..315 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@315..319 + 0: TS_TYPE_PARAMETER@315..319 + 0: TS_TYPE_PARAMETER_MODIFIER@315..318 + 0: IN_KW@315..318 "in" [] [Whitespace(" ")] + 1: (empty) + 1: TS_TYPE_PARAMETER_NAME@318..319 + 0: IDENT@318..319 "T" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@319..321 ">" [] [Whitespace(" ")] + 3: (empty) + 4: (empty) + 5: L_CURLY@321..322 "{" [] [] + 6: JS_CLASS_MEMBER_LIST@322..322 + 7: R_CURLY@322..323 "}" [] [] + 1: (empty) + 11: JS_EXPRESSION_STATEMENT@323..347 + 0: JS_ASSIGNMENT_EXPRESSION@323..347 + 0: JS_IDENTIFIER_ASSIGNMENT@323..329 + 0: IDENT@323..329 "Foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: EQ@329..331 "=" [] [Whitespace(" ")] + 2: JS_CLASS_EXPRESSION@331..347 + 0: CLASS_KW@331..337 "class" [] [Whitespace(" ")] + 1: (empty) + 2: TS_TYPE_PARAMETERS@337..345 + 0: L_ANGLE@337..338 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@338..343 + 0: TS_TYPE_PARAMETER@338..343 + 0: TS_TYPE_PARAMETER_MODIFIER@338..342 + 0: (empty) + 1: OUT_KW@338..342 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@342..343 + 0: IDENT@342..343 "T" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@343..345 ">" [] [Whitespace(" ")] + 3: (empty) + 4: (empty) + 5: L_CURLY@345..346 "{" [] [] + 6: JS_CLASS_MEMBER_LIST@346..346 + 7: R_CURLY@346..347 "}" [] [] + 1: (empty) + 12: JS_EXPRESSION_STATEMENT@347..375 + 0: JS_ASSIGNMENT_EXPRESSION@347..375 + 0: JS_IDENTIFIER_ASSIGNMENT@347..353 + 0: IDENT@347..353 "foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: EQ@353..355 "=" [] [Whitespace(" ")] + 2: JS_FUNCTION_EXPRESSION@355..375 + 0: (empty) + 1: FUNCTION_KW@355..364 "function" [] [Whitespace(" ")] + 2: (empty) + 3: (empty) + 4: TS_TYPE_PARAMETERS@364..370 + 0: L_ANGLE@364..365 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@365..369 + 0: TS_TYPE_PARAMETER@365..369 + 0: TS_TYPE_PARAMETER_MODIFIER@365..368 + 0: IN_KW@365..368 "in" [] [Whitespace(" ")] + 1: (empty) + 1: TS_TYPE_PARAMETER_NAME@368..369 + 0: IDENT@368..369 "T" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@369..370 ">" [] [] + 5: JS_PARAMETERS@370..373 + 0: L_PAREN@370..371 "(" [] [] + 1: JS_PARAMETER_LIST@371..371 + 2: R_PAREN@371..373 ")" [] [Whitespace(" ")] + 6: (empty) + 7: JS_FUNCTION_BODY@373..375 + 0: L_CURLY@373..374 "{" [] [] + 1: JS_DIRECTIVE_LIST@374..374 + 2: JS_STATEMENT_LIST@374..374 + 3: R_CURLY@374..375 "}" [] [] + 1: (empty) + 13: JS_EXPRESSION_STATEMENT@375..404 + 0: JS_ASSIGNMENT_EXPRESSION@375..404 + 0: JS_IDENTIFIER_ASSIGNMENT@375..381 + 0: IDENT@375..381 "foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: EQ@381..383 "=" [] [Whitespace(" ")] + 2: JS_FUNCTION_EXPRESSION@383..404 + 0: (empty) + 1: FUNCTION_KW@383..392 "function" [] [Whitespace(" ")] + 2: (empty) + 3: (empty) + 4: TS_TYPE_PARAMETERS@392..399 + 0: L_ANGLE@392..393 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@393..398 + 0: TS_TYPE_PARAMETER@393..398 + 0: TS_TYPE_PARAMETER_MODIFIER@393..397 + 0: (empty) + 1: OUT_KW@393..397 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@397..398 + 0: IDENT@397..398 "T" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@398..399 ">" [] [] + 5: JS_PARAMETERS@399..402 + 0: L_PAREN@399..400 "(" [] [] + 1: JS_PARAMETER_LIST@400..400 + 2: R_PAREN@400..402 ")" [] [Whitespace(" ")] + 6: (empty) + 7: JS_FUNCTION_BODY@402..404 + 0: L_CURLY@402..403 "{" [] [] + 1: JS_DIRECTIVE_LIST@403..403 + 2: JS_STATEMENT_LIST@403..403 + 3: R_CURLY@403..404 "}" [] [] + 1: (empty) + 14: JS_CLASS_DECLARATION@404..437 + 0: (empty) + 1: CLASS_KW@404..412 "class" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 2: JS_IDENTIFIER_BINDING@412..416 + 0: IDENT@412..416 "Foo" [] [Whitespace(" ")] + 3: (empty) + 4: (empty) + 5: (empty) + 6: L_CURLY@416..418 "{" [] [Whitespace(" ")] + 7: JS_CLASS_MEMBER_LIST@418..436 + 0: JS_METHOD_CLASS_MEMBER@418..436 + 0: JS_METHOD_MODIFIER_LIST@418..418 + 1: (empty) + 2: (empty) + 3: JS_LITERAL_MEMBER_NAME@418..421 + 0: IDENT@418..421 "foo" [] [] + 4: (empty) + 5: TS_TYPE_PARAMETERS@421..427 + 0: L_ANGLE@421..422 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@422..426 + 0: TS_TYPE_PARAMETER@422..426 + 0: TS_TYPE_PARAMETER_MODIFIER@422..425 + 0: IN_KW@422..425 "in" [] [Whitespace(" ")] + 1: (empty) + 1: TS_TYPE_PARAMETER_NAME@425..426 + 0: IDENT@425..426 "T" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@426..427 ">" [] [] + 6: JS_PARAMETERS@427..429 + 0: L_PAREN@427..428 "(" [] [] + 1: JS_PARAMETER_LIST@428..428 + 2: R_PAREN@428..429 ")" [] [] + 7: TS_RETURN_TYPE_ANNOTATION@429..433 + 0: COLON@429..431 ":" [] [Whitespace(" ")] + 1: TS_REFERENCE_TYPE@431..433 + 0: JS_REFERENCE_IDENTIFIER@431..433 + 0: IDENT@431..433 "T" [] [Whitespace(" ")] + 1: (empty) + 8: JS_FUNCTION_BODY@433..436 + 0: L_CURLY@433..434 "{" [] [] + 1: JS_DIRECTIVE_LIST@434..434 + 2: JS_STATEMENT_LIST@434..434 + 3: R_CURLY@434..436 "}" [] [Whitespace(" ")] + 8: R_CURLY@436..437 "}" [] [] + 15: JS_CLASS_DECLARATION@437..471 + 0: (empty) + 1: CLASS_KW@437..445 "class" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 2: JS_IDENTIFIER_BINDING@445..449 + 0: IDENT@445..449 "Foo" [] [Whitespace(" ")] + 3: (empty) + 4: (empty) + 5: (empty) + 6: L_CURLY@449..451 "{" [] [Whitespace(" ")] + 7: JS_CLASS_MEMBER_LIST@451..470 + 0: JS_METHOD_CLASS_MEMBER@451..470 + 0: JS_METHOD_MODIFIER_LIST@451..451 + 1: (empty) + 2: (empty) + 3: JS_LITERAL_MEMBER_NAME@451..454 + 0: IDENT@451..454 "foo" [] [] + 4: (empty) + 5: TS_TYPE_PARAMETERS@454..461 + 0: L_ANGLE@454..455 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@455..460 + 0: TS_TYPE_PARAMETER@455..460 + 0: TS_TYPE_PARAMETER_MODIFIER@455..459 + 0: (empty) + 1: OUT_KW@455..459 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@459..460 + 0: IDENT@459..460 "T" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@460..461 ">" [] [] + 6: JS_PARAMETERS@461..463 + 0: L_PAREN@461..462 "(" [] [] + 1: JS_PARAMETER_LIST@462..462 + 2: R_PAREN@462..463 ")" [] [] + 7: TS_RETURN_TYPE_ANNOTATION@463..467 + 0: COLON@463..465 ":" [] [Whitespace(" ")] + 1: TS_REFERENCE_TYPE@465..467 + 0: JS_REFERENCE_IDENTIFIER@465..467 + 0: IDENT@465..467 "T" [] [Whitespace(" ")] + 1: (empty) + 8: JS_FUNCTION_BODY@467..470 + 0: L_CURLY@467..468 "{" [] [] + 1: JS_DIRECTIVE_LIST@468..468 + 2: JS_STATEMENT_LIST@468..468 + 3: R_CURLY@468..470 "}" [] [Whitespace(" ")] + 8: R_CURLY@470..471 "}" [] [] + 16: JS_EXPRESSION_STATEMENT@471..501 + 0: JS_ASSIGNMENT_EXPRESSION@471..500 + 0: JS_IDENTIFIER_ASSIGNMENT@471..477 + 0: IDENT@471..477 "foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: EQ@477..479 "=" [] [Whitespace(" ")] + 2: JS_OBJECT_EXPRESSION@479..500 + 0: L_CURLY@479..481 "{" [] [Whitespace(" ")] + 1: JS_OBJECT_MEMBER_LIST@481..499 + 0: JS_METHOD_OBJECT_MEMBER@481..499 + 0: (empty) + 1: (empty) + 2: JS_LITERAL_MEMBER_NAME@481..484 + 0: IDENT@481..484 "foo" [] [] + 3: TS_TYPE_PARAMETERS@484..490 + 0: L_ANGLE@484..485 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@485..489 + 0: TS_TYPE_PARAMETER@485..489 + 0: TS_TYPE_PARAMETER_MODIFIER@485..488 + 0: IN_KW@485..488 "in" [] [Whitespace(" ")] + 1: (empty) + 1: TS_TYPE_PARAMETER_NAME@488..489 + 0: IDENT@488..489 "T" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@489..490 ">" [] [] + 4: JS_PARAMETERS@490..492 + 0: L_PAREN@490..491 "(" [] [] + 1: JS_PARAMETER_LIST@491..491 + 2: R_PAREN@491..492 ")" [] [] + 5: TS_RETURN_TYPE_ANNOTATION@492..496 + 0: COLON@492..494 ":" [] [Whitespace(" ")] + 1: TS_REFERENCE_TYPE@494..496 + 0: JS_REFERENCE_IDENTIFIER@494..496 + 0: IDENT@494..496 "T" [] [Whitespace(" ")] + 1: (empty) + 6: JS_FUNCTION_BODY@496..499 + 0: L_CURLY@496..497 "{" [] [] + 1: JS_DIRECTIVE_LIST@497..497 + 2: JS_STATEMENT_LIST@497..497 + 3: R_CURLY@497..499 "}" [] [Whitespace(" ")] + 2: R_CURLY@499..500 "}" [] [] + 1: SEMICOLON@500..501 ";" [] [] + 17: JS_EXPRESSION_STATEMENT@501..532 + 0: JS_ASSIGNMENT_EXPRESSION@501..531 + 0: JS_IDENTIFIER_ASSIGNMENT@501..507 + 0: IDENT@501..507 "foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: EQ@507..509 "=" [] [Whitespace(" ")] + 2: JS_OBJECT_EXPRESSION@509..531 + 0: L_CURLY@509..511 "{" [] [Whitespace(" ")] + 1: JS_OBJECT_MEMBER_LIST@511..530 + 0: JS_METHOD_OBJECT_MEMBER@511..530 + 0: (empty) + 1: (empty) + 2: JS_LITERAL_MEMBER_NAME@511..514 + 0: IDENT@511..514 "foo" [] [] + 3: TS_TYPE_PARAMETERS@514..521 + 0: L_ANGLE@514..515 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@515..520 + 0: TS_TYPE_PARAMETER@515..520 + 0: TS_TYPE_PARAMETER_MODIFIER@515..519 + 0: (empty) + 1: OUT_KW@515..519 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@519..520 + 0: IDENT@519..520 "T" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@520..521 ">" [] [] + 4: JS_PARAMETERS@521..523 + 0: L_PAREN@521..522 "(" [] [] + 1: JS_PARAMETER_LIST@522..522 + 2: R_PAREN@522..523 ")" [] [] + 5: TS_RETURN_TYPE_ANNOTATION@523..527 + 0: COLON@523..525 ":" [] [Whitespace(" ")] + 1: TS_REFERENCE_TYPE@525..527 + 0: JS_REFERENCE_IDENTIFIER@525..527 + 0: IDENT@525..527 "T" [] [Whitespace(" ")] + 1: (empty) + 6: JS_FUNCTION_BODY@527..530 + 0: L_CURLY@527..528 "{" [] [] + 1: JS_DIRECTIVE_LIST@528..528 + 2: JS_STATEMENT_LIST@528..528 + 3: R_CURLY@528..530 "}" [] [Whitespace(" ")] + 2: R_CURLY@530..531 "}" [] [] + 1: SEMICOLON@531..532 ";" [] [] + 18: JS_EXPRESSION_STATEMENT@532..543 + 0: JS_BINARY_EXPRESSION@532..543 + 0: TS_TYPE_ASSERTION_EXPRESSION@532..539 + 0: L_ANGLE@532..535 "<" [Newline("\n"), Whitespace("\t")] [] + 1: TS_REFERENCE_TYPE@535..538 + 0: JS_REFERENCE_IDENTIFIER@535..538 + 0: IDENT@535..538 "in" [] [Whitespace(" ")] + 1: (empty) + 2: (empty) + 3: JS_IDENTIFIER_EXPRESSION@538..539 + 0: JS_REFERENCE_IDENTIFIER@538..539 + 0: IDENT@538..539 "T" [] [] + 1: R_ANGLE@539..540 ">" [] [] + 2: JS_PARENTHESIZED_EXPRESSION@540..543 + 0: L_PAREN@540..541 "(" [] [] + 1: (empty) + 2: R_PAREN@541..543 ")" [] [Whitespace(" ")] + 1: (empty) + 19: JS_UNKNOWN_STATEMENT@543..546 + 0: FAT_ARROW@543..546 "=>" [] [Whitespace(" ")] + 20: JS_BLOCK_STATEMENT@546..548 + 0: L_CURLY@546..547 "{" [] [] + 1: JS_STATEMENT_LIST@547..547 + 2: R_CURLY@547..548 "}" [] [] + 21: JS_EMPTY_STATEMENT@548..549 + 0: SEMICOLON@548..549 ";" [] [] + 22: JS_EXPRESSION_STATEMENT@549..567 + 0: JS_ARROW_FUNCTION_EXPRESSION@549..566 + 0: (empty) + 1: TS_TYPE_PARAMETERS@549..558 + 0: L_ANGLE@549..552 "<" [Newline("\n"), Whitespace("\t")] [] + 1: TS_TYPE_PARAMETER_LIST@552..557 + 0: TS_TYPE_PARAMETER@552..557 + 0: TS_TYPE_PARAMETER_MODIFIER@552..556 + 0: (empty) + 1: OUT_KW@552..556 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@556..557 + 0: IDENT@556..557 "T" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@557..558 ">" [] [] + 2: JS_PARAMETERS@558..561 + 0: L_PAREN@558..559 "(" [] [] + 1: JS_PARAMETER_LIST@559..559 + 2: R_PAREN@559..561 ")" [] [Whitespace(" ")] + 3: (empty) + 4: FAT_ARROW@561..564 "=>" [] [Whitespace(" ")] + 5: JS_FUNCTION_BODY@564..566 + 0: L_CURLY@564..565 "{" [] [] + 1: JS_DIRECTIVE_LIST@565..565 + 2: JS_STATEMENT_LIST@565..565 + 3: R_CURLY@565..566 "}" [] [] + 1: SEMICOLON@566..567 ";" [] [] + 23: JS_EXPRESSION_STATEMENT@567..580 + 0: JS_SEQUENCE_EXPRESSION@567..580 + 0: TS_TYPE_ASSERTION_EXPRESSION@567..574 + 0: L_ANGLE@567..570 "<" [Newline("\n"), Whitespace("\t")] [] + 1: TS_REFERENCE_TYPE@570..573 + 0: JS_REFERENCE_IDENTIFIER@570..573 + 0: IDENT@570..573 "in" [] [Whitespace(" ")] + 1: (empty) + 2: (empty) + 3: JS_IDENTIFIER_EXPRESSION@573..574 + 0: JS_REFERENCE_IDENTIFIER@573..574 + 0: IDENT@573..574 "T" [] [] + 1: COMMA@574..576 "," [] [Whitespace(" ")] + 2: JS_IDENTIFIER_EXPRESSION@576..580 + 0: JS_REFERENCE_IDENTIFIER@576..580 + 0: IDENT@576..580 "out" [] [Whitespace(" ")] + 1: (empty) + 24: JS_EXPRESSION_STATEMENT@580..585 + 0: JS_BINARY_EXPRESSION@580..585 + 0: JS_IDENTIFIER_EXPRESSION@580..581 + 0: JS_REFERENCE_IDENTIFIER@580..581 + 0: IDENT@580..581 "T" [] [] + 1: R_ANGLE@581..582 ">" [] [] + 2: JS_PARENTHESIZED_EXPRESSION@582..585 + 0: L_PAREN@582..583 "(" [] [] + 1: (empty) + 2: R_PAREN@583..585 ")" [] [Whitespace(" ")] + 1: (empty) + 25: JS_UNKNOWN_STATEMENT@585..588 + 0: FAT_ARROW@585..588 "=>" [] [Whitespace(" ")] + 26: JS_BLOCK_STATEMENT@588..590 + 0: L_CURLY@588..589 "{" [] [] + 1: JS_STATEMENT_LIST@589..589 + 2: R_CURLY@589..590 "}" [] [] + 27: JS_EMPTY_STATEMENT@590..591 + 0: SEMICOLON@590..591 ";" [] [] + 28: JS_VARIABLE_STATEMENT@591..615 + 0: JS_VARIABLE_DECLARATION@591..614 + 0: LET_KW@591..597 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATOR_LIST@597..614 + 0: JS_VARIABLE_DECLARATOR@597..614 + 0: JS_IDENTIFIER_BINDING@597..598 + 0: IDENT@597..598 "x" [] [] + 1: TS_TYPE_ANNOTATION@598..614 + 0: COLON@598..600 ":" [] [Whitespace(" ")] + 1: TS_FUNCTION_TYPE@600..614 + 0: TS_TYPE_PARAMETERS@600..606 + 0: L_ANGLE@600..601 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@601..605 + 0: TS_TYPE_PARAMETER@601..605 + 0: TS_TYPE_PARAMETER_MODIFIER@601..604 + 0: IN_KW@601..604 "in" [] [Whitespace(" ")] + 1: (empty) + 1: TS_TYPE_PARAMETER_NAME@604..605 + 0: IDENT@604..605 "T" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@605..606 ">" [] [] + 1: JS_PARAMETERS@606..609 + 0: L_PAREN@606..607 "(" [] [] + 1: JS_PARAMETER_LIST@607..607 + 2: R_PAREN@607..609 ")" [] [Whitespace(" ")] + 2: FAT_ARROW@609..612 "=>" [] [Whitespace(" ")] + 3: TS_OBJECT_TYPE@612..614 + 0: L_CURLY@612..613 "{" [] [] + 1: TS_TYPE_MEMBER_LIST@613..613 + 2: R_CURLY@613..614 "}" [] [] + 2: (empty) + 1: SEMICOLON@614..615 ";" [] [] + 29: JS_VARIABLE_STATEMENT@615..640 + 0: JS_VARIABLE_DECLARATION@615..639 + 0: LET_KW@615..621 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATOR_LIST@621..639 + 0: JS_VARIABLE_DECLARATOR@621..639 + 0: JS_IDENTIFIER_BINDING@621..622 + 0: IDENT@621..622 "x" [] [] + 1: TS_TYPE_ANNOTATION@622..639 + 0: COLON@622..624 ":" [] [Whitespace(" ")] + 1: TS_FUNCTION_TYPE@624..639 + 0: TS_TYPE_PARAMETERS@624..631 + 0: L_ANGLE@624..625 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@625..630 + 0: TS_TYPE_PARAMETER@625..630 + 0: TS_TYPE_PARAMETER_MODIFIER@625..629 + 0: (empty) + 1: OUT_KW@625..629 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@629..630 + 0: IDENT@629..630 "T" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@630..631 ">" [] [] + 1: JS_PARAMETERS@631..634 + 0: L_PAREN@631..632 "(" [] [] + 1: JS_PARAMETER_LIST@632..632 + 2: R_PAREN@632..634 ")" [] [Whitespace(" ")] + 2: FAT_ARROW@634..637 "=>" [] [Whitespace(" ")] + 3: TS_OBJECT_TYPE@637..639 + 0: L_CURLY@637..638 "{" [] [] + 1: TS_TYPE_MEMBER_LIST@638..638 + 2: R_CURLY@638..639 "}" [] [] + 2: (empty) + 1: SEMICOLON@639..640 ";" [] [] + 30: JS_VARIABLE_STATEMENT@640..671 + 0: JS_VARIABLE_DECLARATION@640..670 + 0: LET_KW@640..646 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATOR_LIST@646..670 + 0: JS_VARIABLE_DECLARATOR@646..670 + 0: JS_IDENTIFIER_BINDING@646..647 + 0: IDENT@646..647 "x" [] [] + 1: TS_TYPE_ANNOTATION@647..670 + 0: COLON@647..649 ":" [] [Whitespace(" ")] + 1: TS_FUNCTION_TYPE@649..670 + 0: TS_TYPE_PARAMETERS@649..662 + 0: L_ANGLE@649..650 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@650..661 + 0: TS_TYPE_PARAMETER@650..654 + 0: TS_TYPE_PARAMETER_MODIFIER@650..653 + 0: IN_KW@650..653 "in" [] [Whitespace(" ")] + 1: (empty) + 1: TS_TYPE_PARAMETER_NAME@653..654 + 0: IDENT@653..654 "T" [] [] + 2: (empty) + 3: (empty) + 1: COMMA@654..656 "," [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER@656..661 + 0: TS_TYPE_PARAMETER_MODIFIER@656..660 + 0: (empty) + 1: OUT_KW@656..660 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@660..661 + 0: IDENT@660..661 "T" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@661..662 ">" [] [] + 1: JS_PARAMETERS@662..665 + 0: L_PAREN@662..663 "(" [] [] + 1: JS_PARAMETER_LIST@663..663 + 2: R_PAREN@663..665 ")" [] [Whitespace(" ")] + 2: FAT_ARROW@665..668 "=>" [] [Whitespace(" ")] + 3: TS_OBJECT_TYPE@668..670 + 0: L_CURLY@668..669 "{" [] [] + 1: TS_TYPE_MEMBER_LIST@669..669 + 2: R_CURLY@669..670 "}" [] [] + 2: (empty) + 1: SEMICOLON@670..671 ";" [] [] + 31: JS_VARIABLE_STATEMENT@671..699 + 0: JS_VARIABLE_DECLARATION@671..698 + 0: LET_KW@671..677 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATOR_LIST@677..698 + 0: JS_VARIABLE_DECLARATOR@677..698 + 0: JS_IDENTIFIER_BINDING@677..678 + 0: IDENT@677..678 "x" [] [] + 1: TS_TYPE_ANNOTATION@678..698 + 0: COLON@678..680 ":" [] [Whitespace(" ")] + 1: TS_CONSTRUCTOR_TYPE@680..698 + 0: (empty) + 1: NEW_KW@680..684 "new" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETERS@684..690 + 0: L_ANGLE@684..685 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@685..689 + 0: TS_TYPE_PARAMETER@685..689 + 0: TS_TYPE_PARAMETER_MODIFIER@685..688 + 0: IN_KW@685..688 "in" [] [Whitespace(" ")] + 1: (empty) + 1: TS_TYPE_PARAMETER_NAME@688..689 + 0: IDENT@688..689 "T" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@689..690 ">" [] [] + 3: JS_PARAMETERS@690..693 + 0: L_PAREN@690..691 "(" [] [] + 1: JS_PARAMETER_LIST@691..691 + 2: R_PAREN@691..693 ")" [] [Whitespace(" ")] + 4: FAT_ARROW@693..696 "=>" [] [Whitespace(" ")] + 5: TS_OBJECT_TYPE@696..698 + 0: L_CURLY@696..697 "{" [] [] + 1: TS_TYPE_MEMBER_LIST@697..697 + 2: R_CURLY@697..698 "}" [] [] + 2: (empty) + 1: SEMICOLON@698..699 ";" [] [] + 32: JS_VARIABLE_STATEMENT@699..728 + 0: JS_VARIABLE_DECLARATION@699..727 + 0: LET_KW@699..705 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATOR_LIST@705..727 + 0: JS_VARIABLE_DECLARATOR@705..727 + 0: JS_IDENTIFIER_BINDING@705..706 + 0: IDENT@705..706 "x" [] [] + 1: TS_TYPE_ANNOTATION@706..727 + 0: COLON@706..708 ":" [] [Whitespace(" ")] + 1: TS_CONSTRUCTOR_TYPE@708..727 + 0: (empty) + 1: NEW_KW@708..712 "new" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETERS@712..719 + 0: L_ANGLE@712..713 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@713..718 + 0: TS_TYPE_PARAMETER@713..718 + 0: TS_TYPE_PARAMETER_MODIFIER@713..717 + 0: (empty) + 1: OUT_KW@713..717 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@717..718 + 0: IDENT@717..718 "T" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@718..719 ">" [] [] + 3: JS_PARAMETERS@719..722 + 0: L_PAREN@719..720 "(" [] [] + 1: JS_PARAMETER_LIST@720..720 + 2: R_PAREN@720..722 ")" [] [Whitespace(" ")] + 4: FAT_ARROW@722..725 "=>" [] [Whitespace(" ")] + 5: TS_OBJECT_TYPE@725..727 + 0: L_CURLY@725..726 "{" [] [] + 1: TS_TYPE_MEMBER_LIST@726..726 + 2: R_CURLY@726..727 "}" [] [] + 2: (empty) + 1: SEMICOLON@727..728 ";" [] [] + 33: JS_VARIABLE_STATEMENT@728..763 + 0: JS_VARIABLE_DECLARATION@728..762 + 0: LET_KW@728..734 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATOR_LIST@734..762 + 0: JS_VARIABLE_DECLARATOR@734..762 + 0: JS_IDENTIFIER_BINDING@734..735 + 0: IDENT@734..735 "x" [] [] + 1: TS_TYPE_ANNOTATION@735..762 + 0: COLON@735..737 ":" [] [Whitespace(" ")] + 1: TS_CONSTRUCTOR_TYPE@737..762 + 0: (empty) + 1: NEW_KW@737..741 "new" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETERS@741..754 + 0: L_ANGLE@741..742 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@742..753 + 0: TS_TYPE_PARAMETER@742..746 + 0: TS_TYPE_PARAMETER_MODIFIER@742..745 + 0: IN_KW@742..745 "in" [] [Whitespace(" ")] + 1: (empty) + 1: TS_TYPE_PARAMETER_NAME@745..746 + 0: IDENT@745..746 "T" [] [] + 2: (empty) + 3: (empty) + 1: COMMA@746..748 "," [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER@748..753 + 0: TS_TYPE_PARAMETER_MODIFIER@748..752 + 0: (empty) + 1: OUT_KW@748..752 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@752..753 + 0: IDENT@752..753 "T" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@753..754 ">" [] [] + 3: JS_PARAMETERS@754..757 + 0: L_PAREN@754..755 "(" [] [] + 1: JS_PARAMETER_LIST@755..755 + 2: R_PAREN@755..757 ")" [] [Whitespace(" ")] + 4: FAT_ARROW@757..760 "=>" [] [Whitespace(" ")] + 5: TS_OBJECT_TYPE@760..762 + 0: L_CURLY@760..761 "{" [] [] + 1: TS_TYPE_MEMBER_LIST@761..761 + 2: R_CURLY@761..762 "}" [] [] + 2: (empty) + 1: SEMICOLON@762..763 ";" [] [] + 34: JS_VARIABLE_STATEMENT@763..791 + 0: JS_VARIABLE_DECLARATION@763..790 + 0: LET_KW@763..769 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATOR_LIST@769..790 + 0: JS_VARIABLE_DECLARATOR@769..790 + 0: JS_IDENTIFIER_BINDING@769..770 + 0: IDENT@769..770 "x" [] [] + 1: TS_TYPE_ANNOTATION@770..790 + 0: COLON@770..772 ":" [] [Whitespace(" ")] + 1: TS_OBJECT_TYPE@772..790 + 0: L_CURLY@772..774 "{" [] [Whitespace(" ")] + 1: TS_TYPE_MEMBER_LIST@774..789 + 0: TS_METHOD_SIGNATURE_TYPE_MEMBER@774..789 + 0: JS_LITERAL_MEMBER_NAME@774..775 + 0: IDENT@774..775 "y" [] [] + 1: (empty) + 2: TS_TYPE_PARAMETERS@775..781 + 0: L_ANGLE@775..776 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@776..780 + 0: TS_TYPE_PARAMETER@776..780 + 0: TS_TYPE_PARAMETER_MODIFIER@776..779 + 0: IN_KW@776..779 "in" [] [Whitespace(" ")] + 1: (empty) + 1: TS_TYPE_PARAMETER_NAME@779..780 + 0: IDENT@779..780 "T" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@780..781 ">" [] [] + 3: JS_PARAMETERS@781..783 + 0: L_PAREN@781..782 "(" [] [] + 1: JS_PARAMETER_LIST@782..782 + 2: R_PAREN@782..783 ")" [] [] + 4: TS_RETURN_TYPE_ANNOTATION@783..789 + 0: COLON@783..785 ":" [] [Whitespace(" ")] + 1: TS_ANY_TYPE@785..789 + 0: ANY_KW@785..789 "any" [] [Whitespace(" ")] + 5: (empty) + 2: R_CURLY@789..790 "}" [] [] + 2: (empty) + 1: SEMICOLON@790..791 ";" [] [] + 35: JS_VARIABLE_STATEMENT@791..820 + 0: JS_VARIABLE_DECLARATION@791..819 + 0: LET_KW@791..797 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATOR_LIST@797..819 + 0: JS_VARIABLE_DECLARATOR@797..819 + 0: JS_IDENTIFIER_BINDING@797..798 + 0: IDENT@797..798 "x" [] [] + 1: TS_TYPE_ANNOTATION@798..819 + 0: COLON@798..800 ":" [] [Whitespace(" ")] + 1: TS_OBJECT_TYPE@800..819 + 0: L_CURLY@800..802 "{" [] [Whitespace(" ")] + 1: TS_TYPE_MEMBER_LIST@802..818 + 0: TS_METHOD_SIGNATURE_TYPE_MEMBER@802..818 + 0: JS_LITERAL_MEMBER_NAME@802..803 + 0: IDENT@802..803 "y" [] [] + 1: (empty) + 2: TS_TYPE_PARAMETERS@803..810 + 0: L_ANGLE@803..804 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@804..809 + 0: TS_TYPE_PARAMETER@804..809 + 0: TS_TYPE_PARAMETER_MODIFIER@804..808 + 0: (empty) + 1: OUT_KW@804..808 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@808..809 + 0: IDENT@808..809 "T" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@809..810 ">" [] [] + 3: JS_PARAMETERS@810..812 + 0: L_PAREN@810..811 "(" [] [] + 1: JS_PARAMETER_LIST@811..811 + 2: R_PAREN@811..812 ")" [] [] + 4: TS_RETURN_TYPE_ANNOTATION@812..818 + 0: COLON@812..814 ":" [] [Whitespace(" ")] + 1: TS_ANY_TYPE@814..818 + 0: ANY_KW@814..818 "any" [] [Whitespace(" ")] + 5: (empty) + 2: R_CURLY@818..819 "}" [] [] + 2: (empty) + 1: SEMICOLON@819..820 ";" [] [] + 36: JS_VARIABLE_STATEMENT@820..855 + 0: JS_VARIABLE_DECLARATION@820..854 + 0: LET_KW@820..826 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATOR_LIST@826..854 + 0: JS_VARIABLE_DECLARATOR@826..854 + 0: JS_IDENTIFIER_BINDING@826..827 + 0: IDENT@826..827 "x" [] [] + 1: TS_TYPE_ANNOTATION@827..854 + 0: COLON@827..829 ":" [] [Whitespace(" ")] + 1: TS_OBJECT_TYPE@829..854 + 0: L_CURLY@829..831 "{" [] [Whitespace(" ")] + 1: TS_TYPE_MEMBER_LIST@831..853 + 0: TS_METHOD_SIGNATURE_TYPE_MEMBER@831..853 + 0: JS_LITERAL_MEMBER_NAME@831..832 + 0: IDENT@831..832 "y" [] [] + 1: (empty) + 2: TS_TYPE_PARAMETERS@832..845 + 0: L_ANGLE@832..833 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@833..844 + 0: TS_TYPE_PARAMETER@833..837 + 0: TS_TYPE_PARAMETER_MODIFIER@833..836 + 0: IN_KW@833..836 "in" [] [Whitespace(" ")] + 1: (empty) + 1: TS_TYPE_PARAMETER_NAME@836..837 + 0: IDENT@836..837 "T" [] [] + 2: (empty) + 3: (empty) + 1: COMMA@837..839 "," [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER@839..844 + 0: TS_TYPE_PARAMETER_MODIFIER@839..843 + 0: (empty) + 1: OUT_KW@839..843 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@843..844 + 0: IDENT@843..844 "T" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@844..845 ">" [] [] + 3: JS_PARAMETERS@845..847 + 0: L_PAREN@845..846 "(" [] [] + 1: JS_PARAMETER_LIST@846..846 + 2: R_PAREN@846..847 ")" [] [] + 4: TS_RETURN_TYPE_ANNOTATION@847..853 + 0: COLON@847..849 ":" [] [Whitespace(" ")] + 1: TS_ANY_TYPE@849..853 + 0: ANY_KW@849..853 "any" [] [Whitespace(" ")] + 5: (empty) + 2: R_CURLY@853..854 "}" [] [] + 2: (empty) + 1: SEMICOLON@854..855 ";" [] [] + 3: EOF@855..856 "" [Newline("\n")] [] +-- +error[SyntaxError]: TypeParameterModifier `in` is not valid here + ┌─ type_parameter_modifier1.ts:1:30 + │ +1 │ export default function foo() {} + │ ^^ + +-- +error[SyntaxError]: TypeParameterModifier `out` is not valid here + ┌─ type_parameter_modifier1.ts:2:22 + │ +2 │ export function foo() {} + │ ^^^ + +-- +error[SyntaxError]: TypeParameterModifier `in` is not valid here + ┌─ type_parameter_modifier1.ts:3:23 + │ +3 │ export function foo1() {} + │ ^^ + +-- +error[SyntaxError]: TypeParameterModifier `out` is not valid here + ┌─ type_parameter_modifier1.ts:4:23 + │ +4 │ export function foo2() {} + │ ^^^ + +-- +error[SyntaxError]: expected `,` but instead found `T` + ┌─ type_parameter_modifier1.ts:5:18 + │ +5 │ let foo: Foo + │ ^ unexpected + +-- +error[SyntaxError]: expected `,` but instead found `T` + ┌─ type_parameter_modifier1.ts:6:19 + │ +6 │ let foo: Foo + │ ^ unexpected + +-- +error[SyntaxError]: TypeParameterModifier `in` is not valid here + ┌─ type_parameter_modifier1.ts:7:23 + │ +7 │ declare function foo() + │ ^^ + +-- +error[SyntaxError]: TypeParameterModifier `out` is not valid here + ┌─ type_parameter_modifier1.ts:8:23 + │ +8 │ declare function foo() + │ ^^^ + +-- +error[SyntaxError]: expected `,` but instead found `T` + ┌─ type_parameter_modifier1.ts:9:26 + │ +9 │ declare let foo: Foo + │ ^ unexpected + +-- +error[SyntaxError]: expected `,` but instead found `T` + ┌─ type_parameter_modifier1.ts:10:27 + │ +10 │ declare let foo: Foo + │ ^ unexpected + +-- +error[SyntaxError]: TypeParameterModifier `in` is not valid here + ┌─ type_parameter_modifier1.ts:13:18 + │ +13 │ foo = function () {} + │ ^^ + +-- +error[SyntaxError]: TypeParameterModifier `out` is not valid here + ┌─ type_parameter_modifier1.ts:14:18 + │ +14 │ foo = function () {} + │ ^^^ + +-- +error[SyntaxError]: TypeParameterModifier `in` is not valid here + ┌─ type_parameter_modifier1.ts:15:18 + │ +15 │ class Foo { foo(): T {} } + │ ^^ + +-- +error[SyntaxError]: TypeParameterModifier `out` is not valid here + ┌─ type_parameter_modifier1.ts:16:18 + │ +16 │ class Foo { foo(): T {} } + │ ^^^ + +-- +error[SyntaxError]: TypeParameterModifier `in` is not valid here + ┌─ type_parameter_modifier1.ts:17:14 + │ +17 │ foo = { foo(): T {} }; + │ ^^ + +-- +error[SyntaxError]: TypeParameterModifier `out` is not valid here + ┌─ type_parameter_modifier1.ts:18:14 + │ +18 │ foo = { foo(): T {} }; + │ ^^^ + +-- +error[SyntaxError]: expected `>` but instead found `T` + ┌─ type_parameter_modifier1.ts:19:6 + │ +19 │ () => {}; + │ ^ unexpected + +-- +error[SyntaxError]: Parenthesized expression didnt contain anything + ┌─ type_parameter_modifier1.ts:19:9 + │ +19 │ () => {}; + │ ^ Expected an expression here + +-- +error[SyntaxError]: Expected a semicolon or an implicit semicolon after a statement, but found none + ┌─ type_parameter_modifier1.ts:19:11 + │ +19 │ () => {}; + │ ---------^^ + │ │ │ + │ │ An explicit or implicit semicolon is expected here... + │ ...Which is required to end this statement + +-- +error[SyntaxError]: TypeParameterModifier `out` is not valid here + ┌─ type_parameter_modifier1.ts:20:3 + │ +20 │ () => {}; + │ ^^^ + +-- +error[SyntaxError]: expected `>` but instead found `T` + ┌─ type_parameter_modifier1.ts:21:6 + │ +21 │ () => {}; + │ ^ unexpected + +-- +error[SyntaxError]: Expected a semicolon or an implicit semicolon after a statement, but found none + ┌─ type_parameter_modifier1.ts:21:13 + │ +21 │ () => {}; + │ -----------^ + │ │ │ + │ │ An explicit or implicit semicolon is expected here... + │ ...Which is required to end this statement + +-- +error[SyntaxError]: Parenthesized expression didnt contain anything + ┌─ type_parameter_modifier1.ts:21:16 + │ +21 │ () => {}; + │ ^ Expected an expression here + +-- +error[SyntaxError]: Expected a semicolon or an implicit semicolon after a statement, but found none + ┌─ type_parameter_modifier1.ts:21:18 + │ +21 │ () => {}; + │ -----^^ + │ │ │ + │ │ An explicit or implicit semicolon is expected here... + │ ...Which is required to end this statement + +-- +error[SyntaxError]: TypeParameterModifier `in` is not valid here + ┌─ type_parameter_modifier1.ts:22:10 + │ +22 │ let x: () => {}; + │ ^^ + +-- +error[SyntaxError]: TypeParameterModifier `out` is not valid here + ┌─ type_parameter_modifier1.ts:23:10 + │ +23 │ let x: () => {}; + │ ^^^ + +-- +error[SyntaxError]: TypeParameterModifier `in` is not valid here + ┌─ type_parameter_modifier1.ts:24:10 + │ +24 │ let x: () => {}; + │ ^^ + +-- +error[SyntaxError]: TypeParameterModifier `out` is not valid here + ┌─ type_parameter_modifier1.ts:24:16 + │ +24 │ let x: () => {}; + │ ^^^ + +-- +error[SyntaxError]: TypeParameterModifier `in` is not valid here + ┌─ type_parameter_modifier1.ts:25:14 + │ +25 │ let x: new () => {}; + │ ^^ + +-- +error[SyntaxError]: TypeParameterModifier `out` is not valid here + ┌─ type_parameter_modifier1.ts:26:14 + │ +26 │ let x: new () => {}; + │ ^^^ + +-- +error[SyntaxError]: TypeParameterModifier `in` is not valid here + ┌─ type_parameter_modifier1.ts:27:14 + │ +27 │ let x: new () => {}; + │ ^^ + +-- +error[SyntaxError]: TypeParameterModifier `out` is not valid here + ┌─ type_parameter_modifier1.ts:27:20 + │ +27 │ let x: new () => {}; + │ ^^^ + +-- +error[SyntaxError]: TypeParameterModifier `in` is not valid here + ┌─ type_parameter_modifier1.ts:28:13 + │ +28 │ let x: { y(): any }; + │ ^^ + +-- +error[SyntaxError]: TypeParameterModifier `out` is not valid here + ┌─ type_parameter_modifier1.ts:29:13 + │ +29 │ let x: { y(): any }; + │ ^^^ + +-- +error[SyntaxError]: TypeParameterModifier `in` is not valid here + ┌─ type_parameter_modifier1.ts:30:13 + │ +30 │ let x: { y(): any }; + │ ^^ + +-- +error[SyntaxError]: TypeParameterModifier `out` is not valid here + ┌─ type_parameter_modifier1.ts:30:19 + │ +30 │ let x: { y(): any }; + │ ^^^ + +-- + export default function foo() {} + export function foo() {} + export function foo1() {} + export function foo2() {} + let foo: Foo + let foo: Foo + declare function foo() + declare function foo() + declare let foo: Foo + declare let foo: Foo + Foo = class {} + Foo = class {} + foo = function () {} + foo = function () {} + class Foo { foo(): T {} } + class Foo { foo(): T {} } + foo = { foo(): T {} }; + foo = { foo(): T {} }; + () => {}; + () => {}; + () => {}; + let x: () => {}; + let x: () => {}; + let x: () => {}; + let x: new () => {}; + let x: new () => {}; + let x: new () => {}; + let x: { y(): any }; + let x: { y(): any }; + let x: { y(): any }; diff --git a/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier1.ts b/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier1.ts new file mode 100644 index 00000000000..7fa7529b390 --- /dev/null +++ b/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier1.ts @@ -0,0 +1,30 @@ + export default function foo() {} + export function foo() {} + export function foo1() {} + export function foo2() {} + let foo: Foo + let foo: Foo + declare function foo() + declare function foo() + declare let foo: Foo + declare let foo: Foo + Foo = class {} + Foo = class {} + foo = function () {} + foo = function () {} + class Foo { foo(): T {} } + class Foo { foo(): T {} } + foo = { foo(): T {} }; + foo = { foo(): T {} }; + () => {}; + () => {}; + () => {}; + let x: () => {}; + let x: () => {}; + let x: () => {}; + let x: new () => {}; + let x: new () => {}; + let x: new () => {}; + let x: { y(): any }; + let x: { y(): any }; + let x: { y(): any }; From c444991f984c5164774a6dc2279ca24d804666ea Mon Sep 17 00:00:00 2001 From: IWANABETHATGUY Date: Mon, 9 May 2022 00:10:08 +0800 Subject: [PATCH 06/22] =?UTF-8?q?test:=20=F0=9F=92=8D=20update=20test=20ca?= =?UTF-8?q?se?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/syntax/typescript/types.rs | 27 +- .../inline/err/type_parameter_modifier1.rast | 2200 ++++++++--------- .../inline/err/type_parameter_modifier1.ts | 4 +- .../ok/type_parameter_modifier_tsx.rast | 67 + .../inline/ok/type_parameter_modifier_tsx.tsx | 7 + 5 files changed, 1187 insertions(+), 1118 deletions(-) create mode 100644 crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier_tsx.rast create mode 100644 crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier_tsx.tsx diff --git a/crates/rome_js_parser/src/syntax/typescript/types.rs b/crates/rome_js_parser/src/syntax/typescript/types.rs index 3e4ac6f8939..7b5c38419ab 100644 --- a/crates/rome_js_parser/src/syntax/typescript/types.rs +++ b/crates/rome_js_parser/src/syntax/typescript/types.rs @@ -161,8 +161,8 @@ impl ParseSeparatedList for TsTypeParameterList { // test_err ts type_parameter_modifier1 // export default function foo() {} // export function foo() {} -// export function foo1() {} -// export function foo2() {} +// export function foo1() {} +// export function foo2() {} // let foo: Foo // let foo: Foo // declare function foo() @@ -202,6 +202,15 @@ impl ParseSeparatedList for TsTypeParameterList { // function foo() {} // function foo() {} +// test tsx type_parameter_modifier_tsx +// +// // +// // +// // +// // +// // +// // + // test ts type_parameter_modifier // type Foo = T // type Foo = T @@ -1466,17 +1475,3 @@ fn parse_ts_type_member_semi(p: &mut Parser) { } // TODO: finish all this testing - -// expectPrintedTSX(t, "", "/* @__PURE__ */ React.createElement(\"in\", {\n T: true\n});\n") -// expectPrintedTSX(t, "", "/* @__PURE__ */ React.createElement(\"out\", {\n T: true\n});\n") -// expectPrintedTSX(t, "", "/* @__PURE__ */ React.createElement(\"in\", {\n out: true,\n T: true\n});\n") -// expectPrintedTSX(t, "", "/* @__PURE__ */ React.createElement(\"out\", {\n in: true,\n T: true\n});\n") -// expectPrintedTSX(t, "", "/* @__PURE__ */ React.createElement(\"in\", {\n T: true,\n extends: true\n});\n") -// expectPrintedTSX(t, "", "/* @__PURE__ */ React.createElement(\"out\", {\n T: true,\n extends: true\n});\n") -// expectPrintedTSX(t, "", "/* @__PURE__ */ React.createElement(\"in\", {\n out: true,\n T: true,\n extends: true\n});\n") -// expectParseErrorTSX(t, "() => {}", ": ERROR: Expected \">\" but found \",\"\n") -// expectParseErrorTSX(t, "() => {}", ": ERROR: Expected \">\" but found \",\"\n") -// expectParseErrorTSX(t, "() => {}", ": ERROR: Expected \">\" but found \",\"\n") -// expectParseErrorTSX(t, "() => {}", jsxErrorArrow) -// expectParseErrorTSX(t, "() => {}", jsxErrorArrow) -// expectParseErrorTSX(t, "() => {}", jsxErrorArrow) diff --git a/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier1.rast b/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier1.rast index 1f6028a04cb..0c7765df423 100644 --- a/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier1.rast +++ b/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier1.rast @@ -122,82 +122,82 @@ JsModule { l_curly_token: L_CURLY@103..104 "{" [] [], directives: JsDirectiveList [], statements: JsStatementList [], - r_curly_token: R_CURLY@104..106 "}" [] [Whitespace(" ")], + r_curly_token: R_CURLY@104..105 "}" [] [], }, }, }, JsExport { - export_token: EXPORT_KW@106..115 "export" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + export_token: EXPORT_KW@105..114 "export" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], export_clause: JsFunctionDeclaration { async_token: missing (optional), - function_token: FUNCTION_KW@115..124 "function" [] [Whitespace(" ")], + function_token: FUNCTION_KW@114..123 "function" [] [Whitespace(" ")], star_token: missing (optional), id: JsIdentifierBinding { - name_token: IDENT@124..128 "foo2" [] [], + name_token: IDENT@123..127 "foo2" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@128..129 "<" [] [], + l_angle_token: L_ANGLE@127..128 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { in_token: missing (optional), - out_token: OUT_KW@129..133 "out" [] [Whitespace(" ")], + out_token: OUT_KW@128..132 "out" [] [Whitespace(" ")], }, name: TsTypeParameterName { - ident_token: IDENT@133..134 "T" [] [], + ident_token: IDENT@132..133 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@134..135 ">" [] [], + r_angle_token: R_ANGLE@133..134 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@135..136 "(" [] [], + l_paren_token: L_PAREN@134..135 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@136..138 ")" [] [Whitespace(" ")], + r_paren_token: R_PAREN@135..137 ")" [] [Whitespace(" ")], }, return_type_annotation: missing (optional), body: JsFunctionBody { - l_curly_token: L_CURLY@138..139 "{" [] [], + l_curly_token: L_CURLY@137..138 "{" [] [], directives: JsDirectiveList [], statements: JsStatementList [], - r_curly_token: R_CURLY@139..141 "}" [] [Whitespace(" ")], + r_curly_token: R_CURLY@138..139 "}" [] [], }, }, }, JsVariableStatement { declaration: JsVariableDeclaration { - kind: LET_KW@141..147 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + kind: LET_KW@139..145 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], declarators: JsVariableDeclaratorList [ JsVariableDeclarator { id: JsIdentifierBinding { - name_token: IDENT@147..150 "foo" [] [], + name_token: IDENT@145..148 "foo" [] [], }, variable_annotation: TsTypeAnnotation { - colon_token: COLON@150..152 ":" [] [Whitespace(" ")], + colon_token: COLON@148..150 ":" [] [Whitespace(" ")], ty: TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@152..155 "Foo" [] [], + value_token: IDENT@150..153 "Foo" [] [], }, type_arguments: TsTypeArguments { - l_angle_token: L_ANGLE@155..156 "<" [] [], + l_angle_token: L_ANGLE@153..154 "<" [] [], ts_type_argument_list: TsTypeArgumentList [ TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@156..159 "in" [] [Whitespace(" ")], + value_token: IDENT@154..157 "in" [] [Whitespace(" ")], }, type_arguments: missing (optional), }, missing separator, TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@159..160 "T" [] [], + value_token: IDENT@157..158 "T" [] [], }, type_arguments: missing (optional), }, ], - r_angle_token: R_ANGLE@160..161 ">" [] [], + r_angle_token: R_ANGLE@158..159 ">" [] [], }, }, }, @@ -209,36 +209,36 @@ JsModule { }, JsVariableStatement { declaration: JsVariableDeclaration { - kind: LET_KW@161..167 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + kind: LET_KW@159..165 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], declarators: JsVariableDeclaratorList [ JsVariableDeclarator { id: JsIdentifierBinding { - name_token: IDENT@167..170 "foo" [] [], + name_token: IDENT@165..168 "foo" [] [], }, variable_annotation: TsTypeAnnotation { - colon_token: COLON@170..172 ":" [] [Whitespace(" ")], + colon_token: COLON@168..170 ":" [] [Whitespace(" ")], ty: TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@172..175 "Foo" [] [], + value_token: IDENT@170..173 "Foo" [] [], }, type_arguments: TsTypeArguments { - l_angle_token: L_ANGLE@175..176 "<" [] [], + l_angle_token: L_ANGLE@173..174 "<" [] [], ts_type_argument_list: TsTypeArgumentList [ TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@176..180 "out" [] [Whitespace(" ")], + value_token: IDENT@174..178 "out" [] [Whitespace(" ")], }, type_arguments: missing (optional), }, missing separator, TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@180..181 "T" [] [], + value_token: IDENT@178..179 "T" [] [], }, type_arguments: missing (optional), }, ], - r_angle_token: R_ANGLE@181..182 ">" [] [], + r_angle_token: R_ANGLE@179..180 ">" [] [], }, }, }, @@ -249,107 +249,107 @@ JsModule { semicolon_token: missing (optional), }, TsDeclareStatement { - declare_token: DECLARE_KW@182..192 "declare" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + declare_token: DECLARE_KW@180..190 "declare" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], declaration: TsDeclareFunctionDeclaration { async_token: missing (optional), - function_token: FUNCTION_KW@192..201 "function" [] [Whitespace(" ")], + function_token: FUNCTION_KW@190..199 "function" [] [Whitespace(" ")], id: JsIdentifierBinding { - name_token: IDENT@201..204 "foo" [] [], + name_token: IDENT@199..202 "foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@204..205 "<" [] [], + l_angle_token: L_ANGLE@202..203 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { - in_token: IN_KW@205..208 "in" [] [Whitespace(" ")], + in_token: IN_KW@203..206 "in" [] [Whitespace(" ")], out_token: missing (optional), }, name: TsTypeParameterName { - ident_token: IDENT@208..209 "T" [] [], + ident_token: IDENT@206..207 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@209..210 ">" [] [], + r_angle_token: R_ANGLE@207..208 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@210..211 "(" [] [], + l_paren_token: L_PAREN@208..209 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@211..212 ")" [] [], + r_paren_token: R_PAREN@209..210 ")" [] [], }, return_type_annotation: missing (optional), semicolon_token: missing (optional), }, }, TsDeclareStatement { - declare_token: DECLARE_KW@212..222 "declare" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + declare_token: DECLARE_KW@210..220 "declare" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], declaration: TsDeclareFunctionDeclaration { async_token: missing (optional), - function_token: FUNCTION_KW@222..231 "function" [] [Whitespace(" ")], + function_token: FUNCTION_KW@220..229 "function" [] [Whitespace(" ")], id: JsIdentifierBinding { - name_token: IDENT@231..234 "foo" [] [], + name_token: IDENT@229..232 "foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@234..235 "<" [] [], + l_angle_token: L_ANGLE@232..233 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { in_token: missing (optional), - out_token: OUT_KW@235..239 "out" [] [Whitespace(" ")], + out_token: OUT_KW@233..237 "out" [] [Whitespace(" ")], }, name: TsTypeParameterName { - ident_token: IDENT@239..240 "T" [] [], + ident_token: IDENT@237..238 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@240..241 ">" [] [], + r_angle_token: R_ANGLE@238..239 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@241..242 "(" [] [], + l_paren_token: L_PAREN@239..240 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@242..243 ")" [] [], + r_paren_token: R_PAREN@240..241 ")" [] [], }, return_type_annotation: missing (optional), semicolon_token: missing (optional), }, }, TsDeclareStatement { - declare_token: DECLARE_KW@243..253 "declare" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + declare_token: DECLARE_KW@241..251 "declare" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], declaration: JsVariableDeclarationClause { declaration: JsVariableDeclaration { - kind: LET_KW@253..257 "let" [] [Whitespace(" ")], + kind: LET_KW@251..255 "let" [] [Whitespace(" ")], declarators: JsVariableDeclaratorList [ JsVariableDeclarator { id: JsIdentifierBinding { - name_token: IDENT@257..260 "foo" [] [], + name_token: IDENT@255..258 "foo" [] [], }, variable_annotation: TsTypeAnnotation { - colon_token: COLON@260..262 ":" [] [Whitespace(" ")], + colon_token: COLON@258..260 ":" [] [Whitespace(" ")], ty: TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@262..265 "Foo" [] [], + value_token: IDENT@260..263 "Foo" [] [], }, type_arguments: TsTypeArguments { - l_angle_token: L_ANGLE@265..266 "<" [] [], + l_angle_token: L_ANGLE@263..264 "<" [] [], ts_type_argument_list: TsTypeArgumentList [ TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@266..269 "in" [] [Whitespace(" ")], + value_token: IDENT@264..267 "in" [] [Whitespace(" ")], }, type_arguments: missing (optional), }, missing separator, TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@269..270 "T" [] [], + value_token: IDENT@267..268 "T" [] [], }, type_arguments: missing (optional), }, ], - r_angle_token: R_ANGLE@270..271 ">" [] [], + r_angle_token: R_ANGLE@268..269 ">" [] [], }, }, }, @@ -361,39 +361,39 @@ JsModule { }, }, TsDeclareStatement { - declare_token: DECLARE_KW@271..281 "declare" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + declare_token: DECLARE_KW@269..279 "declare" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], declaration: JsVariableDeclarationClause { declaration: JsVariableDeclaration { - kind: LET_KW@281..285 "let" [] [Whitespace(" ")], + kind: LET_KW@279..283 "let" [] [Whitespace(" ")], declarators: JsVariableDeclaratorList [ JsVariableDeclarator { id: JsIdentifierBinding { - name_token: IDENT@285..288 "foo" [] [], + name_token: IDENT@283..286 "foo" [] [], }, variable_annotation: TsTypeAnnotation { - colon_token: COLON@288..290 ":" [] [Whitespace(" ")], + colon_token: COLON@286..288 ":" [] [Whitespace(" ")], ty: TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@290..293 "Foo" [] [], + value_token: IDENT@288..291 "Foo" [] [], }, type_arguments: TsTypeArguments { - l_angle_token: L_ANGLE@293..294 "<" [] [], + l_angle_token: L_ANGLE@291..292 "<" [] [], ts_type_argument_list: TsTypeArgumentList [ TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@294..298 "out" [] [Whitespace(" ")], + value_token: IDENT@292..296 "out" [] [Whitespace(" ")], }, type_arguments: missing (optional), }, missing separator, TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@298..299 "T" [] [], + value_token: IDENT@296..297 "T" [] [], }, type_arguments: missing (optional), }, ], - r_angle_token: R_ANGLE@299..300 ">" [] [], + r_angle_token: R_ANGLE@297..298 ">" [] [], }, }, }, @@ -407,34 +407,34 @@ JsModule { JsExpressionStatement { expression: JsAssignmentExpression { left: JsIdentifierAssignment { - name_token: IDENT@300..306 "Foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + name_token: IDENT@298..304 "Foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], }, - operator_token: EQ@306..308 "=" [] [Whitespace(" ")], + operator_token: EQ@304..306 "=" [] [Whitespace(" ")], right: JsClassExpression { - class_token: CLASS_KW@308..314 "class" [] [Whitespace(" ")], + class_token: CLASS_KW@306..312 "class" [] [Whitespace(" ")], id: missing (optional), type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@314..315 "<" [] [], + l_angle_token: L_ANGLE@312..313 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { - in_token: IN_KW@315..318 "in" [] [Whitespace(" ")], + in_token: IN_KW@313..316 "in" [] [Whitespace(" ")], out_token: missing (optional), }, name: TsTypeParameterName { - ident_token: IDENT@318..319 "T" [] [], + ident_token: IDENT@316..317 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@319..321 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@317..319 ">" [] [Whitespace(" ")], }, extends_clause: missing (optional), implements_clause: missing (optional), - l_curly_token: L_CURLY@321..322 "{" [] [], + l_curly_token: L_CURLY@319..320 "{" [] [], members: JsClassMemberList [], - r_curly_token: R_CURLY@322..323 "}" [] [], + r_curly_token: R_CURLY@320..321 "}" [] [], }, }, semicolon_token: missing (optional), @@ -442,34 +442,34 @@ JsModule { JsExpressionStatement { expression: JsAssignmentExpression { left: JsIdentifierAssignment { - name_token: IDENT@323..329 "Foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + name_token: IDENT@321..327 "Foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], }, - operator_token: EQ@329..331 "=" [] [Whitespace(" ")], + operator_token: EQ@327..329 "=" [] [Whitespace(" ")], right: JsClassExpression { - class_token: CLASS_KW@331..337 "class" [] [Whitespace(" ")], + class_token: CLASS_KW@329..335 "class" [] [Whitespace(" ")], id: missing (optional), type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@337..338 "<" [] [], + l_angle_token: L_ANGLE@335..336 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { in_token: missing (optional), - out_token: OUT_KW@338..342 "out" [] [Whitespace(" ")], + out_token: OUT_KW@336..340 "out" [] [Whitespace(" ")], }, name: TsTypeParameterName { - ident_token: IDENT@342..343 "T" [] [], + ident_token: IDENT@340..341 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@343..345 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@341..343 ">" [] [Whitespace(" ")], }, extends_clause: missing (optional), implements_clause: missing (optional), - l_curly_token: L_CURLY@345..346 "{" [] [], + l_curly_token: L_CURLY@343..344 "{" [] [], members: JsClassMemberList [], - r_curly_token: R_CURLY@346..347 "}" [] [], + r_curly_token: R_CURLY@344..345 "}" [] [], }, }, semicolon_token: missing (optional), @@ -477,42 +477,42 @@ JsModule { JsExpressionStatement { expression: JsAssignmentExpression { left: JsIdentifierAssignment { - name_token: IDENT@347..353 "foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + name_token: IDENT@345..351 "foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], }, - operator_token: EQ@353..355 "=" [] [Whitespace(" ")], + operator_token: EQ@351..353 "=" [] [Whitespace(" ")], right: JsFunctionExpression { async_token: missing (optional), - function_token: FUNCTION_KW@355..364 "function" [] [Whitespace(" ")], + function_token: FUNCTION_KW@353..362 "function" [] [Whitespace(" ")], star_token: missing (optional), id: missing (optional), type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@364..365 "<" [] [], + l_angle_token: L_ANGLE@362..363 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { - in_token: IN_KW@365..368 "in" [] [Whitespace(" ")], + in_token: IN_KW@363..366 "in" [] [Whitespace(" ")], out_token: missing (optional), }, name: TsTypeParameterName { - ident_token: IDENT@368..369 "T" [] [], + ident_token: IDENT@366..367 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@369..370 ">" [] [], + r_angle_token: R_ANGLE@367..368 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@370..371 "(" [] [], + l_paren_token: L_PAREN@368..369 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@371..373 ")" [] [Whitespace(" ")], + r_paren_token: R_PAREN@369..371 ")" [] [Whitespace(" ")], }, return_type_annotation: missing (optional), body: JsFunctionBody { - l_curly_token: L_CURLY@373..374 "{" [] [], + l_curly_token: L_CURLY@371..372 "{" [] [], directives: JsDirectiveList [], statements: JsStatementList [], - r_curly_token: R_CURLY@374..375 "}" [] [], + r_curly_token: R_CURLY@372..373 "}" [] [], }, }, }, @@ -521,42 +521,42 @@ JsModule { JsExpressionStatement { expression: JsAssignmentExpression { left: JsIdentifierAssignment { - name_token: IDENT@375..381 "foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + name_token: IDENT@373..379 "foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], }, - operator_token: EQ@381..383 "=" [] [Whitespace(" ")], + operator_token: EQ@379..381 "=" [] [Whitespace(" ")], right: JsFunctionExpression { async_token: missing (optional), - function_token: FUNCTION_KW@383..392 "function" [] [Whitespace(" ")], + function_token: FUNCTION_KW@381..390 "function" [] [Whitespace(" ")], star_token: missing (optional), id: missing (optional), type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@392..393 "<" [] [], + l_angle_token: L_ANGLE@390..391 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { in_token: missing (optional), - out_token: OUT_KW@393..397 "out" [] [Whitespace(" ")], + out_token: OUT_KW@391..395 "out" [] [Whitespace(" ")], }, name: TsTypeParameterName { - ident_token: IDENT@397..398 "T" [] [], + ident_token: IDENT@395..396 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@398..399 ">" [] [], + r_angle_token: R_ANGLE@396..397 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@399..400 "(" [] [], + l_paren_token: L_PAREN@397..398 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@400..402 ")" [] [Whitespace(" ")], + r_paren_token: R_PAREN@398..400 ")" [] [Whitespace(" ")], }, return_type_annotation: missing (optional), body: JsFunctionBody { - l_curly_token: L_CURLY@402..403 "{" [] [], + l_curly_token: L_CURLY@400..401 "{" [] [], directives: JsDirectiveList [], statements: JsStatementList [], - r_curly_token: R_CURLY@403..404 "}" [] [], + r_curly_token: R_CURLY@401..402 "}" [] [], }, }, }, @@ -564,338 +564,338 @@ JsModule { }, JsClassDeclaration { abstract_token: missing (optional), - class_token: CLASS_KW@404..412 "class" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + class_token: CLASS_KW@402..410 "class" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], id: JsIdentifierBinding { - name_token: IDENT@412..416 "Foo" [] [Whitespace(" ")], + name_token: IDENT@410..414 "Foo" [] [Whitespace(" ")], }, type_parameters: missing (optional), extends_clause: missing (optional), implements_clause: missing (optional), - l_curly_token: L_CURLY@416..418 "{" [] [Whitespace(" ")], + l_curly_token: L_CURLY@414..416 "{" [] [Whitespace(" ")], members: JsClassMemberList [ JsMethodClassMember { modifiers: JsMethodModifierList [], async_token: missing (optional), star_token: missing (optional), name: JsLiteralMemberName { - value: IDENT@418..421 "foo" [] [], + value: IDENT@416..419 "foo" [] [], }, question_mark_token: missing (optional), type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@421..422 "<" [] [], + l_angle_token: L_ANGLE@419..420 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { - in_token: IN_KW@422..425 "in" [] [Whitespace(" ")], + in_token: IN_KW@420..423 "in" [] [Whitespace(" ")], out_token: missing (optional), }, name: TsTypeParameterName { - ident_token: IDENT@425..426 "T" [] [], + ident_token: IDENT@423..424 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@426..427 ">" [] [], + r_angle_token: R_ANGLE@424..425 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@427..428 "(" [] [], + l_paren_token: L_PAREN@425..426 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@428..429 ")" [] [], + r_paren_token: R_PAREN@426..427 ")" [] [], }, return_type_annotation: TsReturnTypeAnnotation { - colon_token: COLON@429..431 ":" [] [Whitespace(" ")], + colon_token: COLON@427..429 ":" [] [Whitespace(" ")], ty: TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@431..433 "T" [] [Whitespace(" ")], + value_token: IDENT@429..431 "T" [] [Whitespace(" ")], }, type_arguments: missing (optional), }, }, body: JsFunctionBody { - l_curly_token: L_CURLY@433..434 "{" [] [], + l_curly_token: L_CURLY@431..432 "{" [] [], directives: JsDirectiveList [], statements: JsStatementList [], - r_curly_token: R_CURLY@434..436 "}" [] [Whitespace(" ")], + r_curly_token: R_CURLY@432..434 "}" [] [Whitespace(" ")], }, }, ], - r_curly_token: R_CURLY@436..437 "}" [] [], + r_curly_token: R_CURLY@434..435 "}" [] [], }, JsClassDeclaration { abstract_token: missing (optional), - class_token: CLASS_KW@437..445 "class" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + class_token: CLASS_KW@435..443 "class" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], id: JsIdentifierBinding { - name_token: IDENT@445..449 "Foo" [] [Whitespace(" ")], + name_token: IDENT@443..447 "Foo" [] [Whitespace(" ")], }, type_parameters: missing (optional), extends_clause: missing (optional), implements_clause: missing (optional), - l_curly_token: L_CURLY@449..451 "{" [] [Whitespace(" ")], + l_curly_token: L_CURLY@447..449 "{" [] [Whitespace(" ")], members: JsClassMemberList [ JsMethodClassMember { modifiers: JsMethodModifierList [], async_token: missing (optional), star_token: missing (optional), name: JsLiteralMemberName { - value: IDENT@451..454 "foo" [] [], + value: IDENT@449..452 "foo" [] [], }, question_mark_token: missing (optional), type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@454..455 "<" [] [], + l_angle_token: L_ANGLE@452..453 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { in_token: missing (optional), - out_token: OUT_KW@455..459 "out" [] [Whitespace(" ")], + out_token: OUT_KW@453..457 "out" [] [Whitespace(" ")], }, name: TsTypeParameterName { - ident_token: IDENT@459..460 "T" [] [], + ident_token: IDENT@457..458 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@460..461 ">" [] [], + r_angle_token: R_ANGLE@458..459 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@461..462 "(" [] [], + l_paren_token: L_PAREN@459..460 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@462..463 ")" [] [], + r_paren_token: R_PAREN@460..461 ")" [] [], }, return_type_annotation: TsReturnTypeAnnotation { - colon_token: COLON@463..465 ":" [] [Whitespace(" ")], + colon_token: COLON@461..463 ":" [] [Whitespace(" ")], ty: TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@465..467 "T" [] [Whitespace(" ")], + value_token: IDENT@463..465 "T" [] [Whitespace(" ")], }, type_arguments: missing (optional), }, }, body: JsFunctionBody { - l_curly_token: L_CURLY@467..468 "{" [] [], + l_curly_token: L_CURLY@465..466 "{" [] [], directives: JsDirectiveList [], statements: JsStatementList [], - r_curly_token: R_CURLY@468..470 "}" [] [Whitespace(" ")], + r_curly_token: R_CURLY@466..468 "}" [] [Whitespace(" ")], }, }, ], - r_curly_token: R_CURLY@470..471 "}" [] [], + r_curly_token: R_CURLY@468..469 "}" [] [], }, JsExpressionStatement { expression: JsAssignmentExpression { left: JsIdentifierAssignment { - name_token: IDENT@471..477 "foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + name_token: IDENT@469..475 "foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], }, - operator_token: EQ@477..479 "=" [] [Whitespace(" ")], + operator_token: EQ@475..477 "=" [] [Whitespace(" ")], right: JsObjectExpression { - l_curly_token: L_CURLY@479..481 "{" [] [Whitespace(" ")], + l_curly_token: L_CURLY@477..479 "{" [] [Whitespace(" ")], members: JsObjectMemberList [ JsMethodObjectMember { async_token: missing (optional), star_token: missing (optional), name: JsLiteralMemberName { - value: IDENT@481..484 "foo" [] [], + value: IDENT@479..482 "foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@484..485 "<" [] [], + l_angle_token: L_ANGLE@482..483 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { - in_token: IN_KW@485..488 "in" [] [Whitespace(" ")], + in_token: IN_KW@483..486 "in" [] [Whitespace(" ")], out_token: missing (optional), }, name: TsTypeParameterName { - ident_token: IDENT@488..489 "T" [] [], + ident_token: IDENT@486..487 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@489..490 ">" [] [], + r_angle_token: R_ANGLE@487..488 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@490..491 "(" [] [], + l_paren_token: L_PAREN@488..489 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@491..492 ")" [] [], + r_paren_token: R_PAREN@489..490 ")" [] [], }, return_type_annotation: TsReturnTypeAnnotation { - colon_token: COLON@492..494 ":" [] [Whitespace(" ")], + colon_token: COLON@490..492 ":" [] [Whitespace(" ")], ty: TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@494..496 "T" [] [Whitespace(" ")], + value_token: IDENT@492..494 "T" [] [Whitespace(" ")], }, type_arguments: missing (optional), }, }, body: JsFunctionBody { - l_curly_token: L_CURLY@496..497 "{" [] [], + l_curly_token: L_CURLY@494..495 "{" [] [], directives: JsDirectiveList [], statements: JsStatementList [], - r_curly_token: R_CURLY@497..499 "}" [] [Whitespace(" ")], + r_curly_token: R_CURLY@495..497 "}" [] [Whitespace(" ")], }, }, ], - r_curly_token: R_CURLY@499..500 "}" [] [], + r_curly_token: R_CURLY@497..498 "}" [] [], }, }, - semicolon_token: SEMICOLON@500..501 ";" [] [], + semicolon_token: SEMICOLON@498..499 ";" [] [], }, JsExpressionStatement { expression: JsAssignmentExpression { left: JsIdentifierAssignment { - name_token: IDENT@501..507 "foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + name_token: IDENT@499..505 "foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], }, - operator_token: EQ@507..509 "=" [] [Whitespace(" ")], + operator_token: EQ@505..507 "=" [] [Whitespace(" ")], right: JsObjectExpression { - l_curly_token: L_CURLY@509..511 "{" [] [Whitespace(" ")], + l_curly_token: L_CURLY@507..509 "{" [] [Whitespace(" ")], members: JsObjectMemberList [ JsMethodObjectMember { async_token: missing (optional), star_token: missing (optional), name: JsLiteralMemberName { - value: IDENT@511..514 "foo" [] [], + value: IDENT@509..512 "foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@514..515 "<" [] [], + l_angle_token: L_ANGLE@512..513 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { in_token: missing (optional), - out_token: OUT_KW@515..519 "out" [] [Whitespace(" ")], + out_token: OUT_KW@513..517 "out" [] [Whitespace(" ")], }, name: TsTypeParameterName { - ident_token: IDENT@519..520 "T" [] [], + ident_token: IDENT@517..518 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@520..521 ">" [] [], + r_angle_token: R_ANGLE@518..519 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@521..522 "(" [] [], + l_paren_token: L_PAREN@519..520 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@522..523 ")" [] [], + r_paren_token: R_PAREN@520..521 ")" [] [], }, return_type_annotation: TsReturnTypeAnnotation { - colon_token: COLON@523..525 ":" [] [Whitespace(" ")], + colon_token: COLON@521..523 ":" [] [Whitespace(" ")], ty: TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@525..527 "T" [] [Whitespace(" ")], + value_token: IDENT@523..525 "T" [] [Whitespace(" ")], }, type_arguments: missing (optional), }, }, body: JsFunctionBody { - l_curly_token: L_CURLY@527..528 "{" [] [], + l_curly_token: L_CURLY@525..526 "{" [] [], directives: JsDirectiveList [], statements: JsStatementList [], - r_curly_token: R_CURLY@528..530 "}" [] [Whitespace(" ")], + r_curly_token: R_CURLY@526..528 "}" [] [Whitespace(" ")], }, }, ], - r_curly_token: R_CURLY@530..531 "}" [] [], + r_curly_token: R_CURLY@528..529 "}" [] [], }, }, - semicolon_token: SEMICOLON@531..532 ";" [] [], + semicolon_token: SEMICOLON@529..530 ";" [] [], }, JsExpressionStatement { expression: JsBinaryExpression { left: TsTypeAssertionExpression { - l_angle_token: L_ANGLE@532..535 "<" [Newline("\n"), Whitespace("\t")] [], + l_angle_token: L_ANGLE@530..533 "<" [Newline("\n"), Whitespace("\t")] [], ty: TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@535..538 "in" [] [Whitespace(" ")], + value_token: IDENT@533..536 "in" [] [Whitespace(" ")], }, type_arguments: missing (optional), }, r_angle_token: missing (required), expression: JsIdentifierExpression { name: JsReferenceIdentifier { - value_token: IDENT@538..539 "T" [] [], + value_token: IDENT@536..537 "T" [] [], }, }, }, - operator_token: R_ANGLE@539..540 ">" [] [], + operator_token: R_ANGLE@537..538 ">" [] [], right: JsParenthesizedExpression { - l_paren_token: L_PAREN@540..541 "(" [] [], + l_paren_token: L_PAREN@538..539 "(" [] [], expression: missing (required), - r_paren_token: R_PAREN@541..543 ")" [] [Whitespace(" ")], + r_paren_token: R_PAREN@539..541 ")" [] [Whitespace(" ")], }, }, semicolon_token: missing (optional), }, JsUnknownStatement { items: [ - FAT_ARROW@543..546 "=>" [] [Whitespace(" ")], + FAT_ARROW@541..544 "=>" [] [Whitespace(" ")], ], }, JsBlockStatement { - l_curly_token: L_CURLY@546..547 "{" [] [], + l_curly_token: L_CURLY@544..545 "{" [] [], statements: JsStatementList [], - r_curly_token: R_CURLY@547..548 "}" [] [], + r_curly_token: R_CURLY@545..546 "}" [] [], }, JsEmptyStatement { - semicolon_token: SEMICOLON@548..549 ";" [] [], + semicolon_token: SEMICOLON@546..547 ";" [] [], }, JsExpressionStatement { expression: JsArrowFunctionExpression { async_token: missing (optional), type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@549..552 "<" [Newline("\n"), Whitespace("\t")] [], + l_angle_token: L_ANGLE@547..550 "<" [Newline("\n"), Whitespace("\t")] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { in_token: missing (optional), - out_token: OUT_KW@552..556 "out" [] [Whitespace(" ")], + out_token: OUT_KW@550..554 "out" [] [Whitespace(" ")], }, name: TsTypeParameterName { - ident_token: IDENT@556..557 "T" [] [], + ident_token: IDENT@554..555 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@557..558 ">" [] [], + r_angle_token: R_ANGLE@555..556 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@558..559 "(" [] [], + l_paren_token: L_PAREN@556..557 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@559..561 ")" [] [Whitespace(" ")], + r_paren_token: R_PAREN@557..559 ")" [] [Whitespace(" ")], }, return_type_annotation: missing (optional), - fat_arrow_token: FAT_ARROW@561..564 "=>" [] [Whitespace(" ")], + fat_arrow_token: FAT_ARROW@559..562 "=>" [] [Whitespace(" ")], body: JsFunctionBody { - l_curly_token: L_CURLY@564..565 "{" [] [], + l_curly_token: L_CURLY@562..563 "{" [] [], directives: JsDirectiveList [], statements: JsStatementList [], - r_curly_token: R_CURLY@565..566 "}" [] [], + r_curly_token: R_CURLY@563..564 "}" [] [], }, }, - semicolon_token: SEMICOLON@566..567 ";" [] [], + semicolon_token: SEMICOLON@564..565 ";" [] [], }, JsExpressionStatement { expression: JsSequenceExpression { left: TsTypeAssertionExpression { - l_angle_token: L_ANGLE@567..570 "<" [Newline("\n"), Whitespace("\t")] [], + l_angle_token: L_ANGLE@565..568 "<" [Newline("\n"), Whitespace("\t")] [], ty: TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@570..573 "in" [] [Whitespace(" ")], + value_token: IDENT@568..571 "in" [] [Whitespace(" ")], }, type_arguments: missing (optional), }, r_angle_token: missing (required), expression: JsIdentifierExpression { name: JsReferenceIdentifier { - value_token: IDENT@573..574 "T" [] [], + value_token: IDENT@571..572 "T" [] [], }, }, }, - comma_token: COMMA@574..576 "," [] [Whitespace(" ")], + comma_token: COMMA@572..574 "," [] [Whitespace(" ")], right: JsIdentifierExpression { name: JsReferenceIdentifier { - value_token: IDENT@576..580 "out" [] [Whitespace(" ")], + value_token: IDENT@574..578 "out" [] [Whitespace(" ")], }, }, }, @@ -905,69 +905,69 @@ JsModule { expression: JsBinaryExpression { left: JsIdentifierExpression { name: JsReferenceIdentifier { - value_token: IDENT@580..581 "T" [] [], + value_token: IDENT@578..579 "T" [] [], }, }, - operator_token: R_ANGLE@581..582 ">" [] [], + operator_token: R_ANGLE@579..580 ">" [] [], right: JsParenthesizedExpression { - l_paren_token: L_PAREN@582..583 "(" [] [], + l_paren_token: L_PAREN@580..581 "(" [] [], expression: missing (required), - r_paren_token: R_PAREN@583..585 ")" [] [Whitespace(" ")], + r_paren_token: R_PAREN@581..583 ")" [] [Whitespace(" ")], }, }, semicolon_token: missing (optional), }, JsUnknownStatement { items: [ - FAT_ARROW@585..588 "=>" [] [Whitespace(" ")], + FAT_ARROW@583..586 "=>" [] [Whitespace(" ")], ], }, JsBlockStatement { - l_curly_token: L_CURLY@588..589 "{" [] [], + l_curly_token: L_CURLY@586..587 "{" [] [], statements: JsStatementList [], - r_curly_token: R_CURLY@589..590 "}" [] [], + r_curly_token: R_CURLY@587..588 "}" [] [], }, JsEmptyStatement { - semicolon_token: SEMICOLON@590..591 ";" [] [], + semicolon_token: SEMICOLON@588..589 ";" [] [], }, JsVariableStatement { declaration: JsVariableDeclaration { - kind: LET_KW@591..597 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + kind: LET_KW@589..595 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], declarators: JsVariableDeclaratorList [ JsVariableDeclarator { id: JsIdentifierBinding { - name_token: IDENT@597..598 "x" [] [], + name_token: IDENT@595..596 "x" [] [], }, variable_annotation: TsTypeAnnotation { - colon_token: COLON@598..600 ":" [] [Whitespace(" ")], + colon_token: COLON@596..598 ":" [] [Whitespace(" ")], ty: TsFunctionType { type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@600..601 "<" [] [], + l_angle_token: L_ANGLE@598..599 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { - in_token: IN_KW@601..604 "in" [] [Whitespace(" ")], + in_token: IN_KW@599..602 "in" [] [Whitespace(" ")], out_token: missing (optional), }, name: TsTypeParameterName { - ident_token: IDENT@604..605 "T" [] [], + ident_token: IDENT@602..603 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@605..606 ">" [] [], + r_angle_token: R_ANGLE@603..604 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@606..607 "(" [] [], + l_paren_token: L_PAREN@604..605 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@607..609 ")" [] [Whitespace(" ")], + r_paren_token: R_PAREN@605..607 ")" [] [Whitespace(" ")], }, - fat_arrow_token: FAT_ARROW@609..612 "=>" [] [Whitespace(" ")], + fat_arrow_token: FAT_ARROW@607..610 "=>" [] [Whitespace(" ")], return_type: TsObjectType { - l_curly_token: L_CURLY@612..613 "{" [] [], + l_curly_token: L_CURLY@610..611 "{" [] [], members: TsTypeMemberList [], - r_curly_token: R_CURLY@613..614 "}" [] [], + r_curly_token: R_CURLY@611..612 "}" [] [], }, }, }, @@ -975,46 +975,46 @@ JsModule { }, ], }, - semicolon_token: SEMICOLON@614..615 ";" [] [], + semicolon_token: SEMICOLON@612..613 ";" [] [], }, JsVariableStatement { declaration: JsVariableDeclaration { - kind: LET_KW@615..621 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + kind: LET_KW@613..619 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], declarators: JsVariableDeclaratorList [ JsVariableDeclarator { id: JsIdentifierBinding { - name_token: IDENT@621..622 "x" [] [], + name_token: IDENT@619..620 "x" [] [], }, variable_annotation: TsTypeAnnotation { - colon_token: COLON@622..624 ":" [] [Whitespace(" ")], + colon_token: COLON@620..622 ":" [] [Whitespace(" ")], ty: TsFunctionType { type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@624..625 "<" [] [], + l_angle_token: L_ANGLE@622..623 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { in_token: missing (optional), - out_token: OUT_KW@625..629 "out" [] [Whitespace(" ")], + out_token: OUT_KW@623..627 "out" [] [Whitespace(" ")], }, name: TsTypeParameterName { - ident_token: IDENT@629..630 "T" [] [], + ident_token: IDENT@627..628 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@630..631 ">" [] [], + r_angle_token: R_ANGLE@628..629 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@631..632 "(" [] [], + l_paren_token: L_PAREN@629..630 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@632..634 ")" [] [Whitespace(" ")], + r_paren_token: R_PAREN@630..632 ")" [] [Whitespace(" ")], }, - fat_arrow_token: FAT_ARROW@634..637 "=>" [] [Whitespace(" ")], + fat_arrow_token: FAT_ARROW@632..635 "=>" [] [Whitespace(" ")], return_type: TsObjectType { - l_curly_token: L_CURLY@637..638 "{" [] [], + l_curly_token: L_CURLY@635..636 "{" [] [], members: TsTypeMemberList [], - r_curly_token: R_CURLY@638..639 "}" [] [], + r_curly_token: R_CURLY@636..637 "}" [] [], }, }, }, @@ -1022,58 +1022,58 @@ JsModule { }, ], }, - semicolon_token: SEMICOLON@639..640 ";" [] [], + semicolon_token: SEMICOLON@637..638 ";" [] [], }, JsVariableStatement { declaration: JsVariableDeclaration { - kind: LET_KW@640..646 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + kind: LET_KW@638..644 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], declarators: JsVariableDeclaratorList [ JsVariableDeclarator { id: JsIdentifierBinding { - name_token: IDENT@646..647 "x" [] [], + name_token: IDENT@644..645 "x" [] [], }, variable_annotation: TsTypeAnnotation { - colon_token: COLON@647..649 ":" [] [Whitespace(" ")], + colon_token: COLON@645..647 ":" [] [Whitespace(" ")], ty: TsFunctionType { type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@649..650 "<" [] [], + l_angle_token: L_ANGLE@647..648 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { - in_token: IN_KW@650..653 "in" [] [Whitespace(" ")], + in_token: IN_KW@648..651 "in" [] [Whitespace(" ")], out_token: missing (optional), }, name: TsTypeParameterName { - ident_token: IDENT@653..654 "T" [] [], + ident_token: IDENT@651..652 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, - COMMA@654..656 "," [] [Whitespace(" ")], + COMMA@652..654 "," [] [Whitespace(" ")], TsTypeParameter { modifier: TsTypeParameterModifier { in_token: missing (optional), - out_token: OUT_KW@656..660 "out" [] [Whitespace(" ")], + out_token: OUT_KW@654..658 "out" [] [Whitespace(" ")], }, name: TsTypeParameterName { - ident_token: IDENT@660..661 "T" [] [], + ident_token: IDENT@658..659 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@661..662 ">" [] [], + r_angle_token: R_ANGLE@659..660 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@662..663 "(" [] [], + l_paren_token: L_PAREN@660..661 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@663..665 ")" [] [Whitespace(" ")], + r_paren_token: R_PAREN@661..663 ")" [] [Whitespace(" ")], }, - fat_arrow_token: FAT_ARROW@665..668 "=>" [] [Whitespace(" ")], + fat_arrow_token: FAT_ARROW@663..666 "=>" [] [Whitespace(" ")], return_type: TsObjectType { - l_curly_token: L_CURLY@668..669 "{" [] [], + l_curly_token: L_CURLY@666..667 "{" [] [], members: TsTypeMemberList [], - r_curly_token: R_CURLY@669..670 "}" [] [], + r_curly_token: R_CURLY@667..668 "}" [] [], }, }, }, @@ -1081,48 +1081,48 @@ JsModule { }, ], }, - semicolon_token: SEMICOLON@670..671 ";" [] [], + semicolon_token: SEMICOLON@668..669 ";" [] [], }, JsVariableStatement { declaration: JsVariableDeclaration { - kind: LET_KW@671..677 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + kind: LET_KW@669..675 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], declarators: JsVariableDeclaratorList [ JsVariableDeclarator { id: JsIdentifierBinding { - name_token: IDENT@677..678 "x" [] [], + name_token: IDENT@675..676 "x" [] [], }, variable_annotation: TsTypeAnnotation { - colon_token: COLON@678..680 ":" [] [Whitespace(" ")], + colon_token: COLON@676..678 ":" [] [Whitespace(" ")], ty: TsConstructorType { abstract_token: missing (optional), - new_token: NEW_KW@680..684 "new" [] [Whitespace(" ")], + new_token: NEW_KW@678..682 "new" [] [Whitespace(" ")], type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@684..685 "<" [] [], + l_angle_token: L_ANGLE@682..683 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { - in_token: IN_KW@685..688 "in" [] [Whitespace(" ")], + in_token: IN_KW@683..686 "in" [] [Whitespace(" ")], out_token: missing (optional), }, name: TsTypeParameterName { - ident_token: IDENT@688..689 "T" [] [], + ident_token: IDENT@686..687 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@689..690 ">" [] [], + r_angle_token: R_ANGLE@687..688 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@690..691 "(" [] [], + l_paren_token: L_PAREN@688..689 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@691..693 ")" [] [Whitespace(" ")], + r_paren_token: R_PAREN@689..691 ")" [] [Whitespace(" ")], }, - fat_arrow_token: FAT_ARROW@693..696 "=>" [] [Whitespace(" ")], + fat_arrow_token: FAT_ARROW@691..694 "=>" [] [Whitespace(" ")], return_type: TsObjectType { - l_curly_token: L_CURLY@696..697 "{" [] [], + l_curly_token: L_CURLY@694..695 "{" [] [], members: TsTypeMemberList [], - r_curly_token: R_CURLY@697..698 "}" [] [], + r_curly_token: R_CURLY@695..696 "}" [] [], }, }, }, @@ -1130,48 +1130,48 @@ JsModule { }, ], }, - semicolon_token: SEMICOLON@698..699 ";" [] [], + semicolon_token: SEMICOLON@696..697 ";" [] [], }, JsVariableStatement { declaration: JsVariableDeclaration { - kind: LET_KW@699..705 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + kind: LET_KW@697..703 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], declarators: JsVariableDeclaratorList [ JsVariableDeclarator { id: JsIdentifierBinding { - name_token: IDENT@705..706 "x" [] [], + name_token: IDENT@703..704 "x" [] [], }, variable_annotation: TsTypeAnnotation { - colon_token: COLON@706..708 ":" [] [Whitespace(" ")], + colon_token: COLON@704..706 ":" [] [Whitespace(" ")], ty: TsConstructorType { abstract_token: missing (optional), - new_token: NEW_KW@708..712 "new" [] [Whitespace(" ")], + new_token: NEW_KW@706..710 "new" [] [Whitespace(" ")], type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@712..713 "<" [] [], + l_angle_token: L_ANGLE@710..711 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { in_token: missing (optional), - out_token: OUT_KW@713..717 "out" [] [Whitespace(" ")], + out_token: OUT_KW@711..715 "out" [] [Whitespace(" ")], }, name: TsTypeParameterName { - ident_token: IDENT@717..718 "T" [] [], + ident_token: IDENT@715..716 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@718..719 ">" [] [], + r_angle_token: R_ANGLE@716..717 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@719..720 "(" [] [], + l_paren_token: L_PAREN@717..718 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@720..722 ")" [] [Whitespace(" ")], + r_paren_token: R_PAREN@718..720 ")" [] [Whitespace(" ")], }, - fat_arrow_token: FAT_ARROW@722..725 "=>" [] [Whitespace(" ")], + fat_arrow_token: FAT_ARROW@720..723 "=>" [] [Whitespace(" ")], return_type: TsObjectType { - l_curly_token: L_CURLY@725..726 "{" [] [], + l_curly_token: L_CURLY@723..724 "{" [] [], members: TsTypeMemberList [], - r_curly_token: R_CURLY@726..727 "}" [] [], + r_curly_token: R_CURLY@724..725 "}" [] [], }, }, }, @@ -1179,60 +1179,60 @@ JsModule { }, ], }, - semicolon_token: SEMICOLON@727..728 ";" [] [], + semicolon_token: SEMICOLON@725..726 ";" [] [], }, JsVariableStatement { declaration: JsVariableDeclaration { - kind: LET_KW@728..734 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + kind: LET_KW@726..732 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], declarators: JsVariableDeclaratorList [ JsVariableDeclarator { id: JsIdentifierBinding { - name_token: IDENT@734..735 "x" [] [], + name_token: IDENT@732..733 "x" [] [], }, variable_annotation: TsTypeAnnotation { - colon_token: COLON@735..737 ":" [] [Whitespace(" ")], + colon_token: COLON@733..735 ":" [] [Whitespace(" ")], ty: TsConstructorType { abstract_token: missing (optional), - new_token: NEW_KW@737..741 "new" [] [Whitespace(" ")], + new_token: NEW_KW@735..739 "new" [] [Whitespace(" ")], type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@741..742 "<" [] [], + l_angle_token: L_ANGLE@739..740 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { - in_token: IN_KW@742..745 "in" [] [Whitespace(" ")], + in_token: IN_KW@740..743 "in" [] [Whitespace(" ")], out_token: missing (optional), }, name: TsTypeParameterName { - ident_token: IDENT@745..746 "T" [] [], + ident_token: IDENT@743..744 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, - COMMA@746..748 "," [] [Whitespace(" ")], + COMMA@744..746 "," [] [Whitespace(" ")], TsTypeParameter { modifier: TsTypeParameterModifier { in_token: missing (optional), - out_token: OUT_KW@748..752 "out" [] [Whitespace(" ")], + out_token: OUT_KW@746..750 "out" [] [Whitespace(" ")], }, name: TsTypeParameterName { - ident_token: IDENT@752..753 "T" [] [], + ident_token: IDENT@750..751 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@753..754 ">" [] [], + r_angle_token: R_ANGLE@751..752 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@754..755 "(" [] [], + l_paren_token: L_PAREN@752..753 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@755..757 ")" [] [Whitespace(" ")], + r_paren_token: R_PAREN@753..755 ")" [] [Whitespace(" ")], }, - fat_arrow_token: FAT_ARROW@757..760 "=>" [] [Whitespace(" ")], + fat_arrow_token: FAT_ARROW@755..758 "=>" [] [Whitespace(" ")], return_type: TsObjectType { - l_curly_token: L_CURLY@760..761 "{" [] [], + l_curly_token: L_CURLY@758..759 "{" [] [], members: TsTypeMemberList [], - r_curly_token: R_CURLY@761..762 "}" [] [], + r_curly_token: R_CURLY@759..760 "}" [] [], }, }, }, @@ -1240,202 +1240,202 @@ JsModule { }, ], }, - semicolon_token: SEMICOLON@762..763 ";" [] [], + semicolon_token: SEMICOLON@760..761 ";" [] [], }, JsVariableStatement { declaration: JsVariableDeclaration { - kind: LET_KW@763..769 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + kind: LET_KW@761..767 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], declarators: JsVariableDeclaratorList [ JsVariableDeclarator { id: JsIdentifierBinding { - name_token: IDENT@769..770 "x" [] [], + name_token: IDENT@767..768 "x" [] [], }, variable_annotation: TsTypeAnnotation { - colon_token: COLON@770..772 ":" [] [Whitespace(" ")], + colon_token: COLON@768..770 ":" [] [Whitespace(" ")], ty: TsObjectType { - l_curly_token: L_CURLY@772..774 "{" [] [Whitespace(" ")], + l_curly_token: L_CURLY@770..772 "{" [] [Whitespace(" ")], members: TsTypeMemberList [ TsMethodSignatureTypeMember { name: JsLiteralMemberName { - value: IDENT@774..775 "y" [] [], + value: IDENT@772..773 "y" [] [], }, optional_token: missing (optional), type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@775..776 "<" [] [], + l_angle_token: L_ANGLE@773..774 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { - in_token: IN_KW@776..779 "in" [] [Whitespace(" ")], + in_token: IN_KW@774..777 "in" [] [Whitespace(" ")], out_token: missing (optional), }, name: TsTypeParameterName { - ident_token: IDENT@779..780 "T" [] [], + ident_token: IDENT@777..778 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@780..781 ">" [] [], + r_angle_token: R_ANGLE@778..779 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@781..782 "(" [] [], + l_paren_token: L_PAREN@779..780 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@782..783 ")" [] [], + r_paren_token: R_PAREN@780..781 ")" [] [], }, return_type_annotation: TsReturnTypeAnnotation { - colon_token: COLON@783..785 ":" [] [Whitespace(" ")], + colon_token: COLON@781..783 ":" [] [Whitespace(" ")], ty: TsAnyType { - any_token: ANY_KW@785..789 "any" [] [Whitespace(" ")], + any_token: ANY_KW@783..787 "any" [] [Whitespace(" ")], }, }, separator_token: missing (optional), }, ], - r_curly_token: R_CURLY@789..790 "}" [] [], + r_curly_token: R_CURLY@787..788 "}" [] [], }, }, initializer: missing (optional), }, ], }, - semicolon_token: SEMICOLON@790..791 ";" [] [], + semicolon_token: SEMICOLON@788..789 ";" [] [], }, JsVariableStatement { declaration: JsVariableDeclaration { - kind: LET_KW@791..797 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + kind: LET_KW@789..795 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], declarators: JsVariableDeclaratorList [ JsVariableDeclarator { id: JsIdentifierBinding { - name_token: IDENT@797..798 "x" [] [], + name_token: IDENT@795..796 "x" [] [], }, variable_annotation: TsTypeAnnotation { - colon_token: COLON@798..800 ":" [] [Whitespace(" ")], + colon_token: COLON@796..798 ":" [] [Whitespace(" ")], ty: TsObjectType { - l_curly_token: L_CURLY@800..802 "{" [] [Whitespace(" ")], + l_curly_token: L_CURLY@798..800 "{" [] [Whitespace(" ")], members: TsTypeMemberList [ TsMethodSignatureTypeMember { name: JsLiteralMemberName { - value: IDENT@802..803 "y" [] [], + value: IDENT@800..801 "y" [] [], }, optional_token: missing (optional), type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@803..804 "<" [] [], + l_angle_token: L_ANGLE@801..802 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { in_token: missing (optional), - out_token: OUT_KW@804..808 "out" [] [Whitespace(" ")], + out_token: OUT_KW@802..806 "out" [] [Whitespace(" ")], }, name: TsTypeParameterName { - ident_token: IDENT@808..809 "T" [] [], + ident_token: IDENT@806..807 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@809..810 ">" [] [], + r_angle_token: R_ANGLE@807..808 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@810..811 "(" [] [], + l_paren_token: L_PAREN@808..809 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@811..812 ")" [] [], + r_paren_token: R_PAREN@809..810 ")" [] [], }, return_type_annotation: TsReturnTypeAnnotation { - colon_token: COLON@812..814 ":" [] [Whitespace(" ")], + colon_token: COLON@810..812 ":" [] [Whitespace(" ")], ty: TsAnyType { - any_token: ANY_KW@814..818 "any" [] [Whitespace(" ")], + any_token: ANY_KW@812..816 "any" [] [Whitespace(" ")], }, }, separator_token: missing (optional), }, ], - r_curly_token: R_CURLY@818..819 "}" [] [], + r_curly_token: R_CURLY@816..817 "}" [] [], }, }, initializer: missing (optional), }, ], }, - semicolon_token: SEMICOLON@819..820 ";" [] [], + semicolon_token: SEMICOLON@817..818 ";" [] [], }, JsVariableStatement { declaration: JsVariableDeclaration { - kind: LET_KW@820..826 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + kind: LET_KW@818..824 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], declarators: JsVariableDeclaratorList [ JsVariableDeclarator { id: JsIdentifierBinding { - name_token: IDENT@826..827 "x" [] [], + name_token: IDENT@824..825 "x" [] [], }, variable_annotation: TsTypeAnnotation { - colon_token: COLON@827..829 ":" [] [Whitespace(" ")], + colon_token: COLON@825..827 ":" [] [Whitespace(" ")], ty: TsObjectType { - l_curly_token: L_CURLY@829..831 "{" [] [Whitespace(" ")], + l_curly_token: L_CURLY@827..829 "{" [] [Whitespace(" ")], members: TsTypeMemberList [ TsMethodSignatureTypeMember { name: JsLiteralMemberName { - value: IDENT@831..832 "y" [] [], + value: IDENT@829..830 "y" [] [], }, optional_token: missing (optional), type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@832..833 "<" [] [], + l_angle_token: L_ANGLE@830..831 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { - in_token: IN_KW@833..836 "in" [] [Whitespace(" ")], + in_token: IN_KW@831..834 "in" [] [Whitespace(" ")], out_token: missing (optional), }, name: TsTypeParameterName { - ident_token: IDENT@836..837 "T" [] [], + ident_token: IDENT@834..835 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, - COMMA@837..839 "," [] [Whitespace(" ")], + COMMA@835..837 "," [] [Whitespace(" ")], TsTypeParameter { modifier: TsTypeParameterModifier { in_token: missing (optional), - out_token: OUT_KW@839..843 "out" [] [Whitespace(" ")], + out_token: OUT_KW@837..841 "out" [] [Whitespace(" ")], }, name: TsTypeParameterName { - ident_token: IDENT@843..844 "T" [] [], + ident_token: IDENT@841..842 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@844..845 ">" [] [], + r_angle_token: R_ANGLE@842..843 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@845..846 "(" [] [], + l_paren_token: L_PAREN@843..844 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@846..847 ")" [] [], + r_paren_token: R_PAREN@844..845 ")" [] [], }, return_type_annotation: TsReturnTypeAnnotation { - colon_token: COLON@847..849 ":" [] [Whitespace(" ")], + colon_token: COLON@845..847 ":" [] [Whitespace(" ")], ty: TsAnyType { - any_token: ANY_KW@849..853 "any" [] [Whitespace(" ")], + any_token: ANY_KW@847..851 "any" [] [Whitespace(" ")], }, }, separator_token: missing (optional), }, ], - r_curly_token: R_CURLY@853..854 "}" [] [], + r_curly_token: R_CURLY@851..852 "}" [] [], }, }, initializer: missing (optional), }, ], }, - semicolon_token: SEMICOLON@854..855 ";" [] [], + semicolon_token: SEMICOLON@852..853 ";" [] [], }, ], - eof_token: EOF@855..856 "" [Newline("\n")] [], + eof_token: EOF@853..854 "" [Newline("\n")] [], } -0: JS_MODULE@0..856 +0: JS_MODULE@0..854 0: (empty) 1: JS_DIRECTIVE_LIST@0..0 - 2: JS_MODULE_ITEM_LIST@0..855 + 2: JS_MODULE_ITEM_LIST@0..853 0: JS_EXPORT@0..39 0: EXPORT_KW@0..8 "export" [Whitespace("\t")] [Whitespace(" ")] 1: JS_EXPORT_DEFAULT_DECLARATION_CLAUSE@8..39 @@ -1499,9 +1499,9 @@ JsModule { 1: JS_DIRECTIVE_LIST@71..71 2: JS_STATEMENT_LIST@71..71 3: R_CURLY@71..72 "}" [] [] - 2: JS_EXPORT@72..106 + 2: JS_EXPORT@72..105 0: EXPORT_KW@72..81 "export" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: JS_FUNCTION_DECLARATION@81..106 + 1: JS_FUNCTION_DECLARATION@81..105 0: (empty) 1: FUNCTION_KW@81..90 "function" [] [Whitespace(" ")] 2: (empty) @@ -1524,936 +1524,936 @@ JsModule { 1: JS_PARAMETER_LIST@101..101 2: R_PAREN@101..103 ")" [] [Whitespace(" ")] 6: (empty) - 7: JS_FUNCTION_BODY@103..106 + 7: JS_FUNCTION_BODY@103..105 0: L_CURLY@103..104 "{" [] [] 1: JS_DIRECTIVE_LIST@104..104 2: JS_STATEMENT_LIST@104..104 - 3: R_CURLY@104..106 "}" [] [Whitespace(" ")] - 3: JS_EXPORT@106..141 - 0: EXPORT_KW@106..115 "export" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: JS_FUNCTION_DECLARATION@115..141 + 3: R_CURLY@104..105 "}" [] [] + 3: JS_EXPORT@105..139 + 0: EXPORT_KW@105..114 "export" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: JS_FUNCTION_DECLARATION@114..139 0: (empty) - 1: FUNCTION_KW@115..124 "function" [] [Whitespace(" ")] + 1: FUNCTION_KW@114..123 "function" [] [Whitespace(" ")] 2: (empty) - 3: JS_IDENTIFIER_BINDING@124..128 - 0: IDENT@124..128 "foo2" [] [] - 4: TS_TYPE_PARAMETERS@128..135 - 0: L_ANGLE@128..129 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@129..134 - 0: TS_TYPE_PARAMETER@129..134 - 0: TS_TYPE_PARAMETER_MODIFIER@129..133 + 3: JS_IDENTIFIER_BINDING@123..127 + 0: IDENT@123..127 "foo2" [] [] + 4: TS_TYPE_PARAMETERS@127..134 + 0: L_ANGLE@127..128 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@128..133 + 0: TS_TYPE_PARAMETER@128..133 + 0: TS_TYPE_PARAMETER_MODIFIER@128..132 0: (empty) - 1: OUT_KW@129..133 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@133..134 - 0: IDENT@133..134 "T" [] [] + 1: OUT_KW@128..132 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@132..133 + 0: IDENT@132..133 "T" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@134..135 ">" [] [] - 5: JS_PARAMETERS@135..138 - 0: L_PAREN@135..136 "(" [] [] - 1: JS_PARAMETER_LIST@136..136 - 2: R_PAREN@136..138 ")" [] [Whitespace(" ")] + 2: R_ANGLE@133..134 ">" [] [] + 5: JS_PARAMETERS@134..137 + 0: L_PAREN@134..135 "(" [] [] + 1: JS_PARAMETER_LIST@135..135 + 2: R_PAREN@135..137 ")" [] [Whitespace(" ")] 6: (empty) - 7: JS_FUNCTION_BODY@138..141 - 0: L_CURLY@138..139 "{" [] [] - 1: JS_DIRECTIVE_LIST@139..139 - 2: JS_STATEMENT_LIST@139..139 - 3: R_CURLY@139..141 "}" [] [Whitespace(" ")] - 4: JS_VARIABLE_STATEMENT@141..161 - 0: JS_VARIABLE_DECLARATION@141..161 - 0: LET_KW@141..147 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: JS_VARIABLE_DECLARATOR_LIST@147..161 - 0: JS_VARIABLE_DECLARATOR@147..161 - 0: JS_IDENTIFIER_BINDING@147..150 - 0: IDENT@147..150 "foo" [] [] - 1: TS_TYPE_ANNOTATION@150..161 - 0: COLON@150..152 ":" [] [Whitespace(" ")] - 1: TS_REFERENCE_TYPE@152..161 - 0: JS_REFERENCE_IDENTIFIER@152..155 - 0: IDENT@152..155 "Foo" [] [] - 1: TS_TYPE_ARGUMENTS@155..161 - 0: L_ANGLE@155..156 "<" [] [] - 1: TS_TYPE_ARGUMENT_LIST@156..160 - 0: TS_REFERENCE_TYPE@156..159 - 0: JS_REFERENCE_IDENTIFIER@156..159 - 0: IDENT@156..159 "in" [] [Whitespace(" ")] + 7: JS_FUNCTION_BODY@137..139 + 0: L_CURLY@137..138 "{" [] [] + 1: JS_DIRECTIVE_LIST@138..138 + 2: JS_STATEMENT_LIST@138..138 + 3: R_CURLY@138..139 "}" [] [] + 4: JS_VARIABLE_STATEMENT@139..159 + 0: JS_VARIABLE_DECLARATION@139..159 + 0: LET_KW@139..145 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATOR_LIST@145..159 + 0: JS_VARIABLE_DECLARATOR@145..159 + 0: JS_IDENTIFIER_BINDING@145..148 + 0: IDENT@145..148 "foo" [] [] + 1: TS_TYPE_ANNOTATION@148..159 + 0: COLON@148..150 ":" [] [Whitespace(" ")] + 1: TS_REFERENCE_TYPE@150..159 + 0: JS_REFERENCE_IDENTIFIER@150..153 + 0: IDENT@150..153 "Foo" [] [] + 1: TS_TYPE_ARGUMENTS@153..159 + 0: L_ANGLE@153..154 "<" [] [] + 1: TS_TYPE_ARGUMENT_LIST@154..158 + 0: TS_REFERENCE_TYPE@154..157 + 0: JS_REFERENCE_IDENTIFIER@154..157 + 0: IDENT@154..157 "in" [] [Whitespace(" ")] 1: (empty) 1: (empty) - 2: TS_REFERENCE_TYPE@159..160 - 0: JS_REFERENCE_IDENTIFIER@159..160 - 0: IDENT@159..160 "T" [] [] + 2: TS_REFERENCE_TYPE@157..158 + 0: JS_REFERENCE_IDENTIFIER@157..158 + 0: IDENT@157..158 "T" [] [] 1: (empty) - 2: R_ANGLE@160..161 ">" [] [] + 2: R_ANGLE@158..159 ">" [] [] 2: (empty) 1: (empty) - 5: JS_VARIABLE_STATEMENT@161..182 - 0: JS_VARIABLE_DECLARATION@161..182 - 0: LET_KW@161..167 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: JS_VARIABLE_DECLARATOR_LIST@167..182 - 0: JS_VARIABLE_DECLARATOR@167..182 - 0: JS_IDENTIFIER_BINDING@167..170 - 0: IDENT@167..170 "foo" [] [] - 1: TS_TYPE_ANNOTATION@170..182 - 0: COLON@170..172 ":" [] [Whitespace(" ")] - 1: TS_REFERENCE_TYPE@172..182 - 0: JS_REFERENCE_IDENTIFIER@172..175 - 0: IDENT@172..175 "Foo" [] [] - 1: TS_TYPE_ARGUMENTS@175..182 - 0: L_ANGLE@175..176 "<" [] [] - 1: TS_TYPE_ARGUMENT_LIST@176..181 - 0: TS_REFERENCE_TYPE@176..180 - 0: JS_REFERENCE_IDENTIFIER@176..180 - 0: IDENT@176..180 "out" [] [Whitespace(" ")] + 5: JS_VARIABLE_STATEMENT@159..180 + 0: JS_VARIABLE_DECLARATION@159..180 + 0: LET_KW@159..165 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATOR_LIST@165..180 + 0: JS_VARIABLE_DECLARATOR@165..180 + 0: JS_IDENTIFIER_BINDING@165..168 + 0: IDENT@165..168 "foo" [] [] + 1: TS_TYPE_ANNOTATION@168..180 + 0: COLON@168..170 ":" [] [Whitespace(" ")] + 1: TS_REFERENCE_TYPE@170..180 + 0: JS_REFERENCE_IDENTIFIER@170..173 + 0: IDENT@170..173 "Foo" [] [] + 1: TS_TYPE_ARGUMENTS@173..180 + 0: L_ANGLE@173..174 "<" [] [] + 1: TS_TYPE_ARGUMENT_LIST@174..179 + 0: TS_REFERENCE_TYPE@174..178 + 0: JS_REFERENCE_IDENTIFIER@174..178 + 0: IDENT@174..178 "out" [] [Whitespace(" ")] 1: (empty) 1: (empty) - 2: TS_REFERENCE_TYPE@180..181 - 0: JS_REFERENCE_IDENTIFIER@180..181 - 0: IDENT@180..181 "T" [] [] + 2: TS_REFERENCE_TYPE@178..179 + 0: JS_REFERENCE_IDENTIFIER@178..179 + 0: IDENT@178..179 "T" [] [] 1: (empty) - 2: R_ANGLE@181..182 ">" [] [] + 2: R_ANGLE@179..180 ">" [] [] 2: (empty) 1: (empty) - 6: TS_DECLARE_STATEMENT@182..212 - 0: DECLARE_KW@182..192 "declare" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: TS_DECLARE_FUNCTION_DECLARATION@192..212 + 6: TS_DECLARE_STATEMENT@180..210 + 0: DECLARE_KW@180..190 "declare" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: TS_DECLARE_FUNCTION_DECLARATION@190..210 0: (empty) - 1: FUNCTION_KW@192..201 "function" [] [Whitespace(" ")] - 2: JS_IDENTIFIER_BINDING@201..204 - 0: IDENT@201..204 "foo" [] [] - 3: TS_TYPE_PARAMETERS@204..210 - 0: L_ANGLE@204..205 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@205..209 - 0: TS_TYPE_PARAMETER@205..209 - 0: TS_TYPE_PARAMETER_MODIFIER@205..208 - 0: IN_KW@205..208 "in" [] [Whitespace(" ")] + 1: FUNCTION_KW@190..199 "function" [] [Whitespace(" ")] + 2: JS_IDENTIFIER_BINDING@199..202 + 0: IDENT@199..202 "foo" [] [] + 3: TS_TYPE_PARAMETERS@202..208 + 0: L_ANGLE@202..203 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@203..207 + 0: TS_TYPE_PARAMETER@203..207 + 0: TS_TYPE_PARAMETER_MODIFIER@203..206 + 0: IN_KW@203..206 "in" [] [Whitespace(" ")] 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@208..209 - 0: IDENT@208..209 "T" [] [] + 1: TS_TYPE_PARAMETER_NAME@206..207 + 0: IDENT@206..207 "T" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@209..210 ">" [] [] - 4: JS_PARAMETERS@210..212 - 0: L_PAREN@210..211 "(" [] [] - 1: JS_PARAMETER_LIST@211..211 - 2: R_PAREN@211..212 ")" [] [] + 2: R_ANGLE@207..208 ">" [] [] + 4: JS_PARAMETERS@208..210 + 0: L_PAREN@208..209 "(" [] [] + 1: JS_PARAMETER_LIST@209..209 + 2: R_PAREN@209..210 ")" [] [] 5: (empty) 6: (empty) - 7: TS_DECLARE_STATEMENT@212..243 - 0: DECLARE_KW@212..222 "declare" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: TS_DECLARE_FUNCTION_DECLARATION@222..243 + 7: TS_DECLARE_STATEMENT@210..241 + 0: DECLARE_KW@210..220 "declare" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: TS_DECLARE_FUNCTION_DECLARATION@220..241 0: (empty) - 1: FUNCTION_KW@222..231 "function" [] [Whitespace(" ")] - 2: JS_IDENTIFIER_BINDING@231..234 - 0: IDENT@231..234 "foo" [] [] - 3: TS_TYPE_PARAMETERS@234..241 - 0: L_ANGLE@234..235 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@235..240 - 0: TS_TYPE_PARAMETER@235..240 - 0: TS_TYPE_PARAMETER_MODIFIER@235..239 + 1: FUNCTION_KW@220..229 "function" [] [Whitespace(" ")] + 2: JS_IDENTIFIER_BINDING@229..232 + 0: IDENT@229..232 "foo" [] [] + 3: TS_TYPE_PARAMETERS@232..239 + 0: L_ANGLE@232..233 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@233..238 + 0: TS_TYPE_PARAMETER@233..238 + 0: TS_TYPE_PARAMETER_MODIFIER@233..237 0: (empty) - 1: OUT_KW@235..239 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@239..240 - 0: IDENT@239..240 "T" [] [] + 1: OUT_KW@233..237 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@237..238 + 0: IDENT@237..238 "T" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@240..241 ">" [] [] - 4: JS_PARAMETERS@241..243 - 0: L_PAREN@241..242 "(" [] [] - 1: JS_PARAMETER_LIST@242..242 - 2: R_PAREN@242..243 ")" [] [] + 2: R_ANGLE@238..239 ">" [] [] + 4: JS_PARAMETERS@239..241 + 0: L_PAREN@239..240 "(" [] [] + 1: JS_PARAMETER_LIST@240..240 + 2: R_PAREN@240..241 ")" [] [] 5: (empty) 6: (empty) - 8: TS_DECLARE_STATEMENT@243..271 - 0: DECLARE_KW@243..253 "declare" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: JS_VARIABLE_DECLARATION_CLAUSE@253..271 - 0: JS_VARIABLE_DECLARATION@253..271 - 0: LET_KW@253..257 "let" [] [Whitespace(" ")] - 1: JS_VARIABLE_DECLARATOR_LIST@257..271 - 0: JS_VARIABLE_DECLARATOR@257..271 - 0: JS_IDENTIFIER_BINDING@257..260 - 0: IDENT@257..260 "foo" [] [] - 1: TS_TYPE_ANNOTATION@260..271 - 0: COLON@260..262 ":" [] [Whitespace(" ")] - 1: TS_REFERENCE_TYPE@262..271 - 0: JS_REFERENCE_IDENTIFIER@262..265 - 0: IDENT@262..265 "Foo" [] [] - 1: TS_TYPE_ARGUMENTS@265..271 - 0: L_ANGLE@265..266 "<" [] [] - 1: TS_TYPE_ARGUMENT_LIST@266..270 - 0: TS_REFERENCE_TYPE@266..269 - 0: JS_REFERENCE_IDENTIFIER@266..269 - 0: IDENT@266..269 "in" [] [Whitespace(" ")] + 8: TS_DECLARE_STATEMENT@241..269 + 0: DECLARE_KW@241..251 "declare" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATION_CLAUSE@251..269 + 0: JS_VARIABLE_DECLARATION@251..269 + 0: LET_KW@251..255 "let" [] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATOR_LIST@255..269 + 0: JS_VARIABLE_DECLARATOR@255..269 + 0: JS_IDENTIFIER_BINDING@255..258 + 0: IDENT@255..258 "foo" [] [] + 1: TS_TYPE_ANNOTATION@258..269 + 0: COLON@258..260 ":" [] [Whitespace(" ")] + 1: TS_REFERENCE_TYPE@260..269 + 0: JS_REFERENCE_IDENTIFIER@260..263 + 0: IDENT@260..263 "Foo" [] [] + 1: TS_TYPE_ARGUMENTS@263..269 + 0: L_ANGLE@263..264 "<" [] [] + 1: TS_TYPE_ARGUMENT_LIST@264..268 + 0: TS_REFERENCE_TYPE@264..267 + 0: JS_REFERENCE_IDENTIFIER@264..267 + 0: IDENT@264..267 "in" [] [Whitespace(" ")] 1: (empty) 1: (empty) - 2: TS_REFERENCE_TYPE@269..270 - 0: JS_REFERENCE_IDENTIFIER@269..270 - 0: IDENT@269..270 "T" [] [] + 2: TS_REFERENCE_TYPE@267..268 + 0: JS_REFERENCE_IDENTIFIER@267..268 + 0: IDENT@267..268 "T" [] [] 1: (empty) - 2: R_ANGLE@270..271 ">" [] [] + 2: R_ANGLE@268..269 ">" [] [] 2: (empty) 1: (empty) - 9: TS_DECLARE_STATEMENT@271..300 - 0: DECLARE_KW@271..281 "declare" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: JS_VARIABLE_DECLARATION_CLAUSE@281..300 - 0: JS_VARIABLE_DECLARATION@281..300 - 0: LET_KW@281..285 "let" [] [Whitespace(" ")] - 1: JS_VARIABLE_DECLARATOR_LIST@285..300 - 0: JS_VARIABLE_DECLARATOR@285..300 - 0: JS_IDENTIFIER_BINDING@285..288 - 0: IDENT@285..288 "foo" [] [] - 1: TS_TYPE_ANNOTATION@288..300 - 0: COLON@288..290 ":" [] [Whitespace(" ")] - 1: TS_REFERENCE_TYPE@290..300 - 0: JS_REFERENCE_IDENTIFIER@290..293 - 0: IDENT@290..293 "Foo" [] [] - 1: TS_TYPE_ARGUMENTS@293..300 - 0: L_ANGLE@293..294 "<" [] [] - 1: TS_TYPE_ARGUMENT_LIST@294..299 - 0: TS_REFERENCE_TYPE@294..298 - 0: JS_REFERENCE_IDENTIFIER@294..298 - 0: IDENT@294..298 "out" [] [Whitespace(" ")] + 9: TS_DECLARE_STATEMENT@269..298 + 0: DECLARE_KW@269..279 "declare" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATION_CLAUSE@279..298 + 0: JS_VARIABLE_DECLARATION@279..298 + 0: LET_KW@279..283 "let" [] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATOR_LIST@283..298 + 0: JS_VARIABLE_DECLARATOR@283..298 + 0: JS_IDENTIFIER_BINDING@283..286 + 0: IDENT@283..286 "foo" [] [] + 1: TS_TYPE_ANNOTATION@286..298 + 0: COLON@286..288 ":" [] [Whitespace(" ")] + 1: TS_REFERENCE_TYPE@288..298 + 0: JS_REFERENCE_IDENTIFIER@288..291 + 0: IDENT@288..291 "Foo" [] [] + 1: TS_TYPE_ARGUMENTS@291..298 + 0: L_ANGLE@291..292 "<" [] [] + 1: TS_TYPE_ARGUMENT_LIST@292..297 + 0: TS_REFERENCE_TYPE@292..296 + 0: JS_REFERENCE_IDENTIFIER@292..296 + 0: IDENT@292..296 "out" [] [Whitespace(" ")] 1: (empty) 1: (empty) - 2: TS_REFERENCE_TYPE@298..299 - 0: JS_REFERENCE_IDENTIFIER@298..299 - 0: IDENT@298..299 "T" [] [] + 2: TS_REFERENCE_TYPE@296..297 + 0: JS_REFERENCE_IDENTIFIER@296..297 + 0: IDENT@296..297 "T" [] [] 1: (empty) - 2: R_ANGLE@299..300 ">" [] [] + 2: R_ANGLE@297..298 ">" [] [] 2: (empty) 1: (empty) - 10: JS_EXPRESSION_STATEMENT@300..323 - 0: JS_ASSIGNMENT_EXPRESSION@300..323 - 0: JS_IDENTIFIER_ASSIGNMENT@300..306 - 0: IDENT@300..306 "Foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: EQ@306..308 "=" [] [Whitespace(" ")] - 2: JS_CLASS_EXPRESSION@308..323 - 0: CLASS_KW@308..314 "class" [] [Whitespace(" ")] + 10: JS_EXPRESSION_STATEMENT@298..321 + 0: JS_ASSIGNMENT_EXPRESSION@298..321 + 0: JS_IDENTIFIER_ASSIGNMENT@298..304 + 0: IDENT@298..304 "Foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: EQ@304..306 "=" [] [Whitespace(" ")] + 2: JS_CLASS_EXPRESSION@306..321 + 0: CLASS_KW@306..312 "class" [] [Whitespace(" ")] 1: (empty) - 2: TS_TYPE_PARAMETERS@314..321 - 0: L_ANGLE@314..315 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@315..319 - 0: TS_TYPE_PARAMETER@315..319 - 0: TS_TYPE_PARAMETER_MODIFIER@315..318 - 0: IN_KW@315..318 "in" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETERS@312..319 + 0: L_ANGLE@312..313 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@313..317 + 0: TS_TYPE_PARAMETER@313..317 + 0: TS_TYPE_PARAMETER_MODIFIER@313..316 + 0: IN_KW@313..316 "in" [] [Whitespace(" ")] 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@318..319 - 0: IDENT@318..319 "T" [] [] + 1: TS_TYPE_PARAMETER_NAME@316..317 + 0: IDENT@316..317 "T" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@319..321 ">" [] [Whitespace(" ")] + 2: R_ANGLE@317..319 ">" [] [Whitespace(" ")] 3: (empty) 4: (empty) - 5: L_CURLY@321..322 "{" [] [] - 6: JS_CLASS_MEMBER_LIST@322..322 - 7: R_CURLY@322..323 "}" [] [] + 5: L_CURLY@319..320 "{" [] [] + 6: JS_CLASS_MEMBER_LIST@320..320 + 7: R_CURLY@320..321 "}" [] [] 1: (empty) - 11: JS_EXPRESSION_STATEMENT@323..347 - 0: JS_ASSIGNMENT_EXPRESSION@323..347 - 0: JS_IDENTIFIER_ASSIGNMENT@323..329 - 0: IDENT@323..329 "Foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: EQ@329..331 "=" [] [Whitespace(" ")] - 2: JS_CLASS_EXPRESSION@331..347 - 0: CLASS_KW@331..337 "class" [] [Whitespace(" ")] + 11: JS_EXPRESSION_STATEMENT@321..345 + 0: JS_ASSIGNMENT_EXPRESSION@321..345 + 0: JS_IDENTIFIER_ASSIGNMENT@321..327 + 0: IDENT@321..327 "Foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: EQ@327..329 "=" [] [Whitespace(" ")] + 2: JS_CLASS_EXPRESSION@329..345 + 0: CLASS_KW@329..335 "class" [] [Whitespace(" ")] 1: (empty) - 2: TS_TYPE_PARAMETERS@337..345 - 0: L_ANGLE@337..338 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@338..343 - 0: TS_TYPE_PARAMETER@338..343 - 0: TS_TYPE_PARAMETER_MODIFIER@338..342 + 2: TS_TYPE_PARAMETERS@335..343 + 0: L_ANGLE@335..336 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@336..341 + 0: TS_TYPE_PARAMETER@336..341 + 0: TS_TYPE_PARAMETER_MODIFIER@336..340 0: (empty) - 1: OUT_KW@338..342 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@342..343 - 0: IDENT@342..343 "T" [] [] + 1: OUT_KW@336..340 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@340..341 + 0: IDENT@340..341 "T" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@343..345 ">" [] [Whitespace(" ")] + 2: R_ANGLE@341..343 ">" [] [Whitespace(" ")] 3: (empty) 4: (empty) - 5: L_CURLY@345..346 "{" [] [] - 6: JS_CLASS_MEMBER_LIST@346..346 - 7: R_CURLY@346..347 "}" [] [] + 5: L_CURLY@343..344 "{" [] [] + 6: JS_CLASS_MEMBER_LIST@344..344 + 7: R_CURLY@344..345 "}" [] [] 1: (empty) - 12: JS_EXPRESSION_STATEMENT@347..375 - 0: JS_ASSIGNMENT_EXPRESSION@347..375 - 0: JS_IDENTIFIER_ASSIGNMENT@347..353 - 0: IDENT@347..353 "foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: EQ@353..355 "=" [] [Whitespace(" ")] - 2: JS_FUNCTION_EXPRESSION@355..375 + 12: JS_EXPRESSION_STATEMENT@345..373 + 0: JS_ASSIGNMENT_EXPRESSION@345..373 + 0: JS_IDENTIFIER_ASSIGNMENT@345..351 + 0: IDENT@345..351 "foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: EQ@351..353 "=" [] [Whitespace(" ")] + 2: JS_FUNCTION_EXPRESSION@353..373 0: (empty) - 1: FUNCTION_KW@355..364 "function" [] [Whitespace(" ")] + 1: FUNCTION_KW@353..362 "function" [] [Whitespace(" ")] 2: (empty) 3: (empty) - 4: TS_TYPE_PARAMETERS@364..370 - 0: L_ANGLE@364..365 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@365..369 - 0: TS_TYPE_PARAMETER@365..369 - 0: TS_TYPE_PARAMETER_MODIFIER@365..368 - 0: IN_KW@365..368 "in" [] [Whitespace(" ")] + 4: TS_TYPE_PARAMETERS@362..368 + 0: L_ANGLE@362..363 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@363..367 + 0: TS_TYPE_PARAMETER@363..367 + 0: TS_TYPE_PARAMETER_MODIFIER@363..366 + 0: IN_KW@363..366 "in" [] [Whitespace(" ")] 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@368..369 - 0: IDENT@368..369 "T" [] [] + 1: TS_TYPE_PARAMETER_NAME@366..367 + 0: IDENT@366..367 "T" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@369..370 ">" [] [] - 5: JS_PARAMETERS@370..373 - 0: L_PAREN@370..371 "(" [] [] - 1: JS_PARAMETER_LIST@371..371 - 2: R_PAREN@371..373 ")" [] [Whitespace(" ")] + 2: R_ANGLE@367..368 ">" [] [] + 5: JS_PARAMETERS@368..371 + 0: L_PAREN@368..369 "(" [] [] + 1: JS_PARAMETER_LIST@369..369 + 2: R_PAREN@369..371 ")" [] [Whitespace(" ")] 6: (empty) - 7: JS_FUNCTION_BODY@373..375 - 0: L_CURLY@373..374 "{" [] [] - 1: JS_DIRECTIVE_LIST@374..374 - 2: JS_STATEMENT_LIST@374..374 - 3: R_CURLY@374..375 "}" [] [] + 7: JS_FUNCTION_BODY@371..373 + 0: L_CURLY@371..372 "{" [] [] + 1: JS_DIRECTIVE_LIST@372..372 + 2: JS_STATEMENT_LIST@372..372 + 3: R_CURLY@372..373 "}" [] [] 1: (empty) - 13: JS_EXPRESSION_STATEMENT@375..404 - 0: JS_ASSIGNMENT_EXPRESSION@375..404 - 0: JS_IDENTIFIER_ASSIGNMENT@375..381 - 0: IDENT@375..381 "foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: EQ@381..383 "=" [] [Whitespace(" ")] - 2: JS_FUNCTION_EXPRESSION@383..404 + 13: JS_EXPRESSION_STATEMENT@373..402 + 0: JS_ASSIGNMENT_EXPRESSION@373..402 + 0: JS_IDENTIFIER_ASSIGNMENT@373..379 + 0: IDENT@373..379 "foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: EQ@379..381 "=" [] [Whitespace(" ")] + 2: JS_FUNCTION_EXPRESSION@381..402 0: (empty) - 1: FUNCTION_KW@383..392 "function" [] [Whitespace(" ")] + 1: FUNCTION_KW@381..390 "function" [] [Whitespace(" ")] 2: (empty) 3: (empty) - 4: TS_TYPE_PARAMETERS@392..399 - 0: L_ANGLE@392..393 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@393..398 - 0: TS_TYPE_PARAMETER@393..398 - 0: TS_TYPE_PARAMETER_MODIFIER@393..397 + 4: TS_TYPE_PARAMETERS@390..397 + 0: L_ANGLE@390..391 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@391..396 + 0: TS_TYPE_PARAMETER@391..396 + 0: TS_TYPE_PARAMETER_MODIFIER@391..395 0: (empty) - 1: OUT_KW@393..397 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@397..398 - 0: IDENT@397..398 "T" [] [] + 1: OUT_KW@391..395 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@395..396 + 0: IDENT@395..396 "T" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@398..399 ">" [] [] - 5: JS_PARAMETERS@399..402 - 0: L_PAREN@399..400 "(" [] [] - 1: JS_PARAMETER_LIST@400..400 - 2: R_PAREN@400..402 ")" [] [Whitespace(" ")] + 2: R_ANGLE@396..397 ">" [] [] + 5: JS_PARAMETERS@397..400 + 0: L_PAREN@397..398 "(" [] [] + 1: JS_PARAMETER_LIST@398..398 + 2: R_PAREN@398..400 ")" [] [Whitespace(" ")] 6: (empty) - 7: JS_FUNCTION_BODY@402..404 - 0: L_CURLY@402..403 "{" [] [] - 1: JS_DIRECTIVE_LIST@403..403 - 2: JS_STATEMENT_LIST@403..403 - 3: R_CURLY@403..404 "}" [] [] + 7: JS_FUNCTION_BODY@400..402 + 0: L_CURLY@400..401 "{" [] [] + 1: JS_DIRECTIVE_LIST@401..401 + 2: JS_STATEMENT_LIST@401..401 + 3: R_CURLY@401..402 "}" [] [] 1: (empty) - 14: JS_CLASS_DECLARATION@404..437 + 14: JS_CLASS_DECLARATION@402..435 0: (empty) - 1: CLASS_KW@404..412 "class" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 2: JS_IDENTIFIER_BINDING@412..416 - 0: IDENT@412..416 "Foo" [] [Whitespace(" ")] + 1: CLASS_KW@402..410 "class" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 2: JS_IDENTIFIER_BINDING@410..414 + 0: IDENT@410..414 "Foo" [] [Whitespace(" ")] 3: (empty) 4: (empty) 5: (empty) - 6: L_CURLY@416..418 "{" [] [Whitespace(" ")] - 7: JS_CLASS_MEMBER_LIST@418..436 - 0: JS_METHOD_CLASS_MEMBER@418..436 - 0: JS_METHOD_MODIFIER_LIST@418..418 + 6: L_CURLY@414..416 "{" [] [Whitespace(" ")] + 7: JS_CLASS_MEMBER_LIST@416..434 + 0: JS_METHOD_CLASS_MEMBER@416..434 + 0: JS_METHOD_MODIFIER_LIST@416..416 1: (empty) 2: (empty) - 3: JS_LITERAL_MEMBER_NAME@418..421 - 0: IDENT@418..421 "foo" [] [] + 3: JS_LITERAL_MEMBER_NAME@416..419 + 0: IDENT@416..419 "foo" [] [] 4: (empty) - 5: TS_TYPE_PARAMETERS@421..427 - 0: L_ANGLE@421..422 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@422..426 - 0: TS_TYPE_PARAMETER@422..426 - 0: TS_TYPE_PARAMETER_MODIFIER@422..425 - 0: IN_KW@422..425 "in" [] [Whitespace(" ")] + 5: TS_TYPE_PARAMETERS@419..425 + 0: L_ANGLE@419..420 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@420..424 + 0: TS_TYPE_PARAMETER@420..424 + 0: TS_TYPE_PARAMETER_MODIFIER@420..423 + 0: IN_KW@420..423 "in" [] [Whitespace(" ")] 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@425..426 - 0: IDENT@425..426 "T" [] [] + 1: TS_TYPE_PARAMETER_NAME@423..424 + 0: IDENT@423..424 "T" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@426..427 ">" [] [] - 6: JS_PARAMETERS@427..429 - 0: L_PAREN@427..428 "(" [] [] - 1: JS_PARAMETER_LIST@428..428 - 2: R_PAREN@428..429 ")" [] [] - 7: TS_RETURN_TYPE_ANNOTATION@429..433 - 0: COLON@429..431 ":" [] [Whitespace(" ")] - 1: TS_REFERENCE_TYPE@431..433 - 0: JS_REFERENCE_IDENTIFIER@431..433 - 0: IDENT@431..433 "T" [] [Whitespace(" ")] + 2: R_ANGLE@424..425 ">" [] [] + 6: JS_PARAMETERS@425..427 + 0: L_PAREN@425..426 "(" [] [] + 1: JS_PARAMETER_LIST@426..426 + 2: R_PAREN@426..427 ")" [] [] + 7: TS_RETURN_TYPE_ANNOTATION@427..431 + 0: COLON@427..429 ":" [] [Whitespace(" ")] + 1: TS_REFERENCE_TYPE@429..431 + 0: JS_REFERENCE_IDENTIFIER@429..431 + 0: IDENT@429..431 "T" [] [Whitespace(" ")] 1: (empty) - 8: JS_FUNCTION_BODY@433..436 - 0: L_CURLY@433..434 "{" [] [] - 1: JS_DIRECTIVE_LIST@434..434 - 2: JS_STATEMENT_LIST@434..434 - 3: R_CURLY@434..436 "}" [] [Whitespace(" ")] - 8: R_CURLY@436..437 "}" [] [] - 15: JS_CLASS_DECLARATION@437..471 + 8: JS_FUNCTION_BODY@431..434 + 0: L_CURLY@431..432 "{" [] [] + 1: JS_DIRECTIVE_LIST@432..432 + 2: JS_STATEMENT_LIST@432..432 + 3: R_CURLY@432..434 "}" [] [Whitespace(" ")] + 8: R_CURLY@434..435 "}" [] [] + 15: JS_CLASS_DECLARATION@435..469 0: (empty) - 1: CLASS_KW@437..445 "class" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 2: JS_IDENTIFIER_BINDING@445..449 - 0: IDENT@445..449 "Foo" [] [Whitespace(" ")] + 1: CLASS_KW@435..443 "class" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 2: JS_IDENTIFIER_BINDING@443..447 + 0: IDENT@443..447 "Foo" [] [Whitespace(" ")] 3: (empty) 4: (empty) 5: (empty) - 6: L_CURLY@449..451 "{" [] [Whitespace(" ")] - 7: JS_CLASS_MEMBER_LIST@451..470 - 0: JS_METHOD_CLASS_MEMBER@451..470 - 0: JS_METHOD_MODIFIER_LIST@451..451 + 6: L_CURLY@447..449 "{" [] [Whitespace(" ")] + 7: JS_CLASS_MEMBER_LIST@449..468 + 0: JS_METHOD_CLASS_MEMBER@449..468 + 0: JS_METHOD_MODIFIER_LIST@449..449 1: (empty) 2: (empty) - 3: JS_LITERAL_MEMBER_NAME@451..454 - 0: IDENT@451..454 "foo" [] [] + 3: JS_LITERAL_MEMBER_NAME@449..452 + 0: IDENT@449..452 "foo" [] [] 4: (empty) - 5: TS_TYPE_PARAMETERS@454..461 - 0: L_ANGLE@454..455 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@455..460 - 0: TS_TYPE_PARAMETER@455..460 - 0: TS_TYPE_PARAMETER_MODIFIER@455..459 + 5: TS_TYPE_PARAMETERS@452..459 + 0: L_ANGLE@452..453 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@453..458 + 0: TS_TYPE_PARAMETER@453..458 + 0: TS_TYPE_PARAMETER_MODIFIER@453..457 0: (empty) - 1: OUT_KW@455..459 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@459..460 - 0: IDENT@459..460 "T" [] [] + 1: OUT_KW@453..457 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@457..458 + 0: IDENT@457..458 "T" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@460..461 ">" [] [] - 6: JS_PARAMETERS@461..463 - 0: L_PAREN@461..462 "(" [] [] - 1: JS_PARAMETER_LIST@462..462 - 2: R_PAREN@462..463 ")" [] [] - 7: TS_RETURN_TYPE_ANNOTATION@463..467 - 0: COLON@463..465 ":" [] [Whitespace(" ")] - 1: TS_REFERENCE_TYPE@465..467 - 0: JS_REFERENCE_IDENTIFIER@465..467 - 0: IDENT@465..467 "T" [] [Whitespace(" ")] + 2: R_ANGLE@458..459 ">" [] [] + 6: JS_PARAMETERS@459..461 + 0: L_PAREN@459..460 "(" [] [] + 1: JS_PARAMETER_LIST@460..460 + 2: R_PAREN@460..461 ")" [] [] + 7: TS_RETURN_TYPE_ANNOTATION@461..465 + 0: COLON@461..463 ":" [] [Whitespace(" ")] + 1: TS_REFERENCE_TYPE@463..465 + 0: JS_REFERENCE_IDENTIFIER@463..465 + 0: IDENT@463..465 "T" [] [Whitespace(" ")] 1: (empty) - 8: JS_FUNCTION_BODY@467..470 - 0: L_CURLY@467..468 "{" [] [] - 1: JS_DIRECTIVE_LIST@468..468 - 2: JS_STATEMENT_LIST@468..468 - 3: R_CURLY@468..470 "}" [] [Whitespace(" ")] - 8: R_CURLY@470..471 "}" [] [] - 16: JS_EXPRESSION_STATEMENT@471..501 - 0: JS_ASSIGNMENT_EXPRESSION@471..500 - 0: JS_IDENTIFIER_ASSIGNMENT@471..477 - 0: IDENT@471..477 "foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: EQ@477..479 "=" [] [Whitespace(" ")] - 2: JS_OBJECT_EXPRESSION@479..500 - 0: L_CURLY@479..481 "{" [] [Whitespace(" ")] - 1: JS_OBJECT_MEMBER_LIST@481..499 - 0: JS_METHOD_OBJECT_MEMBER@481..499 + 8: JS_FUNCTION_BODY@465..468 + 0: L_CURLY@465..466 "{" [] [] + 1: JS_DIRECTIVE_LIST@466..466 + 2: JS_STATEMENT_LIST@466..466 + 3: R_CURLY@466..468 "}" [] [Whitespace(" ")] + 8: R_CURLY@468..469 "}" [] [] + 16: JS_EXPRESSION_STATEMENT@469..499 + 0: JS_ASSIGNMENT_EXPRESSION@469..498 + 0: JS_IDENTIFIER_ASSIGNMENT@469..475 + 0: IDENT@469..475 "foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: EQ@475..477 "=" [] [Whitespace(" ")] + 2: JS_OBJECT_EXPRESSION@477..498 + 0: L_CURLY@477..479 "{" [] [Whitespace(" ")] + 1: JS_OBJECT_MEMBER_LIST@479..497 + 0: JS_METHOD_OBJECT_MEMBER@479..497 0: (empty) 1: (empty) - 2: JS_LITERAL_MEMBER_NAME@481..484 - 0: IDENT@481..484 "foo" [] [] - 3: TS_TYPE_PARAMETERS@484..490 - 0: L_ANGLE@484..485 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@485..489 - 0: TS_TYPE_PARAMETER@485..489 - 0: TS_TYPE_PARAMETER_MODIFIER@485..488 - 0: IN_KW@485..488 "in" [] [Whitespace(" ")] + 2: JS_LITERAL_MEMBER_NAME@479..482 + 0: IDENT@479..482 "foo" [] [] + 3: TS_TYPE_PARAMETERS@482..488 + 0: L_ANGLE@482..483 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@483..487 + 0: TS_TYPE_PARAMETER@483..487 + 0: TS_TYPE_PARAMETER_MODIFIER@483..486 + 0: IN_KW@483..486 "in" [] [Whitespace(" ")] 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@488..489 - 0: IDENT@488..489 "T" [] [] + 1: TS_TYPE_PARAMETER_NAME@486..487 + 0: IDENT@486..487 "T" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@489..490 ">" [] [] - 4: JS_PARAMETERS@490..492 - 0: L_PAREN@490..491 "(" [] [] - 1: JS_PARAMETER_LIST@491..491 - 2: R_PAREN@491..492 ")" [] [] - 5: TS_RETURN_TYPE_ANNOTATION@492..496 - 0: COLON@492..494 ":" [] [Whitespace(" ")] - 1: TS_REFERENCE_TYPE@494..496 - 0: JS_REFERENCE_IDENTIFIER@494..496 - 0: IDENT@494..496 "T" [] [Whitespace(" ")] + 2: R_ANGLE@487..488 ">" [] [] + 4: JS_PARAMETERS@488..490 + 0: L_PAREN@488..489 "(" [] [] + 1: JS_PARAMETER_LIST@489..489 + 2: R_PAREN@489..490 ")" [] [] + 5: TS_RETURN_TYPE_ANNOTATION@490..494 + 0: COLON@490..492 ":" [] [Whitespace(" ")] + 1: TS_REFERENCE_TYPE@492..494 + 0: JS_REFERENCE_IDENTIFIER@492..494 + 0: IDENT@492..494 "T" [] [Whitespace(" ")] 1: (empty) - 6: JS_FUNCTION_BODY@496..499 - 0: L_CURLY@496..497 "{" [] [] - 1: JS_DIRECTIVE_LIST@497..497 - 2: JS_STATEMENT_LIST@497..497 - 3: R_CURLY@497..499 "}" [] [Whitespace(" ")] - 2: R_CURLY@499..500 "}" [] [] - 1: SEMICOLON@500..501 ";" [] [] - 17: JS_EXPRESSION_STATEMENT@501..532 - 0: JS_ASSIGNMENT_EXPRESSION@501..531 - 0: JS_IDENTIFIER_ASSIGNMENT@501..507 - 0: IDENT@501..507 "foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: EQ@507..509 "=" [] [Whitespace(" ")] - 2: JS_OBJECT_EXPRESSION@509..531 - 0: L_CURLY@509..511 "{" [] [Whitespace(" ")] - 1: JS_OBJECT_MEMBER_LIST@511..530 - 0: JS_METHOD_OBJECT_MEMBER@511..530 + 6: JS_FUNCTION_BODY@494..497 + 0: L_CURLY@494..495 "{" [] [] + 1: JS_DIRECTIVE_LIST@495..495 + 2: JS_STATEMENT_LIST@495..495 + 3: R_CURLY@495..497 "}" [] [Whitespace(" ")] + 2: R_CURLY@497..498 "}" [] [] + 1: SEMICOLON@498..499 ";" [] [] + 17: JS_EXPRESSION_STATEMENT@499..530 + 0: JS_ASSIGNMENT_EXPRESSION@499..529 + 0: JS_IDENTIFIER_ASSIGNMENT@499..505 + 0: IDENT@499..505 "foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: EQ@505..507 "=" [] [Whitespace(" ")] + 2: JS_OBJECT_EXPRESSION@507..529 + 0: L_CURLY@507..509 "{" [] [Whitespace(" ")] + 1: JS_OBJECT_MEMBER_LIST@509..528 + 0: JS_METHOD_OBJECT_MEMBER@509..528 0: (empty) 1: (empty) - 2: JS_LITERAL_MEMBER_NAME@511..514 - 0: IDENT@511..514 "foo" [] [] - 3: TS_TYPE_PARAMETERS@514..521 - 0: L_ANGLE@514..515 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@515..520 - 0: TS_TYPE_PARAMETER@515..520 - 0: TS_TYPE_PARAMETER_MODIFIER@515..519 + 2: JS_LITERAL_MEMBER_NAME@509..512 + 0: IDENT@509..512 "foo" [] [] + 3: TS_TYPE_PARAMETERS@512..519 + 0: L_ANGLE@512..513 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@513..518 + 0: TS_TYPE_PARAMETER@513..518 + 0: TS_TYPE_PARAMETER_MODIFIER@513..517 0: (empty) - 1: OUT_KW@515..519 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@519..520 - 0: IDENT@519..520 "T" [] [] + 1: OUT_KW@513..517 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@517..518 + 0: IDENT@517..518 "T" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@520..521 ">" [] [] - 4: JS_PARAMETERS@521..523 - 0: L_PAREN@521..522 "(" [] [] - 1: JS_PARAMETER_LIST@522..522 - 2: R_PAREN@522..523 ")" [] [] - 5: TS_RETURN_TYPE_ANNOTATION@523..527 - 0: COLON@523..525 ":" [] [Whitespace(" ")] - 1: TS_REFERENCE_TYPE@525..527 - 0: JS_REFERENCE_IDENTIFIER@525..527 - 0: IDENT@525..527 "T" [] [Whitespace(" ")] + 2: R_ANGLE@518..519 ">" [] [] + 4: JS_PARAMETERS@519..521 + 0: L_PAREN@519..520 "(" [] [] + 1: JS_PARAMETER_LIST@520..520 + 2: R_PAREN@520..521 ")" [] [] + 5: TS_RETURN_TYPE_ANNOTATION@521..525 + 0: COLON@521..523 ":" [] [Whitespace(" ")] + 1: TS_REFERENCE_TYPE@523..525 + 0: JS_REFERENCE_IDENTIFIER@523..525 + 0: IDENT@523..525 "T" [] [Whitespace(" ")] 1: (empty) - 6: JS_FUNCTION_BODY@527..530 - 0: L_CURLY@527..528 "{" [] [] - 1: JS_DIRECTIVE_LIST@528..528 - 2: JS_STATEMENT_LIST@528..528 - 3: R_CURLY@528..530 "}" [] [Whitespace(" ")] - 2: R_CURLY@530..531 "}" [] [] - 1: SEMICOLON@531..532 ";" [] [] - 18: JS_EXPRESSION_STATEMENT@532..543 - 0: JS_BINARY_EXPRESSION@532..543 - 0: TS_TYPE_ASSERTION_EXPRESSION@532..539 - 0: L_ANGLE@532..535 "<" [Newline("\n"), Whitespace("\t")] [] - 1: TS_REFERENCE_TYPE@535..538 - 0: JS_REFERENCE_IDENTIFIER@535..538 - 0: IDENT@535..538 "in" [] [Whitespace(" ")] + 6: JS_FUNCTION_BODY@525..528 + 0: L_CURLY@525..526 "{" [] [] + 1: JS_DIRECTIVE_LIST@526..526 + 2: JS_STATEMENT_LIST@526..526 + 3: R_CURLY@526..528 "}" [] [Whitespace(" ")] + 2: R_CURLY@528..529 "}" [] [] + 1: SEMICOLON@529..530 ";" [] [] + 18: JS_EXPRESSION_STATEMENT@530..541 + 0: JS_BINARY_EXPRESSION@530..541 + 0: TS_TYPE_ASSERTION_EXPRESSION@530..537 + 0: L_ANGLE@530..533 "<" [Newline("\n"), Whitespace("\t")] [] + 1: TS_REFERENCE_TYPE@533..536 + 0: JS_REFERENCE_IDENTIFIER@533..536 + 0: IDENT@533..536 "in" [] [Whitespace(" ")] 1: (empty) 2: (empty) - 3: JS_IDENTIFIER_EXPRESSION@538..539 - 0: JS_REFERENCE_IDENTIFIER@538..539 - 0: IDENT@538..539 "T" [] [] - 1: R_ANGLE@539..540 ">" [] [] - 2: JS_PARENTHESIZED_EXPRESSION@540..543 - 0: L_PAREN@540..541 "(" [] [] + 3: JS_IDENTIFIER_EXPRESSION@536..537 + 0: JS_REFERENCE_IDENTIFIER@536..537 + 0: IDENT@536..537 "T" [] [] + 1: R_ANGLE@537..538 ">" [] [] + 2: JS_PARENTHESIZED_EXPRESSION@538..541 + 0: L_PAREN@538..539 "(" [] [] 1: (empty) - 2: R_PAREN@541..543 ")" [] [Whitespace(" ")] + 2: R_PAREN@539..541 ")" [] [Whitespace(" ")] 1: (empty) - 19: JS_UNKNOWN_STATEMENT@543..546 - 0: FAT_ARROW@543..546 "=>" [] [Whitespace(" ")] - 20: JS_BLOCK_STATEMENT@546..548 - 0: L_CURLY@546..547 "{" [] [] - 1: JS_STATEMENT_LIST@547..547 - 2: R_CURLY@547..548 "}" [] [] - 21: JS_EMPTY_STATEMENT@548..549 - 0: SEMICOLON@548..549 ";" [] [] - 22: JS_EXPRESSION_STATEMENT@549..567 - 0: JS_ARROW_FUNCTION_EXPRESSION@549..566 + 19: JS_UNKNOWN_STATEMENT@541..544 + 0: FAT_ARROW@541..544 "=>" [] [Whitespace(" ")] + 20: JS_BLOCK_STATEMENT@544..546 + 0: L_CURLY@544..545 "{" [] [] + 1: JS_STATEMENT_LIST@545..545 + 2: R_CURLY@545..546 "}" [] [] + 21: JS_EMPTY_STATEMENT@546..547 + 0: SEMICOLON@546..547 ";" [] [] + 22: JS_EXPRESSION_STATEMENT@547..565 + 0: JS_ARROW_FUNCTION_EXPRESSION@547..564 0: (empty) - 1: TS_TYPE_PARAMETERS@549..558 - 0: L_ANGLE@549..552 "<" [Newline("\n"), Whitespace("\t")] [] - 1: TS_TYPE_PARAMETER_LIST@552..557 - 0: TS_TYPE_PARAMETER@552..557 - 0: TS_TYPE_PARAMETER_MODIFIER@552..556 + 1: TS_TYPE_PARAMETERS@547..556 + 0: L_ANGLE@547..550 "<" [Newline("\n"), Whitespace("\t")] [] + 1: TS_TYPE_PARAMETER_LIST@550..555 + 0: TS_TYPE_PARAMETER@550..555 + 0: TS_TYPE_PARAMETER_MODIFIER@550..554 0: (empty) - 1: OUT_KW@552..556 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@556..557 - 0: IDENT@556..557 "T" [] [] + 1: OUT_KW@550..554 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@554..555 + 0: IDENT@554..555 "T" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@557..558 ">" [] [] - 2: JS_PARAMETERS@558..561 - 0: L_PAREN@558..559 "(" [] [] - 1: JS_PARAMETER_LIST@559..559 - 2: R_PAREN@559..561 ")" [] [Whitespace(" ")] + 2: R_ANGLE@555..556 ">" [] [] + 2: JS_PARAMETERS@556..559 + 0: L_PAREN@556..557 "(" [] [] + 1: JS_PARAMETER_LIST@557..557 + 2: R_PAREN@557..559 ")" [] [Whitespace(" ")] 3: (empty) - 4: FAT_ARROW@561..564 "=>" [] [Whitespace(" ")] - 5: JS_FUNCTION_BODY@564..566 - 0: L_CURLY@564..565 "{" [] [] - 1: JS_DIRECTIVE_LIST@565..565 - 2: JS_STATEMENT_LIST@565..565 - 3: R_CURLY@565..566 "}" [] [] - 1: SEMICOLON@566..567 ";" [] [] - 23: JS_EXPRESSION_STATEMENT@567..580 - 0: JS_SEQUENCE_EXPRESSION@567..580 - 0: TS_TYPE_ASSERTION_EXPRESSION@567..574 - 0: L_ANGLE@567..570 "<" [Newline("\n"), Whitespace("\t")] [] - 1: TS_REFERENCE_TYPE@570..573 - 0: JS_REFERENCE_IDENTIFIER@570..573 - 0: IDENT@570..573 "in" [] [Whitespace(" ")] + 4: FAT_ARROW@559..562 "=>" [] [Whitespace(" ")] + 5: JS_FUNCTION_BODY@562..564 + 0: L_CURLY@562..563 "{" [] [] + 1: JS_DIRECTIVE_LIST@563..563 + 2: JS_STATEMENT_LIST@563..563 + 3: R_CURLY@563..564 "}" [] [] + 1: SEMICOLON@564..565 ";" [] [] + 23: JS_EXPRESSION_STATEMENT@565..578 + 0: JS_SEQUENCE_EXPRESSION@565..578 + 0: TS_TYPE_ASSERTION_EXPRESSION@565..572 + 0: L_ANGLE@565..568 "<" [Newline("\n"), Whitespace("\t")] [] + 1: TS_REFERENCE_TYPE@568..571 + 0: JS_REFERENCE_IDENTIFIER@568..571 + 0: IDENT@568..571 "in" [] [Whitespace(" ")] 1: (empty) 2: (empty) - 3: JS_IDENTIFIER_EXPRESSION@573..574 - 0: JS_REFERENCE_IDENTIFIER@573..574 - 0: IDENT@573..574 "T" [] [] - 1: COMMA@574..576 "," [] [Whitespace(" ")] - 2: JS_IDENTIFIER_EXPRESSION@576..580 - 0: JS_REFERENCE_IDENTIFIER@576..580 - 0: IDENT@576..580 "out" [] [Whitespace(" ")] + 3: JS_IDENTIFIER_EXPRESSION@571..572 + 0: JS_REFERENCE_IDENTIFIER@571..572 + 0: IDENT@571..572 "T" [] [] + 1: COMMA@572..574 "," [] [Whitespace(" ")] + 2: JS_IDENTIFIER_EXPRESSION@574..578 + 0: JS_REFERENCE_IDENTIFIER@574..578 + 0: IDENT@574..578 "out" [] [Whitespace(" ")] 1: (empty) - 24: JS_EXPRESSION_STATEMENT@580..585 - 0: JS_BINARY_EXPRESSION@580..585 - 0: JS_IDENTIFIER_EXPRESSION@580..581 - 0: JS_REFERENCE_IDENTIFIER@580..581 - 0: IDENT@580..581 "T" [] [] - 1: R_ANGLE@581..582 ">" [] [] - 2: JS_PARENTHESIZED_EXPRESSION@582..585 - 0: L_PAREN@582..583 "(" [] [] + 24: JS_EXPRESSION_STATEMENT@578..583 + 0: JS_BINARY_EXPRESSION@578..583 + 0: JS_IDENTIFIER_EXPRESSION@578..579 + 0: JS_REFERENCE_IDENTIFIER@578..579 + 0: IDENT@578..579 "T" [] [] + 1: R_ANGLE@579..580 ">" [] [] + 2: JS_PARENTHESIZED_EXPRESSION@580..583 + 0: L_PAREN@580..581 "(" [] [] 1: (empty) - 2: R_PAREN@583..585 ")" [] [Whitespace(" ")] + 2: R_PAREN@581..583 ")" [] [Whitespace(" ")] 1: (empty) - 25: JS_UNKNOWN_STATEMENT@585..588 - 0: FAT_ARROW@585..588 "=>" [] [Whitespace(" ")] - 26: JS_BLOCK_STATEMENT@588..590 - 0: L_CURLY@588..589 "{" [] [] - 1: JS_STATEMENT_LIST@589..589 - 2: R_CURLY@589..590 "}" [] [] - 27: JS_EMPTY_STATEMENT@590..591 - 0: SEMICOLON@590..591 ";" [] [] - 28: JS_VARIABLE_STATEMENT@591..615 - 0: JS_VARIABLE_DECLARATION@591..614 - 0: LET_KW@591..597 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: JS_VARIABLE_DECLARATOR_LIST@597..614 - 0: JS_VARIABLE_DECLARATOR@597..614 - 0: JS_IDENTIFIER_BINDING@597..598 - 0: IDENT@597..598 "x" [] [] - 1: TS_TYPE_ANNOTATION@598..614 - 0: COLON@598..600 ":" [] [Whitespace(" ")] - 1: TS_FUNCTION_TYPE@600..614 - 0: TS_TYPE_PARAMETERS@600..606 - 0: L_ANGLE@600..601 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@601..605 - 0: TS_TYPE_PARAMETER@601..605 - 0: TS_TYPE_PARAMETER_MODIFIER@601..604 - 0: IN_KW@601..604 "in" [] [Whitespace(" ")] + 25: JS_UNKNOWN_STATEMENT@583..586 + 0: FAT_ARROW@583..586 "=>" [] [Whitespace(" ")] + 26: JS_BLOCK_STATEMENT@586..588 + 0: L_CURLY@586..587 "{" [] [] + 1: JS_STATEMENT_LIST@587..587 + 2: R_CURLY@587..588 "}" [] [] + 27: JS_EMPTY_STATEMENT@588..589 + 0: SEMICOLON@588..589 ";" [] [] + 28: JS_VARIABLE_STATEMENT@589..613 + 0: JS_VARIABLE_DECLARATION@589..612 + 0: LET_KW@589..595 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATOR_LIST@595..612 + 0: JS_VARIABLE_DECLARATOR@595..612 + 0: JS_IDENTIFIER_BINDING@595..596 + 0: IDENT@595..596 "x" [] [] + 1: TS_TYPE_ANNOTATION@596..612 + 0: COLON@596..598 ":" [] [Whitespace(" ")] + 1: TS_FUNCTION_TYPE@598..612 + 0: TS_TYPE_PARAMETERS@598..604 + 0: L_ANGLE@598..599 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@599..603 + 0: TS_TYPE_PARAMETER@599..603 + 0: TS_TYPE_PARAMETER_MODIFIER@599..602 + 0: IN_KW@599..602 "in" [] [Whitespace(" ")] 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@604..605 - 0: IDENT@604..605 "T" [] [] + 1: TS_TYPE_PARAMETER_NAME@602..603 + 0: IDENT@602..603 "T" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@605..606 ">" [] [] - 1: JS_PARAMETERS@606..609 - 0: L_PAREN@606..607 "(" [] [] - 1: JS_PARAMETER_LIST@607..607 - 2: R_PAREN@607..609 ")" [] [Whitespace(" ")] - 2: FAT_ARROW@609..612 "=>" [] [Whitespace(" ")] - 3: TS_OBJECT_TYPE@612..614 - 0: L_CURLY@612..613 "{" [] [] - 1: TS_TYPE_MEMBER_LIST@613..613 - 2: R_CURLY@613..614 "}" [] [] + 2: R_ANGLE@603..604 ">" [] [] + 1: JS_PARAMETERS@604..607 + 0: L_PAREN@604..605 "(" [] [] + 1: JS_PARAMETER_LIST@605..605 + 2: R_PAREN@605..607 ")" [] [Whitespace(" ")] + 2: FAT_ARROW@607..610 "=>" [] [Whitespace(" ")] + 3: TS_OBJECT_TYPE@610..612 + 0: L_CURLY@610..611 "{" [] [] + 1: TS_TYPE_MEMBER_LIST@611..611 + 2: R_CURLY@611..612 "}" [] [] 2: (empty) - 1: SEMICOLON@614..615 ";" [] [] - 29: JS_VARIABLE_STATEMENT@615..640 - 0: JS_VARIABLE_DECLARATION@615..639 - 0: LET_KW@615..621 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: JS_VARIABLE_DECLARATOR_LIST@621..639 - 0: JS_VARIABLE_DECLARATOR@621..639 - 0: JS_IDENTIFIER_BINDING@621..622 - 0: IDENT@621..622 "x" [] [] - 1: TS_TYPE_ANNOTATION@622..639 - 0: COLON@622..624 ":" [] [Whitespace(" ")] - 1: TS_FUNCTION_TYPE@624..639 - 0: TS_TYPE_PARAMETERS@624..631 - 0: L_ANGLE@624..625 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@625..630 - 0: TS_TYPE_PARAMETER@625..630 - 0: TS_TYPE_PARAMETER_MODIFIER@625..629 + 1: SEMICOLON@612..613 ";" [] [] + 29: JS_VARIABLE_STATEMENT@613..638 + 0: JS_VARIABLE_DECLARATION@613..637 + 0: LET_KW@613..619 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATOR_LIST@619..637 + 0: JS_VARIABLE_DECLARATOR@619..637 + 0: JS_IDENTIFIER_BINDING@619..620 + 0: IDENT@619..620 "x" [] [] + 1: TS_TYPE_ANNOTATION@620..637 + 0: COLON@620..622 ":" [] [Whitespace(" ")] + 1: TS_FUNCTION_TYPE@622..637 + 0: TS_TYPE_PARAMETERS@622..629 + 0: L_ANGLE@622..623 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@623..628 + 0: TS_TYPE_PARAMETER@623..628 + 0: TS_TYPE_PARAMETER_MODIFIER@623..627 0: (empty) - 1: OUT_KW@625..629 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@629..630 - 0: IDENT@629..630 "T" [] [] + 1: OUT_KW@623..627 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@627..628 + 0: IDENT@627..628 "T" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@630..631 ">" [] [] - 1: JS_PARAMETERS@631..634 - 0: L_PAREN@631..632 "(" [] [] - 1: JS_PARAMETER_LIST@632..632 - 2: R_PAREN@632..634 ")" [] [Whitespace(" ")] - 2: FAT_ARROW@634..637 "=>" [] [Whitespace(" ")] - 3: TS_OBJECT_TYPE@637..639 - 0: L_CURLY@637..638 "{" [] [] - 1: TS_TYPE_MEMBER_LIST@638..638 - 2: R_CURLY@638..639 "}" [] [] + 2: R_ANGLE@628..629 ">" [] [] + 1: JS_PARAMETERS@629..632 + 0: L_PAREN@629..630 "(" [] [] + 1: JS_PARAMETER_LIST@630..630 + 2: R_PAREN@630..632 ")" [] [Whitespace(" ")] + 2: FAT_ARROW@632..635 "=>" [] [Whitespace(" ")] + 3: TS_OBJECT_TYPE@635..637 + 0: L_CURLY@635..636 "{" [] [] + 1: TS_TYPE_MEMBER_LIST@636..636 + 2: R_CURLY@636..637 "}" [] [] 2: (empty) - 1: SEMICOLON@639..640 ";" [] [] - 30: JS_VARIABLE_STATEMENT@640..671 - 0: JS_VARIABLE_DECLARATION@640..670 - 0: LET_KW@640..646 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: JS_VARIABLE_DECLARATOR_LIST@646..670 - 0: JS_VARIABLE_DECLARATOR@646..670 - 0: JS_IDENTIFIER_BINDING@646..647 - 0: IDENT@646..647 "x" [] [] - 1: TS_TYPE_ANNOTATION@647..670 - 0: COLON@647..649 ":" [] [Whitespace(" ")] - 1: TS_FUNCTION_TYPE@649..670 - 0: TS_TYPE_PARAMETERS@649..662 - 0: L_ANGLE@649..650 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@650..661 - 0: TS_TYPE_PARAMETER@650..654 - 0: TS_TYPE_PARAMETER_MODIFIER@650..653 - 0: IN_KW@650..653 "in" [] [Whitespace(" ")] + 1: SEMICOLON@637..638 ";" [] [] + 30: JS_VARIABLE_STATEMENT@638..669 + 0: JS_VARIABLE_DECLARATION@638..668 + 0: LET_KW@638..644 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATOR_LIST@644..668 + 0: JS_VARIABLE_DECLARATOR@644..668 + 0: JS_IDENTIFIER_BINDING@644..645 + 0: IDENT@644..645 "x" [] [] + 1: TS_TYPE_ANNOTATION@645..668 + 0: COLON@645..647 ":" [] [Whitespace(" ")] + 1: TS_FUNCTION_TYPE@647..668 + 0: TS_TYPE_PARAMETERS@647..660 + 0: L_ANGLE@647..648 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@648..659 + 0: TS_TYPE_PARAMETER@648..652 + 0: TS_TYPE_PARAMETER_MODIFIER@648..651 + 0: IN_KW@648..651 "in" [] [Whitespace(" ")] 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@653..654 - 0: IDENT@653..654 "T" [] [] + 1: TS_TYPE_PARAMETER_NAME@651..652 + 0: IDENT@651..652 "T" [] [] 2: (empty) 3: (empty) - 1: COMMA@654..656 "," [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER@656..661 - 0: TS_TYPE_PARAMETER_MODIFIER@656..660 + 1: COMMA@652..654 "," [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER@654..659 + 0: TS_TYPE_PARAMETER_MODIFIER@654..658 0: (empty) - 1: OUT_KW@656..660 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@660..661 - 0: IDENT@660..661 "T" [] [] + 1: OUT_KW@654..658 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@658..659 + 0: IDENT@658..659 "T" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@661..662 ">" [] [] - 1: JS_PARAMETERS@662..665 - 0: L_PAREN@662..663 "(" [] [] - 1: JS_PARAMETER_LIST@663..663 - 2: R_PAREN@663..665 ")" [] [Whitespace(" ")] - 2: FAT_ARROW@665..668 "=>" [] [Whitespace(" ")] - 3: TS_OBJECT_TYPE@668..670 - 0: L_CURLY@668..669 "{" [] [] - 1: TS_TYPE_MEMBER_LIST@669..669 - 2: R_CURLY@669..670 "}" [] [] + 2: R_ANGLE@659..660 ">" [] [] + 1: JS_PARAMETERS@660..663 + 0: L_PAREN@660..661 "(" [] [] + 1: JS_PARAMETER_LIST@661..661 + 2: R_PAREN@661..663 ")" [] [Whitespace(" ")] + 2: FAT_ARROW@663..666 "=>" [] [Whitespace(" ")] + 3: TS_OBJECT_TYPE@666..668 + 0: L_CURLY@666..667 "{" [] [] + 1: TS_TYPE_MEMBER_LIST@667..667 + 2: R_CURLY@667..668 "}" [] [] 2: (empty) - 1: SEMICOLON@670..671 ";" [] [] - 31: JS_VARIABLE_STATEMENT@671..699 - 0: JS_VARIABLE_DECLARATION@671..698 - 0: LET_KW@671..677 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: JS_VARIABLE_DECLARATOR_LIST@677..698 - 0: JS_VARIABLE_DECLARATOR@677..698 - 0: JS_IDENTIFIER_BINDING@677..678 - 0: IDENT@677..678 "x" [] [] - 1: TS_TYPE_ANNOTATION@678..698 - 0: COLON@678..680 ":" [] [Whitespace(" ")] - 1: TS_CONSTRUCTOR_TYPE@680..698 + 1: SEMICOLON@668..669 ";" [] [] + 31: JS_VARIABLE_STATEMENT@669..697 + 0: JS_VARIABLE_DECLARATION@669..696 + 0: LET_KW@669..675 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATOR_LIST@675..696 + 0: JS_VARIABLE_DECLARATOR@675..696 + 0: JS_IDENTIFIER_BINDING@675..676 + 0: IDENT@675..676 "x" [] [] + 1: TS_TYPE_ANNOTATION@676..696 + 0: COLON@676..678 ":" [] [Whitespace(" ")] + 1: TS_CONSTRUCTOR_TYPE@678..696 0: (empty) - 1: NEW_KW@680..684 "new" [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETERS@684..690 - 0: L_ANGLE@684..685 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@685..689 - 0: TS_TYPE_PARAMETER@685..689 - 0: TS_TYPE_PARAMETER_MODIFIER@685..688 - 0: IN_KW@685..688 "in" [] [Whitespace(" ")] + 1: NEW_KW@678..682 "new" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETERS@682..688 + 0: L_ANGLE@682..683 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@683..687 + 0: TS_TYPE_PARAMETER@683..687 + 0: TS_TYPE_PARAMETER_MODIFIER@683..686 + 0: IN_KW@683..686 "in" [] [Whitespace(" ")] 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@688..689 - 0: IDENT@688..689 "T" [] [] + 1: TS_TYPE_PARAMETER_NAME@686..687 + 0: IDENT@686..687 "T" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@689..690 ">" [] [] - 3: JS_PARAMETERS@690..693 - 0: L_PAREN@690..691 "(" [] [] - 1: JS_PARAMETER_LIST@691..691 - 2: R_PAREN@691..693 ")" [] [Whitespace(" ")] - 4: FAT_ARROW@693..696 "=>" [] [Whitespace(" ")] - 5: TS_OBJECT_TYPE@696..698 - 0: L_CURLY@696..697 "{" [] [] - 1: TS_TYPE_MEMBER_LIST@697..697 - 2: R_CURLY@697..698 "}" [] [] + 2: R_ANGLE@687..688 ">" [] [] + 3: JS_PARAMETERS@688..691 + 0: L_PAREN@688..689 "(" [] [] + 1: JS_PARAMETER_LIST@689..689 + 2: R_PAREN@689..691 ")" [] [Whitespace(" ")] + 4: FAT_ARROW@691..694 "=>" [] [Whitespace(" ")] + 5: TS_OBJECT_TYPE@694..696 + 0: L_CURLY@694..695 "{" [] [] + 1: TS_TYPE_MEMBER_LIST@695..695 + 2: R_CURLY@695..696 "}" [] [] 2: (empty) - 1: SEMICOLON@698..699 ";" [] [] - 32: JS_VARIABLE_STATEMENT@699..728 - 0: JS_VARIABLE_DECLARATION@699..727 - 0: LET_KW@699..705 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: JS_VARIABLE_DECLARATOR_LIST@705..727 - 0: JS_VARIABLE_DECLARATOR@705..727 - 0: JS_IDENTIFIER_BINDING@705..706 - 0: IDENT@705..706 "x" [] [] - 1: TS_TYPE_ANNOTATION@706..727 - 0: COLON@706..708 ":" [] [Whitespace(" ")] - 1: TS_CONSTRUCTOR_TYPE@708..727 + 1: SEMICOLON@696..697 ";" [] [] + 32: JS_VARIABLE_STATEMENT@697..726 + 0: JS_VARIABLE_DECLARATION@697..725 + 0: LET_KW@697..703 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATOR_LIST@703..725 + 0: JS_VARIABLE_DECLARATOR@703..725 + 0: JS_IDENTIFIER_BINDING@703..704 + 0: IDENT@703..704 "x" [] [] + 1: TS_TYPE_ANNOTATION@704..725 + 0: COLON@704..706 ":" [] [Whitespace(" ")] + 1: TS_CONSTRUCTOR_TYPE@706..725 0: (empty) - 1: NEW_KW@708..712 "new" [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETERS@712..719 - 0: L_ANGLE@712..713 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@713..718 - 0: TS_TYPE_PARAMETER@713..718 - 0: TS_TYPE_PARAMETER_MODIFIER@713..717 + 1: NEW_KW@706..710 "new" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETERS@710..717 + 0: L_ANGLE@710..711 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@711..716 + 0: TS_TYPE_PARAMETER@711..716 + 0: TS_TYPE_PARAMETER_MODIFIER@711..715 0: (empty) - 1: OUT_KW@713..717 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@717..718 - 0: IDENT@717..718 "T" [] [] + 1: OUT_KW@711..715 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@715..716 + 0: IDENT@715..716 "T" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@718..719 ">" [] [] - 3: JS_PARAMETERS@719..722 - 0: L_PAREN@719..720 "(" [] [] - 1: JS_PARAMETER_LIST@720..720 - 2: R_PAREN@720..722 ")" [] [Whitespace(" ")] - 4: FAT_ARROW@722..725 "=>" [] [Whitespace(" ")] - 5: TS_OBJECT_TYPE@725..727 - 0: L_CURLY@725..726 "{" [] [] - 1: TS_TYPE_MEMBER_LIST@726..726 - 2: R_CURLY@726..727 "}" [] [] + 2: R_ANGLE@716..717 ">" [] [] + 3: JS_PARAMETERS@717..720 + 0: L_PAREN@717..718 "(" [] [] + 1: JS_PARAMETER_LIST@718..718 + 2: R_PAREN@718..720 ")" [] [Whitespace(" ")] + 4: FAT_ARROW@720..723 "=>" [] [Whitespace(" ")] + 5: TS_OBJECT_TYPE@723..725 + 0: L_CURLY@723..724 "{" [] [] + 1: TS_TYPE_MEMBER_LIST@724..724 + 2: R_CURLY@724..725 "}" [] [] 2: (empty) - 1: SEMICOLON@727..728 ";" [] [] - 33: JS_VARIABLE_STATEMENT@728..763 - 0: JS_VARIABLE_DECLARATION@728..762 - 0: LET_KW@728..734 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: JS_VARIABLE_DECLARATOR_LIST@734..762 - 0: JS_VARIABLE_DECLARATOR@734..762 - 0: JS_IDENTIFIER_BINDING@734..735 - 0: IDENT@734..735 "x" [] [] - 1: TS_TYPE_ANNOTATION@735..762 - 0: COLON@735..737 ":" [] [Whitespace(" ")] - 1: TS_CONSTRUCTOR_TYPE@737..762 + 1: SEMICOLON@725..726 ";" [] [] + 33: JS_VARIABLE_STATEMENT@726..761 + 0: JS_VARIABLE_DECLARATION@726..760 + 0: LET_KW@726..732 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATOR_LIST@732..760 + 0: JS_VARIABLE_DECLARATOR@732..760 + 0: JS_IDENTIFIER_BINDING@732..733 + 0: IDENT@732..733 "x" [] [] + 1: TS_TYPE_ANNOTATION@733..760 + 0: COLON@733..735 ":" [] [Whitespace(" ")] + 1: TS_CONSTRUCTOR_TYPE@735..760 0: (empty) - 1: NEW_KW@737..741 "new" [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETERS@741..754 - 0: L_ANGLE@741..742 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@742..753 - 0: TS_TYPE_PARAMETER@742..746 - 0: TS_TYPE_PARAMETER_MODIFIER@742..745 - 0: IN_KW@742..745 "in" [] [Whitespace(" ")] + 1: NEW_KW@735..739 "new" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETERS@739..752 + 0: L_ANGLE@739..740 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@740..751 + 0: TS_TYPE_PARAMETER@740..744 + 0: TS_TYPE_PARAMETER_MODIFIER@740..743 + 0: IN_KW@740..743 "in" [] [Whitespace(" ")] 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@745..746 - 0: IDENT@745..746 "T" [] [] + 1: TS_TYPE_PARAMETER_NAME@743..744 + 0: IDENT@743..744 "T" [] [] 2: (empty) 3: (empty) - 1: COMMA@746..748 "," [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER@748..753 - 0: TS_TYPE_PARAMETER_MODIFIER@748..752 + 1: COMMA@744..746 "," [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER@746..751 + 0: TS_TYPE_PARAMETER_MODIFIER@746..750 0: (empty) - 1: OUT_KW@748..752 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@752..753 - 0: IDENT@752..753 "T" [] [] + 1: OUT_KW@746..750 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@750..751 + 0: IDENT@750..751 "T" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@753..754 ">" [] [] - 3: JS_PARAMETERS@754..757 - 0: L_PAREN@754..755 "(" [] [] - 1: JS_PARAMETER_LIST@755..755 - 2: R_PAREN@755..757 ")" [] [Whitespace(" ")] - 4: FAT_ARROW@757..760 "=>" [] [Whitespace(" ")] - 5: TS_OBJECT_TYPE@760..762 - 0: L_CURLY@760..761 "{" [] [] - 1: TS_TYPE_MEMBER_LIST@761..761 - 2: R_CURLY@761..762 "}" [] [] + 2: R_ANGLE@751..752 ">" [] [] + 3: JS_PARAMETERS@752..755 + 0: L_PAREN@752..753 "(" [] [] + 1: JS_PARAMETER_LIST@753..753 + 2: R_PAREN@753..755 ")" [] [Whitespace(" ")] + 4: FAT_ARROW@755..758 "=>" [] [Whitespace(" ")] + 5: TS_OBJECT_TYPE@758..760 + 0: L_CURLY@758..759 "{" [] [] + 1: TS_TYPE_MEMBER_LIST@759..759 + 2: R_CURLY@759..760 "}" [] [] 2: (empty) - 1: SEMICOLON@762..763 ";" [] [] - 34: JS_VARIABLE_STATEMENT@763..791 - 0: JS_VARIABLE_DECLARATION@763..790 - 0: LET_KW@763..769 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: JS_VARIABLE_DECLARATOR_LIST@769..790 - 0: JS_VARIABLE_DECLARATOR@769..790 - 0: JS_IDENTIFIER_BINDING@769..770 - 0: IDENT@769..770 "x" [] [] - 1: TS_TYPE_ANNOTATION@770..790 - 0: COLON@770..772 ":" [] [Whitespace(" ")] - 1: TS_OBJECT_TYPE@772..790 - 0: L_CURLY@772..774 "{" [] [Whitespace(" ")] - 1: TS_TYPE_MEMBER_LIST@774..789 - 0: TS_METHOD_SIGNATURE_TYPE_MEMBER@774..789 - 0: JS_LITERAL_MEMBER_NAME@774..775 - 0: IDENT@774..775 "y" [] [] + 1: SEMICOLON@760..761 ";" [] [] + 34: JS_VARIABLE_STATEMENT@761..789 + 0: JS_VARIABLE_DECLARATION@761..788 + 0: LET_KW@761..767 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATOR_LIST@767..788 + 0: JS_VARIABLE_DECLARATOR@767..788 + 0: JS_IDENTIFIER_BINDING@767..768 + 0: IDENT@767..768 "x" [] [] + 1: TS_TYPE_ANNOTATION@768..788 + 0: COLON@768..770 ":" [] [Whitespace(" ")] + 1: TS_OBJECT_TYPE@770..788 + 0: L_CURLY@770..772 "{" [] [Whitespace(" ")] + 1: TS_TYPE_MEMBER_LIST@772..787 + 0: TS_METHOD_SIGNATURE_TYPE_MEMBER@772..787 + 0: JS_LITERAL_MEMBER_NAME@772..773 + 0: IDENT@772..773 "y" [] [] 1: (empty) - 2: TS_TYPE_PARAMETERS@775..781 - 0: L_ANGLE@775..776 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@776..780 - 0: TS_TYPE_PARAMETER@776..780 - 0: TS_TYPE_PARAMETER_MODIFIER@776..779 - 0: IN_KW@776..779 "in" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETERS@773..779 + 0: L_ANGLE@773..774 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@774..778 + 0: TS_TYPE_PARAMETER@774..778 + 0: TS_TYPE_PARAMETER_MODIFIER@774..777 + 0: IN_KW@774..777 "in" [] [Whitespace(" ")] 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@779..780 - 0: IDENT@779..780 "T" [] [] + 1: TS_TYPE_PARAMETER_NAME@777..778 + 0: IDENT@777..778 "T" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@780..781 ">" [] [] - 3: JS_PARAMETERS@781..783 - 0: L_PAREN@781..782 "(" [] [] - 1: JS_PARAMETER_LIST@782..782 - 2: R_PAREN@782..783 ")" [] [] - 4: TS_RETURN_TYPE_ANNOTATION@783..789 - 0: COLON@783..785 ":" [] [Whitespace(" ")] - 1: TS_ANY_TYPE@785..789 - 0: ANY_KW@785..789 "any" [] [Whitespace(" ")] + 2: R_ANGLE@778..779 ">" [] [] + 3: JS_PARAMETERS@779..781 + 0: L_PAREN@779..780 "(" [] [] + 1: JS_PARAMETER_LIST@780..780 + 2: R_PAREN@780..781 ")" [] [] + 4: TS_RETURN_TYPE_ANNOTATION@781..787 + 0: COLON@781..783 ":" [] [Whitespace(" ")] + 1: TS_ANY_TYPE@783..787 + 0: ANY_KW@783..787 "any" [] [Whitespace(" ")] 5: (empty) - 2: R_CURLY@789..790 "}" [] [] + 2: R_CURLY@787..788 "}" [] [] 2: (empty) - 1: SEMICOLON@790..791 ";" [] [] - 35: JS_VARIABLE_STATEMENT@791..820 - 0: JS_VARIABLE_DECLARATION@791..819 - 0: LET_KW@791..797 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: JS_VARIABLE_DECLARATOR_LIST@797..819 - 0: JS_VARIABLE_DECLARATOR@797..819 - 0: JS_IDENTIFIER_BINDING@797..798 - 0: IDENT@797..798 "x" [] [] - 1: TS_TYPE_ANNOTATION@798..819 - 0: COLON@798..800 ":" [] [Whitespace(" ")] - 1: TS_OBJECT_TYPE@800..819 - 0: L_CURLY@800..802 "{" [] [Whitespace(" ")] - 1: TS_TYPE_MEMBER_LIST@802..818 - 0: TS_METHOD_SIGNATURE_TYPE_MEMBER@802..818 - 0: JS_LITERAL_MEMBER_NAME@802..803 - 0: IDENT@802..803 "y" [] [] + 1: SEMICOLON@788..789 ";" [] [] + 35: JS_VARIABLE_STATEMENT@789..818 + 0: JS_VARIABLE_DECLARATION@789..817 + 0: LET_KW@789..795 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATOR_LIST@795..817 + 0: JS_VARIABLE_DECLARATOR@795..817 + 0: JS_IDENTIFIER_BINDING@795..796 + 0: IDENT@795..796 "x" [] [] + 1: TS_TYPE_ANNOTATION@796..817 + 0: COLON@796..798 ":" [] [Whitespace(" ")] + 1: TS_OBJECT_TYPE@798..817 + 0: L_CURLY@798..800 "{" [] [Whitespace(" ")] + 1: TS_TYPE_MEMBER_LIST@800..816 + 0: TS_METHOD_SIGNATURE_TYPE_MEMBER@800..816 + 0: JS_LITERAL_MEMBER_NAME@800..801 + 0: IDENT@800..801 "y" [] [] 1: (empty) - 2: TS_TYPE_PARAMETERS@803..810 - 0: L_ANGLE@803..804 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@804..809 - 0: TS_TYPE_PARAMETER@804..809 - 0: TS_TYPE_PARAMETER_MODIFIER@804..808 + 2: TS_TYPE_PARAMETERS@801..808 + 0: L_ANGLE@801..802 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@802..807 + 0: TS_TYPE_PARAMETER@802..807 + 0: TS_TYPE_PARAMETER_MODIFIER@802..806 0: (empty) - 1: OUT_KW@804..808 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@808..809 - 0: IDENT@808..809 "T" [] [] + 1: OUT_KW@802..806 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@806..807 + 0: IDENT@806..807 "T" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@809..810 ">" [] [] - 3: JS_PARAMETERS@810..812 - 0: L_PAREN@810..811 "(" [] [] - 1: JS_PARAMETER_LIST@811..811 - 2: R_PAREN@811..812 ")" [] [] - 4: TS_RETURN_TYPE_ANNOTATION@812..818 - 0: COLON@812..814 ":" [] [Whitespace(" ")] - 1: TS_ANY_TYPE@814..818 - 0: ANY_KW@814..818 "any" [] [Whitespace(" ")] + 2: R_ANGLE@807..808 ">" [] [] + 3: JS_PARAMETERS@808..810 + 0: L_PAREN@808..809 "(" [] [] + 1: JS_PARAMETER_LIST@809..809 + 2: R_PAREN@809..810 ")" [] [] + 4: TS_RETURN_TYPE_ANNOTATION@810..816 + 0: COLON@810..812 ":" [] [Whitespace(" ")] + 1: TS_ANY_TYPE@812..816 + 0: ANY_KW@812..816 "any" [] [Whitespace(" ")] 5: (empty) - 2: R_CURLY@818..819 "}" [] [] + 2: R_CURLY@816..817 "}" [] [] 2: (empty) - 1: SEMICOLON@819..820 ";" [] [] - 36: JS_VARIABLE_STATEMENT@820..855 - 0: JS_VARIABLE_DECLARATION@820..854 - 0: LET_KW@820..826 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: JS_VARIABLE_DECLARATOR_LIST@826..854 - 0: JS_VARIABLE_DECLARATOR@826..854 - 0: JS_IDENTIFIER_BINDING@826..827 - 0: IDENT@826..827 "x" [] [] - 1: TS_TYPE_ANNOTATION@827..854 - 0: COLON@827..829 ":" [] [Whitespace(" ")] - 1: TS_OBJECT_TYPE@829..854 - 0: L_CURLY@829..831 "{" [] [Whitespace(" ")] - 1: TS_TYPE_MEMBER_LIST@831..853 - 0: TS_METHOD_SIGNATURE_TYPE_MEMBER@831..853 - 0: JS_LITERAL_MEMBER_NAME@831..832 - 0: IDENT@831..832 "y" [] [] + 1: SEMICOLON@817..818 ";" [] [] + 36: JS_VARIABLE_STATEMENT@818..853 + 0: JS_VARIABLE_DECLARATION@818..852 + 0: LET_KW@818..824 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATOR_LIST@824..852 + 0: JS_VARIABLE_DECLARATOR@824..852 + 0: JS_IDENTIFIER_BINDING@824..825 + 0: IDENT@824..825 "x" [] [] + 1: TS_TYPE_ANNOTATION@825..852 + 0: COLON@825..827 ":" [] [Whitespace(" ")] + 1: TS_OBJECT_TYPE@827..852 + 0: L_CURLY@827..829 "{" [] [Whitespace(" ")] + 1: TS_TYPE_MEMBER_LIST@829..851 + 0: TS_METHOD_SIGNATURE_TYPE_MEMBER@829..851 + 0: JS_LITERAL_MEMBER_NAME@829..830 + 0: IDENT@829..830 "y" [] [] 1: (empty) - 2: TS_TYPE_PARAMETERS@832..845 - 0: L_ANGLE@832..833 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@833..844 - 0: TS_TYPE_PARAMETER@833..837 - 0: TS_TYPE_PARAMETER_MODIFIER@833..836 - 0: IN_KW@833..836 "in" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETERS@830..843 + 0: L_ANGLE@830..831 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@831..842 + 0: TS_TYPE_PARAMETER@831..835 + 0: TS_TYPE_PARAMETER_MODIFIER@831..834 + 0: IN_KW@831..834 "in" [] [Whitespace(" ")] 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@836..837 - 0: IDENT@836..837 "T" [] [] + 1: TS_TYPE_PARAMETER_NAME@834..835 + 0: IDENT@834..835 "T" [] [] 2: (empty) 3: (empty) - 1: COMMA@837..839 "," [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER@839..844 - 0: TS_TYPE_PARAMETER_MODIFIER@839..843 + 1: COMMA@835..837 "," [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER@837..842 + 0: TS_TYPE_PARAMETER_MODIFIER@837..841 0: (empty) - 1: OUT_KW@839..843 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@843..844 - 0: IDENT@843..844 "T" [] [] + 1: OUT_KW@837..841 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@841..842 + 0: IDENT@841..842 "T" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@844..845 ">" [] [] - 3: JS_PARAMETERS@845..847 - 0: L_PAREN@845..846 "(" [] [] - 1: JS_PARAMETER_LIST@846..846 - 2: R_PAREN@846..847 ")" [] [] - 4: TS_RETURN_TYPE_ANNOTATION@847..853 - 0: COLON@847..849 ":" [] [Whitespace(" ")] - 1: TS_ANY_TYPE@849..853 - 0: ANY_KW@849..853 "any" [] [Whitespace(" ")] + 2: R_ANGLE@842..843 ">" [] [] + 3: JS_PARAMETERS@843..845 + 0: L_PAREN@843..844 "(" [] [] + 1: JS_PARAMETER_LIST@844..844 + 2: R_PAREN@844..845 ")" [] [] + 4: TS_RETURN_TYPE_ANNOTATION@845..851 + 0: COLON@845..847 ":" [] [Whitespace(" ")] + 1: TS_ANY_TYPE@847..851 + 0: ANY_KW@847..851 "any" [] [Whitespace(" ")] 5: (empty) - 2: R_CURLY@853..854 "}" [] [] + 2: R_CURLY@851..852 "}" [] [] 2: (empty) - 1: SEMICOLON@854..855 ";" [] [] - 3: EOF@855..856 "" [Newline("\n")] [] + 1: SEMICOLON@852..853 ";" [] [] + 3: EOF@853..854 "" [Newline("\n")] [] -- error[SyntaxError]: TypeParameterModifier `in` is not valid here ┌─ type_parameter_modifier1.ts:1:30 @@ -2472,14 +2472,14 @@ error[SyntaxError]: TypeParameterModifier `out` is not valid here error[SyntaxError]: TypeParameterModifier `in` is not valid here ┌─ type_parameter_modifier1.ts:3:23 │ -3 │ export function foo1() {} +3 │ export function foo1() {} │ ^^ -- error[SyntaxError]: TypeParameterModifier `out` is not valid here ┌─ type_parameter_modifier1.ts:4:23 │ -4 │ export function foo2() {} +4 │ export function foo2() {} │ ^^^ -- @@ -2718,8 +2718,8 @@ error[SyntaxError]: TypeParameterModifier `out` is not valid here -- export default function foo() {} export function foo() {} - export function foo1() {} - export function foo2() {} + export function foo1() {} + export function foo2() {} let foo: Foo let foo: Foo declare function foo() diff --git a/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier1.ts b/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier1.ts index 7fa7529b390..5c474f2eda8 100644 --- a/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier1.ts +++ b/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier1.ts @@ -1,7 +1,7 @@ export default function foo() {} export function foo() {} - export function foo1() {} - export function foo2() {} + export function foo1() {} + export function foo2() {} let foo: Foo let foo: Foo declare function foo() diff --git a/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier_tsx.rast b/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier_tsx.rast new file mode 100644 index 00000000000..7e3857d3b08 --- /dev/null +++ b/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier_tsx.rast @@ -0,0 +1,67 @@ +JsModule { + interpreter_token: missing (optional), + directives: JsDirectiveList [], + items: JsModuleItemList [ + JsExpressionStatement { + expression: JsxTagExpression { + tag: JsxElement { + opening_element: JsxOpeningElement { + l_angle_token: L_ANGLE@0..1 "<" [] [], + name: JsxName { + value_token: JSX_IDENT@1..4 "in" [] [Whitespace(" ")], + }, + type_arguments: missing (optional), + attributes: JsxAttributeList [ + JsxAttribute { + name: JsxName { + value_token: JSX_IDENT@4..5 "T" [] [], + }, + initializer: missing (optional), + }, + ], + r_angle_token: R_ANGLE@5..6 ">" [] [], + }, + children: JsxChildList [], + closing_element: JsxClosingElement { + l_angle_token: L_ANGLE@6..7 "<" [] [], + slash_token: SLASH@7..8 "/" [] [], + name: JsxName { + value_token: JSX_IDENT@8..10 "in" [] [], + }, + r_angle_token: R_ANGLE@10..11 ">" [] [], + }, + }, + }, + semicolon_token: missing (optional), + }, + ], + eof_token: EOF@11..161 "" [Newline("\n"), Comments("// "), Newline("\n"), Comments("// "), Newline("\n"), Comments("// "), Newline("\n"), Comments("//" [] [] + 1: JSX_CHILD_LIST@6..6 + 2: JSX_CLOSING_ELEMENT@6..11 + 0: L_ANGLE@6..7 "<" [] [] + 1: SLASH@7..8 "/" [] [] + 2: JSX_NAME@8..10 + 0: JSX_IDENT@8..10 "in" [] [] + 3: R_ANGLE@10..11 ">" [] [] + 1: (empty) + 3: EOF@11..161 "" [Newline("\n"), Comments("// "), Newline("\n"), Comments("// "), Newline("\n"), Comments("// "), Newline("\n"), Comments("// +// +// +// +// +// +// From 8892d85238881d62350181c25540b37dfe81f025 Mon Sep 17 00:00:00 2001 From: IWANABETHATGUY Date: Mon, 9 May 2022 00:13:59 +0800 Subject: [PATCH 07/22] =?UTF-8?q?style:=20=F0=9F=92=84=20clippy=20and=20fm?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/ts/bindings/type_parameter_modifier.rs | 9 ++++----- crates/rome_js_parser/src/syntax/typescript/types.rs | 6 +++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/crates/rome_js_formatter/src/ts/bindings/type_parameter_modifier.rs b/crates/rome_js_formatter/src/ts/bindings/type_parameter_modifier.rs index 642b8033884..3a7a0c42911 100644 --- a/crates/rome_js_formatter/src/ts/bindings/type_parameter_modifier.rs +++ b/crates/rome_js_formatter/src/ts/bindings/type_parameter_modifier.rs @@ -1,6 +1,5 @@ -use crate::format_traits::FormatOptional; -use crate::{format_elements, space_token, Format, FormatElement, FormatNode, Formatter}; -use rome_formatter::{empty_element, FormatResult}; +use crate::{format_elements, format_traits::FormatOptional, FormatElement, FormatNode, Formatter}; +use rome_formatter::FormatResult; use rome_js_syntax::{TsTypeParameterModifier, TsTypeParameterModifierFields}; impl FormatNode for TsTypeParameterModifier { @@ -10,8 +9,8 @@ impl FormatNode for TsTypeParameterModifier { out_token, } = self.as_fields(); Ok(format_elements![ - empty_element() // in_token.format_or_empty(formatter)?, - // out_token.format_or_empty(formatter)? + in_token.format_or_empty(formatter)?, + out_token.format_or_empty(formatter)? ]) } } diff --git a/crates/rome_js_parser/src/syntax/typescript/types.rs b/crates/rome_js_parser/src/syntax/typescript/types.rs index 7b5c38419ab..4139156f1b9 100644 --- a/crates/rome_js_parser/src/syntax/typescript/types.rs +++ b/crates/rome_js_parser/src/syntax/typescript/types.rs @@ -26,7 +26,7 @@ use crate::{ Absent, CompletedMarker, ParseNodeList, ParseRecovery, ParseSeparatedList, ParsedSyntax, Parser, Present, SyntaxFeature, }; -use rome_diagnostics::{Diagnostic, Span}; +use rome_diagnostics::Span; use rome_js_syntax::JsSyntaxKind::TS_TYPE_ANNOTATION; use rome_js_syntax::T; use rome_js_syntax::{JsSyntaxKind::*, *}; @@ -244,7 +244,7 @@ fn parse_ts_type_parameter_modifier( } else { // TODO: I am not sure if bump here is properly, but it is good for error recover let err = p - .err_builder(&format!("TypeParameterModifier `in` is not valid here",)) + .err_builder("TypeParameterModifier `in` is not valid here") .primary(p.cur_range(), ""); p.error(err); p.bump(T![in]); @@ -257,7 +257,7 @@ fn parse_ts_type_parameter_modifier( p.bump(T![out]); } else { let err = p - .err_builder(&format!("TypeParameterModifier `out` is not valid here",)) + .err_builder("TypeParameterModifier `out` is not valid here") .primary(p.cur_range(), ""); p.error(err); p.bump(T![out]); From 9c414d0a3fdda9ad5ceacb788f242b36079c051e Mon Sep 17 00:00:00 2001 From: IWANABETHATGUY Date: Mon, 9 May 2022 16:36:23 +0800 Subject: [PATCH 08/22] =?UTF-8?q?test:=20=F0=9F=92=8D=20add=20extra=20test?= =?UTF-8?q?=20case?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/syntax/typescript/types.rs | 1 + .../inline/ok/type_parameter_modifier.rast | 1050 +++++++++-------- .../inline/ok/type_parameter_modifier.ts | 1 + 3 files changed, 551 insertions(+), 501 deletions(-) diff --git a/crates/rome_js_parser/src/syntax/typescript/types.rs b/crates/rome_js_parser/src/syntax/typescript/types.rs index 4139156f1b9..131daf3cf37 100644 --- a/crates/rome_js_parser/src/syntax/typescript/types.rs +++ b/crates/rome_js_parser/src/syntax/typescript/types.rs @@ -213,6 +213,7 @@ impl ParseSeparatedList for TsTypeParameterList { // test ts type_parameter_modifier // type Foo = T +// type Foo = out // type Foo = T // type Foo = T // type Foo = T diff --git a/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.rast b/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.rast index 7471315dcea..4d0b673f426 100644 --- a/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.rast +++ b/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.rast @@ -42,23 +42,20 @@ JsModule { l_angle_token: L_ANGLE@27..28 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: missing (optional), - out_token: OUT_KW@28..32 "out" [] [Whitespace(" ")], - }, + modifier: missing (optional), name: TsTypeParameterName { - ident_token: IDENT@32..33 "T" [] [], + ident_token: IDENT@28..31 "out" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@33..35 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@31..33 ">" [] [Whitespace(" ")], }, - eq_token: EQ@35..37 "=" [] [Whitespace(" ")], + eq_token: EQ@33..35 "=" [] [Whitespace(" ")], ty: TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@37..38 "T" [] [], + value_token: IDENT@35..38 "out" [] [], }, type_arguments: missing (optional), }, @@ -74,236 +71,267 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { - in_token: IN_KW@48..51 "in" [] [Whitespace(" ")], + in_token: missing (optional), + out_token: OUT_KW@48..52 "out" [] [Whitespace(" ")], + }, + name: TsTypeParameterName { + ident_token: IDENT@52..53 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@53..55 ">" [] [Whitespace(" ")], + }, + eq_token: EQ@55..57 "=" [] [Whitespace(" ")], + ty: TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@57..58 "T" [] [], + }, + type_arguments: missing (optional), + }, + semicolon_token: missing (optional), + }, + TsTypeAliasDeclaration { + type_token: TYPE_KW@58..64 "type" [Newline("\n")] [Whitespace(" ")], + binding_identifier: TsIdentifierBinding { + name_token: IDENT@64..67 "Foo" [] [], + }, + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@67..68 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + modifier: TsTypeParameterModifier { + in_token: IN_KW@68..71 "in" [] [Whitespace(" ")], out_token: missing (optional), }, name: TsTypeParameterName { - ident_token: IDENT@51..54 "out" [] [], + ident_token: IDENT@71..74 "out" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@54..56 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@74..76 ">" [] [Whitespace(" ")], }, - eq_token: EQ@56..58 "=" [] [Whitespace(" ")], + eq_token: EQ@76..78 "=" [] [Whitespace(" ")], ty: TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@58..59 "T" [] [], + value_token: IDENT@78..79 "T" [] [], }, type_arguments: missing (optional), }, semicolon_token: missing (optional), }, TsTypeAliasDeclaration { - type_token: TYPE_KW@59..65 "type" [Newline("\n")] [Whitespace(" ")], + type_token: TYPE_KW@79..85 "type" [Newline("\n")] [Whitespace(" ")], binding_identifier: TsIdentifierBinding { - name_token: IDENT@65..68 "Foo" [] [], + name_token: IDENT@85..88 "Foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@68..69 "<" [] [], + l_angle_token: L_ANGLE@88..89 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { in_token: missing (optional), - out_token: OUT_KW@69..73 "out" [] [Whitespace(" ")], + out_token: OUT_KW@89..93 "out" [] [Whitespace(" ")], }, name: TsTypeParameterName { - ident_token: IDENT@73..76 "out" [] [], + ident_token: IDENT@93..96 "out" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@76..78 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@96..98 ">" [] [Whitespace(" ")], }, - eq_token: EQ@78..80 "=" [] [Whitespace(" ")], + eq_token: EQ@98..100 "=" [] [Whitespace(" ")], ty: TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@80..81 "T" [] [], + value_token: IDENT@100..101 "T" [] [], }, type_arguments: missing (optional), }, semicolon_token: missing (optional), }, TsTypeAliasDeclaration { - type_token: TYPE_KW@81..87 "type" [Newline("\n")] [Whitespace(" ")], + type_token: TYPE_KW@101..107 "type" [Newline("\n")] [Whitespace(" ")], binding_identifier: TsIdentifierBinding { - name_token: IDENT@87..90 "Foo" [] [], + name_token: IDENT@107..110 "Foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@90..91 "<" [] [], + l_angle_token: L_ANGLE@110..111 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { - in_token: IN_KW@91..94 "in" [] [Whitespace(" ")], - out_token: OUT_KW@94..98 "out" [] [Whitespace(" ")], + in_token: IN_KW@111..114 "in" [] [Whitespace(" ")], + out_token: OUT_KW@114..118 "out" [] [Whitespace(" ")], }, name: TsTypeParameterName { - ident_token: IDENT@98..101 "out" [] [], + ident_token: IDENT@118..121 "out" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@101..103 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@121..123 ">" [] [Whitespace(" ")], }, - eq_token: EQ@103..105 "=" [] [Whitespace(" ")], + eq_token: EQ@123..125 "=" [] [Whitespace(" ")], ty: TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@105..106 "T" [] [], + value_token: IDENT@125..126 "T" [] [], }, type_arguments: missing (optional), }, semicolon_token: missing (optional), }, TsTypeAliasDeclaration { - type_token: TYPE_KW@106..112 "type" [Newline("\n")] [Whitespace(" ")], + type_token: TYPE_KW@126..132 "type" [Newline("\n")] [Whitespace(" ")], binding_identifier: TsIdentifierBinding { - name_token: IDENT@112..115 "Foo" [] [], + name_token: IDENT@132..135 "Foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@115..116 "<" [] [], + l_angle_token: L_ANGLE@135..136 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { - in_token: IN_KW@116..119 "in" [] [Whitespace(" ")], + in_token: IN_KW@136..139 "in" [] [Whitespace(" ")], out_token: missing (optional), }, name: TsTypeParameterName { - ident_token: IDENT@119..120 "X" [] [], + ident_token: IDENT@139..140 "X" [] [], }, constraint: missing (optional), default: missing (optional), }, - COMMA@120..122 "," [] [Whitespace(" ")], + COMMA@140..142 "," [] [Whitespace(" ")], TsTypeParameter { modifier: TsTypeParameterModifier { in_token: missing (optional), - out_token: OUT_KW@122..126 "out" [] [Whitespace(" ")], + out_token: OUT_KW@142..146 "out" [] [Whitespace(" ")], }, name: TsTypeParameterName { - ident_token: IDENT@126..127 "Y" [] [], + ident_token: IDENT@146..147 "Y" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@127..129 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@147..149 ">" [] [Whitespace(" ")], }, - eq_token: EQ@129..131 "=" [] [Whitespace(" ")], + eq_token: EQ@149..151 "=" [] [Whitespace(" ")], ty: TsTupleType { - l_brack_token: L_BRACK@131..132 "[" [] [], + l_brack_token: L_BRACK@151..152 "[" [] [], elements: TsTupleTypeElementList [ TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@132..133 "X" [] [], + value_token: IDENT@152..153 "X" [] [], }, type_arguments: missing (optional), }, - COMMA@133..135 "," [] [Whitespace(" ")], + COMMA@153..155 "," [] [Whitespace(" ")], TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@135..136 "Y" [] [], + value_token: IDENT@155..156 "Y" [] [], }, type_arguments: missing (optional), }, ], - r_brack_token: R_BRACK@136..137 "]" [] [], + r_brack_token: R_BRACK@156..157 "]" [] [], }, semicolon_token: missing (optional), }, TsTypeAliasDeclaration { - type_token: TYPE_KW@137..143 "type" [Newline("\n")] [Whitespace(" ")], + type_token: TYPE_KW@157..163 "type" [Newline("\n")] [Whitespace(" ")], binding_identifier: TsIdentifierBinding { - name_token: IDENT@143..146 "Foo" [] [], + name_token: IDENT@163..166 "Foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@146..147 "<" [] [], + l_angle_token: L_ANGLE@166..167 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { in_token: missing (optional), - out_token: OUT_KW@147..151 "out" [] [Whitespace(" ")], + out_token: OUT_KW@167..171 "out" [] [Whitespace(" ")], }, name: TsTypeParameterName { - ident_token: IDENT@151..152 "X" [] [], + ident_token: IDENT@171..172 "X" [] [], }, constraint: missing (optional), default: missing (optional), }, - COMMA@152..154 "," [] [Whitespace(" ")], + COMMA@172..174 "," [] [Whitespace(" ")], TsTypeParameter { modifier: TsTypeParameterModifier { - in_token: IN_KW@154..157 "in" [] [Whitespace(" ")], + in_token: IN_KW@174..177 "in" [] [Whitespace(" ")], out_token: missing (optional), }, name: TsTypeParameterName { - ident_token: IDENT@157..158 "Y" [] [], + ident_token: IDENT@177..178 "Y" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@158..160 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@178..180 ">" [] [Whitespace(" ")], }, - eq_token: EQ@160..162 "=" [] [Whitespace(" ")], + eq_token: EQ@180..182 "=" [] [Whitespace(" ")], ty: TsTupleType { - l_brack_token: L_BRACK@162..163 "[" [] [], + l_brack_token: L_BRACK@182..183 "[" [] [], elements: TsTupleTypeElementList [ TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@163..164 "X" [] [], + value_token: IDENT@183..184 "X" [] [], }, type_arguments: missing (optional), }, - COMMA@164..166 "," [] [Whitespace(" ")], + COMMA@184..186 "," [] [Whitespace(" ")], TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@166..167 "Y" [] [], + value_token: IDENT@186..187 "Y" [] [], }, type_arguments: missing (optional), }, ], - r_brack_token: R_BRACK@167..168 "]" [] [], + r_brack_token: R_BRACK@187..188 "]" [] [], }, semicolon_token: missing (optional), }, TsTypeAliasDeclaration { - type_token: TYPE_KW@168..174 "type" [Newline("\n")] [Whitespace(" ")], + type_token: TYPE_KW@188..194 "type" [Newline("\n")] [Whitespace(" ")], binding_identifier: TsIdentifierBinding { - name_token: IDENT@174..177 "Foo" [] [], + name_token: IDENT@194..197 "Foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@177..178 "<" [] [], + l_angle_token: L_ANGLE@197..198 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { in_token: missing (optional), - out_token: OUT_KW@178..182 "out" [] [Whitespace(" ")], + out_token: OUT_KW@198..202 "out" [] [Whitespace(" ")], }, name: TsTypeParameterName { - ident_token: IDENT@182..183 "X" [] [], + ident_token: IDENT@202..203 "X" [] [], }, constraint: missing (optional), default: missing (optional), }, - COMMA@183..185 "," [] [Whitespace(" ")], + COMMA@203..205 "," [] [Whitespace(" ")], TsTypeParameter { modifier: TsTypeParameterModifier { in_token: missing (optional), - out_token: OUT_KW@185..189 "out" [] [Whitespace(" ")], + out_token: OUT_KW@205..209 "out" [] [Whitespace(" ")], }, name: TsTypeParameterName { - ident_token: IDENT@189..191 "Y" [] [Whitespace(" ")], + ident_token: IDENT@209..211 "Y" [] [Whitespace(" ")], }, constraint: TsTypeConstraintClause { - extends_token: EXTENDS_KW@191..199 "extends" [] [Whitespace(" ")], + extends_token: EXTENDS_KW@211..219 "extends" [] [Whitespace(" ")], ty: TsTypeOperatorType { - operator_token: KEYOF_KW@199..205 "keyof" [] [Whitespace(" ")], + operator_token: KEYOF_KW@219..225 "keyof" [] [Whitespace(" ")], ty: TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@205..206 "X" [] [], + value_token: IDENT@225..226 "X" [] [], }, type_arguments: missing (optional), }, @@ -312,339 +340,339 @@ JsModule { default: missing (optional), }, ], - r_angle_token: R_ANGLE@206..208 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@226..228 ">" [] [Whitespace(" ")], }, - eq_token: EQ@208..210 "=" [] [Whitespace(" ")], + eq_token: EQ@228..230 "=" [] [Whitespace(" ")], ty: TsTupleType { - l_brack_token: L_BRACK@210..211 "[" [] [], + l_brack_token: L_BRACK@230..231 "[" [] [], elements: TsTupleTypeElementList [ TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@211..212 "X" [] [], + value_token: IDENT@231..232 "X" [] [], }, type_arguments: missing (optional), }, - COMMA@212..214 "," [] [Whitespace(" ")], + COMMA@232..234 "," [] [Whitespace(" ")], TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@214..215 "Y" [] [], + value_token: IDENT@234..235 "Y" [] [], }, type_arguments: missing (optional), }, ], - r_brack_token: R_BRACK@215..216 "]" [] [], + r_brack_token: R_BRACK@235..236 "]" [] [], }, semicolon_token: missing (optional), }, JsClassDeclaration { abstract_token: missing (optional), - class_token: CLASS_KW@216..223 "class" [Newline("\n")] [Whitespace(" ")], + class_token: CLASS_KW@236..243 "class" [Newline("\n")] [Whitespace(" ")], id: JsIdentifierBinding { - name_token: IDENT@223..226 "Foo" [] [], + name_token: IDENT@243..246 "Foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@226..227 "<" [] [], + l_angle_token: L_ANGLE@246..247 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { - in_token: IN_KW@227..230 "in" [] [Whitespace(" ")], + in_token: IN_KW@247..250 "in" [] [Whitespace(" ")], out_token: missing (optional), }, name: TsTypeParameterName { - ident_token: IDENT@230..231 "T" [] [], + ident_token: IDENT@250..251 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@231..233 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@251..253 ">" [] [Whitespace(" ")], }, extends_clause: missing (optional), implements_clause: missing (optional), - l_curly_token: L_CURLY@233..234 "{" [] [], + l_curly_token: L_CURLY@253..254 "{" [] [], members: JsClassMemberList [], - r_curly_token: R_CURLY@234..235 "}" [] [], + r_curly_token: R_CURLY@254..255 "}" [] [], }, JsClassDeclaration { abstract_token: missing (optional), - class_token: CLASS_KW@235..242 "class" [Newline("\n")] [Whitespace(" ")], + class_token: CLASS_KW@255..262 "class" [Newline("\n")] [Whitespace(" ")], id: JsIdentifierBinding { - name_token: IDENT@242..245 "Foo" [] [], + name_token: IDENT@262..265 "Foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@245..246 "<" [] [], + l_angle_token: L_ANGLE@265..266 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { in_token: missing (optional), - out_token: OUT_KW@246..250 "out" [] [Whitespace(" ")], + out_token: OUT_KW@266..270 "out" [] [Whitespace(" ")], }, name: TsTypeParameterName { - ident_token: IDENT@250..251 "T" [] [], + ident_token: IDENT@270..271 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@251..253 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@271..273 ">" [] [Whitespace(" ")], }, extends_clause: missing (optional), implements_clause: missing (optional), - l_curly_token: L_CURLY@253..254 "{" [] [], + l_curly_token: L_CURLY@273..274 "{" [] [], members: JsClassMemberList [], - r_curly_token: R_CURLY@254..255 "}" [] [], + r_curly_token: R_CURLY@274..275 "}" [] [], }, JsExport { - export_token: EXPORT_KW@255..263 "export" [Newline("\n")] [Whitespace(" ")], + export_token: EXPORT_KW@275..283 "export" [Newline("\n")] [Whitespace(" ")], export_clause: JsExportDefaultDeclarationClause { - default_token: DEFAULT_KW@263..271 "default" [] [Whitespace(" ")], + default_token: DEFAULT_KW@283..291 "default" [] [Whitespace(" ")], declaration: JsClassExportDefaultDeclaration { abstract_token: missing (optional), - class_token: CLASS_KW@271..277 "class" [] [Whitespace(" ")], + class_token: CLASS_KW@291..297 "class" [] [Whitespace(" ")], id: JsIdentifierBinding { - name_token: IDENT@277..280 "Foo" [] [], + name_token: IDENT@297..300 "Foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@280..281 "<" [] [], + l_angle_token: L_ANGLE@300..301 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { - in_token: IN_KW@281..284 "in" [] [Whitespace(" ")], + in_token: IN_KW@301..304 "in" [] [Whitespace(" ")], out_token: missing (optional), }, name: TsTypeParameterName { - ident_token: IDENT@284..285 "T" [] [], + ident_token: IDENT@304..305 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@285..287 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@305..307 ">" [] [Whitespace(" ")], }, extends_clause: missing (optional), implements_clause: missing (optional), - l_curly_token: L_CURLY@287..288 "{" [] [], + l_curly_token: L_CURLY@307..308 "{" [] [], members: JsClassMemberList [], - r_curly_token: R_CURLY@288..289 "}" [] [], + r_curly_token: R_CURLY@308..309 "}" [] [], }, semicolon_token: missing (optional), }, }, JsClassDeclaration { abstract_token: missing (optional), - class_token: CLASS_KW@289..296 "class" [Newline("\n")] [Whitespace(" ")], + class_token: CLASS_KW@309..316 "class" [Newline("\n")] [Whitespace(" ")], id: JsIdentifierBinding { - name_token: IDENT@296..299 "Foo" [] [], + name_token: IDENT@316..319 "Foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@299..300 "<" [] [], + l_angle_token: L_ANGLE@319..320 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { in_token: missing (optional), - out_token: OUT_KW@300..304 "out" [] [Whitespace(" ")], + out_token: OUT_KW@320..324 "out" [] [Whitespace(" ")], }, name: TsTypeParameterName { - ident_token: IDENT@304..305 "T" [] [], + ident_token: IDENT@324..325 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@305..307 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@325..327 ">" [] [Whitespace(" ")], }, extends_clause: missing (optional), implements_clause: missing (optional), - l_curly_token: L_CURLY@307..308 "{" [] [], + l_curly_token: L_CURLY@327..328 "{" [] [], members: JsClassMemberList [], - r_curly_token: R_CURLY@308..309 "}" [] [], + r_curly_token: R_CURLY@328..329 "}" [] [], }, TsInterfaceDeclaration { - interface_token: INTERFACE_KW@309..320 "interface" [Newline("\n")] [Whitespace(" ")], + interface_token: INTERFACE_KW@329..340 "interface" [Newline("\n")] [Whitespace(" ")], id: TsIdentifierBinding { - name_token: IDENT@320..323 "Foo" [] [], + name_token: IDENT@340..343 "Foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@323..324 "<" [] [], + l_angle_token: L_ANGLE@343..344 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { - in_token: IN_KW@324..327 "in" [] [Whitespace(" ")], + in_token: IN_KW@344..347 "in" [] [Whitespace(" ")], out_token: missing (optional), }, name: TsTypeParameterName { - ident_token: IDENT@327..328 "T" [] [], + ident_token: IDENT@347..348 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@328..330 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@348..350 ">" [] [Whitespace(" ")], }, extends_clause: missing (optional), - l_curly_token: L_CURLY@330..331 "{" [] [], + l_curly_token: L_CURLY@350..351 "{" [] [], members: TsTypeMemberList [], - r_curly_token: R_CURLY@331..332 "}" [] [], + r_curly_token: R_CURLY@351..352 "}" [] [], }, TsInterfaceDeclaration { - interface_token: INTERFACE_KW@332..343 "interface" [Newline("\n")] [Whitespace(" ")], + interface_token: INTERFACE_KW@352..363 "interface" [Newline("\n")] [Whitespace(" ")], id: TsIdentifierBinding { - name_token: IDENT@343..346 "Foo" [] [], + name_token: IDENT@363..366 "Foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@346..347 "<" [] [], + l_angle_token: L_ANGLE@366..367 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { in_token: missing (optional), - out_token: OUT_KW@347..351 "out" [] [Whitespace(" ")], + out_token: OUT_KW@367..371 "out" [] [Whitespace(" ")], }, name: TsTypeParameterName { - ident_token: IDENT@351..352 "T" [] [], + ident_token: IDENT@371..372 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@352..354 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@372..374 ">" [] [Whitespace(" ")], }, extends_clause: missing (optional), - l_curly_token: L_CURLY@354..355 "{" [] [], + l_curly_token: L_CURLY@374..375 "{" [] [], members: TsTypeMemberList [], - r_curly_token: R_CURLY@355..356 "}" [] [], + r_curly_token: R_CURLY@375..376 "}" [] [], }, TsDeclareStatement { - declare_token: DECLARE_KW@356..365 "declare" [Newline("\n")] [Whitespace(" ")], + declare_token: DECLARE_KW@376..385 "declare" [Newline("\n")] [Whitespace(" ")], declaration: JsClassDeclaration { abstract_token: missing (optional), - class_token: CLASS_KW@365..371 "class" [] [Whitespace(" ")], + class_token: CLASS_KW@385..391 "class" [] [Whitespace(" ")], id: JsIdentifierBinding { - name_token: IDENT@371..374 "Foo" [] [], + name_token: IDENT@391..394 "Foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@374..375 "<" [] [], + l_angle_token: L_ANGLE@394..395 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { - in_token: IN_KW@375..378 "in" [] [Whitespace(" ")], + in_token: IN_KW@395..398 "in" [] [Whitespace(" ")], out_token: missing (optional), }, name: TsTypeParameterName { - ident_token: IDENT@378..379 "T" [] [], + ident_token: IDENT@398..399 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@379..381 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@399..401 ">" [] [Whitespace(" ")], }, extends_clause: missing (optional), implements_clause: missing (optional), - l_curly_token: L_CURLY@381..382 "{" [] [], + l_curly_token: L_CURLY@401..402 "{" [] [], members: JsClassMemberList [], - r_curly_token: R_CURLY@382..383 "}" [] [], + r_curly_token: R_CURLY@402..403 "}" [] [], }, }, TsDeclareStatement { - declare_token: DECLARE_KW@383..392 "declare" [Newline("\n")] [Whitespace(" ")], + declare_token: DECLARE_KW@403..412 "declare" [Newline("\n")] [Whitespace(" ")], declaration: JsClassDeclaration { abstract_token: missing (optional), - class_token: CLASS_KW@392..398 "class" [] [Whitespace(" ")], + class_token: CLASS_KW@412..418 "class" [] [Whitespace(" ")], id: JsIdentifierBinding { - name_token: IDENT@398..401 "Foo" [] [], + name_token: IDENT@418..421 "Foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@401..402 "<" [] [], + l_angle_token: L_ANGLE@421..422 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { in_token: missing (optional), - out_token: OUT_KW@402..406 "out" [] [Whitespace(" ")], + out_token: OUT_KW@422..426 "out" [] [Whitespace(" ")], }, name: TsTypeParameterName { - ident_token: IDENT@406..407 "T" [] [], + ident_token: IDENT@426..427 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@407..409 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@427..429 ">" [] [Whitespace(" ")], }, extends_clause: missing (optional), implements_clause: missing (optional), - l_curly_token: L_CURLY@409..410 "{" [] [], + l_curly_token: L_CURLY@429..430 "{" [] [], members: JsClassMemberList [], - r_curly_token: R_CURLY@410..411 "}" [] [], + r_curly_token: R_CURLY@430..431 "}" [] [], }, }, TsDeclareStatement { - declare_token: DECLARE_KW@411..420 "declare" [Newline("\n")] [Whitespace(" ")], + declare_token: DECLARE_KW@431..440 "declare" [Newline("\n")] [Whitespace(" ")], declaration: TsInterfaceDeclaration { - interface_token: INTERFACE_KW@420..430 "interface" [] [Whitespace(" ")], + interface_token: INTERFACE_KW@440..450 "interface" [] [Whitespace(" ")], id: TsIdentifierBinding { - name_token: IDENT@430..433 "Foo" [] [], + name_token: IDENT@450..453 "Foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@433..434 "<" [] [], + l_angle_token: L_ANGLE@453..454 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { - in_token: IN_KW@434..437 "in" [] [Whitespace(" ")], + in_token: IN_KW@454..457 "in" [] [Whitespace(" ")], out_token: missing (optional), }, name: TsTypeParameterName { - ident_token: IDENT@437..438 "T" [] [], + ident_token: IDENT@457..458 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@438..440 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@458..460 ">" [] [Whitespace(" ")], }, extends_clause: missing (optional), - l_curly_token: L_CURLY@440..441 "{" [] [], + l_curly_token: L_CURLY@460..461 "{" [] [], members: TsTypeMemberList [], - r_curly_token: R_CURLY@441..442 "}" [] [], + r_curly_token: R_CURLY@461..462 "}" [] [], }, }, TsDeclareStatement { - declare_token: DECLARE_KW@442..451 "declare" [Newline("\n")] [Whitespace(" ")], + declare_token: DECLARE_KW@462..471 "declare" [Newline("\n")] [Whitespace(" ")], declaration: TsInterfaceDeclaration { - interface_token: INTERFACE_KW@451..461 "interface" [] [Whitespace(" ")], + interface_token: INTERFACE_KW@471..481 "interface" [] [Whitespace(" ")], id: TsIdentifierBinding { - name_token: IDENT@461..464 "Foo" [] [], + name_token: IDENT@481..484 "Foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@464..465 "<" [] [], + l_angle_token: L_ANGLE@484..485 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { modifier: TsTypeParameterModifier { in_token: missing (optional), - out_token: OUT_KW@465..469 "out" [] [Whitespace(" ")], + out_token: OUT_KW@485..489 "out" [] [Whitespace(" ")], }, name: TsTypeParameterName { - ident_token: IDENT@469..470 "T" [] [], + ident_token: IDENT@489..490 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@470..472 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@490..492 ">" [] [Whitespace(" ")], }, extends_clause: missing (optional), - l_curly_token: L_CURLY@472..473 "{" [] [], + l_curly_token: L_CURLY@492..493 "{" [] [], members: TsTypeMemberList [], - r_curly_token: R_CURLY@473..474 "}" [] [], + r_curly_token: R_CURLY@493..494 "}" [] [], }, }, ], - eof_token: EOF@474..475 "" [Newline("\n")] [], + eof_token: EOF@494..495 "" [Newline("\n")] [], } -0: JS_MODULE@0..475 +0: JS_MODULE@0..495 0: (empty) 1: JS_DIRECTIVE_LIST@0..0 - 2: JS_MODULE_ITEM_LIST@0..474 + 2: JS_MODULE_ITEM_LIST@0..494 0: TS_TYPE_ALIAS_DECLARATION@0..18 0: TYPE_KW@0..5 "type" [] [Whitespace(" ")] 1: TS_IDENTIFIER_BINDING@5..8 @@ -671,251 +699,249 @@ JsModule { 0: TYPE_KW@18..24 "type" [Newline("\n")] [Whitespace(" ")] 1: TS_IDENTIFIER_BINDING@24..27 0: IDENT@24..27 "Foo" [] [] - 2: TS_TYPE_PARAMETERS@27..35 + 2: TS_TYPE_PARAMETERS@27..33 0: L_ANGLE@27..28 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@28..33 - 0: TS_TYPE_PARAMETER@28..33 - 0: TS_TYPE_PARAMETER_MODIFIER@28..32 - 0: (empty) - 1: OUT_KW@28..32 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@32..33 - 0: IDENT@32..33 "T" [] [] + 1: TS_TYPE_PARAMETER_LIST@28..31 + 0: TS_TYPE_PARAMETER@28..31 + 0: (empty) + 1: TS_TYPE_PARAMETER_NAME@28..31 + 0: IDENT@28..31 "out" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@33..35 ">" [] [Whitespace(" ")] - 3: EQ@35..37 "=" [] [Whitespace(" ")] - 4: TS_REFERENCE_TYPE@37..38 - 0: JS_REFERENCE_IDENTIFIER@37..38 - 0: IDENT@37..38 "T" [] [] + 2: R_ANGLE@31..33 ">" [] [Whitespace(" ")] + 3: EQ@33..35 "=" [] [Whitespace(" ")] + 4: TS_REFERENCE_TYPE@35..38 + 0: JS_REFERENCE_IDENTIFIER@35..38 + 0: IDENT@35..38 "out" [] [] 1: (empty) 5: (empty) - 2: TS_TYPE_ALIAS_DECLARATION@38..59 + 2: TS_TYPE_ALIAS_DECLARATION@38..58 0: TYPE_KW@38..44 "type" [Newline("\n")] [Whitespace(" ")] 1: TS_IDENTIFIER_BINDING@44..47 0: IDENT@44..47 "Foo" [] [] - 2: TS_TYPE_PARAMETERS@47..56 + 2: TS_TYPE_PARAMETERS@47..55 0: L_ANGLE@47..48 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@48..54 - 0: TS_TYPE_PARAMETER@48..54 - 0: TS_TYPE_PARAMETER_MODIFIER@48..51 - 0: IN_KW@48..51 "in" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_LIST@48..53 + 0: TS_TYPE_PARAMETER@48..53 + 0: TS_TYPE_PARAMETER_MODIFIER@48..52 + 0: (empty) + 1: OUT_KW@48..52 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@52..53 + 0: IDENT@52..53 "T" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@53..55 ">" [] [Whitespace(" ")] + 3: EQ@55..57 "=" [] [Whitespace(" ")] + 4: TS_REFERENCE_TYPE@57..58 + 0: JS_REFERENCE_IDENTIFIER@57..58 + 0: IDENT@57..58 "T" [] [] + 1: (empty) + 5: (empty) + 3: TS_TYPE_ALIAS_DECLARATION@58..79 + 0: TYPE_KW@58..64 "type" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@64..67 + 0: IDENT@64..67 "Foo" [] [] + 2: TS_TYPE_PARAMETERS@67..76 + 0: L_ANGLE@67..68 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@68..74 + 0: TS_TYPE_PARAMETER@68..74 + 0: TS_TYPE_PARAMETER_MODIFIER@68..71 + 0: IN_KW@68..71 "in" [] [Whitespace(" ")] 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@51..54 - 0: IDENT@51..54 "out" [] [] + 1: TS_TYPE_PARAMETER_NAME@71..74 + 0: IDENT@71..74 "out" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@54..56 ">" [] [Whitespace(" ")] - 3: EQ@56..58 "=" [] [Whitespace(" ")] - 4: TS_REFERENCE_TYPE@58..59 - 0: JS_REFERENCE_IDENTIFIER@58..59 - 0: IDENT@58..59 "T" [] [] + 2: R_ANGLE@74..76 ">" [] [Whitespace(" ")] + 3: EQ@76..78 "=" [] [Whitespace(" ")] + 4: TS_REFERENCE_TYPE@78..79 + 0: JS_REFERENCE_IDENTIFIER@78..79 + 0: IDENT@78..79 "T" [] [] 1: (empty) 5: (empty) - 3: TS_TYPE_ALIAS_DECLARATION@59..81 - 0: TYPE_KW@59..65 "type" [Newline("\n")] [Whitespace(" ")] - 1: TS_IDENTIFIER_BINDING@65..68 - 0: IDENT@65..68 "Foo" [] [] - 2: TS_TYPE_PARAMETERS@68..78 - 0: L_ANGLE@68..69 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@69..76 - 0: TS_TYPE_PARAMETER@69..76 - 0: TS_TYPE_PARAMETER_MODIFIER@69..73 + 4: TS_TYPE_ALIAS_DECLARATION@79..101 + 0: TYPE_KW@79..85 "type" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@85..88 + 0: IDENT@85..88 "Foo" [] [] + 2: TS_TYPE_PARAMETERS@88..98 + 0: L_ANGLE@88..89 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@89..96 + 0: TS_TYPE_PARAMETER@89..96 + 0: TS_TYPE_PARAMETER_MODIFIER@89..93 0: (empty) - 1: OUT_KW@69..73 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@73..76 - 0: IDENT@73..76 "out" [] [] + 1: OUT_KW@89..93 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@93..96 + 0: IDENT@93..96 "out" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@76..78 ">" [] [Whitespace(" ")] - 3: EQ@78..80 "=" [] [Whitespace(" ")] - 4: TS_REFERENCE_TYPE@80..81 - 0: JS_REFERENCE_IDENTIFIER@80..81 - 0: IDENT@80..81 "T" [] [] + 2: R_ANGLE@96..98 ">" [] [Whitespace(" ")] + 3: EQ@98..100 "=" [] [Whitespace(" ")] + 4: TS_REFERENCE_TYPE@100..101 + 0: JS_REFERENCE_IDENTIFIER@100..101 + 0: IDENT@100..101 "T" [] [] 1: (empty) 5: (empty) - 4: TS_TYPE_ALIAS_DECLARATION@81..106 - 0: TYPE_KW@81..87 "type" [Newline("\n")] [Whitespace(" ")] - 1: TS_IDENTIFIER_BINDING@87..90 - 0: IDENT@87..90 "Foo" [] [] - 2: TS_TYPE_PARAMETERS@90..103 - 0: L_ANGLE@90..91 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@91..101 - 0: TS_TYPE_PARAMETER@91..101 - 0: TS_TYPE_PARAMETER_MODIFIER@91..98 - 0: IN_KW@91..94 "in" [] [Whitespace(" ")] - 1: OUT_KW@94..98 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@98..101 - 0: IDENT@98..101 "out" [] [] + 5: TS_TYPE_ALIAS_DECLARATION@101..126 + 0: TYPE_KW@101..107 "type" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@107..110 + 0: IDENT@107..110 "Foo" [] [] + 2: TS_TYPE_PARAMETERS@110..123 + 0: L_ANGLE@110..111 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@111..121 + 0: TS_TYPE_PARAMETER@111..121 + 0: TS_TYPE_PARAMETER_MODIFIER@111..118 + 0: IN_KW@111..114 "in" [] [Whitespace(" ")] + 1: OUT_KW@114..118 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@118..121 + 0: IDENT@118..121 "out" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@101..103 ">" [] [Whitespace(" ")] - 3: EQ@103..105 "=" [] [Whitespace(" ")] - 4: TS_REFERENCE_TYPE@105..106 - 0: JS_REFERENCE_IDENTIFIER@105..106 - 0: IDENT@105..106 "T" [] [] + 2: R_ANGLE@121..123 ">" [] [Whitespace(" ")] + 3: EQ@123..125 "=" [] [Whitespace(" ")] + 4: TS_REFERENCE_TYPE@125..126 + 0: JS_REFERENCE_IDENTIFIER@125..126 + 0: IDENT@125..126 "T" [] [] 1: (empty) 5: (empty) - 5: TS_TYPE_ALIAS_DECLARATION@106..137 - 0: TYPE_KW@106..112 "type" [Newline("\n")] [Whitespace(" ")] - 1: TS_IDENTIFIER_BINDING@112..115 - 0: IDENT@112..115 "Foo" [] [] - 2: TS_TYPE_PARAMETERS@115..129 - 0: L_ANGLE@115..116 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@116..127 - 0: TS_TYPE_PARAMETER@116..120 - 0: TS_TYPE_PARAMETER_MODIFIER@116..119 - 0: IN_KW@116..119 "in" [] [Whitespace(" ")] + 6: TS_TYPE_ALIAS_DECLARATION@126..157 + 0: TYPE_KW@126..132 "type" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@132..135 + 0: IDENT@132..135 "Foo" [] [] + 2: TS_TYPE_PARAMETERS@135..149 + 0: L_ANGLE@135..136 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@136..147 + 0: TS_TYPE_PARAMETER@136..140 + 0: TS_TYPE_PARAMETER_MODIFIER@136..139 + 0: IN_KW@136..139 "in" [] [Whitespace(" ")] 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@119..120 - 0: IDENT@119..120 "X" [] [] + 1: TS_TYPE_PARAMETER_NAME@139..140 + 0: IDENT@139..140 "X" [] [] 2: (empty) 3: (empty) - 1: COMMA@120..122 "," [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER@122..127 - 0: TS_TYPE_PARAMETER_MODIFIER@122..126 + 1: COMMA@140..142 "," [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER@142..147 + 0: TS_TYPE_PARAMETER_MODIFIER@142..146 0: (empty) - 1: OUT_KW@122..126 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@126..127 - 0: IDENT@126..127 "Y" [] [] + 1: OUT_KW@142..146 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@146..147 + 0: IDENT@146..147 "Y" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@127..129 ">" [] [Whitespace(" ")] - 3: EQ@129..131 "=" [] [Whitespace(" ")] - 4: TS_TUPLE_TYPE@131..137 - 0: L_BRACK@131..132 "[" [] [] - 1: TS_TUPLE_TYPE_ELEMENT_LIST@132..136 - 0: TS_REFERENCE_TYPE@132..133 - 0: JS_REFERENCE_IDENTIFIER@132..133 - 0: IDENT@132..133 "X" [] [] + 2: R_ANGLE@147..149 ">" [] [Whitespace(" ")] + 3: EQ@149..151 "=" [] [Whitespace(" ")] + 4: TS_TUPLE_TYPE@151..157 + 0: L_BRACK@151..152 "[" [] [] + 1: TS_TUPLE_TYPE_ELEMENT_LIST@152..156 + 0: TS_REFERENCE_TYPE@152..153 + 0: JS_REFERENCE_IDENTIFIER@152..153 + 0: IDENT@152..153 "X" [] [] 1: (empty) - 1: COMMA@133..135 "," [] [Whitespace(" ")] - 2: TS_REFERENCE_TYPE@135..136 - 0: JS_REFERENCE_IDENTIFIER@135..136 - 0: IDENT@135..136 "Y" [] [] + 1: COMMA@153..155 "," [] [Whitespace(" ")] + 2: TS_REFERENCE_TYPE@155..156 + 0: JS_REFERENCE_IDENTIFIER@155..156 + 0: IDENT@155..156 "Y" [] [] 1: (empty) - 2: R_BRACK@136..137 "]" [] [] + 2: R_BRACK@156..157 "]" [] [] 5: (empty) - 6: TS_TYPE_ALIAS_DECLARATION@137..168 - 0: TYPE_KW@137..143 "type" [Newline("\n")] [Whitespace(" ")] - 1: TS_IDENTIFIER_BINDING@143..146 - 0: IDENT@143..146 "Foo" [] [] - 2: TS_TYPE_PARAMETERS@146..160 - 0: L_ANGLE@146..147 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@147..158 - 0: TS_TYPE_PARAMETER@147..152 - 0: TS_TYPE_PARAMETER_MODIFIER@147..151 + 7: TS_TYPE_ALIAS_DECLARATION@157..188 + 0: TYPE_KW@157..163 "type" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@163..166 + 0: IDENT@163..166 "Foo" [] [] + 2: TS_TYPE_PARAMETERS@166..180 + 0: L_ANGLE@166..167 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@167..178 + 0: TS_TYPE_PARAMETER@167..172 + 0: TS_TYPE_PARAMETER_MODIFIER@167..171 0: (empty) - 1: OUT_KW@147..151 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@151..152 - 0: IDENT@151..152 "X" [] [] + 1: OUT_KW@167..171 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@171..172 + 0: IDENT@171..172 "X" [] [] 2: (empty) 3: (empty) - 1: COMMA@152..154 "," [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER@154..158 - 0: TS_TYPE_PARAMETER_MODIFIER@154..157 - 0: IN_KW@154..157 "in" [] [Whitespace(" ")] + 1: COMMA@172..174 "," [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER@174..178 + 0: TS_TYPE_PARAMETER_MODIFIER@174..177 + 0: IN_KW@174..177 "in" [] [Whitespace(" ")] 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@157..158 - 0: IDENT@157..158 "Y" [] [] + 1: TS_TYPE_PARAMETER_NAME@177..178 + 0: IDENT@177..178 "Y" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@158..160 ">" [] [Whitespace(" ")] - 3: EQ@160..162 "=" [] [Whitespace(" ")] - 4: TS_TUPLE_TYPE@162..168 - 0: L_BRACK@162..163 "[" [] [] - 1: TS_TUPLE_TYPE_ELEMENT_LIST@163..167 - 0: TS_REFERENCE_TYPE@163..164 - 0: JS_REFERENCE_IDENTIFIER@163..164 - 0: IDENT@163..164 "X" [] [] + 2: R_ANGLE@178..180 ">" [] [Whitespace(" ")] + 3: EQ@180..182 "=" [] [Whitespace(" ")] + 4: TS_TUPLE_TYPE@182..188 + 0: L_BRACK@182..183 "[" [] [] + 1: TS_TUPLE_TYPE_ELEMENT_LIST@183..187 + 0: TS_REFERENCE_TYPE@183..184 + 0: JS_REFERENCE_IDENTIFIER@183..184 + 0: IDENT@183..184 "X" [] [] 1: (empty) - 1: COMMA@164..166 "," [] [Whitespace(" ")] - 2: TS_REFERENCE_TYPE@166..167 - 0: JS_REFERENCE_IDENTIFIER@166..167 - 0: IDENT@166..167 "Y" [] [] + 1: COMMA@184..186 "," [] [Whitespace(" ")] + 2: TS_REFERENCE_TYPE@186..187 + 0: JS_REFERENCE_IDENTIFIER@186..187 + 0: IDENT@186..187 "Y" [] [] 1: (empty) - 2: R_BRACK@167..168 "]" [] [] + 2: R_BRACK@187..188 "]" [] [] 5: (empty) - 7: TS_TYPE_ALIAS_DECLARATION@168..216 - 0: TYPE_KW@168..174 "type" [Newline("\n")] [Whitespace(" ")] - 1: TS_IDENTIFIER_BINDING@174..177 - 0: IDENT@174..177 "Foo" [] [] - 2: TS_TYPE_PARAMETERS@177..208 - 0: L_ANGLE@177..178 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@178..206 - 0: TS_TYPE_PARAMETER@178..183 - 0: TS_TYPE_PARAMETER_MODIFIER@178..182 + 8: TS_TYPE_ALIAS_DECLARATION@188..236 + 0: TYPE_KW@188..194 "type" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@194..197 + 0: IDENT@194..197 "Foo" [] [] + 2: TS_TYPE_PARAMETERS@197..228 + 0: L_ANGLE@197..198 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@198..226 + 0: TS_TYPE_PARAMETER@198..203 + 0: TS_TYPE_PARAMETER_MODIFIER@198..202 0: (empty) - 1: OUT_KW@178..182 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@182..183 - 0: IDENT@182..183 "X" [] [] + 1: OUT_KW@198..202 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@202..203 + 0: IDENT@202..203 "X" [] [] 2: (empty) 3: (empty) - 1: COMMA@183..185 "," [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER@185..206 - 0: TS_TYPE_PARAMETER_MODIFIER@185..189 + 1: COMMA@203..205 "," [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER@205..226 + 0: TS_TYPE_PARAMETER_MODIFIER@205..209 0: (empty) - 1: OUT_KW@185..189 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@189..191 - 0: IDENT@189..191 "Y" [] [Whitespace(" ")] - 2: TS_TYPE_CONSTRAINT_CLAUSE@191..206 - 0: EXTENDS_KW@191..199 "extends" [] [Whitespace(" ")] - 1: TS_TYPE_OPERATOR_TYPE@199..206 - 0: KEYOF_KW@199..205 "keyof" [] [Whitespace(" ")] - 1: TS_REFERENCE_TYPE@205..206 - 0: JS_REFERENCE_IDENTIFIER@205..206 - 0: IDENT@205..206 "X" [] [] + 1: OUT_KW@205..209 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@209..211 + 0: IDENT@209..211 "Y" [] [Whitespace(" ")] + 2: TS_TYPE_CONSTRAINT_CLAUSE@211..226 + 0: EXTENDS_KW@211..219 "extends" [] [Whitespace(" ")] + 1: TS_TYPE_OPERATOR_TYPE@219..226 + 0: KEYOF_KW@219..225 "keyof" [] [Whitespace(" ")] + 1: TS_REFERENCE_TYPE@225..226 + 0: JS_REFERENCE_IDENTIFIER@225..226 + 0: IDENT@225..226 "X" [] [] 1: (empty) 3: (empty) - 2: R_ANGLE@206..208 ">" [] [Whitespace(" ")] - 3: EQ@208..210 "=" [] [Whitespace(" ")] - 4: TS_TUPLE_TYPE@210..216 - 0: L_BRACK@210..211 "[" [] [] - 1: TS_TUPLE_TYPE_ELEMENT_LIST@211..215 - 0: TS_REFERENCE_TYPE@211..212 - 0: JS_REFERENCE_IDENTIFIER@211..212 - 0: IDENT@211..212 "X" [] [] + 2: R_ANGLE@226..228 ">" [] [Whitespace(" ")] + 3: EQ@228..230 "=" [] [Whitespace(" ")] + 4: TS_TUPLE_TYPE@230..236 + 0: L_BRACK@230..231 "[" [] [] + 1: TS_TUPLE_TYPE_ELEMENT_LIST@231..235 + 0: TS_REFERENCE_TYPE@231..232 + 0: JS_REFERENCE_IDENTIFIER@231..232 + 0: IDENT@231..232 "X" [] [] 1: (empty) - 1: COMMA@212..214 "," [] [Whitespace(" ")] - 2: TS_REFERENCE_TYPE@214..215 - 0: JS_REFERENCE_IDENTIFIER@214..215 - 0: IDENT@214..215 "Y" [] [] + 1: COMMA@232..234 "," [] [Whitespace(" ")] + 2: TS_REFERENCE_TYPE@234..235 + 0: JS_REFERENCE_IDENTIFIER@234..235 + 0: IDENT@234..235 "Y" [] [] 1: (empty) - 2: R_BRACK@215..216 "]" [] [] + 2: R_BRACK@235..236 "]" [] [] 5: (empty) - 8: JS_CLASS_DECLARATION@216..235 + 9: JS_CLASS_DECLARATION@236..255 0: (empty) - 1: CLASS_KW@216..223 "class" [Newline("\n")] [Whitespace(" ")] - 2: JS_IDENTIFIER_BINDING@223..226 - 0: IDENT@223..226 "Foo" [] [] - 3: TS_TYPE_PARAMETERS@226..233 - 0: L_ANGLE@226..227 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@227..231 - 0: TS_TYPE_PARAMETER@227..231 - 0: TS_TYPE_PARAMETER_MODIFIER@227..230 - 0: IN_KW@227..230 "in" [] [Whitespace(" ")] + 1: CLASS_KW@236..243 "class" [Newline("\n")] [Whitespace(" ")] + 2: JS_IDENTIFIER_BINDING@243..246 + 0: IDENT@243..246 "Foo" [] [] + 3: TS_TYPE_PARAMETERS@246..253 + 0: L_ANGLE@246..247 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@247..251 + 0: TS_TYPE_PARAMETER@247..251 + 0: TS_TYPE_PARAMETER_MODIFIER@247..250 + 0: IN_KW@247..250 "in" [] [Whitespace(" ")] 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@230..231 - 0: IDENT@230..231 "T" [] [] - 2: (empty) - 3: (empty) - 2: R_ANGLE@231..233 ">" [] [Whitespace(" ")] - 4: (empty) - 5: (empty) - 6: L_CURLY@233..234 "{" [] [] - 7: JS_CLASS_MEMBER_LIST@234..234 - 8: R_CURLY@234..235 "}" [] [] - 9: JS_CLASS_DECLARATION@235..255 - 0: (empty) - 1: CLASS_KW@235..242 "class" [Newline("\n")] [Whitespace(" ")] - 2: JS_IDENTIFIER_BINDING@242..245 - 0: IDENT@242..245 "Foo" [] [] - 3: TS_TYPE_PARAMETERS@245..253 - 0: L_ANGLE@245..246 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@246..251 - 0: TS_TYPE_PARAMETER@246..251 - 0: TS_TYPE_PARAMETER_MODIFIER@246..250 - 0: (empty) - 1: OUT_KW@246..250 "out" [] [Whitespace(" ")] 1: TS_TYPE_PARAMETER_NAME@250..251 0: IDENT@250..251 "T" [] [] 2: (empty) @@ -926,185 +952,207 @@ JsModule { 6: L_CURLY@253..254 "{" [] [] 7: JS_CLASS_MEMBER_LIST@254..254 8: R_CURLY@254..255 "}" [] [] - 10: JS_EXPORT@255..289 - 0: EXPORT_KW@255..263 "export" [Newline("\n")] [Whitespace(" ")] - 1: JS_EXPORT_DEFAULT_DECLARATION_CLAUSE@263..289 - 0: DEFAULT_KW@263..271 "default" [] [Whitespace(" ")] - 1: JS_CLASS_EXPORT_DEFAULT_DECLARATION@271..289 + 10: JS_CLASS_DECLARATION@255..275 + 0: (empty) + 1: CLASS_KW@255..262 "class" [Newline("\n")] [Whitespace(" ")] + 2: JS_IDENTIFIER_BINDING@262..265 + 0: IDENT@262..265 "Foo" [] [] + 3: TS_TYPE_PARAMETERS@265..273 + 0: L_ANGLE@265..266 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@266..271 + 0: TS_TYPE_PARAMETER@266..271 + 0: TS_TYPE_PARAMETER_MODIFIER@266..270 + 0: (empty) + 1: OUT_KW@266..270 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@270..271 + 0: IDENT@270..271 "T" [] [] + 2: (empty) + 3: (empty) + 2: R_ANGLE@271..273 ">" [] [Whitespace(" ")] + 4: (empty) + 5: (empty) + 6: L_CURLY@273..274 "{" [] [] + 7: JS_CLASS_MEMBER_LIST@274..274 + 8: R_CURLY@274..275 "}" [] [] + 11: JS_EXPORT@275..309 + 0: EXPORT_KW@275..283 "export" [Newline("\n")] [Whitespace(" ")] + 1: JS_EXPORT_DEFAULT_DECLARATION_CLAUSE@283..309 + 0: DEFAULT_KW@283..291 "default" [] [Whitespace(" ")] + 1: JS_CLASS_EXPORT_DEFAULT_DECLARATION@291..309 0: (empty) - 1: CLASS_KW@271..277 "class" [] [Whitespace(" ")] - 2: JS_IDENTIFIER_BINDING@277..280 - 0: IDENT@277..280 "Foo" [] [] - 3: TS_TYPE_PARAMETERS@280..287 - 0: L_ANGLE@280..281 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@281..285 - 0: TS_TYPE_PARAMETER@281..285 - 0: TS_TYPE_PARAMETER_MODIFIER@281..284 - 0: IN_KW@281..284 "in" [] [Whitespace(" ")] + 1: CLASS_KW@291..297 "class" [] [Whitespace(" ")] + 2: JS_IDENTIFIER_BINDING@297..300 + 0: IDENT@297..300 "Foo" [] [] + 3: TS_TYPE_PARAMETERS@300..307 + 0: L_ANGLE@300..301 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@301..305 + 0: TS_TYPE_PARAMETER@301..305 + 0: TS_TYPE_PARAMETER_MODIFIER@301..304 + 0: IN_KW@301..304 "in" [] [Whitespace(" ")] 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@284..285 - 0: IDENT@284..285 "T" [] [] + 1: TS_TYPE_PARAMETER_NAME@304..305 + 0: IDENT@304..305 "T" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@285..287 ">" [] [Whitespace(" ")] + 2: R_ANGLE@305..307 ">" [] [Whitespace(" ")] 4: (empty) 5: (empty) - 6: L_CURLY@287..288 "{" [] [] - 7: JS_CLASS_MEMBER_LIST@288..288 - 8: R_CURLY@288..289 "}" [] [] + 6: L_CURLY@307..308 "{" [] [] + 7: JS_CLASS_MEMBER_LIST@308..308 + 8: R_CURLY@308..309 "}" [] [] 2: (empty) - 11: JS_CLASS_DECLARATION@289..309 + 12: JS_CLASS_DECLARATION@309..329 0: (empty) - 1: CLASS_KW@289..296 "class" [Newline("\n")] [Whitespace(" ")] - 2: JS_IDENTIFIER_BINDING@296..299 - 0: IDENT@296..299 "Foo" [] [] - 3: TS_TYPE_PARAMETERS@299..307 - 0: L_ANGLE@299..300 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@300..305 - 0: TS_TYPE_PARAMETER@300..305 - 0: TS_TYPE_PARAMETER_MODIFIER@300..304 + 1: CLASS_KW@309..316 "class" [Newline("\n")] [Whitespace(" ")] + 2: JS_IDENTIFIER_BINDING@316..319 + 0: IDENT@316..319 "Foo" [] [] + 3: TS_TYPE_PARAMETERS@319..327 + 0: L_ANGLE@319..320 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@320..325 + 0: TS_TYPE_PARAMETER@320..325 + 0: TS_TYPE_PARAMETER_MODIFIER@320..324 0: (empty) - 1: OUT_KW@300..304 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@304..305 - 0: IDENT@304..305 "T" [] [] + 1: OUT_KW@320..324 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@324..325 + 0: IDENT@324..325 "T" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@305..307 ">" [] [Whitespace(" ")] + 2: R_ANGLE@325..327 ">" [] [Whitespace(" ")] 4: (empty) 5: (empty) - 6: L_CURLY@307..308 "{" [] [] - 7: JS_CLASS_MEMBER_LIST@308..308 - 8: R_CURLY@308..309 "}" [] [] - 12: TS_INTERFACE_DECLARATION@309..332 - 0: INTERFACE_KW@309..320 "interface" [Newline("\n")] [Whitespace(" ")] - 1: TS_IDENTIFIER_BINDING@320..323 - 0: IDENT@320..323 "Foo" [] [] - 2: TS_TYPE_PARAMETERS@323..330 - 0: L_ANGLE@323..324 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@324..328 - 0: TS_TYPE_PARAMETER@324..328 - 0: TS_TYPE_PARAMETER_MODIFIER@324..327 - 0: IN_KW@324..327 "in" [] [Whitespace(" ")] + 6: L_CURLY@327..328 "{" [] [] + 7: JS_CLASS_MEMBER_LIST@328..328 + 8: R_CURLY@328..329 "}" [] [] + 13: TS_INTERFACE_DECLARATION@329..352 + 0: INTERFACE_KW@329..340 "interface" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@340..343 + 0: IDENT@340..343 "Foo" [] [] + 2: TS_TYPE_PARAMETERS@343..350 + 0: L_ANGLE@343..344 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@344..348 + 0: TS_TYPE_PARAMETER@344..348 + 0: TS_TYPE_PARAMETER_MODIFIER@344..347 + 0: IN_KW@344..347 "in" [] [Whitespace(" ")] 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@327..328 - 0: IDENT@327..328 "T" [] [] + 1: TS_TYPE_PARAMETER_NAME@347..348 + 0: IDENT@347..348 "T" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@328..330 ">" [] [Whitespace(" ")] + 2: R_ANGLE@348..350 ">" [] [Whitespace(" ")] 3: (empty) - 4: L_CURLY@330..331 "{" [] [] - 5: TS_TYPE_MEMBER_LIST@331..331 - 6: R_CURLY@331..332 "}" [] [] - 13: TS_INTERFACE_DECLARATION@332..356 - 0: INTERFACE_KW@332..343 "interface" [Newline("\n")] [Whitespace(" ")] - 1: TS_IDENTIFIER_BINDING@343..346 - 0: IDENT@343..346 "Foo" [] [] - 2: TS_TYPE_PARAMETERS@346..354 - 0: L_ANGLE@346..347 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@347..352 - 0: TS_TYPE_PARAMETER@347..352 - 0: TS_TYPE_PARAMETER_MODIFIER@347..351 + 4: L_CURLY@350..351 "{" [] [] + 5: TS_TYPE_MEMBER_LIST@351..351 + 6: R_CURLY@351..352 "}" [] [] + 14: TS_INTERFACE_DECLARATION@352..376 + 0: INTERFACE_KW@352..363 "interface" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@363..366 + 0: IDENT@363..366 "Foo" [] [] + 2: TS_TYPE_PARAMETERS@366..374 + 0: L_ANGLE@366..367 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@367..372 + 0: TS_TYPE_PARAMETER@367..372 + 0: TS_TYPE_PARAMETER_MODIFIER@367..371 0: (empty) - 1: OUT_KW@347..351 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@351..352 - 0: IDENT@351..352 "T" [] [] + 1: OUT_KW@367..371 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@371..372 + 0: IDENT@371..372 "T" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@352..354 ">" [] [Whitespace(" ")] + 2: R_ANGLE@372..374 ">" [] [Whitespace(" ")] 3: (empty) - 4: L_CURLY@354..355 "{" [] [] - 5: TS_TYPE_MEMBER_LIST@355..355 - 6: R_CURLY@355..356 "}" [] [] - 14: TS_DECLARE_STATEMENT@356..383 - 0: DECLARE_KW@356..365 "declare" [Newline("\n")] [Whitespace(" ")] - 1: JS_CLASS_DECLARATION@365..383 + 4: L_CURLY@374..375 "{" [] [] + 5: TS_TYPE_MEMBER_LIST@375..375 + 6: R_CURLY@375..376 "}" [] [] + 15: TS_DECLARE_STATEMENT@376..403 + 0: DECLARE_KW@376..385 "declare" [Newline("\n")] [Whitespace(" ")] + 1: JS_CLASS_DECLARATION@385..403 0: (empty) - 1: CLASS_KW@365..371 "class" [] [Whitespace(" ")] - 2: JS_IDENTIFIER_BINDING@371..374 - 0: IDENT@371..374 "Foo" [] [] - 3: TS_TYPE_PARAMETERS@374..381 - 0: L_ANGLE@374..375 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@375..379 - 0: TS_TYPE_PARAMETER@375..379 - 0: TS_TYPE_PARAMETER_MODIFIER@375..378 - 0: IN_KW@375..378 "in" [] [Whitespace(" ")] + 1: CLASS_KW@385..391 "class" [] [Whitespace(" ")] + 2: JS_IDENTIFIER_BINDING@391..394 + 0: IDENT@391..394 "Foo" [] [] + 3: TS_TYPE_PARAMETERS@394..401 + 0: L_ANGLE@394..395 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@395..399 + 0: TS_TYPE_PARAMETER@395..399 + 0: TS_TYPE_PARAMETER_MODIFIER@395..398 + 0: IN_KW@395..398 "in" [] [Whitespace(" ")] 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@378..379 - 0: IDENT@378..379 "T" [] [] + 1: TS_TYPE_PARAMETER_NAME@398..399 + 0: IDENT@398..399 "T" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@379..381 ">" [] [Whitespace(" ")] + 2: R_ANGLE@399..401 ">" [] [Whitespace(" ")] 4: (empty) 5: (empty) - 6: L_CURLY@381..382 "{" [] [] - 7: JS_CLASS_MEMBER_LIST@382..382 - 8: R_CURLY@382..383 "}" [] [] - 15: TS_DECLARE_STATEMENT@383..411 - 0: DECLARE_KW@383..392 "declare" [Newline("\n")] [Whitespace(" ")] - 1: JS_CLASS_DECLARATION@392..411 + 6: L_CURLY@401..402 "{" [] [] + 7: JS_CLASS_MEMBER_LIST@402..402 + 8: R_CURLY@402..403 "}" [] [] + 16: TS_DECLARE_STATEMENT@403..431 + 0: DECLARE_KW@403..412 "declare" [Newline("\n")] [Whitespace(" ")] + 1: JS_CLASS_DECLARATION@412..431 0: (empty) - 1: CLASS_KW@392..398 "class" [] [Whitespace(" ")] - 2: JS_IDENTIFIER_BINDING@398..401 - 0: IDENT@398..401 "Foo" [] [] - 3: TS_TYPE_PARAMETERS@401..409 - 0: L_ANGLE@401..402 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@402..407 - 0: TS_TYPE_PARAMETER@402..407 - 0: TS_TYPE_PARAMETER_MODIFIER@402..406 + 1: CLASS_KW@412..418 "class" [] [Whitespace(" ")] + 2: JS_IDENTIFIER_BINDING@418..421 + 0: IDENT@418..421 "Foo" [] [] + 3: TS_TYPE_PARAMETERS@421..429 + 0: L_ANGLE@421..422 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@422..427 + 0: TS_TYPE_PARAMETER@422..427 + 0: TS_TYPE_PARAMETER_MODIFIER@422..426 0: (empty) - 1: OUT_KW@402..406 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@406..407 - 0: IDENT@406..407 "T" [] [] + 1: OUT_KW@422..426 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@426..427 + 0: IDENT@426..427 "T" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@407..409 ">" [] [Whitespace(" ")] + 2: R_ANGLE@427..429 ">" [] [Whitespace(" ")] 4: (empty) 5: (empty) - 6: L_CURLY@409..410 "{" [] [] - 7: JS_CLASS_MEMBER_LIST@410..410 - 8: R_CURLY@410..411 "}" [] [] - 16: TS_DECLARE_STATEMENT@411..442 - 0: DECLARE_KW@411..420 "declare" [Newline("\n")] [Whitespace(" ")] - 1: TS_INTERFACE_DECLARATION@420..442 - 0: INTERFACE_KW@420..430 "interface" [] [Whitespace(" ")] - 1: TS_IDENTIFIER_BINDING@430..433 - 0: IDENT@430..433 "Foo" [] [] - 2: TS_TYPE_PARAMETERS@433..440 - 0: L_ANGLE@433..434 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@434..438 - 0: TS_TYPE_PARAMETER@434..438 - 0: TS_TYPE_PARAMETER_MODIFIER@434..437 - 0: IN_KW@434..437 "in" [] [Whitespace(" ")] + 6: L_CURLY@429..430 "{" [] [] + 7: JS_CLASS_MEMBER_LIST@430..430 + 8: R_CURLY@430..431 "}" [] [] + 17: TS_DECLARE_STATEMENT@431..462 + 0: DECLARE_KW@431..440 "declare" [Newline("\n")] [Whitespace(" ")] + 1: TS_INTERFACE_DECLARATION@440..462 + 0: INTERFACE_KW@440..450 "interface" [] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@450..453 + 0: IDENT@450..453 "Foo" [] [] + 2: TS_TYPE_PARAMETERS@453..460 + 0: L_ANGLE@453..454 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@454..458 + 0: TS_TYPE_PARAMETER@454..458 + 0: TS_TYPE_PARAMETER_MODIFIER@454..457 + 0: IN_KW@454..457 "in" [] [Whitespace(" ")] 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@437..438 - 0: IDENT@437..438 "T" [] [] + 1: TS_TYPE_PARAMETER_NAME@457..458 + 0: IDENT@457..458 "T" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@438..440 ">" [] [Whitespace(" ")] + 2: R_ANGLE@458..460 ">" [] [Whitespace(" ")] 3: (empty) - 4: L_CURLY@440..441 "{" [] [] - 5: TS_TYPE_MEMBER_LIST@441..441 - 6: R_CURLY@441..442 "}" [] [] - 17: TS_DECLARE_STATEMENT@442..474 - 0: DECLARE_KW@442..451 "declare" [Newline("\n")] [Whitespace(" ")] - 1: TS_INTERFACE_DECLARATION@451..474 - 0: INTERFACE_KW@451..461 "interface" [] [Whitespace(" ")] - 1: TS_IDENTIFIER_BINDING@461..464 - 0: IDENT@461..464 "Foo" [] [] - 2: TS_TYPE_PARAMETERS@464..472 - 0: L_ANGLE@464..465 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@465..470 - 0: TS_TYPE_PARAMETER@465..470 - 0: TS_TYPE_PARAMETER_MODIFIER@465..469 + 4: L_CURLY@460..461 "{" [] [] + 5: TS_TYPE_MEMBER_LIST@461..461 + 6: R_CURLY@461..462 "}" [] [] + 18: TS_DECLARE_STATEMENT@462..494 + 0: DECLARE_KW@462..471 "declare" [Newline("\n")] [Whitespace(" ")] + 1: TS_INTERFACE_DECLARATION@471..494 + 0: INTERFACE_KW@471..481 "interface" [] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@481..484 + 0: IDENT@481..484 "Foo" [] [] + 2: TS_TYPE_PARAMETERS@484..492 + 0: L_ANGLE@484..485 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@485..490 + 0: TS_TYPE_PARAMETER@485..490 + 0: TS_TYPE_PARAMETER_MODIFIER@485..489 0: (empty) - 1: OUT_KW@465..469 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@469..470 - 0: IDENT@469..470 "T" [] [] + 1: OUT_KW@485..489 "out" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER_NAME@489..490 + 0: IDENT@489..490 "T" [] [] 2: (empty) 3: (empty) - 2: R_ANGLE@470..472 ">" [] [Whitespace(" ")] + 2: R_ANGLE@490..492 ">" [] [Whitespace(" ")] 3: (empty) - 4: L_CURLY@472..473 "{" [] [] - 5: TS_TYPE_MEMBER_LIST@473..473 - 6: R_CURLY@473..474 "}" [] [] - 3: EOF@474..475 "" [Newline("\n")] [] + 4: L_CURLY@492..493 "{" [] [] + 5: TS_TYPE_MEMBER_LIST@493..493 + 6: R_CURLY@493..494 "}" [] [] + 3: EOF@494..495 "" [Newline("\n")] [] diff --git a/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.ts b/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.ts index 203be309dd6..050ff489d46 100644 --- a/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.ts +++ b/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.ts @@ -1,4 +1,5 @@ type Foo = T +type Foo = out type Foo = T type Foo = T type Foo = T From abfe9364ae122d3fb3558d028b11785abcd9f0aa Mon Sep 17 00:00:00 2001 From: IWANABETHATGUY Date: Tue, 14 Jun 2022 22:58:17 +0800 Subject: [PATCH 09/22] =?UTF-8?q?chore:=20=F0=9F=A4=96=20conflict=20resolv?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/generated/node_factory.rs | 37 +++++++++++++++++++ crates/rome_js_syntax/src/generated/nodes.rs | 1 + .../rome_js_syntax/src/generated/nodes_mut.rs | 26 +++++++++++-- 3 files changed, 61 insertions(+), 3 deletions(-) diff --git a/crates/rome_js_factory/src/generated/node_factory.rs b/crates/rome_js_factory/src/generated/node_factory.rs index 9fbe8a0d2e2..0896449758d 100644 --- a/crates/rome_js_factory/src/generated/node_factory.rs +++ b/crates/rome_js_factory/src/generated/node_factory.rs @@ -6008,16 +6008,22 @@ pub fn ts_type_operator_type(operator_token_token: SyntaxToken, ty: TsType) -> T pub fn ts_type_parameter(name: TsTypeParameterName) -> TsTypeParameterBuilder { TsTypeParameterBuilder { name, + modifier: None, constraint: None, default: None, } } pub struct TsTypeParameterBuilder { name: TsTypeParameterName, + modifier: Option, constraint: Option, default: Option, } impl TsTypeParameterBuilder { + pub fn with_modifier(mut self, modifier: TsTypeParameterModifier) -> Self { + self.modifier = Some(modifier); + self + } pub fn with_constraint(mut self, constraint: TsTypeConstraintClause) -> Self { self.constraint = Some(constraint); self @@ -6030,6 +6036,8 @@ impl TsTypeParameterBuilder { TsTypeParameter::unwrap_cast(SyntaxNode::new_detached( JsSyntaxKind::TS_TYPE_PARAMETER, [ + self.modifier + .map(|token| SyntaxElement::Node(token.into_syntax())), Some(SyntaxElement::Node(self.name.into_syntax())), self.constraint .map(|token| SyntaxElement::Node(token.into_syntax())), @@ -6039,6 +6047,35 @@ impl TsTypeParameterBuilder { )) } } +pub fn ts_type_parameter_modifier() -> TsTypeParameterModifierBuilder { + TsTypeParameterModifierBuilder { + in_token: None, + out_token: None, + } +} +pub struct TsTypeParameterModifierBuilder { + in_token: Option, + out_token: Option, +} +impl TsTypeParameterModifierBuilder { + pub fn with_in_token(mut self, in_token: SyntaxToken) -> Self { + self.in_token = Some(in_token); + self + } + pub fn with_out_token(mut self, out_token: SyntaxToken) -> Self { + self.out_token = Some(out_token); + self + } + pub fn build(self) -> TsTypeParameterModifier { + TsTypeParameterModifier::unwrap_cast(SyntaxNode::new_detached( + JsSyntaxKind::TS_TYPE_PARAMETER_MODIFIER, + [ + self.in_token.map(|token| SyntaxElement::Token(token)), + self.out_token.map(|token| SyntaxElement::Token(token)), + ], + )) + } +} pub fn ts_type_parameter_name(ident_token: SyntaxToken) -> TsTypeParameterName { TsTypeParameterName::unwrap_cast(SyntaxNode::new_detached( JsSyntaxKind::TS_TYPE_PARAMETER_NAME, diff --git a/crates/rome_js_syntax/src/generated/nodes.rs b/crates/rome_js_syntax/src/generated/nodes.rs index 91ec702fe9a..14a97b15778 100644 --- a/crates/rome_js_syntax/src/generated/nodes.rs +++ b/crates/rome_js_syntax/src/generated/nodes.rs @@ -23798,6 +23798,7 @@ impl AstNode for TsTypeParameterModifier { } } fn syntax(&self) -> &SyntaxNode { &self.syntax } + fn into_syntax(self) -> SyntaxNode { self.syntax } } impl std::fmt::Debug for TsTypeParameterModifier { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { diff --git a/crates/rome_js_syntax/src/generated/nodes_mut.rs b/crates/rome_js_syntax/src/generated/nodes_mut.rs index 5a87694ec48..0cb4218a559 100644 --- a/crates/rome_js_syntax/src/generated/nodes_mut.rs +++ b/crates/rome_js_syntax/src/generated/nodes_mut.rs @@ -5680,25 +5680,45 @@ impl TsTypeOperatorType { } } impl TsTypeParameter { + pub fn with_modifier(self, element: Option) -> Self { + Self::unwrap_cast(self.syntax.splice_slots( + 0usize..=0usize, + once(element.map(|element| element.into_syntax().into())), + )) + } pub fn with_name(self, element: TsTypeParameterName) -> Self { Self::unwrap_cast( self.syntax - .splice_slots(0usize..=0usize, once(Some(element.into_syntax().into()))), + .splice_slots(1usize..=1usize, once(Some(element.into_syntax().into()))), ) } pub fn with_constraint(self, element: Option) -> Self { Self::unwrap_cast(self.syntax.splice_slots( - 1usize..=1usize, + 2usize..=2usize, once(element.map(|element| element.into_syntax().into())), )) } pub fn with_default(self, element: Option) -> Self { Self::unwrap_cast(self.syntax.splice_slots( - 2usize..=2usize, + 3usize..=3usize, once(element.map(|element| element.into_syntax().into())), )) } } +impl TsTypeParameterModifier { + pub fn with_in_token(self, element: Option) -> Self { + Self::unwrap_cast( + self.syntax + .splice_slots(0usize..=0usize, once(element.map(|element| element.into()))), + ) + } + pub fn with_out_token(self, element: Option) -> Self { + Self::unwrap_cast( + self.syntax + .splice_slots(1usize..=1usize, once(element.map(|element| element.into()))), + ) + } +} impl TsTypeParameterName { pub fn with_ident_token(self, element: SyntaxToken) -> Self { Self::unwrap_cast( From 4d247abdefcdb92d0602e2930b64a1a345c6a10e Mon Sep 17 00:00:00 2001 From: IWANABETHATGUY Date: Tue, 14 Jun 2022 23:09:12 +0800 Subject: [PATCH 10/22] =?UTF-8?q?test:=20=F0=9F=92=8D=20update=20snapshot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/rome_js_parser/src/syntax/typescript/types.rs | 8 ++++---- .../test_data/inline/ok/type_parameter_modifier_tsx.tsx | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/rome_js_parser/src/syntax/typescript/types.rs b/crates/rome_js_parser/src/syntax/typescript/types.rs index 131daf3cf37..159e9a79411 100644 --- a/crates/rome_js_parser/src/syntax/typescript/types.rs +++ b/crates/rome_js_parser/src/syntax/typescript/types.rs @@ -203,10 +203,10 @@ impl ParseSeparatedList for TsTypeParameterList { // function foo() {} // test tsx type_parameter_modifier_tsx -// -// // -// // -// // +// ; +// ; +// ; +// ; // // // // // // diff --git a/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier_tsx.tsx b/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier_tsx.tsx index b2f0654dc68..c0f7dfcea0c 100644 --- a/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier_tsx.tsx +++ b/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier_tsx.tsx @@ -1,7 +1,7 @@ - -// -// -// +; +; +; +; // // // From 620e2e34d56b3208f42e991927ac28df10f99cfb Mon Sep 17 00:00:00 2001 From: IWANABETHATGUY Date: Tue, 14 Jun 2022 23:23:47 +0800 Subject: [PATCH 11/22] =?UTF-8?q?chore:=20=F0=9F=A4=96=20update=20test=20r?= =?UTF-8?q?esult?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/generated/node_factory.rs | 49 +-- .../src/generated/syntax_factory.rs | 35 +- .../src/syntax/typescript/types.rs | 37 +- .../err/ts_constructor_type_parameters.rast | 8 +- .../err/ts_declare_function_with_body.rast | 8 +- .../err/ts_getter_setter_type_parameters.rast | 16 +- .../err/ts_object_getter_type_parameters.rast | 8 +- .../err/ts_object_setter_type_parameters.rast | 8 +- .../err/ts_type_parameters_incomplete.rast | 8 +- .../inline/err/type_parameter_modifier.rast | 167 ++++---- .../inline/err/type_parameter_modifier1.rast | 405 +++++++----------- .../ok/ts_arrow_function_type_parameters.rast | 44 +- .../test_data/inline/ok/ts_as_assignment.rast | 8 +- .../ok/ts_call_expr_with_type_arguments.rast | 40 +- .../inline/ok/ts_call_signature_member.rast | 16 +- .../inline/ok/ts_class_type_parameters.rast | 24 +- ...s_conditional_type_call_signature_lhs.rast | 8 +- .../ok/ts_construct_signature_member.rast | 16 +- .../inline/ok/ts_constructor_type.rast | 32 +- .../inline/ok/ts_declare_function.rast | 24 +- .../inline/ok/ts_default_type_clause.rast | 20 +- .../inline/ok/ts_function_statement.rast | 28 +- .../test_data/inline/ok/ts_function_type.rast | 16 +- .../ok/ts_interface_extends_clause.rast | 8 +- .../test_data/inline/ok/ts_mapped_type.rast | 32 +- .../inline/ok/ts_method_class_member.rast | 26 +- .../ok/ts_method_object_member_body.rast | 16 +- .../inline/ok/ts_new_with_type_arguments.rast | 24 +- .../inline/ok/ts_optional_chain_call.rast | 16 +- ...s_property_or_method_signature_member.rast | 16 +- .../inline/ok/ts_template_literal_type.rast | 10 +- .../ok/ts_type_arguments_left_shift.rast | 16 +- .../inline/ok/ts_type_constraint_clause.rast | 20 +- .../inline/ok/ts_type_parameters.rast | 30 +- .../inline/ok/tsx_type_arguments.rast | 46 +- .../inline/ok/type_parameter_modifier.rast | 325 ++++++-------- .../ok/type_parameter_modifier_tsx.rast | 14 +- .../inline/ok/type_parameter_modifier_tsx.tsx | 6 +- crates/rome_js_syntax/src/generated/macros.rs | 4 - crates/rome_js_syntax/src/generated/nodes.rs | 96 +---- .../rome_js_syntax/src/generated/nodes_mut.rs | 36 +- xtask/codegen/js.ungram | 7 +- 42 files changed, 825 insertions(+), 948 deletions(-) diff --git a/crates/rome_js_factory/src/generated/node_factory.rs b/crates/rome_js_factory/src/generated/node_factory.rs index 0896449758d..996697a254f 100644 --- a/crates/rome_js_factory/src/generated/node_factory.rs +++ b/crates/rome_js_factory/src/generated/node_factory.rs @@ -6008,20 +6008,26 @@ pub fn ts_type_operator_type(operator_token_token: SyntaxToken, ty: TsType) -> T pub fn ts_type_parameter(name: TsTypeParameterName) -> TsTypeParameterBuilder { TsTypeParameterBuilder { name, - modifier: None, + in_modifier_token: None, + out_modfier_token: None, constraint: None, default: None, } } pub struct TsTypeParameterBuilder { name: TsTypeParameterName, - modifier: Option, + in_modifier_token: Option, + out_modfier_token: Option, constraint: Option, default: Option, } impl TsTypeParameterBuilder { - pub fn with_modifier(mut self, modifier: TsTypeParameterModifier) -> Self { - self.modifier = Some(modifier); + pub fn with_in_modifier_token(mut self, in_modifier_token: SyntaxToken) -> Self { + self.in_modifier_token = Some(in_modifier_token); + self + } + pub fn with_out_modfier_token(mut self, out_modfier_token: SyntaxToken) -> Self { + self.out_modfier_token = Some(out_modfier_token); self } pub fn with_constraint(mut self, constraint: TsTypeConstraintClause) -> Self { @@ -6036,8 +6042,10 @@ impl TsTypeParameterBuilder { TsTypeParameter::unwrap_cast(SyntaxNode::new_detached( JsSyntaxKind::TS_TYPE_PARAMETER, [ - self.modifier - .map(|token| SyntaxElement::Node(token.into_syntax())), + self.in_modifier_token + .map(|token| SyntaxElement::Token(token)), + self.out_modfier_token + .map(|token| SyntaxElement::Token(token)), Some(SyntaxElement::Node(self.name.into_syntax())), self.constraint .map(|token| SyntaxElement::Node(token.into_syntax())), @@ -6047,35 +6055,6 @@ impl TsTypeParameterBuilder { )) } } -pub fn ts_type_parameter_modifier() -> TsTypeParameterModifierBuilder { - TsTypeParameterModifierBuilder { - in_token: None, - out_token: None, - } -} -pub struct TsTypeParameterModifierBuilder { - in_token: Option, - out_token: Option, -} -impl TsTypeParameterModifierBuilder { - pub fn with_in_token(mut self, in_token: SyntaxToken) -> Self { - self.in_token = Some(in_token); - self - } - pub fn with_out_token(mut self, out_token: SyntaxToken) -> Self { - self.out_token = Some(out_token); - self - } - pub fn build(self) -> TsTypeParameterModifier { - TsTypeParameterModifier::unwrap_cast(SyntaxNode::new_detached( - JsSyntaxKind::TS_TYPE_PARAMETER_MODIFIER, - [ - self.in_token.map(|token| SyntaxElement::Token(token)), - self.out_token.map(|token| SyntaxElement::Token(token)), - ], - )) - } -} pub fn ts_type_parameter_name(ident_token: SyntaxToken) -> TsTypeParameterName { TsTypeParameterName::unwrap_cast(SyntaxNode::new_detached( JsSyntaxKind::TS_TYPE_PARAMETER_NAME, diff --git a/crates/rome_js_factory/src/generated/syntax_factory.rs b/crates/rome_js_factory/src/generated/syntax_factory.rs index 2f3a59d3294..26c82a3b00c 100644 --- a/crates/rome_js_factory/src/generated/syntax_factory.rs +++ b/crates/rome_js_factory/src/generated/syntax_factory.rs @@ -9253,57 +9253,38 @@ impl SyntaxFactory for JsSyntaxFactory { } TS_TYPE_PARAMETER => { let mut elements = (&children).into_iter(); - let mut slots: RawNodeSlots<4usize> = RawNodeSlots::default(); + let mut slots: RawNodeSlots<5usize> = RawNodeSlots::default(); let mut current_element = elements.next(); if let Some(element) = ¤t_element { - if TsTypeParameterModifier::can_cast(element.kind()) { + if element.kind() == T![in] { slots.mark_present(); current_element = elements.next(); } } slots.next_slot(); if let Some(element) = ¤t_element { - if TsTypeParameterName::can_cast(element.kind()) { + if element.kind() == T![out] { slots.mark_present(); current_element = elements.next(); } } slots.next_slot(); if let Some(element) = ¤t_element { - if TsTypeConstraintClause::can_cast(element.kind()) { + if TsTypeParameterName::can_cast(element.kind()) { slots.mark_present(); current_element = elements.next(); } } slots.next_slot(); if let Some(element) = ¤t_element { - if TsDefaultTypeClause::can_cast(element.kind()) { - slots.mark_present(); - current_element = elements.next(); - } - } - slots.next_slot(); - if current_element.is_some() { - return RawSyntaxNode::new( - TS_TYPE_PARAMETER.to_unknown(), - children.into_iter().map(Some), - ); - } - slots.into_node(TS_TYPE_PARAMETER, children) - } - TS_TYPE_PARAMETER_MODIFIER => { - let mut elements = (&children).into_iter(); - let mut slots: RawNodeSlots<2usize> = RawNodeSlots::default(); - let mut current_element = elements.next(); - if let Some(element) = ¤t_element { - if element.kind() == T![in] { + if TsTypeConstraintClause::can_cast(element.kind()) { slots.mark_present(); current_element = elements.next(); } } slots.next_slot(); if let Some(element) = ¤t_element { - if element.kind() == T![out] { + if TsDefaultTypeClause::can_cast(element.kind()) { slots.mark_present(); current_element = elements.next(); } @@ -9311,11 +9292,11 @@ impl SyntaxFactory for JsSyntaxFactory { slots.next_slot(); if current_element.is_some() { return RawSyntaxNode::new( - TS_TYPE_PARAMETER_MODIFIER.to_unknown(), + TS_TYPE_PARAMETER.to_unknown(), children.into_iter().map(Some), ); } - slots.into_node(TS_TYPE_PARAMETER_MODIFIER, children) + slots.into_node(TS_TYPE_PARAMETER, children) } TS_TYPE_PARAMETER_NAME => { let mut elements = (&children).into_iter(); diff --git a/crates/rome_js_parser/src/syntax/typescript/types.rs b/crates/rome_js_parser/src/syntax/typescript/types.rs index 159e9a79411..025cf730df8 100644 --- a/crates/rome_js_parser/src/syntax/typescript/types.rs +++ b/crates/rome_js_parser/src/syntax/typescript/types.rs @@ -204,9 +204,9 @@ impl ParseSeparatedList for TsTypeParameterList { // test tsx type_parameter_modifier_tsx // ; -// ; -// ; -// ; +// // ; +// // ; +// // ; // // // // // // @@ -231,11 +231,24 @@ impl ParseSeparatedList for TsTypeParameterList { // declare class Foo {} // declare interface Foo {} // declare interface Foo {} -fn parse_ts_type_parameter_modifier( - p: &mut Parser, - could_use_parameter_modifier: bool, -) -> ParsedSyntax { + + +// fn parse_ts_type_parameter_modifier( +// p: &mut Parser, +// could_use_parameter_modifier: bool, +// ) -> ParsedSyntax { +// let m = p.start(); + +// if !has_any_modifier { +// m.abandon(p); +// return Absent; +// } +// Present(m.complete(p, TS_TYPE_PARAMETER_MODIFIER)) +// } + +fn parse_ts_type_parameter(p: &mut Parser, could_use_parameter_modifier: bool) -> ParsedSyntax { let m = p.start(); + // parse_ts_type_parameter_modifier(p, could_use_parameter_modifier).ok(); let mut has_any_modifier = false; // try to eat `in` modifier if p.at(T![in]) { @@ -264,16 +277,6 @@ fn parse_ts_type_parameter_modifier( p.bump(T![out]); } } - if !has_any_modifier { - m.abandon(p); - return Absent; - } - Present(m.complete(p, TS_TYPE_PARAMETER_MODIFIER)) -} - -fn parse_ts_type_parameter(p: &mut Parser, could_use_parameter_modifier: bool) -> ParsedSyntax { - let m = p.start(); - parse_ts_type_parameter_modifier(p, could_use_parameter_modifier).ok(); let name = parse_ts_type_parameter_name(p); parse_ts_type_constraint_clause(p).ok(); parse_ts_default_type_clause(p).ok(); diff --git a/crates/rome_js_parser/test_data/inline/err/ts_constructor_type_parameters.rast b/crates/rome_js_parser/test_data/inline/err/ts_constructor_type_parameters.rast index 10c453815f6..1959e7a18a2 100644 --- a/crates/rome_js_parser/test_data/inline/err/ts_constructor_type_parameters.rast +++ b/crates/rome_js_parser/test_data/inline/err/ts_constructor_type_parameters.rast @@ -23,7 +23,8 @@ JsModule { l_angle_token: L_ANGLE@21..22 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@22..23 "A" [] [], }, @@ -85,10 +86,11 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@22..23 0: TS_TYPE_PARAMETER@22..23 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@22..23 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@22..23 0: IDENT@22..23 "A" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@23..24 ">" [] [] 3: JS_CONSTRUCTOR_PARAMETERS@24..28 0: L_PAREN@24..25 "(" [] [] diff --git a/crates/rome_js_parser/test_data/inline/err/ts_declare_function_with_body.rast b/crates/rome_js_parser/test_data/inline/err/ts_declare_function_with_body.rast index 112272ae042..7bf33ef329e 100644 --- a/crates/rome_js_parser/test_data/inline/err/ts_declare_function_with_body.rast +++ b/crates/rome_js_parser/test_data/inline/err/ts_declare_function_with_body.rast @@ -15,7 +15,8 @@ JsModule { l_angle_token: L_ANGLE@21..22 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@22..23 "A" [] [], }, @@ -90,10 +91,11 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@22..23 0: TS_TYPE_PARAMETER@22..23 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@22..23 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@22..23 0: IDENT@22..23 "A" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@23..24 ">" [] [] 3: JS_PARAMETERS@24..30 0: L_PAREN@24..25 "(" [] [] diff --git a/crates/rome_js_parser/test_data/inline/err/ts_getter_setter_type_parameters.rast b/crates/rome_js_parser/test_data/inline/err/ts_getter_setter_type_parameters.rast index a1896fdc9dd..7fd20acee7f 100644 --- a/crates/rome_js_parser/test_data/inline/err/ts_getter_setter_type_parameters.rast +++ b/crates/rome_js_parser/test_data/inline/err/ts_getter_setter_type_parameters.rast @@ -24,7 +24,8 @@ JsModule { l_angle_token: L_ANGLE@19..20 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@20..21 "A" [] [], }, @@ -64,7 +65,8 @@ JsModule { l_angle_token: L_ANGLE@37..38 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@38..39 "A" [] [], }, @@ -131,10 +133,11 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@20..21 0: TS_TYPE_PARAMETER@20..21 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@20..21 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@20..21 0: IDENT@20..21 "A" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@21..22 ">" [] [] 4: L_PAREN@22..23 "(" [] [] 5: R_PAREN@23..24 ")" [] [] @@ -159,10 +162,11 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@38..39 0: TS_TYPE_PARAMETER@38..39 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@38..39 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@38..39 0: IDENT@38..39 "A" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@39..40 ">" [] [] 4: L_PAREN@40..41 "(" [] [] 5: JS_FORMAL_PARAMETER@41..49 diff --git a/crates/rome_js_parser/test_data/inline/err/ts_object_getter_type_parameters.rast b/crates/rome_js_parser/test_data/inline/err/ts_object_getter_type_parameters.rast index 2a8a557079c..8476b328921 100644 --- a/crates/rome_js_parser/test_data/inline/err/ts_object_getter_type_parameters.rast +++ b/crates/rome_js_parser/test_data/inline/err/ts_object_getter_type_parameters.rast @@ -18,7 +18,8 @@ JsModule { l_angle_token: L_ANGLE@8..9 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@9..10 "A" [] [], }, @@ -77,10 +78,11 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@9..10 0: TS_TYPE_PARAMETER@9..10 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@9..10 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@9..10 0: IDENT@9..10 "A" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@10..11 ">" [] [] 3: L_PAREN@11..12 "(" [] [] 4: R_PAREN@12..13 ")" [] [] diff --git a/crates/rome_js_parser/test_data/inline/err/ts_object_setter_type_parameters.rast b/crates/rome_js_parser/test_data/inline/err/ts_object_setter_type_parameters.rast index c8d9d574eaf..af2df65c0b9 100644 --- a/crates/rome_js_parser/test_data/inline/err/ts_object_setter_type_parameters.rast +++ b/crates/rome_js_parser/test_data/inline/err/ts_object_setter_type_parameters.rast @@ -18,7 +18,8 @@ JsModule { l_angle_token: L_ANGLE@8..9 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@9..10 "A" [] [], }, @@ -84,10 +85,11 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@9..10 0: TS_TYPE_PARAMETER@9..10 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@9..10 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@9..10 0: IDENT@9..10 "A" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@10..11 ">" [] [] 3: L_PAREN@11..12 "(" [] [] 4: JS_FORMAL_PARAMETER@12..20 diff --git a/crates/rome_js_parser/test_data/inline/err/ts_type_parameters_incomplete.rast b/crates/rome_js_parser/test_data/inline/err/ts_type_parameters_incomplete.rast index 84e11924292..eaeaad03748 100644 --- a/crates/rome_js_parser/test_data/inline/err/ts_type_parameters_incomplete.rast +++ b/crates/rome_js_parser/test_data/inline/err/ts_type_parameters_incomplete.rast @@ -11,7 +11,8 @@ JsModule { l_angle_token: L_ANGLE@6..7 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@7..8 "T" [] [], }, @@ -42,10 +43,11 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@7..8 0: TS_TYPE_PARAMETER@7..8 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@7..8 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@7..8 0: IDENT@7..8 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: (empty) 3: (empty) 4: (empty) diff --git a/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.rast b/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.rast index 61b8c64ae7a..dda3d53b2ca 100644 --- a/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.rast +++ b/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.rast @@ -14,7 +14,8 @@ JsModule { JsUnknown { items: [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@9..10 "i" [] [], }, @@ -27,7 +28,8 @@ JsModule { ], }, TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@11..18 "\\u006E" [] [Whitespace(" ")], }, @@ -35,7 +37,8 @@ JsModule { default: missing (optional), }, TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@18..19 "T" [] [], }, @@ -68,7 +71,8 @@ JsModule { JsUnknown { items: [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@34..36 "ou" [] [], }, @@ -81,7 +85,8 @@ JsModule { ], }, TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@37..44 "\\u0074" [] [Whitespace(" ")], }, @@ -89,7 +94,8 @@ JsModule { default: missing (optional), }, TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@44..45 "T" [] [], }, @@ -121,10 +127,7 @@ JsModule { L_ANGLE@59..60 "<" [] [], JsUnknown { items: [ - TsTypeParameterModifier { - in_token: IN_KW@60..63 "in" [] [Whitespace(" ")], - out_token: missing (optional), - }, + IN_KW@60..63 "in" [] [Whitespace(" ")], JsUnknown { items: [ IN_KW@63..65 "in" [] [], @@ -155,10 +158,7 @@ JsModule { L_ANGLE@79..80 "<" [] [], JsUnknown { items: [ - TsTypeParameterModifier { - in_token: missing (optional), - out_token: OUT_KW@80..84 "out" [] [Whitespace(" ")], - }, + OUT_KW@80..84 "out" [] [Whitespace(" ")], JsUnknown { items: [ IN_KW@84..86 "in" [] [], @@ -189,17 +189,15 @@ JsModule { L_ANGLE@100..101 "<" [] [], JsUnknown { items: [ - TsTypeParameterModifier { - in_token: missing (optional), - out_token: OUT_KW@101..105 "out" [] [Whitespace(" ")], - }, + OUT_KW@101..105 "out" [] [Whitespace(" ")], JsUnknown { items: [ IN_KW@105..108 "in" [] [Whitespace(" ")], ], }, TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@108..109 "T" [] [], }, @@ -241,7 +239,8 @@ JsModule { ], }, TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@131..132 "T" [] [], }, @@ -273,17 +272,16 @@ JsModule { L_ANGLE@146..147 "<" [] [], JsUnknown { items: [ - TsTypeParameterModifier { - in_token: IN_KW@147..150 "in" [] [Whitespace(" ")], - out_token: OUT_KW@150..154 "out" [] [Whitespace(" ")], - }, + IN_KW@147..150 "in" [] [Whitespace(" ")], + OUT_KW@150..154 "out" [] [Whitespace(" ")], JsUnknown { items: [ IN_KW@154..157 "in" [] [Whitespace(" ")], ], }, TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@157..158 "T" [] [], }, @@ -313,10 +311,8 @@ JsModule { l_angle_token: L_ANGLE@172..173 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: IN_KW@173..176 "in" [] [Whitespace(" ")], - out_token: OUT_KW@176..180 "out" [] [Whitespace(" ")], - }, + in_modifier_token: IN_KW@173..176 "in" [] [Whitespace(" ")], + out_modfier_token: OUT_KW@176..180 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@180..184 "out" [] [Whitespace(" ")], }, @@ -325,7 +321,8 @@ JsModule { }, missing separator, TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@184..185 "T" [] [], }, @@ -355,10 +352,8 @@ JsModule { l_angle_token: L_ANGLE@203..204 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: IN_KW@204..207 "in" [] [Whitespace(" ")], - out_token: missing (optional), - }, + in_modifier_token: IN_KW@204..207 "in" [] [Whitespace(" ")], + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@207..208 "T" [] [], }, @@ -392,10 +387,8 @@ JsModule { l_angle_token: L_ANGLE@227..228 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: missing (optional), - out_token: OUT_KW@228..232 "out" [] [Whitespace(" ")], - }, + in_modifier_token: missing (optional), + out_modfier_token: OUT_KW@228..232 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@232..233 "T" [] [], }, @@ -435,24 +428,27 @@ JsModule { 1: JS_UNKNOWN@9..19 0: TS_TYPE_PARAMETER@9..10 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@9..10 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@9..10 0: IDENT@9..10 "i" [] [] - 2: (empty) 3: (empty) + 4: (empty) 1: JS_UNKNOWN@10..11 0: ERROR_TOKEN@10..11 "\\" [] [] 2: TS_TYPE_PARAMETER@11..18 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@11..18 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@11..18 0: IDENT@11..18 "\\u006E" [] [Whitespace(" ")] - 2: (empty) 3: (empty) + 4: (empty) 3: TS_TYPE_PARAMETER@18..19 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@18..19 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@18..19 0: IDENT@18..19 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@19..21 ">" [] [Whitespace(" ")] 3: EQ@21..23 "=" [] [Whitespace(" ")] 4: TS_REFERENCE_TYPE@23..24 @@ -468,24 +464,27 @@ JsModule { 1: JS_UNKNOWN@34..45 0: TS_TYPE_PARAMETER@34..36 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@34..36 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@34..36 0: IDENT@34..36 "ou" [] [] - 2: (empty) 3: (empty) + 4: (empty) 1: JS_UNKNOWN@36..37 0: ERROR_TOKEN@36..37 "\\" [] [] 2: TS_TYPE_PARAMETER@37..44 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@37..44 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@37..44 0: IDENT@37..44 "\\u0074" [] [Whitespace(" ")] - 2: (empty) 3: (empty) + 4: (empty) 3: TS_TYPE_PARAMETER@44..45 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@44..45 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@44..45 0: IDENT@44..45 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@45..47 ">" [] [Whitespace(" ")] 3: EQ@47..49 "=" [] [Whitespace(" ")] 4: TS_REFERENCE_TYPE@49..50 @@ -499,9 +498,7 @@ JsModule { 2: JS_UNKNOWN@59..67 0: L_ANGLE@59..60 "<" [] [] 1: JS_UNKNOWN@60..65 - 0: TS_TYPE_PARAMETER_MODIFIER@60..63 - 0: IN_KW@60..63 "in" [] [Whitespace(" ")] - 1: (empty) + 0: IN_KW@60..63 "in" [] [Whitespace(" ")] 1: JS_UNKNOWN@63..65 0: IN_KW@63..65 "in" [] [] 2: R_ANGLE@65..67 ">" [] [Whitespace(" ")] @@ -517,9 +514,7 @@ JsModule { 2: JS_UNKNOWN@79..88 0: L_ANGLE@79..80 "<" [] [] 1: JS_UNKNOWN@80..86 - 0: TS_TYPE_PARAMETER_MODIFIER@80..84 - 0: (empty) - 1: OUT_KW@80..84 "out" [] [Whitespace(" ")] + 0: OUT_KW@80..84 "out" [] [Whitespace(" ")] 1: JS_UNKNOWN@84..86 0: IN_KW@84..86 "in" [] [] 2: R_ANGLE@86..88 ">" [] [Whitespace(" ")] @@ -535,17 +530,16 @@ JsModule { 2: JS_UNKNOWN@100..111 0: L_ANGLE@100..101 "<" [] [] 1: JS_UNKNOWN@101..109 - 0: TS_TYPE_PARAMETER_MODIFIER@101..105 - 0: (empty) - 1: OUT_KW@101..105 "out" [] [Whitespace(" ")] + 0: OUT_KW@101..105 "out" [] [Whitespace(" ")] 1: JS_UNKNOWN@105..108 0: IN_KW@105..108 "in" [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER@108..109 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@108..109 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@108..109 0: IDENT@108..109 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@109..111 ">" [] [Whitespace(" ")] 3: EQ@111..113 "=" [] [Whitespace(" ")] 4: TS_REFERENCE_TYPE@113..114 @@ -564,10 +558,11 @@ JsModule { 0: IDENT@124..131 "public" [] [Whitespace(" ")] 1: TS_TYPE_PARAMETER@131..132 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@131..132 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@131..132 0: IDENT@131..132 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@132..134 ">" [] [Whitespace(" ")] 3: EQ@134..136 "=" [] [Whitespace(" ")] 4: TS_REFERENCE_TYPE@136..137 @@ -581,17 +576,17 @@ JsModule { 2: JS_UNKNOWN@146..160 0: L_ANGLE@146..147 "<" [] [] 1: JS_UNKNOWN@147..158 - 0: TS_TYPE_PARAMETER_MODIFIER@147..154 - 0: IN_KW@147..150 "in" [] [Whitespace(" ")] - 1: OUT_KW@150..154 "out" [] [Whitespace(" ")] - 1: JS_UNKNOWN@154..157 + 0: IN_KW@147..150 "in" [] [Whitespace(" ")] + 1: OUT_KW@150..154 "out" [] [Whitespace(" ")] + 2: JS_UNKNOWN@154..157 0: IN_KW@154..157 "in" [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER@157..158 + 3: TS_TYPE_PARAMETER@157..158 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@157..158 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@157..158 0: IDENT@157..158 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@158..160 ">" [] [Whitespace(" ")] 3: EQ@160..162 "=" [] [Whitespace(" ")] 4: TS_REFERENCE_TYPE@162..163 @@ -606,20 +601,20 @@ JsModule { 0: L_ANGLE@172..173 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@173..185 0: TS_TYPE_PARAMETER@173..184 - 0: TS_TYPE_PARAMETER_MODIFIER@173..180 - 0: IN_KW@173..176 "in" [] [Whitespace(" ")] - 1: OUT_KW@176..180 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@180..184 + 0: IN_KW@173..176 "in" [] [Whitespace(" ")] + 1: OUT_KW@176..180 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@180..184 0: IDENT@180..184 "out" [] [Whitespace(" ")] - 2: (empty) 3: (empty) + 4: (empty) 1: (empty) 2: TS_TYPE_PARAMETER@184..185 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@184..185 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@184..185 0: IDENT@184..185 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@185..187 ">" [] [Whitespace(" ")] 3: EQ@187..189 "=" [] [Whitespace(" ")] 4: TS_REFERENCE_TYPE@189..190 @@ -637,13 +632,12 @@ JsModule { 0: L_ANGLE@203..204 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@204..208 0: TS_TYPE_PARAMETER@204..208 - 0: TS_TYPE_PARAMETER_MODIFIER@204..207 - 0: IN_KW@204..207 "in" [] [Whitespace(" ")] - 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@207..208 + 0: IN_KW@204..207 "in" [] [Whitespace(" ")] + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@207..208 0: IDENT@207..208 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@208..209 ">" [] [] 5: JS_PARAMETERS@209..212 0: L_PAREN@209..210 "(" [] [] @@ -665,13 +659,12 @@ JsModule { 0: L_ANGLE@227..228 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@228..233 0: TS_TYPE_PARAMETER@228..233 - 0: TS_TYPE_PARAMETER_MODIFIER@228..232 - 0: (empty) - 1: OUT_KW@228..232 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@232..233 + 0: (empty) + 1: OUT_KW@228..232 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@232..233 0: IDENT@232..233 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@233..234 ">" [] [] 5: JS_PARAMETERS@234..237 0: L_PAREN@234..235 "(" [] [] diff --git a/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier1.rast b/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier1.rast index 0c7765df423..6f9790693d5 100644 --- a/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier1.rast +++ b/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier1.rast @@ -17,10 +17,8 @@ JsModule { l_angle_token: L_ANGLE@28..29 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: IN_KW@29..32 "in" [] [Whitespace(" ")], - out_token: missing (optional), - }, + in_modifier_token: IN_KW@29..32 "in" [] [Whitespace(" ")], + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@32..33 "T" [] [], }, @@ -59,10 +57,8 @@ JsModule { l_angle_token: L_ANGLE@60..61 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: missing (optional), - out_token: OUT_KW@61..65 "out" [] [Whitespace(" ")], - }, + in_modifier_token: missing (optional), + out_modfier_token: OUT_KW@61..65 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@65..66 "T" [] [], }, @@ -99,10 +95,8 @@ JsModule { l_angle_token: L_ANGLE@94..95 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: IN_KW@95..98 "in" [] [Whitespace(" ")], - out_token: missing (optional), - }, + in_modifier_token: IN_KW@95..98 "in" [] [Whitespace(" ")], + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@98..99 "T" [] [], }, @@ -139,10 +133,8 @@ JsModule { l_angle_token: L_ANGLE@127..128 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: missing (optional), - out_token: OUT_KW@128..132 "out" [] [Whitespace(" ")], - }, + in_modifier_token: missing (optional), + out_modfier_token: OUT_KW@128..132 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@132..133 "T" [] [], }, @@ -260,10 +252,8 @@ JsModule { l_angle_token: L_ANGLE@202..203 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: IN_KW@203..206 "in" [] [Whitespace(" ")], - out_token: missing (optional), - }, + in_modifier_token: IN_KW@203..206 "in" [] [Whitespace(" ")], + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@206..207 "T" [] [], }, @@ -294,10 +284,8 @@ JsModule { l_angle_token: L_ANGLE@232..233 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: missing (optional), - out_token: OUT_KW@233..237 "out" [] [Whitespace(" ")], - }, + in_modifier_token: missing (optional), + out_modfier_token: OUT_KW@233..237 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@237..238 "T" [] [], }, @@ -417,10 +405,8 @@ JsModule { l_angle_token: L_ANGLE@312..313 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: IN_KW@313..316 "in" [] [Whitespace(" ")], - out_token: missing (optional), - }, + in_modifier_token: IN_KW@313..316 "in" [] [Whitespace(" ")], + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@316..317 "T" [] [], }, @@ -452,10 +438,8 @@ JsModule { l_angle_token: L_ANGLE@335..336 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: missing (optional), - out_token: OUT_KW@336..340 "out" [] [Whitespace(" ")], - }, + in_modifier_token: missing (optional), + out_modfier_token: OUT_KW@336..340 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@340..341 "T" [] [], }, @@ -489,10 +473,8 @@ JsModule { l_angle_token: L_ANGLE@362..363 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: IN_KW@363..366 "in" [] [Whitespace(" ")], - out_token: missing (optional), - }, + in_modifier_token: IN_KW@363..366 "in" [] [Whitespace(" ")], + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@366..367 "T" [] [], }, @@ -533,10 +515,8 @@ JsModule { l_angle_token: L_ANGLE@390..391 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: missing (optional), - out_token: OUT_KW@391..395 "out" [] [Whitespace(" ")], - }, + in_modifier_token: missing (optional), + out_modfier_token: OUT_KW@391..395 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@395..396 "T" [] [], }, @@ -585,10 +565,8 @@ JsModule { l_angle_token: L_ANGLE@419..420 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: IN_KW@420..423 "in" [] [Whitespace(" ")], - out_token: missing (optional), - }, + in_modifier_token: IN_KW@420..423 "in" [] [Whitespace(" ")], + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@423..424 "T" [] [], }, @@ -645,10 +623,8 @@ JsModule { l_angle_token: L_ANGLE@452..453 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: missing (optional), - out_token: OUT_KW@453..457 "out" [] [Whitespace(" ")], - }, + in_modifier_token: missing (optional), + out_modfier_token: OUT_KW@453..457 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@457..458 "T" [] [], }, @@ -701,10 +677,8 @@ JsModule { l_angle_token: L_ANGLE@482..483 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: IN_KW@483..486 "in" [] [Whitespace(" ")], - out_token: missing (optional), - }, + in_modifier_token: IN_KW@483..486 "in" [] [Whitespace(" ")], + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@486..487 "T" [] [], }, @@ -760,10 +734,8 @@ JsModule { l_angle_token: L_ANGLE@512..513 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: missing (optional), - out_token: OUT_KW@513..517 "out" [] [Whitespace(" ")], - }, + in_modifier_token: missing (optional), + out_modfier_token: OUT_KW@513..517 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@517..518 "T" [] [], }, @@ -846,10 +818,8 @@ JsModule { l_angle_token: L_ANGLE@547..550 "<" [Newline("\n"), Whitespace("\t")] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: missing (optional), - out_token: OUT_KW@550..554 "out" [] [Whitespace(" ")], - }, + in_modifier_token: missing (optional), + out_modfier_token: OUT_KW@550..554 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@554..555 "T" [] [], }, @@ -945,10 +915,8 @@ JsModule { l_angle_token: L_ANGLE@598..599 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: IN_KW@599..602 "in" [] [Whitespace(" ")], - out_token: missing (optional), - }, + in_modifier_token: IN_KW@599..602 "in" [] [Whitespace(" ")], + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@602..603 "T" [] [], }, @@ -992,10 +960,8 @@ JsModule { l_angle_token: L_ANGLE@622..623 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: missing (optional), - out_token: OUT_KW@623..627 "out" [] [Whitespace(" ")], - }, + in_modifier_token: missing (optional), + out_modfier_token: OUT_KW@623..627 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@627..628 "T" [] [], }, @@ -1039,10 +1005,8 @@ JsModule { l_angle_token: L_ANGLE@647..648 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: IN_KW@648..651 "in" [] [Whitespace(" ")], - out_token: missing (optional), - }, + in_modifier_token: IN_KW@648..651 "in" [] [Whitespace(" ")], + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@651..652 "T" [] [], }, @@ -1051,10 +1015,8 @@ JsModule { }, COMMA@652..654 "," [] [Whitespace(" ")], TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: missing (optional), - out_token: OUT_KW@654..658 "out" [] [Whitespace(" ")], - }, + in_modifier_token: missing (optional), + out_modfier_token: OUT_KW@654..658 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@658..659 "T" [] [], }, @@ -1100,10 +1062,8 @@ JsModule { l_angle_token: L_ANGLE@682..683 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: IN_KW@683..686 "in" [] [Whitespace(" ")], - out_token: missing (optional), - }, + in_modifier_token: IN_KW@683..686 "in" [] [Whitespace(" ")], + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@686..687 "T" [] [], }, @@ -1149,10 +1109,8 @@ JsModule { l_angle_token: L_ANGLE@710..711 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: missing (optional), - out_token: OUT_KW@711..715 "out" [] [Whitespace(" ")], - }, + in_modifier_token: missing (optional), + out_modfier_token: OUT_KW@711..715 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@715..716 "T" [] [], }, @@ -1198,10 +1156,8 @@ JsModule { l_angle_token: L_ANGLE@739..740 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: IN_KW@740..743 "in" [] [Whitespace(" ")], - out_token: missing (optional), - }, + in_modifier_token: IN_KW@740..743 "in" [] [Whitespace(" ")], + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@743..744 "T" [] [], }, @@ -1210,10 +1166,8 @@ JsModule { }, COMMA@744..746 "," [] [Whitespace(" ")], TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: missing (optional), - out_token: OUT_KW@746..750 "out" [] [Whitespace(" ")], - }, + in_modifier_token: missing (optional), + out_modfier_token: OUT_KW@746..750 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@750..751 "T" [] [], }, @@ -1264,10 +1218,8 @@ JsModule { l_angle_token: L_ANGLE@773..774 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: IN_KW@774..777 "in" [] [Whitespace(" ")], - out_token: missing (optional), - }, + in_modifier_token: IN_KW@774..777 "in" [] [Whitespace(" ")], + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@777..778 "T" [] [], }, @@ -1322,10 +1274,8 @@ JsModule { l_angle_token: L_ANGLE@801..802 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: missing (optional), - out_token: OUT_KW@802..806 "out" [] [Whitespace(" ")], - }, + in_modifier_token: missing (optional), + out_modfier_token: OUT_KW@802..806 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@806..807 "T" [] [], }, @@ -1380,10 +1330,8 @@ JsModule { l_angle_token: L_ANGLE@830..831 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: IN_KW@831..834 "in" [] [Whitespace(" ")], - out_token: missing (optional), - }, + in_modifier_token: IN_KW@831..834 "in" [] [Whitespace(" ")], + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@834..835 "T" [] [], }, @@ -1392,10 +1340,8 @@ JsModule { }, COMMA@835..837 "," [] [Whitespace(" ")], TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: missing (optional), - out_token: OUT_KW@837..841 "out" [] [Whitespace(" ")], - }, + in_modifier_token: missing (optional), + out_modfier_token: OUT_KW@837..841 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@841..842 "T" [] [], }, @@ -1450,13 +1396,12 @@ JsModule { 0: L_ANGLE@28..29 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@29..33 0: TS_TYPE_PARAMETER@29..33 - 0: TS_TYPE_PARAMETER_MODIFIER@29..32 - 0: IN_KW@29..32 "in" [] [Whitespace(" ")] - 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@32..33 + 0: IN_KW@29..32 "in" [] [Whitespace(" ")] + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@32..33 0: IDENT@32..33 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@33..34 ">" [] [] 5: JS_PARAMETERS@34..37 0: L_PAREN@34..35 "(" [] [] @@ -1481,13 +1426,12 @@ JsModule { 0: L_ANGLE@60..61 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@61..66 0: TS_TYPE_PARAMETER@61..66 - 0: TS_TYPE_PARAMETER_MODIFIER@61..65 - 0: (empty) - 1: OUT_KW@61..65 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@65..66 + 0: (empty) + 1: OUT_KW@61..65 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@65..66 0: IDENT@65..66 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@66..67 ">" [] [] 5: JS_PARAMETERS@67..70 0: L_PAREN@67..68 "(" [] [] @@ -1511,13 +1455,12 @@ JsModule { 0: L_ANGLE@94..95 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@95..99 0: TS_TYPE_PARAMETER@95..99 - 0: TS_TYPE_PARAMETER_MODIFIER@95..98 - 0: IN_KW@95..98 "in" [] [Whitespace(" ")] - 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@98..99 + 0: IN_KW@95..98 "in" [] [Whitespace(" ")] + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@98..99 0: IDENT@98..99 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@99..100 ">" [] [] 5: JS_PARAMETERS@100..103 0: L_PAREN@100..101 "(" [] [] @@ -1541,13 +1484,12 @@ JsModule { 0: L_ANGLE@127..128 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@128..133 0: TS_TYPE_PARAMETER@128..133 - 0: TS_TYPE_PARAMETER_MODIFIER@128..132 - 0: (empty) - 1: OUT_KW@128..132 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@132..133 + 0: (empty) + 1: OUT_KW@128..132 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@132..133 0: IDENT@132..133 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@133..134 ">" [] [] 5: JS_PARAMETERS@134..137 0: L_PAREN@134..135 "(" [] [] @@ -1624,13 +1566,12 @@ JsModule { 0: L_ANGLE@202..203 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@203..207 0: TS_TYPE_PARAMETER@203..207 - 0: TS_TYPE_PARAMETER_MODIFIER@203..206 - 0: IN_KW@203..206 "in" [] [Whitespace(" ")] - 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@206..207 + 0: IN_KW@203..206 "in" [] [Whitespace(" ")] + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@206..207 0: IDENT@206..207 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@207..208 ">" [] [] 4: JS_PARAMETERS@208..210 0: L_PAREN@208..209 "(" [] [] @@ -1649,13 +1590,12 @@ JsModule { 0: L_ANGLE@232..233 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@233..238 0: TS_TYPE_PARAMETER@233..238 - 0: TS_TYPE_PARAMETER_MODIFIER@233..237 - 0: (empty) - 1: OUT_KW@233..237 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@237..238 + 0: (empty) + 1: OUT_KW@233..237 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@237..238 0: IDENT@237..238 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@238..239 ">" [] [] 4: JS_PARAMETERS@239..241 0: L_PAREN@239..240 "(" [] [] @@ -1733,13 +1673,12 @@ JsModule { 0: L_ANGLE@312..313 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@313..317 0: TS_TYPE_PARAMETER@313..317 - 0: TS_TYPE_PARAMETER_MODIFIER@313..316 - 0: IN_KW@313..316 "in" [] [Whitespace(" ")] - 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@316..317 + 0: IN_KW@313..316 "in" [] [Whitespace(" ")] + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@316..317 0: IDENT@316..317 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@317..319 ">" [] [Whitespace(" ")] 3: (empty) 4: (empty) @@ -1759,13 +1698,12 @@ JsModule { 0: L_ANGLE@335..336 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@336..341 0: TS_TYPE_PARAMETER@336..341 - 0: TS_TYPE_PARAMETER_MODIFIER@336..340 - 0: (empty) - 1: OUT_KW@336..340 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@340..341 + 0: (empty) + 1: OUT_KW@336..340 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@340..341 0: IDENT@340..341 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@341..343 ">" [] [Whitespace(" ")] 3: (empty) 4: (empty) @@ -1787,13 +1725,12 @@ JsModule { 0: L_ANGLE@362..363 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@363..367 0: TS_TYPE_PARAMETER@363..367 - 0: TS_TYPE_PARAMETER_MODIFIER@363..366 - 0: IN_KW@363..366 "in" [] [Whitespace(" ")] - 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@366..367 + 0: IN_KW@363..366 "in" [] [Whitespace(" ")] + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@366..367 0: IDENT@366..367 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@367..368 ">" [] [] 5: JS_PARAMETERS@368..371 0: L_PAREN@368..369 "(" [] [] @@ -1820,13 +1757,12 @@ JsModule { 0: L_ANGLE@390..391 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@391..396 0: TS_TYPE_PARAMETER@391..396 - 0: TS_TYPE_PARAMETER_MODIFIER@391..395 - 0: (empty) - 1: OUT_KW@391..395 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@395..396 + 0: (empty) + 1: OUT_KW@391..395 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@395..396 0: IDENT@395..396 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@396..397 ">" [] [] 5: JS_PARAMETERS@397..400 0: L_PAREN@397..398 "(" [] [] @@ -1860,13 +1796,12 @@ JsModule { 0: L_ANGLE@419..420 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@420..424 0: TS_TYPE_PARAMETER@420..424 - 0: TS_TYPE_PARAMETER_MODIFIER@420..423 - 0: IN_KW@420..423 "in" [] [Whitespace(" ")] - 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@423..424 + 0: IN_KW@420..423 "in" [] [Whitespace(" ")] + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@423..424 0: IDENT@423..424 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@424..425 ">" [] [] 6: JS_PARAMETERS@425..427 0: L_PAREN@425..426 "(" [] [] @@ -1905,13 +1840,12 @@ JsModule { 0: L_ANGLE@452..453 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@453..458 0: TS_TYPE_PARAMETER@453..458 - 0: TS_TYPE_PARAMETER_MODIFIER@453..457 - 0: (empty) - 1: OUT_KW@453..457 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@457..458 + 0: (empty) + 1: OUT_KW@453..457 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@457..458 0: IDENT@457..458 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@458..459 ">" [] [] 6: JS_PARAMETERS@459..461 0: L_PAREN@459..460 "(" [] [] @@ -1946,13 +1880,12 @@ JsModule { 0: L_ANGLE@482..483 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@483..487 0: TS_TYPE_PARAMETER@483..487 - 0: TS_TYPE_PARAMETER_MODIFIER@483..486 - 0: IN_KW@483..486 "in" [] [Whitespace(" ")] - 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@486..487 + 0: IN_KW@483..486 "in" [] [Whitespace(" ")] + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@486..487 0: IDENT@486..487 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@487..488 ">" [] [] 4: JS_PARAMETERS@488..490 0: L_PAREN@488..489 "(" [] [] @@ -1988,13 +1921,12 @@ JsModule { 0: L_ANGLE@512..513 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@513..518 0: TS_TYPE_PARAMETER@513..518 - 0: TS_TYPE_PARAMETER_MODIFIER@513..517 - 0: (empty) - 1: OUT_KW@513..517 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@517..518 + 0: (empty) + 1: OUT_KW@513..517 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@517..518 0: IDENT@517..518 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@518..519 ">" [] [] 4: JS_PARAMETERS@519..521 0: L_PAREN@519..520 "(" [] [] @@ -2046,13 +1978,12 @@ JsModule { 0: L_ANGLE@547..550 "<" [Newline("\n"), Whitespace("\t")] [] 1: TS_TYPE_PARAMETER_LIST@550..555 0: TS_TYPE_PARAMETER@550..555 - 0: TS_TYPE_PARAMETER_MODIFIER@550..554 - 0: (empty) - 1: OUT_KW@550..554 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@554..555 + 0: (empty) + 1: OUT_KW@550..554 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@554..555 0: IDENT@554..555 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@555..556 ">" [] [] 2: JS_PARAMETERS@556..559 0: L_PAREN@556..557 "(" [] [] @@ -2116,13 +2047,12 @@ JsModule { 0: L_ANGLE@598..599 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@599..603 0: TS_TYPE_PARAMETER@599..603 - 0: TS_TYPE_PARAMETER_MODIFIER@599..602 - 0: IN_KW@599..602 "in" [] [Whitespace(" ")] - 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@602..603 + 0: IN_KW@599..602 "in" [] [Whitespace(" ")] + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@602..603 0: IDENT@602..603 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@603..604 ">" [] [] 1: JS_PARAMETERS@604..607 0: L_PAREN@604..605 "(" [] [] @@ -2149,13 +2079,12 @@ JsModule { 0: L_ANGLE@622..623 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@623..628 0: TS_TYPE_PARAMETER@623..628 - 0: TS_TYPE_PARAMETER_MODIFIER@623..627 - 0: (empty) - 1: OUT_KW@623..627 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@627..628 + 0: (empty) + 1: OUT_KW@623..627 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@627..628 0: IDENT@627..628 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@628..629 ">" [] [] 1: JS_PARAMETERS@629..632 0: L_PAREN@629..630 "(" [] [] @@ -2182,22 +2111,20 @@ JsModule { 0: L_ANGLE@647..648 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@648..659 0: TS_TYPE_PARAMETER@648..652 - 0: TS_TYPE_PARAMETER_MODIFIER@648..651 - 0: IN_KW@648..651 "in" [] [Whitespace(" ")] - 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@651..652 + 0: IN_KW@648..651 "in" [] [Whitespace(" ")] + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@651..652 0: IDENT@651..652 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 1: COMMA@652..654 "," [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER@654..659 - 0: TS_TYPE_PARAMETER_MODIFIER@654..658 - 0: (empty) - 1: OUT_KW@654..658 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@658..659 + 0: (empty) + 1: OUT_KW@654..658 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@658..659 0: IDENT@658..659 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@659..660 ">" [] [] 1: JS_PARAMETERS@660..663 0: L_PAREN@660..661 "(" [] [] @@ -2226,13 +2153,12 @@ JsModule { 0: L_ANGLE@682..683 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@683..687 0: TS_TYPE_PARAMETER@683..687 - 0: TS_TYPE_PARAMETER_MODIFIER@683..686 - 0: IN_KW@683..686 "in" [] [Whitespace(" ")] - 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@686..687 + 0: IN_KW@683..686 "in" [] [Whitespace(" ")] + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@686..687 0: IDENT@686..687 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@687..688 ">" [] [] 3: JS_PARAMETERS@688..691 0: L_PAREN@688..689 "(" [] [] @@ -2261,13 +2187,12 @@ JsModule { 0: L_ANGLE@710..711 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@711..716 0: TS_TYPE_PARAMETER@711..716 - 0: TS_TYPE_PARAMETER_MODIFIER@711..715 - 0: (empty) - 1: OUT_KW@711..715 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@715..716 + 0: (empty) + 1: OUT_KW@711..715 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@715..716 0: IDENT@715..716 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@716..717 ">" [] [] 3: JS_PARAMETERS@717..720 0: L_PAREN@717..718 "(" [] [] @@ -2296,22 +2221,20 @@ JsModule { 0: L_ANGLE@739..740 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@740..751 0: TS_TYPE_PARAMETER@740..744 - 0: TS_TYPE_PARAMETER_MODIFIER@740..743 - 0: IN_KW@740..743 "in" [] [Whitespace(" ")] - 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@743..744 + 0: IN_KW@740..743 "in" [] [Whitespace(" ")] + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@743..744 0: IDENT@743..744 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 1: COMMA@744..746 "," [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER@746..751 - 0: TS_TYPE_PARAMETER_MODIFIER@746..750 - 0: (empty) - 1: OUT_KW@746..750 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@750..751 + 0: (empty) + 1: OUT_KW@746..750 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@750..751 0: IDENT@750..751 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@751..752 ">" [] [] 3: JS_PARAMETERS@752..755 0: L_PAREN@752..753 "(" [] [] @@ -2344,13 +2267,12 @@ JsModule { 0: L_ANGLE@773..774 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@774..778 0: TS_TYPE_PARAMETER@774..778 - 0: TS_TYPE_PARAMETER_MODIFIER@774..777 - 0: IN_KW@774..777 "in" [] [Whitespace(" ")] - 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@777..778 + 0: IN_KW@774..777 "in" [] [Whitespace(" ")] + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@777..778 0: IDENT@777..778 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@778..779 ">" [] [] 3: JS_PARAMETERS@779..781 0: L_PAREN@779..780 "(" [] [] @@ -2384,13 +2306,12 @@ JsModule { 0: L_ANGLE@801..802 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@802..807 0: TS_TYPE_PARAMETER@802..807 - 0: TS_TYPE_PARAMETER_MODIFIER@802..806 - 0: (empty) - 1: OUT_KW@802..806 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@806..807 + 0: (empty) + 1: OUT_KW@802..806 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@806..807 0: IDENT@806..807 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@807..808 ">" [] [] 3: JS_PARAMETERS@808..810 0: L_PAREN@808..809 "(" [] [] @@ -2424,22 +2345,20 @@ JsModule { 0: L_ANGLE@830..831 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@831..842 0: TS_TYPE_PARAMETER@831..835 - 0: TS_TYPE_PARAMETER_MODIFIER@831..834 - 0: IN_KW@831..834 "in" [] [Whitespace(" ")] - 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@834..835 + 0: IN_KW@831..834 "in" [] [Whitespace(" ")] + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@834..835 0: IDENT@834..835 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 1: COMMA@835..837 "," [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER@837..842 - 0: TS_TYPE_PARAMETER_MODIFIER@837..841 - 0: (empty) - 1: OUT_KW@837..841 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@841..842 + 0: (empty) + 1: OUT_KW@837..841 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@841..842 0: IDENT@841..842 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@842..843 ">" [] [] 3: JS_PARAMETERS@843..845 0: L_PAREN@843..844 "(" [] [] diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_arrow_function_type_parameters.rast b/crates/rome_js_parser/test_data/inline/ok/ts_arrow_function_type_parameters.rast index 5080690573b..32f32355cc5 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_arrow_function_type_parameters.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_arrow_function_type_parameters.rast @@ -19,7 +19,8 @@ JsModule { l_angle_token: L_ANGLE@8..9 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@9..10 "A" [] [], }, @@ -28,7 +29,8 @@ JsModule { }, COMMA@10..12 "," [] [Whitespace(" ")], TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@12..14 "B" [] [Whitespace(" ")], }, @@ -45,7 +47,8 @@ JsModule { }, COMMA@23..25 "," [] [Whitespace(" ")], TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@25..27 "C" [] [Whitespace(" ")], }, @@ -145,7 +148,8 @@ JsModule { l_angle_token: L_ANGLE@81..82 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@82..83 "A" [] [], }, @@ -154,7 +158,8 @@ JsModule { }, COMMA@83..85 "," [] [Whitespace(" ")], TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@85..86 "B" [] [], }, @@ -256,29 +261,32 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@9..35 0: TS_TYPE_PARAMETER@9..10 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@9..10 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@9..10 0: IDENT@9..10 "A" [] [] - 2: (empty) 3: (empty) + 4: (empty) 1: COMMA@10..12 "," [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER@12..23 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@12..14 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@12..14 0: IDENT@12..14 "B" [] [Whitespace(" ")] - 2: TS_TYPE_CONSTRAINT_CLAUSE@14..23 + 3: TS_TYPE_CONSTRAINT_CLAUSE@14..23 0: EXTENDS_KW@14..22 "extends" [] [Whitespace(" ")] 1: TS_REFERENCE_TYPE@22..23 0: JS_REFERENCE_IDENTIFIER@22..23 0: IDENT@22..23 "A" [] [] 1: (empty) - 3: (empty) + 4: (empty) 3: COMMA@23..25 "," [] [Whitespace(" ")] 4: TS_TYPE_PARAMETER@25..35 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@25..27 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@25..27 0: IDENT@25..27 "C" [] [Whitespace(" ")] - 2: (empty) - 3: TS_DEFAULT_TYPE_CLAUSE@27..35 + 3: (empty) + 4: TS_DEFAULT_TYPE_CLAUSE@27..35 0: EQ@27..29 "=" [] [Whitespace(" ")] 1: TS_STRING_TYPE@29..35 0: STRING_KW@29..35 "string" [] [] @@ -344,17 +352,19 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@82..86 0: TS_TYPE_PARAMETER@82..83 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@82..83 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@82..83 0: IDENT@82..83 "A" [] [] - 2: (empty) 3: (empty) + 4: (empty) 1: COMMA@83..85 "," [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER@85..86 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@85..86 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@85..86 0: IDENT@85..86 "B" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@86..87 ">" [] [] 2: JS_PARAMETERS@87..99 0: L_PAREN@87..88 "(" [] [] diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_as_assignment.rast b/crates/rome_js_parser/test_data/inline/ok/ts_as_assignment.rast index 0a34ba2e3df..d9f46dae6e9 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_as_assignment.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_as_assignment.rast @@ -31,7 +31,8 @@ JsModule { l_angle_token: L_ANGLE@18..19 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@19..20 "A" [] [], }, @@ -325,10 +326,11 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@19..20 0: TS_TYPE_PARAMETER@19..20 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@19..20 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@19..20 0: IDENT@19..20 "A" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@20..22 ">" [] [Whitespace(" ")] 3: EQ@22..24 "=" [] [Whitespace(" ")] 4: TS_OBJECT_TYPE@24..32 diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_call_expr_with_type_arguments.rast b/crates/rome_js_parser/test_data/inline/ok/ts_call_expr_with_type_arguments.rast index 9b40401a600..d2f82a0db7e 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_call_expr_with_type_arguments.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_call_expr_with_type_arguments.rast @@ -13,7 +13,8 @@ JsModule { l_angle_token: L_ANGLE@10..11 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@11..12 "A" [] [], }, @@ -22,7 +23,8 @@ JsModule { }, COMMA@12..14 "," [] [Whitespace(" ")], TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@14..15 "B" [] [], }, @@ -31,7 +33,8 @@ JsModule { }, COMMA@15..17 "," [] [Whitespace(" ")], TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@17..18 "C" [] [], }, @@ -238,7 +241,8 @@ JsModule { l_angle_token: L_ANGLE@94..95 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@95..96 "T" [] [], }, @@ -273,7 +277,8 @@ JsModule { l_angle_token: L_ANGLE@105..106 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@106..107 "T" [] [], }, @@ -348,24 +353,27 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@11..18 0: TS_TYPE_PARAMETER@11..12 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@11..12 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@11..12 0: IDENT@11..12 "A" [] [] - 2: (empty) 3: (empty) + 4: (empty) 1: COMMA@12..14 "," [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER@14..15 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@14..15 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@14..15 0: IDENT@14..15 "B" [] [] - 2: (empty) 3: (empty) + 4: (empty) 3: COMMA@15..17 "," [] [Whitespace(" ")] 4: TS_TYPE_PARAMETER@17..18 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@17..18 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@17..18 0: IDENT@17..18 "C" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@18..19 ">" [] [] 5: JS_PARAMETERS@19..22 0: L_PAREN@19..20 "(" [] [] @@ -510,10 +518,11 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@95..96 0: TS_TYPE_PARAMETER@95..96 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@95..96 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@95..96 0: IDENT@95..96 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@96..98 ">" [] [Whitespace(" ")] 3: EQ@98..100 "=" [] [Whitespace(" ")] 4: TS_REFERENCE_TYPE@100..101 @@ -536,10 +545,11 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@106..107 0: TS_TYPE_PARAMETER@106..107 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@106..107 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@106..107 0: IDENT@106..107 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@107..108 ">" [] [] 1: JS_PARAMETERS@108..117 0: L_PAREN@108..109 "(" [] [] diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_call_signature_member.rast b/crates/rome_js_parser/test_data/inline/ok/ts_call_signature_member.rast index d3305c9d0a1..4c7f0f1035c 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_call_signature_member.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_call_signature_member.rast @@ -104,7 +104,8 @@ JsModule { l_angle_token: L_ANGLE@67..68 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@68..69 "A" [] [], }, @@ -113,7 +114,8 @@ JsModule { }, COMMA@69..71 "," [] [Whitespace(" ")], TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@71..72 "B" [] [], }, @@ -262,17 +264,19 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@68..72 0: TS_TYPE_PARAMETER@68..69 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@68..69 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@68..69 0: IDENT@68..69 "A" [] [] - 2: (empty) 3: (empty) + 4: (empty) 1: COMMA@69..71 "," [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER@71..72 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@71..72 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@71..72 0: IDENT@71..72 "B" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@72..73 ">" [] [] 1: JS_PARAMETERS@73..85 0: L_PAREN@73..74 "(" [] [] diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_class_type_parameters.rast b/crates/rome_js_parser/test_data/inline/ok/ts_class_type_parameters.rast index 1cd5d112396..fa11a8601b6 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_class_type_parameters.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_class_type_parameters.rast @@ -12,7 +12,8 @@ JsModule { l_angle_token: L_ANGLE@16..17 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@17..18 "A" [] [], }, @@ -21,7 +22,8 @@ JsModule { }, COMMA@18..20 "," [] [Whitespace(" ")], TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@20..21 "B" [] [], }, @@ -30,7 +32,8 @@ JsModule { }, COMMA@21..23 "," [] [Whitespace(" ")], TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@23..24 "C" [] [], }, @@ -64,24 +67,27 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@17..24 0: TS_TYPE_PARAMETER@17..18 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@17..18 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@17..18 0: IDENT@17..18 "A" [] [] - 2: (empty) 3: (empty) + 4: (empty) 1: COMMA@18..20 "," [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER@20..21 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@20..21 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@20..21 0: IDENT@20..21 "B" [] [] - 2: (empty) 3: (empty) + 4: (empty) 3: COMMA@21..23 "," [] [Whitespace(" ")] 4: TS_TYPE_PARAMETER@23..24 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@23..24 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@23..24 0: IDENT@23..24 "C" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@24..26 ">" [] [Whitespace(" ")] 4: (empty) 5: (empty) diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_conditional_type_call_signature_lhs.rast b/crates/rome_js_parser/test_data/inline/ok/ts_conditional_type_call_signature_lhs.rast index 9385b4bf36b..318f0a0808a 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_conditional_type_call_signature_lhs.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_conditional_type_call_signature_lhs.rast @@ -11,7 +11,8 @@ JsModule { l_angle_token: L_ANGLE@6..7 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@7..8 "V" [] [], }, @@ -126,10 +127,11 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@7..8 0: TS_TYPE_PARAMETER@7..8 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@7..8 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@7..8 0: IDENT@7..8 "V" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@8..10 ">" [] [Whitespace(" ")] 3: EQ@10..12 "=" [] [Whitespace(" ")] 4: TS_CONDITIONAL_TYPE@12..91 diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_construct_signature_member.rast b/crates/rome_js_parser/test_data/inline/ok/ts_construct_signature_member.rast index ee62d943c37..413fdf684a7 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_construct_signature_member.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_construct_signature_member.rast @@ -103,7 +103,8 @@ JsModule { l_angle_token: L_ANGLE@84..85 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@85..86 "A" [] [], }, @@ -112,7 +113,8 @@ JsModule { }, COMMA@86..88 "," [] [Whitespace(" ")], TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@88..89 "B" [] [], }, @@ -260,17 +262,19 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@85..89 0: TS_TYPE_PARAMETER@85..86 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@85..86 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@85..86 0: IDENT@85..86 "A" [] [] - 2: (empty) 3: (empty) + 4: (empty) 1: COMMA@86..88 "," [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER@88..89 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@88..89 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@88..89 0: IDENT@88..89 "B" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@89..90 ">" [] [] 2: JS_PARAMETERS@90..102 0: L_PAREN@90..91 "(" [] [] diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_constructor_type.rast b/crates/rome_js_parser/test_data/inline/ok/ts_constructor_type.rast index 988f5686557..7117c866f59 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_constructor_type.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_constructor_type.rast @@ -118,7 +118,8 @@ JsModule { l_angle_token: L_ANGLE@113..114 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@114..115 "A" [] [], }, @@ -127,7 +128,8 @@ JsModule { }, COMMA@115..117 "," [] [Whitespace(" ")], TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@117..118 "B" [] [], }, @@ -197,7 +199,8 @@ JsModule { l_angle_token: L_ANGLE@164..165 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@165..166 "A" [] [], }, @@ -206,7 +209,8 @@ JsModule { }, COMMA@166..168 "," [] [Whitespace(" ")], TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@168..169 "B" [] [], }, @@ -358,17 +362,19 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@114..118 0: TS_TYPE_PARAMETER@114..115 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@114..115 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@114..115 0: IDENT@114..115 "A" [] [] - 2: (empty) 3: (empty) + 4: (empty) 1: COMMA@115..117 "," [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER@117..118 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@117..118 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@117..118 0: IDENT@117..118 "B" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@118..119 ">" [] [] 3: JS_PARAMETERS@119..132 0: L_PAREN@119..120 "(" [] [] @@ -415,17 +421,19 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@165..169 0: TS_TYPE_PARAMETER@165..166 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@165..166 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@165..166 0: IDENT@165..166 "A" [] [] - 2: (empty) 3: (empty) + 4: (empty) 1: COMMA@166..168 "," [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER@168..169 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@168..169 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@168..169 0: IDENT@168..169 "B" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@169..170 ">" [] [] 3: JS_PARAMETERS@170..183 0: L_PAREN@170..171 "(" [] [] diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_declare_function.rast b/crates/rome_js_parser/test_data/inline/ok/ts_declare_function.rast index 40b4299205d..a293bd3c644 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_declare_function.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_declare_function.rast @@ -14,7 +14,8 @@ JsModule { l_angle_token: L_ANGLE@21..22 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@22..23 "A" [] [], }, @@ -23,7 +24,8 @@ JsModule { }, COMMA@23..25 "," [] [Whitespace(" ")], TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@25..26 "B" [] [], }, @@ -32,7 +34,8 @@ JsModule { }, COMMA@26..28 "," [] [Whitespace(" ")], TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@28..29 "R" [] [], }, @@ -200,24 +203,27 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@22..29 0: TS_TYPE_PARAMETER@22..23 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@22..23 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@22..23 0: IDENT@22..23 "A" [] [] - 2: (empty) 3: (empty) + 4: (empty) 1: COMMA@23..25 "," [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER@25..26 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@25..26 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@25..26 0: IDENT@25..26 "B" [] [] - 2: (empty) 3: (empty) + 4: (empty) 3: COMMA@26..28 "," [] [Whitespace(" ")] 4: TS_TYPE_PARAMETER@28..29 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@28..29 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@28..29 0: IDENT@28..29 "R" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@29..30 ">" [] [] 4: JS_PARAMETERS@30..42 0: L_PAREN@30..31 "(" [] [] diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_default_type_clause.rast b/crates/rome_js_parser/test_data/inline/ok/ts_default_type_clause.rast index 42513c3a1b2..f6edfdc0d10 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_default_type_clause.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_default_type_clause.rast @@ -11,7 +11,8 @@ JsModule { l_angle_token: L_ANGLE@6..7 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@7..8 "X" [] [], }, @@ -44,7 +45,8 @@ JsModule { l_angle_token: L_ANGLE@28..29 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@29..31 "X" [] [Whitespace(" ")], }, @@ -116,10 +118,11 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@7..15 0: TS_TYPE_PARAMETER@7..15 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@7..8 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@7..8 0: IDENT@7..8 "X" [] [] - 2: (empty) - 3: TS_DEFAULT_TYPE_CLAUSE@8..15 + 3: (empty) + 4: TS_DEFAULT_TYPE_CLAUSE@8..15 0: EQ@8..9 "=" [] [] 1: TS_STRING_TYPE@9..15 0: STRING_KW@9..15 "string" [] [] @@ -139,9 +142,10 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@29..63 0: TS_TYPE_PARAMETER@29..63 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@29..31 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@29..31 0: IDENT@29..31 "X" [] [Whitespace(" ")] - 2: TS_TYPE_CONSTRAINT_CLAUSE@31..55 + 3: TS_TYPE_CONSTRAINT_CLAUSE@31..55 0: EXTENDS_KW@31..39 "extends" [] [Whitespace(" ")] 1: TS_UNION_TYPE@39..55 0: (empty) @@ -151,7 +155,7 @@ JsModule { 1: PIPE@46..48 "|" [] [Whitespace(" ")] 2: TS_STRING_TYPE@48..55 0: STRING_KW@48..55 "string" [] [Whitespace(" ")] - 3: TS_DEFAULT_TYPE_CLAUSE@55..63 + 4: TS_DEFAULT_TYPE_CLAUSE@55..63 0: EQ@55..57 "=" [] [Whitespace(" ")] 1: TS_STRING_TYPE@57..63 0: STRING_KW@57..63 "string" [] [] diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_function_statement.rast b/crates/rome_js_parser/test_data/inline/ok/ts_function_statement.rast index fabbee4490f..b7c5882d25d 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_function_statement.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_function_statement.rast @@ -76,7 +76,8 @@ JsModule { l_angle_token: L_ANGLE@67..68 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@68..69 "A" [] [], }, @@ -85,7 +86,8 @@ JsModule { }, COMMA@69..71 "," [] [Whitespace(" ")], TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@71..73 "B" [] [Whitespace(" ")], }, @@ -102,7 +104,8 @@ JsModule { }, COMMA@82..84 "," [] [Whitespace(" ")], TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@84..86 "C" [] [Whitespace(" ")], }, @@ -249,29 +252,32 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@68..89 0: TS_TYPE_PARAMETER@68..69 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@68..69 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@68..69 0: IDENT@68..69 "A" [] [] - 2: (empty) 3: (empty) + 4: (empty) 1: COMMA@69..71 "," [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER@71..82 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@71..73 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@71..73 0: IDENT@71..73 "B" [] [Whitespace(" ")] - 2: TS_TYPE_CONSTRAINT_CLAUSE@73..82 + 3: TS_TYPE_CONSTRAINT_CLAUSE@73..82 0: EXTENDS_KW@73..81 "extends" [] [Whitespace(" ")] 1: TS_REFERENCE_TYPE@81..82 0: JS_REFERENCE_IDENTIFIER@81..82 0: IDENT@81..82 "A" [] [] 1: (empty) - 3: (empty) + 4: (empty) 3: COMMA@82..84 "," [] [Whitespace(" ")] 4: TS_TYPE_PARAMETER@84..89 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@84..86 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@84..86 0: IDENT@84..86 "C" [] [Whitespace(" ")] - 2: (empty) - 3: TS_DEFAULT_TYPE_CLAUSE@86..89 + 3: (empty) + 4: TS_DEFAULT_TYPE_CLAUSE@86..89 0: EQ@86..88 "=" [] [Whitespace(" ")] 1: TS_REFERENCE_TYPE@88..89 0: JS_REFERENCE_IDENTIFIER@88..89 diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_function_type.rast b/crates/rome_js_parser/test_data/inline/ok/ts_function_type.rast index ea3e7153d73..59837c35d9c 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_function_type.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_function_type.rast @@ -219,7 +219,8 @@ JsModule { l_angle_token: L_ANGLE@173..174 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@174..175 "A" [] [], }, @@ -228,7 +229,8 @@ JsModule { }, COMMA@175..177 "," [] [Whitespace(" ")], TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@177..178 "B" [] [], }, @@ -540,17 +542,19 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@174..178 0: TS_TYPE_PARAMETER@174..175 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@174..175 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@174..175 0: IDENT@174..175 "A" [] [] - 2: (empty) 3: (empty) + 4: (empty) 1: COMMA@175..177 "," [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER@177..178 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@177..178 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@177..178 0: IDENT@177..178 "B" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@178..179 ">" [] [] 1: JS_PARAMETERS@179..192 0: L_PAREN@179..180 "(" [] [] diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_interface_extends_clause.rast b/crates/rome_js_parser/test_data/inline/ok/ts_interface_extends_clause.rast index cab4eb32699..b78b3dd9f5d 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_interface_extends_clause.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_interface_extends_clause.rast @@ -11,7 +11,8 @@ JsModule { l_angle_token: L_ANGLE@11..12 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@12..16 "Prop" [] [], }, @@ -126,10 +127,11 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@12..16 0: TS_TYPE_PARAMETER@12..16 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@12..16 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@12..16 0: IDENT@12..16 "Prop" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@16..18 ">" [] [Whitespace(" ")] 3: (empty) 4: L_CURLY@18..20 "{" [] [Whitespace(" ")] diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_mapped_type.rast b/crates/rome_js_parser/test_data/inline/ok/ts_mapped_type.rast index fad2ac0d55a..449b93aae67 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_mapped_type.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_mapped_type.rast @@ -47,7 +47,8 @@ JsModule { l_angle_token: L_ANGLE@50..51 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@51..55 "Type" [] [], }, @@ -98,7 +99,8 @@ JsModule { l_angle_token: L_ANGLE@119..120 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@120..124 "Type" [] [], }, @@ -165,7 +167,8 @@ JsModule { l_angle_token: L_ANGLE@199..200 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@200..204 "Type" [] [], }, @@ -232,7 +235,8 @@ JsModule { l_angle_token: L_ANGLE@270..271 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@271..275 "Type" [] [], }, @@ -382,10 +386,11 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@51..55 0: TS_TYPE_PARAMETER@51..55 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@51..55 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@51..55 0: IDENT@51..55 "Type" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@55..57 ">" [] [Whitespace(" ")] 3: EQ@57..59 "=" [] [Whitespace(" ")] 4: TS_MAPPED_TYPE@59..99 @@ -420,10 +425,11 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@120..124 0: TS_TYPE_PARAMETER@120..124 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@120..124 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@120..124 0: IDENT@120..124 "Type" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@124..126 ">" [] [Whitespace(" ")] 3: EQ@126..128 "=" [] [Whitespace(" ")] 4: TS_MAPPED_TYPE@128..184 @@ -469,10 +475,11 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@200..204 0: TS_TYPE_PARAMETER@200..204 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@200..204 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@200..204 0: IDENT@200..204 "Type" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@204..206 ">" [] [Whitespace(" ")] 3: EQ@206..208 "=" [] [Whitespace(" ")] 4: TS_MAPPED_TYPE@208..256 @@ -518,10 +525,11 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@271..275 0: TS_TYPE_PARAMETER@271..275 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@271..275 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@271..275 0: IDENT@271..275 "Type" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@275..277 ">" [] [Whitespace(" ")] 3: EQ@277..279 "=" [] [Whitespace(" ")] 4: TS_MAPPED_TYPE@279..374 diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_method_class_member.rast b/crates/rome_js_parser/test_data/inline/ok/ts_method_class_member.rast index 4ad8b9c1130..fe91601c8d0 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_method_class_member.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_method_class_member.rast @@ -25,7 +25,8 @@ JsModule { l_angle_token: L_ANGLE@19..20 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@20..21 "A" [] [], }, @@ -34,7 +35,8 @@ JsModule { }, COMMA@21..23 "," [] [Whitespace(" ")], TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@23..25 "B" [] [Whitespace(" ")], }, @@ -51,7 +53,8 @@ JsModule { }, COMMA@34..36 "," [] [Whitespace(" ")], TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@36..37 "R" [] [], }, @@ -149,29 +152,32 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@20..37 0: TS_TYPE_PARAMETER@20..21 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@20..21 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@20..21 0: IDENT@20..21 "A" [] [] - 2: (empty) 3: (empty) + 4: (empty) 1: COMMA@21..23 "," [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER@23..34 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@23..25 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@23..25 0: IDENT@23..25 "B" [] [Whitespace(" ")] - 2: TS_TYPE_CONSTRAINT_CLAUSE@25..34 + 3: TS_TYPE_CONSTRAINT_CLAUSE@25..34 0: EXTENDS_KW@25..33 "extends" [] [Whitespace(" ")] 1: TS_REFERENCE_TYPE@33..34 0: JS_REFERENCE_IDENTIFIER@33..34 0: IDENT@33..34 "A" [] [] 1: (empty) - 3: (empty) + 4: (empty) 3: COMMA@34..36 "," [] [Whitespace(" ")] 4: TS_TYPE_PARAMETER@36..37 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@36..37 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@36..37 0: IDENT@36..37 "R" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@37..38 ">" [] [] 6: JS_PARAMETERS@38..50 0: L_PAREN@38..39 "(" [] [] diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_method_object_member_body.rast b/crates/rome_js_parser/test_data/inline/ok/ts_method_object_member_body.rast index 286b3edd66a..54f4760ee76 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_method_object_member_body.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_method_object_member_body.rast @@ -18,7 +18,8 @@ JsModule { l_angle_token: L_ANGLE@8..9 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@9..10 "A" [] [], }, @@ -136,7 +137,8 @@ JsModule { l_angle_token: L_ANGLE@115..116 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@116..117 "R" [] [], }, @@ -256,10 +258,11 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@9..10 0: TS_TYPE_PARAMETER@9..10 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@9..10 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@9..10 0: IDENT@9..10 "A" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@10..11 ">" [] [] 4: JS_PARAMETERS@11..24 0: L_PAREN@11..12 "(" [] [] @@ -339,10 +342,11 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@116..117 0: TS_TYPE_PARAMETER@116..117 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@116..117 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@116..117 0: IDENT@116..117 "R" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@117..118 ">" [] [] 4: JS_PARAMETERS@118..137 0: L_PAREN@118..119 "(" [] [] diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_new_with_type_arguments.rast b/crates/rome_js_parser/test_data/inline/ok/ts_new_with_type_arguments.rast index e1cd9a54158..378d27d8d39 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_new_with_type_arguments.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_new_with_type_arguments.rast @@ -12,7 +12,8 @@ JsModule { l_angle_token: L_ANGLE@10..11 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@11..12 "A" [] [], }, @@ -21,7 +22,8 @@ JsModule { }, COMMA@12..14 "," [] [Whitespace(" ")], TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@14..15 "B" [] [], }, @@ -30,7 +32,8 @@ JsModule { }, COMMA@15..17 "," [] [Whitespace(" ")], TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@17..18 "C" [] [], }, @@ -106,24 +109,27 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@11..18 0: TS_TYPE_PARAMETER@11..12 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@11..12 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@11..12 0: IDENT@11..12 "A" [] [] - 2: (empty) 3: (empty) + 4: (empty) 1: COMMA@12..14 "," [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER@14..15 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@14..15 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@14..15 0: IDENT@14..15 "B" [] [] - 2: (empty) 3: (empty) + 4: (empty) 3: COMMA@15..17 "," [] [Whitespace(" ")] 4: TS_TYPE_PARAMETER@17..18 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@17..18 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@17..18 0: IDENT@17..18 "C" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@18..20 ">" [] [Whitespace(" ")] 4: (empty) 5: (empty) diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_optional_chain_call.rast b/crates/rome_js_parser/test_data/inline/ok/ts_optional_chain_call.rast index ae7cd57054f..8f806cccb9a 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_optional_chain_call.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_optional_chain_call.rast @@ -12,7 +12,8 @@ JsModule { l_angle_token: L_ANGLE@1..2 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@2..3 "A" [] [], }, @@ -21,7 +22,8 @@ JsModule { }, COMMA@3..5 "," [] [Whitespace(" ")], TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@5..6 "B" [] [], }, @@ -94,17 +96,19 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@2..6 0: TS_TYPE_PARAMETER@2..3 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@2..3 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@2..3 0: IDENT@2..3 "A" [] [] - 2: (empty) 3: (empty) + 4: (empty) 1: COMMA@3..5 "," [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER@5..6 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@5..6 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@5..6 0: IDENT@5..6 "B" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@6..7 ">" [] [] 2: JS_PARAMETERS@7..10 0: L_PAREN@7..8 "(" [] [] diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_property_or_method_signature_member.rast b/crates/rome_js_parser/test_data/inline/ok/ts_property_or_method_signature_member.rast index 0558abba90e..28ae58d4292 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_property_or_method_signature_member.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_property_or_method_signature_member.rast @@ -236,7 +236,8 @@ JsModule { l_angle_token: L_ANGLE@189..190 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@190..191 "A" [] [], }, @@ -245,7 +246,8 @@ JsModule { }, COMMA@191..193 "," [] [Whitespace(" ")], TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@193..194 "B" [] [], }, @@ -488,17 +490,19 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@190..194 0: TS_TYPE_PARAMETER@190..191 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@190..191 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@190..191 0: IDENT@190..191 "A" [] [] - 2: (empty) 3: (empty) + 4: (empty) 1: COMMA@191..193 "," [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER@193..194 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@193..194 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@193..194 0: IDENT@193..194 "B" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@194..195 ">" [] [] 3: JS_PARAMETERS@195..207 0: L_PAREN@195..196 "(" [] [] diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_template_literal_type.rast b/crates/rome_js_parser/test_data/inline/ok/ts_template_literal_type.rast index 79d2e3034ce..aa4d5bb62ff 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_template_literal_type.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_template_literal_type.rast @@ -57,7 +57,8 @@ JsModule { l_angle_token: L_ANGLE@39..40 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@40..42 "X" [] [Whitespace(" ")], }, @@ -144,13 +145,14 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@40..56 0: TS_TYPE_PARAMETER@40..56 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@40..42 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@40..42 0: IDENT@40..42 "X" [] [Whitespace(" ")] - 2: TS_TYPE_CONSTRAINT_CLAUSE@42..56 + 3: TS_TYPE_CONSTRAINT_CLAUSE@42..56 0: EXTENDS_KW@42..50 "extends" [] [Whitespace(" ")] 1: TS_STRING_TYPE@50..56 0: STRING_KW@50..56 "string" [] [] - 3: (empty) + 4: (empty) 2: R_ANGLE@56..58 ">" [] [Whitespace(" ")] 3: EQ@58..60 "=" [] [Whitespace(" ")] 4: TS_TEMPLATE_LITERAL_TYPE@60..67 diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_type_arguments_left_shift.rast b/crates/rome_js_parser/test_data/inline/ok/ts_type_arguments_left_shift.rast index a03be322c18..d03f5df9a52 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_type_arguments_left_shift.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_type_arguments_left_shift.rast @@ -11,7 +11,8 @@ JsModule { l_angle_token: L_ANGLE@6..7 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@7..8 "T" [] [], }, @@ -49,7 +50,8 @@ JsModule { l_angle_token: L_ANGLE@26..27 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@27..28 "C" [] [], }, @@ -109,10 +111,11 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@7..8 0: TS_TYPE_PARAMETER@7..8 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@7..8 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@7..8 0: IDENT@7..8 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@8..10 ">" [] [Whitespace(" ")] 3: EQ@10..12 "=" [] [Whitespace(" ")] 4: TS_REFERENCE_TYPE@12..13 @@ -138,10 +141,11 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@27..28 0: TS_TYPE_PARAMETER@27..28 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@27..28 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@27..28 0: IDENT@27..28 "C" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@28..29 ">" [] [] 1: JS_PARAMETERS@29..36 0: L_PAREN@29..30 "(" [] [] diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_type_constraint_clause.rast b/crates/rome_js_parser/test_data/inline/ok/ts_type_constraint_clause.rast index f9a2d442ed5..9652212b657 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_type_constraint_clause.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_type_constraint_clause.rast @@ -11,7 +11,8 @@ JsModule { l_angle_token: L_ANGLE@6..7 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@7..9 "X" [] [Whitespace(" ")], }, @@ -44,7 +45,8 @@ JsModule { l_angle_token: L_ANGLE@36..37 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@37..39 "X" [] [Whitespace(" ")], }, @@ -111,13 +113,14 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@7..23 0: TS_TYPE_PARAMETER@7..23 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@7..9 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@7..9 0: IDENT@7..9 "X" [] [Whitespace(" ")] - 2: TS_TYPE_CONSTRAINT_CLAUSE@9..23 + 3: TS_TYPE_CONSTRAINT_CLAUSE@9..23 0: EXTENDS_KW@9..17 "extends" [] [Whitespace(" ")] 1: TS_NUMBER_TYPE@17..23 0: NUMBER_KW@17..23 "number" [] [] - 3: (empty) + 4: (empty) 2: R_ANGLE@23..25 ">" [] [Whitespace(" ")] 3: EQ@25..27 "=" [] [Whitespace(" ")] 4: TS_REFERENCE_TYPE@27..28 @@ -134,9 +137,10 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@37..62 0: TS_TYPE_PARAMETER@37..62 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@37..39 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@37..39 0: IDENT@37..39 "X" [] [Whitespace(" ")] - 2: TS_TYPE_CONSTRAINT_CLAUSE@39..62 + 3: TS_TYPE_CONSTRAINT_CLAUSE@39..62 0: EXTENDS_KW@39..47 "extends" [] [Whitespace(" ")] 1: TS_UNION_TYPE@47..62 0: (empty) @@ -146,7 +150,7 @@ JsModule { 1: PIPE@54..56 "|" [] [Whitespace(" ")] 2: TS_STRING_TYPE@56..62 0: STRING_KW@56..62 "string" [] [] - 3: (empty) + 4: (empty) 2: R_ANGLE@62..64 ">" [] [Whitespace(" ")] 3: EQ@64..66 "=" [] [Whitespace(" ")] 4: TS_OBJECT_TYPE@66..74 diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_type_parameters.rast b/crates/rome_js_parser/test_data/inline/ok/ts_type_parameters.rast index 666d7c01eed..d55e84786c7 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_type_parameters.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_type_parameters.rast @@ -11,7 +11,8 @@ JsModule { l_angle_token: L_ANGLE@6..7 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@7..9 "X" [] [Whitespace(" ")], }, @@ -25,7 +26,8 @@ JsModule { }, COMMA@23..25 "," [] [Whitespace(" ")], TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@25..27 "Y" [] [Whitespace(" ")], }, @@ -39,7 +41,8 @@ JsModule { }, COMMA@35..37 "," [] [Whitespace(" ")], TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@37..39 "Z" [] [Whitespace(" ")], }, @@ -145,29 +148,32 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@7..71 0: TS_TYPE_PARAMETER@7..23 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@7..9 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@7..9 0: IDENT@7..9 "X" [] [Whitespace(" ")] - 2: TS_TYPE_CONSTRAINT_CLAUSE@9..23 + 3: TS_TYPE_CONSTRAINT_CLAUSE@9..23 0: EXTENDS_KW@9..17 "extends" [] [Whitespace(" ")] 1: TS_STRING_TYPE@17..23 0: STRING_KW@17..23 "string" [] [] - 3: (empty) + 4: (empty) 1: COMMA@23..25 "," [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER@25..35 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@25..27 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@25..27 0: IDENT@25..27 "Y" [] [Whitespace(" ")] - 2: (empty) - 3: TS_DEFAULT_TYPE_CLAUSE@27..35 + 3: (empty) + 4: TS_DEFAULT_TYPE_CLAUSE@27..35 0: EQ@27..29 "=" [] [Whitespace(" ")] 1: TS_NUMBER_TYPE@29..35 0: NUMBER_KW@29..35 "number" [] [] 3: COMMA@35..37 "," [] [Whitespace(" ")] 4: TS_TYPE_PARAMETER@37..71 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@37..39 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@37..39 0: IDENT@37..39 "Z" [] [Whitespace(" ")] - 2: TS_TYPE_CONSTRAINT_CLAUSE@39..63 + 3: TS_TYPE_CONSTRAINT_CLAUSE@39..63 0: EXTENDS_KW@39..47 "extends" [] [Whitespace(" ")] 1: TS_UNION_TYPE@47..63 0: (empty) @@ -177,7 +183,7 @@ JsModule { 1: PIPE@54..56 "|" [] [Whitespace(" ")] 2: TS_NUMBER_TYPE@56..63 0: NUMBER_KW@56..63 "number" [] [Whitespace(" ")] - 3: TS_DEFAULT_TYPE_CLAUSE@63..71 + 4: TS_DEFAULT_TYPE_CLAUSE@63..71 0: EQ@63..65 "=" [] [Whitespace(" ")] 1: TS_NUMBER_TYPE@65..71 0: NUMBER_KW@65..71 "number" [] [] diff --git a/crates/rome_js_parser/test_data/inline/ok/tsx_type_arguments.rast b/crates/rome_js_parser/test_data/inline/ok/tsx_type_arguments.rast index 6874db5c508..c4efae7045e 100644 --- a/crates/rome_js_parser/test_data/inline/ok/tsx_type_arguments.rast +++ b/crates/rome_js_parser/test_data/inline/ok/tsx_type_arguments.rast @@ -9,7 +9,8 @@ JsModule { l_angle_token: L_ANGLE@0..35 "<" [Comments("// These are valid ty ..."), Newline("\n")] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@35..37 "A" [] [Whitespace(" ")], }, @@ -50,7 +51,8 @@ JsModule { l_angle_token: L_ANGLE@56..58 "<" [Newline("\n")] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@58..59 "A" [] [], }, @@ -88,7 +90,8 @@ JsModule { l_angle_token: L_ANGLE@76..78 "<" [Newline("\n")] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@78..79 "A" [] [], }, @@ -97,7 +100,8 @@ JsModule { }, COMMA@79..81 "," [] [Whitespace(" ")], TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@81..82 "B" [] [], }, @@ -130,7 +134,8 @@ JsModule { l_angle_token: L_ANGLE@92..94 "<" [Newline("\n")] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@94..96 "A" [] [Whitespace(" ")], }, @@ -191,15 +196,16 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@35..46 0: TS_TYPE_PARAMETER@35..46 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@35..37 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@35..37 0: IDENT@35..37 "A" [] [Whitespace(" ")] - 2: TS_TYPE_CONSTRAINT_CLAUSE@37..46 + 3: TS_TYPE_CONSTRAINT_CLAUSE@37..46 0: EXTENDS_KW@37..45 "extends" [] [Whitespace(" ")] 1: TS_REFERENCE_TYPE@45..46 0: JS_REFERENCE_IDENTIFIER@45..46 0: IDENT@45..46 "B" [] [] 1: (empty) - 3: (empty) + 4: (empty) 2: R_ANGLE@46..47 ">" [] [] 2: JS_PARAMETERS@47..50 0: L_PAREN@47..48 "(" [] [] @@ -221,10 +227,11 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@58..66 0: TS_TYPE_PARAMETER@58..66 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@58..59 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@58..59 0: IDENT@58..59 "A" [] [] - 2: (empty) - 3: TS_DEFAULT_TYPE_CLAUSE@59..66 + 3: (empty) + 4: TS_DEFAULT_TYPE_CLAUSE@59..66 0: EQ@59..60 "=" [] [] 1: TS_STRING_TYPE@60..66 0: STRING_KW@60..66 "string" [] [] @@ -249,17 +256,19 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@78..82 0: TS_TYPE_PARAMETER@78..79 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@78..79 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@78..79 0: IDENT@78..79 "A" [] [] - 2: (empty) 3: (empty) + 4: (empty) 1: COMMA@79..81 "," [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER@81..82 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@81..82 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@81..82 0: IDENT@81..82 "B" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@82..83 ">" [] [] 2: JS_PARAMETERS@83..86 0: L_PAREN@83..84 "(" [] [] @@ -281,9 +290,10 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@94..108 0: TS_TYPE_PARAMETER@94..108 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@94..96 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@94..96 0: IDENT@94..96 "A" [] [Whitespace(" ")] - 2: TS_TYPE_CONSTRAINT_CLAUSE@96..108 + 3: TS_TYPE_CONSTRAINT_CLAUSE@96..108 0: EXTENDS_KW@96..104 "extends" [] [Whitespace(" ")] 1: TS_REFERENCE_TYPE@104..108 0: JS_REFERENCE_IDENTIFIER@104..105 @@ -296,7 +306,7 @@ JsModule { 0: IDENT@106..107 "C" [] [] 1: (empty) 2: R_ANGLE@107..108 ">" [] [] - 3: (empty) + 4: (empty) 2: R_ANGLE@108..109 ">" [] [] 2: JS_PARAMETERS@109..112 0: L_PAREN@109..110 "(" [] [] diff --git a/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.rast b/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.rast index 4d0b673f426..c7801079931 100644 --- a/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.rast +++ b/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.rast @@ -11,10 +11,8 @@ JsModule { l_angle_token: L_ANGLE@8..9 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: IN_KW@9..12 "in" [] [Whitespace(" ")], - out_token: missing (optional), - }, + in_modifier_token: IN_KW@9..12 "in" [] [Whitespace(" ")], + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@12..13 "T" [] [], }, @@ -42,7 +40,8 @@ JsModule { l_angle_token: L_ANGLE@27..28 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: missing (optional), + in_modifier_token: missing (optional), + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@28..31 "out" [] [], }, @@ -70,10 +69,8 @@ JsModule { l_angle_token: L_ANGLE@47..48 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: missing (optional), - out_token: OUT_KW@48..52 "out" [] [Whitespace(" ")], - }, + in_modifier_token: missing (optional), + out_modfier_token: OUT_KW@48..52 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@52..53 "T" [] [], }, @@ -101,10 +98,8 @@ JsModule { l_angle_token: L_ANGLE@67..68 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: IN_KW@68..71 "in" [] [Whitespace(" ")], - out_token: missing (optional), - }, + in_modifier_token: IN_KW@68..71 "in" [] [Whitespace(" ")], + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@71..74 "out" [] [], }, @@ -132,10 +127,8 @@ JsModule { l_angle_token: L_ANGLE@88..89 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: missing (optional), - out_token: OUT_KW@89..93 "out" [] [Whitespace(" ")], - }, + in_modifier_token: missing (optional), + out_modfier_token: OUT_KW@89..93 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@93..96 "out" [] [], }, @@ -163,10 +156,8 @@ JsModule { l_angle_token: L_ANGLE@110..111 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: IN_KW@111..114 "in" [] [Whitespace(" ")], - out_token: OUT_KW@114..118 "out" [] [Whitespace(" ")], - }, + in_modifier_token: IN_KW@111..114 "in" [] [Whitespace(" ")], + out_modfier_token: OUT_KW@114..118 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@118..121 "out" [] [], }, @@ -194,10 +185,8 @@ JsModule { l_angle_token: L_ANGLE@135..136 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: IN_KW@136..139 "in" [] [Whitespace(" ")], - out_token: missing (optional), - }, + in_modifier_token: IN_KW@136..139 "in" [] [Whitespace(" ")], + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@139..140 "X" [] [], }, @@ -206,10 +195,8 @@ JsModule { }, COMMA@140..142 "," [] [Whitespace(" ")], TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: missing (optional), - out_token: OUT_KW@142..146 "out" [] [Whitespace(" ")], - }, + in_modifier_token: missing (optional), + out_modfier_token: OUT_KW@142..146 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@146..147 "Y" [] [], }, @@ -250,10 +237,8 @@ JsModule { l_angle_token: L_ANGLE@166..167 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: missing (optional), - out_token: OUT_KW@167..171 "out" [] [Whitespace(" ")], - }, + in_modifier_token: missing (optional), + out_modfier_token: OUT_KW@167..171 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@171..172 "X" [] [], }, @@ -262,10 +247,8 @@ JsModule { }, COMMA@172..174 "," [] [Whitespace(" ")], TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: IN_KW@174..177 "in" [] [Whitespace(" ")], - out_token: missing (optional), - }, + in_modifier_token: IN_KW@174..177 "in" [] [Whitespace(" ")], + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@177..178 "Y" [] [], }, @@ -306,10 +289,8 @@ JsModule { l_angle_token: L_ANGLE@197..198 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: missing (optional), - out_token: OUT_KW@198..202 "out" [] [Whitespace(" ")], - }, + in_modifier_token: missing (optional), + out_modfier_token: OUT_KW@198..202 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@202..203 "X" [] [], }, @@ -318,10 +299,8 @@ JsModule { }, COMMA@203..205 "," [] [Whitespace(" ")], TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: missing (optional), - out_token: OUT_KW@205..209 "out" [] [Whitespace(" ")], - }, + in_modifier_token: missing (optional), + out_modfier_token: OUT_KW@205..209 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@209..211 "Y" [] [Whitespace(" ")], }, @@ -374,10 +353,8 @@ JsModule { l_angle_token: L_ANGLE@246..247 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: IN_KW@247..250 "in" [] [Whitespace(" ")], - out_token: missing (optional), - }, + in_modifier_token: IN_KW@247..250 "in" [] [Whitespace(" ")], + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@250..251 "T" [] [], }, @@ -403,10 +380,8 @@ JsModule { l_angle_token: L_ANGLE@265..266 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: missing (optional), - out_token: OUT_KW@266..270 "out" [] [Whitespace(" ")], - }, + in_modifier_token: missing (optional), + out_modfier_token: OUT_KW@266..270 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@270..271 "T" [] [], }, @@ -436,10 +411,8 @@ JsModule { l_angle_token: L_ANGLE@300..301 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: IN_KW@301..304 "in" [] [Whitespace(" ")], - out_token: missing (optional), - }, + in_modifier_token: IN_KW@301..304 "in" [] [Whitespace(" ")], + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@304..305 "T" [] [], }, @@ -468,10 +441,8 @@ JsModule { l_angle_token: L_ANGLE@319..320 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: missing (optional), - out_token: OUT_KW@320..324 "out" [] [Whitespace(" ")], - }, + in_modifier_token: missing (optional), + out_modfier_token: OUT_KW@320..324 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@324..325 "T" [] [], }, @@ -496,10 +467,8 @@ JsModule { l_angle_token: L_ANGLE@343..344 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: IN_KW@344..347 "in" [] [Whitespace(" ")], - out_token: missing (optional), - }, + in_modifier_token: IN_KW@344..347 "in" [] [Whitespace(" ")], + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@347..348 "T" [] [], }, @@ -523,10 +492,8 @@ JsModule { l_angle_token: L_ANGLE@366..367 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: missing (optional), - out_token: OUT_KW@367..371 "out" [] [Whitespace(" ")], - }, + in_modifier_token: missing (optional), + out_modfier_token: OUT_KW@367..371 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@371..372 "T" [] [], }, @@ -553,10 +520,8 @@ JsModule { l_angle_token: L_ANGLE@394..395 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: IN_KW@395..398 "in" [] [Whitespace(" ")], - out_token: missing (optional), - }, + in_modifier_token: IN_KW@395..398 "in" [] [Whitespace(" ")], + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@398..399 "T" [] [], }, @@ -585,10 +550,8 @@ JsModule { l_angle_token: L_ANGLE@421..422 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: missing (optional), - out_token: OUT_KW@422..426 "out" [] [Whitespace(" ")], - }, + in_modifier_token: missing (optional), + out_modfier_token: OUT_KW@422..426 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@426..427 "T" [] [], }, @@ -616,10 +579,8 @@ JsModule { l_angle_token: L_ANGLE@453..454 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: IN_KW@454..457 "in" [] [Whitespace(" ")], - out_token: missing (optional), - }, + in_modifier_token: IN_KW@454..457 "in" [] [Whitespace(" ")], + out_modfier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@457..458 "T" [] [], }, @@ -646,10 +607,8 @@ JsModule { l_angle_token: L_ANGLE@484..485 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - modifier: TsTypeParameterModifier { - in_token: missing (optional), - out_token: OUT_KW@485..489 "out" [] [Whitespace(" ")], - }, + in_modifier_token: missing (optional), + out_modfier_token: OUT_KW@485..489 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@489..490 "T" [] [], }, @@ -681,13 +640,12 @@ JsModule { 0: L_ANGLE@8..9 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@9..13 0: TS_TYPE_PARAMETER@9..13 - 0: TS_TYPE_PARAMETER_MODIFIER@9..12 - 0: IN_KW@9..12 "in" [] [Whitespace(" ")] - 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@12..13 + 0: IN_KW@9..12 "in" [] [Whitespace(" ")] + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@12..13 0: IDENT@12..13 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@13..15 ">" [] [Whitespace(" ")] 3: EQ@15..17 "=" [] [Whitespace(" ")] 4: TS_REFERENCE_TYPE@17..18 @@ -704,10 +662,11 @@ JsModule { 1: TS_TYPE_PARAMETER_LIST@28..31 0: TS_TYPE_PARAMETER@28..31 0: (empty) - 1: TS_TYPE_PARAMETER_NAME@28..31 + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@28..31 0: IDENT@28..31 "out" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@31..33 ">" [] [Whitespace(" ")] 3: EQ@33..35 "=" [] [Whitespace(" ")] 4: TS_REFERENCE_TYPE@35..38 @@ -723,13 +682,12 @@ JsModule { 0: L_ANGLE@47..48 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@48..53 0: TS_TYPE_PARAMETER@48..53 - 0: TS_TYPE_PARAMETER_MODIFIER@48..52 - 0: (empty) - 1: OUT_KW@48..52 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@52..53 + 0: (empty) + 1: OUT_KW@48..52 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@52..53 0: IDENT@52..53 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@53..55 ">" [] [Whitespace(" ")] 3: EQ@55..57 "=" [] [Whitespace(" ")] 4: TS_REFERENCE_TYPE@57..58 @@ -745,13 +703,12 @@ JsModule { 0: L_ANGLE@67..68 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@68..74 0: TS_TYPE_PARAMETER@68..74 - 0: TS_TYPE_PARAMETER_MODIFIER@68..71 - 0: IN_KW@68..71 "in" [] [Whitespace(" ")] - 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@71..74 + 0: IN_KW@68..71 "in" [] [Whitespace(" ")] + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@71..74 0: IDENT@71..74 "out" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@74..76 ">" [] [Whitespace(" ")] 3: EQ@76..78 "=" [] [Whitespace(" ")] 4: TS_REFERENCE_TYPE@78..79 @@ -767,13 +724,12 @@ JsModule { 0: L_ANGLE@88..89 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@89..96 0: TS_TYPE_PARAMETER@89..96 - 0: TS_TYPE_PARAMETER_MODIFIER@89..93 - 0: (empty) - 1: OUT_KW@89..93 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@93..96 + 0: (empty) + 1: OUT_KW@89..93 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@93..96 0: IDENT@93..96 "out" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@96..98 ">" [] [Whitespace(" ")] 3: EQ@98..100 "=" [] [Whitespace(" ")] 4: TS_REFERENCE_TYPE@100..101 @@ -789,13 +745,12 @@ JsModule { 0: L_ANGLE@110..111 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@111..121 0: TS_TYPE_PARAMETER@111..121 - 0: TS_TYPE_PARAMETER_MODIFIER@111..118 - 0: IN_KW@111..114 "in" [] [Whitespace(" ")] - 1: OUT_KW@114..118 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@118..121 + 0: IN_KW@111..114 "in" [] [Whitespace(" ")] + 1: OUT_KW@114..118 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@118..121 0: IDENT@118..121 "out" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@121..123 ">" [] [Whitespace(" ")] 3: EQ@123..125 "=" [] [Whitespace(" ")] 4: TS_REFERENCE_TYPE@125..126 @@ -811,22 +766,20 @@ JsModule { 0: L_ANGLE@135..136 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@136..147 0: TS_TYPE_PARAMETER@136..140 - 0: TS_TYPE_PARAMETER_MODIFIER@136..139 - 0: IN_KW@136..139 "in" [] [Whitespace(" ")] - 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@139..140 + 0: IN_KW@136..139 "in" [] [Whitespace(" ")] + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@139..140 0: IDENT@139..140 "X" [] [] - 2: (empty) 3: (empty) + 4: (empty) 1: COMMA@140..142 "," [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER@142..147 - 0: TS_TYPE_PARAMETER_MODIFIER@142..146 - 0: (empty) - 1: OUT_KW@142..146 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@146..147 + 0: (empty) + 1: OUT_KW@142..146 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@146..147 0: IDENT@146..147 "Y" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@147..149 ">" [] [Whitespace(" ")] 3: EQ@149..151 "=" [] [Whitespace(" ")] 4: TS_TUPLE_TYPE@151..157 @@ -851,22 +804,20 @@ JsModule { 0: L_ANGLE@166..167 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@167..178 0: TS_TYPE_PARAMETER@167..172 - 0: TS_TYPE_PARAMETER_MODIFIER@167..171 - 0: (empty) - 1: OUT_KW@167..171 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@171..172 + 0: (empty) + 1: OUT_KW@167..171 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@171..172 0: IDENT@171..172 "X" [] [] - 2: (empty) 3: (empty) + 4: (empty) 1: COMMA@172..174 "," [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER@174..178 - 0: TS_TYPE_PARAMETER_MODIFIER@174..177 - 0: IN_KW@174..177 "in" [] [Whitespace(" ")] - 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@177..178 + 0: IN_KW@174..177 "in" [] [Whitespace(" ")] + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@177..178 0: IDENT@177..178 "Y" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@178..180 ">" [] [Whitespace(" ")] 3: EQ@180..182 "=" [] [Whitespace(" ")] 4: TS_TUPLE_TYPE@182..188 @@ -891,21 +842,19 @@ JsModule { 0: L_ANGLE@197..198 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@198..226 0: TS_TYPE_PARAMETER@198..203 - 0: TS_TYPE_PARAMETER_MODIFIER@198..202 - 0: (empty) - 1: OUT_KW@198..202 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@202..203 + 0: (empty) + 1: OUT_KW@198..202 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@202..203 0: IDENT@202..203 "X" [] [] - 2: (empty) 3: (empty) + 4: (empty) 1: COMMA@203..205 "," [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER@205..226 - 0: TS_TYPE_PARAMETER_MODIFIER@205..209 - 0: (empty) - 1: OUT_KW@205..209 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@209..211 + 0: (empty) + 1: OUT_KW@205..209 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@209..211 0: IDENT@209..211 "Y" [] [Whitespace(" ")] - 2: TS_TYPE_CONSTRAINT_CLAUSE@211..226 + 3: TS_TYPE_CONSTRAINT_CLAUSE@211..226 0: EXTENDS_KW@211..219 "extends" [] [Whitespace(" ")] 1: TS_TYPE_OPERATOR_TYPE@219..226 0: KEYOF_KW@219..225 "keyof" [] [Whitespace(" ")] @@ -913,7 +862,7 @@ JsModule { 0: JS_REFERENCE_IDENTIFIER@225..226 0: IDENT@225..226 "X" [] [] 1: (empty) - 3: (empty) + 4: (empty) 2: R_ANGLE@226..228 ">" [] [Whitespace(" ")] 3: EQ@228..230 "=" [] [Whitespace(" ")] 4: TS_TUPLE_TYPE@230..236 @@ -939,13 +888,12 @@ JsModule { 0: L_ANGLE@246..247 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@247..251 0: TS_TYPE_PARAMETER@247..251 - 0: TS_TYPE_PARAMETER_MODIFIER@247..250 - 0: IN_KW@247..250 "in" [] [Whitespace(" ")] - 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@250..251 + 0: IN_KW@247..250 "in" [] [Whitespace(" ")] + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@250..251 0: IDENT@250..251 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@251..253 ">" [] [Whitespace(" ")] 4: (empty) 5: (empty) @@ -961,13 +909,12 @@ JsModule { 0: L_ANGLE@265..266 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@266..271 0: TS_TYPE_PARAMETER@266..271 - 0: TS_TYPE_PARAMETER_MODIFIER@266..270 - 0: (empty) - 1: OUT_KW@266..270 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@270..271 + 0: (empty) + 1: OUT_KW@266..270 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@270..271 0: IDENT@270..271 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@271..273 ">" [] [Whitespace(" ")] 4: (empty) 5: (empty) @@ -987,13 +934,12 @@ JsModule { 0: L_ANGLE@300..301 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@301..305 0: TS_TYPE_PARAMETER@301..305 - 0: TS_TYPE_PARAMETER_MODIFIER@301..304 - 0: IN_KW@301..304 "in" [] [Whitespace(" ")] - 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@304..305 + 0: IN_KW@301..304 "in" [] [Whitespace(" ")] + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@304..305 0: IDENT@304..305 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@305..307 ">" [] [Whitespace(" ")] 4: (empty) 5: (empty) @@ -1010,13 +956,12 @@ JsModule { 0: L_ANGLE@319..320 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@320..325 0: TS_TYPE_PARAMETER@320..325 - 0: TS_TYPE_PARAMETER_MODIFIER@320..324 - 0: (empty) - 1: OUT_KW@320..324 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@324..325 + 0: (empty) + 1: OUT_KW@320..324 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@324..325 0: IDENT@324..325 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@325..327 ">" [] [Whitespace(" ")] 4: (empty) 5: (empty) @@ -1031,13 +976,12 @@ JsModule { 0: L_ANGLE@343..344 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@344..348 0: TS_TYPE_PARAMETER@344..348 - 0: TS_TYPE_PARAMETER_MODIFIER@344..347 - 0: IN_KW@344..347 "in" [] [Whitespace(" ")] - 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@347..348 + 0: IN_KW@344..347 "in" [] [Whitespace(" ")] + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@347..348 0: IDENT@347..348 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@348..350 ">" [] [Whitespace(" ")] 3: (empty) 4: L_CURLY@350..351 "{" [] [] @@ -1051,13 +995,12 @@ JsModule { 0: L_ANGLE@366..367 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@367..372 0: TS_TYPE_PARAMETER@367..372 - 0: TS_TYPE_PARAMETER_MODIFIER@367..371 - 0: (empty) - 1: OUT_KW@367..371 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@371..372 + 0: (empty) + 1: OUT_KW@367..371 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@371..372 0: IDENT@371..372 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@372..374 ">" [] [Whitespace(" ")] 3: (empty) 4: L_CURLY@374..375 "{" [] [] @@ -1074,13 +1017,12 @@ JsModule { 0: L_ANGLE@394..395 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@395..399 0: TS_TYPE_PARAMETER@395..399 - 0: TS_TYPE_PARAMETER_MODIFIER@395..398 - 0: IN_KW@395..398 "in" [] [Whitespace(" ")] - 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@398..399 + 0: IN_KW@395..398 "in" [] [Whitespace(" ")] + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@398..399 0: IDENT@398..399 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@399..401 ">" [] [Whitespace(" ")] 4: (empty) 5: (empty) @@ -1098,13 +1040,12 @@ JsModule { 0: L_ANGLE@421..422 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@422..427 0: TS_TYPE_PARAMETER@422..427 - 0: TS_TYPE_PARAMETER_MODIFIER@422..426 - 0: (empty) - 1: OUT_KW@422..426 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@426..427 + 0: (empty) + 1: OUT_KW@422..426 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@426..427 0: IDENT@426..427 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@427..429 ">" [] [Whitespace(" ")] 4: (empty) 5: (empty) @@ -1121,13 +1062,12 @@ JsModule { 0: L_ANGLE@453..454 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@454..458 0: TS_TYPE_PARAMETER@454..458 - 0: TS_TYPE_PARAMETER_MODIFIER@454..457 - 0: IN_KW@454..457 "in" [] [Whitespace(" ")] - 1: (empty) - 1: TS_TYPE_PARAMETER_NAME@457..458 + 0: IN_KW@454..457 "in" [] [Whitespace(" ")] + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@457..458 0: IDENT@457..458 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@458..460 ">" [] [Whitespace(" ")] 3: (empty) 4: L_CURLY@460..461 "{" [] [] @@ -1143,13 +1083,12 @@ JsModule { 0: L_ANGLE@484..485 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@485..490 0: TS_TYPE_PARAMETER@485..490 - 0: TS_TYPE_PARAMETER_MODIFIER@485..489 - 0: (empty) - 1: OUT_KW@485..489 "out" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER_NAME@489..490 + 0: (empty) + 1: OUT_KW@485..489 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@489..490 0: IDENT@489..490 "T" [] [] - 2: (empty) 3: (empty) + 4: (empty) 2: R_ANGLE@490..492 ">" [] [Whitespace(" ")] 3: (empty) 4: L_CURLY@492..493 "{" [] [] diff --git a/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier_tsx.rast b/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier_tsx.rast index 7e3857d3b08..3dc75d27e6f 100644 --- a/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier_tsx.rast +++ b/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier_tsx.rast @@ -32,17 +32,17 @@ JsModule { }, }, }, - semicolon_token: missing (optional), + semicolon_token: SEMICOLON@11..12 ";" [] [], }, ], - eof_token: EOF@11..161 "" [Newline("\n"), Comments("// "), Newline("\n"), Comments("// "), Newline("\n"), Comments("// "), Newline("\n"), Comments("//;"), Newline("\n"), Comments("// ;"), Newline("\n"), Comments("// ;"), Newline("\n"), Comments("//" [] [] - 1: (empty) - 3: EOF@11..161 "" [Newline("\n"), Comments("// "), Newline("\n"), Comments("// "), Newline("\n"), Comments("// "), Newline("\n"), Comments("//;"), Newline("\n"), Comments("// ;"), Newline("\n"), Comments("// ;"), Newline("\n"), Comments("//; -; -; -; +// ; +// ; +// ; // // // diff --git a/crates/rome_js_syntax/src/generated/macros.rs b/crates/rome_js_syntax/src/generated/macros.rs index 7665110de5d..e73d92ffdf1 100644 --- a/crates/rome_js_syntax/src/generated/macros.rs +++ b/crates/rome_js_syntax/src/generated/macros.rs @@ -1150,10 +1150,6 @@ macro_rules! map_syntax_node { let $pattern = unsafe { $crate::TsTypeParameter::new_unchecked(node) }; $body } - $crate::JsSyntaxKind::TS_TYPE_PARAMETER_MODIFIER => { - let $pattern = unsafe { $crate::TsTypeParameterModifier::new_unchecked(node) }; - $body - } $crate::JsSyntaxKind::TS_TYPE_PARAMETER_NAME => { let $pattern = unsafe { $crate::TsTypeParameterName::new_unchecked(node) }; $body diff --git a/crates/rome_js_syntax/src/generated/nodes.rs b/crates/rome_js_syntax/src/generated/nodes.rs index 14a97b15778..ae0cf3002b2 100644 --- a/crates/rome_js_syntax/src/generated/nodes.rs +++ b/crates/rome_js_syntax/src/generated/nodes.rs @@ -11589,22 +11589,22 @@ impl TsTypeParameter { pub const unsafe fn new_unchecked(syntax: SyntaxNode) -> Self { Self { syntax } } pub fn as_fields(&self) -> TsTypeParameterFields { TsTypeParameterFields { - modifier: self.modifier(), + in_modifier_token: self.in_modifier_token(), + out_modfier_token: self.out_modfier_token(), name: self.name(), constraint: self.constraint(), default: self.default(), } } - pub fn modifier(&self) -> Option { - support::node(&self.syntax, 0usize) - } + pub fn in_modifier_token(&self) -> Option { support::token(&self.syntax, 0usize) } + pub fn out_modfier_token(&self) -> Option { support::token(&self.syntax, 1usize) } pub fn name(&self) -> SyntaxResult { - support::required_node(&self.syntax, 1usize) + support::required_node(&self.syntax, 2usize) } pub fn constraint(&self) -> Option { - support::node(&self.syntax, 2usize) + support::node(&self.syntax, 3usize) } - pub fn default(&self) -> Option { support::node(&self.syntax, 3usize) } + pub fn default(&self) -> Option { support::node(&self.syntax, 4usize) } } #[cfg(feature = "serde")] impl Serialize for TsTypeParameter { @@ -11617,47 +11617,13 @@ impl Serialize for TsTypeParameter { } #[cfg_attr(feature = "serde", derive(Serialize), serde(crate = "serde_crate"))] pub struct TsTypeParameterFields { - pub modifier: Option, + pub in_modifier_token: Option, + pub out_modfier_token: Option, pub name: SyntaxResult, pub constraint: Option, pub default: Option, } #[derive(Clone, PartialEq, Eq, Hash)] -pub struct TsTypeParameterModifier { - pub(crate) syntax: SyntaxNode, -} -impl TsTypeParameterModifier { - #[doc = r" Create an AstNode from a SyntaxNode without checking its kind"] - #[doc = r""] - #[doc = r" # Safety"] - #[doc = r" This function must be guarded with a call to [AstNode::can_cast]"] - #[doc = r" or a match on [SyntaxNode::kind]"] - #[inline] - pub const unsafe fn new_unchecked(syntax: SyntaxNode) -> Self { Self { syntax } } - pub fn as_fields(&self) -> TsTypeParameterModifierFields { - TsTypeParameterModifierFields { - in_token: self.in_token(), - out_token: self.out_token(), - } - } - pub fn in_token(&self) -> Option { support::token(&self.syntax, 0usize) } - pub fn out_token(&self) -> Option { support::token(&self.syntax, 1usize) } -} -#[cfg(feature = "serde")] -impl Serialize for TsTypeParameterModifier { - fn serialize(&self, serializer: S) -> Result - where - S: Serializer, - { - self.as_fields().serialize(serializer) - } -} -#[cfg_attr(feature = "serde", derive(Serialize), serde(crate = "serde_crate"))] -pub struct TsTypeParameterModifierFields { - pub in_token: Option, - pub out_token: Option, -} -#[derive(Clone, PartialEq, Eq, Hash)] pub struct TsTypeParameterName { pub(crate) syntax: SyntaxNode, } @@ -23771,7 +23737,14 @@ impl AstNode for TsTypeParameter { impl std::fmt::Debug for TsTypeParameter { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.debug_struct("TsTypeParameter") - .field("modifier", &support::DebugOptionalElement(self.modifier())) + .field( + "in_modifier_token", + &support::DebugOptionalElement(self.in_modifier_token()), + ) + .field( + "out_modfier_token", + &support::DebugOptionalElement(self.out_modfier_token()), + ) .field("name", &support::DebugSyntaxResult(self.name())) .field( "constraint", @@ -23787,36 +23760,6 @@ impl From for SyntaxNode { impl From for SyntaxElement { fn from(n: TsTypeParameter) -> SyntaxElement { n.syntax.into() } } -impl AstNode for TsTypeParameterModifier { - type Language = Language; - fn can_cast(kind: SyntaxKind) -> bool { kind == TS_TYPE_PARAMETER_MODIFIER } - fn cast(syntax: SyntaxNode) -> Option { - if Self::can_cast(syntax.kind()) { - Some(Self { syntax }) - } else { - None - } - } - fn syntax(&self) -> &SyntaxNode { &self.syntax } - fn into_syntax(self) -> SyntaxNode { self.syntax } -} -impl std::fmt::Debug for TsTypeParameterModifier { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.debug_struct("TsTypeParameterModifier") - .field("in_token", &support::DebugOptionalElement(self.in_token())) - .field( - "out_token", - &support::DebugOptionalElement(self.out_token()), - ) - .finish() - } -} -impl From for SyntaxNode { - fn from(n: TsTypeParameterModifier) -> SyntaxNode { n.syntax } -} -impl From for SyntaxElement { - fn from(n: TsTypeParameterModifier) -> SyntaxElement { n.syntax.into() } -} impl AstNode for TsTypeParameterName { type Language = Language; fn can_cast(kind: SyntaxKind) -> bool { kind == TS_TYPE_PARAMETER_NAME } @@ -32416,11 +32359,6 @@ impl std::fmt::Display for TsTypeParameter { std::fmt::Display::fmt(self.syntax(), f) } } -impl std::fmt::Display for TsTypeParameterModifier { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - std::fmt::Display::fmt(self.syntax(), f) - } -} impl std::fmt::Display for TsTypeParameterName { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { std::fmt::Display::fmt(self.syntax(), f) diff --git a/crates/rome_js_syntax/src/generated/nodes_mut.rs b/crates/rome_js_syntax/src/generated/nodes_mut.rs index 0cb4218a559..e150ccc2f78 100644 --- a/crates/rome_js_syntax/src/generated/nodes_mut.rs +++ b/crates/rome_js_syntax/src/generated/nodes_mut.rs @@ -5680,45 +5680,37 @@ impl TsTypeOperatorType { } } impl TsTypeParameter { - pub fn with_modifier(self, element: Option) -> Self { - Self::unwrap_cast(self.syntax.splice_slots( - 0usize..=0usize, - once(element.map(|element| element.into_syntax().into())), - )) + pub fn with_in_modifier_token(self, element: Option) -> Self { + Self::unwrap_cast( + self.syntax + .splice_slots(0usize..=0usize, once(element.map(|element| element.into()))), + ) + } + pub fn with_out_modfier_token(self, element: Option) -> Self { + Self::unwrap_cast( + self.syntax + .splice_slots(1usize..=1usize, once(element.map(|element| element.into()))), + ) } pub fn with_name(self, element: TsTypeParameterName) -> Self { Self::unwrap_cast( self.syntax - .splice_slots(1usize..=1usize, once(Some(element.into_syntax().into()))), + .splice_slots(2usize..=2usize, once(Some(element.into_syntax().into()))), ) } pub fn with_constraint(self, element: Option) -> Self { Self::unwrap_cast(self.syntax.splice_slots( - 2usize..=2usize, + 3usize..=3usize, once(element.map(|element| element.into_syntax().into())), )) } pub fn with_default(self, element: Option) -> Self { Self::unwrap_cast(self.syntax.splice_slots( - 3usize..=3usize, + 4usize..=4usize, once(element.map(|element| element.into_syntax().into())), )) } } -impl TsTypeParameterModifier { - pub fn with_in_token(self, element: Option) -> Self { - Self::unwrap_cast( - self.syntax - .splice_slots(0usize..=0usize, once(element.map(|element| element.into()))), - ) - } - pub fn with_out_token(self, element: Option) -> Self { - Self::unwrap_cast( - self.syntax - .splice_slots(1usize..=1usize, once(element.map(|element| element.into()))), - ) - } -} impl TsTypeParameterName { pub fn with_ident_token(self, element: SyntaxToken) -> Self { Self::unwrap_cast( diff --git a/xtask/codegen/js.ungram b/xtask/codegen/js.ungram index 79f9b628dc7..ce8fea06e87 100644 --- a/xtask/codegen/js.ungram +++ b/xtask/codegen/js.ungram @@ -1880,15 +1880,12 @@ TsTypeParameterList = (TsTypeParameter (',' TsTypeParameter)* ','?) // type A = { b: B } // ^^^^^^^^^^^^^^^^^^^^^^ TsTypeParameter = - modifier: TsTypeParameterModifier? + in_modifier: 'in' ? + out_modfier: 'out'? name: TsTypeParameterName constraint: TsTypeConstraintClause? default: TsDefaultTypeClause? -TsTypeParameterModifier = - 'in'? - 'out'? - TsTypeParameterName = 'ident' TsTypeConstraintClause = From 0004eb08707f551378ca670a3a4852d6ea38e6c5 Mon Sep 17 00:00:00 2001 From: IWANABETHATGUY Date: Tue, 14 Jun 2022 23:29:25 +0800 Subject: [PATCH 12/22] =?UTF-8?q?test:=20=F0=9F=92=8D=20update=20snapshot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/generated/node_factory.rs | 10 ++-- .../rome_js_formatter/src/ts/bindings/mod.rs | 1 - .../src/ts/bindings/type_parameter.rs | 4 +- .../ts/bindings/type_parameter_modifier.rs | 16 ------ .../err/ts_constructor_type_parameters.rast | 2 +- .../err/ts_declare_function_with_body.rast | 2 +- .../err/ts_getter_setter_type_parameters.rast | 4 +- .../err/ts_object_getter_type_parameters.rast | 2 +- .../err/ts_object_setter_type_parameters.rast | 2 +- .../err/ts_type_parameters_incomplete.rast | 2 +- .../inline/err/type_parameter_modifier.rast | 26 ++++----- .../inline/err/type_parameter_modifier1.rast | 54 +++++++++---------- .../ok/ts_arrow_function_type_parameters.rast | 10 ++-- .../test_data/inline/ok/ts_as_assignment.rast | 2 +- .../ok/ts_call_expr_with_type_arguments.rast | 10 ++-- .../inline/ok/ts_call_signature_member.rast | 4 +- .../inline/ok/ts_class_type_parameters.rast | 6 +-- ...s_conditional_type_call_signature_lhs.rast | 2 +- .../ok/ts_construct_signature_member.rast | 4 +- .../inline/ok/ts_constructor_type.rast | 8 +-- .../inline/ok/ts_declare_function.rast | 6 +-- .../inline/ok/ts_default_type_clause.rast | 4 +- .../inline/ok/ts_function_statement.rast | 6 +-- .../test_data/inline/ok/ts_function_type.rast | 4 +- .../ok/ts_interface_extends_clause.rast | 2 +- .../test_data/inline/ok/ts_mapped_type.rast | 8 +-- .../inline/ok/ts_method_class_member.rast | 6 +-- .../ok/ts_method_object_member_body.rast | 4 +- .../inline/ok/ts_new_with_type_arguments.rast | 6 +-- .../inline/ok/ts_optional_chain_call.rast | 4 +- ...s_property_or_method_signature_member.rast | 4 +- .../inline/ok/ts_template_literal_type.rast | 2 +- .../ok/ts_type_arguments_left_shift.rast | 4 +- .../inline/ok/ts_type_constraint_clause.rast | 4 +- .../inline/ok/ts_type_parameters.rast | 6 +-- .../inline/ok/tsx_type_arguments.rast | 10 ++-- .../inline/ok/type_parameter_modifier.rast | 44 +++++++-------- crates/rome_js_syntax/src/generated/nodes.rs | 10 ++-- .../rome_js_syntax/src/generated/nodes_mut.rs | 2 +- xtask/codegen/js.ungram | 2 +- 40 files changed, 147 insertions(+), 162 deletions(-) delete mode 100644 crates/rome_js_formatter/src/ts/bindings/type_parameter_modifier.rs diff --git a/crates/rome_js_factory/src/generated/node_factory.rs b/crates/rome_js_factory/src/generated/node_factory.rs index 996697a254f..45d8f75ddd0 100644 --- a/crates/rome_js_factory/src/generated/node_factory.rs +++ b/crates/rome_js_factory/src/generated/node_factory.rs @@ -6009,7 +6009,7 @@ pub fn ts_type_parameter(name: TsTypeParameterName) -> TsTypeParameterBuilder { TsTypeParameterBuilder { name, in_modifier_token: None, - out_modfier_token: None, + out_modifier_token: None, constraint: None, default: None, } @@ -6017,7 +6017,7 @@ pub fn ts_type_parameter(name: TsTypeParameterName) -> TsTypeParameterBuilder { pub struct TsTypeParameterBuilder { name: TsTypeParameterName, in_modifier_token: Option, - out_modfier_token: Option, + out_modifier_token: Option, constraint: Option, default: Option, } @@ -6026,8 +6026,8 @@ impl TsTypeParameterBuilder { self.in_modifier_token = Some(in_modifier_token); self } - pub fn with_out_modfier_token(mut self, out_modfier_token: SyntaxToken) -> Self { - self.out_modfier_token = Some(out_modfier_token); + pub fn with_out_modifier_token(mut self, out_modifier_token: SyntaxToken) -> Self { + self.out_modifier_token = Some(out_modifier_token); self } pub fn with_constraint(mut self, constraint: TsTypeConstraintClause) -> Self { @@ -6044,7 +6044,7 @@ impl TsTypeParameterBuilder { [ self.in_modifier_token .map(|token| SyntaxElement::Token(token)), - self.out_modfier_token + self.out_modifier_token .map(|token| SyntaxElement::Token(token)), Some(SyntaxElement::Node(self.name.into_syntax())), self.constraint diff --git a/crates/rome_js_formatter/src/ts/bindings/mod.rs b/crates/rome_js_formatter/src/ts/bindings/mod.rs index 671c7ea99b5..06e7985c8dd 100644 --- a/crates/rome_js_formatter/src/ts/bindings/mod.rs +++ b/crates/rome_js_formatter/src/ts/bindings/mod.rs @@ -5,5 +5,4 @@ mod index_signature_parameter; mod property_parameter; mod this_parameter; mod type_parameter; -mod type_parameter_modifier; mod type_parameters; diff --git a/crates/rome_js_formatter/src/ts/bindings/type_parameter.rs b/crates/rome_js_formatter/src/ts/bindings/type_parameter.rs index ecd81cc4499..f59d3a7bd9d 100644 --- a/crates/rome_js_formatter/src/ts/bindings/type_parameter.rs +++ b/crates/rome_js_formatter/src/ts/bindings/type_parameter.rs @@ -9,8 +9,10 @@ impl FormatNodeFields for FormatNodeRule { name, constraint, default, + in_modifier_token, + out_modifier_token, } = node.as_fields(); - + write!(f, [in_modifier_token.format(), out_modifier_token.format()])?; write!(f, [name.format()])?; if let Some(constraint) = constraint { diff --git a/crates/rome_js_formatter/src/ts/bindings/type_parameter_modifier.rs b/crates/rome_js_formatter/src/ts/bindings/type_parameter_modifier.rs deleted file mode 100644 index 3a7a0c42911..00000000000 --- a/crates/rome_js_formatter/src/ts/bindings/type_parameter_modifier.rs +++ /dev/null @@ -1,16 +0,0 @@ -use crate::{format_elements, format_traits::FormatOptional, FormatElement, FormatNode, Formatter}; -use rome_formatter::FormatResult; -use rome_js_syntax::{TsTypeParameterModifier, TsTypeParameterModifierFields}; - -impl FormatNode for TsTypeParameterModifier { - fn format_fields(&self, formatter: &Formatter) -> FormatResult { - let TsTypeParameterModifierFields { - in_token, - out_token, - } = self.as_fields(); - Ok(format_elements![ - in_token.format_or_empty(formatter)?, - out_token.format_or_empty(formatter)? - ]) - } -} diff --git a/crates/rome_js_parser/test_data/inline/err/ts_constructor_type_parameters.rast b/crates/rome_js_parser/test_data/inline/err/ts_constructor_type_parameters.rast index 1959e7a18a2..d20b7482e71 100644 --- a/crates/rome_js_parser/test_data/inline/err/ts_constructor_type_parameters.rast +++ b/crates/rome_js_parser/test_data/inline/err/ts_constructor_type_parameters.rast @@ -24,7 +24,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@22..23 "A" [] [], }, diff --git a/crates/rome_js_parser/test_data/inline/err/ts_declare_function_with_body.rast b/crates/rome_js_parser/test_data/inline/err/ts_declare_function_with_body.rast index 7bf33ef329e..3c9d5e8e203 100644 --- a/crates/rome_js_parser/test_data/inline/err/ts_declare_function_with_body.rast +++ b/crates/rome_js_parser/test_data/inline/err/ts_declare_function_with_body.rast @@ -16,7 +16,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@22..23 "A" [] [], }, diff --git a/crates/rome_js_parser/test_data/inline/err/ts_getter_setter_type_parameters.rast b/crates/rome_js_parser/test_data/inline/err/ts_getter_setter_type_parameters.rast index 7fd20acee7f..44f95c136e2 100644 --- a/crates/rome_js_parser/test_data/inline/err/ts_getter_setter_type_parameters.rast +++ b/crates/rome_js_parser/test_data/inline/err/ts_getter_setter_type_parameters.rast @@ -25,7 +25,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@20..21 "A" [] [], }, @@ -66,7 +66,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@38..39 "A" [] [], }, diff --git a/crates/rome_js_parser/test_data/inline/err/ts_object_getter_type_parameters.rast b/crates/rome_js_parser/test_data/inline/err/ts_object_getter_type_parameters.rast index 8476b328921..4adae30ba52 100644 --- a/crates/rome_js_parser/test_data/inline/err/ts_object_getter_type_parameters.rast +++ b/crates/rome_js_parser/test_data/inline/err/ts_object_getter_type_parameters.rast @@ -19,7 +19,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@9..10 "A" [] [], }, diff --git a/crates/rome_js_parser/test_data/inline/err/ts_object_setter_type_parameters.rast b/crates/rome_js_parser/test_data/inline/err/ts_object_setter_type_parameters.rast index af2df65c0b9..1b926884c31 100644 --- a/crates/rome_js_parser/test_data/inline/err/ts_object_setter_type_parameters.rast +++ b/crates/rome_js_parser/test_data/inline/err/ts_object_setter_type_parameters.rast @@ -19,7 +19,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@9..10 "A" [] [], }, diff --git a/crates/rome_js_parser/test_data/inline/err/ts_type_parameters_incomplete.rast b/crates/rome_js_parser/test_data/inline/err/ts_type_parameters_incomplete.rast index eaeaad03748..2b60e557050 100644 --- a/crates/rome_js_parser/test_data/inline/err/ts_type_parameters_incomplete.rast +++ b/crates/rome_js_parser/test_data/inline/err/ts_type_parameters_incomplete.rast @@ -12,7 +12,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@7..8 "T" [] [], }, diff --git a/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.rast b/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.rast index dda3d53b2ca..c3527c825ad 100644 --- a/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.rast +++ b/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.rast @@ -15,7 +15,7 @@ JsModule { items: [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@9..10 "i" [] [], }, @@ -29,7 +29,7 @@ JsModule { }, TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@11..18 "\\u006E" [] [Whitespace(" ")], }, @@ -38,7 +38,7 @@ JsModule { }, TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@18..19 "T" [] [], }, @@ -72,7 +72,7 @@ JsModule { items: [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@34..36 "ou" [] [], }, @@ -86,7 +86,7 @@ JsModule { }, TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@37..44 "\\u0074" [] [Whitespace(" ")], }, @@ -95,7 +95,7 @@ JsModule { }, TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@44..45 "T" [] [], }, @@ -197,7 +197,7 @@ JsModule { }, TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@108..109 "T" [] [], }, @@ -240,7 +240,7 @@ JsModule { }, TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@131..132 "T" [] [], }, @@ -281,7 +281,7 @@ JsModule { }, TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@157..158 "T" [] [], }, @@ -312,7 +312,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: IN_KW@173..176 "in" [] [Whitespace(" ")], - out_modfier_token: OUT_KW@176..180 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@176..180 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@180..184 "out" [] [Whitespace(" ")], }, @@ -322,7 +322,7 @@ JsModule { missing separator, TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@184..185 "T" [] [], }, @@ -353,7 +353,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: IN_KW@204..207 "in" [] [Whitespace(" ")], - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@207..208 "T" [] [], }, @@ -388,7 +388,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: OUT_KW@228..232 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@228..232 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@232..233 "T" [] [], }, diff --git a/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier1.rast b/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier1.rast index 6f9790693d5..5bbc4ecfcfd 100644 --- a/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier1.rast +++ b/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier1.rast @@ -18,7 +18,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: IN_KW@29..32 "in" [] [Whitespace(" ")], - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@32..33 "T" [] [], }, @@ -58,7 +58,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: OUT_KW@61..65 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@61..65 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@65..66 "T" [] [], }, @@ -96,7 +96,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: IN_KW@95..98 "in" [] [Whitespace(" ")], - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@98..99 "T" [] [], }, @@ -134,7 +134,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: OUT_KW@128..132 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@128..132 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@132..133 "T" [] [], }, @@ -253,7 +253,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: IN_KW@203..206 "in" [] [Whitespace(" ")], - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@206..207 "T" [] [], }, @@ -285,7 +285,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: OUT_KW@233..237 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@233..237 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@237..238 "T" [] [], }, @@ -406,7 +406,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: IN_KW@313..316 "in" [] [Whitespace(" ")], - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@316..317 "T" [] [], }, @@ -439,7 +439,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: OUT_KW@336..340 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@336..340 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@340..341 "T" [] [], }, @@ -474,7 +474,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: IN_KW@363..366 "in" [] [Whitespace(" ")], - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@366..367 "T" [] [], }, @@ -516,7 +516,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: OUT_KW@391..395 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@391..395 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@395..396 "T" [] [], }, @@ -566,7 +566,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: IN_KW@420..423 "in" [] [Whitespace(" ")], - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@423..424 "T" [] [], }, @@ -624,7 +624,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: OUT_KW@453..457 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@453..457 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@457..458 "T" [] [], }, @@ -678,7 +678,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: IN_KW@483..486 "in" [] [Whitespace(" ")], - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@486..487 "T" [] [], }, @@ -735,7 +735,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: OUT_KW@513..517 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@513..517 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@517..518 "T" [] [], }, @@ -819,7 +819,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: OUT_KW@550..554 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@550..554 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@554..555 "T" [] [], }, @@ -916,7 +916,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: IN_KW@599..602 "in" [] [Whitespace(" ")], - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@602..603 "T" [] [], }, @@ -961,7 +961,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: OUT_KW@623..627 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@623..627 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@627..628 "T" [] [], }, @@ -1006,7 +1006,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: IN_KW@648..651 "in" [] [Whitespace(" ")], - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@651..652 "T" [] [], }, @@ -1016,7 +1016,7 @@ JsModule { COMMA@652..654 "," [] [Whitespace(" ")], TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: OUT_KW@654..658 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@654..658 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@658..659 "T" [] [], }, @@ -1063,7 +1063,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: IN_KW@683..686 "in" [] [Whitespace(" ")], - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@686..687 "T" [] [], }, @@ -1110,7 +1110,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: OUT_KW@711..715 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@711..715 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@715..716 "T" [] [], }, @@ -1157,7 +1157,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: IN_KW@740..743 "in" [] [Whitespace(" ")], - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@743..744 "T" [] [], }, @@ -1167,7 +1167,7 @@ JsModule { COMMA@744..746 "," [] [Whitespace(" ")], TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: OUT_KW@746..750 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@746..750 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@750..751 "T" [] [], }, @@ -1219,7 +1219,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: IN_KW@774..777 "in" [] [Whitespace(" ")], - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@777..778 "T" [] [], }, @@ -1275,7 +1275,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: OUT_KW@802..806 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@802..806 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@806..807 "T" [] [], }, @@ -1331,7 +1331,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: IN_KW@831..834 "in" [] [Whitespace(" ")], - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@834..835 "T" [] [], }, @@ -1341,7 +1341,7 @@ JsModule { COMMA@835..837 "," [] [Whitespace(" ")], TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: OUT_KW@837..841 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@837..841 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@841..842 "T" [] [], }, diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_arrow_function_type_parameters.rast b/crates/rome_js_parser/test_data/inline/ok/ts_arrow_function_type_parameters.rast index 32f32355cc5..4aac7578dd0 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_arrow_function_type_parameters.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_arrow_function_type_parameters.rast @@ -20,7 +20,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@9..10 "A" [] [], }, @@ -30,7 +30,7 @@ JsModule { COMMA@10..12 "," [] [Whitespace(" ")], TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@12..14 "B" [] [Whitespace(" ")], }, @@ -48,7 +48,7 @@ JsModule { COMMA@23..25 "," [] [Whitespace(" ")], TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@25..27 "C" [] [Whitespace(" ")], }, @@ -149,7 +149,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@82..83 "A" [] [], }, @@ -159,7 +159,7 @@ JsModule { COMMA@83..85 "," [] [Whitespace(" ")], TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@85..86 "B" [] [], }, diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_as_assignment.rast b/crates/rome_js_parser/test_data/inline/ok/ts_as_assignment.rast index d9f46dae6e9..0d4854c70eb 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_as_assignment.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_as_assignment.rast @@ -32,7 +32,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@19..20 "A" [] [], }, diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_call_expr_with_type_arguments.rast b/crates/rome_js_parser/test_data/inline/ok/ts_call_expr_with_type_arguments.rast index d2f82a0db7e..8017aa8d030 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_call_expr_with_type_arguments.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_call_expr_with_type_arguments.rast @@ -14,7 +14,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@11..12 "A" [] [], }, @@ -24,7 +24,7 @@ JsModule { COMMA@12..14 "," [] [Whitespace(" ")], TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@14..15 "B" [] [], }, @@ -34,7 +34,7 @@ JsModule { COMMA@15..17 "," [] [Whitespace(" ")], TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@17..18 "C" [] [], }, @@ -242,7 +242,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@95..96 "T" [] [], }, @@ -278,7 +278,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@106..107 "T" [] [], }, diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_call_signature_member.rast b/crates/rome_js_parser/test_data/inline/ok/ts_call_signature_member.rast index 4c7f0f1035c..3a3d11a6050 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_call_signature_member.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_call_signature_member.rast @@ -105,7 +105,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@68..69 "A" [] [], }, @@ -115,7 +115,7 @@ JsModule { COMMA@69..71 "," [] [Whitespace(" ")], TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@71..72 "B" [] [], }, diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_class_type_parameters.rast b/crates/rome_js_parser/test_data/inline/ok/ts_class_type_parameters.rast index fa11a8601b6..d3d629f04bd 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_class_type_parameters.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_class_type_parameters.rast @@ -13,7 +13,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@17..18 "A" [] [], }, @@ -23,7 +23,7 @@ JsModule { COMMA@18..20 "," [] [Whitespace(" ")], TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@20..21 "B" [] [], }, @@ -33,7 +33,7 @@ JsModule { COMMA@21..23 "," [] [Whitespace(" ")], TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@23..24 "C" [] [], }, diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_conditional_type_call_signature_lhs.rast b/crates/rome_js_parser/test_data/inline/ok/ts_conditional_type_call_signature_lhs.rast index 318f0a0808a..a5769711633 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_conditional_type_call_signature_lhs.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_conditional_type_call_signature_lhs.rast @@ -12,7 +12,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@7..8 "V" [] [], }, diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_construct_signature_member.rast b/crates/rome_js_parser/test_data/inline/ok/ts_construct_signature_member.rast index 413fdf684a7..fd886ed3ef3 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_construct_signature_member.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_construct_signature_member.rast @@ -104,7 +104,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@85..86 "A" [] [], }, @@ -114,7 +114,7 @@ JsModule { COMMA@86..88 "," [] [Whitespace(" ")], TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@88..89 "B" [] [], }, diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_constructor_type.rast b/crates/rome_js_parser/test_data/inline/ok/ts_constructor_type.rast index 7117c866f59..0e20bf3e781 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_constructor_type.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_constructor_type.rast @@ -119,7 +119,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@114..115 "A" [] [], }, @@ -129,7 +129,7 @@ JsModule { COMMA@115..117 "," [] [Whitespace(" ")], TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@117..118 "B" [] [], }, @@ -200,7 +200,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@165..166 "A" [] [], }, @@ -210,7 +210,7 @@ JsModule { COMMA@166..168 "," [] [Whitespace(" ")], TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@168..169 "B" [] [], }, diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_declare_function.rast b/crates/rome_js_parser/test_data/inline/ok/ts_declare_function.rast index a293bd3c644..c2ccb652579 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_declare_function.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_declare_function.rast @@ -15,7 +15,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@22..23 "A" [] [], }, @@ -25,7 +25,7 @@ JsModule { COMMA@23..25 "," [] [Whitespace(" ")], TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@25..26 "B" [] [], }, @@ -35,7 +35,7 @@ JsModule { COMMA@26..28 "," [] [Whitespace(" ")], TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@28..29 "R" [] [], }, diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_default_type_clause.rast b/crates/rome_js_parser/test_data/inline/ok/ts_default_type_clause.rast index f6edfdc0d10..52edabe9c46 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_default_type_clause.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_default_type_clause.rast @@ -12,7 +12,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@7..8 "X" [] [], }, @@ -46,7 +46,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@29..31 "X" [] [Whitespace(" ")], }, diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_function_statement.rast b/crates/rome_js_parser/test_data/inline/ok/ts_function_statement.rast index b7c5882d25d..e8b584e3f30 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_function_statement.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_function_statement.rast @@ -77,7 +77,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@68..69 "A" [] [], }, @@ -87,7 +87,7 @@ JsModule { COMMA@69..71 "," [] [Whitespace(" ")], TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@71..73 "B" [] [Whitespace(" ")], }, @@ -105,7 +105,7 @@ JsModule { COMMA@82..84 "," [] [Whitespace(" ")], TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@84..86 "C" [] [Whitespace(" ")], }, diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_function_type.rast b/crates/rome_js_parser/test_data/inline/ok/ts_function_type.rast index 59837c35d9c..2aae28e6034 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_function_type.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_function_type.rast @@ -220,7 +220,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@174..175 "A" [] [], }, @@ -230,7 +230,7 @@ JsModule { COMMA@175..177 "," [] [Whitespace(" ")], TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@177..178 "B" [] [], }, diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_interface_extends_clause.rast b/crates/rome_js_parser/test_data/inline/ok/ts_interface_extends_clause.rast index b78b3dd9f5d..8426b054153 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_interface_extends_clause.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_interface_extends_clause.rast @@ -12,7 +12,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@12..16 "Prop" [] [], }, diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_mapped_type.rast b/crates/rome_js_parser/test_data/inline/ok/ts_mapped_type.rast index 449b93aae67..b0ece9bf398 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_mapped_type.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_mapped_type.rast @@ -48,7 +48,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@51..55 "Type" [] [], }, @@ -100,7 +100,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@120..124 "Type" [] [], }, @@ -168,7 +168,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@200..204 "Type" [] [], }, @@ -236,7 +236,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@271..275 "Type" [] [], }, diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_method_class_member.rast b/crates/rome_js_parser/test_data/inline/ok/ts_method_class_member.rast index fe91601c8d0..ab28c588d62 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_method_class_member.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_method_class_member.rast @@ -26,7 +26,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@20..21 "A" [] [], }, @@ -36,7 +36,7 @@ JsModule { COMMA@21..23 "," [] [Whitespace(" ")], TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@23..25 "B" [] [Whitespace(" ")], }, @@ -54,7 +54,7 @@ JsModule { COMMA@34..36 "," [] [Whitespace(" ")], TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@36..37 "R" [] [], }, diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_method_object_member_body.rast b/crates/rome_js_parser/test_data/inline/ok/ts_method_object_member_body.rast index 54f4760ee76..b49259c1080 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_method_object_member_body.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_method_object_member_body.rast @@ -19,7 +19,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@9..10 "A" [] [], }, @@ -138,7 +138,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@116..117 "R" [] [], }, diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_new_with_type_arguments.rast b/crates/rome_js_parser/test_data/inline/ok/ts_new_with_type_arguments.rast index 378d27d8d39..4d2a7714c3c 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_new_with_type_arguments.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_new_with_type_arguments.rast @@ -13,7 +13,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@11..12 "A" [] [], }, @@ -23,7 +23,7 @@ JsModule { COMMA@12..14 "," [] [Whitespace(" ")], TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@14..15 "B" [] [], }, @@ -33,7 +33,7 @@ JsModule { COMMA@15..17 "," [] [Whitespace(" ")], TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@17..18 "C" [] [], }, diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_optional_chain_call.rast b/crates/rome_js_parser/test_data/inline/ok/ts_optional_chain_call.rast index 8f806cccb9a..d8e9734cc86 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_optional_chain_call.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_optional_chain_call.rast @@ -13,7 +13,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@2..3 "A" [] [], }, @@ -23,7 +23,7 @@ JsModule { COMMA@3..5 "," [] [Whitespace(" ")], TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@5..6 "B" [] [], }, diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_property_or_method_signature_member.rast b/crates/rome_js_parser/test_data/inline/ok/ts_property_or_method_signature_member.rast index 28ae58d4292..c612a50996c 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_property_or_method_signature_member.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_property_or_method_signature_member.rast @@ -237,7 +237,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@190..191 "A" [] [], }, @@ -247,7 +247,7 @@ JsModule { COMMA@191..193 "," [] [Whitespace(" ")], TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@193..194 "B" [] [], }, diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_template_literal_type.rast b/crates/rome_js_parser/test_data/inline/ok/ts_template_literal_type.rast index aa4d5bb62ff..cad3b03e23e 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_template_literal_type.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_template_literal_type.rast @@ -58,7 +58,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@40..42 "X" [] [Whitespace(" ")], }, diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_type_arguments_left_shift.rast b/crates/rome_js_parser/test_data/inline/ok/ts_type_arguments_left_shift.rast index d03f5df9a52..0913f8784a0 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_type_arguments_left_shift.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_type_arguments_left_shift.rast @@ -12,7 +12,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@7..8 "T" [] [], }, @@ -51,7 +51,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@27..28 "C" [] [], }, diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_type_constraint_clause.rast b/crates/rome_js_parser/test_data/inline/ok/ts_type_constraint_clause.rast index 9652212b657..61d1072f793 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_type_constraint_clause.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_type_constraint_clause.rast @@ -12,7 +12,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@7..9 "X" [] [Whitespace(" ")], }, @@ -46,7 +46,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@37..39 "X" [] [Whitespace(" ")], }, diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_type_parameters.rast b/crates/rome_js_parser/test_data/inline/ok/ts_type_parameters.rast index d55e84786c7..0bb2b71ddf2 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_type_parameters.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_type_parameters.rast @@ -12,7 +12,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@7..9 "X" [] [Whitespace(" ")], }, @@ -27,7 +27,7 @@ JsModule { COMMA@23..25 "," [] [Whitespace(" ")], TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@25..27 "Y" [] [Whitespace(" ")], }, @@ -42,7 +42,7 @@ JsModule { COMMA@35..37 "," [] [Whitespace(" ")], TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@37..39 "Z" [] [Whitespace(" ")], }, diff --git a/crates/rome_js_parser/test_data/inline/ok/tsx_type_arguments.rast b/crates/rome_js_parser/test_data/inline/ok/tsx_type_arguments.rast index c4efae7045e..99c32e6bb39 100644 --- a/crates/rome_js_parser/test_data/inline/ok/tsx_type_arguments.rast +++ b/crates/rome_js_parser/test_data/inline/ok/tsx_type_arguments.rast @@ -10,7 +10,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@35..37 "A" [] [Whitespace(" ")], }, @@ -52,7 +52,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@58..59 "A" [] [], }, @@ -91,7 +91,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@78..79 "A" [] [], }, @@ -101,7 +101,7 @@ JsModule { COMMA@79..81 "," [] [Whitespace(" ")], TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@81..82 "B" [] [], }, @@ -135,7 +135,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@94..96 "A" [] [Whitespace(" ")], }, diff --git a/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.rast b/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.rast index c7801079931..94a113571f3 100644 --- a/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.rast +++ b/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.rast @@ -12,7 +12,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: IN_KW@9..12 "in" [] [Whitespace(" ")], - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@12..13 "T" [] [], }, @@ -41,7 +41,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@28..31 "out" [] [], }, @@ -70,7 +70,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: OUT_KW@48..52 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@48..52 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@52..53 "T" [] [], }, @@ -99,7 +99,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: IN_KW@68..71 "in" [] [Whitespace(" ")], - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@71..74 "out" [] [], }, @@ -128,7 +128,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: OUT_KW@89..93 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@89..93 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@93..96 "out" [] [], }, @@ -157,7 +157,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: IN_KW@111..114 "in" [] [Whitespace(" ")], - out_modfier_token: OUT_KW@114..118 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@114..118 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@118..121 "out" [] [], }, @@ -186,7 +186,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: IN_KW@136..139 "in" [] [Whitespace(" ")], - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@139..140 "X" [] [], }, @@ -196,7 +196,7 @@ JsModule { COMMA@140..142 "," [] [Whitespace(" ")], TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: OUT_KW@142..146 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@142..146 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@146..147 "Y" [] [], }, @@ -238,7 +238,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: OUT_KW@167..171 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@167..171 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@171..172 "X" [] [], }, @@ -248,7 +248,7 @@ JsModule { COMMA@172..174 "," [] [Whitespace(" ")], TsTypeParameter { in_modifier_token: IN_KW@174..177 "in" [] [Whitespace(" ")], - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@177..178 "Y" [] [], }, @@ -290,7 +290,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: OUT_KW@198..202 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@198..202 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@202..203 "X" [] [], }, @@ -300,7 +300,7 @@ JsModule { COMMA@203..205 "," [] [Whitespace(" ")], TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: OUT_KW@205..209 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@205..209 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@209..211 "Y" [] [Whitespace(" ")], }, @@ -354,7 +354,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: IN_KW@247..250 "in" [] [Whitespace(" ")], - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@250..251 "T" [] [], }, @@ -381,7 +381,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: OUT_KW@266..270 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@266..270 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@270..271 "T" [] [], }, @@ -412,7 +412,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: IN_KW@301..304 "in" [] [Whitespace(" ")], - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@304..305 "T" [] [], }, @@ -442,7 +442,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: OUT_KW@320..324 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@320..324 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@324..325 "T" [] [], }, @@ -468,7 +468,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: IN_KW@344..347 "in" [] [Whitespace(" ")], - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@347..348 "T" [] [], }, @@ -493,7 +493,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: OUT_KW@367..371 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@367..371 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@371..372 "T" [] [], }, @@ -521,7 +521,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: IN_KW@395..398 "in" [] [Whitespace(" ")], - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@398..399 "T" [] [], }, @@ -551,7 +551,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: OUT_KW@422..426 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@422..426 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@426..427 "T" [] [], }, @@ -580,7 +580,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: IN_KW@454..457 "in" [] [Whitespace(" ")], - out_modfier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@457..458 "T" [] [], }, @@ -608,7 +608,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modfier_token: OUT_KW@485..489 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@485..489 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@489..490 "T" [] [], }, diff --git a/crates/rome_js_syntax/src/generated/nodes.rs b/crates/rome_js_syntax/src/generated/nodes.rs index ae0cf3002b2..9b88efaa056 100644 --- a/crates/rome_js_syntax/src/generated/nodes.rs +++ b/crates/rome_js_syntax/src/generated/nodes.rs @@ -11590,14 +11590,14 @@ impl TsTypeParameter { pub fn as_fields(&self) -> TsTypeParameterFields { TsTypeParameterFields { in_modifier_token: self.in_modifier_token(), - out_modfier_token: self.out_modfier_token(), + out_modifier_token: self.out_modifier_token(), name: self.name(), constraint: self.constraint(), default: self.default(), } } pub fn in_modifier_token(&self) -> Option { support::token(&self.syntax, 0usize) } - pub fn out_modfier_token(&self) -> Option { support::token(&self.syntax, 1usize) } + pub fn out_modifier_token(&self) -> Option { support::token(&self.syntax, 1usize) } pub fn name(&self) -> SyntaxResult { support::required_node(&self.syntax, 2usize) } @@ -11618,7 +11618,7 @@ impl Serialize for TsTypeParameter { #[cfg_attr(feature = "serde", derive(Serialize), serde(crate = "serde_crate"))] pub struct TsTypeParameterFields { pub in_modifier_token: Option, - pub out_modfier_token: Option, + pub out_modifier_token: Option, pub name: SyntaxResult, pub constraint: Option, pub default: Option, @@ -23742,8 +23742,8 @@ impl std::fmt::Debug for TsTypeParameter { &support::DebugOptionalElement(self.in_modifier_token()), ) .field( - "out_modfier_token", - &support::DebugOptionalElement(self.out_modfier_token()), + "out_modifier_token", + &support::DebugOptionalElement(self.out_modifier_token()), ) .field("name", &support::DebugSyntaxResult(self.name())) .field( diff --git a/crates/rome_js_syntax/src/generated/nodes_mut.rs b/crates/rome_js_syntax/src/generated/nodes_mut.rs index e150ccc2f78..caa495bcf6d 100644 --- a/crates/rome_js_syntax/src/generated/nodes_mut.rs +++ b/crates/rome_js_syntax/src/generated/nodes_mut.rs @@ -5686,7 +5686,7 @@ impl TsTypeParameter { .splice_slots(0usize..=0usize, once(element.map(|element| element.into()))), ) } - pub fn with_out_modfier_token(self, element: Option) -> Self { + pub fn with_out_modifier_token(self, element: Option) -> Self { Self::unwrap_cast( self.syntax .splice_slots(1usize..=1usize, once(element.map(|element| element.into()))), diff --git a/xtask/codegen/js.ungram b/xtask/codegen/js.ungram index ce8fea06e87..5a381efe424 100644 --- a/xtask/codegen/js.ungram +++ b/xtask/codegen/js.ungram @@ -1881,7 +1881,7 @@ TsTypeParameterList = (TsTypeParameter (',' TsTypeParameter)* ','?) // ^^^^^^^^^^^^^^^^^^^^^^ TsTypeParameter = in_modifier: 'in' ? - out_modfier: 'out'? + out_modifier: 'out'? name: TsTypeParameterName constraint: TsTypeConstraintClause? default: TsDefaultTypeClause? From 7811d453bb2ce65d1dbe03b9e9e1c2102fe80036 Mon Sep 17 00:00:00 2001 From: IWANABETHATGUY Date: Wed, 15 Jun 2022 00:13:48 +0800 Subject: [PATCH 13/22] =?UTF-8?q?chore:=20=F0=9F=A4=96=20update=20test=20p?= =?UTF-8?q?arser?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/syntax/typescript/types.rs | 27 +- .../ok/type_parameter_modifier_tsx.rast | 437 +++++++++++++++++- .../inline/ok/type_parameter_modifier_tsx.tsx | 12 +- crates/rome_js_syntax/src/lib.rs | 2 +- 4 files changed, 446 insertions(+), 32 deletions(-) diff --git a/crates/rome_js_parser/src/syntax/typescript/types.rs b/crates/rome_js_parser/src/syntax/typescript/types.rs index 025cf730df8..8afedfefdc5 100644 --- a/crates/rome_js_parser/src/syntax/typescript/types.rs +++ b/crates/rome_js_parser/src/syntax/typescript/types.rs @@ -204,12 +204,12 @@ impl ParseSeparatedList for TsTypeParameterList { // test tsx type_parameter_modifier_tsx // ; -// // ; -// // ; -// // ; -// // -// // -// // +// ; +// ; +// ; +// ; +// ; +// ; // test ts type_parameter_modifier // type Foo = T @@ -233,26 +233,12 @@ impl ParseSeparatedList for TsTypeParameterList { // declare interface Foo {} -// fn parse_ts_type_parameter_modifier( -// p: &mut Parser, -// could_use_parameter_modifier: bool, -// ) -> ParsedSyntax { -// let m = p.start(); - -// if !has_any_modifier { -// m.abandon(p); -// return Absent; -// } -// Present(m.complete(p, TS_TYPE_PARAMETER_MODIFIER)) -// } fn parse_ts_type_parameter(p: &mut Parser, could_use_parameter_modifier: bool) -> ParsedSyntax { let m = p.start(); // parse_ts_type_parameter_modifier(p, could_use_parameter_modifier).ok(); - let mut has_any_modifier = false; // try to eat `in` modifier if p.at(T![in]) { - has_any_modifier = true; if could_use_parameter_modifier { p.bump(T![in]); } else { @@ -266,7 +252,6 @@ fn parse_ts_type_parameter(p: &mut Parser, could_use_parameter_modifier: bool) - } if p.at(T![out]) && !p.nth_at(1, T![,]) && !p.nth_at(1, T![>]) { - has_any_modifier = true; if could_use_parameter_modifier { p.bump(T![out]); } else { diff --git a/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier_tsx.rast b/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier_tsx.rast index 3dc75d27e6f..11f21731e91 100644 --- a/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier_tsx.rast +++ b/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier_tsx.rast @@ -34,14 +34,269 @@ JsModule { }, semicolon_token: SEMICOLON@11..12 ";" [] [], }, + JsExpressionStatement { + expression: JsxTagExpression { + tag: JsxElement { + opening_element: JsxOpeningElement { + l_angle_token: L_ANGLE@12..14 "<" [Newline("\n")] [], + name: JsxName { + value_token: JSX_IDENT@14..18 "out" [] [Whitespace(" ")], + }, + type_arguments: missing (optional), + attributes: JsxAttributeList [ + JsxAttribute { + name: JsxName { + value_token: JSX_IDENT@18..19 "T" [] [], + }, + initializer: missing (optional), + }, + ], + r_angle_token: R_ANGLE@19..20 ">" [] [], + }, + children: JsxChildList [], + closing_element: JsxClosingElement { + l_angle_token: L_ANGLE@20..21 "<" [] [], + slash_token: SLASH@21..22 "/" [] [], + name: JsxName { + value_token: JSX_IDENT@22..25 "out" [] [], + }, + r_angle_token: R_ANGLE@25..26 ">" [] [], + }, + }, + }, + semicolon_token: SEMICOLON@26..27 ";" [] [], + }, + JsExpressionStatement { + expression: JsxTagExpression { + tag: JsxElement { + opening_element: JsxOpeningElement { + l_angle_token: L_ANGLE@27..29 "<" [Newline("\n")] [], + name: JsxName { + value_token: JSX_IDENT@29..32 "in" [] [Whitespace(" ")], + }, + type_arguments: missing (optional), + attributes: JsxAttributeList [ + JsxAttribute { + name: JsxName { + value_token: JSX_IDENT@32..36 "out" [] [Whitespace(" ")], + }, + initializer: missing (optional), + }, + JsxAttribute { + name: JsxName { + value_token: JSX_IDENT@36..37 "T" [] [], + }, + initializer: missing (optional), + }, + ], + r_angle_token: R_ANGLE@37..38 ">" [] [], + }, + children: JsxChildList [], + closing_element: JsxClosingElement { + l_angle_token: L_ANGLE@38..39 "<" [] [], + slash_token: SLASH@39..40 "/" [] [], + name: JsxName { + value_token: JSX_IDENT@40..42 "in" [] [], + }, + r_angle_token: R_ANGLE@42..43 ">" [] [], + }, + }, + }, + semicolon_token: SEMICOLON@43..44 ";" [] [], + }, + JsExpressionStatement { + expression: JsxTagExpression { + tag: JsxElement { + opening_element: JsxOpeningElement { + l_angle_token: L_ANGLE@44..46 "<" [Newline("\n")] [], + name: JsxName { + value_token: JSX_IDENT@46..50 "out" [] [Whitespace(" ")], + }, + type_arguments: missing (optional), + attributes: JsxAttributeList [ + JsxAttribute { + name: JsxName { + value_token: JSX_IDENT@50..53 "in" [] [Whitespace(" ")], + }, + initializer: missing (optional), + }, + JsxAttribute { + name: JsxName { + value_token: JSX_IDENT@53..54 "T" [] [], + }, + initializer: missing (optional), + }, + ], + r_angle_token: R_ANGLE@54..55 ">" [] [], + }, + children: JsxChildList [], + closing_element: JsxClosingElement { + l_angle_token: L_ANGLE@55..56 "<" [] [], + slash_token: SLASH@56..57 "/" [] [], + name: JsxName { + value_token: JSX_IDENT@57..60 "out" [] [], + }, + r_angle_token: R_ANGLE@60..61 ">" [] [], + }, + }, + }, + semicolon_token: SEMICOLON@61..62 ";" [] [], + }, + JsExpressionStatement { + expression: JsxTagExpression { + tag: JsxElement { + opening_element: JsxOpeningElement { + l_angle_token: L_ANGLE@62..64 "<" [Newline("\n")] [], + name: JsxName { + value_token: JSX_IDENT@64..67 "in" [] [Whitespace(" ")], + }, + type_arguments: missing (optional), + attributes: JsxAttributeList [ + JsxAttribute { + name: JsxName { + value_token: JSX_IDENT@67..69 "T" [] [Whitespace(" ")], + }, + initializer: missing (optional), + }, + JsxAttribute { + name: JsxName { + value_token: JSX_IDENT@69..76 "extends" [] [], + }, + initializer: JsxAttributeInitializerClause { + eq_token: EQ@76..77 "=" [] [], + value: JsxExpressionAttributeValue { + l_curly_token: L_CURLY@77..78 "{" [] [], + expression: JsBooleanLiteralExpression { + value_token: TRUE_KW@78..82 "true" [] [], + }, + r_curly_token: R_CURLY@82..83 "}" [] [], + }, + }, + }, + ], + r_angle_token: R_ANGLE@83..84 ">" [] [], + }, + children: JsxChildList [], + closing_element: JsxClosingElement { + l_angle_token: L_ANGLE@84..85 "<" [] [], + slash_token: SLASH@85..86 "/" [] [], + name: JsxName { + value_token: JSX_IDENT@86..88 "in" [] [], + }, + r_angle_token: R_ANGLE@88..89 ">" [] [], + }, + }, + }, + semicolon_token: SEMICOLON@89..90 ";" [] [], + }, + JsExpressionStatement { + expression: JsxTagExpression { + tag: JsxElement { + opening_element: JsxOpeningElement { + l_angle_token: L_ANGLE@90..92 "<" [Newline("\n")] [], + name: JsxName { + value_token: JSX_IDENT@92..96 "out" [] [Whitespace(" ")], + }, + type_arguments: missing (optional), + attributes: JsxAttributeList [ + JsxAttribute { + name: JsxName { + value_token: JSX_IDENT@96..98 "T" [] [Whitespace(" ")], + }, + initializer: missing (optional), + }, + JsxAttribute { + name: JsxName { + value_token: JSX_IDENT@98..105 "extends" [] [], + }, + initializer: JsxAttributeInitializerClause { + eq_token: EQ@105..106 "=" [] [], + value: JsxExpressionAttributeValue { + l_curly_token: L_CURLY@106..107 "{" [] [], + expression: JsBooleanLiteralExpression { + value_token: TRUE_KW@107..111 "true" [] [], + }, + r_curly_token: R_CURLY@111..112 "}" [] [], + }, + }, + }, + ], + r_angle_token: R_ANGLE@112..113 ">" [] [], + }, + children: JsxChildList [], + closing_element: JsxClosingElement { + l_angle_token: L_ANGLE@113..114 "<" [] [], + slash_token: SLASH@114..115 "/" [] [], + name: JsxName { + value_token: JSX_IDENT@115..118 "out" [] [], + }, + r_angle_token: R_ANGLE@118..119 ">" [] [], + }, + }, + }, + semicolon_token: SEMICOLON@119..120 ";" [] [], + }, + JsExpressionStatement { + expression: JsxTagExpression { + tag: JsxElement { + opening_element: JsxOpeningElement { + l_angle_token: L_ANGLE@120..122 "<" [Newline("\n")] [], + name: JsxName { + value_token: JSX_IDENT@122..125 "in" [] [Whitespace(" ")], + }, + type_arguments: missing (optional), + attributes: JsxAttributeList [ + JsxAttribute { + name: JsxName { + value_token: JSX_IDENT@125..129 "out" [] [Whitespace(" ")], + }, + initializer: missing (optional), + }, + JsxAttribute { + name: JsxName { + value_token: JSX_IDENT@129..131 "T" [] [Whitespace(" ")], + }, + initializer: missing (optional), + }, + JsxAttribute { + name: JsxName { + value_token: JSX_IDENT@131..138 "extends" [] [], + }, + initializer: JsxAttributeInitializerClause { + eq_token: EQ@138..139 "=" [] [], + value: JsxExpressionAttributeValue { + l_curly_token: L_CURLY@139..140 "{" [] [], + expression: JsBooleanLiteralExpression { + value_token: TRUE_KW@140..144 "true" [] [], + }, + r_curly_token: R_CURLY@144..145 "}" [] [], + }, + }, + }, + ], + r_angle_token: R_ANGLE@145..146 ">" [] [], + }, + children: JsxChildList [], + closing_element: JsxClosingElement { + l_angle_token: L_ANGLE@146..147 "<" [] [], + slash_token: SLASH@147..148 "/" [] [], + name: JsxName { + value_token: JSX_IDENT@148..150 "in" [] [], + }, + r_angle_token: R_ANGLE@150..151 ">" [] [], + }, + }, + }, + semicolon_token: SEMICOLON@151..152 ";" [] [], + }, ], - eof_token: EOF@12..165 "" [Newline("\n"), Comments("// ;"), Newline("\n"), Comments("// ;"), Newline("\n"), Comments("// ;"), Newline("\n"), Comments("//" [] [] 1: SEMICOLON@11..12 ";" [] [] - 3: EOF@12..165 "" [Newline("\n"), Comments("// ;"), Newline("\n"), Comments("// ;"), Newline("\n"), Comments("// ;"), Newline("\n"), Comments("//" [] [] + 1: JSX_CHILD_LIST@20..20 + 2: JSX_CLOSING_ELEMENT@20..26 + 0: L_ANGLE@20..21 "<" [] [] + 1: SLASH@21..22 "/" [] [] + 2: JSX_NAME@22..25 + 0: JSX_IDENT@22..25 "out" [] [] + 3: R_ANGLE@25..26 ">" [] [] + 1: SEMICOLON@26..27 ";" [] [] + 2: JS_EXPRESSION_STATEMENT@27..44 + 0: JSX_TAG_EXPRESSION@27..43 + 0: JSX_ELEMENT@27..43 + 0: JSX_OPENING_ELEMENT@27..38 + 0: L_ANGLE@27..29 "<" [Newline("\n")] [] + 1: JSX_NAME@29..32 + 0: JSX_IDENT@29..32 "in" [] [Whitespace(" ")] + 2: (empty) + 3: JSX_ATTRIBUTE_LIST@32..37 + 0: JSX_ATTRIBUTE@32..36 + 0: JSX_NAME@32..36 + 0: JSX_IDENT@32..36 "out" [] [Whitespace(" ")] + 1: (empty) + 1: JSX_ATTRIBUTE@36..37 + 0: JSX_NAME@36..37 + 0: JSX_IDENT@36..37 "T" [] [] + 1: (empty) + 4: R_ANGLE@37..38 ">" [] [] + 1: JSX_CHILD_LIST@38..38 + 2: JSX_CLOSING_ELEMENT@38..43 + 0: L_ANGLE@38..39 "<" [] [] + 1: SLASH@39..40 "/" [] [] + 2: JSX_NAME@40..42 + 0: JSX_IDENT@40..42 "in" [] [] + 3: R_ANGLE@42..43 ">" [] [] + 1: SEMICOLON@43..44 ";" [] [] + 3: JS_EXPRESSION_STATEMENT@44..62 + 0: JSX_TAG_EXPRESSION@44..61 + 0: JSX_ELEMENT@44..61 + 0: JSX_OPENING_ELEMENT@44..55 + 0: L_ANGLE@44..46 "<" [Newline("\n")] [] + 1: JSX_NAME@46..50 + 0: JSX_IDENT@46..50 "out" [] [Whitespace(" ")] + 2: (empty) + 3: JSX_ATTRIBUTE_LIST@50..54 + 0: JSX_ATTRIBUTE@50..53 + 0: JSX_NAME@50..53 + 0: JSX_IDENT@50..53 "in" [] [Whitespace(" ")] + 1: (empty) + 1: JSX_ATTRIBUTE@53..54 + 0: JSX_NAME@53..54 + 0: JSX_IDENT@53..54 "T" [] [] + 1: (empty) + 4: R_ANGLE@54..55 ">" [] [] + 1: JSX_CHILD_LIST@55..55 + 2: JSX_CLOSING_ELEMENT@55..61 + 0: L_ANGLE@55..56 "<" [] [] + 1: SLASH@56..57 "/" [] [] + 2: JSX_NAME@57..60 + 0: JSX_IDENT@57..60 "out" [] [] + 3: R_ANGLE@60..61 ">" [] [] + 1: SEMICOLON@61..62 ";" [] [] + 4: JS_EXPRESSION_STATEMENT@62..90 + 0: JSX_TAG_EXPRESSION@62..89 + 0: JSX_ELEMENT@62..89 + 0: JSX_OPENING_ELEMENT@62..84 + 0: L_ANGLE@62..64 "<" [Newline("\n")] [] + 1: JSX_NAME@64..67 + 0: JSX_IDENT@64..67 "in" [] [Whitespace(" ")] + 2: (empty) + 3: JSX_ATTRIBUTE_LIST@67..83 + 0: JSX_ATTRIBUTE@67..69 + 0: JSX_NAME@67..69 + 0: JSX_IDENT@67..69 "T" [] [Whitespace(" ")] + 1: (empty) + 1: JSX_ATTRIBUTE@69..83 + 0: JSX_NAME@69..76 + 0: JSX_IDENT@69..76 "extends" [] [] + 1: JSX_ATTRIBUTE_INITIALIZER_CLAUSE@76..83 + 0: EQ@76..77 "=" [] [] + 1: JSX_EXPRESSION_ATTRIBUTE_VALUE@77..83 + 0: L_CURLY@77..78 "{" [] [] + 1: JS_BOOLEAN_LITERAL_EXPRESSION@78..82 + 0: TRUE_KW@78..82 "true" [] [] + 2: R_CURLY@82..83 "}" [] [] + 4: R_ANGLE@83..84 ">" [] [] + 1: JSX_CHILD_LIST@84..84 + 2: JSX_CLOSING_ELEMENT@84..89 + 0: L_ANGLE@84..85 "<" [] [] + 1: SLASH@85..86 "/" [] [] + 2: JSX_NAME@86..88 + 0: JSX_IDENT@86..88 "in" [] [] + 3: R_ANGLE@88..89 ">" [] [] + 1: SEMICOLON@89..90 ";" [] [] + 5: JS_EXPRESSION_STATEMENT@90..120 + 0: JSX_TAG_EXPRESSION@90..119 + 0: JSX_ELEMENT@90..119 + 0: JSX_OPENING_ELEMENT@90..113 + 0: L_ANGLE@90..92 "<" [Newline("\n")] [] + 1: JSX_NAME@92..96 + 0: JSX_IDENT@92..96 "out" [] [Whitespace(" ")] + 2: (empty) + 3: JSX_ATTRIBUTE_LIST@96..112 + 0: JSX_ATTRIBUTE@96..98 + 0: JSX_NAME@96..98 + 0: JSX_IDENT@96..98 "T" [] [Whitespace(" ")] + 1: (empty) + 1: JSX_ATTRIBUTE@98..112 + 0: JSX_NAME@98..105 + 0: JSX_IDENT@98..105 "extends" [] [] + 1: JSX_ATTRIBUTE_INITIALIZER_CLAUSE@105..112 + 0: EQ@105..106 "=" [] [] + 1: JSX_EXPRESSION_ATTRIBUTE_VALUE@106..112 + 0: L_CURLY@106..107 "{" [] [] + 1: JS_BOOLEAN_LITERAL_EXPRESSION@107..111 + 0: TRUE_KW@107..111 "true" [] [] + 2: R_CURLY@111..112 "}" [] [] + 4: R_ANGLE@112..113 ">" [] [] + 1: JSX_CHILD_LIST@113..113 + 2: JSX_CLOSING_ELEMENT@113..119 + 0: L_ANGLE@113..114 "<" [] [] + 1: SLASH@114..115 "/" [] [] + 2: JSX_NAME@115..118 + 0: JSX_IDENT@115..118 "out" [] [] + 3: R_ANGLE@118..119 ">" [] [] + 1: SEMICOLON@119..120 ";" [] [] + 6: JS_EXPRESSION_STATEMENT@120..152 + 0: JSX_TAG_EXPRESSION@120..151 + 0: JSX_ELEMENT@120..151 + 0: JSX_OPENING_ELEMENT@120..146 + 0: L_ANGLE@120..122 "<" [Newline("\n")] [] + 1: JSX_NAME@122..125 + 0: JSX_IDENT@122..125 "in" [] [Whitespace(" ")] + 2: (empty) + 3: JSX_ATTRIBUTE_LIST@125..145 + 0: JSX_ATTRIBUTE@125..129 + 0: JSX_NAME@125..129 + 0: JSX_IDENT@125..129 "out" [] [Whitespace(" ")] + 1: (empty) + 1: JSX_ATTRIBUTE@129..131 + 0: JSX_NAME@129..131 + 0: JSX_IDENT@129..131 "T" [] [Whitespace(" ")] + 1: (empty) + 2: JSX_ATTRIBUTE@131..145 + 0: JSX_NAME@131..138 + 0: JSX_IDENT@131..138 "extends" [] [] + 1: JSX_ATTRIBUTE_INITIALIZER_CLAUSE@138..145 + 0: EQ@138..139 "=" [] [] + 1: JSX_EXPRESSION_ATTRIBUTE_VALUE@139..145 + 0: L_CURLY@139..140 "{" [] [] + 1: JS_BOOLEAN_LITERAL_EXPRESSION@140..144 + 0: TRUE_KW@140..144 "true" [] [] + 2: R_CURLY@144..145 "}" [] [] + 4: R_ANGLE@145..146 ">" [] [] + 1: JSX_CHILD_LIST@146..146 + 2: JSX_CLOSING_ELEMENT@146..151 + 0: L_ANGLE@146..147 "<" [] [] + 1: SLASH@147..148 "/" [] [] + 2: JSX_NAME@148..150 + 0: JSX_IDENT@148..150 "in" [] [] + 3: R_ANGLE@150..151 ">" [] [] + 1: SEMICOLON@151..152 ";" [] [] + 3: EOF@152..153 "" [Newline("\n")] [] diff --git a/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier_tsx.tsx b/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier_tsx.tsx index e5812ccc6e5..7ed076c87d2 100644 --- a/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier_tsx.tsx +++ b/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier_tsx.tsx @@ -1,7 +1,7 @@ ; -// ; -// ; -// ; -// -// -// +; +; +; +; +; +; diff --git a/crates/rome_js_syntax/src/lib.rs b/crates/rome_js_syntax/src/lib.rs index 3cc917be52a..a4d94851582 100644 --- a/crates/rome_js_syntax/src/lib.rs +++ b/crates/rome_js_syntax/src/lib.rs @@ -53,7 +53,7 @@ impl JsSyntaxKind { /// Returns `true` for any contextual (await) or non-contextual keyword #[inline] pub const fn is_keyword(self) -> bool { - (self as u16) <= (JsSyntaxKind::OF_KW as u16) + (self as u16) <= (JsSyntaxKind::OUT_KW as u16) && (self as u16) >= (JsSyntaxKind::BREAK_KW as u16) } From d8dd387ec11b49fe46da005c53f7ed17aa34e387 Mon Sep 17 00:00:00 2001 From: IWANABETHATGUY Date: Wed, 15 Jun 2022 00:16:04 +0800 Subject: [PATCH 14/22] =?UTF-8?q?style:=20=F0=9F=92=84=20fmt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/rome_js_parser/src/syntax/typescript/types.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/crates/rome_js_parser/src/syntax/typescript/types.rs b/crates/rome_js_parser/src/syntax/typescript/types.rs index 8afedfefdc5..b6d529dcd7b 100644 --- a/crates/rome_js_parser/src/syntax/typescript/types.rs +++ b/crates/rome_js_parser/src/syntax/typescript/types.rs @@ -232,8 +232,6 @@ impl ParseSeparatedList for TsTypeParameterList { // declare interface Foo {} // declare interface Foo {} - - fn parse_ts_type_parameter(p: &mut Parser, could_use_parameter_modifier: bool) -> ParsedSyntax { let m = p.start(); // parse_ts_type_parameter_modifier(p, could_use_parameter_modifier).ok(); From 94d4fe745fe8b9c5d32435e9cd2b6184898e395e Mon Sep 17 00:00:00 2001 From: IWANABETHATGUY Date: Wed, 15 Jun 2022 00:40:42 +0800 Subject: [PATCH 15/22] =?UTF-8?q?test:=20=F0=9F=92=8D=20update=20format=20?= =?UTF-8?q?test=20snapshot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/ts/bindings/type_parameter.rs | 10 +- .../optional-variance/basic.ts.snap | 284 ++---------------- 2 files changed, 37 insertions(+), 257 deletions(-) diff --git a/crates/rome_js_formatter/src/ts/bindings/type_parameter.rs b/crates/rome_js_formatter/src/ts/bindings/type_parameter.rs index f59d3a7bd9d..b8939dceee7 100644 --- a/crates/rome_js_formatter/src/ts/bindings/type_parameter.rs +++ b/crates/rome_js_formatter/src/ts/bindings/type_parameter.rs @@ -12,9 +12,15 @@ impl FormatNodeFields for FormatNodeRule { in_modifier_token, out_modifier_token, } = node.as_fields(); - write!(f, [in_modifier_token.format(), out_modifier_token.format()])?; - write!(f, [name.format()])?; + if let Some(in_modifier_token) = in_modifier_token { + write!(f, [in_modifier_token.format(), space_token()])?; + } + + if let Some(out_modifier_token) = out_modifier_token { + write!(f, [out_modifier_token.format(), space_token()])?; + } + write!(f, [name.format()])?; if let Some(constraint) = constraint { write!(f, [space_token(), constraint.format()])?; } diff --git a/crates/rome_js_formatter/tests/specs/prettier/typescript/optional-variance/basic.ts.snap b/crates/rome_js_formatter/tests/specs/prettier/typescript/optional-variance/basic.ts.snap index 8b0a97596ef..6897d6f8da5 100644 --- a/crates/rome_js_formatter/tests/specs/prettier/typescript/optional-variance/basic.ts.snap +++ b/crates/rome_js_formatter/tests/specs/prettier/typescript/optional-variance/basic.ts.snap @@ -1,5 +1,6 @@ --- source: crates/rome_js_formatter/tests/prettier_tests.rs +assertion_line: 182 expression: basic.ts --- # Input @@ -71,50 +72,50 @@ declare class StateNode { # Output ```js type Covariant = { - x: T; -} + x: T; +}; type Contravariant = { - f: (x: T) => void; -} + f: (x: T) => void; +}; type Invariant = { - f: (x: T) => T; -} + f: (x: T) => T; +}; type T10 = T; type T11 = keyof T; type T12 = T[K]; type T13 = T[keyof T]; type Covariant1 = { - x: T; -} + x: T; +}; type Contravariant1 = keyof T; type Contravariant2 = { - f: (x: T) => void; -} + f: (x: T) => void; +}; type Invariant1 = { - f: (x: T) => T; -} + f: (x: T) => T; +}; type Invariant2 = { - f: (x: T) => T; -} + f: (x: T) => T; +}; type Foo1 = { - x: T; - f: FooFn1; -} + x: T; + f: FooFn1; +}; type Foo2 = { - x: T; - f: FooFn2; -} + x: T; + f: FooFn2; +}; type Foo3 = { - x: T; - f: FooFn3; -} + x: T; + f: FooFn3; +}; type T21 = T; @@ -122,243 +123,16 @@ interface Baz {} interface Baz {} interface Parent { - child: Child | null; - parent: Parent | null; + child: Child | null; + parent: Parent | null; } declare class StateNode { - _storedEvent: TEvent; - _action: ActionObject; - _state: StateNode; + _storedEvent: TEvent; + _action: ActionObject; + _state: StateNode; } ``` -# Errors -``` -error[SyntaxError]: expected `,` but instead found `T` - ┌─ basic.ts:1:20 - │ -1 │ type Covariant = { - │ ^ unexpected - -error[SyntaxError]: expected a type parameter but instead found 'in' - ┌─ basic.ts:4:20 - │ -4 │ type Contravariant = { - │ ^^ Expected a type parameter here - -error[SyntaxError]: expected `,` but instead found `T` - ┌─ basic.ts:4:23 - │ -4 │ type Contravariant = { - │ ^ unexpected - -error[SyntaxError]: expected a type parameter but instead found 'in' - ┌─ basic.ts:7:16 - │ -7 │ type Invariant = { - │ ^^ Expected a type parameter here - -error[SyntaxError]: expected `,` but instead found `out` - ┌─ basic.ts:7:19 - │ -7 │ type Invariant = { - │ ^^^ unexpected - -error[SyntaxError]: expected `,` but instead found `T` - ┌─ basic.ts:7:23 - │ -7 │ type Invariant = { - │ ^ unexpected - -error[SyntaxError]: expected `,` but instead found `T` - ┌─ basic.ts:10:14 - │ -10 │ type T10 = T; - │ ^ unexpected - -error[SyntaxError]: expected a type parameter but instead found 'in' - ┌─ basic.ts:11:10 - │ -11 │ type T11 = keyof T; - │ ^^ Expected a type parameter here - -error[SyntaxError]: expected `,` but instead found `T` - ┌─ basic.ts:11:13 - │ -11 │ type T11 = keyof T; - │ ^ unexpected - -error[SyntaxError]: expected `,` but instead found `T` - ┌─ basic.ts:12:14 - │ -12 │ type T12 = T[K]; - │ ^ unexpected - -error[SyntaxError]: expected `,` but instead found `K` - ┌─ basic.ts:12:21 - │ -12 │ type T12 = T[K]; - │ ^ unexpected - -error[SyntaxError]: expected a type parameter but instead found 'in' - ┌─ basic.ts:13:10 - │ -13 │ type T13 = T[keyof T]; - │ ^^ Expected a type parameter here - -error[SyntaxError]: expected `,` but instead found `out` - ┌─ basic.ts:13:13 - │ -13 │ type T13 = T[keyof T]; - │ ^^^ unexpected - -error[SyntaxError]: expected `,` but instead found `T` - ┌─ basic.ts:13:17 - │ -13 │ type T13 = T[keyof T]; - │ ^ unexpected - -error[SyntaxError]: expected a type parameter but instead found 'in' - ┌─ basic.ts:15:17 - │ -15 │ type Covariant1 = { - │ ^^ Expected a type parameter here - -error[SyntaxError]: expected `,` but instead found `T` - ┌─ basic.ts:15:20 - │ -15 │ type Covariant1 = { - │ ^ unexpected - -error[SyntaxError]: expected `,` but instead found `T` - ┌─ basic.ts:19:25 - │ -19 │ type Contravariant1 = keyof T; - │ ^ unexpected - -error[SyntaxError]: expected `,` but instead found `T` - ┌─ basic.ts:21:25 - │ -21 │ type Contravariant2 = { - │ ^ unexpected - -error[SyntaxError]: expected a type parameter but instead found 'in' - ┌─ basic.ts:25:17 - │ -25 │ type Invariant1 = { - │ ^^ Expected a type parameter here - -error[SyntaxError]: expected `,` but instead found `T` - ┌─ basic.ts:25:20 - │ -25 │ type Invariant1 = { - │ ^ unexpected - -error[SyntaxError]: expected `,` but instead found `T` - ┌─ basic.ts:29:21 - │ -29 │ type Invariant2 = { - │ ^ unexpected - -error[SyntaxError]: expected a type parameter but instead found 'in' - ┌─ basic.ts:32:11 - │ -32 │ type Foo1 = { - │ ^^ Expected a type parameter here - -error[SyntaxError]: expected `,` but instead found `T` - ┌─ basic.ts:32:14 - │ -32 │ type Foo1 = { - │ ^ unexpected - -error[SyntaxError]: expected `,` but instead found `T` - ┌─ basic.ts:37:15 - │ -37 │ type Foo2 = { - │ ^ unexpected - -error[SyntaxError]: expected a type parameter but instead found 'in' - ┌─ basic.ts:42:11 - │ -42 │ type Foo3 = { - │ ^^ Expected a type parameter here - -error[SyntaxError]: expected `,` but instead found `out` - ┌─ basic.ts:42:14 - │ -42 │ type Foo3 = { - │ ^^^ unexpected - -error[SyntaxError]: expected `,` but instead found `T` - ┌─ basic.ts:42:18 - │ -42 │ type Foo3 = { - │ ^ unexpected - -error[SyntaxError]: expected a type parameter but instead found 'in' - ┌─ basic.ts:47:10 - │ -47 │ type T21 = T; - │ ^^ Expected a type parameter here - -error[SyntaxError]: expected `,` but instead found `out` - ┌─ basic.ts:47:13 - │ -47 │ type T21 = T; - │ ^^^ unexpected - -error[SyntaxError]: expected `,` but instead found `T` - ┌─ basic.ts:47:17 - │ -47 │ type T21 = T; - │ ^ unexpected - -error[SyntaxError]: expected `,` but instead found `T` - ┌─ basic.ts:49:19 - │ -49 │ interface Baz {} - │ ^ unexpected - -error[SyntaxError]: expected a type parameter but instead found 'in' - ┌─ basic.ts:50:15 - │ -50 │ interface Baz {} - │ ^^ Expected a type parameter here - -error[SyntaxError]: expected `,` but instead found `T` - ┌─ basic.ts:50:18 - │ -50 │ interface Baz {} - │ ^ unexpected - -error[SyntaxError]: expected `,` but instead found `A` - ┌─ basic.ts:52:22 - │ -52 │ interface Parent { - │ ^ unexpected - -error[SyntaxError]: expected a type parameter but instead found 'in' - ┌─ basic.ts:57:35 - │ -57 │ declare class StateNode { - │ ^^ Expected a type parameter here - -error[SyntaxError]: expected `,` but instead found `out` - ┌─ basic.ts:57:38 - │ -57 │ declare class StateNode { - │ ^^^ unexpected - -error[SyntaxError]: expected `,` but instead found `TEvent` - ┌─ basic.ts:57:42 - │ -57 │ declare class StateNode { - │ ^^^^^^ unexpected - - -``` - From c3d5352927e06d876091cec200f3a3979d7724e2 Mon Sep 17 00:00:00 2001 From: nissy-dev Date: Wed, 1 Mar 2023 23:55:01 +0900 Subject: [PATCH 16/22] feat: update parse logic --- .../src/syntax/typescript/types.rs | 81 +- .../err/ts_instantiation_expressions_1.rast | 40 +- .../inline/err/type_parameter_modifier.rast | 1075 ++++---- .../inline/err/type_parameter_modifier.ts | 16 +- .../inline/err/type_parameter_modifier1.rast | 2408 +++++++++++------ .../inline/ok/ts_conditional_type.rast | 60 +- .../ok/ts_instantiation_expressions.rast | 20 +- .../inline/ok/ts_satisfies_assignment.rast | 10 +- .../test_data/inline/ok/ts_typeof_type.rast | 10 +- .../inline/ok/type_parameter_modifier.rast | 1021 ++++--- .../inline/ok/type_parameter_modifier.ts | 18 +- 11 files changed, 2884 insertions(+), 1875 deletions(-) diff --git a/crates/rome_js_parser/src/syntax/typescript/types.rs b/crates/rome_js_parser/src/syntax/typescript/types.rs index 241d55628de..277fc678570 100644 --- a/crates/rome_js_parser/src/syntax/typescript/types.rs +++ b/crates/rome_js_parser/src/syntax/typescript/types.rs @@ -236,14 +236,14 @@ impl ParseSeparatedList for TsTypeParameterList { // let x: { y(): any }; // test_err ts type_parameter_modifier -// type Foo = T -// type Foo = T -// type Foo = T -// type Foo = T -// type Foo = T -// type Foo = T -// type Foo = T -// type Foo = T +// type Foo = {} +// type Foo = {} +// type Foo = {} +// type Foo = {} +// type Foo = {} +// type Foo = {} +// type Foo = {} +// type Foo = {} // function foo() {} // function foo() {} @@ -257,15 +257,15 @@ impl ParseSeparatedList for TsTypeParameterList { // ; // test ts type_parameter_modifier -// type Foo = T -// type Foo = out -// type Foo = T -// type Foo = T -// type Foo = T -// type Foo = T -// type Foo = [X, Y] -// type Foo = [X, Y] -// type Foo = [X, Y] +// type Foo = {} +// type Foo = {} +// type Foo = {} +// type Foo = {} +// type Foo = {} +// type Foo = {} +// type Foo = {} +// type Foo = {} +// type Foo = {} // class Foo {} // class Foo {} // export default class Foo {} @@ -283,39 +283,30 @@ fn parse_ts_type_parameter( could_use_parameter_modifier: bool, ) -> ParsedSyntax { let m = p.start(); - // parse_ts_type_parameter_modifier(p, could_use_parameter_modifier).ok(); - // try to eat `in` modifier + if could_use_parameter_modifier { + parse_ts_type_parameter_modifiers(p); + } + + let name = parse_ts_type_parameter_name(p); + parse_ts_type_constraint_clause(p, context).ok(); + parse_ts_default_type_clause(p).ok(); + + if name.is_absent() { + m.abandon(p); + Absent + } else { + Present(m.complete(p, TS_TYPE_PARAMETER)) + } +} + +fn parse_ts_type_parameter_modifiers(p: &mut JsParser) { if p.at(T![in]) { - if could_use_parameter_modifier { - p.bump(T![in]); - } else { - // TODO: I am not sure if bump here is properly, but it is good for error recover - // let err = p - // .err_builder("TypeParameterModifier `in` is not valid here") - // .primary(p.cur_range(), ""); - // p.error(err); - p.bump(T![in]); - } + p.eat(T![in]); } if p.at(T![out]) && !p.nth_at(1, T![,]) && !p.nth_at(1, T![>]) { - if could_use_parameter_modifier { - p.bump(T![out]); - } else { - // let err = p - // .err_builder("TypeParameterModifier `out` is not valid here") - // .primary(p.cur_range(), ""); - // p.error(err); - p.bump(T![out]); - } + p.eat(T![out]); } - - parse_ts_type_parameter_name(p).map(|name| { - let m = name.precede(p); - parse_ts_type_constraint_clause(p, context).ok(); - parse_ts_default_type_clause(p).ok(); - m.complete(p, TS_TYPE_PARAMETER) - }) } // test ts ts_type_constraint_clause diff --git a/crates/rome_js_parser/test_data/inline/err/ts_instantiation_expressions_1.rast b/crates/rome_js_parser/test_data/inline/err/ts_instantiation_expressions_1.rast index 4d882ea13ab..fa103f4c2c2 100644 --- a/crates/rome_js_parser/test_data/inline/err/ts_instantiation_expressions_1.rast +++ b/crates/rome_js_parser/test_data/inline/err/ts_instantiation_expressions_1.rast @@ -107,6 +107,8 @@ JsModule { l_angle_token: L_ANGLE@114..116 "<" [] [Whitespace(" ")], items: TsTypeParameterList [ TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@116..117 "f" [] [], }, @@ -123,6 +125,8 @@ JsModule { l_angle_token: L_ANGLE@117..118 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@118..119 "T" [] [], }, @@ -562,6 +566,8 @@ JsModule { l_angle_token: L_ANGLE@266..268 "<" [] [Whitespace(" ")], items: TsTypeParameterList [ TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@268..269 "f" [] [], }, @@ -578,6 +584,8 @@ JsModule { l_angle_token: L_ANGLE@269..270 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@270..271 "T" [] [], }, @@ -891,10 +899,12 @@ JsModule { 0: L_ANGLE@114..116 "<" [] [Whitespace(" ")] 1: TS_TYPE_PARAMETER_LIST@116..117 0: TS_TYPE_PARAMETER@116..117 - 0: TS_TYPE_PARAMETER_NAME@116..117 - 0: IDENT@116..117 "f" [] [] + 0: (empty) 1: (empty) - 2: (empty) + 2: TS_TYPE_PARAMETER_NAME@116..117 + 0: IDENT@116..117 "f" [] [] + 3: (empty) + 4: (empty) 2: (empty) 1: (empty) 2: (empty) @@ -903,10 +913,12 @@ JsModule { 0: L_ANGLE@117..118 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@118..119 0: TS_TYPE_PARAMETER@118..119 - 0: TS_TYPE_PARAMETER_NAME@118..119 - 0: IDENT@118..119 "T" [] [] + 0: (empty) 1: (empty) - 2: (empty) + 2: TS_TYPE_PARAMETER_NAME@118..119 + 0: IDENT@118..119 "T" [] [] + 3: (empty) + 4: (empty) 2: R_ANGLE@119..120 ">" [] [] 1: (empty) 2: (empty) @@ -1184,10 +1196,12 @@ JsModule { 0: L_ANGLE@266..268 "<" [] [Whitespace(" ")] 1: TS_TYPE_PARAMETER_LIST@268..269 0: TS_TYPE_PARAMETER@268..269 - 0: TS_TYPE_PARAMETER_NAME@268..269 - 0: IDENT@268..269 "f" [] [] + 0: (empty) 1: (empty) - 2: (empty) + 2: TS_TYPE_PARAMETER_NAME@268..269 + 0: IDENT@268..269 "f" [] [] + 3: (empty) + 4: (empty) 2: (empty) 1: (empty) 2: (empty) @@ -1196,10 +1210,12 @@ JsModule { 0: L_ANGLE@269..270 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@270..271 0: TS_TYPE_PARAMETER@270..271 - 0: TS_TYPE_PARAMETER_NAME@270..271 - 0: IDENT@270..271 "T" [] [] + 0: (empty) 1: (empty) - 2: (empty) + 2: TS_TYPE_PARAMETER_NAME@270..271 + 0: IDENT@270..271 "T" [] [] + 3: (empty) + 4: (empty) 2: R_ANGLE@271..272 ">" [] [] 1: (empty) 2: (empty) diff --git a/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.rast b/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.rast index c3527c825ad..62bc824973e 100644 --- a/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.rast +++ b/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.rast @@ -2,16 +2,16 @@ JsModule { interpreter_token: missing (optional), directives: JsDirectiveList [], items: JsModuleItemList [ - JsUnknownStatement { + JsBogusStatement { items: [ TYPE_KW@0..5 "type" [] [Whitespace(" ")], TsIdentifierBinding { name_token: IDENT@5..8 "Foo" [] [], }, - JsUnknown { + JsBogus { items: [ L_ANGLE@8..9 "<" [] [], - JsUnknown { + JsBogus { items: [ TsTypeParameter { in_modifier_token: missing (optional), @@ -22,7 +22,7 @@ JsModule { constraint: missing (optional), default: missing (optional), }, - JsUnknown { + TsBogusType { items: [ ERROR_TOKEN@10..11 "\\" [] [], ], @@ -51,44 +51,43 @@ JsModule { ], }, EQ@21..23 "=" [] [Whitespace(" ")], - TsReferenceType { - name: JsReferenceIdentifier { - value_token: IDENT@23..24 "T" [] [], - }, - type_arguments: missing (optional), + TsObjectType { + l_curly_token: L_CURLY@23..24 "{" [] [], + members: TsTypeMemberList [], + r_curly_token: R_CURLY@24..25 "}" [] [], }, ], }, - JsUnknownStatement { + JsBogusStatement { items: [ - TYPE_KW@24..30 "type" [Newline("\n")] [Whitespace(" ")], + TYPE_KW@25..31 "type" [Newline("\n")] [Whitespace(" ")], TsIdentifierBinding { - name_token: IDENT@30..33 "Foo" [] [], + name_token: IDENT@31..34 "Foo" [] [], }, - JsUnknown { + JsBogus { items: [ - L_ANGLE@33..34 "<" [] [], - JsUnknown { + L_ANGLE@34..35 "<" [] [], + JsBogus { items: [ TsTypeParameter { in_modifier_token: missing (optional), out_modifier_token: missing (optional), name: TsTypeParameterName { - ident_token: IDENT@34..36 "ou" [] [], + ident_token: IDENT@35..37 "ou" [] [], }, constraint: missing (optional), default: missing (optional), }, - JsUnknown { + TsBogusType { items: [ - ERROR_TOKEN@36..37 "\\" [] [], + ERROR_TOKEN@37..38 "\\" [] [], ], }, TsTypeParameter { in_modifier_token: missing (optional), out_modifier_token: missing (optional), name: TsTypeParameterName { - ident_token: IDENT@37..44 "\\u0074" [] [Whitespace(" ")], + ident_token: IDENT@38..45 "\\u0074" [] [Whitespace(" ")], }, constraint: missing (optional), default: missing (optional), @@ -97,143 +96,139 @@ JsModule { in_modifier_token: missing (optional), out_modifier_token: missing (optional), name: TsTypeParameterName { - ident_token: IDENT@44..45 "T" [] [], + ident_token: IDENT@45..46 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], }, - R_ANGLE@45..47 ">" [] [Whitespace(" ")], + R_ANGLE@46..48 ">" [] [Whitespace(" ")], ], }, - EQ@47..49 "=" [] [Whitespace(" ")], - TsReferenceType { - name: JsReferenceIdentifier { - value_token: IDENT@49..50 "T" [] [], - }, - type_arguments: missing (optional), + EQ@48..50 "=" [] [Whitespace(" ")], + TsObjectType { + l_curly_token: L_CURLY@50..51 "{" [] [], + members: TsTypeMemberList [], + r_curly_token: R_CURLY@51..52 "}" [] [], }, ], }, - JsUnknownStatement { + JsBogusStatement { items: [ - TYPE_KW@50..56 "type" [Newline("\n")] [Whitespace(" ")], + TYPE_KW@52..58 "type" [Newline("\n")] [Whitespace(" ")], TsIdentifierBinding { - name_token: IDENT@56..59 "Foo" [] [], + name_token: IDENT@58..61 "Foo" [] [], }, - JsUnknown { + JsBogus { items: [ - L_ANGLE@59..60 "<" [] [], - JsUnknown { + L_ANGLE@61..62 "<" [] [], + JsBogus { items: [ - IN_KW@60..63 "in" [] [Whitespace(" ")], - JsUnknown { + IN_KW@62..65 "in" [] [Whitespace(" ")], + TsBogusType { items: [ - IN_KW@63..65 "in" [] [], + IN_KW@65..67 "in" [] [], ], }, ], }, - R_ANGLE@65..67 ">" [] [Whitespace(" ")], + R_ANGLE@67..69 ">" [] [Whitespace(" ")], ], }, - EQ@67..69 "=" [] [Whitespace(" ")], - TsReferenceType { - name: JsReferenceIdentifier { - value_token: IDENT@69..70 "T" [] [], - }, - type_arguments: missing (optional), + EQ@69..71 "=" [] [Whitespace(" ")], + TsObjectType { + l_curly_token: L_CURLY@71..72 "{" [] [], + members: TsTypeMemberList [], + r_curly_token: R_CURLY@72..73 "}" [] [], }, ], }, - JsUnknownStatement { + JsBogusStatement { items: [ - TYPE_KW@70..76 "type" [Newline("\n")] [Whitespace(" ")], + TYPE_KW@73..79 "type" [Newline("\n")] [Whitespace(" ")], TsIdentifierBinding { - name_token: IDENT@76..79 "Foo" [] [], + name_token: IDENT@79..82 "Foo" [] [], }, - JsUnknown { + JsBogus { items: [ - L_ANGLE@79..80 "<" [] [], - JsUnknown { + L_ANGLE@82..83 "<" [] [], + JsBogus { items: [ - OUT_KW@80..84 "out" [] [Whitespace(" ")], - JsUnknown { + OUT_KW@83..87 "out" [] [Whitespace(" ")], + TsBogusType { items: [ - IN_KW@84..86 "in" [] [], + IN_KW@87..89 "in" [] [], ], }, ], }, - R_ANGLE@86..88 ">" [] [Whitespace(" ")], + R_ANGLE@89..91 ">" [] [Whitespace(" ")], ], }, - EQ@88..90 "=" [] [Whitespace(" ")], - TsReferenceType { - name: JsReferenceIdentifier { - value_token: IDENT@90..91 "T" [] [], - }, - type_arguments: missing (optional), + EQ@91..93 "=" [] [Whitespace(" ")], + TsObjectType { + l_curly_token: L_CURLY@93..94 "{" [] [], + members: TsTypeMemberList [], + r_curly_token: R_CURLY@94..95 "}" [] [], }, ], }, - JsUnknownStatement { + JsBogusStatement { items: [ - TYPE_KW@91..97 "type" [Newline("\n")] [Whitespace(" ")], + TYPE_KW@95..101 "type" [Newline("\n")] [Whitespace(" ")], TsIdentifierBinding { - name_token: IDENT@97..100 "Foo" [] [], + name_token: IDENT@101..104 "Foo" [] [], }, - JsUnknown { + JsBogus { items: [ - L_ANGLE@100..101 "<" [] [], - JsUnknown { + L_ANGLE@104..105 "<" [] [], + JsBogus { items: [ - OUT_KW@101..105 "out" [] [Whitespace(" ")], - JsUnknown { + OUT_KW@105..109 "out" [] [Whitespace(" ")], + TsBogusType { items: [ - IN_KW@105..108 "in" [] [Whitespace(" ")], + IN_KW@109..112 "in" [] [Whitespace(" ")], ], }, TsTypeParameter { in_modifier_token: missing (optional), out_modifier_token: missing (optional), name: TsTypeParameterName { - ident_token: IDENT@108..109 "T" [] [], + ident_token: IDENT@112..113 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], }, - R_ANGLE@109..111 ">" [] [Whitespace(" ")], + R_ANGLE@113..115 ">" [] [Whitespace(" ")], ], }, - EQ@111..113 "=" [] [Whitespace(" ")], - TsReferenceType { - name: JsReferenceIdentifier { - value_token: IDENT@113..114 "T" [] [], - }, - type_arguments: missing (optional), + EQ@115..117 "=" [] [Whitespace(" ")], + TsObjectType { + l_curly_token: L_CURLY@117..118 "{" [] [], + members: TsTypeMemberList [], + r_curly_token: R_CURLY@118..119 "}" [] [], }, ], }, - JsUnknownStatement { + JsBogusStatement { items: [ - TYPE_KW@114..120 "type" [Newline("\n")] [Whitespace(" ")], + TYPE_KW@119..125 "type" [Newline("\n")] [Whitespace(" ")], TsIdentifierBinding { - name_token: IDENT@120..123 "Foo" [] [], + name_token: IDENT@125..128 "Foo" [] [], }, - JsUnknown { + JsBogus { items: [ - L_ANGLE@123..124 "<" [] [], - JsUnknown { + L_ANGLE@128..129 "<" [] [], + JsBogus { items: [ - JsUnknown { + JsBogus { items: [ - JsUnknown { + JsBogus { items: [ - IDENT@124..131 "public" [] [Whitespace(" ")], + IDENT@129..136 "public" [] [Whitespace(" ")], ], }, ], @@ -242,79 +237,77 @@ JsModule { in_modifier_token: missing (optional), out_modifier_token: missing (optional), name: TsTypeParameterName { - ident_token: IDENT@131..132 "T" [] [], + ident_token: IDENT@136..137 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], }, - R_ANGLE@132..134 ">" [] [Whitespace(" ")], + R_ANGLE@137..139 ">" [] [Whitespace(" ")], ], }, - EQ@134..136 "=" [] [Whitespace(" ")], - TsReferenceType { - name: JsReferenceIdentifier { - value_token: IDENT@136..137 "T" [] [], - }, - type_arguments: missing (optional), + EQ@139..141 "=" [] [Whitespace(" ")], + TsObjectType { + l_curly_token: L_CURLY@141..142 "{" [] [], + members: TsTypeMemberList [], + r_curly_token: R_CURLY@142..143 "}" [] [], }, ], }, - JsUnknownStatement { + JsBogusStatement { items: [ - TYPE_KW@137..143 "type" [Newline("\n")] [Whitespace(" ")], + TYPE_KW@143..149 "type" [Newline("\n")] [Whitespace(" ")], TsIdentifierBinding { - name_token: IDENT@143..146 "Foo" [] [], + name_token: IDENT@149..152 "Foo" [] [], }, - JsUnknown { + JsBogus { items: [ - L_ANGLE@146..147 "<" [] [], - JsUnknown { + L_ANGLE@152..153 "<" [] [], + JsBogus { items: [ - IN_KW@147..150 "in" [] [Whitespace(" ")], - OUT_KW@150..154 "out" [] [Whitespace(" ")], - JsUnknown { + IN_KW@153..156 "in" [] [Whitespace(" ")], + OUT_KW@156..160 "out" [] [Whitespace(" ")], + TsBogusType { items: [ - IN_KW@154..157 "in" [] [Whitespace(" ")], + IN_KW@160..163 "in" [] [Whitespace(" ")], ], }, TsTypeParameter { in_modifier_token: missing (optional), out_modifier_token: missing (optional), name: TsTypeParameterName { - ident_token: IDENT@157..158 "T" [] [], + ident_token: IDENT@163..164 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], }, - R_ANGLE@158..160 ">" [] [Whitespace(" ")], + R_ANGLE@164..166 ">" [] [Whitespace(" ")], ], }, - EQ@160..162 "=" [] [Whitespace(" ")], - TsReferenceType { - name: JsReferenceIdentifier { - value_token: IDENT@162..163 "T" [] [], - }, - type_arguments: missing (optional), + EQ@166..168 "=" [] [Whitespace(" ")], + TsObjectType { + l_curly_token: L_CURLY@168..169 "{" [] [], + members: TsTypeMemberList [], + r_curly_token: R_CURLY@169..170 "}" [] [], }, ], }, TsTypeAliasDeclaration { - type_token: TYPE_KW@163..169 "type" [Newline("\n")] [Whitespace(" ")], + type_token: TYPE_KW@170..176 "type" [Newline("\n")] [Whitespace(" ")], binding_identifier: TsIdentifierBinding { - name_token: IDENT@169..172 "Foo" [] [], + name_token: IDENT@176..179 "Foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@172..173 "<" [] [], + l_angle_token: L_ANGLE@179..180 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - in_modifier_token: IN_KW@173..176 "in" [] [Whitespace(" ")], - out_modifier_token: OUT_KW@176..180 "out" [] [Whitespace(" ")], + in_modifier_token: IN_KW@180..183 "in" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@183..187 "out" [] [Whitespace(" ")], name: TsTypeParameterName { - ident_token: IDENT@180..184 "out" [] [Whitespace(" ")], + ident_token: IDENT@187..191 "out" [] [Whitespace(" ")], }, constraint: missing (optional), default: missing (optional), @@ -324,108 +317,125 @@ JsModule { in_modifier_token: missing (optional), out_modifier_token: missing (optional), name: TsTypeParameterName { - ident_token: IDENT@184..185 "T" [] [], + ident_token: IDENT@191..192 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@185..187 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@192..194 ">" [] [Whitespace(" ")], }, - eq_token: EQ@187..189 "=" [] [Whitespace(" ")], - ty: TsReferenceType { - name: JsReferenceIdentifier { - value_token: IDENT@189..190 "T" [] [], - }, - type_arguments: missing (optional), + eq_token: EQ@194..196 "=" [] [Whitespace(" ")], + ty: TsObjectType { + l_curly_token: L_CURLY@196..197 "{" [] [], + members: TsTypeMemberList [], + r_curly_token: R_CURLY@197..198 "}" [] [], }, semicolon_token: missing (optional), }, + JsBogusStatement { + items: [ + FUNCTION_KW@198..208 "function" [Newline("\n")] [Whitespace(" ")], + JsIdentifierBinding { + name_token: IDENT@208..211 "foo" [] [], + }, + JsBogus { + items: [ + L_ANGLE@211..212 "<" [] [], + JsBogus { + items: [ + TsBogusType { + items: [ + IN_KW@212..215 "in" [] [Whitespace(" ")], + ], + }, + TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@215..216 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + }, + R_ANGLE@216..217 ">" [] [], + ], + }, + JsParameters { + l_paren_token: L_PAREN@217..218 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@218..220 ")" [] [Whitespace(" ")], + }, + JsFunctionBody { + l_curly_token: L_CURLY@220..221 "{" [] [], + directives: JsDirectiveList [], + statements: JsStatementList [], + r_curly_token: R_CURLY@221..222 "}" [] [], + }, + ], + }, JsFunctionDeclaration { async_token: missing (optional), - function_token: FUNCTION_KW@190..200 "function" [Newline("\n")] [Whitespace(" ")], + function_token: FUNCTION_KW@222..232 "function" [Newline("\n")] [Whitespace(" ")], star_token: missing (optional), id: JsIdentifierBinding { - name_token: IDENT@200..203 "foo" [] [], + name_token: IDENT@232..235 "foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@203..204 "<" [] [], + l_angle_token: L_ANGLE@235..236 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - in_modifier_token: IN_KW@204..207 "in" [] [Whitespace(" ")], + in_modifier_token: missing (optional), out_modifier_token: missing (optional), name: TsTypeParameterName { - ident_token: IDENT@207..208 "T" [] [], + ident_token: IDENT@236..240 "out" [] [Whitespace(" ")], }, constraint: missing (optional), default: missing (optional), }, - ], - r_angle_token: R_ANGLE@208..209 ">" [] [], - }, - parameters: JsParameters { - l_paren_token: L_PAREN@209..210 "(" [] [], - items: JsParameterList [], - r_paren_token: R_PAREN@210..212 ")" [] [Whitespace(" ")], - }, - return_type_annotation: missing (optional), - body: JsFunctionBody { - l_curly_token: L_CURLY@212..213 "{" [] [], - directives: JsDirectiveList [], - statements: JsStatementList [], - r_curly_token: R_CURLY@213..214 "}" [] [], - }, - }, - JsFunctionDeclaration { - async_token: missing (optional), - function_token: FUNCTION_KW@214..224 "function" [Newline("\n")] [Whitespace(" ")], - star_token: missing (optional), - id: JsIdentifierBinding { - name_token: IDENT@224..227 "foo" [] [], - }, - type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@227..228 "<" [] [], - items: TsTypeParameterList [ + missing separator, TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: OUT_KW@228..232 "out" [] [Whitespace(" ")], + out_modifier_token: missing (optional), name: TsTypeParameterName { - ident_token: IDENT@232..233 "T" [] [], + ident_token: IDENT@240..241 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@233..234 ">" [] [], + r_angle_token: R_ANGLE@241..242 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@234..235 "(" [] [], + l_paren_token: L_PAREN@242..243 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@235..237 ")" [] [Whitespace(" ")], + r_paren_token: R_PAREN@243..245 ")" [] [Whitespace(" ")], }, return_type_annotation: missing (optional), body: JsFunctionBody { - l_curly_token: L_CURLY@237..238 "{" [] [], + l_curly_token: L_CURLY@245..246 "{" [] [], directives: JsDirectiveList [], statements: JsStatementList [], - r_curly_token: R_CURLY@238..239 "}" [] [], + r_curly_token: R_CURLY@246..247 "}" [] [], }, }, ], - eof_token: EOF@239..240 "" [Newline("\n")] [], + eof_token: EOF@247..248 "" [Newline("\n")] [], } -0: JS_MODULE@0..240 +0: JS_MODULE@0..248 0: (empty) 1: JS_DIRECTIVE_LIST@0..0 - 2: JS_MODULE_ITEM_LIST@0..239 - 0: JS_UNKNOWN_STATEMENT@0..24 + 2: JS_MODULE_ITEM_LIST@0..247 + 0: JS_BOGUS_STATEMENT@0..25 0: TYPE_KW@0..5 "type" [] [Whitespace(" ")] 1: TS_IDENTIFIER_BINDING@5..8 0: IDENT@5..8 "Foo" [] [] - 2: JS_UNKNOWN@8..21 + 2: JS_BOGUS@8..21 0: L_ANGLE@8..9 "<" [] [] - 1: JS_UNKNOWN@9..19 + 1: JS_BOGUS@9..19 0: TS_TYPE_PARAMETER@9..10 0: (empty) 1: (empty) @@ -433,7 +443,7 @@ JsModule { 0: IDENT@9..10 "i" [] [] 3: (empty) 4: (empty) - 1: JS_UNKNOWN@10..11 + 1: TS_BOGUS_TYPE@10..11 0: ERROR_TOKEN@10..11 "\\" [] [] 2: TS_TYPE_PARAMETER@11..18 0: (empty) @@ -451,373 +461,518 @@ JsModule { 4: (empty) 2: R_ANGLE@19..21 ">" [] [Whitespace(" ")] 3: EQ@21..23 "=" [] [Whitespace(" ")] - 4: TS_REFERENCE_TYPE@23..24 - 0: JS_REFERENCE_IDENTIFIER@23..24 - 0: IDENT@23..24 "T" [] [] - 1: (empty) - 1: JS_UNKNOWN_STATEMENT@24..50 - 0: TYPE_KW@24..30 "type" [Newline("\n")] [Whitespace(" ")] - 1: TS_IDENTIFIER_BINDING@30..33 - 0: IDENT@30..33 "Foo" [] [] - 2: JS_UNKNOWN@33..47 - 0: L_ANGLE@33..34 "<" [] [] - 1: JS_UNKNOWN@34..45 - 0: TS_TYPE_PARAMETER@34..36 + 4: TS_OBJECT_TYPE@23..25 + 0: L_CURLY@23..24 "{" [] [] + 1: TS_TYPE_MEMBER_LIST@24..24 + 2: R_CURLY@24..25 "}" [] [] + 1: JS_BOGUS_STATEMENT@25..52 + 0: TYPE_KW@25..31 "type" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@31..34 + 0: IDENT@31..34 "Foo" [] [] + 2: JS_BOGUS@34..48 + 0: L_ANGLE@34..35 "<" [] [] + 1: JS_BOGUS@35..46 + 0: TS_TYPE_PARAMETER@35..37 0: (empty) 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@34..36 - 0: IDENT@34..36 "ou" [] [] + 2: TS_TYPE_PARAMETER_NAME@35..37 + 0: IDENT@35..37 "ou" [] [] 3: (empty) 4: (empty) - 1: JS_UNKNOWN@36..37 - 0: ERROR_TOKEN@36..37 "\\" [] [] - 2: TS_TYPE_PARAMETER@37..44 + 1: TS_BOGUS_TYPE@37..38 + 0: ERROR_TOKEN@37..38 "\\" [] [] + 2: TS_TYPE_PARAMETER@38..45 0: (empty) 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@37..44 - 0: IDENT@37..44 "\\u0074" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@38..45 + 0: IDENT@38..45 "\\u0074" [] [Whitespace(" ")] 3: (empty) 4: (empty) - 3: TS_TYPE_PARAMETER@44..45 + 3: TS_TYPE_PARAMETER@45..46 0: (empty) 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@44..45 - 0: IDENT@44..45 "T" [] [] + 2: TS_TYPE_PARAMETER_NAME@45..46 + 0: IDENT@45..46 "T" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@45..47 ">" [] [Whitespace(" ")] - 3: EQ@47..49 "=" [] [Whitespace(" ")] - 4: TS_REFERENCE_TYPE@49..50 - 0: JS_REFERENCE_IDENTIFIER@49..50 - 0: IDENT@49..50 "T" [] [] - 1: (empty) - 2: JS_UNKNOWN_STATEMENT@50..70 - 0: TYPE_KW@50..56 "type" [Newline("\n")] [Whitespace(" ")] - 1: TS_IDENTIFIER_BINDING@56..59 - 0: IDENT@56..59 "Foo" [] [] - 2: JS_UNKNOWN@59..67 - 0: L_ANGLE@59..60 "<" [] [] - 1: JS_UNKNOWN@60..65 - 0: IN_KW@60..63 "in" [] [Whitespace(" ")] - 1: JS_UNKNOWN@63..65 - 0: IN_KW@63..65 "in" [] [] - 2: R_ANGLE@65..67 ">" [] [Whitespace(" ")] - 3: EQ@67..69 "=" [] [Whitespace(" ")] - 4: TS_REFERENCE_TYPE@69..70 - 0: JS_REFERENCE_IDENTIFIER@69..70 - 0: IDENT@69..70 "T" [] [] - 1: (empty) - 3: JS_UNKNOWN_STATEMENT@70..91 - 0: TYPE_KW@70..76 "type" [Newline("\n")] [Whitespace(" ")] - 1: TS_IDENTIFIER_BINDING@76..79 - 0: IDENT@76..79 "Foo" [] [] - 2: JS_UNKNOWN@79..88 - 0: L_ANGLE@79..80 "<" [] [] - 1: JS_UNKNOWN@80..86 - 0: OUT_KW@80..84 "out" [] [Whitespace(" ")] - 1: JS_UNKNOWN@84..86 - 0: IN_KW@84..86 "in" [] [] - 2: R_ANGLE@86..88 ">" [] [Whitespace(" ")] - 3: EQ@88..90 "=" [] [Whitespace(" ")] - 4: TS_REFERENCE_TYPE@90..91 - 0: JS_REFERENCE_IDENTIFIER@90..91 - 0: IDENT@90..91 "T" [] [] - 1: (empty) - 4: JS_UNKNOWN_STATEMENT@91..114 - 0: TYPE_KW@91..97 "type" [Newline("\n")] [Whitespace(" ")] - 1: TS_IDENTIFIER_BINDING@97..100 - 0: IDENT@97..100 "Foo" [] [] - 2: JS_UNKNOWN@100..111 - 0: L_ANGLE@100..101 "<" [] [] - 1: JS_UNKNOWN@101..109 - 0: OUT_KW@101..105 "out" [] [Whitespace(" ")] - 1: JS_UNKNOWN@105..108 - 0: IN_KW@105..108 "in" [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER@108..109 + 2: R_ANGLE@46..48 ">" [] [Whitespace(" ")] + 3: EQ@48..50 "=" [] [Whitespace(" ")] + 4: TS_OBJECT_TYPE@50..52 + 0: L_CURLY@50..51 "{" [] [] + 1: TS_TYPE_MEMBER_LIST@51..51 + 2: R_CURLY@51..52 "}" [] [] + 2: JS_BOGUS_STATEMENT@52..73 + 0: TYPE_KW@52..58 "type" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@58..61 + 0: IDENT@58..61 "Foo" [] [] + 2: JS_BOGUS@61..69 + 0: L_ANGLE@61..62 "<" [] [] + 1: JS_BOGUS@62..67 + 0: IN_KW@62..65 "in" [] [Whitespace(" ")] + 1: TS_BOGUS_TYPE@65..67 + 0: IN_KW@65..67 "in" [] [] + 2: R_ANGLE@67..69 ">" [] [Whitespace(" ")] + 3: EQ@69..71 "=" [] [Whitespace(" ")] + 4: TS_OBJECT_TYPE@71..73 + 0: L_CURLY@71..72 "{" [] [] + 1: TS_TYPE_MEMBER_LIST@72..72 + 2: R_CURLY@72..73 "}" [] [] + 3: JS_BOGUS_STATEMENT@73..95 + 0: TYPE_KW@73..79 "type" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@79..82 + 0: IDENT@79..82 "Foo" [] [] + 2: JS_BOGUS@82..91 + 0: L_ANGLE@82..83 "<" [] [] + 1: JS_BOGUS@83..89 + 0: OUT_KW@83..87 "out" [] [Whitespace(" ")] + 1: TS_BOGUS_TYPE@87..89 + 0: IN_KW@87..89 "in" [] [] + 2: R_ANGLE@89..91 ">" [] [Whitespace(" ")] + 3: EQ@91..93 "=" [] [Whitespace(" ")] + 4: TS_OBJECT_TYPE@93..95 + 0: L_CURLY@93..94 "{" [] [] + 1: TS_TYPE_MEMBER_LIST@94..94 + 2: R_CURLY@94..95 "}" [] [] + 4: JS_BOGUS_STATEMENT@95..119 + 0: TYPE_KW@95..101 "type" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@101..104 + 0: IDENT@101..104 "Foo" [] [] + 2: JS_BOGUS@104..115 + 0: L_ANGLE@104..105 "<" [] [] + 1: JS_BOGUS@105..113 + 0: OUT_KW@105..109 "out" [] [Whitespace(" ")] + 1: TS_BOGUS_TYPE@109..112 + 0: IN_KW@109..112 "in" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER@112..113 0: (empty) 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@108..109 - 0: IDENT@108..109 "T" [] [] + 2: TS_TYPE_PARAMETER_NAME@112..113 + 0: IDENT@112..113 "T" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@109..111 ">" [] [Whitespace(" ")] - 3: EQ@111..113 "=" [] [Whitespace(" ")] - 4: TS_REFERENCE_TYPE@113..114 - 0: JS_REFERENCE_IDENTIFIER@113..114 - 0: IDENT@113..114 "T" [] [] - 1: (empty) - 5: JS_UNKNOWN_STATEMENT@114..137 - 0: TYPE_KW@114..120 "type" [Newline("\n")] [Whitespace(" ")] - 1: TS_IDENTIFIER_BINDING@120..123 - 0: IDENT@120..123 "Foo" [] [] - 2: JS_UNKNOWN@123..134 - 0: L_ANGLE@123..124 "<" [] [] - 1: JS_UNKNOWN@124..132 - 0: JS_UNKNOWN@124..131 - 0: JS_UNKNOWN@124..131 - 0: IDENT@124..131 "public" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER@131..132 + 2: R_ANGLE@113..115 ">" [] [Whitespace(" ")] + 3: EQ@115..117 "=" [] [Whitespace(" ")] + 4: TS_OBJECT_TYPE@117..119 + 0: L_CURLY@117..118 "{" [] [] + 1: TS_TYPE_MEMBER_LIST@118..118 + 2: R_CURLY@118..119 "}" [] [] + 5: JS_BOGUS_STATEMENT@119..143 + 0: TYPE_KW@119..125 "type" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@125..128 + 0: IDENT@125..128 "Foo" [] [] + 2: JS_BOGUS@128..139 + 0: L_ANGLE@128..129 "<" [] [] + 1: JS_BOGUS@129..137 + 0: JS_BOGUS@129..136 + 0: JS_BOGUS@129..136 + 0: IDENT@129..136 "public" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER@136..137 0: (empty) 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@131..132 - 0: IDENT@131..132 "T" [] [] + 2: TS_TYPE_PARAMETER_NAME@136..137 + 0: IDENT@136..137 "T" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@132..134 ">" [] [Whitespace(" ")] - 3: EQ@134..136 "=" [] [Whitespace(" ")] - 4: TS_REFERENCE_TYPE@136..137 - 0: JS_REFERENCE_IDENTIFIER@136..137 - 0: IDENT@136..137 "T" [] [] - 1: (empty) - 6: JS_UNKNOWN_STATEMENT@137..163 - 0: TYPE_KW@137..143 "type" [Newline("\n")] [Whitespace(" ")] - 1: TS_IDENTIFIER_BINDING@143..146 - 0: IDENT@143..146 "Foo" [] [] - 2: JS_UNKNOWN@146..160 - 0: L_ANGLE@146..147 "<" [] [] - 1: JS_UNKNOWN@147..158 - 0: IN_KW@147..150 "in" [] [Whitespace(" ")] - 1: OUT_KW@150..154 "out" [] [Whitespace(" ")] - 2: JS_UNKNOWN@154..157 - 0: IN_KW@154..157 "in" [] [Whitespace(" ")] - 3: TS_TYPE_PARAMETER@157..158 + 2: R_ANGLE@137..139 ">" [] [Whitespace(" ")] + 3: EQ@139..141 "=" [] [Whitespace(" ")] + 4: TS_OBJECT_TYPE@141..143 + 0: L_CURLY@141..142 "{" [] [] + 1: TS_TYPE_MEMBER_LIST@142..142 + 2: R_CURLY@142..143 "}" [] [] + 6: JS_BOGUS_STATEMENT@143..170 + 0: TYPE_KW@143..149 "type" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@149..152 + 0: IDENT@149..152 "Foo" [] [] + 2: JS_BOGUS@152..166 + 0: L_ANGLE@152..153 "<" [] [] + 1: JS_BOGUS@153..164 + 0: IN_KW@153..156 "in" [] [Whitespace(" ")] + 1: OUT_KW@156..160 "out" [] [Whitespace(" ")] + 2: TS_BOGUS_TYPE@160..163 + 0: IN_KW@160..163 "in" [] [Whitespace(" ")] + 3: TS_TYPE_PARAMETER@163..164 0: (empty) 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@157..158 - 0: IDENT@157..158 "T" [] [] + 2: TS_TYPE_PARAMETER_NAME@163..164 + 0: IDENT@163..164 "T" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@158..160 ">" [] [Whitespace(" ")] - 3: EQ@160..162 "=" [] [Whitespace(" ")] - 4: TS_REFERENCE_TYPE@162..163 - 0: JS_REFERENCE_IDENTIFIER@162..163 - 0: IDENT@162..163 "T" [] [] - 1: (empty) - 7: TS_TYPE_ALIAS_DECLARATION@163..190 - 0: TYPE_KW@163..169 "type" [Newline("\n")] [Whitespace(" ")] - 1: TS_IDENTIFIER_BINDING@169..172 - 0: IDENT@169..172 "Foo" [] [] - 2: TS_TYPE_PARAMETERS@172..187 - 0: L_ANGLE@172..173 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@173..185 - 0: TS_TYPE_PARAMETER@173..184 - 0: IN_KW@173..176 "in" [] [Whitespace(" ")] - 1: OUT_KW@176..180 "out" [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER_NAME@180..184 - 0: IDENT@180..184 "out" [] [Whitespace(" ")] + 2: R_ANGLE@164..166 ">" [] [Whitespace(" ")] + 3: EQ@166..168 "=" [] [Whitespace(" ")] + 4: TS_OBJECT_TYPE@168..170 + 0: L_CURLY@168..169 "{" [] [] + 1: TS_TYPE_MEMBER_LIST@169..169 + 2: R_CURLY@169..170 "}" [] [] + 7: TS_TYPE_ALIAS_DECLARATION@170..198 + 0: TYPE_KW@170..176 "type" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@176..179 + 0: IDENT@176..179 "Foo" [] [] + 2: TS_TYPE_PARAMETERS@179..194 + 0: L_ANGLE@179..180 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@180..192 + 0: TS_TYPE_PARAMETER@180..191 + 0: IN_KW@180..183 "in" [] [Whitespace(" ")] + 1: OUT_KW@183..187 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@187..191 + 0: IDENT@187..191 "out" [] [Whitespace(" ")] 3: (empty) 4: (empty) 1: (empty) - 2: TS_TYPE_PARAMETER@184..185 + 2: TS_TYPE_PARAMETER@191..192 0: (empty) 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@184..185 - 0: IDENT@184..185 "T" [] [] + 2: TS_TYPE_PARAMETER_NAME@191..192 + 0: IDENT@191..192 "T" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@185..187 ">" [] [Whitespace(" ")] - 3: EQ@187..189 "=" [] [Whitespace(" ")] - 4: TS_REFERENCE_TYPE@189..190 - 0: JS_REFERENCE_IDENTIFIER@189..190 - 0: IDENT@189..190 "T" [] [] - 1: (empty) + 2: R_ANGLE@192..194 ">" [] [Whitespace(" ")] + 3: EQ@194..196 "=" [] [Whitespace(" ")] + 4: TS_OBJECT_TYPE@196..198 + 0: L_CURLY@196..197 "{" [] [] + 1: TS_TYPE_MEMBER_LIST@197..197 + 2: R_CURLY@197..198 "}" [] [] 5: (empty) - 8: JS_FUNCTION_DECLARATION@190..214 - 0: (empty) - 1: FUNCTION_KW@190..200 "function" [Newline("\n")] [Whitespace(" ")] - 2: (empty) - 3: JS_IDENTIFIER_BINDING@200..203 - 0: IDENT@200..203 "foo" [] [] - 4: TS_TYPE_PARAMETERS@203..209 - 0: L_ANGLE@203..204 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@204..208 - 0: TS_TYPE_PARAMETER@204..208 - 0: IN_KW@204..207 "in" [] [Whitespace(" ")] + 8: JS_BOGUS_STATEMENT@198..222 + 0: FUNCTION_KW@198..208 "function" [Newline("\n")] [Whitespace(" ")] + 1: JS_IDENTIFIER_BINDING@208..211 + 0: IDENT@208..211 "foo" [] [] + 2: JS_BOGUS@211..217 + 0: L_ANGLE@211..212 "<" [] [] + 1: JS_BOGUS@212..216 + 0: TS_BOGUS_TYPE@212..215 + 0: IN_KW@212..215 "in" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER@215..216 + 0: (empty) 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@207..208 - 0: IDENT@207..208 "T" [] [] + 2: TS_TYPE_PARAMETER_NAME@215..216 + 0: IDENT@215..216 "T" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@208..209 ">" [] [] - 5: JS_PARAMETERS@209..212 - 0: L_PAREN@209..210 "(" [] [] - 1: JS_PARAMETER_LIST@210..210 - 2: R_PAREN@210..212 ")" [] [Whitespace(" ")] - 6: (empty) - 7: JS_FUNCTION_BODY@212..214 - 0: L_CURLY@212..213 "{" [] [] - 1: JS_DIRECTIVE_LIST@213..213 - 2: JS_STATEMENT_LIST@213..213 - 3: R_CURLY@213..214 "}" [] [] - 9: JS_FUNCTION_DECLARATION@214..239 + 2: R_ANGLE@216..217 ">" [] [] + 3: JS_PARAMETERS@217..220 + 0: L_PAREN@217..218 "(" [] [] + 1: JS_PARAMETER_LIST@218..218 + 2: R_PAREN@218..220 ")" [] [Whitespace(" ")] + 4: JS_FUNCTION_BODY@220..222 + 0: L_CURLY@220..221 "{" [] [] + 1: JS_DIRECTIVE_LIST@221..221 + 2: JS_STATEMENT_LIST@221..221 + 3: R_CURLY@221..222 "}" [] [] + 9: JS_FUNCTION_DECLARATION@222..247 0: (empty) - 1: FUNCTION_KW@214..224 "function" [Newline("\n")] [Whitespace(" ")] + 1: FUNCTION_KW@222..232 "function" [Newline("\n")] [Whitespace(" ")] 2: (empty) - 3: JS_IDENTIFIER_BINDING@224..227 - 0: IDENT@224..227 "foo" [] [] - 4: TS_TYPE_PARAMETERS@227..234 - 0: L_ANGLE@227..228 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@228..233 - 0: TS_TYPE_PARAMETER@228..233 + 3: JS_IDENTIFIER_BINDING@232..235 + 0: IDENT@232..235 "foo" [] [] + 4: TS_TYPE_PARAMETERS@235..242 + 0: L_ANGLE@235..236 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@236..241 + 0: TS_TYPE_PARAMETER@236..240 0: (empty) - 1: OUT_KW@228..232 "out" [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER_NAME@232..233 - 0: IDENT@232..233 "T" [] [] + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@236..240 + 0: IDENT@236..240 "out" [] [Whitespace(" ")] + 3: (empty) + 4: (empty) + 1: (empty) + 2: TS_TYPE_PARAMETER@240..241 + 0: (empty) + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@240..241 + 0: IDENT@240..241 "T" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@233..234 ">" [] [] - 5: JS_PARAMETERS@234..237 - 0: L_PAREN@234..235 "(" [] [] - 1: JS_PARAMETER_LIST@235..235 - 2: R_PAREN@235..237 ")" [] [Whitespace(" ")] + 2: R_ANGLE@241..242 ">" [] [] + 5: JS_PARAMETERS@242..245 + 0: L_PAREN@242..243 "(" [] [] + 1: JS_PARAMETER_LIST@243..243 + 2: R_PAREN@243..245 ")" [] [Whitespace(" ")] 6: (empty) - 7: JS_FUNCTION_BODY@237..239 - 0: L_CURLY@237..238 "{" [] [] - 1: JS_DIRECTIVE_LIST@238..238 - 2: JS_STATEMENT_LIST@238..238 - 3: R_CURLY@238..239 "}" [] [] - 3: EOF@239..240 "" [Newline("\n")] [] --- -error[SyntaxError]: expected `,` but instead found `\` - ┌─ type_parameter_modifier.ts:1:11 - │ -1 │ type Foo = T - │ ^ unexpected - + 7: JS_FUNCTION_BODY@245..247 + 0: L_CURLY@245..246 "{" [] [] + 1: JS_DIRECTIVE_LIST@246..246 + 2: JS_STATEMENT_LIST@246..246 + 3: R_CURLY@246..247 "}" [] [] + 3: EOF@247..248 "" [Newline("\n")] [] -- -error[SyntaxError]: expected `,` but instead found `\u006E` - ┌─ type_parameter_modifier.ts:1:12 - │ -1 │ type Foo = T - │ ^^^^^^ unexpected +type_parameter_modifier.ts:1:11 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × unexpected token `\` + + > 1 │ type Foo = {} + │ ^ + 2 │ type Foo = {} + 3 │ type Foo = {} + -- -error[SyntaxError]: expected `,` but instead found `T` - ┌─ type_parameter_modifier.ts:1:19 - │ -1 │ type Foo = T - │ ^ unexpected +type_parameter_modifier.ts:1:12 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected `,` but instead found `\u006E` + + > 1 │ type Foo = {} + │ ^^^^^^ + 2 │ type Foo = {} + 3 │ type Foo = {} + + i Remove \u006E + -- -error[SyntaxError]: expected `,` but instead found `\` - ┌─ type_parameter_modifier.ts:2:12 - │ -2 │ type Foo = T - │ ^ unexpected +type_parameter_modifier.ts:1:19 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected `,` but instead found `T` + + > 1 │ type Foo = {} + │ ^ + 2 │ type Foo = {} + 3 │ type Foo = {} + + i Remove T + -- -error[SyntaxError]: expected `,` but instead found `\u0074` - ┌─ type_parameter_modifier.ts:2:13 - │ -2 │ type Foo = T - │ ^^^^^^ unexpected +type_parameter_modifier.ts:2:12 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × unexpected token `\` + + 1 │ type Foo = {} + > 2 │ type Foo = {} + │ ^ + 3 │ type Foo = {} + 4 │ type Foo = {} + -- -error[SyntaxError]: expected `,` but instead found `T` - ┌─ type_parameter_modifier.ts:2:20 - │ -2 │ type Foo = T - │ ^ unexpected +type_parameter_modifier.ts:2:13 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected `,` but instead found `\u0074` + + 1 │ type Foo = {} + > 2 │ type Foo = {} + │ ^^^^^^ + 3 │ type Foo = {} + 4 │ type Foo = {} + + i Remove \u0074 + -- -error[SyntaxError]: expected a type parameter but instead found 'in' - ┌─ type_parameter_modifier.ts:3:13 - │ -3 │ type Foo = T - │ ^^ Expected a type parameter here +type_parameter_modifier.ts:2:20 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected `,` but instead found `T` + + 1 │ type Foo = {} + > 2 │ type Foo = {} + │ ^ + 3 │ type Foo = {} + 4 │ type Foo = {} + + i Remove T + -- -error[SyntaxError]: expected a type parameter but instead found 'in' - ┌─ type_parameter_modifier.ts:4:14 - │ -4 │ type Foo = T - │ ^^ Expected a type parameter here +type_parameter_modifier.ts:3:13 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected a type parameter but instead found 'in' + + 1 │ type Foo = {} + 2 │ type Foo = {} + > 3 │ type Foo = {} + │ ^^ + 4 │ type Foo = {} + 5 │ type Foo = {} + + i Expected a type parameter here + + 1 │ type Foo = {} + 2 │ type Foo = {} + > 3 │ type Foo = {} + │ ^^ + 4 │ type Foo = {} + 5 │ type Foo = {} + -- -error[SyntaxError]: expected a type parameter but instead found 'in' - ┌─ type_parameter_modifier.ts:5:14 - │ -5 │ type Foo = T - │ ^^ Expected a type parameter here +type_parameter_modifier.ts:4:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected a type parameter but instead found 'in' + + 2 │ type Foo = {} + 3 │ type Foo = {} + > 4 │ type Foo = {} + │ ^^ + 5 │ type Foo = {} + 6 │ type Foo = {} + + i Expected a type parameter here + + 2 │ type Foo = {} + 3 │ type Foo = {} + > 4 │ type Foo = {} + │ ^^ + 5 │ type Foo = {} + 6 │ type Foo = {} + -- -error[SyntaxError]: expected `,` but instead found `T` - ┌─ type_parameter_modifier.ts:5:17 - │ -5 │ type Foo = T - │ ^ unexpected +type_parameter_modifier.ts:5:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected a type parameter but instead found 'in' + + 3 │ type Foo = {} + 4 │ type Foo = {} + > 5 │ type Foo = {} + │ ^^ + 6 │ type Foo = {} + 7 │ type Foo = {} + + i Expected a type parameter here + + 3 │ type Foo = {} + 4 │ type Foo = {} + > 5 │ type Foo = {} + │ ^^ + 6 │ type Foo = {} + 7 │ type Foo = {} + -- -error[SyntaxError]: Illegal use of reserved keyword `public` as an identifier in strict mode - ┌─ type_parameter_modifier.ts:6:10 - │ -6 │ type Foo = T - │ ^^^^^^ +type_parameter_modifier.ts:5:17 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected `,` but instead found `T` + + 3 │ type Foo = {} + 4 │ type Foo = {} + > 5 │ type Foo = {} + │ ^ + 6 │ type Foo = {} + 7 │ type Foo = {} + + i Remove T + -- -error[SyntaxError]: expected `,` but instead found `T` - ┌─ type_parameter_modifier.ts:6:17 - │ -6 │ type Foo = T - │ ^ unexpected +type_parameter_modifier.ts:6:10 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × Illegal use of reserved keyword `public` as an identifier in strict mode + + 4 │ type Foo = {} + 5 │ type Foo = {} + > 6 │ type Foo = {} + │ ^^^^^^ + 7 │ type Foo = {} + 8 │ type Foo = {} + -- -error[SyntaxError]: expected a type parameter but instead found 'in' - ┌─ type_parameter_modifier.ts:7:17 - │ -7 │ type Foo = T - │ ^^ Expected a type parameter here +type_parameter_modifier.ts:6:17 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected `,` but instead found `T` + + 4 │ type Foo = {} + 5 │ type Foo = {} + > 6 │ type Foo = {} + │ ^ + 7 │ type Foo = {} + 8 │ type Foo = {} + + i Remove T + -- -error[SyntaxError]: expected `,` but instead found `T` - ┌─ type_parameter_modifier.ts:7:20 - │ -7 │ type Foo = T - │ ^ unexpected +type_parameter_modifier.ts:7:17 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected a type parameter but instead found 'in' + + 5 │ type Foo = {} + 6 │ type Foo = {} + > 7 │ type Foo = {} + │ ^^ + 8 │ type Foo = {} + 9 │ function foo() {} + + i Expected a type parameter here + + 5 │ type Foo = {} + 6 │ type Foo = {} + > 7 │ type Foo = {} + │ ^^ + 8 │ type Foo = {} + 9 │ function foo() {} + -- -error[SyntaxError]: expected `,` but instead found `T` - ┌─ type_parameter_modifier.ts:8:21 - │ -8 │ type Foo = T - │ ^ unexpected +type_parameter_modifier.ts:7:20 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected `,` but instead found `T` + + 5 │ type Foo = {} + 6 │ type Foo = {} + > 7 │ type Foo = {} + │ ^ + 8 │ type Foo = {} + 9 │ function foo() {} + + i Remove T + -- -error[SyntaxError]: TypeParameterModifier `in` is not valid here - ┌─ type_parameter_modifier.ts:9:14 - │ -9 │ function foo() {} - │ ^^ +type_parameter_modifier.ts:8:21 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected `,` but instead found `T` + + 6 │ type Foo = {} + 7 │ type Foo = {} + > 8 │ type Foo = {} + │ ^ + 9 │ function foo() {} + 10 │ function foo() {} + + i Remove T + -- -error[SyntaxError]: TypeParameterModifier `out` is not valid here - ┌─ type_parameter_modifier.ts:10:14 - │ -10 │ function foo() {} - │ ^^^ +type_parameter_modifier.ts:9:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected a type parameter but instead found 'in' + + 7 │ type Foo = {} + 8 │ type Foo = {} + > 9 │ function foo() {} + │ ^^ + 10 │ function foo() {} + 11 │ + + i Expected a type parameter here + + 7 │ type Foo = {} + 8 │ type Foo = {} + > 9 │ function foo() {} + │ ^^ + 10 │ function foo() {} + 11 │ + -- -error: unexpected token `\` - ┌─ type_parameter_modifier.ts:1:11 - │ -1 │ type Foo = T - │ ^ +type_parameter_modifier.ts:9:17 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected `,` but instead found `T` + + 7 │ type Foo = {} + 8 │ type Foo = {} + > 9 │ function foo() {} + │ ^ + 10 │ function foo() {} + 11 │ + + i Remove T + -- -error: unexpected token `\` - ┌─ type_parameter_modifier.ts:2:12 - │ -2 │ type Foo = T - │ ^ +type_parameter_modifier.ts:10:18 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected `,` but instead found `T` + + 8 │ type Foo = {} + 9 │ function foo() {} + > 10 │ function foo() {} + │ ^ + 11 │ + + i Remove T + -- -type Foo = T -type Foo = T -type Foo = T -type Foo = T -type Foo = T -type Foo = T -type Foo = T -type Foo = T +type Foo = {} +type Foo = {} +type Foo = {} +type Foo = {} +type Foo = {} +type Foo = {} +type Foo = {} +type Foo = {} function foo() {} function foo() {} diff --git a/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.ts b/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.ts index 569a018a919..79634bbe926 100644 --- a/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.ts +++ b/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.ts @@ -1,10 +1,10 @@ -type Foo = T -type Foo = T -type Foo = T -type Foo = T -type Foo = T -type Foo = T -type Foo = T -type Foo = T +type Foo = {} +type Foo = {} +type Foo = {} +type Foo = {} +type Foo = {} +type Foo = {} +type Foo = {} +type Foo = {} function foo() {} function foo() {} diff --git a/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier1.rast b/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier1.rast index 5bbc4ecfcfd..41dae42c9e8 100644 --- a/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier1.rast +++ b/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier1.rast @@ -2,47 +2,58 @@ JsModule { interpreter_token: missing (optional), directives: JsDirectiveList [], items: JsModuleItemList [ - JsExport { - export_token: EXPORT_KW@0..8 "export" [Whitespace("\t")] [Whitespace(" ")], - export_clause: JsExportDefaultDeclarationClause { - default_token: DEFAULT_KW@8..16 "default" [] [Whitespace(" ")], - declaration: JsFunctionExportDefaultDeclaration { - async_token: missing (optional), - function_token: FUNCTION_KW@16..25 "function" [] [Whitespace(" ")], - star_token: missing (optional), - id: JsIdentifierBinding { - name_token: IDENT@25..28 "foo" [] [], - }, - type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@28..29 "<" [] [], - items: TsTypeParameterList [ - TsTypeParameter { - in_modifier_token: IN_KW@29..32 "in" [] [Whitespace(" ")], - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@32..33 "T" [] [], + JsBogusStatement { + items: [ + EXPORT_KW@0..8 "export" [Whitespace("\t")] [Whitespace(" ")], + JsBogus { + items: [ + DEFAULT_KW@8..16 "default" [] [Whitespace(" ")], + JsBogus { + items: [ + FUNCTION_KW@16..25 "function" [] [Whitespace(" ")], + JsIdentifierBinding { + name_token: IDENT@25..28 "foo" [] [], }, - constraint: missing (optional), - default: missing (optional), - }, - ], - r_angle_token: R_ANGLE@33..34 ">" [] [], - }, - parameters: JsParameters { - l_paren_token: L_PAREN@34..35 "(" [] [], - items: JsParameterList [], - r_paren_token: R_PAREN@35..37 ")" [] [Whitespace(" ")], - }, - return_type_annotation: missing (optional), - body: JsFunctionBody { - l_curly_token: L_CURLY@37..38 "{" [] [], - directives: JsDirectiveList [], - statements: JsStatementList [], - r_curly_token: R_CURLY@38..39 "}" [] [], - }, + JsBogus { + items: [ + L_ANGLE@28..29 "<" [] [], + JsBogus { + items: [ + TsBogusType { + items: [ + IN_KW@29..32 "in" [] [Whitespace(" ")], + ], + }, + TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@32..33 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + }, + R_ANGLE@33..34 ">" [] [], + ], + }, + JsParameters { + l_paren_token: L_PAREN@34..35 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@35..37 ")" [] [Whitespace(" ")], + }, + JsFunctionBody { + l_curly_token: L_CURLY@37..38 "{" [] [], + directives: JsDirectiveList [], + statements: JsStatementList [], + r_curly_token: R_CURLY@38..39 "}" [] [], + }, + ], + }, + ], }, - semicolon_token: missing (optional), - }, + ], }, JsExport { export_token: EXPORT_KW@39..48 "export" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], @@ -58,7 +69,17 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: OUT_KW@61..65 "out" [] [Whitespace(" ")], + out_modifier_token: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@61..65 "out" [] [Whitespace(" ")], + }, + constraint: missing (optional), + default: missing (optional), + }, + missing separator, + TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@65..66 "T" [] [], }, @@ -82,43 +103,53 @@ JsModule { }, }, }, - JsExport { - export_token: EXPORT_KW@72..81 "export" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], - export_clause: JsFunctionDeclaration { - async_token: missing (optional), - function_token: FUNCTION_KW@81..90 "function" [] [Whitespace(" ")], - star_token: missing (optional), - id: JsIdentifierBinding { - name_token: IDENT@90..94 "foo1" [] [], - }, - type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@94..95 "<" [] [], - items: TsTypeParameterList [ - TsTypeParameter { - in_modifier_token: IN_KW@95..98 "in" [] [Whitespace(" ")], - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@98..99 "T" [] [], - }, - constraint: missing (optional), - default: missing (optional), + JsBogusStatement { + items: [ + EXPORT_KW@72..81 "export" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + JsBogusStatement { + items: [ + FUNCTION_KW@81..90 "function" [] [Whitespace(" ")], + JsIdentifierBinding { + name_token: IDENT@90..94 "foo1" [] [], + }, + JsBogus { + items: [ + L_ANGLE@94..95 "<" [] [], + JsBogus { + items: [ + TsBogusType { + items: [ + IN_KW@95..98 "in" [] [Whitespace(" ")], + ], + }, + TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@98..99 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + }, + R_ANGLE@99..100 ">" [] [], + ], + }, + JsParameters { + l_paren_token: L_PAREN@100..101 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@101..103 ")" [] [Whitespace(" ")], + }, + JsFunctionBody { + l_curly_token: L_CURLY@103..104 "{" [] [], + directives: JsDirectiveList [], + statements: JsStatementList [], + r_curly_token: R_CURLY@104..105 "}" [] [], }, ], - r_angle_token: R_ANGLE@99..100 ">" [] [], - }, - parameters: JsParameters { - l_paren_token: L_PAREN@100..101 "(" [] [], - items: JsParameterList [], - r_paren_token: R_PAREN@101..103 ")" [] [Whitespace(" ")], }, - return_type_annotation: missing (optional), - body: JsFunctionBody { - l_curly_token: L_CURLY@103..104 "{" [] [], - directives: JsDirectiveList [], - statements: JsStatementList [], - r_curly_token: R_CURLY@104..105 "}" [] [], - }, - }, + ], }, JsExport { export_token: EXPORT_KW@105..114 "export" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], @@ -134,7 +165,17 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: OUT_KW@128..132 "out" [] [Whitespace(" ")], + out_modifier_token: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@128..132 "out" [] [Whitespace(" ")], + }, + constraint: missing (optional), + default: missing (optional), + }, + missing separator, + TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@132..133 "T" [] [], }, @@ -240,37 +281,47 @@ JsModule { }, semicolon_token: missing (optional), }, - TsDeclareStatement { - declare_token: DECLARE_KW@180..190 "declare" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], - declaration: TsDeclareFunctionDeclaration { - async_token: missing (optional), - function_token: FUNCTION_KW@190..199 "function" [] [Whitespace(" ")], - id: JsIdentifierBinding { - name_token: IDENT@199..202 "foo" [] [], - }, - type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@202..203 "<" [] [], - items: TsTypeParameterList [ - TsTypeParameter { - in_modifier_token: IN_KW@203..206 "in" [] [Whitespace(" ")], - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@206..207 "T" [] [], - }, - constraint: missing (optional), - default: missing (optional), + JsBogusStatement { + items: [ + DECLARE_KW@180..190 "declare" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + JsBogusStatement { + items: [ + FUNCTION_KW@190..199 "function" [] [Whitespace(" ")], + JsIdentifierBinding { + name_token: IDENT@199..202 "foo" [] [], + }, + JsBogus { + items: [ + L_ANGLE@202..203 "<" [] [], + JsBogus { + items: [ + TsBogusType { + items: [ + IN_KW@203..206 "in" [] [Whitespace(" ")], + ], + }, + TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@206..207 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + }, + R_ANGLE@207..208 ">" [] [], + ], + }, + JsParameters { + l_paren_token: L_PAREN@208..209 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@209..210 ")" [] [], }, ], - r_angle_token: R_ANGLE@207..208 ">" [] [], }, - parameters: JsParameters { - l_paren_token: L_PAREN@208..209 "(" [] [], - items: JsParameterList [], - r_paren_token: R_PAREN@209..210 ")" [] [], - }, - return_type_annotation: missing (optional), - semicolon_token: missing (optional), - }, + ], }, TsDeclareStatement { declare_token: DECLARE_KW@210..220 "declare" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], @@ -285,7 +336,17 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: OUT_KW@233..237 "out" [] [Whitespace(" ")], + out_modifier_token: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@233..237 "out" [] [Whitespace(" ")], + }, + constraint: missing (optional), + default: missing (optional), + }, + missing separator, + TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@237..238 "T" [] [], }, @@ -464,38 +525,45 @@ JsModule { name_token: IDENT@345..351 "foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], }, operator_token: EQ@351..353 "=" [] [Whitespace(" ")], - right: JsFunctionExpression { - async_token: missing (optional), - function_token: FUNCTION_KW@353..362 "function" [] [Whitespace(" ")], - star_token: missing (optional), - id: missing (optional), - type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@362..363 "<" [] [], - items: TsTypeParameterList [ - TsTypeParameter { - in_modifier_token: IN_KW@363..366 "in" [] [Whitespace(" ")], - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@366..367 "T" [] [], + right: JsBogusExpression { + items: [ + FUNCTION_KW@353..362 "function" [] [Whitespace(" ")], + JsBogus { + items: [ + L_ANGLE@362..363 "<" [] [], + JsBogus { + items: [ + TsBogusType { + items: [ + IN_KW@363..366 "in" [] [Whitespace(" ")], + ], + }, + TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@366..367 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], }, - constraint: missing (optional), - default: missing (optional), - }, - ], - r_angle_token: R_ANGLE@367..368 ">" [] [], - }, - parameters: JsParameters { - l_paren_token: L_PAREN@368..369 "(" [] [], - items: JsParameterList [], - r_paren_token: R_PAREN@369..371 ")" [] [Whitespace(" ")], - }, - return_type_annotation: missing (optional), - body: JsFunctionBody { - l_curly_token: L_CURLY@371..372 "{" [] [], - directives: JsDirectiveList [], - statements: JsStatementList [], - r_curly_token: R_CURLY@372..373 "}" [] [], - }, + R_ANGLE@367..368 ">" [] [], + ], + }, + JsParameters { + l_paren_token: L_PAREN@368..369 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@369..371 ")" [] [Whitespace(" ")], + }, + JsFunctionBody { + l_curly_token: L_CURLY@371..372 "{" [] [], + directives: JsDirectiveList [], + statements: JsStatementList [], + r_curly_token: R_CURLY@372..373 "}" [] [], + }, + ], }, }, semicolon_token: missing (optional), @@ -516,7 +584,17 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: OUT_KW@391..395 "out" [] [Whitespace(" ")], + out_modifier_token: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@391..395 "out" [] [Whitespace(" ")], + }, + constraint: missing (optional), + default: missing (optional), + }, + missing separator, + TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@395..396 "T" [] [], }, @@ -553,49 +631,57 @@ JsModule { implements_clause: missing (optional), l_curly_token: L_CURLY@414..416 "{" [] [Whitespace(" ")], members: JsClassMemberList [ - JsMethodClassMember { - modifiers: JsMethodModifierList [], - async_token: missing (optional), - star_token: missing (optional), - name: JsLiteralMemberName { - value: IDENT@416..419 "foo" [] [], - }, - question_mark_token: missing (optional), - type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@419..420 "<" [] [], - items: TsTypeParameterList [ - TsTypeParameter { - in_modifier_token: IN_KW@420..423 "in" [] [Whitespace(" ")], - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@423..424 "T" [] [], + JsBogusMember { + items: [ + JsMethodModifierList [], + JsLiteralMemberName { + value: IDENT@416..419 "foo" [] [], + }, + JsBogus { + items: [ + L_ANGLE@419..420 "<" [] [], + JsBogus { + items: [ + TsBogusType { + items: [ + IN_KW@420..423 "in" [] [Whitespace(" ")], + ], + }, + TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@423..424 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], }, - constraint: missing (optional), - default: missing (optional), - }, - ], - r_angle_token: R_ANGLE@424..425 ">" [] [], - }, - parameters: JsParameters { - l_paren_token: L_PAREN@425..426 "(" [] [], - items: JsParameterList [], - r_paren_token: R_PAREN@426..427 ")" [] [], - }, - return_type_annotation: TsReturnTypeAnnotation { - colon_token: COLON@427..429 ":" [] [Whitespace(" ")], - ty: TsReferenceType { - name: JsReferenceIdentifier { - value_token: IDENT@429..431 "T" [] [Whitespace(" ")], + R_ANGLE@424..425 ">" [] [], + ], + }, + JsParameters { + l_paren_token: L_PAREN@425..426 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@426..427 ")" [] [], + }, + TsReturnTypeAnnotation { + colon_token: COLON@427..429 ":" [] [Whitespace(" ")], + ty: TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@429..431 "T" [] [Whitespace(" ")], + }, + type_arguments: missing (optional), }, - type_arguments: missing (optional), }, - }, - body: JsFunctionBody { - l_curly_token: L_CURLY@431..432 "{" [] [], - directives: JsDirectiveList [], - statements: JsStatementList [], - r_curly_token: R_CURLY@432..434 "}" [] [Whitespace(" ")], - }, + JsFunctionBody { + l_curly_token: L_CURLY@431..432 "{" [] [], + directives: JsDirectiveList [], + statements: JsStatementList [], + r_curly_token: R_CURLY@432..434 "}" [] [Whitespace(" ")], + }, + ], }, ], r_curly_token: R_CURLY@434..435 "}" [] [], @@ -624,7 +710,17 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: OUT_KW@453..457 "out" [] [Whitespace(" ")], + out_modifier_token: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@453..457 "out" [] [Whitespace(" ")], + }, + constraint: missing (optional), + default: missing (optional), + }, + missing separator, + TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@457..458 "T" [] [], }, @@ -667,47 +763,56 @@ JsModule { right: JsObjectExpression { l_curly_token: L_CURLY@477..479 "{" [] [Whitespace(" ")], members: JsObjectMemberList [ - JsMethodObjectMember { - async_token: missing (optional), - star_token: missing (optional), - name: JsLiteralMemberName { - value: IDENT@479..482 "foo" [] [], - }, - type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@482..483 "<" [] [], - items: TsTypeParameterList [ - TsTypeParameter { - in_modifier_token: IN_KW@483..486 "in" [] [Whitespace(" ")], - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@486..487 "T" [] [], + JsBogusMember { + items: [ + JsLiteralMemberName { + value: IDENT@479..482 "foo" [] [], + }, + JsBogus { + items: [ + L_ANGLE@482..483 "<" [] [], + JsBogus { + items: [ + TsBogusType { + items: [ + IN_KW@483..486 "in" [] [Whitespace(" ")], + ], + }, + TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@486..487 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], }, - constraint: missing (optional), - default: missing (optional), - }, - ], - r_angle_token: R_ANGLE@487..488 ">" [] [], - }, - parameters: JsParameters { - l_paren_token: L_PAREN@488..489 "(" [] [], - items: JsParameterList [], - r_paren_token: R_PAREN@489..490 ")" [] [], - }, - return_type_annotation: TsReturnTypeAnnotation { - colon_token: COLON@490..492 ":" [] [Whitespace(" ")], - ty: TsReferenceType { - name: JsReferenceIdentifier { - value_token: IDENT@492..494 "T" [] [Whitespace(" ")], + R_ANGLE@487..488 ">" [] [], + ], + }, + JsParameters { + l_paren_token: L_PAREN@488..489 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@489..490 ")" [] [], + }, + TsReturnTypeAnnotation { + colon_token: COLON@490..492 ":" [] [Whitespace(" ")], + ty: TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@492..494 "T" [] [Whitespace(" ")], + }, + type_arguments: missing (optional), }, - type_arguments: missing (optional), }, - }, - body: JsFunctionBody { - l_curly_token: L_CURLY@494..495 "{" [] [], - directives: JsDirectiveList [], - statements: JsStatementList [], - r_curly_token: R_CURLY@495..497 "}" [] [Whitespace(" ")], - }, + JsFunctionBody { + l_curly_token: L_CURLY@494..495 "{" [] [], + directives: JsDirectiveList [], + statements: JsStatementList [], + r_curly_token: R_CURLY@495..497 "}" [] [Whitespace(" ")], + }, + ], }, ], r_curly_token: R_CURLY@497..498 "}" [] [], @@ -735,7 +840,17 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: OUT_KW@513..517 "out" [] [Whitespace(" ")], + out_modifier_token: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@513..517 "out" [] [Whitespace(" ")], + }, + constraint: missing (optional), + default: missing (optional), + }, + missing separator, + TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@517..518 "T" [] [], }, @@ -798,7 +913,7 @@ JsModule { }, semicolon_token: missing (optional), }, - JsUnknownStatement { + JsBogusStatement { items: [ FAT_ARROW@541..544 "=>" [] [Whitespace(" ")], ], @@ -819,7 +934,17 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: OUT_KW@550..554 "out" [] [Whitespace(" ")], + out_modifier_token: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@550..554 "out" [] [Whitespace(" ")], + }, + constraint: missing (optional), + default: missing (optional), + }, + missing separator, + TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@554..555 "T" [] [], }, @@ -887,7 +1012,7 @@ JsModule { }, semicolon_token: missing (optional), }, - JsUnknownStatement { + JsBogusStatement { items: [ FAT_ARROW@583..586 "=>" [] [Whitespace(" ")], ], @@ -910,33 +1035,44 @@ JsModule { }, variable_annotation: TsTypeAnnotation { colon_token: COLON@596..598 ":" [] [Whitespace(" ")], - ty: TsFunctionType { - type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@598..599 "<" [] [], - items: TsTypeParameterList [ - TsTypeParameter { - in_modifier_token: IN_KW@599..602 "in" [] [Whitespace(" ")], - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@602..603 "T" [] [], + ty: TsBogusType { + items: [ + JsBogus { + items: [ + L_ANGLE@598..599 "<" [] [], + JsBogus { + items: [ + TsBogusType { + items: [ + IN_KW@599..602 "in" [] [Whitespace(" ")], + ], + }, + TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@602..603 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], }, - constraint: missing (optional), - default: missing (optional), - }, - ], - r_angle_token: R_ANGLE@603..604 ">" [] [], - }, - parameters: JsParameters { - l_paren_token: L_PAREN@604..605 "(" [] [], - items: JsParameterList [], - r_paren_token: R_PAREN@605..607 ")" [] [Whitespace(" ")], - }, - fat_arrow_token: FAT_ARROW@607..610 "=>" [] [Whitespace(" ")], - return_type: TsObjectType { - l_curly_token: L_CURLY@610..611 "{" [] [], - members: TsTypeMemberList [], - r_curly_token: R_CURLY@611..612 "}" [] [], - }, + R_ANGLE@603..604 ">" [] [], + ], + }, + JsParameters { + l_paren_token: L_PAREN@604..605 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@605..607 ")" [] [Whitespace(" ")], + }, + FAT_ARROW@607..610 "=>" [] [Whitespace(" ")], + TsObjectType { + l_curly_token: L_CURLY@610..611 "{" [] [], + members: TsTypeMemberList [], + r_curly_token: R_CURLY@611..612 "}" [] [], + }, + ], }, }, initializer: missing (optional), @@ -961,7 +1097,17 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: OUT_KW@623..627 "out" [] [Whitespace(" ")], + out_modifier_token: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@623..627 "out" [] [Whitespace(" ")], + }, + constraint: missing (optional), + default: missing (optional), + }, + missing separator, + TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@627..628 "T" [] [], }, @@ -1000,43 +1146,63 @@ JsModule { }, variable_annotation: TsTypeAnnotation { colon_token: COLON@645..647 ":" [] [Whitespace(" ")], - ty: TsFunctionType { - type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@647..648 "<" [] [], - items: TsTypeParameterList [ - TsTypeParameter { - in_modifier_token: IN_KW@648..651 "in" [] [Whitespace(" ")], - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@651..652 "T" [] [], - }, - constraint: missing (optional), - default: missing (optional), - }, - COMMA@652..654 "," [] [Whitespace(" ")], - TsTypeParameter { - in_modifier_token: missing (optional), - out_modifier_token: OUT_KW@654..658 "out" [] [Whitespace(" ")], - name: TsTypeParameterName { - ident_token: IDENT@658..659 "T" [] [], + ty: TsBogusType { + items: [ + JsBogus { + items: [ + L_ANGLE@647..648 "<" [] [], + JsBogus { + items: [ + TsBogusType { + items: [ + IN_KW@648..651 "in" [] [Whitespace(" ")], + ], + }, + TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@651..652 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + COMMA@652..654 "," [] [Whitespace(" ")], + TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@654..658 "out" [] [Whitespace(" ")], + }, + constraint: missing (optional), + default: missing (optional), + }, + TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@658..659 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], }, - constraint: missing (optional), - default: missing (optional), - }, - ], - r_angle_token: R_ANGLE@659..660 ">" [] [], - }, - parameters: JsParameters { - l_paren_token: L_PAREN@660..661 "(" [] [], - items: JsParameterList [], - r_paren_token: R_PAREN@661..663 ")" [] [Whitespace(" ")], - }, - fat_arrow_token: FAT_ARROW@663..666 "=>" [] [Whitespace(" ")], - return_type: TsObjectType { - l_curly_token: L_CURLY@666..667 "{" [] [], - members: TsTypeMemberList [], - r_curly_token: R_CURLY@667..668 "}" [] [], - }, + R_ANGLE@659..660 ">" [] [], + ], + }, + JsParameters { + l_paren_token: L_PAREN@660..661 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@661..663 ")" [] [Whitespace(" ")], + }, + FAT_ARROW@663..666 "=>" [] [Whitespace(" ")], + TsObjectType { + l_curly_token: L_CURLY@666..667 "{" [] [], + members: TsTypeMemberList [], + r_curly_token: R_CURLY@667..668 "}" [] [], + }, + ], }, }, initializer: missing (optional), @@ -1055,35 +1221,45 @@ JsModule { }, variable_annotation: TsTypeAnnotation { colon_token: COLON@676..678 ":" [] [Whitespace(" ")], - ty: TsConstructorType { - abstract_token: missing (optional), - new_token: NEW_KW@678..682 "new" [] [Whitespace(" ")], - type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@682..683 "<" [] [], - items: TsTypeParameterList [ - TsTypeParameter { - in_modifier_token: IN_KW@683..686 "in" [] [Whitespace(" ")], - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@686..687 "T" [] [], - }, - constraint: missing (optional), - default: missing (optional), - }, - ], - r_angle_token: R_ANGLE@687..688 ">" [] [], - }, - parameters: JsParameters { - l_paren_token: L_PAREN@688..689 "(" [] [], - items: JsParameterList [], - r_paren_token: R_PAREN@689..691 ")" [] [Whitespace(" ")], - }, - fat_arrow_token: FAT_ARROW@691..694 "=>" [] [Whitespace(" ")], - return_type: TsObjectType { - l_curly_token: L_CURLY@694..695 "{" [] [], - members: TsTypeMemberList [], - r_curly_token: R_CURLY@695..696 "}" [] [], - }, + ty: TsBogusType { + items: [ + NEW_KW@678..682 "new" [] [Whitespace(" ")], + JsBogus { + items: [ + L_ANGLE@682..683 "<" [] [], + JsBogus { + items: [ + TsBogusType { + items: [ + IN_KW@683..686 "in" [] [Whitespace(" ")], + ], + }, + TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@686..687 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + }, + R_ANGLE@687..688 ">" [] [], + ], + }, + JsParameters { + l_paren_token: L_PAREN@688..689 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@689..691 ")" [] [Whitespace(" ")], + }, + FAT_ARROW@691..694 "=>" [] [Whitespace(" ")], + TsObjectType { + l_curly_token: L_CURLY@694..695 "{" [] [], + members: TsTypeMemberList [], + r_curly_token: R_CURLY@695..696 "}" [] [], + }, + ], }, }, initializer: missing (optional), @@ -1110,7 +1286,17 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: OUT_KW@711..715 "out" [] [Whitespace(" ")], + out_modifier_token: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@711..715 "out" [] [Whitespace(" ")], + }, + constraint: missing (optional), + default: missing (optional), + }, + missing separator, + TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@715..716 "T" [] [], }, @@ -1149,45 +1335,64 @@ JsModule { }, variable_annotation: TsTypeAnnotation { colon_token: COLON@733..735 ":" [] [Whitespace(" ")], - ty: TsConstructorType { - abstract_token: missing (optional), - new_token: NEW_KW@735..739 "new" [] [Whitespace(" ")], - type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@739..740 "<" [] [], - items: TsTypeParameterList [ - TsTypeParameter { - in_modifier_token: IN_KW@740..743 "in" [] [Whitespace(" ")], - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@743..744 "T" [] [], - }, - constraint: missing (optional), - default: missing (optional), - }, - COMMA@744..746 "," [] [Whitespace(" ")], - TsTypeParameter { - in_modifier_token: missing (optional), - out_modifier_token: OUT_KW@746..750 "out" [] [Whitespace(" ")], - name: TsTypeParameterName { - ident_token: IDENT@750..751 "T" [] [], + ty: TsBogusType { + items: [ + NEW_KW@735..739 "new" [] [Whitespace(" ")], + JsBogus { + items: [ + L_ANGLE@739..740 "<" [] [], + JsBogus { + items: [ + TsBogusType { + items: [ + IN_KW@740..743 "in" [] [Whitespace(" ")], + ], + }, + TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@743..744 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + COMMA@744..746 "," [] [Whitespace(" ")], + TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@746..750 "out" [] [Whitespace(" ")], + }, + constraint: missing (optional), + default: missing (optional), + }, + TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@750..751 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], }, - constraint: missing (optional), - default: missing (optional), - }, - ], - r_angle_token: R_ANGLE@751..752 ">" [] [], - }, - parameters: JsParameters { - l_paren_token: L_PAREN@752..753 "(" [] [], - items: JsParameterList [], - r_paren_token: R_PAREN@753..755 ")" [] [Whitespace(" ")], - }, - fat_arrow_token: FAT_ARROW@755..758 "=>" [] [Whitespace(" ")], - return_type: TsObjectType { - l_curly_token: L_CURLY@758..759 "{" [] [], - members: TsTypeMemberList [], - r_curly_token: R_CURLY@759..760 "}" [] [], - }, + R_ANGLE@751..752 ">" [] [], + ], + }, + JsParameters { + l_paren_token: L_PAREN@752..753 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@753..755 ")" [] [Whitespace(" ")], + }, + FAT_ARROW@755..758 "=>" [] [Whitespace(" ")], + TsObjectType { + l_curly_token: L_CURLY@758..759 "{" [] [], + members: TsTypeMemberList [], + r_curly_token: R_CURLY@759..760 "}" [] [], + }, + ], }, }, initializer: missing (optional), @@ -1206,44 +1411,57 @@ JsModule { }, variable_annotation: TsTypeAnnotation { colon_token: COLON@768..770 ":" [] [Whitespace(" ")], - ty: TsObjectType { - l_curly_token: L_CURLY@770..772 "{" [] [Whitespace(" ")], - members: TsTypeMemberList [ - TsMethodSignatureTypeMember { - name: JsLiteralMemberName { - value: IDENT@772..773 "y" [] [], - }, - optional_token: missing (optional), - type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@773..774 "<" [] [], - items: TsTypeParameterList [ - TsTypeParameter { - in_modifier_token: IN_KW@774..777 "in" [] [Whitespace(" ")], - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@777..778 "T" [] [], + ty: TsBogusType { + items: [ + L_CURLY@770..772 "{" [] [Whitespace(" ")], + JsBogus { + items: [ + JsBogus { + items: [ + JsLiteralMemberName { + value: IDENT@772..773 "y" [] [], }, - constraint: missing (optional), - default: missing (optional), - }, - ], - r_angle_token: R_ANGLE@778..779 ">" [] [], - }, - parameters: JsParameters { - l_paren_token: L_PAREN@779..780 "(" [] [], - items: JsParameterList [], - r_paren_token: R_PAREN@780..781 ")" [] [], - }, - return_type_annotation: TsReturnTypeAnnotation { - colon_token: COLON@781..783 ":" [] [Whitespace(" ")], - ty: TsAnyType { - any_token: ANY_KW@783..787 "any" [] [Whitespace(" ")], + JsBogus { + items: [ + L_ANGLE@773..774 "<" [] [], + JsBogus { + items: [ + TsBogusType { + items: [ + IN_KW@774..777 "in" [] [Whitespace(" ")], + ], + }, + TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@777..778 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + }, + R_ANGLE@778..779 ">" [] [], + ], + }, + JsParameters { + l_paren_token: L_PAREN@779..780 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@780..781 ")" [] [], + }, + TsReturnTypeAnnotation { + colon_token: COLON@781..783 ":" [] [Whitespace(" ")], + ty: TsAnyType { + any_token: ANY_KW@783..787 "any" [] [Whitespace(" ")], + }, + }, + ], }, - }, - separator_token: missing (optional), + ], }, + R_CURLY@787..788 "}" [] [], ], - r_curly_token: R_CURLY@787..788 "}" [] [], }, }, initializer: missing (optional), @@ -1275,7 +1493,17 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: OUT_KW@802..806 "out" [] [Whitespace(" ")], + out_modifier_token: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@802..806 "out" [] [Whitespace(" ")], + }, + constraint: missing (optional), + default: missing (optional), + }, + missing separator, + TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@806..807 "T" [] [], }, @@ -1318,54 +1546,76 @@ JsModule { }, variable_annotation: TsTypeAnnotation { colon_token: COLON@825..827 ":" [] [Whitespace(" ")], - ty: TsObjectType { - l_curly_token: L_CURLY@827..829 "{" [] [Whitespace(" ")], - members: TsTypeMemberList [ - TsMethodSignatureTypeMember { - name: JsLiteralMemberName { - value: IDENT@829..830 "y" [] [], - }, - optional_token: missing (optional), - type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@830..831 "<" [] [], - items: TsTypeParameterList [ - TsTypeParameter { - in_modifier_token: IN_KW@831..834 "in" [] [Whitespace(" ")], - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@834..835 "T" [] [], + ty: TsBogusType { + items: [ + L_CURLY@827..829 "{" [] [Whitespace(" ")], + JsBogus { + items: [ + JsBogus { + items: [ + JsLiteralMemberName { + value: IDENT@829..830 "y" [] [], }, - constraint: missing (optional), - default: missing (optional), - }, - COMMA@835..837 "," [] [Whitespace(" ")], - TsTypeParameter { - in_modifier_token: missing (optional), - out_modifier_token: OUT_KW@837..841 "out" [] [Whitespace(" ")], - name: TsTypeParameterName { - ident_token: IDENT@841..842 "T" [] [], + JsBogus { + items: [ + L_ANGLE@830..831 "<" [] [], + JsBogus { + items: [ + TsBogusType { + items: [ + IN_KW@831..834 "in" [] [Whitespace(" ")], + ], + }, + TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@834..835 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + COMMA@835..837 "," [] [Whitespace(" ")], + TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@837..841 "out" [] [Whitespace(" ")], + }, + constraint: missing (optional), + default: missing (optional), + }, + TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@841..842 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + }, + R_ANGLE@842..843 ">" [] [], + ], }, - constraint: missing (optional), - default: missing (optional), - }, - ], - r_angle_token: R_ANGLE@842..843 ">" [] [], - }, - parameters: JsParameters { - l_paren_token: L_PAREN@843..844 "(" [] [], - items: JsParameterList [], - r_paren_token: R_PAREN@844..845 ")" [] [], - }, - return_type_annotation: TsReturnTypeAnnotation { - colon_token: COLON@845..847 ":" [] [Whitespace(" ")], - ty: TsAnyType { - any_token: ANY_KW@847..851 "any" [] [Whitespace(" ")], + JsParameters { + l_paren_token: L_PAREN@843..844 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@844..845 ")" [] [], + }, + TsReturnTypeAnnotation { + colon_token: COLON@845..847 ":" [] [Whitespace(" ")], + ty: TsAnyType { + any_token: ANY_KW@847..851 "any" [] [Whitespace(" ")], + }, + }, + ], }, - }, - separator_token: missing (optional), + ], }, + R_CURLY@851..852 "}" [] [], ], - r_curly_token: R_CURLY@851..852 "}" [] [], }, }, initializer: missing (optional), @@ -1382,38 +1632,36 @@ JsModule { 0: (empty) 1: JS_DIRECTIVE_LIST@0..0 2: JS_MODULE_ITEM_LIST@0..853 - 0: JS_EXPORT@0..39 + 0: JS_BOGUS_STATEMENT@0..39 0: EXPORT_KW@0..8 "export" [Whitespace("\t")] [Whitespace(" ")] - 1: JS_EXPORT_DEFAULT_DECLARATION_CLAUSE@8..39 + 1: JS_BOGUS@8..39 0: DEFAULT_KW@8..16 "default" [] [Whitespace(" ")] - 1: JS_FUNCTION_EXPORT_DEFAULT_DECLARATION@16..39 - 0: (empty) - 1: FUNCTION_KW@16..25 "function" [] [Whitespace(" ")] - 2: (empty) - 3: JS_IDENTIFIER_BINDING@25..28 + 1: JS_BOGUS@16..39 + 0: FUNCTION_KW@16..25 "function" [] [Whitespace(" ")] + 1: JS_IDENTIFIER_BINDING@25..28 0: IDENT@25..28 "foo" [] [] - 4: TS_TYPE_PARAMETERS@28..34 + 2: JS_BOGUS@28..34 0: L_ANGLE@28..29 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@29..33 - 0: TS_TYPE_PARAMETER@29..33 + 1: JS_BOGUS@29..33 + 0: TS_BOGUS_TYPE@29..32 0: IN_KW@29..32 "in" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER@32..33 + 0: (empty) 1: (empty) 2: TS_TYPE_PARAMETER_NAME@32..33 0: IDENT@32..33 "T" [] [] 3: (empty) 4: (empty) 2: R_ANGLE@33..34 ">" [] [] - 5: JS_PARAMETERS@34..37 + 3: JS_PARAMETERS@34..37 0: L_PAREN@34..35 "(" [] [] 1: JS_PARAMETER_LIST@35..35 2: R_PAREN@35..37 ")" [] [Whitespace(" ")] - 6: (empty) - 7: JS_FUNCTION_BODY@37..39 + 4: JS_FUNCTION_BODY@37..39 0: L_CURLY@37..38 "{" [] [] 1: JS_DIRECTIVE_LIST@38..38 2: JS_STATEMENT_LIST@38..38 3: R_CURLY@38..39 "}" [] [] - 2: (empty) 1: JS_EXPORT@39..72 0: EXPORT_KW@39..48 "export" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] 1: JS_FUNCTION_DECLARATION@48..72 @@ -1425,9 +1673,17 @@ JsModule { 4: TS_TYPE_PARAMETERS@60..67 0: L_ANGLE@60..61 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@61..66 - 0: TS_TYPE_PARAMETER@61..66 + 0: TS_TYPE_PARAMETER@61..65 + 0: (empty) + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@61..65 + 0: IDENT@61..65 "out" [] [Whitespace(" ")] + 3: (empty) + 4: (empty) + 1: (empty) + 2: TS_TYPE_PARAMETER@65..66 0: (empty) - 1: OUT_KW@61..65 "out" [] [Whitespace(" ")] + 1: (empty) 2: TS_TYPE_PARAMETER_NAME@65..66 0: IDENT@65..66 "T" [] [] 3: (empty) @@ -1443,31 +1699,30 @@ JsModule { 1: JS_DIRECTIVE_LIST@71..71 2: JS_STATEMENT_LIST@71..71 3: R_CURLY@71..72 "}" [] [] - 2: JS_EXPORT@72..105 + 2: JS_BOGUS_STATEMENT@72..105 0: EXPORT_KW@72..81 "export" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: JS_FUNCTION_DECLARATION@81..105 - 0: (empty) - 1: FUNCTION_KW@81..90 "function" [] [Whitespace(" ")] - 2: (empty) - 3: JS_IDENTIFIER_BINDING@90..94 + 1: JS_BOGUS_STATEMENT@81..105 + 0: FUNCTION_KW@81..90 "function" [] [Whitespace(" ")] + 1: JS_IDENTIFIER_BINDING@90..94 0: IDENT@90..94 "foo1" [] [] - 4: TS_TYPE_PARAMETERS@94..100 + 2: JS_BOGUS@94..100 0: L_ANGLE@94..95 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@95..99 - 0: TS_TYPE_PARAMETER@95..99 + 1: JS_BOGUS@95..99 + 0: TS_BOGUS_TYPE@95..98 0: IN_KW@95..98 "in" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER@98..99 + 0: (empty) 1: (empty) 2: TS_TYPE_PARAMETER_NAME@98..99 0: IDENT@98..99 "T" [] [] 3: (empty) 4: (empty) 2: R_ANGLE@99..100 ">" [] [] - 5: JS_PARAMETERS@100..103 + 3: JS_PARAMETERS@100..103 0: L_PAREN@100..101 "(" [] [] 1: JS_PARAMETER_LIST@101..101 2: R_PAREN@101..103 ")" [] [Whitespace(" ")] - 6: (empty) - 7: JS_FUNCTION_BODY@103..105 + 4: JS_FUNCTION_BODY@103..105 0: L_CURLY@103..104 "{" [] [] 1: JS_DIRECTIVE_LIST@104..104 2: JS_STATEMENT_LIST@104..104 @@ -1483,9 +1738,17 @@ JsModule { 4: TS_TYPE_PARAMETERS@127..134 0: L_ANGLE@127..128 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@128..133 - 0: TS_TYPE_PARAMETER@128..133 + 0: TS_TYPE_PARAMETER@128..132 + 0: (empty) + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@128..132 + 0: IDENT@128..132 "out" [] [Whitespace(" ")] + 3: (empty) + 4: (empty) + 1: (empty) + 2: TS_TYPE_PARAMETER@132..133 0: (empty) - 1: OUT_KW@128..132 "out" [] [Whitespace(" ")] + 1: (empty) 2: TS_TYPE_PARAMETER_NAME@132..133 0: IDENT@132..133 "T" [] [] 3: (empty) @@ -1555,30 +1818,29 @@ JsModule { 2: R_ANGLE@179..180 ">" [] [] 2: (empty) 1: (empty) - 6: TS_DECLARE_STATEMENT@180..210 + 6: JS_BOGUS_STATEMENT@180..210 0: DECLARE_KW@180..190 "declare" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: TS_DECLARE_FUNCTION_DECLARATION@190..210 - 0: (empty) - 1: FUNCTION_KW@190..199 "function" [] [Whitespace(" ")] - 2: JS_IDENTIFIER_BINDING@199..202 + 1: JS_BOGUS_STATEMENT@190..210 + 0: FUNCTION_KW@190..199 "function" [] [Whitespace(" ")] + 1: JS_IDENTIFIER_BINDING@199..202 0: IDENT@199..202 "foo" [] [] - 3: TS_TYPE_PARAMETERS@202..208 + 2: JS_BOGUS@202..208 0: L_ANGLE@202..203 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@203..207 - 0: TS_TYPE_PARAMETER@203..207 + 1: JS_BOGUS@203..207 + 0: TS_BOGUS_TYPE@203..206 0: IN_KW@203..206 "in" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER@206..207 + 0: (empty) 1: (empty) 2: TS_TYPE_PARAMETER_NAME@206..207 0: IDENT@206..207 "T" [] [] 3: (empty) 4: (empty) 2: R_ANGLE@207..208 ">" [] [] - 4: JS_PARAMETERS@208..210 + 3: JS_PARAMETERS@208..210 0: L_PAREN@208..209 "(" [] [] 1: JS_PARAMETER_LIST@209..209 2: R_PAREN@209..210 ")" [] [] - 5: (empty) - 6: (empty) 7: TS_DECLARE_STATEMENT@210..241 0: DECLARE_KW@210..220 "declare" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] 1: TS_DECLARE_FUNCTION_DECLARATION@220..241 @@ -1589,9 +1851,17 @@ JsModule { 3: TS_TYPE_PARAMETERS@232..239 0: L_ANGLE@232..233 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@233..238 - 0: TS_TYPE_PARAMETER@233..238 + 0: TS_TYPE_PARAMETER@233..237 + 0: (empty) + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@233..237 + 0: IDENT@233..237 "out" [] [Whitespace(" ")] + 3: (empty) + 4: (empty) + 1: (empty) + 2: TS_TYPE_PARAMETER@237..238 0: (empty) - 1: OUT_KW@233..237 "out" [] [Whitespace(" ")] + 1: (empty) 2: TS_TYPE_PARAMETER_NAME@237..238 0: IDENT@237..238 "T" [] [] 3: (empty) @@ -1716,28 +1986,26 @@ JsModule { 0: JS_IDENTIFIER_ASSIGNMENT@345..351 0: IDENT@345..351 "foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] 1: EQ@351..353 "=" [] [Whitespace(" ")] - 2: JS_FUNCTION_EXPRESSION@353..373 - 0: (empty) - 1: FUNCTION_KW@353..362 "function" [] [Whitespace(" ")] - 2: (empty) - 3: (empty) - 4: TS_TYPE_PARAMETERS@362..368 + 2: JS_BOGUS_EXPRESSION@353..373 + 0: FUNCTION_KW@353..362 "function" [] [Whitespace(" ")] + 1: JS_BOGUS@362..368 0: L_ANGLE@362..363 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@363..367 - 0: TS_TYPE_PARAMETER@363..367 + 1: JS_BOGUS@363..367 + 0: TS_BOGUS_TYPE@363..366 0: IN_KW@363..366 "in" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER@366..367 + 0: (empty) 1: (empty) 2: TS_TYPE_PARAMETER_NAME@366..367 0: IDENT@366..367 "T" [] [] 3: (empty) 4: (empty) 2: R_ANGLE@367..368 ">" [] [] - 5: JS_PARAMETERS@368..371 + 2: JS_PARAMETERS@368..371 0: L_PAREN@368..369 "(" [] [] 1: JS_PARAMETER_LIST@369..369 2: R_PAREN@369..371 ")" [] [Whitespace(" ")] - 6: (empty) - 7: JS_FUNCTION_BODY@371..373 + 3: JS_FUNCTION_BODY@371..373 0: L_CURLY@371..372 "{" [] [] 1: JS_DIRECTIVE_LIST@372..372 2: JS_STATEMENT_LIST@372..372 @@ -1756,9 +2024,17 @@ JsModule { 4: TS_TYPE_PARAMETERS@390..397 0: L_ANGLE@390..391 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@391..396 - 0: TS_TYPE_PARAMETER@391..396 + 0: TS_TYPE_PARAMETER@391..395 + 0: (empty) + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@391..395 + 0: IDENT@391..395 "out" [] [Whitespace(" ")] + 3: (empty) + 4: (empty) + 1: (empty) + 2: TS_TYPE_PARAMETER@395..396 0: (empty) - 1: OUT_KW@391..395 "out" [] [Whitespace(" ")] + 1: (empty) 2: TS_TYPE_PARAMETER_NAME@395..396 0: IDENT@395..396 "T" [] [] 3: (empty) @@ -1785,35 +2061,34 @@ JsModule { 5: (empty) 6: L_CURLY@414..416 "{" [] [Whitespace(" ")] 7: JS_CLASS_MEMBER_LIST@416..434 - 0: JS_METHOD_CLASS_MEMBER@416..434 + 0: JS_BOGUS_MEMBER@416..434 0: JS_METHOD_MODIFIER_LIST@416..416 - 1: (empty) - 2: (empty) - 3: JS_LITERAL_MEMBER_NAME@416..419 + 1: JS_LITERAL_MEMBER_NAME@416..419 0: IDENT@416..419 "foo" [] [] - 4: (empty) - 5: TS_TYPE_PARAMETERS@419..425 + 2: JS_BOGUS@419..425 0: L_ANGLE@419..420 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@420..424 - 0: TS_TYPE_PARAMETER@420..424 + 1: JS_BOGUS@420..424 + 0: TS_BOGUS_TYPE@420..423 0: IN_KW@420..423 "in" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER@423..424 + 0: (empty) 1: (empty) 2: TS_TYPE_PARAMETER_NAME@423..424 0: IDENT@423..424 "T" [] [] 3: (empty) 4: (empty) 2: R_ANGLE@424..425 ">" [] [] - 6: JS_PARAMETERS@425..427 + 3: JS_PARAMETERS@425..427 0: L_PAREN@425..426 "(" [] [] 1: JS_PARAMETER_LIST@426..426 2: R_PAREN@426..427 ")" [] [] - 7: TS_RETURN_TYPE_ANNOTATION@427..431 + 4: TS_RETURN_TYPE_ANNOTATION@427..431 0: COLON@427..429 ":" [] [Whitespace(" ")] 1: TS_REFERENCE_TYPE@429..431 0: JS_REFERENCE_IDENTIFIER@429..431 0: IDENT@429..431 "T" [] [Whitespace(" ")] 1: (empty) - 8: JS_FUNCTION_BODY@431..434 + 5: JS_FUNCTION_BODY@431..434 0: L_CURLY@431..432 "{" [] [] 1: JS_DIRECTIVE_LIST@432..432 2: JS_STATEMENT_LIST@432..432 @@ -1839,9 +2114,17 @@ JsModule { 5: TS_TYPE_PARAMETERS@452..459 0: L_ANGLE@452..453 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@453..458 - 0: TS_TYPE_PARAMETER@453..458 + 0: TS_TYPE_PARAMETER@453..457 + 0: (empty) + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@453..457 + 0: IDENT@453..457 "out" [] [Whitespace(" ")] + 3: (empty) + 4: (empty) + 1: (empty) + 2: TS_TYPE_PARAMETER@457..458 0: (empty) - 1: OUT_KW@453..457 "out" [] [Whitespace(" ")] + 1: (empty) 2: TS_TYPE_PARAMETER_NAME@457..458 0: IDENT@457..458 "T" [] [] 3: (empty) @@ -1871,33 +2154,33 @@ JsModule { 2: JS_OBJECT_EXPRESSION@477..498 0: L_CURLY@477..479 "{" [] [Whitespace(" ")] 1: JS_OBJECT_MEMBER_LIST@479..497 - 0: JS_METHOD_OBJECT_MEMBER@479..497 - 0: (empty) - 1: (empty) - 2: JS_LITERAL_MEMBER_NAME@479..482 + 0: JS_BOGUS_MEMBER@479..497 + 0: JS_LITERAL_MEMBER_NAME@479..482 0: IDENT@479..482 "foo" [] [] - 3: TS_TYPE_PARAMETERS@482..488 + 1: JS_BOGUS@482..488 0: L_ANGLE@482..483 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@483..487 - 0: TS_TYPE_PARAMETER@483..487 + 1: JS_BOGUS@483..487 + 0: TS_BOGUS_TYPE@483..486 0: IN_KW@483..486 "in" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER@486..487 + 0: (empty) 1: (empty) 2: TS_TYPE_PARAMETER_NAME@486..487 0: IDENT@486..487 "T" [] [] 3: (empty) 4: (empty) 2: R_ANGLE@487..488 ">" [] [] - 4: JS_PARAMETERS@488..490 + 2: JS_PARAMETERS@488..490 0: L_PAREN@488..489 "(" [] [] 1: JS_PARAMETER_LIST@489..489 2: R_PAREN@489..490 ")" [] [] - 5: TS_RETURN_TYPE_ANNOTATION@490..494 + 3: TS_RETURN_TYPE_ANNOTATION@490..494 0: COLON@490..492 ":" [] [Whitespace(" ")] 1: TS_REFERENCE_TYPE@492..494 0: JS_REFERENCE_IDENTIFIER@492..494 0: IDENT@492..494 "T" [] [Whitespace(" ")] 1: (empty) - 6: JS_FUNCTION_BODY@494..497 + 4: JS_FUNCTION_BODY@494..497 0: L_CURLY@494..495 "{" [] [] 1: JS_DIRECTIVE_LIST@495..495 2: JS_STATEMENT_LIST@495..495 @@ -1920,9 +2203,17 @@ JsModule { 3: TS_TYPE_PARAMETERS@512..519 0: L_ANGLE@512..513 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@513..518 - 0: TS_TYPE_PARAMETER@513..518 + 0: TS_TYPE_PARAMETER@513..517 + 0: (empty) + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@513..517 + 0: IDENT@513..517 "out" [] [Whitespace(" ")] + 3: (empty) + 4: (empty) + 1: (empty) + 2: TS_TYPE_PARAMETER@517..518 0: (empty) - 1: OUT_KW@513..517 "out" [] [Whitespace(" ")] + 1: (empty) 2: TS_TYPE_PARAMETER_NAME@517..518 0: IDENT@517..518 "T" [] [] 3: (empty) @@ -1963,7 +2254,7 @@ JsModule { 1: (empty) 2: R_PAREN@539..541 ")" [] [Whitespace(" ")] 1: (empty) - 19: JS_UNKNOWN_STATEMENT@541..544 + 19: JS_BOGUS_STATEMENT@541..544 0: FAT_ARROW@541..544 "=>" [] [Whitespace(" ")] 20: JS_BLOCK_STATEMENT@544..546 0: L_CURLY@544..545 "{" [] [] @@ -1977,9 +2268,17 @@ JsModule { 1: TS_TYPE_PARAMETERS@547..556 0: L_ANGLE@547..550 "<" [Newline("\n"), Whitespace("\t")] [] 1: TS_TYPE_PARAMETER_LIST@550..555 - 0: TS_TYPE_PARAMETER@550..555 + 0: TS_TYPE_PARAMETER@550..554 + 0: (empty) + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@550..554 + 0: IDENT@550..554 "out" [] [Whitespace(" ")] + 3: (empty) + 4: (empty) + 1: (empty) + 2: TS_TYPE_PARAMETER@554..555 0: (empty) - 1: OUT_KW@550..554 "out" [] [Whitespace(" ")] + 1: (empty) 2: TS_TYPE_PARAMETER_NAME@554..555 0: IDENT@554..555 "T" [] [] 3: (empty) @@ -2025,7 +2324,7 @@ JsModule { 1: (empty) 2: R_PAREN@581..583 ")" [] [Whitespace(" ")] 1: (empty) - 25: JS_UNKNOWN_STATEMENT@583..586 + 25: JS_BOGUS_STATEMENT@583..586 0: FAT_ARROW@583..586 "=>" [] [Whitespace(" ")] 26: JS_BLOCK_STATEMENT@586..588 0: L_CURLY@586..587 "{" [] [] @@ -2042,12 +2341,14 @@ JsModule { 0: IDENT@595..596 "x" [] [] 1: TS_TYPE_ANNOTATION@596..612 0: COLON@596..598 ":" [] [Whitespace(" ")] - 1: TS_FUNCTION_TYPE@598..612 - 0: TS_TYPE_PARAMETERS@598..604 + 1: TS_BOGUS_TYPE@598..612 + 0: JS_BOGUS@598..604 0: L_ANGLE@598..599 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@599..603 - 0: TS_TYPE_PARAMETER@599..603 + 1: JS_BOGUS@599..603 + 0: TS_BOGUS_TYPE@599..602 0: IN_KW@599..602 "in" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER@602..603 + 0: (empty) 1: (empty) 2: TS_TYPE_PARAMETER_NAME@602..603 0: IDENT@602..603 "T" [] [] @@ -2078,9 +2379,17 @@ JsModule { 0: TS_TYPE_PARAMETERS@622..629 0: L_ANGLE@622..623 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@623..628 - 0: TS_TYPE_PARAMETER@623..628 + 0: TS_TYPE_PARAMETER@623..627 + 0: (empty) + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@623..627 + 0: IDENT@623..627 "out" [] [Whitespace(" ")] + 3: (empty) + 4: (empty) + 1: (empty) + 2: TS_TYPE_PARAMETER@627..628 0: (empty) - 1: OUT_KW@623..627 "out" [] [Whitespace(" ")] + 1: (empty) 2: TS_TYPE_PARAMETER_NAME@627..628 0: IDENT@627..628 "T" [] [] 3: (empty) @@ -2106,21 +2415,30 @@ JsModule { 0: IDENT@644..645 "x" [] [] 1: TS_TYPE_ANNOTATION@645..668 0: COLON@645..647 ":" [] [Whitespace(" ")] - 1: TS_FUNCTION_TYPE@647..668 - 0: TS_TYPE_PARAMETERS@647..660 + 1: TS_BOGUS_TYPE@647..668 + 0: JS_BOGUS@647..660 0: L_ANGLE@647..648 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@648..659 - 0: TS_TYPE_PARAMETER@648..652 + 1: JS_BOGUS@648..659 + 0: TS_BOGUS_TYPE@648..651 0: IN_KW@648..651 "in" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER@651..652 + 0: (empty) 1: (empty) 2: TS_TYPE_PARAMETER_NAME@651..652 0: IDENT@651..652 "T" [] [] 3: (empty) 4: (empty) - 1: COMMA@652..654 "," [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER@654..659 + 2: COMMA@652..654 "," [] [Whitespace(" ")] + 3: TS_TYPE_PARAMETER@654..658 + 0: (empty) + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@654..658 + 0: IDENT@654..658 "out" [] [Whitespace(" ")] + 3: (empty) + 4: (empty) + 4: TS_TYPE_PARAMETER@658..659 0: (empty) - 1: OUT_KW@654..658 "out" [] [Whitespace(" ")] + 1: (empty) 2: TS_TYPE_PARAMETER_NAME@658..659 0: IDENT@658..659 "T" [] [] 3: (empty) @@ -2146,26 +2464,27 @@ JsModule { 0: IDENT@675..676 "x" [] [] 1: TS_TYPE_ANNOTATION@676..696 0: COLON@676..678 ":" [] [Whitespace(" ")] - 1: TS_CONSTRUCTOR_TYPE@678..696 - 0: (empty) - 1: NEW_KW@678..682 "new" [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETERS@682..688 + 1: TS_BOGUS_TYPE@678..696 + 0: NEW_KW@678..682 "new" [] [Whitespace(" ")] + 1: JS_BOGUS@682..688 0: L_ANGLE@682..683 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@683..687 - 0: TS_TYPE_PARAMETER@683..687 + 1: JS_BOGUS@683..687 + 0: TS_BOGUS_TYPE@683..686 0: IN_KW@683..686 "in" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER@686..687 + 0: (empty) 1: (empty) 2: TS_TYPE_PARAMETER_NAME@686..687 0: IDENT@686..687 "T" [] [] 3: (empty) 4: (empty) 2: R_ANGLE@687..688 ">" [] [] - 3: JS_PARAMETERS@688..691 + 2: JS_PARAMETERS@688..691 0: L_PAREN@688..689 "(" [] [] 1: JS_PARAMETER_LIST@689..689 2: R_PAREN@689..691 ")" [] [Whitespace(" ")] - 4: FAT_ARROW@691..694 "=>" [] [Whitespace(" ")] - 5: TS_OBJECT_TYPE@694..696 + 3: FAT_ARROW@691..694 "=>" [] [Whitespace(" ")] + 4: TS_OBJECT_TYPE@694..696 0: L_CURLY@694..695 "{" [] [] 1: TS_TYPE_MEMBER_LIST@695..695 2: R_CURLY@695..696 "}" [] [] @@ -2186,9 +2505,17 @@ JsModule { 2: TS_TYPE_PARAMETERS@710..717 0: L_ANGLE@710..711 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@711..716 - 0: TS_TYPE_PARAMETER@711..716 + 0: TS_TYPE_PARAMETER@711..715 + 0: (empty) + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@711..715 + 0: IDENT@711..715 "out" [] [Whitespace(" ")] + 3: (empty) + 4: (empty) + 1: (empty) + 2: TS_TYPE_PARAMETER@715..716 0: (empty) - 1: OUT_KW@711..715 "out" [] [Whitespace(" ")] + 1: (empty) 2: TS_TYPE_PARAMETER_NAME@715..716 0: IDENT@715..716 "T" [] [] 3: (empty) @@ -2214,34 +2541,42 @@ JsModule { 0: IDENT@732..733 "x" [] [] 1: TS_TYPE_ANNOTATION@733..760 0: COLON@733..735 ":" [] [Whitespace(" ")] - 1: TS_CONSTRUCTOR_TYPE@735..760 - 0: (empty) - 1: NEW_KW@735..739 "new" [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETERS@739..752 + 1: TS_BOGUS_TYPE@735..760 + 0: NEW_KW@735..739 "new" [] [Whitespace(" ")] + 1: JS_BOGUS@739..752 0: L_ANGLE@739..740 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@740..751 - 0: TS_TYPE_PARAMETER@740..744 + 1: JS_BOGUS@740..751 + 0: TS_BOGUS_TYPE@740..743 0: IN_KW@740..743 "in" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER@743..744 + 0: (empty) 1: (empty) 2: TS_TYPE_PARAMETER_NAME@743..744 0: IDENT@743..744 "T" [] [] 3: (empty) 4: (empty) - 1: COMMA@744..746 "," [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER@746..751 + 2: COMMA@744..746 "," [] [Whitespace(" ")] + 3: TS_TYPE_PARAMETER@746..750 + 0: (empty) + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@746..750 + 0: IDENT@746..750 "out" [] [Whitespace(" ")] + 3: (empty) + 4: (empty) + 4: TS_TYPE_PARAMETER@750..751 0: (empty) - 1: OUT_KW@746..750 "out" [] [Whitespace(" ")] + 1: (empty) 2: TS_TYPE_PARAMETER_NAME@750..751 0: IDENT@750..751 "T" [] [] 3: (empty) 4: (empty) 2: R_ANGLE@751..752 ">" [] [] - 3: JS_PARAMETERS@752..755 + 2: JS_PARAMETERS@752..755 0: L_PAREN@752..753 "(" [] [] 1: JS_PARAMETER_LIST@753..753 2: R_PAREN@753..755 ")" [] [Whitespace(" ")] - 4: FAT_ARROW@755..758 "=>" [] [Whitespace(" ")] - 5: TS_OBJECT_TYPE@758..760 + 3: FAT_ARROW@755..758 "=>" [] [Whitespace(" ")] + 4: TS_OBJECT_TYPE@758..760 0: L_CURLY@758..759 "{" [] [] 1: TS_TYPE_MEMBER_LIST@759..759 2: R_CURLY@759..760 "}" [] [] @@ -2256,33 +2591,33 @@ JsModule { 0: IDENT@767..768 "x" [] [] 1: TS_TYPE_ANNOTATION@768..788 0: COLON@768..770 ":" [] [Whitespace(" ")] - 1: TS_OBJECT_TYPE@770..788 + 1: TS_BOGUS_TYPE@770..788 0: L_CURLY@770..772 "{" [] [Whitespace(" ")] - 1: TS_TYPE_MEMBER_LIST@772..787 - 0: TS_METHOD_SIGNATURE_TYPE_MEMBER@772..787 + 1: JS_BOGUS@772..787 + 0: JS_BOGUS@772..787 0: JS_LITERAL_MEMBER_NAME@772..773 0: IDENT@772..773 "y" [] [] - 1: (empty) - 2: TS_TYPE_PARAMETERS@773..779 + 1: JS_BOGUS@773..779 0: L_ANGLE@773..774 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@774..778 - 0: TS_TYPE_PARAMETER@774..778 + 1: JS_BOGUS@774..778 + 0: TS_BOGUS_TYPE@774..777 0: IN_KW@774..777 "in" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER@777..778 + 0: (empty) 1: (empty) 2: TS_TYPE_PARAMETER_NAME@777..778 0: IDENT@777..778 "T" [] [] 3: (empty) 4: (empty) 2: R_ANGLE@778..779 ">" [] [] - 3: JS_PARAMETERS@779..781 + 2: JS_PARAMETERS@779..781 0: L_PAREN@779..780 "(" [] [] 1: JS_PARAMETER_LIST@780..780 2: R_PAREN@780..781 ")" [] [] - 4: TS_RETURN_TYPE_ANNOTATION@781..787 + 3: TS_RETURN_TYPE_ANNOTATION@781..787 0: COLON@781..783 ":" [] [Whitespace(" ")] 1: TS_ANY_TYPE@783..787 0: ANY_KW@783..787 "any" [] [Whitespace(" ")] - 5: (empty) 2: R_CURLY@787..788 "}" [] [] 2: (empty) 1: SEMICOLON@788..789 ";" [] [] @@ -2305,9 +2640,17 @@ JsModule { 2: TS_TYPE_PARAMETERS@801..808 0: L_ANGLE@801..802 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@802..807 - 0: TS_TYPE_PARAMETER@802..807 + 0: TS_TYPE_PARAMETER@802..806 + 0: (empty) + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@802..806 + 0: IDENT@802..806 "out" [] [Whitespace(" ")] + 3: (empty) + 4: (empty) + 1: (empty) + 2: TS_TYPE_PARAMETER@806..807 0: (empty) - 1: OUT_KW@802..806 "out" [] [Whitespace(" ")] + 1: (empty) 2: TS_TYPE_PARAMETER_NAME@806..807 0: IDENT@806..807 "T" [] [] 3: (empty) @@ -2334,306 +2677,845 @@ JsModule { 0: IDENT@824..825 "x" [] [] 1: TS_TYPE_ANNOTATION@825..852 0: COLON@825..827 ":" [] [Whitespace(" ")] - 1: TS_OBJECT_TYPE@827..852 + 1: TS_BOGUS_TYPE@827..852 0: L_CURLY@827..829 "{" [] [Whitespace(" ")] - 1: TS_TYPE_MEMBER_LIST@829..851 - 0: TS_METHOD_SIGNATURE_TYPE_MEMBER@829..851 + 1: JS_BOGUS@829..851 + 0: JS_BOGUS@829..851 0: JS_LITERAL_MEMBER_NAME@829..830 0: IDENT@829..830 "y" [] [] - 1: (empty) - 2: TS_TYPE_PARAMETERS@830..843 + 1: JS_BOGUS@830..843 0: L_ANGLE@830..831 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@831..842 - 0: TS_TYPE_PARAMETER@831..835 + 1: JS_BOGUS@831..842 + 0: TS_BOGUS_TYPE@831..834 0: IN_KW@831..834 "in" [] [Whitespace(" ")] + 1: TS_TYPE_PARAMETER@834..835 + 0: (empty) 1: (empty) 2: TS_TYPE_PARAMETER_NAME@834..835 0: IDENT@834..835 "T" [] [] 3: (empty) 4: (empty) - 1: COMMA@835..837 "," [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER@837..842 + 2: COMMA@835..837 "," [] [Whitespace(" ")] + 3: TS_TYPE_PARAMETER@837..841 + 0: (empty) + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@837..841 + 0: IDENT@837..841 "out" [] [Whitespace(" ")] + 3: (empty) + 4: (empty) + 4: TS_TYPE_PARAMETER@841..842 0: (empty) - 1: OUT_KW@837..841 "out" [] [Whitespace(" ")] + 1: (empty) 2: TS_TYPE_PARAMETER_NAME@841..842 0: IDENT@841..842 "T" [] [] 3: (empty) 4: (empty) 2: R_ANGLE@842..843 ">" [] [] - 3: JS_PARAMETERS@843..845 + 2: JS_PARAMETERS@843..845 0: L_PAREN@843..844 "(" [] [] 1: JS_PARAMETER_LIST@844..844 2: R_PAREN@844..845 ")" [] [] - 4: TS_RETURN_TYPE_ANNOTATION@845..851 + 3: TS_RETURN_TYPE_ANNOTATION@845..851 0: COLON@845..847 ":" [] [Whitespace(" ")] 1: TS_ANY_TYPE@847..851 0: ANY_KW@847..851 "any" [] [Whitespace(" ")] - 5: (empty) 2: R_CURLY@851..852 "}" [] [] 2: (empty) 1: SEMICOLON@852..853 ";" [] [] 3: EOF@853..854 "" [Newline("\n")] [] -- -error[SyntaxError]: TypeParameterModifier `in` is not valid here - ┌─ type_parameter_modifier1.ts:1:30 - │ -1 │ export default function foo() {} - │ ^^ +type_parameter_modifier1.ts:1:30 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + × expected a type parameter but instead found 'in' + + > 1 │ export default function foo() {} + │ ^^ + 2 │ export function foo() {} + 3 │ export function foo1() {} + + i Expected a type parameter here + + > 1 │ export default function foo() {} + │ ^^ + 2 │ export function foo() {} + 3 │ export function foo1() {} + +-- +type_parameter_modifier1.ts:1:33 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + × expected `,` but instead found `T` + + > 1 │ export default function foo() {} + │ ^ + 2 │ export function foo() {} + 3 │ export function foo1() {} + + i Remove T + +-- +type_parameter_modifier1.ts:2:26 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + × expected `,` but instead found `T` + + 1 │ export default function foo() {} + > 2 │ export function foo() {} + │ ^ + 3 │ export function foo1() {} + 4 │ export function foo2() {} + + i Remove T + +-- +type_parameter_modifier1.ts:3:23 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + × expected a type parameter but instead found 'in' + + 1 │ export default function foo() {} + 2 │ export function foo() {} + > 3 │ export function foo1() {} + │ ^^ + 4 │ export function foo2() {} + 5 │ let foo: Foo + + i Expected a type parameter here + + 1 │ export default function foo() {} + 2 │ export function foo() {} + > 3 │ export function foo1() {} + │ ^^ + 4 │ export function foo2() {} + 5 │ let foo: Foo + +-- +type_parameter_modifier1.ts:3:26 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + × expected `,` but instead found `T` + + 1 │ export default function foo() {} + 2 │ export function foo() {} + > 3 │ export function foo1() {} + │ ^ + 4 │ export function foo2() {} + 5 │ let foo: Foo + + i Remove T + +-- +type_parameter_modifier1.ts:4:27 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + × expected `,` but instead found `T` + + 2 │ export function foo() {} + 3 │ export function foo1() {} + > 4 │ export function foo2() {} + │ ^ + 5 │ let foo: Foo + 6 │ let foo: Foo + + i Remove T + +-- +type_parameter_modifier1.ts:5:18 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + × expected `,` but instead found `T` + + 3 │ export function foo1() {} + 4 │ export function foo2() {} + > 5 │ let foo: Foo + │ ^ + 6 │ let foo: Foo + 7 │ declare function foo() + + i Remove T + +-- +type_parameter_modifier1.ts:6:19 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + × expected `,` but instead found `T` + + 4 │ export function foo2() {} + 5 │ let foo: Foo + > 6 │ let foo: Foo + │ ^ + 7 │ declare function foo() + 8 │ declare function foo() + + i Remove T + +-- +type_parameter_modifier1.ts:7:23 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + × expected a type parameter but instead found 'in' + + 5 │ let foo: Foo + 6 │ let foo: Foo + > 7 │ declare function foo() + │ ^^ + 8 │ declare function foo() + 9 │ declare let foo: Foo + + i Expected a type parameter here + + 5 │ let foo: Foo + 6 │ let foo: Foo + > 7 │ declare function foo() + │ ^^ + 8 │ declare function foo() + 9 │ declare let foo: Foo + +-- +type_parameter_modifier1.ts:7:26 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + × expected `,` but instead found `T` + + 5 │ let foo: Foo + 6 │ let foo: Foo + > 7 │ declare function foo() + │ ^ + 8 │ declare function foo() + 9 │ declare let foo: Foo + + i Remove T + +-- +type_parameter_modifier1.ts:8:27 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + × expected `,` but instead found `T` + + 6 │ let foo: Foo + 7 │ declare function foo() + > 8 │ declare function foo() + │ ^ + 9 │ declare let foo: Foo + 10 │ declare let foo: Foo + + i Remove T + +-- +type_parameter_modifier1.ts:9:26 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + × expected `,` but instead found `T` + + 7 │ declare function foo() + 8 │ declare function foo() + > 9 │ declare let foo: Foo + │ ^ + 10 │ declare let foo: Foo + 11 │ Foo = class {} + + i Remove T + +-- +type_parameter_modifier1.ts:10:27 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected `,` but instead found `T` + + 8 │ declare function foo() + 9 │ declare let foo: Foo + > 10 │ declare let foo: Foo + │ ^ + 11 │ Foo = class {} + 12 │ Foo = class {} + + i Remove T + -- -error[SyntaxError]: TypeParameterModifier `out` is not valid here - ┌─ type_parameter_modifier1.ts:2:22 - │ -2 │ export function foo() {} - │ ^^^ +type_parameter_modifier1.ts:13:18 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected a type parameter but instead found 'in' + + 11 │ Foo = class {} + 12 │ Foo = class {} + > 13 │ foo = function () {} + │ ^^ + 14 │ foo = function () {} + 15 │ class Foo { foo(): T {} } + + i Expected a type parameter here + + 11 │ Foo = class {} + 12 │ Foo = class {} + > 13 │ foo = function () {} + │ ^^ + 14 │ foo = function () {} + 15 │ class Foo { foo(): T {} } + -- -error[SyntaxError]: TypeParameterModifier `in` is not valid here - ┌─ type_parameter_modifier1.ts:3:23 - │ -3 │ export function foo1() {} - │ ^^ +type_parameter_modifier1.ts:13:21 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected `,` but instead found `T` + + 11 │ Foo = class {} + 12 │ Foo = class {} + > 13 │ foo = function () {} + │ ^ + 14 │ foo = function () {} + 15 │ class Foo { foo(): T {} } + + i Remove T + -- -error[SyntaxError]: TypeParameterModifier `out` is not valid here - ┌─ type_parameter_modifier1.ts:4:23 - │ -4 │ export function foo2() {} - │ ^^^ +type_parameter_modifier1.ts:14:22 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected `,` but instead found `T` + + 12 │ Foo = class {} + 13 │ foo = function () {} + > 14 │ foo = function () {} + │ ^ + 15 │ class Foo { foo(): T {} } + 16 │ class Foo { foo(): T {} } + + i Remove T + -- -error[SyntaxError]: expected `,` but instead found `T` - ┌─ type_parameter_modifier1.ts:5:18 - │ -5 │ let foo: Foo - │ ^ unexpected +type_parameter_modifier1.ts:15:18 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected a type parameter but instead found 'in' + + 13 │ foo = function () {} + 14 │ foo = function () {} + > 15 │ class Foo { foo(): T {} } + │ ^^ + 16 │ class Foo { foo(): T {} } + 17 │ foo = { foo(): T {} }; + + i Expected a type parameter here + + 13 │ foo = function () {} + 14 │ foo = function () {} + > 15 │ class Foo { foo(): T {} } + │ ^^ + 16 │ class Foo { foo(): T {} } + 17 │ foo = { foo(): T {} }; + -- -error[SyntaxError]: expected `,` but instead found `T` - ┌─ type_parameter_modifier1.ts:6:19 - │ -6 │ let foo: Foo - │ ^ unexpected +type_parameter_modifier1.ts:15:21 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected `,` but instead found `T` + + 13 │ foo = function () {} + 14 │ foo = function () {} + > 15 │ class Foo { foo(): T {} } + │ ^ + 16 │ class Foo { foo(): T {} } + 17 │ foo = { foo(): T {} }; + + i Remove T + -- -error[SyntaxError]: TypeParameterModifier `in` is not valid here - ┌─ type_parameter_modifier1.ts:7:23 - │ -7 │ declare function foo() - │ ^^ +type_parameter_modifier1.ts:16:22 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected `,` but instead found `T` + + 14 │ foo = function () {} + 15 │ class Foo { foo(): T {} } + > 16 │ class Foo { foo(): T {} } + │ ^ + 17 │ foo = { foo(): T {} }; + 18 │ foo = { foo(): T {} }; + + i Remove T + -- -error[SyntaxError]: TypeParameterModifier `out` is not valid here - ┌─ type_parameter_modifier1.ts:8:23 - │ -8 │ declare function foo() - │ ^^^ +type_parameter_modifier1.ts:17:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected a type parameter but instead found 'in' + + 15 │ class Foo { foo(): T {} } + 16 │ class Foo { foo(): T {} } + > 17 │ foo = { foo(): T {} }; + │ ^^ + 18 │ foo = { foo(): T {} }; + 19 │ () => {}; + + i Expected a type parameter here + + 15 │ class Foo { foo(): T {} } + 16 │ class Foo { foo(): T {} } + > 17 │ foo = { foo(): T {} }; + │ ^^ + 18 │ foo = { foo(): T {} }; + 19 │ () => {}; + -- -error[SyntaxError]: expected `,` but instead found `T` - ┌─ type_parameter_modifier1.ts:9:26 - │ -9 │ declare let foo: Foo - │ ^ unexpected +type_parameter_modifier1.ts:17:17 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected `,` but instead found `T` + + 15 │ class Foo { foo(): T {} } + 16 │ class Foo { foo(): T {} } + > 17 │ foo = { foo(): T {} }; + │ ^ + 18 │ foo = { foo(): T {} }; + 19 │ () => {}; + + i Remove T + -- -error[SyntaxError]: expected `,` but instead found `T` - ┌─ type_parameter_modifier1.ts:10:27 - │ -10 │ declare let foo: Foo - │ ^ unexpected +type_parameter_modifier1.ts:18:18 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected `,` but instead found `T` + + 16 │ class Foo { foo(): T {} } + 17 │ foo = { foo(): T {} }; + > 18 │ foo = { foo(): T {} }; + │ ^ + 19 │ () => {}; + 20 │ () => {}; + + i Remove T + -- -error[SyntaxError]: TypeParameterModifier `in` is not valid here - ┌─ type_parameter_modifier1.ts:13:18 - │ -13 │ foo = function () {} - │ ^^ +type_parameter_modifier1.ts:19:6 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected `>` but instead found `T` + + 17 │ foo = { foo(): T {} }; + 18 │ foo = { foo(): T {} }; + > 19 │ () => {}; + │ ^ + 20 │ () => {}; + 21 │ () => {}; + + i Remove T + -- -error[SyntaxError]: TypeParameterModifier `out` is not valid here - ┌─ type_parameter_modifier1.ts:14:18 - │ -14 │ foo = function () {} - │ ^^^ +type_parameter_modifier1.ts:19:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × Parenthesized expression didnt contain anything + + 17 │ foo = { foo(): T {} }; + 18 │ foo = { foo(): T {} }; + > 19 │ () => {}; + │ ^ + 20 │ () => {}; + 21 │ () => {}; + + i Expected an expression here + -- -error[SyntaxError]: TypeParameterModifier `in` is not valid here - ┌─ type_parameter_modifier1.ts:15:18 - │ -15 │ class Foo { foo(): T {} } - │ ^^ +type_parameter_modifier1.ts:19:11 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × Expected a semicolon or an implicit semicolon after a statement, but found none + + 17 │ foo = { foo(): T {} }; + 18 │ foo = { foo(): T {} }; + > 19 │ () => {}; + │ ^^ + 20 │ () => {}; + 21 │ () => {}; + + i An explicit or implicit semicolon is expected here... + + 17 │ foo = { foo(): T {} }; + 18 │ foo = { foo(): T {} }; + > 19 │ () => {}; + │ ^^ + 20 │ () => {}; + 21 │ () => {}; + + i ...Which is required to end this statement + + 17 │ foo = { foo(): T {} }; + 18 │ foo = { foo(): T {} }; + > 19 │ () => {}; + │ ^^^^^^^^^^^ + 20 │ () => {}; + 21 │ () => {}; + -- -error[SyntaxError]: TypeParameterModifier `out` is not valid here - ┌─ type_parameter_modifier1.ts:16:18 - │ -16 │ class Foo { foo(): T {} } - │ ^^^ +type_parameter_modifier1.ts:20:7 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected `,` but instead found `T` + + 18 │ foo = { foo(): T {} }; + 19 │ () => {}; + > 20 │ () => {}; + │ ^ + 21 │ () => {}; + 22 │ let x: () => {}; + + i Remove T + -- -error[SyntaxError]: TypeParameterModifier `in` is not valid here - ┌─ type_parameter_modifier1.ts:17:14 - │ -17 │ foo = { foo(): T {} }; - │ ^^ +type_parameter_modifier1.ts:21:6 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected `>` but instead found `T` + + 19 │ () => {}; + 20 │ () => {}; + > 21 │ () => {}; + │ ^ + 22 │ let x: () => {}; + 23 │ let x: () => {}; + + i Remove T + -- -error[SyntaxError]: TypeParameterModifier `out` is not valid here - ┌─ type_parameter_modifier1.ts:18:14 - │ -18 │ foo = { foo(): T {} }; - │ ^^^ +type_parameter_modifier1.ts:21:13 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × Expected a semicolon or an implicit semicolon after a statement, but found none + + 19 │ () => {}; + 20 │ () => {}; + > 21 │ () => {}; + │ ^ + 22 │ let x: () => {}; + 23 │ let x: () => {}; + + i An explicit or implicit semicolon is expected here... + + 19 │ () => {}; + 20 │ () => {}; + > 21 │ () => {}; + │ ^ + 22 │ let x: () => {}; + 23 │ let x: () => {}; + + i ...Which is required to end this statement + + 19 │ () => {}; + 20 │ () => {}; + > 21 │ () => {}; + │ ^^^^^^^^^^^^ + 22 │ let x: () => {}; + 23 │ let x: () => {}; + -- -error[SyntaxError]: expected `>` but instead found `T` - ┌─ type_parameter_modifier1.ts:19:6 - │ -19 │ () => {}; - │ ^ unexpected +type_parameter_modifier1.ts:21:16 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × Parenthesized expression didnt contain anything + + 19 │ () => {}; + 20 │ () => {}; + > 21 │ () => {}; + │ ^ + 22 │ let x: () => {}; + 23 │ let x: () => {}; + + i Expected an expression here + -- -error[SyntaxError]: Parenthesized expression didnt contain anything - ┌─ type_parameter_modifier1.ts:19:9 - │ -19 │ () => {}; - │ ^ Expected an expression here +type_parameter_modifier1.ts:21:18 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × Expected a semicolon or an implicit semicolon after a statement, but found none + + 19 │ () => {}; + 20 │ () => {}; + > 21 │ () => {}; + │ ^^ + 22 │ let x: () => {}; + 23 │ let x: () => {}; + + i An explicit or implicit semicolon is expected here... + + 19 │ () => {}; + 20 │ () => {}; + > 21 │ () => {}; + │ ^^ + 22 │ let x: () => {}; + 23 │ let x: () => {}; + + i ...Which is required to end this statement + + 19 │ () => {}; + 20 │ () => {}; + > 21 │ () => {}; + │ ^^^^^^^ + 22 │ let x: () => {}; + 23 │ let x: () => {}; + -- -error[SyntaxError]: Expected a semicolon or an implicit semicolon after a statement, but found none - ┌─ type_parameter_modifier1.ts:19:11 - │ -19 │ () => {}; - │ ---------^^ - │ │ │ - │ │ An explicit or implicit semicolon is expected here... - │ ...Which is required to end this statement +type_parameter_modifier1.ts:22:10 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected a type parameter but instead found 'in' + + 20 │ () => {}; + 21 │ () => {}; + > 22 │ let x: () => {}; + │ ^^ + 23 │ let x: () => {}; + 24 │ let x: () => {}; + + i Expected a type parameter here + + 20 │ () => {}; + 21 │ () => {}; + > 22 │ let x: () => {}; + │ ^^ + 23 │ let x: () => {}; + 24 │ let x: () => {}; + -- -error[SyntaxError]: TypeParameterModifier `out` is not valid here - ┌─ type_parameter_modifier1.ts:20:3 - │ -20 │ () => {}; - │ ^^^ +type_parameter_modifier1.ts:22:13 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected `,` but instead found `T` + + 20 │ () => {}; + 21 │ () => {}; + > 22 │ let x: () => {}; + │ ^ + 23 │ let x: () => {}; + 24 │ let x: () => {}; + + i Remove T + -- -error[SyntaxError]: expected `>` but instead found `T` - ┌─ type_parameter_modifier1.ts:21:6 - │ -21 │ () => {}; - │ ^ unexpected +type_parameter_modifier1.ts:23:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected `,` but instead found `T` + + 21 │ () => {}; + 22 │ let x: () => {}; + > 23 │ let x: () => {}; + │ ^ + 24 │ let x: () => {}; + 25 │ let x: new () => {}; + + i Remove T + -- -error[SyntaxError]: Expected a semicolon or an implicit semicolon after a statement, but found none - ┌─ type_parameter_modifier1.ts:21:13 - │ -21 │ () => {}; - │ -----------^ - │ │ │ - │ │ An explicit or implicit semicolon is expected here... - │ ...Which is required to end this statement +type_parameter_modifier1.ts:24:10 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected a type parameter but instead found 'in' + + 22 │ let x: () => {}; + 23 │ let x: () => {}; + > 24 │ let x: () => {}; + │ ^^ + 25 │ let x: new () => {}; + 26 │ let x: new () => {}; + + i Expected a type parameter here + + 22 │ let x: () => {}; + 23 │ let x: () => {}; + > 24 │ let x: () => {}; + │ ^^ + 25 │ let x: new () => {}; + 26 │ let x: new () => {}; + -- -error[SyntaxError]: Parenthesized expression didnt contain anything - ┌─ type_parameter_modifier1.ts:21:16 - │ -21 │ () => {}; - │ ^ Expected an expression here +type_parameter_modifier1.ts:24:13 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected `,` but instead found `T` + + 22 │ let x: () => {}; + 23 │ let x: () => {}; + > 24 │ let x: () => {}; + │ ^ + 25 │ let x: new () => {}; + 26 │ let x: new () => {}; + + i Remove T + -- -error[SyntaxError]: Expected a semicolon or an implicit semicolon after a statement, but found none - ┌─ type_parameter_modifier1.ts:21:18 - │ -21 │ () => {}; - │ -----^^ - │ │ │ - │ │ An explicit or implicit semicolon is expected here... - │ ...Which is required to end this statement +type_parameter_modifier1.ts:24:20 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected `,` but instead found `T` + + 22 │ let x: () => {}; + 23 │ let x: () => {}; + > 24 │ let x: () => {}; + │ ^ + 25 │ let x: new () => {}; + 26 │ let x: new () => {}; + + i Remove T + -- -error[SyntaxError]: TypeParameterModifier `in` is not valid here - ┌─ type_parameter_modifier1.ts:22:10 - │ -22 │ let x: () => {}; - │ ^^ +type_parameter_modifier1.ts:25:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected a type parameter but instead found 'in' + + 23 │ let x: () => {}; + 24 │ let x: () => {}; + > 25 │ let x: new () => {}; + │ ^^ + 26 │ let x: new () => {}; + 27 │ let x: new () => {}; + + i Expected a type parameter here + + 23 │ let x: () => {}; + 24 │ let x: () => {}; + > 25 │ let x: new () => {}; + │ ^^ + 26 │ let x: new () => {}; + 27 │ let x: new () => {}; + -- -error[SyntaxError]: TypeParameterModifier `out` is not valid here - ┌─ type_parameter_modifier1.ts:23:10 - │ -23 │ let x: () => {}; - │ ^^^ +type_parameter_modifier1.ts:25:17 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected `,` but instead found `T` + + 23 │ let x: () => {}; + 24 │ let x: () => {}; + > 25 │ let x: new () => {}; + │ ^ + 26 │ let x: new () => {}; + 27 │ let x: new () => {}; + + i Remove T + -- -error[SyntaxError]: TypeParameterModifier `in` is not valid here - ┌─ type_parameter_modifier1.ts:24:10 - │ -24 │ let x: () => {}; - │ ^^ +type_parameter_modifier1.ts:26:18 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected `,` but instead found `T` + + 24 │ let x: () => {}; + 25 │ let x: new () => {}; + > 26 │ let x: new () => {}; + │ ^ + 27 │ let x: new () => {}; + 28 │ let x: { y(): any }; + + i Remove T + -- -error[SyntaxError]: TypeParameterModifier `out` is not valid here - ┌─ type_parameter_modifier1.ts:24:16 - │ -24 │ let x: () => {}; - │ ^^^ +type_parameter_modifier1.ts:27:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected a type parameter but instead found 'in' + + 25 │ let x: new () => {}; + 26 │ let x: new () => {}; + > 27 │ let x: new () => {}; + │ ^^ + 28 │ let x: { y(): any }; + 29 │ let x: { y(): any }; + + i Expected a type parameter here + + 25 │ let x: new () => {}; + 26 │ let x: new () => {}; + > 27 │ let x: new () => {}; + │ ^^ + 28 │ let x: { y(): any }; + 29 │ let x: { y(): any }; + -- -error[SyntaxError]: TypeParameterModifier `in` is not valid here - ┌─ type_parameter_modifier1.ts:25:14 - │ -25 │ let x: new () => {}; - │ ^^ +type_parameter_modifier1.ts:27:17 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected `,` but instead found `T` + + 25 │ let x: new () => {}; + 26 │ let x: new () => {}; + > 27 │ let x: new () => {}; + │ ^ + 28 │ let x: { y(): any }; + 29 │ let x: { y(): any }; + + i Remove T + -- -error[SyntaxError]: TypeParameterModifier `out` is not valid here - ┌─ type_parameter_modifier1.ts:26:14 - │ -26 │ let x: new () => {}; - │ ^^^ +type_parameter_modifier1.ts:27:24 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected `,` but instead found `T` + + 25 │ let x: new () => {}; + 26 │ let x: new () => {}; + > 27 │ let x: new () => {}; + │ ^ + 28 │ let x: { y(): any }; + 29 │ let x: { y(): any }; + + i Remove T + -- -error[SyntaxError]: TypeParameterModifier `in` is not valid here - ┌─ type_parameter_modifier1.ts:27:14 - │ -27 │ let x: new () => {}; - │ ^^ +type_parameter_modifier1.ts:28:13 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected a type parameter but instead found 'in' + + 26 │ let x: new () => {}; + 27 │ let x: new () => {}; + > 28 │ let x: { y(): any }; + │ ^^ + 29 │ let x: { y(): any }; + 30 │ let x: { y(): any }; + + i Expected a type parameter here + + 26 │ let x: new () => {}; + 27 │ let x: new () => {}; + > 28 │ let x: { y(): any }; + │ ^^ + 29 │ let x: { y(): any }; + 30 │ let x: { y(): any }; + -- -error[SyntaxError]: TypeParameterModifier `out` is not valid here - ┌─ type_parameter_modifier1.ts:27:20 - │ -27 │ let x: new () => {}; - │ ^^^ +type_parameter_modifier1.ts:28:16 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected `,` but instead found `T` + + 26 │ let x: new () => {}; + 27 │ let x: new () => {}; + > 28 │ let x: { y(): any }; + │ ^ + 29 │ let x: { y(): any }; + 30 │ let x: { y(): any }; + + i Remove T + -- -error[SyntaxError]: TypeParameterModifier `in` is not valid here - ┌─ type_parameter_modifier1.ts:28:13 - │ -28 │ let x: { y(): any }; - │ ^^ +type_parameter_modifier1.ts:29:17 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected `,` but instead found `T` + + 27 │ let x: new () => {}; + 28 │ let x: { y(): any }; + > 29 │ let x: { y(): any }; + │ ^ + 30 │ let x: { y(): any }; + 31 │ + + i Remove T + -- -error[SyntaxError]: TypeParameterModifier `out` is not valid here - ┌─ type_parameter_modifier1.ts:29:13 - │ -29 │ let x: { y(): any }; - │ ^^^ +type_parameter_modifier1.ts:30:13 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected a type parameter but instead found 'in' + + 28 │ let x: { y(): any }; + 29 │ let x: { y(): any }; + > 30 │ let x: { y(): any }; + │ ^^ + 31 │ + + i Expected a type parameter here + + 28 │ let x: { y(): any }; + 29 │ let x: { y(): any }; + > 30 │ let x: { y(): any }; + │ ^^ + 31 │ + -- -error[SyntaxError]: TypeParameterModifier `in` is not valid here - ┌─ type_parameter_modifier1.ts:30:13 - │ -30 │ let x: { y(): any }; - │ ^^ +type_parameter_modifier1.ts:30:16 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected `,` but instead found `T` + + 28 │ let x: { y(): any }; + 29 │ let x: { y(): any }; + > 30 │ let x: { y(): any }; + │ ^ + 31 │ + + i Remove T + -- -error[SyntaxError]: TypeParameterModifier `out` is not valid here - ┌─ type_parameter_modifier1.ts:30:19 - │ -30 │ let x: { y(): any }; - │ ^^^ +type_parameter_modifier1.ts:30:23 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + × expected `,` but instead found `T` + + 28 │ let x: { y(): any }; + 29 │ let x: { y(): any }; + > 30 │ let x: { y(): any }; + │ ^ + 31 │ + + i Remove T + -- export default function foo() {} export function foo() {} diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_conditional_type.rast b/crates/rome_js_parser/test_data/inline/ok/ts_conditional_type.rast index 6da4e41e738..0e574dc540a 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_conditional_type.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_conditional_type.rast @@ -102,6 +102,8 @@ JsModule { l_angle_token: L_ANGLE@141..142 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@142..143 "T" [] [], }, @@ -172,6 +174,8 @@ JsModule { l_angle_token: L_ANGLE@215..216 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@216..217 "U" [] [], }, @@ -180,6 +184,8 @@ JsModule { }, COMMA@217..219 "," [] [Whitespace(" ")], TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@219..220 "T" [] [], }, @@ -255,6 +261,8 @@ JsModule { l_angle_token: L_ANGLE@282..283 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@283..284 "T" [] [], }, @@ -345,6 +353,8 @@ JsModule { l_angle_token: L_ANGLE@360..361 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@361..362 "T" [] [], }, @@ -478,6 +488,8 @@ JsModule { l_angle_token: L_ANGLE@483..484 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@484..485 "T" [] [], }, @@ -634,10 +646,12 @@ JsModule { 0: L_ANGLE@141..142 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@142..143 0: TS_TYPE_PARAMETER@142..143 - 0: TS_TYPE_PARAMETER_NAME@142..143 - 0: IDENT@142..143 "T" [] [] + 0: (empty) 1: (empty) - 2: (empty) + 2: TS_TYPE_PARAMETER_NAME@142..143 + 0: IDENT@142..143 "T" [] [] + 3: (empty) + 4: (empty) 2: R_ANGLE@143..145 ">" [] [Whitespace(" ")] 3: EQ@145..147 "=" [] [Whitespace(" ")] 4: TS_CONDITIONAL_TYPE@147..207 @@ -683,16 +697,20 @@ JsModule { 0: L_ANGLE@215..216 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@216..220 0: TS_TYPE_PARAMETER@216..217 - 0: TS_TYPE_PARAMETER_NAME@216..217 - 0: IDENT@216..217 "U" [] [] + 0: (empty) 1: (empty) - 2: (empty) + 2: TS_TYPE_PARAMETER_NAME@216..217 + 0: IDENT@216..217 "U" [] [] + 3: (empty) + 4: (empty) 1: COMMA@217..219 "," [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER@219..220 - 0: TS_TYPE_PARAMETER_NAME@219..220 - 0: IDENT@219..220 "T" [] [] + 0: (empty) 1: (empty) - 2: (empty) + 2: TS_TYPE_PARAMETER_NAME@219..220 + 0: IDENT@219..220 "T" [] [] + 3: (empty) + 4: (empty) 2: R_ANGLE@220..222 ">" [] [Whitespace(" ")] 3: EQ@222..224 "=" [] [Whitespace(" ")] 4: TS_CONDITIONAL_TYPE@224..275 @@ -742,10 +760,12 @@ JsModule { 0: L_ANGLE@282..283 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@283..284 0: TS_TYPE_PARAMETER@283..284 - 0: TS_TYPE_PARAMETER_NAME@283..284 - 0: IDENT@283..284 "T" [] [] + 0: (empty) 1: (empty) - 2: (empty) + 2: TS_TYPE_PARAMETER_NAME@283..284 + 0: IDENT@283..284 "T" [] [] + 3: (empty) + 4: (empty) 2: R_ANGLE@284..286 ">" [] [Whitespace(" ")] 3: EQ@286..288 "=" [] [Whitespace(" ")] 4: TS_CONDITIONAL_TYPE@288..352 @@ -809,10 +829,12 @@ JsModule { 0: L_ANGLE@360..361 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@361..362 0: TS_TYPE_PARAMETER@361..362 - 0: TS_TYPE_PARAMETER_NAME@361..362 - 0: IDENT@361..362 "T" [] [] + 0: (empty) 1: (empty) - 2: (empty) + 2: TS_TYPE_PARAMETER_NAME@361..362 + 0: IDENT@361..362 "T" [] [] + 3: (empty) + 4: (empty) 2: R_ANGLE@362..364 ">" [] [Whitespace(" ")] 3: EQ@364..366 "=" [] [Whitespace(" ")] 4: TS_CONDITIONAL_TYPE@366..421 @@ -903,10 +925,12 @@ JsModule { 0: L_ANGLE@483..484 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@484..485 0: TS_TYPE_PARAMETER@484..485 - 0: TS_TYPE_PARAMETER_NAME@484..485 - 0: IDENT@484..485 "T" [] [] + 0: (empty) 1: (empty) - 2: (empty) + 2: TS_TYPE_PARAMETER_NAME@484..485 + 0: IDENT@484..485 "T" [] [] + 3: (empty) + 4: (empty) 2: R_ANGLE@485..487 ">" [] [Whitespace(" ")] 3: EQ@487..489 "=" [] [Whitespace(" ")] 4: TS_CONDITIONAL_TYPE@489..552 diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_instantiation_expressions.rast b/crates/rome_js_parser/test_data/inline/ok/ts_instantiation_expressions.rast index 14f0eab6d39..0e445ad7a75 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_instantiation_expressions.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_instantiation_expressions.rast @@ -781,6 +781,8 @@ JsModule { l_angle_token: L_ANGLE@516..517 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@517..518 "T" [] [], }, @@ -833,6 +835,8 @@ JsModule { l_angle_token: L_ANGLE@537..538 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@538..539 "T" [] [], }, @@ -1510,10 +1514,12 @@ JsModule { 0: L_ANGLE@516..517 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@517..518 0: TS_TYPE_PARAMETER@517..518 - 0: TS_TYPE_PARAMETER_NAME@517..518 - 0: IDENT@517..518 "T" [] [] + 0: (empty) 1: (empty) - 2: (empty) + 2: TS_TYPE_PARAMETER_NAME@517..518 + 0: IDENT@517..518 "T" [] [] + 3: (empty) + 4: (empty) 2: R_ANGLE@518..519 ">" [] [] 1: JS_PARAMETERS@519..522 0: L_PAREN@519..520 "(" [] [] @@ -1546,10 +1552,12 @@ JsModule { 0: L_ANGLE@537..538 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@538..539 0: TS_TYPE_PARAMETER@538..539 - 0: TS_TYPE_PARAMETER_NAME@538..539 - 0: IDENT@538..539 "T" [] [] + 0: (empty) 1: (empty) - 2: (empty) + 2: TS_TYPE_PARAMETER_NAME@538..539 + 0: IDENT@538..539 "T" [] [] + 3: (empty) + 4: (empty) 2: R_ANGLE@539..540 ">" [] [] 1: JS_PARAMETERS@540..543 0: L_PAREN@540..541 "(" [] [] diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_satisfies_assignment.rast b/crates/rome_js_parser/test_data/inline/ok/ts_satisfies_assignment.rast index 91212795474..28e4e2a95e7 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_satisfies_assignment.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_satisfies_assignment.rast @@ -31,6 +31,8 @@ JsModule { l_angle_token: L_ANGLE@18..19 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@19..20 "A" [] [], }, @@ -300,10 +302,12 @@ JsModule { 0: L_ANGLE@18..19 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@19..20 0: TS_TYPE_PARAMETER@19..20 - 0: TS_TYPE_PARAMETER_NAME@19..20 - 0: IDENT@19..20 "A" [] [] + 0: (empty) 1: (empty) - 2: (empty) + 2: TS_TYPE_PARAMETER_NAME@19..20 + 0: IDENT@19..20 "A" [] [] + 3: (empty) + 4: (empty) 2: R_ANGLE@20..22 ">" [] [Whitespace(" ")] 3: EQ@22..24 "=" [] [Whitespace(" ")] 4: TS_OBJECT_TYPE@24..32 diff --git a/crates/rome_js_parser/test_data/inline/ok/ts_typeof_type.rast b/crates/rome_js_parser/test_data/inline/ok/ts_typeof_type.rast index 0ce8fcc79c2..f4a002f9a9b 100644 --- a/crates/rome_js_parser/test_data/inline/ok/ts_typeof_type.rast +++ b/crates/rome_js_parser/test_data/inline/ok/ts_typeof_type.rast @@ -71,6 +71,8 @@ JsModule { l_angle_token: L_ANGLE@74..75 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), name: TsTypeParameterName { ident_token: IDENT@75..76 "U" [] [], }, @@ -170,10 +172,12 @@ JsModule { 0: L_ANGLE@74..75 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@75..76 0: TS_TYPE_PARAMETER@75..76 - 0: TS_TYPE_PARAMETER_NAME@75..76 - 0: IDENT@75..76 "U" [] [] + 0: (empty) 1: (empty) - 2: (empty) + 2: TS_TYPE_PARAMETER_NAME@75..76 + 0: IDENT@75..76 "U" [] [] + 3: (empty) + 4: (empty) 2: R_ANGLE@76..78 ">" [] [Whitespace(" ")] 3: EQ@78..80 "=" [] [Whitespace(" ")] 4: TS_REFERENCE_TYPE@80..109 diff --git a/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.rast b/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.rast index 94a113571f3..55d8a74c891 100644 --- a/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.rast +++ b/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.rast @@ -23,40 +23,38 @@ JsModule { r_angle_token: R_ANGLE@13..15 ">" [] [Whitespace(" ")], }, eq_token: EQ@15..17 "=" [] [Whitespace(" ")], - ty: TsReferenceType { - name: JsReferenceIdentifier { - value_token: IDENT@17..18 "T" [] [], - }, - type_arguments: missing (optional), + ty: TsObjectType { + l_curly_token: L_CURLY@17..18 "{" [] [], + members: TsTypeMemberList [], + r_curly_token: R_CURLY@18..19 "}" [] [], }, semicolon_token: missing (optional), }, TsTypeAliasDeclaration { - type_token: TYPE_KW@18..24 "type" [Newline("\n")] [Whitespace(" ")], + type_token: TYPE_KW@19..25 "type" [Newline("\n")] [Whitespace(" ")], binding_identifier: TsIdentifierBinding { - name_token: IDENT@24..27 "Foo" [] [], + name_token: IDENT@25..28 "Foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@27..28 "<" [] [], + l_angle_token: L_ANGLE@28..29 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), out_modifier_token: missing (optional), name: TsTypeParameterName { - ident_token: IDENT@28..31 "out" [] [], + ident_token: IDENT@29..32 "out" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@31..33 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@32..34 ">" [] [Whitespace(" ")], }, - eq_token: EQ@33..35 "=" [] [Whitespace(" ")], - ty: TsReferenceType { - name: JsReferenceIdentifier { - value_token: IDENT@35..38 "out" [] [], - }, - type_arguments: missing (optional), + eq_token: EQ@34..36 "=" [] [Whitespace(" ")], + ty: TsObjectType { + l_curly_token: L_CURLY@36..37 "{" [] [], + members: TsTypeMemberList [], + r_curly_token: R_CURLY@37..38 "}" [] [], }, semicolon_token: missing (optional), }, @@ -81,150 +79,132 @@ JsModule { r_angle_token: R_ANGLE@53..55 ">" [] [Whitespace(" ")], }, eq_token: EQ@55..57 "=" [] [Whitespace(" ")], - ty: TsReferenceType { - name: JsReferenceIdentifier { - value_token: IDENT@57..58 "T" [] [], - }, - type_arguments: missing (optional), + ty: TsObjectType { + l_curly_token: L_CURLY@57..58 "{" [] [], + members: TsTypeMemberList [], + r_curly_token: R_CURLY@58..59 "}" [] [], }, semicolon_token: missing (optional), }, TsTypeAliasDeclaration { - type_token: TYPE_KW@58..64 "type" [Newline("\n")] [Whitespace(" ")], + type_token: TYPE_KW@59..65 "type" [Newline("\n")] [Whitespace(" ")], binding_identifier: TsIdentifierBinding { - name_token: IDENT@64..67 "Foo" [] [], + name_token: IDENT@65..68 "Foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@67..68 "<" [] [], + l_angle_token: L_ANGLE@68..69 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - in_modifier_token: IN_KW@68..71 "in" [] [Whitespace(" ")], + in_modifier_token: IN_KW@69..72 "in" [] [Whitespace(" ")], out_modifier_token: missing (optional), name: TsTypeParameterName { - ident_token: IDENT@71..74 "out" [] [], + ident_token: IDENT@72..75 "out" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@74..76 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@75..77 ">" [] [Whitespace(" ")], }, - eq_token: EQ@76..78 "=" [] [Whitespace(" ")], - ty: TsReferenceType { - name: JsReferenceIdentifier { - value_token: IDENT@78..79 "T" [] [], - }, - type_arguments: missing (optional), + eq_token: EQ@77..79 "=" [] [Whitespace(" ")], + ty: TsObjectType { + l_curly_token: L_CURLY@79..80 "{" [] [], + members: TsTypeMemberList [], + r_curly_token: R_CURLY@80..81 "}" [] [], }, semicolon_token: missing (optional), }, TsTypeAliasDeclaration { - type_token: TYPE_KW@79..85 "type" [Newline("\n")] [Whitespace(" ")], + type_token: TYPE_KW@81..87 "type" [Newline("\n")] [Whitespace(" ")], binding_identifier: TsIdentifierBinding { - name_token: IDENT@85..88 "Foo" [] [], + name_token: IDENT@87..90 "Foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@88..89 "<" [] [], + l_angle_token: L_ANGLE@90..91 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: OUT_KW@89..93 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@91..95 "out" [] [Whitespace(" ")], name: TsTypeParameterName { - ident_token: IDENT@93..96 "out" [] [], + ident_token: IDENT@95..98 "out" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@96..98 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@98..100 ">" [] [Whitespace(" ")], }, - eq_token: EQ@98..100 "=" [] [Whitespace(" ")], - ty: TsReferenceType { - name: JsReferenceIdentifier { - value_token: IDENT@100..101 "T" [] [], - }, - type_arguments: missing (optional), + eq_token: EQ@100..102 "=" [] [Whitespace(" ")], + ty: TsObjectType { + l_curly_token: L_CURLY@102..103 "{" [] [], + members: TsTypeMemberList [], + r_curly_token: R_CURLY@103..104 "}" [] [], }, semicolon_token: missing (optional), }, TsTypeAliasDeclaration { - type_token: TYPE_KW@101..107 "type" [Newline("\n")] [Whitespace(" ")], + type_token: TYPE_KW@104..110 "type" [Newline("\n")] [Whitespace(" ")], binding_identifier: TsIdentifierBinding { - name_token: IDENT@107..110 "Foo" [] [], + name_token: IDENT@110..113 "Foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@110..111 "<" [] [], + l_angle_token: L_ANGLE@113..114 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - in_modifier_token: IN_KW@111..114 "in" [] [Whitespace(" ")], - out_modifier_token: OUT_KW@114..118 "out" [] [Whitespace(" ")], + in_modifier_token: IN_KW@114..117 "in" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@117..121 "out" [] [Whitespace(" ")], name: TsTypeParameterName { - ident_token: IDENT@118..121 "out" [] [], + ident_token: IDENT@121..124 "out" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@121..123 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@124..126 ">" [] [Whitespace(" ")], }, - eq_token: EQ@123..125 "=" [] [Whitespace(" ")], - ty: TsReferenceType { - name: JsReferenceIdentifier { - value_token: IDENT@125..126 "T" [] [], - }, - type_arguments: missing (optional), + eq_token: EQ@126..128 "=" [] [Whitespace(" ")], + ty: TsObjectType { + l_curly_token: L_CURLY@128..129 "{" [] [], + members: TsTypeMemberList [], + r_curly_token: R_CURLY@129..130 "}" [] [], }, semicolon_token: missing (optional), }, TsTypeAliasDeclaration { - type_token: TYPE_KW@126..132 "type" [Newline("\n")] [Whitespace(" ")], + type_token: TYPE_KW@130..136 "type" [Newline("\n")] [Whitespace(" ")], binding_identifier: TsIdentifierBinding { - name_token: IDENT@132..135 "Foo" [] [], + name_token: IDENT@136..139 "Foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@135..136 "<" [] [], + l_angle_token: L_ANGLE@139..140 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - in_modifier_token: IN_KW@136..139 "in" [] [Whitespace(" ")], + in_modifier_token: IN_KW@140..143 "in" [] [Whitespace(" ")], out_modifier_token: missing (optional), name: TsTypeParameterName { - ident_token: IDENT@139..140 "X" [] [], + ident_token: IDENT@143..144 "X" [] [], }, constraint: missing (optional), default: missing (optional), }, - COMMA@140..142 "," [] [Whitespace(" ")], + COMMA@144..146 "," [] [Whitespace(" ")], TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: OUT_KW@142..146 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@146..150 "out" [] [Whitespace(" ")], name: TsTypeParameterName { - ident_token: IDENT@146..147 "Y" [] [], + ident_token: IDENT@150..151 "Y" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@147..149 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@151..153 ">" [] [Whitespace(" ")], }, - eq_token: EQ@149..151 "=" [] [Whitespace(" ")], - ty: TsTupleType { - l_brack_token: L_BRACK@151..152 "[" [] [], - elements: TsTupleTypeElementList [ - TsReferenceType { - name: JsReferenceIdentifier { - value_token: IDENT@152..153 "X" [] [], - }, - type_arguments: missing (optional), - }, - COMMA@153..155 "," [] [Whitespace(" ")], - TsReferenceType { - name: JsReferenceIdentifier { - value_token: IDENT@155..156 "Y" [] [], - }, - type_arguments: missing (optional), - }, - ], - r_brack_token: R_BRACK@156..157 "]" [] [], + eq_token: EQ@153..155 "=" [] [Whitespace(" ")], + ty: TsObjectType { + l_curly_token: L_CURLY@155..156 "{" [] [], + members: TsTypeMemberList [], + r_curly_token: R_CURLY@156..157 "}" [] [], }, semicolon_token: missing (optional), }, @@ -259,58 +239,44 @@ JsModule { r_angle_token: R_ANGLE@178..180 ">" [] [Whitespace(" ")], }, eq_token: EQ@180..182 "=" [] [Whitespace(" ")], - ty: TsTupleType { - l_brack_token: L_BRACK@182..183 "[" [] [], - elements: TsTupleTypeElementList [ - TsReferenceType { - name: JsReferenceIdentifier { - value_token: IDENT@183..184 "X" [] [], - }, - type_arguments: missing (optional), - }, - COMMA@184..186 "," [] [Whitespace(" ")], - TsReferenceType { - name: JsReferenceIdentifier { - value_token: IDENT@186..187 "Y" [] [], - }, - type_arguments: missing (optional), - }, - ], - r_brack_token: R_BRACK@187..188 "]" [] [], + ty: TsObjectType { + l_curly_token: L_CURLY@182..183 "{" [] [], + members: TsTypeMemberList [], + r_curly_token: R_CURLY@183..184 "}" [] [], }, semicolon_token: missing (optional), }, TsTypeAliasDeclaration { - type_token: TYPE_KW@188..194 "type" [Newline("\n")] [Whitespace(" ")], + type_token: TYPE_KW@184..190 "type" [Newline("\n")] [Whitespace(" ")], binding_identifier: TsIdentifierBinding { - name_token: IDENT@194..197 "Foo" [] [], + name_token: IDENT@190..193 "Foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@197..198 "<" [] [], + l_angle_token: L_ANGLE@193..194 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: OUT_KW@198..202 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@194..198 "out" [] [Whitespace(" ")], name: TsTypeParameterName { - ident_token: IDENT@202..203 "X" [] [], + ident_token: IDENT@198..199 "X" [] [], }, constraint: missing (optional), default: missing (optional), }, - COMMA@203..205 "," [] [Whitespace(" ")], + COMMA@199..201 "," [] [Whitespace(" ")], TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: OUT_KW@205..209 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@201..205 "out" [] [Whitespace(" ")], name: TsTypeParameterName { - ident_token: IDENT@209..211 "Y" [] [Whitespace(" ")], + ident_token: IDENT@205..207 "Y" [] [Whitespace(" ")], }, constraint: TsTypeConstraintClause { - extends_token: EXTENDS_KW@211..219 "extends" [] [Whitespace(" ")], + extends_token: EXTENDS_KW@207..215 "extends" [] [Whitespace(" ")], ty: TsTypeOperatorType { - operator_token: KEYOF_KW@219..225 "keyof" [] [Whitespace(" ")], + operator_token: KEYOF_KW@215..221 "keyof" [] [Whitespace(" ")], ty: TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@225..226 "X" [] [], + value_token: IDENT@221..222 "X" [] [], }, type_arguments: missing (optional), }, @@ -319,320 +285,306 @@ JsModule { default: missing (optional), }, ], - r_angle_token: R_ANGLE@226..228 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@222..224 ">" [] [Whitespace(" ")], }, - eq_token: EQ@228..230 "=" [] [Whitespace(" ")], - ty: TsTupleType { - l_brack_token: L_BRACK@230..231 "[" [] [], - elements: TsTupleTypeElementList [ - TsReferenceType { - name: JsReferenceIdentifier { - value_token: IDENT@231..232 "X" [] [], - }, - type_arguments: missing (optional), - }, - COMMA@232..234 "," [] [Whitespace(" ")], - TsReferenceType { - name: JsReferenceIdentifier { - value_token: IDENT@234..235 "Y" [] [], - }, - type_arguments: missing (optional), - }, - ], - r_brack_token: R_BRACK@235..236 "]" [] [], + eq_token: EQ@224..226 "=" [] [Whitespace(" ")], + ty: TsObjectType { + l_curly_token: L_CURLY@226..227 "{" [] [], + members: TsTypeMemberList [], + r_curly_token: R_CURLY@227..228 "}" [] [], }, semicolon_token: missing (optional), }, JsClassDeclaration { abstract_token: missing (optional), - class_token: CLASS_KW@236..243 "class" [Newline("\n")] [Whitespace(" ")], + class_token: CLASS_KW@228..235 "class" [Newline("\n")] [Whitespace(" ")], id: JsIdentifierBinding { - name_token: IDENT@243..246 "Foo" [] [], + name_token: IDENT@235..238 "Foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@246..247 "<" [] [], + l_angle_token: L_ANGLE@238..239 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - in_modifier_token: IN_KW@247..250 "in" [] [Whitespace(" ")], + in_modifier_token: IN_KW@239..242 "in" [] [Whitespace(" ")], out_modifier_token: missing (optional), name: TsTypeParameterName { - ident_token: IDENT@250..251 "T" [] [], + ident_token: IDENT@242..243 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@251..253 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@243..245 ">" [] [Whitespace(" ")], }, extends_clause: missing (optional), implements_clause: missing (optional), - l_curly_token: L_CURLY@253..254 "{" [] [], + l_curly_token: L_CURLY@245..246 "{" [] [], members: JsClassMemberList [], - r_curly_token: R_CURLY@254..255 "}" [] [], + r_curly_token: R_CURLY@246..247 "}" [] [], }, JsClassDeclaration { abstract_token: missing (optional), - class_token: CLASS_KW@255..262 "class" [Newline("\n")] [Whitespace(" ")], + class_token: CLASS_KW@247..254 "class" [Newline("\n")] [Whitespace(" ")], id: JsIdentifierBinding { - name_token: IDENT@262..265 "Foo" [] [], + name_token: IDENT@254..257 "Foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@265..266 "<" [] [], + l_angle_token: L_ANGLE@257..258 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: OUT_KW@266..270 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@258..262 "out" [] [Whitespace(" ")], name: TsTypeParameterName { - ident_token: IDENT@270..271 "T" [] [], + ident_token: IDENT@262..263 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@271..273 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@263..265 ">" [] [Whitespace(" ")], }, extends_clause: missing (optional), implements_clause: missing (optional), - l_curly_token: L_CURLY@273..274 "{" [] [], + l_curly_token: L_CURLY@265..266 "{" [] [], members: JsClassMemberList [], - r_curly_token: R_CURLY@274..275 "}" [] [], + r_curly_token: R_CURLY@266..267 "}" [] [], }, JsExport { - export_token: EXPORT_KW@275..283 "export" [Newline("\n")] [Whitespace(" ")], + export_token: EXPORT_KW@267..275 "export" [Newline("\n")] [Whitespace(" ")], export_clause: JsExportDefaultDeclarationClause { - default_token: DEFAULT_KW@283..291 "default" [] [Whitespace(" ")], + default_token: DEFAULT_KW@275..283 "default" [] [Whitespace(" ")], declaration: JsClassExportDefaultDeclaration { abstract_token: missing (optional), - class_token: CLASS_KW@291..297 "class" [] [Whitespace(" ")], + class_token: CLASS_KW@283..289 "class" [] [Whitespace(" ")], id: JsIdentifierBinding { - name_token: IDENT@297..300 "Foo" [] [], + name_token: IDENT@289..292 "Foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@300..301 "<" [] [], + l_angle_token: L_ANGLE@292..293 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - in_modifier_token: IN_KW@301..304 "in" [] [Whitespace(" ")], + in_modifier_token: IN_KW@293..296 "in" [] [Whitespace(" ")], out_modifier_token: missing (optional), name: TsTypeParameterName { - ident_token: IDENT@304..305 "T" [] [], + ident_token: IDENT@296..297 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@305..307 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@297..299 ">" [] [Whitespace(" ")], }, extends_clause: missing (optional), implements_clause: missing (optional), - l_curly_token: L_CURLY@307..308 "{" [] [], + l_curly_token: L_CURLY@299..300 "{" [] [], members: JsClassMemberList [], - r_curly_token: R_CURLY@308..309 "}" [] [], + r_curly_token: R_CURLY@300..301 "}" [] [], }, semicolon_token: missing (optional), }, }, JsClassDeclaration { abstract_token: missing (optional), - class_token: CLASS_KW@309..316 "class" [Newline("\n")] [Whitespace(" ")], + class_token: CLASS_KW@301..308 "class" [Newline("\n")] [Whitespace(" ")], id: JsIdentifierBinding { - name_token: IDENT@316..319 "Foo" [] [], + name_token: IDENT@308..311 "Foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@319..320 "<" [] [], + l_angle_token: L_ANGLE@311..312 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: OUT_KW@320..324 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@312..316 "out" [] [Whitespace(" ")], name: TsTypeParameterName { - ident_token: IDENT@324..325 "T" [] [], + ident_token: IDENT@316..317 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@325..327 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@317..319 ">" [] [Whitespace(" ")], }, extends_clause: missing (optional), implements_clause: missing (optional), - l_curly_token: L_CURLY@327..328 "{" [] [], + l_curly_token: L_CURLY@319..320 "{" [] [], members: JsClassMemberList [], - r_curly_token: R_CURLY@328..329 "}" [] [], + r_curly_token: R_CURLY@320..321 "}" [] [], }, TsInterfaceDeclaration { - interface_token: INTERFACE_KW@329..340 "interface" [Newline("\n")] [Whitespace(" ")], + interface_token: INTERFACE_KW@321..332 "interface" [Newline("\n")] [Whitespace(" ")], id: TsIdentifierBinding { - name_token: IDENT@340..343 "Foo" [] [], + name_token: IDENT@332..335 "Foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@343..344 "<" [] [], + l_angle_token: L_ANGLE@335..336 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - in_modifier_token: IN_KW@344..347 "in" [] [Whitespace(" ")], + in_modifier_token: IN_KW@336..339 "in" [] [Whitespace(" ")], out_modifier_token: missing (optional), name: TsTypeParameterName { - ident_token: IDENT@347..348 "T" [] [], + ident_token: IDENT@339..340 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@348..350 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@340..342 ">" [] [Whitespace(" ")], }, extends_clause: missing (optional), - l_curly_token: L_CURLY@350..351 "{" [] [], + l_curly_token: L_CURLY@342..343 "{" [] [], members: TsTypeMemberList [], - r_curly_token: R_CURLY@351..352 "}" [] [], + r_curly_token: R_CURLY@343..344 "}" [] [], }, TsInterfaceDeclaration { - interface_token: INTERFACE_KW@352..363 "interface" [Newline("\n")] [Whitespace(" ")], + interface_token: INTERFACE_KW@344..355 "interface" [Newline("\n")] [Whitespace(" ")], id: TsIdentifierBinding { - name_token: IDENT@363..366 "Foo" [] [], + name_token: IDENT@355..358 "Foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@366..367 "<" [] [], + l_angle_token: L_ANGLE@358..359 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: OUT_KW@367..371 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@359..363 "out" [] [Whitespace(" ")], name: TsTypeParameterName { - ident_token: IDENT@371..372 "T" [] [], + ident_token: IDENT@363..364 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@372..374 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@364..366 ">" [] [Whitespace(" ")], }, extends_clause: missing (optional), - l_curly_token: L_CURLY@374..375 "{" [] [], + l_curly_token: L_CURLY@366..367 "{" [] [], members: TsTypeMemberList [], - r_curly_token: R_CURLY@375..376 "}" [] [], + r_curly_token: R_CURLY@367..368 "}" [] [], }, TsDeclareStatement { - declare_token: DECLARE_KW@376..385 "declare" [Newline("\n")] [Whitespace(" ")], + declare_token: DECLARE_KW@368..377 "declare" [Newline("\n")] [Whitespace(" ")], declaration: JsClassDeclaration { abstract_token: missing (optional), - class_token: CLASS_KW@385..391 "class" [] [Whitespace(" ")], + class_token: CLASS_KW@377..383 "class" [] [Whitespace(" ")], id: JsIdentifierBinding { - name_token: IDENT@391..394 "Foo" [] [], + name_token: IDENT@383..386 "Foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@394..395 "<" [] [], + l_angle_token: L_ANGLE@386..387 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - in_modifier_token: IN_KW@395..398 "in" [] [Whitespace(" ")], + in_modifier_token: IN_KW@387..390 "in" [] [Whitespace(" ")], out_modifier_token: missing (optional), name: TsTypeParameterName { - ident_token: IDENT@398..399 "T" [] [], + ident_token: IDENT@390..391 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@399..401 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@391..393 ">" [] [Whitespace(" ")], }, extends_clause: missing (optional), implements_clause: missing (optional), - l_curly_token: L_CURLY@401..402 "{" [] [], + l_curly_token: L_CURLY@393..394 "{" [] [], members: JsClassMemberList [], - r_curly_token: R_CURLY@402..403 "}" [] [], + r_curly_token: R_CURLY@394..395 "}" [] [], }, }, TsDeclareStatement { - declare_token: DECLARE_KW@403..412 "declare" [Newline("\n")] [Whitespace(" ")], + declare_token: DECLARE_KW@395..404 "declare" [Newline("\n")] [Whitespace(" ")], declaration: JsClassDeclaration { abstract_token: missing (optional), - class_token: CLASS_KW@412..418 "class" [] [Whitespace(" ")], + class_token: CLASS_KW@404..410 "class" [] [Whitespace(" ")], id: JsIdentifierBinding { - name_token: IDENT@418..421 "Foo" [] [], + name_token: IDENT@410..413 "Foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@421..422 "<" [] [], + l_angle_token: L_ANGLE@413..414 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: OUT_KW@422..426 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@414..418 "out" [] [Whitespace(" ")], name: TsTypeParameterName { - ident_token: IDENT@426..427 "T" [] [], + ident_token: IDENT@418..419 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@427..429 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@419..421 ">" [] [Whitespace(" ")], }, extends_clause: missing (optional), implements_clause: missing (optional), - l_curly_token: L_CURLY@429..430 "{" [] [], + l_curly_token: L_CURLY@421..422 "{" [] [], members: JsClassMemberList [], - r_curly_token: R_CURLY@430..431 "}" [] [], + r_curly_token: R_CURLY@422..423 "}" [] [], }, }, TsDeclareStatement { - declare_token: DECLARE_KW@431..440 "declare" [Newline("\n")] [Whitespace(" ")], + declare_token: DECLARE_KW@423..432 "declare" [Newline("\n")] [Whitespace(" ")], declaration: TsInterfaceDeclaration { - interface_token: INTERFACE_KW@440..450 "interface" [] [Whitespace(" ")], + interface_token: INTERFACE_KW@432..442 "interface" [] [Whitespace(" ")], id: TsIdentifierBinding { - name_token: IDENT@450..453 "Foo" [] [], + name_token: IDENT@442..445 "Foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@453..454 "<" [] [], + l_angle_token: L_ANGLE@445..446 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - in_modifier_token: IN_KW@454..457 "in" [] [Whitespace(" ")], + in_modifier_token: IN_KW@446..449 "in" [] [Whitespace(" ")], out_modifier_token: missing (optional), name: TsTypeParameterName { - ident_token: IDENT@457..458 "T" [] [], + ident_token: IDENT@449..450 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@458..460 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@450..452 ">" [] [Whitespace(" ")], }, extends_clause: missing (optional), - l_curly_token: L_CURLY@460..461 "{" [] [], + l_curly_token: L_CURLY@452..453 "{" [] [], members: TsTypeMemberList [], - r_curly_token: R_CURLY@461..462 "}" [] [], + r_curly_token: R_CURLY@453..454 "}" [] [], }, }, TsDeclareStatement { - declare_token: DECLARE_KW@462..471 "declare" [Newline("\n")] [Whitespace(" ")], + declare_token: DECLARE_KW@454..463 "declare" [Newline("\n")] [Whitespace(" ")], declaration: TsInterfaceDeclaration { - interface_token: INTERFACE_KW@471..481 "interface" [] [Whitespace(" ")], + interface_token: INTERFACE_KW@463..473 "interface" [] [Whitespace(" ")], id: TsIdentifierBinding { - name_token: IDENT@481..484 "Foo" [] [], + name_token: IDENT@473..476 "Foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@484..485 "<" [] [], + l_angle_token: L_ANGLE@476..477 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: OUT_KW@485..489 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@477..481 "out" [] [Whitespace(" ")], name: TsTypeParameterName { - ident_token: IDENT@489..490 "T" [] [], + ident_token: IDENT@481..482 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@490..492 ">" [] [Whitespace(" ")], + r_angle_token: R_ANGLE@482..484 ">" [] [Whitespace(" ")], }, extends_clause: missing (optional), - l_curly_token: L_CURLY@492..493 "{" [] [], + l_curly_token: L_CURLY@484..485 "{" [] [], members: TsTypeMemberList [], - r_curly_token: R_CURLY@493..494 "}" [] [], + r_curly_token: R_CURLY@485..486 "}" [] [], }, }, ], - eof_token: EOF@494..495 "" [Newline("\n")] [], + eof_token: EOF@486..487 "" [Newline("\n")] [], } -0: JS_MODULE@0..495 +0: JS_MODULE@0..487 0: (empty) 1: JS_DIRECTIVE_LIST@0..0 - 2: JS_MODULE_ITEM_LIST@0..494 - 0: TS_TYPE_ALIAS_DECLARATION@0..18 + 2: JS_MODULE_ITEM_LIST@0..486 + 0: TS_TYPE_ALIAS_DECLARATION@0..19 0: TYPE_KW@0..5 "type" [] [Whitespace(" ")] 1: TS_IDENTIFIER_BINDING@5..8 0: IDENT@5..8 "Foo" [] [] @@ -648,33 +600,33 @@ JsModule { 4: (empty) 2: R_ANGLE@13..15 ">" [] [Whitespace(" ")] 3: EQ@15..17 "=" [] [Whitespace(" ")] - 4: TS_REFERENCE_TYPE@17..18 - 0: JS_REFERENCE_IDENTIFIER@17..18 - 0: IDENT@17..18 "T" [] [] - 1: (empty) + 4: TS_OBJECT_TYPE@17..19 + 0: L_CURLY@17..18 "{" [] [] + 1: TS_TYPE_MEMBER_LIST@18..18 + 2: R_CURLY@18..19 "}" [] [] 5: (empty) - 1: TS_TYPE_ALIAS_DECLARATION@18..38 - 0: TYPE_KW@18..24 "type" [Newline("\n")] [Whitespace(" ")] - 1: TS_IDENTIFIER_BINDING@24..27 - 0: IDENT@24..27 "Foo" [] [] - 2: TS_TYPE_PARAMETERS@27..33 - 0: L_ANGLE@27..28 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@28..31 - 0: TS_TYPE_PARAMETER@28..31 + 1: TS_TYPE_ALIAS_DECLARATION@19..38 + 0: TYPE_KW@19..25 "type" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@25..28 + 0: IDENT@25..28 "Foo" [] [] + 2: TS_TYPE_PARAMETERS@28..34 + 0: L_ANGLE@28..29 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@29..32 + 0: TS_TYPE_PARAMETER@29..32 0: (empty) 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@28..31 - 0: IDENT@28..31 "out" [] [] + 2: TS_TYPE_PARAMETER_NAME@29..32 + 0: IDENT@29..32 "out" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@31..33 ">" [] [Whitespace(" ")] - 3: EQ@33..35 "=" [] [Whitespace(" ")] - 4: TS_REFERENCE_TYPE@35..38 - 0: JS_REFERENCE_IDENTIFIER@35..38 - 0: IDENT@35..38 "out" [] [] - 1: (empty) + 2: R_ANGLE@32..34 ">" [] [Whitespace(" ")] + 3: EQ@34..36 "=" [] [Whitespace(" ")] + 4: TS_OBJECT_TYPE@36..38 + 0: L_CURLY@36..37 "{" [] [] + 1: TS_TYPE_MEMBER_LIST@37..37 + 2: R_CURLY@37..38 "}" [] [] 5: (empty) - 2: TS_TYPE_ALIAS_DECLARATION@38..58 + 2: TS_TYPE_ALIAS_DECLARATION@38..59 0: TYPE_KW@38..44 "type" [Newline("\n")] [Whitespace(" ")] 1: TS_IDENTIFIER_BINDING@44..47 0: IDENT@44..47 "Foo" [] [] @@ -690,113 +642,104 @@ JsModule { 4: (empty) 2: R_ANGLE@53..55 ">" [] [Whitespace(" ")] 3: EQ@55..57 "=" [] [Whitespace(" ")] - 4: TS_REFERENCE_TYPE@57..58 - 0: JS_REFERENCE_IDENTIFIER@57..58 - 0: IDENT@57..58 "T" [] [] - 1: (empty) + 4: TS_OBJECT_TYPE@57..59 + 0: L_CURLY@57..58 "{" [] [] + 1: TS_TYPE_MEMBER_LIST@58..58 + 2: R_CURLY@58..59 "}" [] [] 5: (empty) - 3: TS_TYPE_ALIAS_DECLARATION@58..79 - 0: TYPE_KW@58..64 "type" [Newline("\n")] [Whitespace(" ")] - 1: TS_IDENTIFIER_BINDING@64..67 - 0: IDENT@64..67 "Foo" [] [] - 2: TS_TYPE_PARAMETERS@67..76 - 0: L_ANGLE@67..68 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@68..74 - 0: TS_TYPE_PARAMETER@68..74 - 0: IN_KW@68..71 "in" [] [Whitespace(" ")] + 3: TS_TYPE_ALIAS_DECLARATION@59..81 + 0: TYPE_KW@59..65 "type" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@65..68 + 0: IDENT@65..68 "Foo" [] [] + 2: TS_TYPE_PARAMETERS@68..77 + 0: L_ANGLE@68..69 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@69..75 + 0: TS_TYPE_PARAMETER@69..75 + 0: IN_KW@69..72 "in" [] [Whitespace(" ")] 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@71..74 - 0: IDENT@71..74 "out" [] [] + 2: TS_TYPE_PARAMETER_NAME@72..75 + 0: IDENT@72..75 "out" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@74..76 ">" [] [Whitespace(" ")] - 3: EQ@76..78 "=" [] [Whitespace(" ")] - 4: TS_REFERENCE_TYPE@78..79 - 0: JS_REFERENCE_IDENTIFIER@78..79 - 0: IDENT@78..79 "T" [] [] - 1: (empty) + 2: R_ANGLE@75..77 ">" [] [Whitespace(" ")] + 3: EQ@77..79 "=" [] [Whitespace(" ")] + 4: TS_OBJECT_TYPE@79..81 + 0: L_CURLY@79..80 "{" [] [] + 1: TS_TYPE_MEMBER_LIST@80..80 + 2: R_CURLY@80..81 "}" [] [] 5: (empty) - 4: TS_TYPE_ALIAS_DECLARATION@79..101 - 0: TYPE_KW@79..85 "type" [Newline("\n")] [Whitespace(" ")] - 1: TS_IDENTIFIER_BINDING@85..88 - 0: IDENT@85..88 "Foo" [] [] - 2: TS_TYPE_PARAMETERS@88..98 - 0: L_ANGLE@88..89 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@89..96 - 0: TS_TYPE_PARAMETER@89..96 + 4: TS_TYPE_ALIAS_DECLARATION@81..104 + 0: TYPE_KW@81..87 "type" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@87..90 + 0: IDENT@87..90 "Foo" [] [] + 2: TS_TYPE_PARAMETERS@90..100 + 0: L_ANGLE@90..91 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@91..98 + 0: TS_TYPE_PARAMETER@91..98 0: (empty) - 1: OUT_KW@89..93 "out" [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER_NAME@93..96 - 0: IDENT@93..96 "out" [] [] + 1: OUT_KW@91..95 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@95..98 + 0: IDENT@95..98 "out" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@96..98 ">" [] [Whitespace(" ")] - 3: EQ@98..100 "=" [] [Whitespace(" ")] - 4: TS_REFERENCE_TYPE@100..101 - 0: JS_REFERENCE_IDENTIFIER@100..101 - 0: IDENT@100..101 "T" [] [] - 1: (empty) + 2: R_ANGLE@98..100 ">" [] [Whitespace(" ")] + 3: EQ@100..102 "=" [] [Whitespace(" ")] + 4: TS_OBJECT_TYPE@102..104 + 0: L_CURLY@102..103 "{" [] [] + 1: TS_TYPE_MEMBER_LIST@103..103 + 2: R_CURLY@103..104 "}" [] [] 5: (empty) - 5: TS_TYPE_ALIAS_DECLARATION@101..126 - 0: TYPE_KW@101..107 "type" [Newline("\n")] [Whitespace(" ")] - 1: TS_IDENTIFIER_BINDING@107..110 - 0: IDENT@107..110 "Foo" [] [] - 2: TS_TYPE_PARAMETERS@110..123 - 0: L_ANGLE@110..111 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@111..121 - 0: TS_TYPE_PARAMETER@111..121 - 0: IN_KW@111..114 "in" [] [Whitespace(" ")] - 1: OUT_KW@114..118 "out" [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER_NAME@118..121 - 0: IDENT@118..121 "out" [] [] + 5: TS_TYPE_ALIAS_DECLARATION@104..130 + 0: TYPE_KW@104..110 "type" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@110..113 + 0: IDENT@110..113 "Foo" [] [] + 2: TS_TYPE_PARAMETERS@113..126 + 0: L_ANGLE@113..114 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@114..124 + 0: TS_TYPE_PARAMETER@114..124 + 0: IN_KW@114..117 "in" [] [Whitespace(" ")] + 1: OUT_KW@117..121 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@121..124 + 0: IDENT@121..124 "out" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@121..123 ">" [] [Whitespace(" ")] - 3: EQ@123..125 "=" [] [Whitespace(" ")] - 4: TS_REFERENCE_TYPE@125..126 - 0: JS_REFERENCE_IDENTIFIER@125..126 - 0: IDENT@125..126 "T" [] [] - 1: (empty) + 2: R_ANGLE@124..126 ">" [] [Whitespace(" ")] + 3: EQ@126..128 "=" [] [Whitespace(" ")] + 4: TS_OBJECT_TYPE@128..130 + 0: L_CURLY@128..129 "{" [] [] + 1: TS_TYPE_MEMBER_LIST@129..129 + 2: R_CURLY@129..130 "}" [] [] 5: (empty) - 6: TS_TYPE_ALIAS_DECLARATION@126..157 - 0: TYPE_KW@126..132 "type" [Newline("\n")] [Whitespace(" ")] - 1: TS_IDENTIFIER_BINDING@132..135 - 0: IDENT@132..135 "Foo" [] [] - 2: TS_TYPE_PARAMETERS@135..149 - 0: L_ANGLE@135..136 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@136..147 - 0: TS_TYPE_PARAMETER@136..140 - 0: IN_KW@136..139 "in" [] [Whitespace(" ")] + 6: TS_TYPE_ALIAS_DECLARATION@130..157 + 0: TYPE_KW@130..136 "type" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@136..139 + 0: IDENT@136..139 "Foo" [] [] + 2: TS_TYPE_PARAMETERS@139..153 + 0: L_ANGLE@139..140 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@140..151 + 0: TS_TYPE_PARAMETER@140..144 + 0: IN_KW@140..143 "in" [] [Whitespace(" ")] 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@139..140 - 0: IDENT@139..140 "X" [] [] + 2: TS_TYPE_PARAMETER_NAME@143..144 + 0: IDENT@143..144 "X" [] [] 3: (empty) 4: (empty) - 1: COMMA@140..142 "," [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER@142..147 + 1: COMMA@144..146 "," [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER@146..151 0: (empty) - 1: OUT_KW@142..146 "out" [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER_NAME@146..147 - 0: IDENT@146..147 "Y" [] [] + 1: OUT_KW@146..150 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@150..151 + 0: IDENT@150..151 "Y" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@147..149 ">" [] [Whitespace(" ")] - 3: EQ@149..151 "=" [] [Whitespace(" ")] - 4: TS_TUPLE_TYPE@151..157 - 0: L_BRACK@151..152 "[" [] [] - 1: TS_TUPLE_TYPE_ELEMENT_LIST@152..156 - 0: TS_REFERENCE_TYPE@152..153 - 0: JS_REFERENCE_IDENTIFIER@152..153 - 0: IDENT@152..153 "X" [] [] - 1: (empty) - 1: COMMA@153..155 "," [] [Whitespace(" ")] - 2: TS_REFERENCE_TYPE@155..156 - 0: JS_REFERENCE_IDENTIFIER@155..156 - 0: IDENT@155..156 "Y" [] [] - 1: (empty) - 2: R_BRACK@156..157 "]" [] [] + 2: R_ANGLE@151..153 ">" [] [Whitespace(" ")] + 3: EQ@153..155 "=" [] [Whitespace(" ")] + 4: TS_OBJECT_TYPE@155..157 + 0: L_CURLY@155..156 "{" [] [] + 1: TS_TYPE_MEMBER_LIST@156..156 + 2: R_CURLY@156..157 "}" [] [] 5: (empty) - 7: TS_TYPE_ALIAS_DECLARATION@157..188 + 7: TS_TYPE_ALIAS_DECLARATION@157..184 0: TYPE_KW@157..163 "type" [Newline("\n")] [Whitespace(" ")] 1: TS_IDENTIFIER_BINDING@163..166 0: IDENT@163..166 "Foo" [] [] @@ -820,278 +763,260 @@ JsModule { 4: (empty) 2: R_ANGLE@178..180 ">" [] [Whitespace(" ")] 3: EQ@180..182 "=" [] [Whitespace(" ")] - 4: TS_TUPLE_TYPE@182..188 - 0: L_BRACK@182..183 "[" [] [] - 1: TS_TUPLE_TYPE_ELEMENT_LIST@183..187 - 0: TS_REFERENCE_TYPE@183..184 - 0: JS_REFERENCE_IDENTIFIER@183..184 - 0: IDENT@183..184 "X" [] [] - 1: (empty) - 1: COMMA@184..186 "," [] [Whitespace(" ")] - 2: TS_REFERENCE_TYPE@186..187 - 0: JS_REFERENCE_IDENTIFIER@186..187 - 0: IDENT@186..187 "Y" [] [] - 1: (empty) - 2: R_BRACK@187..188 "]" [] [] + 4: TS_OBJECT_TYPE@182..184 + 0: L_CURLY@182..183 "{" [] [] + 1: TS_TYPE_MEMBER_LIST@183..183 + 2: R_CURLY@183..184 "}" [] [] 5: (empty) - 8: TS_TYPE_ALIAS_DECLARATION@188..236 - 0: TYPE_KW@188..194 "type" [Newline("\n")] [Whitespace(" ")] - 1: TS_IDENTIFIER_BINDING@194..197 - 0: IDENT@194..197 "Foo" [] [] - 2: TS_TYPE_PARAMETERS@197..228 - 0: L_ANGLE@197..198 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@198..226 - 0: TS_TYPE_PARAMETER@198..203 + 8: TS_TYPE_ALIAS_DECLARATION@184..228 + 0: TYPE_KW@184..190 "type" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@190..193 + 0: IDENT@190..193 "Foo" [] [] + 2: TS_TYPE_PARAMETERS@193..224 + 0: L_ANGLE@193..194 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@194..222 + 0: TS_TYPE_PARAMETER@194..199 0: (empty) - 1: OUT_KW@198..202 "out" [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER_NAME@202..203 - 0: IDENT@202..203 "X" [] [] + 1: OUT_KW@194..198 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@198..199 + 0: IDENT@198..199 "X" [] [] 3: (empty) 4: (empty) - 1: COMMA@203..205 "," [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER@205..226 + 1: COMMA@199..201 "," [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER@201..222 0: (empty) - 1: OUT_KW@205..209 "out" [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER_NAME@209..211 - 0: IDENT@209..211 "Y" [] [Whitespace(" ")] - 3: TS_TYPE_CONSTRAINT_CLAUSE@211..226 - 0: EXTENDS_KW@211..219 "extends" [] [Whitespace(" ")] - 1: TS_TYPE_OPERATOR_TYPE@219..226 - 0: KEYOF_KW@219..225 "keyof" [] [Whitespace(" ")] - 1: TS_REFERENCE_TYPE@225..226 - 0: JS_REFERENCE_IDENTIFIER@225..226 - 0: IDENT@225..226 "X" [] [] + 1: OUT_KW@201..205 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@205..207 + 0: IDENT@205..207 "Y" [] [Whitespace(" ")] + 3: TS_TYPE_CONSTRAINT_CLAUSE@207..222 + 0: EXTENDS_KW@207..215 "extends" [] [Whitespace(" ")] + 1: TS_TYPE_OPERATOR_TYPE@215..222 + 0: KEYOF_KW@215..221 "keyof" [] [Whitespace(" ")] + 1: TS_REFERENCE_TYPE@221..222 + 0: JS_REFERENCE_IDENTIFIER@221..222 + 0: IDENT@221..222 "X" [] [] 1: (empty) 4: (empty) - 2: R_ANGLE@226..228 ">" [] [Whitespace(" ")] - 3: EQ@228..230 "=" [] [Whitespace(" ")] - 4: TS_TUPLE_TYPE@230..236 - 0: L_BRACK@230..231 "[" [] [] - 1: TS_TUPLE_TYPE_ELEMENT_LIST@231..235 - 0: TS_REFERENCE_TYPE@231..232 - 0: JS_REFERENCE_IDENTIFIER@231..232 - 0: IDENT@231..232 "X" [] [] - 1: (empty) - 1: COMMA@232..234 "," [] [Whitespace(" ")] - 2: TS_REFERENCE_TYPE@234..235 - 0: JS_REFERENCE_IDENTIFIER@234..235 - 0: IDENT@234..235 "Y" [] [] - 1: (empty) - 2: R_BRACK@235..236 "]" [] [] + 2: R_ANGLE@222..224 ">" [] [Whitespace(" ")] + 3: EQ@224..226 "=" [] [Whitespace(" ")] + 4: TS_OBJECT_TYPE@226..228 + 0: L_CURLY@226..227 "{" [] [] + 1: TS_TYPE_MEMBER_LIST@227..227 + 2: R_CURLY@227..228 "}" [] [] 5: (empty) - 9: JS_CLASS_DECLARATION@236..255 + 9: JS_CLASS_DECLARATION@228..247 0: (empty) - 1: CLASS_KW@236..243 "class" [Newline("\n")] [Whitespace(" ")] - 2: JS_IDENTIFIER_BINDING@243..246 - 0: IDENT@243..246 "Foo" [] [] - 3: TS_TYPE_PARAMETERS@246..253 - 0: L_ANGLE@246..247 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@247..251 - 0: TS_TYPE_PARAMETER@247..251 - 0: IN_KW@247..250 "in" [] [Whitespace(" ")] + 1: CLASS_KW@228..235 "class" [Newline("\n")] [Whitespace(" ")] + 2: JS_IDENTIFIER_BINDING@235..238 + 0: IDENT@235..238 "Foo" [] [] + 3: TS_TYPE_PARAMETERS@238..245 + 0: L_ANGLE@238..239 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@239..243 + 0: TS_TYPE_PARAMETER@239..243 + 0: IN_KW@239..242 "in" [] [Whitespace(" ")] 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@250..251 - 0: IDENT@250..251 "T" [] [] + 2: TS_TYPE_PARAMETER_NAME@242..243 + 0: IDENT@242..243 "T" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@251..253 ">" [] [Whitespace(" ")] + 2: R_ANGLE@243..245 ">" [] [Whitespace(" ")] 4: (empty) 5: (empty) - 6: L_CURLY@253..254 "{" [] [] - 7: JS_CLASS_MEMBER_LIST@254..254 - 8: R_CURLY@254..255 "}" [] [] - 10: JS_CLASS_DECLARATION@255..275 + 6: L_CURLY@245..246 "{" [] [] + 7: JS_CLASS_MEMBER_LIST@246..246 + 8: R_CURLY@246..247 "}" [] [] + 10: JS_CLASS_DECLARATION@247..267 0: (empty) - 1: CLASS_KW@255..262 "class" [Newline("\n")] [Whitespace(" ")] - 2: JS_IDENTIFIER_BINDING@262..265 - 0: IDENT@262..265 "Foo" [] [] - 3: TS_TYPE_PARAMETERS@265..273 - 0: L_ANGLE@265..266 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@266..271 - 0: TS_TYPE_PARAMETER@266..271 + 1: CLASS_KW@247..254 "class" [Newline("\n")] [Whitespace(" ")] + 2: JS_IDENTIFIER_BINDING@254..257 + 0: IDENT@254..257 "Foo" [] [] + 3: TS_TYPE_PARAMETERS@257..265 + 0: L_ANGLE@257..258 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@258..263 + 0: TS_TYPE_PARAMETER@258..263 0: (empty) - 1: OUT_KW@266..270 "out" [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER_NAME@270..271 - 0: IDENT@270..271 "T" [] [] + 1: OUT_KW@258..262 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@262..263 + 0: IDENT@262..263 "T" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@271..273 ">" [] [Whitespace(" ")] + 2: R_ANGLE@263..265 ">" [] [Whitespace(" ")] 4: (empty) 5: (empty) - 6: L_CURLY@273..274 "{" [] [] - 7: JS_CLASS_MEMBER_LIST@274..274 - 8: R_CURLY@274..275 "}" [] [] - 11: JS_EXPORT@275..309 - 0: EXPORT_KW@275..283 "export" [Newline("\n")] [Whitespace(" ")] - 1: JS_EXPORT_DEFAULT_DECLARATION_CLAUSE@283..309 - 0: DEFAULT_KW@283..291 "default" [] [Whitespace(" ")] - 1: JS_CLASS_EXPORT_DEFAULT_DECLARATION@291..309 + 6: L_CURLY@265..266 "{" [] [] + 7: JS_CLASS_MEMBER_LIST@266..266 + 8: R_CURLY@266..267 "}" [] [] + 11: JS_EXPORT@267..301 + 0: EXPORT_KW@267..275 "export" [Newline("\n")] [Whitespace(" ")] + 1: JS_EXPORT_DEFAULT_DECLARATION_CLAUSE@275..301 + 0: DEFAULT_KW@275..283 "default" [] [Whitespace(" ")] + 1: JS_CLASS_EXPORT_DEFAULT_DECLARATION@283..301 0: (empty) - 1: CLASS_KW@291..297 "class" [] [Whitespace(" ")] - 2: JS_IDENTIFIER_BINDING@297..300 - 0: IDENT@297..300 "Foo" [] [] - 3: TS_TYPE_PARAMETERS@300..307 - 0: L_ANGLE@300..301 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@301..305 - 0: TS_TYPE_PARAMETER@301..305 - 0: IN_KW@301..304 "in" [] [Whitespace(" ")] + 1: CLASS_KW@283..289 "class" [] [Whitespace(" ")] + 2: JS_IDENTIFIER_BINDING@289..292 + 0: IDENT@289..292 "Foo" [] [] + 3: TS_TYPE_PARAMETERS@292..299 + 0: L_ANGLE@292..293 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@293..297 + 0: TS_TYPE_PARAMETER@293..297 + 0: IN_KW@293..296 "in" [] [Whitespace(" ")] 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@304..305 - 0: IDENT@304..305 "T" [] [] + 2: TS_TYPE_PARAMETER_NAME@296..297 + 0: IDENT@296..297 "T" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@305..307 ">" [] [Whitespace(" ")] + 2: R_ANGLE@297..299 ">" [] [Whitespace(" ")] 4: (empty) 5: (empty) - 6: L_CURLY@307..308 "{" [] [] - 7: JS_CLASS_MEMBER_LIST@308..308 - 8: R_CURLY@308..309 "}" [] [] + 6: L_CURLY@299..300 "{" [] [] + 7: JS_CLASS_MEMBER_LIST@300..300 + 8: R_CURLY@300..301 "}" [] [] 2: (empty) - 12: JS_CLASS_DECLARATION@309..329 + 12: JS_CLASS_DECLARATION@301..321 0: (empty) - 1: CLASS_KW@309..316 "class" [Newline("\n")] [Whitespace(" ")] - 2: JS_IDENTIFIER_BINDING@316..319 - 0: IDENT@316..319 "Foo" [] [] - 3: TS_TYPE_PARAMETERS@319..327 - 0: L_ANGLE@319..320 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@320..325 - 0: TS_TYPE_PARAMETER@320..325 + 1: CLASS_KW@301..308 "class" [Newline("\n")] [Whitespace(" ")] + 2: JS_IDENTIFIER_BINDING@308..311 + 0: IDENT@308..311 "Foo" [] [] + 3: TS_TYPE_PARAMETERS@311..319 + 0: L_ANGLE@311..312 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@312..317 + 0: TS_TYPE_PARAMETER@312..317 0: (empty) - 1: OUT_KW@320..324 "out" [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER_NAME@324..325 - 0: IDENT@324..325 "T" [] [] + 1: OUT_KW@312..316 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@316..317 + 0: IDENT@316..317 "T" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@325..327 ">" [] [Whitespace(" ")] + 2: R_ANGLE@317..319 ">" [] [Whitespace(" ")] 4: (empty) 5: (empty) - 6: L_CURLY@327..328 "{" [] [] - 7: JS_CLASS_MEMBER_LIST@328..328 - 8: R_CURLY@328..329 "}" [] [] - 13: TS_INTERFACE_DECLARATION@329..352 - 0: INTERFACE_KW@329..340 "interface" [Newline("\n")] [Whitespace(" ")] - 1: TS_IDENTIFIER_BINDING@340..343 - 0: IDENT@340..343 "Foo" [] [] - 2: TS_TYPE_PARAMETERS@343..350 - 0: L_ANGLE@343..344 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@344..348 - 0: TS_TYPE_PARAMETER@344..348 - 0: IN_KW@344..347 "in" [] [Whitespace(" ")] + 6: L_CURLY@319..320 "{" [] [] + 7: JS_CLASS_MEMBER_LIST@320..320 + 8: R_CURLY@320..321 "}" [] [] + 13: TS_INTERFACE_DECLARATION@321..344 + 0: INTERFACE_KW@321..332 "interface" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@332..335 + 0: IDENT@332..335 "Foo" [] [] + 2: TS_TYPE_PARAMETERS@335..342 + 0: L_ANGLE@335..336 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@336..340 + 0: TS_TYPE_PARAMETER@336..340 + 0: IN_KW@336..339 "in" [] [Whitespace(" ")] 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@347..348 - 0: IDENT@347..348 "T" [] [] + 2: TS_TYPE_PARAMETER_NAME@339..340 + 0: IDENT@339..340 "T" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@348..350 ">" [] [Whitespace(" ")] + 2: R_ANGLE@340..342 ">" [] [Whitespace(" ")] 3: (empty) - 4: L_CURLY@350..351 "{" [] [] - 5: TS_TYPE_MEMBER_LIST@351..351 - 6: R_CURLY@351..352 "}" [] [] - 14: TS_INTERFACE_DECLARATION@352..376 - 0: INTERFACE_KW@352..363 "interface" [Newline("\n")] [Whitespace(" ")] - 1: TS_IDENTIFIER_BINDING@363..366 - 0: IDENT@363..366 "Foo" [] [] - 2: TS_TYPE_PARAMETERS@366..374 - 0: L_ANGLE@366..367 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@367..372 - 0: TS_TYPE_PARAMETER@367..372 + 4: L_CURLY@342..343 "{" [] [] + 5: TS_TYPE_MEMBER_LIST@343..343 + 6: R_CURLY@343..344 "}" [] [] + 14: TS_INTERFACE_DECLARATION@344..368 + 0: INTERFACE_KW@344..355 "interface" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@355..358 + 0: IDENT@355..358 "Foo" [] [] + 2: TS_TYPE_PARAMETERS@358..366 + 0: L_ANGLE@358..359 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@359..364 + 0: TS_TYPE_PARAMETER@359..364 0: (empty) - 1: OUT_KW@367..371 "out" [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER_NAME@371..372 - 0: IDENT@371..372 "T" [] [] + 1: OUT_KW@359..363 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@363..364 + 0: IDENT@363..364 "T" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@372..374 ">" [] [Whitespace(" ")] + 2: R_ANGLE@364..366 ">" [] [Whitespace(" ")] 3: (empty) - 4: L_CURLY@374..375 "{" [] [] - 5: TS_TYPE_MEMBER_LIST@375..375 - 6: R_CURLY@375..376 "}" [] [] - 15: TS_DECLARE_STATEMENT@376..403 - 0: DECLARE_KW@376..385 "declare" [Newline("\n")] [Whitespace(" ")] - 1: JS_CLASS_DECLARATION@385..403 + 4: L_CURLY@366..367 "{" [] [] + 5: TS_TYPE_MEMBER_LIST@367..367 + 6: R_CURLY@367..368 "}" [] [] + 15: TS_DECLARE_STATEMENT@368..395 + 0: DECLARE_KW@368..377 "declare" [Newline("\n")] [Whitespace(" ")] + 1: JS_CLASS_DECLARATION@377..395 0: (empty) - 1: CLASS_KW@385..391 "class" [] [Whitespace(" ")] - 2: JS_IDENTIFIER_BINDING@391..394 - 0: IDENT@391..394 "Foo" [] [] - 3: TS_TYPE_PARAMETERS@394..401 - 0: L_ANGLE@394..395 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@395..399 - 0: TS_TYPE_PARAMETER@395..399 - 0: IN_KW@395..398 "in" [] [Whitespace(" ")] + 1: CLASS_KW@377..383 "class" [] [Whitespace(" ")] + 2: JS_IDENTIFIER_BINDING@383..386 + 0: IDENT@383..386 "Foo" [] [] + 3: TS_TYPE_PARAMETERS@386..393 + 0: L_ANGLE@386..387 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@387..391 + 0: TS_TYPE_PARAMETER@387..391 + 0: IN_KW@387..390 "in" [] [Whitespace(" ")] 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@398..399 - 0: IDENT@398..399 "T" [] [] + 2: TS_TYPE_PARAMETER_NAME@390..391 + 0: IDENT@390..391 "T" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@399..401 ">" [] [Whitespace(" ")] + 2: R_ANGLE@391..393 ">" [] [Whitespace(" ")] 4: (empty) 5: (empty) - 6: L_CURLY@401..402 "{" [] [] - 7: JS_CLASS_MEMBER_LIST@402..402 - 8: R_CURLY@402..403 "}" [] [] - 16: TS_DECLARE_STATEMENT@403..431 - 0: DECLARE_KW@403..412 "declare" [Newline("\n")] [Whitespace(" ")] - 1: JS_CLASS_DECLARATION@412..431 + 6: L_CURLY@393..394 "{" [] [] + 7: JS_CLASS_MEMBER_LIST@394..394 + 8: R_CURLY@394..395 "}" [] [] + 16: TS_DECLARE_STATEMENT@395..423 + 0: DECLARE_KW@395..404 "declare" [Newline("\n")] [Whitespace(" ")] + 1: JS_CLASS_DECLARATION@404..423 0: (empty) - 1: CLASS_KW@412..418 "class" [] [Whitespace(" ")] - 2: JS_IDENTIFIER_BINDING@418..421 - 0: IDENT@418..421 "Foo" [] [] - 3: TS_TYPE_PARAMETERS@421..429 - 0: L_ANGLE@421..422 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@422..427 - 0: TS_TYPE_PARAMETER@422..427 + 1: CLASS_KW@404..410 "class" [] [Whitespace(" ")] + 2: JS_IDENTIFIER_BINDING@410..413 + 0: IDENT@410..413 "Foo" [] [] + 3: TS_TYPE_PARAMETERS@413..421 + 0: L_ANGLE@413..414 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@414..419 + 0: TS_TYPE_PARAMETER@414..419 0: (empty) - 1: OUT_KW@422..426 "out" [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER_NAME@426..427 - 0: IDENT@426..427 "T" [] [] + 1: OUT_KW@414..418 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@418..419 + 0: IDENT@418..419 "T" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@427..429 ">" [] [Whitespace(" ")] + 2: R_ANGLE@419..421 ">" [] [Whitespace(" ")] 4: (empty) 5: (empty) - 6: L_CURLY@429..430 "{" [] [] - 7: JS_CLASS_MEMBER_LIST@430..430 - 8: R_CURLY@430..431 "}" [] [] - 17: TS_DECLARE_STATEMENT@431..462 - 0: DECLARE_KW@431..440 "declare" [Newline("\n")] [Whitespace(" ")] - 1: TS_INTERFACE_DECLARATION@440..462 - 0: INTERFACE_KW@440..450 "interface" [] [Whitespace(" ")] - 1: TS_IDENTIFIER_BINDING@450..453 - 0: IDENT@450..453 "Foo" [] [] - 2: TS_TYPE_PARAMETERS@453..460 - 0: L_ANGLE@453..454 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@454..458 - 0: TS_TYPE_PARAMETER@454..458 - 0: IN_KW@454..457 "in" [] [Whitespace(" ")] + 6: L_CURLY@421..422 "{" [] [] + 7: JS_CLASS_MEMBER_LIST@422..422 + 8: R_CURLY@422..423 "}" [] [] + 17: TS_DECLARE_STATEMENT@423..454 + 0: DECLARE_KW@423..432 "declare" [Newline("\n")] [Whitespace(" ")] + 1: TS_INTERFACE_DECLARATION@432..454 + 0: INTERFACE_KW@432..442 "interface" [] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@442..445 + 0: IDENT@442..445 "Foo" [] [] + 2: TS_TYPE_PARAMETERS@445..452 + 0: L_ANGLE@445..446 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@446..450 + 0: TS_TYPE_PARAMETER@446..450 + 0: IN_KW@446..449 "in" [] [Whitespace(" ")] 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@457..458 - 0: IDENT@457..458 "T" [] [] + 2: TS_TYPE_PARAMETER_NAME@449..450 + 0: IDENT@449..450 "T" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@458..460 ">" [] [Whitespace(" ")] + 2: R_ANGLE@450..452 ">" [] [Whitespace(" ")] 3: (empty) - 4: L_CURLY@460..461 "{" [] [] - 5: TS_TYPE_MEMBER_LIST@461..461 - 6: R_CURLY@461..462 "}" [] [] - 18: TS_DECLARE_STATEMENT@462..494 - 0: DECLARE_KW@462..471 "declare" [Newline("\n")] [Whitespace(" ")] - 1: TS_INTERFACE_DECLARATION@471..494 - 0: INTERFACE_KW@471..481 "interface" [] [Whitespace(" ")] - 1: TS_IDENTIFIER_BINDING@481..484 - 0: IDENT@481..484 "Foo" [] [] - 2: TS_TYPE_PARAMETERS@484..492 - 0: L_ANGLE@484..485 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@485..490 - 0: TS_TYPE_PARAMETER@485..490 + 4: L_CURLY@452..453 "{" [] [] + 5: TS_TYPE_MEMBER_LIST@453..453 + 6: R_CURLY@453..454 "}" [] [] + 18: TS_DECLARE_STATEMENT@454..486 + 0: DECLARE_KW@454..463 "declare" [Newline("\n")] [Whitespace(" ")] + 1: TS_INTERFACE_DECLARATION@463..486 + 0: INTERFACE_KW@463..473 "interface" [] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@473..476 + 0: IDENT@473..476 "Foo" [] [] + 2: TS_TYPE_PARAMETERS@476..484 + 0: L_ANGLE@476..477 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@477..482 + 0: TS_TYPE_PARAMETER@477..482 0: (empty) - 1: OUT_KW@485..489 "out" [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER_NAME@489..490 - 0: IDENT@489..490 "T" [] [] + 1: OUT_KW@477..481 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@481..482 + 0: IDENT@481..482 "T" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@490..492 ">" [] [Whitespace(" ")] + 2: R_ANGLE@482..484 ">" [] [Whitespace(" ")] 3: (empty) - 4: L_CURLY@492..493 "{" [] [] - 5: TS_TYPE_MEMBER_LIST@493..493 - 6: R_CURLY@493..494 "}" [] [] - 3: EOF@494..495 "" [Newline("\n")] [] + 4: L_CURLY@484..485 "{" [] [] + 5: TS_TYPE_MEMBER_LIST@485..485 + 6: R_CURLY@485..486 "}" [] [] + 3: EOF@486..487 "" [Newline("\n")] [] diff --git a/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.ts b/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.ts index 050ff489d46..fe4789f0cc1 100644 --- a/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.ts +++ b/crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier.ts @@ -1,12 +1,12 @@ -type Foo = T -type Foo = out -type Foo = T -type Foo = T -type Foo = T -type Foo = T -type Foo = [X, Y] -type Foo = [X, Y] -type Foo = [X, Y] +type Foo = {} +type Foo = {} +type Foo = {} +type Foo = {} +type Foo = {} +type Foo = {} +type Foo = {} +type Foo = {} +type Foo = {} class Foo {} class Foo {} export default class Foo {} From 1c92719304049c65bdd2c7ba55d4727bb7344909 Mon Sep 17 00:00:00 2001 From: nissy-dev Date: Thu, 2 Mar 2023 01:47:00 +0900 Subject: [PATCH 17/22] feat: separate parse_ts_type_parameters and parse_ts_type_parameters_with_modifiers --- crates/rome_js_parser/src/syntax/class.rs | 12 ++--- crates/rome_js_parser/src/syntax/function.rs | 6 +-- crates/rome_js_parser/src/syntax/object.rs | 6 +-- .../src/syntax/typescript/statement.rs | 6 +-- .../src/syntax/typescript/types.rs | 54 +++++++++++-------- 5 files changed, 48 insertions(+), 36 deletions(-) diff --git a/crates/rome_js_parser/src/syntax/class.rs b/crates/rome_js_parser/src/syntax/class.rs index 5defbe6f2ed..947ea80c827 100644 --- a/crates/rome_js_parser/src/syntax/class.rs +++ b/crates/rome_js_parser/src/syntax/class.rs @@ -54,7 +54,8 @@ use super::function::LineBreak; use super::js_parse_error::unexpected_body_inside_ambient_context; use super::typescript::ts_parse_error::{self, unexpected_abstract_member_with_body}; use super::typescript::{ - expect_ts_index_signature_member, is_at_ts_index_signature_member, MemberParent, + expect_ts_index_signature_member, is_at_ts_index_signature_member, + parse_ts_type_parameters_with_modifiers, MemberParent, }; pub(crate) fn is_at_ts_abstract_class_declaration( @@ -255,7 +256,7 @@ fn parse_class(p: &mut JsParser, kind: ClassKind) -> CompletedMarker { TypeScript .parse_exclusive_syntax( p, - |p| parse_ts_type_parameters(p, TypeContext::default(), true), + |p| parse_ts_type_parameters_with_modifiers(p, TypeContext::default(), true), |p, type_parameters| { ts_only_syntax_error(p, "class type parameters", type_parameters.range(p)) }, @@ -687,8 +688,7 @@ fn parse_class_member_impl( // get a(): A {} // set a(value: A) {} // } - if let Present(type_parameters) = parse_ts_type_parameters(p, TypeContext::default(), false) - { + if let Present(type_parameters) = parse_ts_type_parameters(p, TypeContext::default()) { p.error(ts_accessor_type_parameters_error(p, &type_parameters)) } @@ -1177,7 +1177,7 @@ fn parse_method_class_member_rest( TypeScript .parse_exclusive_syntax( p, - |p| parse_ts_type_parameters(p, TypeContext::default(), false), + |p| parse_ts_type_parameters(p, TypeContext::default()), |p, marker| ts_only_syntax_error(p, "type parameters", marker.range(p)), ) .ok(); @@ -1460,7 +1460,7 @@ fn parse_constructor_class_member_body( // test_err ts ts_constructor_type_parameters // class A { constructor(b) {} } - if let Present(type_parameters) = parse_ts_type_parameters(p, TypeContext::default(), false) { + if let Present(type_parameters) = parse_ts_type_parameters(p, TypeContext::default()) { p.error(ts_constructor_type_parameters_error(p, &type_parameters)); } diff --git a/crates/rome_js_parser/src/syntax/function.rs b/crates/rome_js_parser/src/syntax/function.rs index 0c71f64a85f..6c6b411f737 100644 --- a/crates/rome_js_parser/src/syntax/function.rs +++ b/crates/rome_js_parser/src/syntax/function.rs @@ -231,7 +231,7 @@ fn parse_function(p: &mut JsParser, m: Marker, kind: FunctionKind) -> CompletedM TypeScript .parse_exclusive_syntax( p, - |p| parse_ts_type_parameters(p, TypeContext::default(), false), + |p| parse_ts_type_parameters(p, TypeContext::default()), |p, marker| { p.err_builder( "type parameters can only be used in TypeScript files", @@ -411,7 +411,7 @@ fn parse_ambient_function( let binding = parse_binding(p); let binding_range = p.cur_range(); - parse_ts_type_parameters(p, TypeContext::default(), false).ok(); + parse_ts_type_parameters(p, TypeContext::default()).ok(); parse_parameter_list(p, ParameterContext::Declaration, SignatureFlags::empty()) .or_add_diagnostic(p, expected_parameters); parse_ts_return_type_annotation(p).ok(); @@ -540,7 +540,7 @@ fn try_parse_parenthesized_arrow_function_head( }; if p.at(T![<]) { - parse_ts_type_parameters(p, TypeContext::default(), false).ok(); + parse_ts_type_parameters(p, TypeContext::default()).ok(); if ambiguity.is_disallowed() && p.last() != Some(T![>]) { return Err(m); diff --git a/crates/rome_js_parser/src/syntax/object.rs b/crates/rome_js_parser/src/syntax/object.rs index 174428de0c6..b5bcf1d488b 100644 --- a/crates/rome_js_parser/src/syntax/object.rs +++ b/crates/rome_js_parser/src/syntax/object.rs @@ -259,7 +259,7 @@ fn parse_getter_object_member(p: &mut JsParser) -> ParsedSyntax { // test_err ts ts_object_getter_type_parameters // ({ get a(): A {} }); - if let Present(type_parameters) = parse_ts_type_parameters(p, TypeContext::default(), false) { + if let Present(type_parameters) = parse_ts_type_parameters(p, TypeContext::default()) { p.error(ts_accessor_type_parameters_error(p, &type_parameters)) } @@ -291,7 +291,7 @@ fn parse_setter_object_member(p: &mut JsParser) -> ParsedSyntax { // test_err ts ts_object_setter_type_parameters // ({ set a(value: A) {} }); - if let Present(type_parameters) = parse_ts_type_parameters(p, TypeContext::default(), false) { + if let Present(type_parameters) = parse_ts_type_parameters(p, TypeContext::default()) { p.error(ts_accessor_type_parameters_error(p, &type_parameters)) } @@ -435,7 +435,7 @@ fn parse_method_object_member_body(p: &mut JsParser, flags: SignatureFlags) { TypeScript .parse_exclusive_syntax( p, - |p| parse_ts_type_parameters(p, TypeContext::default(), false), + |p| parse_ts_type_parameters(p, TypeContext::default()), |p, type_parameters| { ts_only_syntax_error(p, "type parameters", type_parameters.range(p)) }, diff --git a/crates/rome_js_parser/src/syntax/typescript/statement.rs b/crates/rome_js_parser/src/syntax/typescript/statement.rs index 1954dec23a2..2cb5a58ef60 100644 --- a/crates/rome_js_parser/src/syntax/typescript/statement.rs +++ b/crates/rome_js_parser/src/syntax/typescript/statement.rs @@ -15,7 +15,7 @@ use crate::syntax::stmt::{semi, STMT_RECOVERY_SET}; use crate::syntax::typescript::ts_parse_error::expected_ts_type; use crate::syntax::typescript::{ expect_ts_type_list, parse_ts_identifier_binding, parse_ts_implements_clause, parse_ts_name, - parse_ts_type, parse_ts_type_parameters, TypeContext, TypeMembers, + parse_ts_type, parse_ts_type_parameters_with_modifiers, TypeContext, TypeMembers, }; use crate::{syntax, Absent, JsParser, ParseRecovery, ParsedSyntax, Present}; use rome_js_syntax::{JsSyntaxKind::*, *}; @@ -207,7 +207,7 @@ pub(crate) fn parse_ts_type_alias_declaration(p: &mut JsParser) -> ParsedSyntax p.expect(T![type]); parse_ts_identifier_binding(p, super::TsIdentifierContext::Type) .or_add_diagnostic(p, expected_identifier); - parse_ts_type_parameters(p, TypeContext::default(), true).ok(); + parse_ts_type_parameters_with_modifiers(p, TypeContext::default(), true).ok(); p.expect(T![=]); parse_ts_type(p, TypeContext::default()).or_add_diagnostic(p, expected_ts_type); @@ -298,7 +298,7 @@ pub(crate) fn parse_ts_interface_declaration(p: &mut JsParser) -> ParsedSyntax { p.expect(T![interface]); parse_ts_identifier_binding(p, super::TsIdentifierContext::Type) .or_add_diagnostic(p, expected_identifier); - parse_ts_type_parameters(p, TypeContext::default(), true).ok(); + parse_ts_type_parameters_with_modifiers(p, TypeContext::default(), true).ok(); eat_interface_heritage_clause(p); p.expect(T!['{']); TypeMembers.parse_list(p); diff --git a/crates/rome_js_parser/src/syntax/typescript/types.rs b/crates/rome_js_parser/src/syntax/typescript/types.rs index 277fc678570..696c10f17a4 100644 --- a/crates/rome_js_parser/src/syntax/typescript/types.rs +++ b/crates/rome_js_parser/src/syntax/typescript/types.rs @@ -114,12 +114,8 @@ pub(crate) fn parse_ts_return_type_annotation(p: &mut JsParser) -> ParsedSyntax Present(m.complete(p, TS_RETURN_TYPE_ANNOTATION)) } -fn parse_ts_call_signature( - p: &mut JsParser, - context: TypeContext, - could_use_parameter_modifier: bool, -) { - parse_ts_type_parameters(p, context, could_use_parameter_modifier).ok(); +fn parse_ts_call_signature(p: &mut JsParser, context: TypeContext) { + parse_ts_type_parameters(p, context).ok(); parse_parameter_list(p, ParameterContext::Declaration, SignatureFlags::empty()) .or_add_diagnostic(p, expected_parameters); parse_ts_return_type_annotation(p).ok(); @@ -134,10 +130,26 @@ fn parse_ts_type_parameter_name(p: &mut JsParser) -> ParsedSyntax { // // test_err ts ts_type_parameters_incomplete // type A ParsedSyntax { + if !is_nth_at_ts_type_parameters(p, 0) { + return Absent; + } + + let m = p.start(); + p.bump(T![<]); + if p.at(T![>]) { + p.error(expected_ts_type_parameter(p, p.cur_range())); + } + TsTypeParameterList::new(context, false).parse_list(p); + p.expect(T![>]); + + Present(m.complete(p, TS_TYPE_PARAMETERS)) +} + +pub(crate) fn parse_ts_type_parameters_with_modifiers( p: &mut JsParser, context: TypeContext, - could_use_parameter_modifier: bool, + allow_in_out_modifier: bool, ) -> ParsedSyntax { if !is_nth_at_ts_type_parameters(p, 0) { return Absent; @@ -148,7 +160,7 @@ pub(crate) fn parse_ts_type_parameters( if p.at(T![>]) { p.error(expected_ts_type_parameter(p, p.cur_range())); } - TsTypeParameterList::new(context, could_use_parameter_modifier).parse_list(p); + TsTypeParameterList::new(context, allow_in_out_modifier).parse_list(p); p.expect(T![>]); Present(m.complete(p, TS_TYPE_PARAMETERS)) @@ -156,14 +168,14 @@ pub(crate) fn parse_ts_type_parameters( struct TsTypeParameterList { context: TypeContext, - could_use_parameter_modifier: bool, + allow_in_out_modifier: bool, } impl TsTypeParameterList { - pub fn new(context: TypeContext, could_use_parameter_modifier: bool) -> Self { + pub fn new(context: TypeContext, allow_in_out_modifier: bool) -> Self { Self { context, - could_use_parameter_modifier, + allow_in_out_modifier, } } } @@ -175,7 +187,7 @@ impl ParseSeparatedList for TsTypeParameterList { const LIST_KIND: Self::Kind = TS_TYPE_PARAMETER_LIST; fn parse_element(&mut self, p: &mut JsParser) -> ParsedSyntax { - parse_ts_type_parameter(p, self.context, self.could_use_parameter_modifier) + parse_ts_type_parameter(p, self.context, self.allow_in_out_modifier) } fn is_at_list_end(&self, p: &mut JsParser) -> bool { @@ -237,7 +249,7 @@ impl ParseSeparatedList for TsTypeParameterList { // test_err ts type_parameter_modifier // type Foo = {} -// type Foo = {} +// type Foo = // type Foo = {} // type Foo = {} // type Foo = {} @@ -280,10 +292,10 @@ impl ParseSeparatedList for TsTypeParameterList { fn parse_ts_type_parameter( p: &mut JsParser, context: TypeContext, - could_use_parameter_modifier: bool, + allow_in_out_modifier: bool, ) -> ParsedSyntax { let m = p.start(); - if could_use_parameter_modifier { + if allow_in_out_modifier { parse_ts_type_parameter_modifiers(p); } @@ -972,7 +984,7 @@ fn parse_ts_property_or_method_signature_type_member( p.eat(T![?]); if p.at(T!['(']) || p.at(T![<]) { - parse_ts_call_signature(p, context, false); + parse_ts_call_signature(p, context); parse_ts_type_member_semi(p); let method = m.complete(p, TS_METHOD_SIGNATURE_TYPE_MEMBER); @@ -1001,7 +1013,7 @@ fn parse_ts_call_signature_type_member(p: &mut JsParser, context: TypeContext) - } let m = p.start(); - parse_ts_call_signature(p, context, false); + parse_ts_call_signature(p, context); parse_ts_type_member_semi(p); Present(m.complete(p, TS_CALL_SIGNATURE_TYPE_MEMBER)) } @@ -1020,7 +1032,7 @@ fn parse_ts_construct_signature_type_member( let m = p.start(); p.expect(T![new]); - parse_ts_type_parameters(p, context, true).ok(); + parse_ts_type_parameters_with_modifiers(p, context, true).ok(); parse_parameter_list(p, ParameterContext::Declaration, SignatureFlags::empty()) .or_add_diagnostic(p, expected_parameters); parse_ts_type_annotation(p).ok(); @@ -1289,7 +1301,7 @@ fn parse_ts_constructor_type(p: &mut JsParser, context: TypeContext) -> ParsedSy p.eat(T![abstract]); p.expect(T![new]); - parse_ts_type_parameters(p, context, false).ok(); + parse_ts_type_parameters(p, context).ok(); parse_parameter_list(p, ParameterContext::Declaration, SignatureFlags::empty()) .or_add_diagnostic(p, expected_parameters); p.expect(T![=>]); @@ -1352,7 +1364,7 @@ fn parse_ts_function_type(p: &mut JsParser, context: TypeContext) -> ParsedSynta } let m = p.start(); - parse_ts_type_parameters(p, context, false).ok(); + parse_ts_type_parameters(p, context).ok(); parse_parameter_list(p, ParameterContext::Declaration, SignatureFlags::empty()) .or_add_diagnostic(p, expected_parameters); p.expect(T![=>]); From 6a4802f7917e3ed0777f11ecf430d6b21595b482 Mon Sep 17 00:00:00 2001 From: nissy-dev Date: Mon, 6 Mar 2023 00:52:28 +0900 Subject: [PATCH 18/22] fix: update test case --- crates/rome_js_parser/src/syntax/typescript/types.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/rome_js_parser/src/syntax/typescript/types.rs b/crates/rome_js_parser/src/syntax/typescript/types.rs index 696c10f17a4..794d49664ff 100644 --- a/crates/rome_js_parser/src/syntax/typescript/types.rs +++ b/crates/rome_js_parser/src/syntax/typescript/types.rs @@ -249,7 +249,7 @@ impl ParseSeparatedList for TsTypeParameterList { // test_err ts type_parameter_modifier // type Foo = {} -// type Foo = +// type Foo = {} // type Foo = {} // type Foo = {} // type Foo = {} @@ -313,11 +313,11 @@ fn parse_ts_type_parameter( fn parse_ts_type_parameter_modifiers(p: &mut JsParser) { if p.at(T![in]) { - p.eat(T![in]); + p.bump(T![in]); } if p.at(T![out]) && !p.nth_at(1, T![,]) && !p.nth_at(1, T![>]) { - p.eat(T![out]); + p.bump(T![out]); } } From efb5dd02b95beca2f965c00db53aeb9a93391cac Mon Sep 17 00:00:00 2001 From: nissy-dev Date: Mon, 6 Mar 2023 22:02:58 +0900 Subject: [PATCH 19/22] feat: update parser --- .../optional-variance/basic.ts.snap | 794 ------- .../src/syntax/typescript/types.rs | 93 +- .../inline/err/type_parameter_modifier.rast | 308 +-- .../inline/err/type_parameter_modifier1.rast | 1898 ++++++----------- 4 files changed, 824 insertions(+), 2269 deletions(-) delete mode 100644 crates/rome_js_formatter/tests/specs/prettier/typescript/optional-variance/basic.ts.snap diff --git a/crates/rome_js_formatter/tests/specs/prettier/typescript/optional-variance/basic.ts.snap b/crates/rome_js_formatter/tests/specs/prettier/typescript/optional-variance/basic.ts.snap deleted file mode 100644 index f77bd7d30e8..00000000000 --- a/crates/rome_js_formatter/tests/specs/prettier/typescript/optional-variance/basic.ts.snap +++ /dev/null @@ -1,794 +0,0 @@ ---- -source: crates/rome_formatter_test/src/snapshot_builder.rs -info: - test_file: typescript/optional-variance/basic.ts ---- - -# Input - -```ts -type Covariant = { - x: T; -} -type Contravariant = { - f: (x: T) => void; -} -type Invariant = { - f: (x: T) => T; -} -type T10 = T; -type T11 = keyof T; -type T12 = T[K]; -type T13 = T[keyof T]; - -type Covariant1 = { - x: T; -} - -type Contravariant1 = keyof T; - -type Contravariant2 = { - f: (x: T) => void; -} - -type Invariant1 = { - f: (x: T) => T; -} - -type Invariant2 = { - f: (x: T) => T; -} -type Foo1 = { - x: T; - f: FooFn1; -} - -type Foo2 = { - x: T; - f: FooFn2; -} - -type Foo3 = { - x: T; - f: FooFn3; -} - -type T21 = T; - -interface Baz {} -interface Baz {} - -interface Parent { - child: Child | null; - parent: Parent | null; -} - -declare class StateNode { - _storedEvent: TEvent; - _action: ActionObject; - _state: StateNode; -} - -``` - - -# Prettier differences - -```diff ---- Prettier -+++ Rome -@@ -1,48 +1,48 @@ - type Covariant = { -- x: T; --}; -+ x: T; -+} - type Contravariant = { -- f: (x: T) => void; --}; -+ f: (x: T) => void; -+} - type Invariant = { -- f: (x: T) => T; --}; -+ f: (x: T) => T; -+} - type T10 = T; - type T11 = keyof T; - type T12 = T[K]; - type T13 = T[keyof T]; - - type Covariant1 = { -- x: T; --}; -+ x: T; -+} - - type Contravariant1 = keyof T; - - type Contravariant2 = { -- f: (x: T) => void; --}; -+ f: (x: T) => void; -+} - - type Invariant1 = { -- f: (x: T) => T; --}; -+ f: (x: T) => T; -+} - - type Invariant2 = { -- f: (x: T) => T; --}; -+ f: (x: T) => T; -+} - type Foo1 = { -- x: T; -- f: FooFn1; --}; -+ x: T; -+ f: FooFn1; -+} - - type Foo2 = { -- x: T; -- f: FooFn2; --}; -+ x: T; -+ f: FooFn2; -+} - - type Foo3 = { -- x: T; -- f: FooFn3; --}; -+ x: T; -+ f: FooFn3; -+} - - type T21 = T; - -@@ -50,12 +50,12 @@ - interface Baz {} - - interface Parent { -- child: Child | null; -- parent: Parent | null; -+ child: Child | null; -+ parent: Parent | null; - } - - declare class StateNode { -- _storedEvent: TEvent; -- _action: ActionObject; -- _state: StateNode; -+ _storedEvent: TEvent; -+ _action: ActionObject; -+ _state: StateNode; - } -``` - -# Output - -```ts -type Covariant = { - x: T; -}; -type Contravariant = { - f: (x: T) => void; -}; -type Invariant = { - f: (x: T) => T; -}; -type T10 = T; -type T11 = keyof T; -type T12 = T[K]; -type T13 = T[keyof T]; - -type Covariant1 = { - x: T; -}; - -type Contravariant1 = keyof T; - -type Contravariant2 = { - f: (x: T) => void; -}; - -type Invariant1 = { - f: (x: T) => T; -}; - -type Invariant2 = { - f: (x: T) => T; -}; -type Foo1 = { - x: T; - f: FooFn1; -}; - -type Foo2 = { - x: T; - f: FooFn2; -}; - -type Foo3 = { - x: T; - f: FooFn3; -}; - -type T21 = T; - -interface Baz {} -interface Baz {} - -interface Parent { - child: Child | null; - parent: Parent | null; -} - -declare class StateNode { - _storedEvent: TEvent; - _action: ActionObject; - _state: StateNode; -} -``` - -# Errors -``` -basic.ts:1:20 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `T` - - > 1 │ type Covariant = { - │ ^ - 2 │ x: T; - 3 │ } - - i Remove T - -basic.ts:4:20 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected a type parameter but instead found 'in' - - 2 │ x: T; - 3 │ } - > 4 │ type Contravariant = { - │ ^^ - 5 │ f: (x: T) => void; - 6 │ } - - i Expected a type parameter here - - 2 │ x: T; - 3 │ } - > 4 │ type Contravariant = { - │ ^^ - 5 │ f: (x: T) => void; - 6 │ } - -basic.ts:4:23 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `T` - - 2 │ x: T; - 3 │ } - > 4 │ type Contravariant = { - │ ^ - 5 │ f: (x: T) => void; - 6 │ } - - i Remove T - -basic.ts:7:16 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected a type parameter but instead found 'in' - - 5 │ f: (x: T) => void; - 6 │ } - > 7 │ type Invariant = { - │ ^^ - 8 │ f: (x: T) => T; - 9 │ } - - i Expected a type parameter here - - 5 │ f: (x: T) => void; - 6 │ } - > 7 │ type Invariant = { - │ ^^ - 8 │ f: (x: T) => T; - 9 │ } - -basic.ts:7:19 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `out` - - 5 │ f: (x: T) => void; - 6 │ } - > 7 │ type Invariant = { - │ ^^^ - 8 │ f: (x: T) => T; - 9 │ } - - i Remove out - -basic.ts:7:23 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `T` - - 5 │ f: (x: T) => void; - 6 │ } - > 7 │ type Invariant = { - │ ^ - 8 │ f: (x: T) => T; - 9 │ } - - i Remove T - -basic.ts:10:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `T` - - 8 │ f: (x: T) => T; - 9 │ } - > 10 │ type T10 = T; - │ ^ - 11 │ type T11 = keyof T; - 12 │ type T12 = T[K]; - - i Remove T - -basic.ts:11:10 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected a type parameter but instead found 'in' - - 9 │ } - 10 │ type T10 = T; - > 11 │ type T11 = keyof T; - │ ^^ - 12 │ type T12 = T[K]; - 13 │ type T13 = T[keyof T]; - - i Expected a type parameter here - - 9 │ } - 10 │ type T10 = T; - > 11 │ type T11 = keyof T; - │ ^^ - 12 │ type T12 = T[K]; - 13 │ type T13 = T[keyof T]; - -basic.ts:11:13 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `T` - - 9 │ } - 10 │ type T10 = T; - > 11 │ type T11 = keyof T; - │ ^ - 12 │ type T12 = T[K]; - 13 │ type T13 = T[keyof T]; - - i Remove T - -basic.ts:12:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `T` - - 10 │ type T10 = T; - 11 │ type T11 = keyof T; - > 12 │ type T12 = T[K]; - │ ^ - 13 │ type T13 = T[keyof T]; - 14 │ - - i Remove T - -basic.ts:12:21 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `K` - - 10 │ type T10 = T; - 11 │ type T11 = keyof T; - > 12 │ type T12 = T[K]; - │ ^ - 13 │ type T13 = T[keyof T]; - 14 │ - - i Remove K - -basic.ts:13:10 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected a type parameter but instead found 'in' - - 11 │ type T11 = keyof T; - 12 │ type T12 = T[K]; - > 13 │ type T13 = T[keyof T]; - │ ^^ - 14 │ - 15 │ type Covariant1 = { - - i Expected a type parameter here - - 11 │ type T11 = keyof T; - 12 │ type T12 = T[K]; - > 13 │ type T13 = T[keyof T]; - │ ^^ - 14 │ - 15 │ type Covariant1 = { - -basic.ts:13:13 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `out` - - 11 │ type T11 = keyof T; - 12 │ type T12 = T[K]; - > 13 │ type T13 = T[keyof T]; - │ ^^^ - 14 │ - 15 │ type Covariant1 = { - - i Remove out - -basic.ts:13:17 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `T` - - 11 │ type T11 = keyof T; - 12 │ type T12 = T[K]; - > 13 │ type T13 = T[keyof T]; - │ ^ - 14 │ - 15 │ type Covariant1 = { - - i Remove T - -basic.ts:15:17 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected a type parameter but instead found 'in' - - 13 │ type T13 = T[keyof T]; - 14 │ - > 15 │ type Covariant1 = { - │ ^^ - 16 │ x: T; - 17 │ } - - i Expected a type parameter here - - 13 │ type T13 = T[keyof T]; - 14 │ - > 15 │ type Covariant1 = { - │ ^^ - 16 │ x: T; - 17 │ } - -basic.ts:15:20 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `T` - - 13 │ type T13 = T[keyof T]; - 14 │ - > 15 │ type Covariant1 = { - │ ^ - 16 │ x: T; - 17 │ } - - i Remove T - -basic.ts:19:25 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `T` - - 17 │ } - 18 │ - > 19 │ type Contravariant1 = keyof T; - │ ^ - 20 │ - 21 │ type Contravariant2 = { - - i Remove T - -basic.ts:21:25 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `T` - - 19 │ type Contravariant1 = keyof T; - 20 │ - > 21 │ type Contravariant2 = { - │ ^ - 22 │ f: (x: T) => void; - 23 │ } - - i Remove T - -basic.ts:25:17 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected a type parameter but instead found 'in' - - 23 │ } - 24 │ - > 25 │ type Invariant1 = { - │ ^^ - 26 │ f: (x: T) => T; - 27 │ } - - i Expected a type parameter here - - 23 │ } - 24 │ - > 25 │ type Invariant1 = { - │ ^^ - 26 │ f: (x: T) => T; - 27 │ } - -basic.ts:25:20 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `T` - - 23 │ } - 24 │ - > 25 │ type Invariant1 = { - │ ^ - 26 │ f: (x: T) => T; - 27 │ } - - i Remove T - -basic.ts:29:21 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `T` - - 27 │ } - 28 │ - > 29 │ type Invariant2 = { - │ ^ - 30 │ f: (x: T) => T; - 31 │ } - - i Remove T - -basic.ts:32:11 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected a type parameter but instead found 'in' - - 30 │ f: (x: T) => T; - 31 │ } - > 32 │ type Foo1 = { - │ ^^ - 33 │ x: T; - 34 │ f: FooFn1; - - i Expected a type parameter here - - 30 │ f: (x: T) => T; - 31 │ } - > 32 │ type Foo1 = { - │ ^^ - 33 │ x: T; - 34 │ f: FooFn1; - -basic.ts:32:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `T` - - 30 │ f: (x: T) => T; - 31 │ } - > 32 │ type Foo1 = { - │ ^ - 33 │ x: T; - 34 │ f: FooFn1; - - i Remove T - -basic.ts:37:15 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `T` - - 35 │ } - 36 │ - > 37 │ type Foo2 = { - │ ^ - 38 │ x: T; - 39 │ f: FooFn2; - - i Remove T - -basic.ts:42:11 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected a type parameter but instead found 'in' - - 40 │ } - 41 │ - > 42 │ type Foo3 = { - │ ^^ - 43 │ x: T; - 44 │ f: FooFn3; - - i Expected a type parameter here - - 40 │ } - 41 │ - > 42 │ type Foo3 = { - │ ^^ - 43 │ x: T; - 44 │ f: FooFn3; - -basic.ts:42:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `out` - - 40 │ } - 41 │ - > 42 │ type Foo3 = { - │ ^^^ - 43 │ x: T; - 44 │ f: FooFn3; - - i Remove out - -basic.ts:42:18 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `T` - - 40 │ } - 41 │ - > 42 │ type Foo3 = { - │ ^ - 43 │ x: T; - 44 │ f: FooFn3; - - i Remove T - -basic.ts:47:10 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected a type parameter but instead found 'in' - - 45 │ } - 46 │ - > 47 │ type T21 = T; - │ ^^ - 48 │ - 49 │ interface Baz {} - - i Expected a type parameter here - - 45 │ } - 46 │ - > 47 │ type T21 = T; - │ ^^ - 48 │ - 49 │ interface Baz {} - -basic.ts:47:13 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `out` - - 45 │ } - 46 │ - > 47 │ type T21 = T; - │ ^^^ - 48 │ - 49 │ interface Baz {} - - i Remove out - -basic.ts:47:17 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `T` - - 45 │ } - 46 │ - > 47 │ type T21 = T; - │ ^ - 48 │ - 49 │ interface Baz {} - - i Remove T - -basic.ts:49:19 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `T` - - 47 │ type T21 = T; - 48 │ - > 49 │ interface Baz {} - │ ^ - 50 │ interface Baz {} - 51 │ - - i Remove T - -basic.ts:50:15 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected a type parameter but instead found 'in' - - 49 │ interface Baz {} - > 50 │ interface Baz {} - │ ^^ - 51 │ - 52 │ interface Parent { - - i Expected a type parameter here - - 49 │ interface Baz {} - > 50 │ interface Baz {} - │ ^^ - 51 │ - 52 │ interface Parent { - -basic.ts:50:18 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `T` - - 49 │ interface Baz {} - > 50 │ interface Baz {} - │ ^ - 51 │ - 52 │ interface Parent { - - i Remove T - -basic.ts:52:22 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `A` - - 50 │ interface Baz {} - 51 │ - > 52 │ interface Parent { - │ ^ - 53 │ child: Child | null; - 54 │ parent: Parent | null; - - i Remove A - -basic.ts:57:35 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected a type parameter but instead found 'in' - - 55 │ } - 56 │ - > 57 │ declare class StateNode { - │ ^^ - 58 │ _storedEvent: TEvent; - 59 │ _action: ActionObject; - - i Expected a type parameter here - - 55 │ } - 56 │ - > 57 │ declare class StateNode { - │ ^^ - 58 │ _storedEvent: TEvent; - 59 │ _action: ActionObject; - -basic.ts:57:38 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `out` - - 55 │ } - 56 │ - > 57 │ declare class StateNode { - │ ^^^ - 58 │ _storedEvent: TEvent; - 59 │ _action: ActionObject; - - i Remove out - -basic.ts:57:42 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `TEvent` - - 55 │ } - 56 │ - > 57 │ declare class StateNode { - │ ^^^^^^ - 58 │ _storedEvent: TEvent; - 59 │ _action: ActionObject; - - i Remove TEvent - - -``` diff --git a/crates/rome_js_parser/src/syntax/typescript/types.rs b/crates/rome_js_parser/src/syntax/typescript/types.rs index 794d49664ff..af44b9b0ba6 100644 --- a/crates/rome_js_parser/src/syntax/typescript/types.rs +++ b/crates/rome_js_parser/src/syntax/typescript/types.rs @@ -12,7 +12,7 @@ use crate::syntax::function::{ }; use crate::syntax::js_parse_error::{ expected_identifier, expected_object_member_name, expected_parameter, expected_parameters, - expected_property_or_signature, + expected_property_or_signature, modifier_already_seen, modifier_must_precede_modifier, }; use crate::syntax::object::{ is_at_object_member_name, is_nth_at_type_member_name, parse_object_member_name, @@ -22,6 +22,7 @@ use crate::syntax::typescript::try_parse; use crate::syntax::typescript::ts_parse_error::{expected_ts_type, expected_ts_type_parameter}; use bitflags::bitflags; use rome_parser::parse_lists::{ParseNodeList, ParseSeparatedList}; +use smallvec::SmallVec; use crate::lexer::{LexContext, ReLexContext}; use crate::span::Span; @@ -295,9 +296,7 @@ fn parse_ts_type_parameter( allow_in_out_modifier: bool, ) -> ParsedSyntax { let m = p.start(); - if allow_in_out_modifier { - parse_ts_type_parameter_modifiers(p); - } + parse_ts_type_parameter_modifiers(p, allow_in_out_modifier); let name = parse_ts_type_parameter_name(p); parse_ts_type_constraint_clause(p, context).ok(); @@ -311,13 +310,89 @@ fn parse_ts_type_parameter( } } -fn parse_ts_type_parameter_modifiers(p: &mut JsParser) { - if p.at(T![in]) { - p.bump(T![in]); +#[derive(Eq, PartialEq, Clone, Copy, Debug)] +enum TypeParameterModifierKind { + In, + Out, +} + +/// Stores the range of a parsed modifier with its kind +#[derive(Eq, PartialEq, Clone, Copy, Debug)] +struct TypeParameterModifier { + kind: TypeParameterModifierKind, + range: TextRange, +} + +#[derive(Debug, Default)] +struct ClassMemberModifierList(SmallVec<[TypeParameterModifier; 2]>); + +impl ClassMemberModifierList { + /// Sets the range of a parsed modifier + fn add_modifier(&mut self, modifier: TypeParameterModifier) { + self.0.push(modifier); } - if p.at(T![out]) && !p.nth_at(1, T![,]) && !p.nth_at(1, T![>]) { - p.bump(T![out]); + fn find(&self, modifier_kind: &TypeParameterModifierKind) -> Option<&TypeParameterModifier> { + self.0 + .iter() + .find(|predicate| predicate.kind == *modifier_kind) + } +} + +fn parse_ts_type_parameter_modifiers(p: &mut JsParser, allow_in_out_modifier: bool) { + let mut modifiers = ClassMemberModifierList::default(); + while p.at_ts(token_set!(T![in], T![out])) && !p.nth_at(1, T![,]) && !p.nth_at(1, T![>]) { + if !allow_in_out_modifier { + let text_range = p.cur_range(); + p.error(p.err_builder( + format!( + "'{}' modifier can only appear on a type parameter of a class, interface or type alias.", + p.text(text_range) + ), + text_range, + )); + p.bump_any(); + continue; + } + + let modifier = match p.cur() { + T![in] => TypeParameterModifier { + kind: TypeParameterModifierKind::In, + range: p.cur_range(), + }, + T![out] => TypeParameterModifier { + kind: TypeParameterModifierKind::Out, + range: p.cur_range(), + }, + _ => unreachable!(), + }; + + // check for duplicate modifiers + if let Some(existing_modifier) = modifiers.find(&modifier.kind) { + p.error(modifier_already_seen( + p, + modifier.range, + existing_modifier.range, + )); + p.bump_any(); + continue; + } + + // check for modifier precedence + if let Some(out_modifier) = modifiers.find(&TypeParameterModifierKind::Out) { + if modifier.kind == TypeParameterModifierKind::In { + p.error(modifier_must_precede_modifier( + p, + modifier.range, + out_modifier.range, + )); + p.bump_any(); + continue; + } + } + + modifiers.add_modifier(modifier); + p.bump_any(); } } diff --git a/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.rast b/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.rast index 62bc824973e..005e89e74fb 100644 --- a/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.rast +++ b/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.rast @@ -185,21 +185,15 @@ JsModule { L_ANGLE@104..105 "<" [] [], JsBogus { items: [ - OUT_KW@105..109 "out" [] [Whitespace(" ")], - TsBogusType { + JsBogus { items: [ + OUT_KW@105..109 "out" [] [Whitespace(" ")], IN_KW@109..112 "in" [] [Whitespace(" ")], + TsTypeParameterName { + ident_token: IDENT@112..113 "T" [] [], + }, ], }, - TsTypeParameter { - in_modifier_token: missing (optional), - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@112..113 "T" [] [], - }, - constraint: missing (optional), - default: missing (optional), - }, ], }, R_ANGLE@113..115 ">" [] [Whitespace(" ")], @@ -266,22 +260,16 @@ JsModule { L_ANGLE@152..153 "<" [] [], JsBogus { items: [ - IN_KW@153..156 "in" [] [Whitespace(" ")], - OUT_KW@156..160 "out" [] [Whitespace(" ")], - TsBogusType { + JsBogus { items: [ + IN_KW@153..156 "in" [] [Whitespace(" ")], + OUT_KW@156..160 "out" [] [Whitespace(" ")], IN_KW@160..163 "in" [] [Whitespace(" ")], + TsTypeParameterName { + ident_token: IDENT@163..164 "T" [] [], + }, ], }, - TsTypeParameter { - in_modifier_token: missing (optional), - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@163..164 "T" [] [], - }, - constraint: missing (optional), - default: missing (optional), - }, ], }, R_ANGLE@164..166 ">" [] [Whitespace(" ")], @@ -295,110 +283,88 @@ JsModule { }, ], }, - TsTypeAliasDeclaration { - type_token: TYPE_KW@170..176 "type" [Newline("\n")] [Whitespace(" ")], - binding_identifier: TsIdentifierBinding { - name_token: IDENT@176..179 "Foo" [] [], - }, - type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@179..180 "<" [] [], - items: TsTypeParameterList [ - TsTypeParameter { - in_modifier_token: IN_KW@180..183 "in" [] [Whitespace(" ")], - out_modifier_token: OUT_KW@183..187 "out" [] [Whitespace(" ")], - name: TsTypeParameterName { - ident_token: IDENT@187..191 "out" [] [Whitespace(" ")], - }, - constraint: missing (optional), - default: missing (optional), - }, - missing separator, - TsTypeParameter { - in_modifier_token: missing (optional), - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@191..192 "T" [] [], - }, - constraint: missing (optional), - default: missing (optional), - }, - ], - r_angle_token: R_ANGLE@192..194 ">" [] [Whitespace(" ")], - }, - eq_token: EQ@194..196 "=" [] [Whitespace(" ")], - ty: TsObjectType { - l_curly_token: L_CURLY@196..197 "{" [] [], - members: TsTypeMemberList [], - r_curly_token: R_CURLY@197..198 "}" [] [], - }, - semicolon_token: missing (optional), - }, JsBogusStatement { items: [ - FUNCTION_KW@198..208 "function" [Newline("\n")] [Whitespace(" ")], - JsIdentifierBinding { - name_token: IDENT@208..211 "foo" [] [], + TYPE_KW@170..176 "type" [Newline("\n")] [Whitespace(" ")], + TsIdentifierBinding { + name_token: IDENT@176..179 "Foo" [] [], }, JsBogus { items: [ - L_ANGLE@211..212 "<" [] [], + L_ANGLE@179..180 "<" [] [], JsBogus { items: [ - TsBogusType { + JsBogus { items: [ - IN_KW@212..215 "in" [] [Whitespace(" ")], + IN_KW@180..183 "in" [] [Whitespace(" ")], + OUT_KW@183..187 "out" [] [Whitespace(" ")], + OUT_KW@187..191 "out" [] [Whitespace(" ")], + TsTypeParameterName { + ident_token: IDENT@191..192 "T" [] [], + }, ], }, - TsTypeParameter { - in_modifier_token: missing (optional), - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@215..216 "T" [] [], - }, - constraint: missing (optional), - default: missing (optional), - }, ], }, - R_ANGLE@216..217 ">" [] [], + R_ANGLE@192..194 ">" [] [Whitespace(" ")], ], }, - JsParameters { - l_paren_token: L_PAREN@217..218 "(" [] [], - items: JsParameterList [], - r_paren_token: R_PAREN@218..220 ")" [] [Whitespace(" ")], - }, - JsFunctionBody { - l_curly_token: L_CURLY@220..221 "{" [] [], - directives: JsDirectiveList [], - statements: JsStatementList [], - r_curly_token: R_CURLY@221..222 "}" [] [], + EQ@194..196 "=" [] [Whitespace(" ")], + TsObjectType { + l_curly_token: L_CURLY@196..197 "{" [] [], + members: TsTypeMemberList [], + r_curly_token: R_CURLY@197..198 "}" [] [], }, ], }, JsFunctionDeclaration { async_token: missing (optional), - function_token: FUNCTION_KW@222..232 "function" [Newline("\n")] [Whitespace(" ")], + function_token: FUNCTION_KW@198..208 "function" [Newline("\n")] [Whitespace(" ")], star_token: missing (optional), id: JsIdentifierBinding { - name_token: IDENT@232..235 "foo" [] [], + name_token: IDENT@208..211 "foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@235..236 "<" [] [], + l_angle_token: L_ANGLE@211..212 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - in_modifier_token: missing (optional), + in_modifier_token: IN_KW@212..215 "in" [] [Whitespace(" ")], out_modifier_token: missing (optional), name: TsTypeParameterName { - ident_token: IDENT@236..240 "out" [] [Whitespace(" ")], + ident_token: IDENT@215..216 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, - missing separator, + ], + r_angle_token: R_ANGLE@216..217 ">" [] [], + }, + parameters: JsParameters { + l_paren_token: L_PAREN@217..218 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@218..220 ")" [] [Whitespace(" ")], + }, + return_type_annotation: missing (optional), + body: JsFunctionBody { + l_curly_token: L_CURLY@220..221 "{" [] [], + directives: JsDirectiveList [], + statements: JsStatementList [], + r_curly_token: R_CURLY@221..222 "}" [] [], + }, + }, + JsFunctionDeclaration { + async_token: missing (optional), + function_token: FUNCTION_KW@222..232 "function" [Newline("\n")] [Whitespace(" ")], + star_token: missing (optional), + id: JsIdentifierBinding { + name_token: IDENT@232..235 "foo" [] [], + }, + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@235..236 "<" [] [], + items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: missing (optional), + out_modifier_token: OUT_KW@236..240 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@240..241 "T" [] [], }, @@ -540,16 +506,11 @@ JsModule { 2: JS_BOGUS@104..115 0: L_ANGLE@104..105 "<" [] [] 1: JS_BOGUS@105..113 - 0: OUT_KW@105..109 "out" [] [Whitespace(" ")] - 1: TS_BOGUS_TYPE@109..112 - 0: IN_KW@109..112 "in" [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER@112..113 - 0: (empty) - 1: (empty) + 0: JS_BOGUS@105..113 + 0: OUT_KW@105..109 "out" [] [Whitespace(" ")] + 1: IN_KW@109..112 "in" [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER_NAME@112..113 0: IDENT@112..113 "T" [] [] - 3: (empty) - 4: (empty) 2: R_ANGLE@113..115 ">" [] [Whitespace(" ")] 3: EQ@115..117 "=" [] [Whitespace(" ")] 4: TS_OBJECT_TYPE@117..119 @@ -586,74 +547,60 @@ JsModule { 2: JS_BOGUS@152..166 0: L_ANGLE@152..153 "<" [] [] 1: JS_BOGUS@153..164 - 0: IN_KW@153..156 "in" [] [Whitespace(" ")] - 1: OUT_KW@156..160 "out" [] [Whitespace(" ")] - 2: TS_BOGUS_TYPE@160..163 - 0: IN_KW@160..163 "in" [] [Whitespace(" ")] - 3: TS_TYPE_PARAMETER@163..164 - 0: (empty) - 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@163..164 + 0: JS_BOGUS@153..164 + 0: IN_KW@153..156 "in" [] [Whitespace(" ")] + 1: OUT_KW@156..160 "out" [] [Whitespace(" ")] + 2: IN_KW@160..163 "in" [] [Whitespace(" ")] + 3: TS_TYPE_PARAMETER_NAME@163..164 0: IDENT@163..164 "T" [] [] - 3: (empty) - 4: (empty) 2: R_ANGLE@164..166 ">" [] [Whitespace(" ")] 3: EQ@166..168 "=" [] [Whitespace(" ")] 4: TS_OBJECT_TYPE@168..170 0: L_CURLY@168..169 "{" [] [] 1: TS_TYPE_MEMBER_LIST@169..169 2: R_CURLY@169..170 "}" [] [] - 7: TS_TYPE_ALIAS_DECLARATION@170..198 + 7: JS_BOGUS_STATEMENT@170..198 0: TYPE_KW@170..176 "type" [Newline("\n")] [Whitespace(" ")] 1: TS_IDENTIFIER_BINDING@176..179 0: IDENT@176..179 "Foo" [] [] - 2: TS_TYPE_PARAMETERS@179..194 + 2: JS_BOGUS@179..194 0: L_ANGLE@179..180 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@180..192 - 0: TS_TYPE_PARAMETER@180..191 + 1: JS_BOGUS@180..192 + 0: JS_BOGUS@180..192 0: IN_KW@180..183 "in" [] [Whitespace(" ")] 1: OUT_KW@183..187 "out" [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER_NAME@187..191 - 0: IDENT@187..191 "out" [] [Whitespace(" ")] - 3: (empty) - 4: (empty) - 1: (empty) - 2: TS_TYPE_PARAMETER@191..192 - 0: (empty) - 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@191..192 + 2: OUT_KW@187..191 "out" [] [Whitespace(" ")] + 3: TS_TYPE_PARAMETER_NAME@191..192 0: IDENT@191..192 "T" [] [] - 3: (empty) - 4: (empty) 2: R_ANGLE@192..194 ">" [] [Whitespace(" ")] 3: EQ@194..196 "=" [] [Whitespace(" ")] 4: TS_OBJECT_TYPE@196..198 0: L_CURLY@196..197 "{" [] [] 1: TS_TYPE_MEMBER_LIST@197..197 2: R_CURLY@197..198 "}" [] [] - 5: (empty) - 8: JS_BOGUS_STATEMENT@198..222 - 0: FUNCTION_KW@198..208 "function" [Newline("\n")] [Whitespace(" ")] - 1: JS_IDENTIFIER_BINDING@208..211 + 8: JS_FUNCTION_DECLARATION@198..222 + 0: (empty) + 1: FUNCTION_KW@198..208 "function" [Newline("\n")] [Whitespace(" ")] + 2: (empty) + 3: JS_IDENTIFIER_BINDING@208..211 0: IDENT@208..211 "foo" [] [] - 2: JS_BOGUS@211..217 + 4: TS_TYPE_PARAMETERS@211..217 0: L_ANGLE@211..212 "<" [] [] - 1: JS_BOGUS@212..216 - 0: TS_BOGUS_TYPE@212..215 + 1: TS_TYPE_PARAMETER_LIST@212..216 + 0: TS_TYPE_PARAMETER@212..216 0: IN_KW@212..215 "in" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER@215..216 - 0: (empty) 1: (empty) 2: TS_TYPE_PARAMETER_NAME@215..216 0: IDENT@215..216 "T" [] [] 3: (empty) 4: (empty) 2: R_ANGLE@216..217 ">" [] [] - 3: JS_PARAMETERS@217..220 + 5: JS_PARAMETERS@217..220 0: L_PAREN@217..218 "(" [] [] 1: JS_PARAMETER_LIST@218..218 2: R_PAREN@218..220 ")" [] [Whitespace(" ")] - 4: JS_FUNCTION_BODY@220..222 + 6: (empty) + 7: JS_FUNCTION_BODY@220..222 0: L_CURLY@220..221 "{" [] [] 1: JS_DIRECTIVE_LIST@221..221 2: JS_STATEMENT_LIST@221..221 @@ -667,17 +614,9 @@ JsModule { 4: TS_TYPE_PARAMETERS@235..242 0: L_ANGLE@235..236 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@236..241 - 0: TS_TYPE_PARAMETER@236..240 - 0: (empty) - 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@236..240 - 0: IDENT@236..240 "out" [] [Whitespace(" ")] - 3: (empty) - 4: (empty) - 1: (empty) - 2: TS_TYPE_PARAMETER@240..241 + 0: TS_TYPE_PARAMETER@236..241 0: (empty) - 1: (empty) + 1: OUT_KW@236..240 "out" [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER_NAME@240..241 0: IDENT@240..241 "T" [] [] 3: (empty) @@ -810,7 +749,7 @@ type_parameter_modifier.ts:4:14 parse ━━━━━━━━━━━━━━ -- type_parameter_modifier.ts:5:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × expected a type parameter but instead found 'in' + × 'in' must precede 'out' 3 │ type Foo = {} 4 │ type Foo = {} @@ -819,7 +758,7 @@ type_parameter_modifier.ts:5:14 parse ━━━━━━━━━━━━━━ 6 │ type Foo = {} 7 │ type Foo = {} - i Expected a type parameter here + i move this modifier 3 │ type Foo = {} 4 │ type Foo = {} @@ -828,20 +767,15 @@ type_parameter_modifier.ts:5:14 parse ━━━━━━━━━━━━━━ 6 │ type Foo = {} 7 │ type Foo = {} --- -type_parameter_modifier.ts:5:17 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `T` + i before this modifier 3 │ type Foo = {} 4 │ type Foo = {} > 5 │ type Foo = {} - │ ^ + │ ^^^ 6 │ type Foo = {} 7 │ type Foo = {} - i Remove T - -- type_parameter_modifier.ts:6:10 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -871,7 +805,7 @@ type_parameter_modifier.ts:6:17 parse ━━━━━━━━━━━━━━ -- type_parameter_modifier.ts:7:17 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × expected a type parameter but instead found 'in' + × 'in' already seen 5 │ type Foo = {} 6 │ type Foo = {} @@ -880,7 +814,7 @@ type_parameter_modifier.ts:7:17 parse ━━━━━━━━━━━━━━ 8 │ type Foo = {} 9 │ function foo() {} - i Expected a type parameter here + i duplicate modifier 5 │ type Foo = {} 6 │ type Foo = {} @@ -889,82 +823,68 @@ type_parameter_modifier.ts:7:17 parse ━━━━━━━━━━━━━━ 8 │ type Foo = {} 9 │ function foo() {} --- -type_parameter_modifier.ts:7:20 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `T` + i first seen here 5 │ type Foo = {} 6 │ type Foo = {} > 7 │ type Foo = {} - │ ^ + │ ^^ 8 │ type Foo = {} 9 │ function foo() {} - i Remove T - -- -type_parameter_modifier.ts:8:21 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier.ts:8:17 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × expected `,` but instead found `T` + × 'out' already seen 6 │ type Foo = {} 7 │ type Foo = {} > 8 │ type Foo = {} - │ ^ + │ ^^^ 9 │ function foo() {} 10 │ function foo() {} - i Remove T - --- -type_parameter_modifier.ts:9:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected a type parameter but instead found 'in' + i duplicate modifier + 6 │ type Foo = {} 7 │ type Foo = {} - 8 │ type Foo = {} - > 9 │ function foo() {} - │ ^^ + > 8 │ type Foo = {} + │ ^^^ + 9 │ function foo() {} 10 │ function foo() {} - 11 │ - i Expected a type parameter here + i first seen here + 6 │ type Foo = {} 7 │ type Foo = {} - 8 │ type Foo = {} - > 9 │ function foo() {} - │ ^^ + > 8 │ type Foo = {} + │ ^^^ + 9 │ function foo() {} 10 │ function foo() {} - 11 │ -- -type_parameter_modifier.ts:9:17 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier.ts:9:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × expected `,` but instead found `T` + × 'in' modifier can only appear on a type parameter of a class, interface or type alias. 7 │ type Foo = {} 8 │ type Foo = {} > 9 │ function foo() {} - │ ^ + │ ^^ 10 │ function foo() {} 11 │ - i Remove T - -- -type_parameter_modifier.ts:10:18 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier.ts:10:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × expected `,` but instead found `T` + × 'out' modifier can only appear on a type parameter of a class, interface or type alias. 8 │ type Foo = {} 9 │ function foo() {} > 10 │ function foo() {} - │ ^ + │ ^^^ 11 │ - i Remove T - -- type Foo = {} type Foo = {} diff --git a/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier1.rast b/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier1.rast index 41dae42c9e8..65d715dcbf0 100644 --- a/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier1.rast +++ b/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier1.rast @@ -2,58 +2,47 @@ JsModule { interpreter_token: missing (optional), directives: JsDirectiveList [], items: JsModuleItemList [ - JsBogusStatement { - items: [ - EXPORT_KW@0..8 "export" [Whitespace("\t")] [Whitespace(" ")], - JsBogus { - items: [ - DEFAULT_KW@8..16 "default" [] [Whitespace(" ")], - JsBogus { - items: [ - FUNCTION_KW@16..25 "function" [] [Whitespace(" ")], - JsIdentifierBinding { - name_token: IDENT@25..28 "foo" [] [], - }, - JsBogus { - items: [ - L_ANGLE@28..29 "<" [] [], - JsBogus { - items: [ - TsBogusType { - items: [ - IN_KW@29..32 "in" [] [Whitespace(" ")], - ], - }, - TsTypeParameter { - in_modifier_token: missing (optional), - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@32..33 "T" [] [], - }, - constraint: missing (optional), - default: missing (optional), - }, - ], - }, - R_ANGLE@33..34 ">" [] [], - ], - }, - JsParameters { - l_paren_token: L_PAREN@34..35 "(" [] [], - items: JsParameterList [], - r_paren_token: R_PAREN@35..37 ")" [] [Whitespace(" ")], - }, - JsFunctionBody { - l_curly_token: L_CURLY@37..38 "{" [] [], - directives: JsDirectiveList [], - statements: JsStatementList [], - r_curly_token: R_CURLY@38..39 "}" [] [], + JsExport { + export_token: EXPORT_KW@0..8 "export" [Whitespace("\t")] [Whitespace(" ")], + export_clause: JsExportDefaultDeclarationClause { + default_token: DEFAULT_KW@8..16 "default" [] [Whitespace(" ")], + declaration: JsFunctionExportDefaultDeclaration { + async_token: missing (optional), + function_token: FUNCTION_KW@16..25 "function" [] [Whitespace(" ")], + star_token: missing (optional), + id: JsIdentifierBinding { + name_token: IDENT@25..28 "foo" [] [], + }, + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@28..29 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + in_modifier_token: IN_KW@29..32 "in" [] [Whitespace(" ")], + out_modifier_token: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@32..33 "T" [] [], }, - ], - }, - ], + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@33..34 ">" [] [], + }, + parameters: JsParameters { + l_paren_token: L_PAREN@34..35 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@35..37 ")" [] [Whitespace(" ")], + }, + return_type_annotation: missing (optional), + body: JsFunctionBody { + l_curly_token: L_CURLY@37..38 "{" [] [], + directives: JsDirectiveList [], + statements: JsStatementList [], + r_curly_token: R_CURLY@38..39 "}" [] [], + }, }, - ], + semicolon_token: missing (optional), + }, }, JsExport { export_token: EXPORT_KW@39..48 "export" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], @@ -69,17 +58,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@61..65 "out" [] [Whitespace(" ")], - }, - constraint: missing (optional), - default: missing (optional), - }, - missing separator, - TsTypeParameter { - in_modifier_token: missing (optional), - out_modifier_token: missing (optional), + out_modifier_token: OUT_KW@61..65 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@65..66 "T" [] [], }, @@ -103,53 +82,43 @@ JsModule { }, }, }, - JsBogusStatement { - items: [ - EXPORT_KW@72..81 "export" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], - JsBogusStatement { - items: [ - FUNCTION_KW@81..90 "function" [] [Whitespace(" ")], - JsIdentifierBinding { - name_token: IDENT@90..94 "foo1" [] [], - }, - JsBogus { - items: [ - L_ANGLE@94..95 "<" [] [], - JsBogus { - items: [ - TsBogusType { - items: [ - IN_KW@95..98 "in" [] [Whitespace(" ")], - ], - }, - TsTypeParameter { - in_modifier_token: missing (optional), - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@98..99 "T" [] [], - }, - constraint: missing (optional), - default: missing (optional), - }, - ], - }, - R_ANGLE@99..100 ">" [] [], - ], - }, - JsParameters { - l_paren_token: L_PAREN@100..101 "(" [] [], - items: JsParameterList [], - r_paren_token: R_PAREN@101..103 ")" [] [Whitespace(" ")], - }, - JsFunctionBody { - l_curly_token: L_CURLY@103..104 "{" [] [], - directives: JsDirectiveList [], - statements: JsStatementList [], - r_curly_token: R_CURLY@104..105 "}" [] [], + JsExport { + export_token: EXPORT_KW@72..81 "export" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + export_clause: JsFunctionDeclaration { + async_token: missing (optional), + function_token: FUNCTION_KW@81..90 "function" [] [Whitespace(" ")], + star_token: missing (optional), + id: JsIdentifierBinding { + name_token: IDENT@90..94 "foo1" [] [], + }, + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@94..95 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + in_modifier_token: IN_KW@95..98 "in" [] [Whitespace(" ")], + out_modifier_token: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@98..99 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), }, ], + r_angle_token: R_ANGLE@99..100 ">" [] [], }, - ], + parameters: JsParameters { + l_paren_token: L_PAREN@100..101 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@101..103 ")" [] [Whitespace(" ")], + }, + return_type_annotation: missing (optional), + body: JsFunctionBody { + l_curly_token: L_CURLY@103..104 "{" [] [], + directives: JsDirectiveList [], + statements: JsStatementList [], + r_curly_token: R_CURLY@104..105 "}" [] [], + }, + }, }, JsExport { export_token: EXPORT_KW@105..114 "export" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], @@ -165,17 +134,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@128..132 "out" [] [Whitespace(" ")], - }, - constraint: missing (optional), - default: missing (optional), - }, - missing separator, - TsTypeParameter { - in_modifier_token: missing (optional), - out_modifier_token: missing (optional), + out_modifier_token: OUT_KW@128..132 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@132..133 "T" [] [], }, @@ -281,47 +240,37 @@ JsModule { }, semicolon_token: missing (optional), }, - JsBogusStatement { - items: [ - DECLARE_KW@180..190 "declare" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], - JsBogusStatement { - items: [ - FUNCTION_KW@190..199 "function" [] [Whitespace(" ")], - JsIdentifierBinding { - name_token: IDENT@199..202 "foo" [] [], - }, - JsBogus { - items: [ - L_ANGLE@202..203 "<" [] [], - JsBogus { - items: [ - TsBogusType { - items: [ - IN_KW@203..206 "in" [] [Whitespace(" ")], - ], - }, - TsTypeParameter { - in_modifier_token: missing (optional), - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@206..207 "T" [] [], - }, - constraint: missing (optional), - default: missing (optional), - }, - ], - }, - R_ANGLE@207..208 ">" [] [], - ], - }, - JsParameters { - l_paren_token: L_PAREN@208..209 "(" [] [], - items: JsParameterList [], - r_paren_token: R_PAREN@209..210 ")" [] [], + TsDeclareStatement { + declare_token: DECLARE_KW@180..190 "declare" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + declaration: TsDeclareFunctionDeclaration { + async_token: missing (optional), + function_token: FUNCTION_KW@190..199 "function" [] [Whitespace(" ")], + id: JsIdentifierBinding { + name_token: IDENT@199..202 "foo" [] [], + }, + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@202..203 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + in_modifier_token: IN_KW@203..206 "in" [] [Whitespace(" ")], + out_modifier_token: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@206..207 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), }, ], + r_angle_token: R_ANGLE@207..208 ">" [] [], }, - ], + parameters: JsParameters { + l_paren_token: L_PAREN@208..209 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@209..210 ")" [] [], + }, + return_type_annotation: missing (optional), + semicolon_token: missing (optional), + }, }, TsDeclareStatement { declare_token: DECLARE_KW@210..220 "declare" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], @@ -336,17 +285,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@233..237 "out" [] [Whitespace(" ")], - }, - constraint: missing (optional), - default: missing (optional), - }, - missing separator, - TsTypeParameter { - in_modifier_token: missing (optional), - out_modifier_token: missing (optional), + out_modifier_token: OUT_KW@233..237 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@237..238 "T" [] [], }, @@ -525,45 +464,38 @@ JsModule { name_token: IDENT@345..351 "foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], }, operator_token: EQ@351..353 "=" [] [Whitespace(" ")], - right: JsBogusExpression { - items: [ - FUNCTION_KW@353..362 "function" [] [Whitespace(" ")], - JsBogus { - items: [ - L_ANGLE@362..363 "<" [] [], - JsBogus { - items: [ - TsBogusType { - items: [ - IN_KW@363..366 "in" [] [Whitespace(" ")], - ], - }, - TsTypeParameter { - in_modifier_token: missing (optional), - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@366..367 "T" [] [], - }, - constraint: missing (optional), - default: missing (optional), - }, - ], + right: JsFunctionExpression { + async_token: missing (optional), + function_token: FUNCTION_KW@353..362 "function" [] [Whitespace(" ")], + star_token: missing (optional), + id: missing (optional), + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@362..363 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + in_modifier_token: IN_KW@363..366 "in" [] [Whitespace(" ")], + out_modifier_token: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@366..367 "T" [] [], }, - R_ANGLE@367..368 ">" [] [], - ], - }, - JsParameters { - l_paren_token: L_PAREN@368..369 "(" [] [], - items: JsParameterList [], - r_paren_token: R_PAREN@369..371 ")" [] [Whitespace(" ")], - }, - JsFunctionBody { - l_curly_token: L_CURLY@371..372 "{" [] [], - directives: JsDirectiveList [], - statements: JsStatementList [], - r_curly_token: R_CURLY@372..373 "}" [] [], - }, - ], + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@367..368 ">" [] [], + }, + parameters: JsParameters { + l_paren_token: L_PAREN@368..369 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@369..371 ")" [] [Whitespace(" ")], + }, + return_type_annotation: missing (optional), + body: JsFunctionBody { + l_curly_token: L_CURLY@371..372 "{" [] [], + directives: JsDirectiveList [], + statements: JsStatementList [], + r_curly_token: R_CURLY@372..373 "}" [] [], + }, }, }, semicolon_token: missing (optional), @@ -584,17 +516,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@391..395 "out" [] [Whitespace(" ")], - }, - constraint: missing (optional), - default: missing (optional), - }, - missing separator, - TsTypeParameter { - in_modifier_token: missing (optional), - out_modifier_token: missing (optional), + out_modifier_token: OUT_KW@391..395 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@395..396 "T" [] [], }, @@ -631,57 +553,49 @@ JsModule { implements_clause: missing (optional), l_curly_token: L_CURLY@414..416 "{" [] [Whitespace(" ")], members: JsClassMemberList [ - JsBogusMember { - items: [ - JsMethodModifierList [], - JsLiteralMemberName { - value: IDENT@416..419 "foo" [] [], - }, - JsBogus { - items: [ - L_ANGLE@419..420 "<" [] [], - JsBogus { - items: [ - TsBogusType { - items: [ - IN_KW@420..423 "in" [] [Whitespace(" ")], - ], - }, - TsTypeParameter { - in_modifier_token: missing (optional), - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@423..424 "T" [] [], - }, - constraint: missing (optional), - default: missing (optional), - }, - ], - }, - R_ANGLE@424..425 ">" [] [], - ], - }, - JsParameters { - l_paren_token: L_PAREN@425..426 "(" [] [], - items: JsParameterList [], - r_paren_token: R_PAREN@426..427 ")" [] [], - }, - TsReturnTypeAnnotation { - colon_token: COLON@427..429 ":" [] [Whitespace(" ")], - ty: TsReferenceType { - name: JsReferenceIdentifier { - value_token: IDENT@429..431 "T" [] [Whitespace(" ")], + JsMethodClassMember { + modifiers: JsMethodModifierList [], + async_token: missing (optional), + star_token: missing (optional), + name: JsLiteralMemberName { + value: IDENT@416..419 "foo" [] [], + }, + question_mark_token: missing (optional), + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@419..420 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + in_modifier_token: IN_KW@420..423 "in" [] [Whitespace(" ")], + out_modifier_token: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@423..424 "T" [] [], }, - type_arguments: missing (optional), + constraint: missing (optional), + default: missing (optional), }, + ], + r_angle_token: R_ANGLE@424..425 ">" [] [], + }, + parameters: JsParameters { + l_paren_token: L_PAREN@425..426 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@426..427 ")" [] [], + }, + return_type_annotation: TsReturnTypeAnnotation { + colon_token: COLON@427..429 ":" [] [Whitespace(" ")], + ty: TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@429..431 "T" [] [Whitespace(" ")], + }, + type_arguments: missing (optional), }, - JsFunctionBody { - l_curly_token: L_CURLY@431..432 "{" [] [], - directives: JsDirectiveList [], - statements: JsStatementList [], - r_curly_token: R_CURLY@432..434 "}" [] [Whitespace(" ")], - }, - ], + }, + body: JsFunctionBody { + l_curly_token: L_CURLY@431..432 "{" [] [], + directives: JsDirectiveList [], + statements: JsStatementList [], + r_curly_token: R_CURLY@432..434 "}" [] [Whitespace(" ")], + }, }, ], r_curly_token: R_CURLY@434..435 "}" [] [], @@ -710,17 +624,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@453..457 "out" [] [Whitespace(" ")], - }, - constraint: missing (optional), - default: missing (optional), - }, - missing separator, - TsTypeParameter { - in_modifier_token: missing (optional), - out_modifier_token: missing (optional), + out_modifier_token: OUT_KW@453..457 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@457..458 "T" [] [], }, @@ -763,56 +667,47 @@ JsModule { right: JsObjectExpression { l_curly_token: L_CURLY@477..479 "{" [] [Whitespace(" ")], members: JsObjectMemberList [ - JsBogusMember { - items: [ - JsLiteralMemberName { - value: IDENT@479..482 "foo" [] [], - }, - JsBogus { - items: [ - L_ANGLE@482..483 "<" [] [], - JsBogus { - items: [ - TsBogusType { - items: [ - IN_KW@483..486 "in" [] [Whitespace(" ")], - ], - }, - TsTypeParameter { - in_modifier_token: missing (optional), - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@486..487 "T" [] [], - }, - constraint: missing (optional), - default: missing (optional), - }, - ], - }, - R_ANGLE@487..488 ">" [] [], - ], - }, - JsParameters { - l_paren_token: L_PAREN@488..489 "(" [] [], - items: JsParameterList [], - r_paren_token: R_PAREN@489..490 ")" [] [], - }, - TsReturnTypeAnnotation { - colon_token: COLON@490..492 ":" [] [Whitespace(" ")], - ty: TsReferenceType { - name: JsReferenceIdentifier { - value_token: IDENT@492..494 "T" [] [Whitespace(" ")], + JsMethodObjectMember { + async_token: missing (optional), + star_token: missing (optional), + name: JsLiteralMemberName { + value: IDENT@479..482 "foo" [] [], + }, + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@482..483 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + in_modifier_token: IN_KW@483..486 "in" [] [Whitespace(" ")], + out_modifier_token: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@486..487 "T" [] [], }, - type_arguments: missing (optional), + constraint: missing (optional), + default: missing (optional), }, + ], + r_angle_token: R_ANGLE@487..488 ">" [] [], + }, + parameters: JsParameters { + l_paren_token: L_PAREN@488..489 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@489..490 ")" [] [], + }, + return_type_annotation: TsReturnTypeAnnotation { + colon_token: COLON@490..492 ":" [] [Whitespace(" ")], + ty: TsReferenceType { + name: JsReferenceIdentifier { + value_token: IDENT@492..494 "T" [] [Whitespace(" ")], + }, + type_arguments: missing (optional), }, - JsFunctionBody { - l_curly_token: L_CURLY@494..495 "{" [] [], - directives: JsDirectiveList [], - statements: JsStatementList [], - r_curly_token: R_CURLY@495..497 "}" [] [Whitespace(" ")], - }, - ], + }, + body: JsFunctionBody { + l_curly_token: L_CURLY@494..495 "{" [] [], + directives: JsDirectiveList [], + statements: JsStatementList [], + r_curly_token: R_CURLY@495..497 "}" [] [Whitespace(" ")], + }, }, ], r_curly_token: R_CURLY@497..498 "}" [] [], @@ -840,17 +735,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@513..517 "out" [] [Whitespace(" ")], - }, - constraint: missing (optional), - default: missing (optional), - }, - missing separator, - TsTypeParameter { - in_modifier_token: missing (optional), - out_modifier_token: missing (optional), + out_modifier_token: OUT_KW@513..517 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@517..518 "T" [] [], }, @@ -934,17 +819,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@550..554 "out" [] [Whitespace(" ")], - }, - constraint: missing (optional), - default: missing (optional), - }, - missing separator, - TsTypeParameter { - in_modifier_token: missing (optional), - out_modifier_token: missing (optional), + out_modifier_token: OUT_KW@550..554 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@554..555 "T" [] [], }, @@ -1035,44 +910,33 @@ JsModule { }, variable_annotation: TsTypeAnnotation { colon_token: COLON@596..598 ":" [] [Whitespace(" ")], - ty: TsBogusType { - items: [ - JsBogus { - items: [ - L_ANGLE@598..599 "<" [] [], - JsBogus { - items: [ - TsBogusType { - items: [ - IN_KW@599..602 "in" [] [Whitespace(" ")], - ], - }, - TsTypeParameter { - in_modifier_token: missing (optional), - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@602..603 "T" [] [], - }, - constraint: missing (optional), - default: missing (optional), - }, - ], + ty: TsFunctionType { + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@598..599 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + in_modifier_token: IN_KW@599..602 "in" [] [Whitespace(" ")], + out_modifier_token: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@602..603 "T" [] [], }, - R_ANGLE@603..604 ">" [] [], - ], - }, - JsParameters { - l_paren_token: L_PAREN@604..605 "(" [] [], - items: JsParameterList [], - r_paren_token: R_PAREN@605..607 ")" [] [Whitespace(" ")], - }, - FAT_ARROW@607..610 "=>" [] [Whitespace(" ")], - TsObjectType { - l_curly_token: L_CURLY@610..611 "{" [] [], - members: TsTypeMemberList [], - r_curly_token: R_CURLY@611..612 "}" [] [], - }, - ], + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@603..604 ">" [] [], + }, + parameters: JsParameters { + l_paren_token: L_PAREN@604..605 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@605..607 ")" [] [Whitespace(" ")], + }, + fat_arrow_token: FAT_ARROW@607..610 "=>" [] [Whitespace(" ")], + return_type: TsObjectType { + l_curly_token: L_CURLY@610..611 "{" [] [], + members: TsTypeMemberList [], + r_curly_token: R_CURLY@611..612 "}" [] [], + }, }, }, initializer: missing (optional), @@ -1097,17 +961,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@623..627 "out" [] [Whitespace(" ")], - }, - constraint: missing (optional), - default: missing (optional), - }, - missing separator, - TsTypeParameter { - in_modifier_token: missing (optional), - out_modifier_token: missing (optional), + out_modifier_token: OUT_KW@623..627 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@627..628 "T" [] [], }, @@ -1146,63 +1000,43 @@ JsModule { }, variable_annotation: TsTypeAnnotation { colon_token: COLON@645..647 ":" [] [Whitespace(" ")], - ty: TsBogusType { - items: [ - JsBogus { - items: [ - L_ANGLE@647..648 "<" [] [], - JsBogus { - items: [ - TsBogusType { - items: [ - IN_KW@648..651 "in" [] [Whitespace(" ")], - ], - }, - TsTypeParameter { - in_modifier_token: missing (optional), - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@651..652 "T" [] [], - }, - constraint: missing (optional), - default: missing (optional), - }, - COMMA@652..654 "," [] [Whitespace(" ")], - TsTypeParameter { - in_modifier_token: missing (optional), - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@654..658 "out" [] [Whitespace(" ")], - }, - constraint: missing (optional), - default: missing (optional), - }, - TsTypeParameter { - in_modifier_token: missing (optional), - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@658..659 "T" [] [], - }, - constraint: missing (optional), - default: missing (optional), - }, - ], + ty: TsFunctionType { + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@647..648 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + in_modifier_token: IN_KW@648..651 "in" [] [Whitespace(" ")], + out_modifier_token: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@651..652 "T" [] [], }, - R_ANGLE@659..660 ">" [] [], - ], - }, - JsParameters { - l_paren_token: L_PAREN@660..661 "(" [] [], - items: JsParameterList [], - r_paren_token: R_PAREN@661..663 ")" [] [Whitespace(" ")], - }, - FAT_ARROW@663..666 "=>" [] [Whitespace(" ")], - TsObjectType { - l_curly_token: L_CURLY@666..667 "{" [] [], - members: TsTypeMemberList [], - r_curly_token: R_CURLY@667..668 "}" [] [], - }, - ], + constraint: missing (optional), + default: missing (optional), + }, + COMMA@652..654 "," [] [Whitespace(" ")], + TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: OUT_KW@654..658 "out" [] [Whitespace(" ")], + name: TsTypeParameterName { + ident_token: IDENT@658..659 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@659..660 ">" [] [], + }, + parameters: JsParameters { + l_paren_token: L_PAREN@660..661 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@661..663 ")" [] [Whitespace(" ")], + }, + fat_arrow_token: FAT_ARROW@663..666 "=>" [] [Whitespace(" ")], + return_type: TsObjectType { + l_curly_token: L_CURLY@666..667 "{" [] [], + members: TsTypeMemberList [], + r_curly_token: R_CURLY@667..668 "}" [] [], + }, }, }, initializer: missing (optional), @@ -1221,45 +1055,35 @@ JsModule { }, variable_annotation: TsTypeAnnotation { colon_token: COLON@676..678 ":" [] [Whitespace(" ")], - ty: TsBogusType { - items: [ - NEW_KW@678..682 "new" [] [Whitespace(" ")], - JsBogus { - items: [ - L_ANGLE@682..683 "<" [] [], - JsBogus { - items: [ - TsBogusType { - items: [ - IN_KW@683..686 "in" [] [Whitespace(" ")], - ], - }, - TsTypeParameter { - in_modifier_token: missing (optional), - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@686..687 "T" [] [], - }, - constraint: missing (optional), - default: missing (optional), - }, - ], + ty: TsConstructorType { + abstract_token: missing (optional), + new_token: NEW_KW@678..682 "new" [] [Whitespace(" ")], + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@682..683 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + in_modifier_token: IN_KW@683..686 "in" [] [Whitespace(" ")], + out_modifier_token: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@686..687 "T" [] [], }, - R_ANGLE@687..688 ">" [] [], - ], - }, - JsParameters { - l_paren_token: L_PAREN@688..689 "(" [] [], - items: JsParameterList [], - r_paren_token: R_PAREN@689..691 ")" [] [Whitespace(" ")], - }, - FAT_ARROW@691..694 "=>" [] [Whitespace(" ")], - TsObjectType { - l_curly_token: L_CURLY@694..695 "{" [] [], - members: TsTypeMemberList [], - r_curly_token: R_CURLY@695..696 "}" [] [], - }, - ], + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@687..688 ">" [] [], + }, + parameters: JsParameters { + l_paren_token: L_PAREN@688..689 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@689..691 ")" [] [Whitespace(" ")], + }, + fat_arrow_token: FAT_ARROW@691..694 "=>" [] [Whitespace(" ")], + return_type: TsObjectType { + l_curly_token: L_CURLY@694..695 "{" [] [], + members: TsTypeMemberList [], + r_curly_token: R_CURLY@695..696 "}" [] [], + }, }, }, initializer: missing (optional), @@ -1286,17 +1110,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@711..715 "out" [] [Whitespace(" ")], - }, - constraint: missing (optional), - default: missing (optional), - }, - missing separator, - TsTypeParameter { - in_modifier_token: missing (optional), - out_modifier_token: missing (optional), + out_modifier_token: OUT_KW@711..715 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@715..716 "T" [] [], }, @@ -1335,64 +1149,45 @@ JsModule { }, variable_annotation: TsTypeAnnotation { colon_token: COLON@733..735 ":" [] [Whitespace(" ")], - ty: TsBogusType { - items: [ - NEW_KW@735..739 "new" [] [Whitespace(" ")], - JsBogus { - items: [ - L_ANGLE@739..740 "<" [] [], - JsBogus { - items: [ - TsBogusType { - items: [ - IN_KW@740..743 "in" [] [Whitespace(" ")], - ], - }, - TsTypeParameter { - in_modifier_token: missing (optional), - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@743..744 "T" [] [], - }, - constraint: missing (optional), - default: missing (optional), - }, - COMMA@744..746 "," [] [Whitespace(" ")], - TsTypeParameter { - in_modifier_token: missing (optional), - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@746..750 "out" [] [Whitespace(" ")], - }, - constraint: missing (optional), - default: missing (optional), - }, - TsTypeParameter { - in_modifier_token: missing (optional), - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@750..751 "T" [] [], - }, - constraint: missing (optional), - default: missing (optional), - }, - ], + ty: TsConstructorType { + abstract_token: missing (optional), + new_token: NEW_KW@735..739 "new" [] [Whitespace(" ")], + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@739..740 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + in_modifier_token: IN_KW@740..743 "in" [] [Whitespace(" ")], + out_modifier_token: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@743..744 "T" [] [], }, - R_ANGLE@751..752 ">" [] [], - ], - }, - JsParameters { - l_paren_token: L_PAREN@752..753 "(" [] [], - items: JsParameterList [], - r_paren_token: R_PAREN@753..755 ")" [] [Whitespace(" ")], - }, - FAT_ARROW@755..758 "=>" [] [Whitespace(" ")], - TsObjectType { - l_curly_token: L_CURLY@758..759 "{" [] [], - members: TsTypeMemberList [], - r_curly_token: R_CURLY@759..760 "}" [] [], - }, - ], + constraint: missing (optional), + default: missing (optional), + }, + COMMA@744..746 "," [] [Whitespace(" ")], + TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: OUT_KW@746..750 "out" [] [Whitespace(" ")], + name: TsTypeParameterName { + ident_token: IDENT@750..751 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@751..752 ">" [] [], + }, + parameters: JsParameters { + l_paren_token: L_PAREN@752..753 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@753..755 ")" [] [Whitespace(" ")], + }, + fat_arrow_token: FAT_ARROW@755..758 "=>" [] [Whitespace(" ")], + return_type: TsObjectType { + l_curly_token: L_CURLY@758..759 "{" [] [], + members: TsTypeMemberList [], + r_curly_token: R_CURLY@759..760 "}" [] [], + }, }, }, initializer: missing (optional), @@ -1411,57 +1206,44 @@ JsModule { }, variable_annotation: TsTypeAnnotation { colon_token: COLON@768..770 ":" [] [Whitespace(" ")], - ty: TsBogusType { - items: [ - L_CURLY@770..772 "{" [] [Whitespace(" ")], - JsBogus { - items: [ - JsBogus { - items: [ - JsLiteralMemberName { - value: IDENT@772..773 "y" [] [], - }, - JsBogus { - items: [ - L_ANGLE@773..774 "<" [] [], - JsBogus { - items: [ - TsBogusType { - items: [ - IN_KW@774..777 "in" [] [Whitespace(" ")], - ], - }, - TsTypeParameter { - in_modifier_token: missing (optional), - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@777..778 "T" [] [], - }, - constraint: missing (optional), - default: missing (optional), - }, - ], - }, - R_ANGLE@778..779 ">" [] [], - ], - }, - JsParameters { - l_paren_token: L_PAREN@779..780 "(" [] [], - items: JsParameterList [], - r_paren_token: R_PAREN@780..781 ")" [] [], - }, - TsReturnTypeAnnotation { - colon_token: COLON@781..783 ":" [] [Whitespace(" ")], - ty: TsAnyType { - any_token: ANY_KW@783..787 "any" [] [Whitespace(" ")], - }, + ty: TsObjectType { + l_curly_token: L_CURLY@770..772 "{" [] [Whitespace(" ")], + members: TsTypeMemberList [ + TsMethodSignatureTypeMember { + name: JsLiteralMemberName { + value: IDENT@772..773 "y" [] [], + }, + optional_token: missing (optional), + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@773..774 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + in_modifier_token: IN_KW@774..777 "in" [] [Whitespace(" ")], + out_modifier_token: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@777..778 "T" [] [], }, - ], + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@778..779 ">" [] [], + }, + parameters: JsParameters { + l_paren_token: L_PAREN@779..780 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@780..781 ")" [] [], + }, + return_type_annotation: TsReturnTypeAnnotation { + colon_token: COLON@781..783 ":" [] [Whitespace(" ")], + ty: TsAnyType { + any_token: ANY_KW@783..787 "any" [] [Whitespace(" ")], }, - ], + }, + separator_token: missing (optional), }, - R_CURLY@787..788 "}" [] [], ], + r_curly_token: R_CURLY@787..788 "}" [] [], }, }, initializer: missing (optional), @@ -1493,17 +1275,7 @@ JsModule { items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@802..806 "out" [] [Whitespace(" ")], - }, - constraint: missing (optional), - default: missing (optional), - }, - missing separator, - TsTypeParameter { - in_modifier_token: missing (optional), - out_modifier_token: missing (optional), + out_modifier_token: OUT_KW@802..806 "out" [] [Whitespace(" ")], name: TsTypeParameterName { ident_token: IDENT@806..807 "T" [] [], }, @@ -1546,79 +1318,57 @@ JsModule { }, variable_annotation: TsTypeAnnotation { colon_token: COLON@825..827 ":" [] [Whitespace(" ")], - ty: TsBogusType { - items: [ - L_CURLY@827..829 "{" [] [Whitespace(" ")], - JsBogus { - items: [ - JsBogus { - items: [ - JsLiteralMemberName { - value: IDENT@829..830 "y" [] [], - }, - JsBogus { - items: [ - L_ANGLE@830..831 "<" [] [], - JsBogus { - items: [ - TsBogusType { - items: [ - IN_KW@831..834 "in" [] [Whitespace(" ")], - ], - }, - TsTypeParameter { - in_modifier_token: missing (optional), - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@834..835 "T" [] [], - }, - constraint: missing (optional), - default: missing (optional), - }, - COMMA@835..837 "," [] [Whitespace(" ")], - TsTypeParameter { - in_modifier_token: missing (optional), - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@837..841 "out" [] [Whitespace(" ")], - }, - constraint: missing (optional), - default: missing (optional), - }, - TsTypeParameter { - in_modifier_token: missing (optional), - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@841..842 "T" [] [], - }, - constraint: missing (optional), - default: missing (optional), - }, - ], - }, - R_ANGLE@842..843 ">" [] [], - ], - }, - JsParameters { - l_paren_token: L_PAREN@843..844 "(" [] [], - items: JsParameterList [], - r_paren_token: R_PAREN@844..845 ")" [] [], + ty: TsObjectType { + l_curly_token: L_CURLY@827..829 "{" [] [Whitespace(" ")], + members: TsTypeMemberList [ + TsMethodSignatureTypeMember { + name: JsLiteralMemberName { + value: IDENT@829..830 "y" [] [], + }, + optional_token: missing (optional), + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@830..831 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + in_modifier_token: IN_KW@831..834 "in" [] [Whitespace(" ")], + out_modifier_token: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@834..835 "T" [] [], }, - TsReturnTypeAnnotation { - colon_token: COLON@845..847 ":" [] [Whitespace(" ")], - ty: TsAnyType { - any_token: ANY_KW@847..851 "any" [] [Whitespace(" ")], - }, + constraint: missing (optional), + default: missing (optional), + }, + COMMA@835..837 "," [] [Whitespace(" ")], + TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: OUT_KW@837..841 "out" [] [Whitespace(" ")], + name: TsTypeParameterName { + ident_token: IDENT@841..842 "T" [] [], }, - ], - }, - ], - }, - R_CURLY@851..852 "}" [] [], - ], - }, - }, - initializer: missing (optional), + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@842..843 ">" [] [], + }, + parameters: JsParameters { + l_paren_token: L_PAREN@843..844 "(" [] [], + items: JsParameterList [], + r_paren_token: R_PAREN@844..845 ")" [] [], + }, + return_type_annotation: TsReturnTypeAnnotation { + colon_token: COLON@845..847 ":" [] [Whitespace(" ")], + ty: TsAnyType { + any_token: ANY_KW@847..851 "any" [] [Whitespace(" ")], + }, + }, + separator_token: missing (optional), + }, + ], + r_curly_token: R_CURLY@851..852 "}" [] [], + }, + }, + initializer: missing (optional), }, ], }, @@ -1632,36 +1382,38 @@ JsModule { 0: (empty) 1: JS_DIRECTIVE_LIST@0..0 2: JS_MODULE_ITEM_LIST@0..853 - 0: JS_BOGUS_STATEMENT@0..39 + 0: JS_EXPORT@0..39 0: EXPORT_KW@0..8 "export" [Whitespace("\t")] [Whitespace(" ")] - 1: JS_BOGUS@8..39 + 1: JS_EXPORT_DEFAULT_DECLARATION_CLAUSE@8..39 0: DEFAULT_KW@8..16 "default" [] [Whitespace(" ")] - 1: JS_BOGUS@16..39 - 0: FUNCTION_KW@16..25 "function" [] [Whitespace(" ")] - 1: JS_IDENTIFIER_BINDING@25..28 + 1: JS_FUNCTION_EXPORT_DEFAULT_DECLARATION@16..39 + 0: (empty) + 1: FUNCTION_KW@16..25 "function" [] [Whitespace(" ")] + 2: (empty) + 3: JS_IDENTIFIER_BINDING@25..28 0: IDENT@25..28 "foo" [] [] - 2: JS_BOGUS@28..34 + 4: TS_TYPE_PARAMETERS@28..34 0: L_ANGLE@28..29 "<" [] [] - 1: JS_BOGUS@29..33 - 0: TS_BOGUS_TYPE@29..32 + 1: TS_TYPE_PARAMETER_LIST@29..33 + 0: TS_TYPE_PARAMETER@29..33 0: IN_KW@29..32 "in" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER@32..33 - 0: (empty) 1: (empty) 2: TS_TYPE_PARAMETER_NAME@32..33 0: IDENT@32..33 "T" [] [] 3: (empty) 4: (empty) 2: R_ANGLE@33..34 ">" [] [] - 3: JS_PARAMETERS@34..37 + 5: JS_PARAMETERS@34..37 0: L_PAREN@34..35 "(" [] [] 1: JS_PARAMETER_LIST@35..35 2: R_PAREN@35..37 ")" [] [Whitespace(" ")] - 4: JS_FUNCTION_BODY@37..39 + 6: (empty) + 7: JS_FUNCTION_BODY@37..39 0: L_CURLY@37..38 "{" [] [] 1: JS_DIRECTIVE_LIST@38..38 2: JS_STATEMENT_LIST@38..38 3: R_CURLY@38..39 "}" [] [] + 2: (empty) 1: JS_EXPORT@39..72 0: EXPORT_KW@39..48 "export" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] 1: JS_FUNCTION_DECLARATION@48..72 @@ -1673,17 +1425,9 @@ JsModule { 4: TS_TYPE_PARAMETERS@60..67 0: L_ANGLE@60..61 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@61..66 - 0: TS_TYPE_PARAMETER@61..65 + 0: TS_TYPE_PARAMETER@61..66 0: (empty) - 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@61..65 - 0: IDENT@61..65 "out" [] [Whitespace(" ")] - 3: (empty) - 4: (empty) - 1: (empty) - 2: TS_TYPE_PARAMETER@65..66 - 0: (empty) - 1: (empty) + 1: OUT_KW@61..65 "out" [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER_NAME@65..66 0: IDENT@65..66 "T" [] [] 3: (empty) @@ -1699,30 +1443,31 @@ JsModule { 1: JS_DIRECTIVE_LIST@71..71 2: JS_STATEMENT_LIST@71..71 3: R_CURLY@71..72 "}" [] [] - 2: JS_BOGUS_STATEMENT@72..105 + 2: JS_EXPORT@72..105 0: EXPORT_KW@72..81 "export" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: JS_BOGUS_STATEMENT@81..105 - 0: FUNCTION_KW@81..90 "function" [] [Whitespace(" ")] - 1: JS_IDENTIFIER_BINDING@90..94 + 1: JS_FUNCTION_DECLARATION@81..105 + 0: (empty) + 1: FUNCTION_KW@81..90 "function" [] [Whitespace(" ")] + 2: (empty) + 3: JS_IDENTIFIER_BINDING@90..94 0: IDENT@90..94 "foo1" [] [] - 2: JS_BOGUS@94..100 + 4: TS_TYPE_PARAMETERS@94..100 0: L_ANGLE@94..95 "<" [] [] - 1: JS_BOGUS@95..99 - 0: TS_BOGUS_TYPE@95..98 + 1: TS_TYPE_PARAMETER_LIST@95..99 + 0: TS_TYPE_PARAMETER@95..99 0: IN_KW@95..98 "in" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER@98..99 - 0: (empty) 1: (empty) 2: TS_TYPE_PARAMETER_NAME@98..99 0: IDENT@98..99 "T" [] [] 3: (empty) 4: (empty) 2: R_ANGLE@99..100 ">" [] [] - 3: JS_PARAMETERS@100..103 + 5: JS_PARAMETERS@100..103 0: L_PAREN@100..101 "(" [] [] 1: JS_PARAMETER_LIST@101..101 2: R_PAREN@101..103 ")" [] [Whitespace(" ")] - 4: JS_FUNCTION_BODY@103..105 + 6: (empty) + 7: JS_FUNCTION_BODY@103..105 0: L_CURLY@103..104 "{" [] [] 1: JS_DIRECTIVE_LIST@104..104 2: JS_STATEMENT_LIST@104..104 @@ -1738,17 +1483,9 @@ JsModule { 4: TS_TYPE_PARAMETERS@127..134 0: L_ANGLE@127..128 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@128..133 - 0: TS_TYPE_PARAMETER@128..132 + 0: TS_TYPE_PARAMETER@128..133 0: (empty) - 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@128..132 - 0: IDENT@128..132 "out" [] [Whitespace(" ")] - 3: (empty) - 4: (empty) - 1: (empty) - 2: TS_TYPE_PARAMETER@132..133 - 0: (empty) - 1: (empty) + 1: OUT_KW@128..132 "out" [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER_NAME@132..133 0: IDENT@132..133 "T" [] [] 3: (empty) @@ -1818,29 +1555,30 @@ JsModule { 2: R_ANGLE@179..180 ">" [] [] 2: (empty) 1: (empty) - 6: JS_BOGUS_STATEMENT@180..210 + 6: TS_DECLARE_STATEMENT@180..210 0: DECLARE_KW@180..190 "declare" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: JS_BOGUS_STATEMENT@190..210 - 0: FUNCTION_KW@190..199 "function" [] [Whitespace(" ")] - 1: JS_IDENTIFIER_BINDING@199..202 + 1: TS_DECLARE_FUNCTION_DECLARATION@190..210 + 0: (empty) + 1: FUNCTION_KW@190..199 "function" [] [Whitespace(" ")] + 2: JS_IDENTIFIER_BINDING@199..202 0: IDENT@199..202 "foo" [] [] - 2: JS_BOGUS@202..208 + 3: TS_TYPE_PARAMETERS@202..208 0: L_ANGLE@202..203 "<" [] [] - 1: JS_BOGUS@203..207 - 0: TS_BOGUS_TYPE@203..206 + 1: TS_TYPE_PARAMETER_LIST@203..207 + 0: TS_TYPE_PARAMETER@203..207 0: IN_KW@203..206 "in" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER@206..207 - 0: (empty) 1: (empty) 2: TS_TYPE_PARAMETER_NAME@206..207 0: IDENT@206..207 "T" [] [] 3: (empty) 4: (empty) 2: R_ANGLE@207..208 ">" [] [] - 3: JS_PARAMETERS@208..210 + 4: JS_PARAMETERS@208..210 0: L_PAREN@208..209 "(" [] [] 1: JS_PARAMETER_LIST@209..209 2: R_PAREN@209..210 ")" [] [] + 5: (empty) + 6: (empty) 7: TS_DECLARE_STATEMENT@210..241 0: DECLARE_KW@210..220 "declare" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] 1: TS_DECLARE_FUNCTION_DECLARATION@220..241 @@ -1851,17 +1589,9 @@ JsModule { 3: TS_TYPE_PARAMETERS@232..239 0: L_ANGLE@232..233 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@233..238 - 0: TS_TYPE_PARAMETER@233..237 - 0: (empty) - 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@233..237 - 0: IDENT@233..237 "out" [] [Whitespace(" ")] - 3: (empty) - 4: (empty) - 1: (empty) - 2: TS_TYPE_PARAMETER@237..238 + 0: TS_TYPE_PARAMETER@233..238 0: (empty) - 1: (empty) + 1: OUT_KW@233..237 "out" [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER_NAME@237..238 0: IDENT@237..238 "T" [] [] 3: (empty) @@ -1986,26 +1716,28 @@ JsModule { 0: JS_IDENTIFIER_ASSIGNMENT@345..351 0: IDENT@345..351 "foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] 1: EQ@351..353 "=" [] [Whitespace(" ")] - 2: JS_BOGUS_EXPRESSION@353..373 - 0: FUNCTION_KW@353..362 "function" [] [Whitespace(" ")] - 1: JS_BOGUS@362..368 + 2: JS_FUNCTION_EXPRESSION@353..373 + 0: (empty) + 1: FUNCTION_KW@353..362 "function" [] [Whitespace(" ")] + 2: (empty) + 3: (empty) + 4: TS_TYPE_PARAMETERS@362..368 0: L_ANGLE@362..363 "<" [] [] - 1: JS_BOGUS@363..367 - 0: TS_BOGUS_TYPE@363..366 + 1: TS_TYPE_PARAMETER_LIST@363..367 + 0: TS_TYPE_PARAMETER@363..367 0: IN_KW@363..366 "in" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER@366..367 - 0: (empty) 1: (empty) 2: TS_TYPE_PARAMETER_NAME@366..367 0: IDENT@366..367 "T" [] [] 3: (empty) 4: (empty) 2: R_ANGLE@367..368 ">" [] [] - 2: JS_PARAMETERS@368..371 + 5: JS_PARAMETERS@368..371 0: L_PAREN@368..369 "(" [] [] 1: JS_PARAMETER_LIST@369..369 2: R_PAREN@369..371 ")" [] [Whitespace(" ")] - 3: JS_FUNCTION_BODY@371..373 + 6: (empty) + 7: JS_FUNCTION_BODY@371..373 0: L_CURLY@371..372 "{" [] [] 1: JS_DIRECTIVE_LIST@372..372 2: JS_STATEMENT_LIST@372..372 @@ -2024,17 +1756,9 @@ JsModule { 4: TS_TYPE_PARAMETERS@390..397 0: L_ANGLE@390..391 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@391..396 - 0: TS_TYPE_PARAMETER@391..395 + 0: TS_TYPE_PARAMETER@391..396 0: (empty) - 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@391..395 - 0: IDENT@391..395 "out" [] [Whitespace(" ")] - 3: (empty) - 4: (empty) - 1: (empty) - 2: TS_TYPE_PARAMETER@395..396 - 0: (empty) - 1: (empty) + 1: OUT_KW@391..395 "out" [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER_NAME@395..396 0: IDENT@395..396 "T" [] [] 3: (empty) @@ -2061,34 +1785,35 @@ JsModule { 5: (empty) 6: L_CURLY@414..416 "{" [] [Whitespace(" ")] 7: JS_CLASS_MEMBER_LIST@416..434 - 0: JS_BOGUS_MEMBER@416..434 + 0: JS_METHOD_CLASS_MEMBER@416..434 0: JS_METHOD_MODIFIER_LIST@416..416 - 1: JS_LITERAL_MEMBER_NAME@416..419 + 1: (empty) + 2: (empty) + 3: JS_LITERAL_MEMBER_NAME@416..419 0: IDENT@416..419 "foo" [] [] - 2: JS_BOGUS@419..425 + 4: (empty) + 5: TS_TYPE_PARAMETERS@419..425 0: L_ANGLE@419..420 "<" [] [] - 1: JS_BOGUS@420..424 - 0: TS_BOGUS_TYPE@420..423 + 1: TS_TYPE_PARAMETER_LIST@420..424 + 0: TS_TYPE_PARAMETER@420..424 0: IN_KW@420..423 "in" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER@423..424 - 0: (empty) 1: (empty) 2: TS_TYPE_PARAMETER_NAME@423..424 0: IDENT@423..424 "T" [] [] 3: (empty) 4: (empty) 2: R_ANGLE@424..425 ">" [] [] - 3: JS_PARAMETERS@425..427 + 6: JS_PARAMETERS@425..427 0: L_PAREN@425..426 "(" [] [] 1: JS_PARAMETER_LIST@426..426 2: R_PAREN@426..427 ")" [] [] - 4: TS_RETURN_TYPE_ANNOTATION@427..431 + 7: TS_RETURN_TYPE_ANNOTATION@427..431 0: COLON@427..429 ":" [] [Whitespace(" ")] 1: TS_REFERENCE_TYPE@429..431 0: JS_REFERENCE_IDENTIFIER@429..431 0: IDENT@429..431 "T" [] [Whitespace(" ")] 1: (empty) - 5: JS_FUNCTION_BODY@431..434 + 8: JS_FUNCTION_BODY@431..434 0: L_CURLY@431..432 "{" [] [] 1: JS_DIRECTIVE_LIST@432..432 2: JS_STATEMENT_LIST@432..432 @@ -2114,17 +1839,9 @@ JsModule { 5: TS_TYPE_PARAMETERS@452..459 0: L_ANGLE@452..453 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@453..458 - 0: TS_TYPE_PARAMETER@453..457 + 0: TS_TYPE_PARAMETER@453..458 0: (empty) - 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@453..457 - 0: IDENT@453..457 "out" [] [Whitespace(" ")] - 3: (empty) - 4: (empty) - 1: (empty) - 2: TS_TYPE_PARAMETER@457..458 - 0: (empty) - 1: (empty) + 1: OUT_KW@453..457 "out" [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER_NAME@457..458 0: IDENT@457..458 "T" [] [] 3: (empty) @@ -2154,33 +1871,33 @@ JsModule { 2: JS_OBJECT_EXPRESSION@477..498 0: L_CURLY@477..479 "{" [] [Whitespace(" ")] 1: JS_OBJECT_MEMBER_LIST@479..497 - 0: JS_BOGUS_MEMBER@479..497 - 0: JS_LITERAL_MEMBER_NAME@479..482 + 0: JS_METHOD_OBJECT_MEMBER@479..497 + 0: (empty) + 1: (empty) + 2: JS_LITERAL_MEMBER_NAME@479..482 0: IDENT@479..482 "foo" [] [] - 1: JS_BOGUS@482..488 + 3: TS_TYPE_PARAMETERS@482..488 0: L_ANGLE@482..483 "<" [] [] - 1: JS_BOGUS@483..487 - 0: TS_BOGUS_TYPE@483..486 + 1: TS_TYPE_PARAMETER_LIST@483..487 + 0: TS_TYPE_PARAMETER@483..487 0: IN_KW@483..486 "in" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER@486..487 - 0: (empty) 1: (empty) 2: TS_TYPE_PARAMETER_NAME@486..487 0: IDENT@486..487 "T" [] [] 3: (empty) 4: (empty) 2: R_ANGLE@487..488 ">" [] [] - 2: JS_PARAMETERS@488..490 + 4: JS_PARAMETERS@488..490 0: L_PAREN@488..489 "(" [] [] 1: JS_PARAMETER_LIST@489..489 2: R_PAREN@489..490 ")" [] [] - 3: TS_RETURN_TYPE_ANNOTATION@490..494 + 5: TS_RETURN_TYPE_ANNOTATION@490..494 0: COLON@490..492 ":" [] [Whitespace(" ")] 1: TS_REFERENCE_TYPE@492..494 0: JS_REFERENCE_IDENTIFIER@492..494 0: IDENT@492..494 "T" [] [Whitespace(" ")] 1: (empty) - 4: JS_FUNCTION_BODY@494..497 + 6: JS_FUNCTION_BODY@494..497 0: L_CURLY@494..495 "{" [] [] 1: JS_DIRECTIVE_LIST@495..495 2: JS_STATEMENT_LIST@495..495 @@ -2203,17 +1920,9 @@ JsModule { 3: TS_TYPE_PARAMETERS@512..519 0: L_ANGLE@512..513 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@513..518 - 0: TS_TYPE_PARAMETER@513..517 + 0: TS_TYPE_PARAMETER@513..518 0: (empty) - 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@513..517 - 0: IDENT@513..517 "out" [] [Whitespace(" ")] - 3: (empty) - 4: (empty) - 1: (empty) - 2: TS_TYPE_PARAMETER@517..518 - 0: (empty) - 1: (empty) + 1: OUT_KW@513..517 "out" [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER_NAME@517..518 0: IDENT@517..518 "T" [] [] 3: (empty) @@ -2268,17 +1977,9 @@ JsModule { 1: TS_TYPE_PARAMETERS@547..556 0: L_ANGLE@547..550 "<" [Newline("\n"), Whitespace("\t")] [] 1: TS_TYPE_PARAMETER_LIST@550..555 - 0: TS_TYPE_PARAMETER@550..554 - 0: (empty) - 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@550..554 - 0: IDENT@550..554 "out" [] [Whitespace(" ")] - 3: (empty) - 4: (empty) - 1: (empty) - 2: TS_TYPE_PARAMETER@554..555 + 0: TS_TYPE_PARAMETER@550..555 0: (empty) - 1: (empty) + 1: OUT_KW@550..554 "out" [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER_NAME@554..555 0: IDENT@554..555 "T" [] [] 3: (empty) @@ -2341,14 +2042,12 @@ JsModule { 0: IDENT@595..596 "x" [] [] 1: TS_TYPE_ANNOTATION@596..612 0: COLON@596..598 ":" [] [Whitespace(" ")] - 1: TS_BOGUS_TYPE@598..612 - 0: JS_BOGUS@598..604 + 1: TS_FUNCTION_TYPE@598..612 + 0: TS_TYPE_PARAMETERS@598..604 0: L_ANGLE@598..599 "<" [] [] - 1: JS_BOGUS@599..603 - 0: TS_BOGUS_TYPE@599..602 + 1: TS_TYPE_PARAMETER_LIST@599..603 + 0: TS_TYPE_PARAMETER@599..603 0: IN_KW@599..602 "in" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER@602..603 - 0: (empty) 1: (empty) 2: TS_TYPE_PARAMETER_NAME@602..603 0: IDENT@602..603 "T" [] [] @@ -2379,17 +2078,9 @@ JsModule { 0: TS_TYPE_PARAMETERS@622..629 0: L_ANGLE@622..623 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@623..628 - 0: TS_TYPE_PARAMETER@623..627 + 0: TS_TYPE_PARAMETER@623..628 0: (empty) - 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@623..627 - 0: IDENT@623..627 "out" [] [Whitespace(" ")] - 3: (empty) - 4: (empty) - 1: (empty) - 2: TS_TYPE_PARAMETER@627..628 - 0: (empty) - 1: (empty) + 1: OUT_KW@623..627 "out" [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER_NAME@627..628 0: IDENT@627..628 "T" [] [] 3: (empty) @@ -2415,30 +2106,21 @@ JsModule { 0: IDENT@644..645 "x" [] [] 1: TS_TYPE_ANNOTATION@645..668 0: COLON@645..647 ":" [] [Whitespace(" ")] - 1: TS_BOGUS_TYPE@647..668 - 0: JS_BOGUS@647..660 + 1: TS_FUNCTION_TYPE@647..668 + 0: TS_TYPE_PARAMETERS@647..660 0: L_ANGLE@647..648 "<" [] [] - 1: JS_BOGUS@648..659 - 0: TS_BOGUS_TYPE@648..651 + 1: TS_TYPE_PARAMETER_LIST@648..659 + 0: TS_TYPE_PARAMETER@648..652 0: IN_KW@648..651 "in" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER@651..652 - 0: (empty) 1: (empty) 2: TS_TYPE_PARAMETER_NAME@651..652 0: IDENT@651..652 "T" [] [] 3: (empty) 4: (empty) - 2: COMMA@652..654 "," [] [Whitespace(" ")] - 3: TS_TYPE_PARAMETER@654..658 - 0: (empty) - 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@654..658 - 0: IDENT@654..658 "out" [] [Whitespace(" ")] - 3: (empty) - 4: (empty) - 4: TS_TYPE_PARAMETER@658..659 + 1: COMMA@652..654 "," [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER@654..659 0: (empty) - 1: (empty) + 1: OUT_KW@654..658 "out" [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER_NAME@658..659 0: IDENT@658..659 "T" [] [] 3: (empty) @@ -2464,27 +2146,26 @@ JsModule { 0: IDENT@675..676 "x" [] [] 1: TS_TYPE_ANNOTATION@676..696 0: COLON@676..678 ":" [] [Whitespace(" ")] - 1: TS_BOGUS_TYPE@678..696 - 0: NEW_KW@678..682 "new" [] [Whitespace(" ")] - 1: JS_BOGUS@682..688 + 1: TS_CONSTRUCTOR_TYPE@678..696 + 0: (empty) + 1: NEW_KW@678..682 "new" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETERS@682..688 0: L_ANGLE@682..683 "<" [] [] - 1: JS_BOGUS@683..687 - 0: TS_BOGUS_TYPE@683..686 + 1: TS_TYPE_PARAMETER_LIST@683..687 + 0: TS_TYPE_PARAMETER@683..687 0: IN_KW@683..686 "in" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER@686..687 - 0: (empty) 1: (empty) 2: TS_TYPE_PARAMETER_NAME@686..687 0: IDENT@686..687 "T" [] [] 3: (empty) 4: (empty) 2: R_ANGLE@687..688 ">" [] [] - 2: JS_PARAMETERS@688..691 + 3: JS_PARAMETERS@688..691 0: L_PAREN@688..689 "(" [] [] 1: JS_PARAMETER_LIST@689..689 2: R_PAREN@689..691 ")" [] [Whitespace(" ")] - 3: FAT_ARROW@691..694 "=>" [] [Whitespace(" ")] - 4: TS_OBJECT_TYPE@694..696 + 4: FAT_ARROW@691..694 "=>" [] [Whitespace(" ")] + 5: TS_OBJECT_TYPE@694..696 0: L_CURLY@694..695 "{" [] [] 1: TS_TYPE_MEMBER_LIST@695..695 2: R_CURLY@695..696 "}" [] [] @@ -2505,17 +2186,9 @@ JsModule { 2: TS_TYPE_PARAMETERS@710..717 0: L_ANGLE@710..711 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@711..716 - 0: TS_TYPE_PARAMETER@711..715 - 0: (empty) - 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@711..715 - 0: IDENT@711..715 "out" [] [Whitespace(" ")] - 3: (empty) - 4: (empty) - 1: (empty) - 2: TS_TYPE_PARAMETER@715..716 + 0: TS_TYPE_PARAMETER@711..716 0: (empty) - 1: (empty) + 1: OUT_KW@711..715 "out" [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER_NAME@715..716 0: IDENT@715..716 "T" [] [] 3: (empty) @@ -2541,42 +2214,34 @@ JsModule { 0: IDENT@732..733 "x" [] [] 1: TS_TYPE_ANNOTATION@733..760 0: COLON@733..735 ":" [] [Whitespace(" ")] - 1: TS_BOGUS_TYPE@735..760 - 0: NEW_KW@735..739 "new" [] [Whitespace(" ")] - 1: JS_BOGUS@739..752 + 1: TS_CONSTRUCTOR_TYPE@735..760 + 0: (empty) + 1: NEW_KW@735..739 "new" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETERS@739..752 0: L_ANGLE@739..740 "<" [] [] - 1: JS_BOGUS@740..751 - 0: TS_BOGUS_TYPE@740..743 + 1: TS_TYPE_PARAMETER_LIST@740..751 + 0: TS_TYPE_PARAMETER@740..744 0: IN_KW@740..743 "in" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER@743..744 - 0: (empty) 1: (empty) 2: TS_TYPE_PARAMETER_NAME@743..744 0: IDENT@743..744 "T" [] [] 3: (empty) 4: (empty) - 2: COMMA@744..746 "," [] [Whitespace(" ")] - 3: TS_TYPE_PARAMETER@746..750 + 1: COMMA@744..746 "," [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER@746..751 0: (empty) - 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@746..750 - 0: IDENT@746..750 "out" [] [Whitespace(" ")] - 3: (empty) - 4: (empty) - 4: TS_TYPE_PARAMETER@750..751 - 0: (empty) - 1: (empty) + 1: OUT_KW@746..750 "out" [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER_NAME@750..751 0: IDENT@750..751 "T" [] [] 3: (empty) 4: (empty) 2: R_ANGLE@751..752 ">" [] [] - 2: JS_PARAMETERS@752..755 + 3: JS_PARAMETERS@752..755 0: L_PAREN@752..753 "(" [] [] 1: JS_PARAMETER_LIST@753..753 2: R_PAREN@753..755 ")" [] [Whitespace(" ")] - 3: FAT_ARROW@755..758 "=>" [] [Whitespace(" ")] - 4: TS_OBJECT_TYPE@758..760 + 4: FAT_ARROW@755..758 "=>" [] [Whitespace(" ")] + 5: TS_OBJECT_TYPE@758..760 0: L_CURLY@758..759 "{" [] [] 1: TS_TYPE_MEMBER_LIST@759..759 2: R_CURLY@759..760 "}" [] [] @@ -2591,33 +2256,33 @@ JsModule { 0: IDENT@767..768 "x" [] [] 1: TS_TYPE_ANNOTATION@768..788 0: COLON@768..770 ":" [] [Whitespace(" ")] - 1: TS_BOGUS_TYPE@770..788 + 1: TS_OBJECT_TYPE@770..788 0: L_CURLY@770..772 "{" [] [Whitespace(" ")] - 1: JS_BOGUS@772..787 - 0: JS_BOGUS@772..787 + 1: TS_TYPE_MEMBER_LIST@772..787 + 0: TS_METHOD_SIGNATURE_TYPE_MEMBER@772..787 0: JS_LITERAL_MEMBER_NAME@772..773 0: IDENT@772..773 "y" [] [] - 1: JS_BOGUS@773..779 + 1: (empty) + 2: TS_TYPE_PARAMETERS@773..779 0: L_ANGLE@773..774 "<" [] [] - 1: JS_BOGUS@774..778 - 0: TS_BOGUS_TYPE@774..777 + 1: TS_TYPE_PARAMETER_LIST@774..778 + 0: TS_TYPE_PARAMETER@774..778 0: IN_KW@774..777 "in" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER@777..778 - 0: (empty) 1: (empty) 2: TS_TYPE_PARAMETER_NAME@777..778 0: IDENT@777..778 "T" [] [] 3: (empty) 4: (empty) 2: R_ANGLE@778..779 ">" [] [] - 2: JS_PARAMETERS@779..781 + 3: JS_PARAMETERS@779..781 0: L_PAREN@779..780 "(" [] [] 1: JS_PARAMETER_LIST@780..780 2: R_PAREN@780..781 ")" [] [] - 3: TS_RETURN_TYPE_ANNOTATION@781..787 + 4: TS_RETURN_TYPE_ANNOTATION@781..787 0: COLON@781..783 ":" [] [Whitespace(" ")] 1: TS_ANY_TYPE@783..787 0: ANY_KW@783..787 "any" [] [Whitespace(" ")] + 5: (empty) 2: R_CURLY@787..788 "}" [] [] 2: (empty) 1: SEMICOLON@788..789 ";" [] [] @@ -2640,17 +2305,9 @@ JsModule { 2: TS_TYPE_PARAMETERS@801..808 0: L_ANGLE@801..802 "<" [] [] 1: TS_TYPE_PARAMETER_LIST@802..807 - 0: TS_TYPE_PARAMETER@802..806 + 0: TS_TYPE_PARAMETER@802..807 0: (empty) - 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@802..806 - 0: IDENT@802..806 "out" [] [Whitespace(" ")] - 3: (empty) - 4: (empty) - 1: (empty) - 2: TS_TYPE_PARAMETER@806..807 - 0: (empty) - 1: (empty) + 1: OUT_KW@802..806 "out" [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER_NAME@806..807 0: IDENT@806..807 "T" [] [] 3: (empty) @@ -2677,48 +2334,41 @@ JsModule { 0: IDENT@824..825 "x" [] [] 1: TS_TYPE_ANNOTATION@825..852 0: COLON@825..827 ":" [] [Whitespace(" ")] - 1: TS_BOGUS_TYPE@827..852 + 1: TS_OBJECT_TYPE@827..852 0: L_CURLY@827..829 "{" [] [Whitespace(" ")] - 1: JS_BOGUS@829..851 - 0: JS_BOGUS@829..851 + 1: TS_TYPE_MEMBER_LIST@829..851 + 0: TS_METHOD_SIGNATURE_TYPE_MEMBER@829..851 0: JS_LITERAL_MEMBER_NAME@829..830 0: IDENT@829..830 "y" [] [] - 1: JS_BOGUS@830..843 + 1: (empty) + 2: TS_TYPE_PARAMETERS@830..843 0: L_ANGLE@830..831 "<" [] [] - 1: JS_BOGUS@831..842 - 0: TS_BOGUS_TYPE@831..834 + 1: TS_TYPE_PARAMETER_LIST@831..842 + 0: TS_TYPE_PARAMETER@831..835 0: IN_KW@831..834 "in" [] [Whitespace(" ")] - 1: TS_TYPE_PARAMETER@834..835 - 0: (empty) 1: (empty) 2: TS_TYPE_PARAMETER_NAME@834..835 0: IDENT@834..835 "T" [] [] 3: (empty) 4: (empty) - 2: COMMA@835..837 "," [] [Whitespace(" ")] - 3: TS_TYPE_PARAMETER@837..841 - 0: (empty) - 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@837..841 - 0: IDENT@837..841 "out" [] [Whitespace(" ")] - 3: (empty) - 4: (empty) - 4: TS_TYPE_PARAMETER@841..842 + 1: COMMA@835..837 "," [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER@837..842 0: (empty) - 1: (empty) + 1: OUT_KW@837..841 "out" [] [Whitespace(" ")] 2: TS_TYPE_PARAMETER_NAME@841..842 0: IDENT@841..842 "T" [] [] 3: (empty) 4: (empty) 2: R_ANGLE@842..843 ">" [] [] - 2: JS_PARAMETERS@843..845 + 3: JS_PARAMETERS@843..845 0: L_PAREN@843..844 "(" [] [] 1: JS_PARAMETER_LIST@844..844 2: R_PAREN@844..845 ")" [] [] - 3: TS_RETURN_TYPE_ANNOTATION@845..851 + 4: TS_RETURN_TYPE_ANNOTATION@845..851 0: COLON@845..847 ":" [] [Whitespace(" ")] 1: TS_ANY_TYPE@847..851 0: ANY_KW@847..851 "any" [] [Whitespace(" ")] + 5: (empty) 2: R_CURLY@851..852 "}" [] [] 2: (empty) 1: SEMICOLON@852..853 ";" [] [] @@ -2726,14 +2376,7 @@ JsModule { -- type_parameter_modifier1.ts:1:30 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × expected a type parameter but instead found 'in' - - > 1 │ export default function foo() {} - │ ^^ - 2 │ export function foo() {} - 3 │ export function foo1() {} - - i Expected a type parameter here + × 'in' modifier can only appear on a type parameter of a class, interface or type alias. > 1 │ export default function foo() {} │ ^^ @@ -2741,43 +2384,20 @@ type_parameter_modifier1.ts:1:30 parse ━━━━━━━━━━━━━ 3 │ export function foo1() {} -- -type_parameter_modifier1.ts:1:33 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:2:22 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × expected `,` but instead found `T` - - > 1 │ export default function foo() {} - │ ^ - 2 │ export function foo() {} - 3 │ export function foo1() {} - - i Remove T - --- -type_parameter_modifier1.ts:2:26 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `T` + × 'out' modifier can only appear on a type parameter of a class, interface or type alias. 1 │ export default function foo() {} > 2 │ export function foo() {} - │ ^ + │ ^^^ 3 │ export function foo1() {} 4 │ export function foo2() {} - i Remove T - -- type_parameter_modifier1.ts:3:23 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × expected a type parameter but instead found 'in' - - 1 │ export default function foo() {} - 2 │ export function foo() {} - > 3 │ export function foo1() {} - │ ^^ - 4 │ export function foo2() {} - 5 │ let foo: Foo - - i Expected a type parameter here + × 'in' modifier can only appear on a type parameter of a class, interface or type alias. 1 │ export default function foo() {} 2 │ export function foo() {} @@ -2787,33 +2407,17 @@ type_parameter_modifier1.ts:3:23 parse ━━━━━━━━━━━━━ 5 │ let foo: Foo -- -type_parameter_modifier1.ts:3:26 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `T` - - 1 │ export default function foo() {} - 2 │ export function foo() {} - > 3 │ export function foo1() {} - │ ^ - 4 │ export function foo2() {} - 5 │ let foo: Foo - - i Remove T - --- -type_parameter_modifier1.ts:4:27 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:4:23 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × expected `,` but instead found `T` + × 'out' modifier can only appear on a type parameter of a class, interface or type alias. 2 │ export function foo() {} 3 │ export function foo1() {} > 4 │ export function foo2() {} - │ ^ + │ ^^^ 5 │ let foo: Foo 6 │ let foo: Foo - i Remove T - -- type_parameter_modifier1.ts:5:18 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -2845,16 +2449,7 @@ type_parameter_modifier1.ts:6:19 parse ━━━━━━━━━━━━━ -- type_parameter_modifier1.ts:7:23 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × expected a type parameter but instead found 'in' - - 5 │ let foo: Foo - 6 │ let foo: Foo - > 7 │ declare function foo() - │ ^^ - 8 │ declare function foo() - 9 │ declare let foo: Foo - - i Expected a type parameter here + × 'in' modifier can only appear on a type parameter of a class, interface or type alias. 5 │ let foo: Foo 6 │ let foo: Foo @@ -2864,33 +2459,17 @@ type_parameter_modifier1.ts:7:23 parse ━━━━━━━━━━━━━ 9 │ declare let foo: Foo -- -type_parameter_modifier1.ts:7:26 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:8:23 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × expected `,` but instead found `T` - - 5 │ let foo: Foo - 6 │ let foo: Foo - > 7 │ declare function foo() - │ ^ - 8 │ declare function foo() - 9 │ declare let foo: Foo - - i Remove T - --- -type_parameter_modifier1.ts:8:27 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `T` + × 'out' modifier can only appear on a type parameter of a class, interface or type alias. 6 │ let foo: Foo 7 │ declare function foo() > 8 │ declare function foo() - │ ^ + │ ^^^ 9 │ declare let foo: Foo 10 │ declare let foo: Foo - i Remove T - -- type_parameter_modifier1.ts:9:26 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -2922,16 +2501,7 @@ type_parameter_modifier1.ts:10:27 parse ━━━━━━━━━━━━━ -- type_parameter_modifier1.ts:13:18 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × expected a type parameter but instead found 'in' - - 11 │ Foo = class {} - 12 │ Foo = class {} - > 13 │ foo = function () {} - │ ^^ - 14 │ foo = function () {} - 15 │ class Foo { foo(): T {} } - - i Expected a type parameter here + × 'in' modifier can only appear on a type parameter of a class, interface or type alias. 11 │ Foo = class {} 12 │ Foo = class {} @@ -2941,46 +2511,21 @@ type_parameter_modifier1.ts:13:18 parse ━━━━━━━━━━━━━ 15 │ class Foo { foo(): T {} } -- -type_parameter_modifier1.ts:13:21 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:14:18 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × expected `,` but instead found `T` - - 11 │ Foo = class {} - 12 │ Foo = class {} - > 13 │ foo = function () {} - │ ^ - 14 │ foo = function () {} - 15 │ class Foo { foo(): T {} } - - i Remove T - --- -type_parameter_modifier1.ts:14:22 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `T` + × 'out' modifier can only appear on a type parameter of a class, interface or type alias. 12 │ Foo = class {} 13 │ foo = function () {} > 14 │ foo = function () {} - │ ^ + │ ^^^ 15 │ class Foo { foo(): T {} } 16 │ class Foo { foo(): T {} } - i Remove T - -- type_parameter_modifier1.ts:15:18 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × expected a type parameter but instead found 'in' - - 13 │ foo = function () {} - 14 │ foo = function () {} - > 15 │ class Foo { foo(): T {} } - │ ^^ - 16 │ class Foo { foo(): T {} } - 17 │ foo = { foo(): T {} }; - - i Expected a type parameter here + × 'in' modifier can only appear on a type parameter of a class, interface or type alias. 13 │ foo = function () {} 14 │ foo = function () {} @@ -2990,37 +2535,21 @@ type_parameter_modifier1.ts:15:18 parse ━━━━━━━━━━━━━ 17 │ foo = { foo(): T {} }; -- -type_parameter_modifier1.ts:15:21 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:16:18 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × expected `,` but instead found `T` - - 13 │ foo = function () {} - 14 │ foo = function () {} - > 15 │ class Foo { foo(): T {} } - │ ^ - 16 │ class Foo { foo(): T {} } - 17 │ foo = { foo(): T {} }; - - i Remove T - --- -type_parameter_modifier1.ts:16:22 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `T` + × 'out' modifier can only appear on a type parameter of a class, interface or type alias. 14 │ foo = function () {} 15 │ class Foo { foo(): T {} } > 16 │ class Foo { foo(): T {} } - │ ^ + │ ^^^ 17 │ foo = { foo(): T {} }; 18 │ foo = { foo(): T {} }; - i Remove T - -- type_parameter_modifier1.ts:17:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × expected a type parameter but instead found 'in' + × 'in' modifier can only appear on a type parameter of a class, interface or type alias. 15 │ class Foo { foo(): T {} } 16 │ class Foo { foo(): T {} } @@ -3029,43 +2558,18 @@ type_parameter_modifier1.ts:17:14 parse ━━━━━━━━━━━━━ 18 │ foo = { foo(): T {} }; 19 │ () => {}; - i Expected a type parameter here - - 15 │ class Foo { foo(): T {} } - 16 │ class Foo { foo(): T {} } - > 17 │ foo = { foo(): T {} }; - │ ^^ - 18 │ foo = { foo(): T {} }; - 19 │ () => {}; - --- -type_parameter_modifier1.ts:17:17 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `T` - - 15 │ class Foo { foo(): T {} } - 16 │ class Foo { foo(): T {} } - > 17 │ foo = { foo(): T {} }; - │ ^ - 18 │ foo = { foo(): T {} }; - 19 │ () => {}; - - i Remove T - -- -type_parameter_modifier1.ts:18:18 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:18:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × expected `,` but instead found `T` + × 'out' modifier can only appear on a type parameter of a class, interface or type alias. 16 │ class Foo { foo(): T {} } 17 │ foo = { foo(): T {} }; > 18 │ foo = { foo(): T {} }; - │ ^ + │ ^^^ 19 │ () => {}; 20 │ () => {}; - i Remove T - -- type_parameter_modifier1.ts:19:6 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -3125,19 +2629,17 @@ type_parameter_modifier1.ts:19:11 parse ━━━━━━━━━━━━━ 21 │ () => {}; -- -type_parameter_modifier1.ts:20:7 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:20:3 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × expected `,` but instead found `T` + × 'out' modifier can only appear on a type parameter of a class, interface or type alias. 18 │ foo = { foo(): T {} }; 19 │ () => {}; > 20 │ () => {}; - │ ^ + │ ^^^ 21 │ () => {}; 22 │ let x: () => {}; - i Remove T - -- type_parameter_modifier1.ts:21:6 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -3229,16 +2731,7 @@ type_parameter_modifier1.ts:21:18 parse ━━━━━━━━━━━━━ -- type_parameter_modifier1.ts:22:10 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × expected a type parameter but instead found 'in' - - 20 │ () => {}; - 21 │ () => {}; - > 22 │ let x: () => {}; - │ ^^ - 23 │ let x: () => {}; - 24 │ let x: () => {}; - - i Expected a type parameter here + × 'in' modifier can only appear on a type parameter of a class, interface or type alias. 20 │ () => {}; 21 │ () => {}; @@ -3248,37 +2741,21 @@ type_parameter_modifier1.ts:22:10 parse ━━━━━━━━━━━━━ 24 │ let x: () => {}; -- -type_parameter_modifier1.ts:22:13 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:23:10 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × expected `,` but instead found `T` - - 20 │ () => {}; - 21 │ () => {}; - > 22 │ let x: () => {}; - │ ^ - 23 │ let x: () => {}; - 24 │ let x: () => {}; - - i Remove T - --- -type_parameter_modifier1.ts:23:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `T` + × 'out' modifier can only appear on a type parameter of a class, interface or type alias. 21 │ () => {}; 22 │ let x: () => {}; > 23 │ let x: () => {}; - │ ^ + │ ^^^ 24 │ let x: () => {}; 25 │ let x: new () => {}; - i Remove T - -- type_parameter_modifier1.ts:24:10 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × expected a type parameter but instead found 'in' + × 'in' modifier can only appear on a type parameter of a class, interface or type alias. 22 │ let x: () => {}; 23 │ let x: () => {}; @@ -3287,56 +2764,22 @@ type_parameter_modifier1.ts:24:10 parse ━━━━━━━━━━━━━ 25 │ let x: new () => {}; 26 │ let x: new () => {}; - i Expected a type parameter here - - 22 │ let x: () => {}; - 23 │ let x: () => {}; - > 24 │ let x: () => {}; - │ ^^ - 25 │ let x: new () => {}; - 26 │ let x: new () => {}; - --- -type_parameter_modifier1.ts:24:13 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `T` - - 22 │ let x: () => {}; - 23 │ let x: () => {}; - > 24 │ let x: () => {}; - │ ^ - 25 │ let x: new () => {}; - 26 │ let x: new () => {}; - - i Remove T - -- -type_parameter_modifier1.ts:24:20 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:24:16 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × expected `,` but instead found `T` + × 'out' modifier can only appear on a type parameter of a class, interface or type alias. 22 │ let x: () => {}; 23 │ let x: () => {}; > 24 │ let x: () => {}; - │ ^ + │ ^^^ 25 │ let x: new () => {}; 26 │ let x: new () => {}; - i Remove T - -- type_parameter_modifier1.ts:25:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × expected a type parameter but instead found 'in' - - 23 │ let x: () => {}; - 24 │ let x: () => {}; - > 25 │ let x: new () => {}; - │ ^^ - 26 │ let x: new () => {}; - 27 │ let x: new () => {}; - - i Expected a type parameter here + × 'in' modifier can only appear on a type parameter of a class, interface or type alias. 23 │ let x: () => {}; 24 │ let x: () => {}; @@ -3346,37 +2789,21 @@ type_parameter_modifier1.ts:25:14 parse ━━━━━━━━━━━━━ 27 │ let x: new () => {}; -- -type_parameter_modifier1.ts:25:17 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:26:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × expected `,` but instead found `T` - - 23 │ let x: () => {}; - 24 │ let x: () => {}; - > 25 │ let x: new () => {}; - │ ^ - 26 │ let x: new () => {}; - 27 │ let x: new () => {}; - - i Remove T - --- -type_parameter_modifier1.ts:26:18 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `T` + × 'out' modifier can only appear on a type parameter of a class, interface or type alias. 24 │ let x: () => {}; 25 │ let x: new () => {}; > 26 │ let x: new () => {}; - │ ^ + │ ^^^ 27 │ let x: new () => {}; 28 │ let x: { y(): any }; - i Remove T - -- type_parameter_modifier1.ts:27:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × expected a type parameter but instead found 'in' + × 'in' modifier can only appear on a type parameter of a class, interface or type alias. 25 │ let x: new () => {}; 26 │ let x: new () => {}; @@ -3385,56 +2812,22 @@ type_parameter_modifier1.ts:27:14 parse ━━━━━━━━━━━━━ 28 │ let x: { y(): any }; 29 │ let x: { y(): any }; - i Expected a type parameter here - - 25 │ let x: new () => {}; - 26 │ let x: new () => {}; - > 27 │ let x: new () => {}; - │ ^^ - 28 │ let x: { y(): any }; - 29 │ let x: { y(): any }; - --- -type_parameter_modifier1.ts:27:17 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `T` - - 25 │ let x: new () => {}; - 26 │ let x: new () => {}; - > 27 │ let x: new () => {}; - │ ^ - 28 │ let x: { y(): any }; - 29 │ let x: { y(): any }; - - i Remove T - -- -type_parameter_modifier1.ts:27:24 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:27:20 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × expected `,` but instead found `T` + × 'out' modifier can only appear on a type parameter of a class, interface or type alias. 25 │ let x: new () => {}; 26 │ let x: new () => {}; > 27 │ let x: new () => {}; - │ ^ + │ ^^^ 28 │ let x: { y(): any }; 29 │ let x: { y(): any }; - i Remove T - -- type_parameter_modifier1.ts:28:13 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × expected a type parameter but instead found 'in' - - 26 │ let x: new () => {}; - 27 │ let x: new () => {}; - > 28 │ let x: { y(): any }; - │ ^^ - 29 │ let x: { y(): any }; - 30 │ let x: { y(): any }; - - i Expected a type parameter here + × 'in' modifier can only appear on a type parameter of a class, interface or type alias. 26 │ let x: new () => {}; 27 │ let x: new () => {}; @@ -3444,45 +2837,21 @@ type_parameter_modifier1.ts:28:13 parse ━━━━━━━━━━━━━ 30 │ let x: { y(): any }; -- -type_parameter_modifier1.ts:28:16 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:29:13 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × expected `,` but instead found `T` - - 26 │ let x: new () => {}; - 27 │ let x: new () => {}; - > 28 │ let x: { y(): any }; - │ ^ - 29 │ let x: { y(): any }; - 30 │ let x: { y(): any }; - - i Remove T - --- -type_parameter_modifier1.ts:29:17 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `T` + × 'out' modifier can only appear on a type parameter of a class, interface or type alias. 27 │ let x: new () => {}; 28 │ let x: { y(): any }; > 29 │ let x: { y(): any }; - │ ^ + │ ^^^ 30 │ let x: { y(): any }; 31 │ - i Remove T - -- type_parameter_modifier1.ts:30:13 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × expected a type parameter but instead found 'in' - - 28 │ let x: { y(): any }; - 29 │ let x: { y(): any }; - > 30 │ let x: { y(): any }; - │ ^^ - 31 │ - - i Expected a type parameter here + × 'in' modifier can only appear on a type parameter of a class, interface or type alias. 28 │ let x: { y(): any }; 29 │ let x: { y(): any }; @@ -3491,31 +2860,16 @@ type_parameter_modifier1.ts:30:13 parse ━━━━━━━━━━━━━ 31 │ -- -type_parameter_modifier1.ts:30:16 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:30:19 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × expected `,` but instead found `T` + × 'out' modifier can only appear on a type parameter of a class, interface or type alias. 28 │ let x: { y(): any }; 29 │ let x: { y(): any }; > 30 │ let x: { y(): any }; - │ ^ + │ ^^^ 31 │ - i Remove T - --- -type_parameter_modifier1.ts:30:23 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `T` - - 28 │ let x: { y(): any }; - 29 │ let x: { y(): any }; - > 30 │ let x: { y(): any }; - │ ^ - 31 │ - - i Remove T - -- export default function foo() {} export function foo() {} From 38841d8c7161c7dd7c5ee1cfadd320e9e05c318a Mon Sep 17 00:00:00 2001 From: nissy-dev Date: Mon, 6 Mar 2023 22:32:15 +0900 Subject: [PATCH 20/22] fix: update tests --- .../src/syntax/typescript/types.rs | 58 +- .../inline/err/type_parameter_modifier1.rast | 2976 ++++++++--------- .../inline/err/type_parameter_modifier1.ts | 58 +- 3 files changed, 1485 insertions(+), 1607 deletions(-) diff --git a/crates/rome_js_parser/src/syntax/typescript/types.rs b/crates/rome_js_parser/src/syntax/typescript/types.rs index af44b9b0ba6..b8d173afef3 100644 --- a/crates/rome_js_parser/src/syntax/typescript/types.rs +++ b/crates/rome_js_parser/src/syntax/typescript/types.rs @@ -217,36 +217,34 @@ impl ParseSeparatedList for TsTypeParameterList { } // test_err ts type_parameter_modifier1 -// export default function foo() {} -// export function foo() {} -// export function foo1() {} -// export function foo2() {} -// let foo: Foo -// let foo: Foo -// declare function foo() -// declare function foo() -// declare let foo: Foo -// declare let foo: Foo -// Foo = class {} -// Foo = class {} -// foo = function () {} -// foo = function () {} -// class Foo { foo(): T {} } -// class Foo { foo(): T {} } -// foo = { foo(): T {} }; -// foo = { foo(): T {} }; -// () => {}; -// () => {}; -// () => {}; -// let x: () => {}; -// let x: () => {}; -// let x: () => {}; -// let x: new () => {}; -// let x: new () => {}; -// let x: new () => {}; -// let x: { y(): any }; -// let x: { y(): any }; -// let x: { y(): any }; +// export default function foo() {} +// export function foo() {} +// export function foo1() {} +// export function foo2() {} +// let foo: Foo +// let foo: Foo +// declare function foo() +// declare function foo() +// declare let foo: Foo +// declare let foo: Foo +// foo = function () {} +// foo = function () {} +// class Foo { foo(): T {} } +// class Foo { foo(): T {} } +// foo = { foo(): T {} }; +// foo = { foo(): T {} }; +// () => {}; +// () => {}; +// () => {}; +// let x: () => {}; +// let x: () => {}; +// let x: () => {}; +// let x: new () => {}; +// let x: new () => {}; +// let x: new () => {}; +// let x: { y(): any }; +// let x: { y(): any }; +// let x: { y(): any }; // test_err ts type_parameter_modifier // type Foo = {} diff --git a/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier1.rast b/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier1.rast index 65d715dcbf0..d44821a3a17 100644 --- a/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier1.rast +++ b/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier1.rast @@ -3,193 +3,193 @@ JsModule { directives: JsDirectiveList [], items: JsModuleItemList [ JsExport { - export_token: EXPORT_KW@0..8 "export" [Whitespace("\t")] [Whitespace(" ")], + export_token: EXPORT_KW@0..7 "export" [] [Whitespace(" ")], export_clause: JsExportDefaultDeclarationClause { - default_token: DEFAULT_KW@8..16 "default" [] [Whitespace(" ")], + default_token: DEFAULT_KW@7..15 "default" [] [Whitespace(" ")], declaration: JsFunctionExportDefaultDeclaration { async_token: missing (optional), - function_token: FUNCTION_KW@16..25 "function" [] [Whitespace(" ")], + function_token: FUNCTION_KW@15..24 "function" [] [Whitespace(" ")], star_token: missing (optional), id: JsIdentifierBinding { - name_token: IDENT@25..28 "foo" [] [], + name_token: IDENT@24..27 "foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@28..29 "<" [] [], + l_angle_token: L_ANGLE@27..28 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - in_modifier_token: IN_KW@29..32 "in" [] [Whitespace(" ")], + in_modifier_token: IN_KW@28..31 "in" [] [Whitespace(" ")], out_modifier_token: missing (optional), name: TsTypeParameterName { - ident_token: IDENT@32..33 "T" [] [], + ident_token: IDENT@31..32 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@33..34 ">" [] [], + r_angle_token: R_ANGLE@32..33 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@34..35 "(" [] [], + l_paren_token: L_PAREN@33..34 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@35..37 ")" [] [Whitespace(" ")], + r_paren_token: R_PAREN@34..36 ")" [] [Whitespace(" ")], }, return_type_annotation: missing (optional), body: JsFunctionBody { - l_curly_token: L_CURLY@37..38 "{" [] [], + l_curly_token: L_CURLY@36..37 "{" [] [], directives: JsDirectiveList [], statements: JsStatementList [], - r_curly_token: R_CURLY@38..39 "}" [] [], + r_curly_token: R_CURLY@37..38 "}" [] [], }, }, semicolon_token: missing (optional), }, }, JsExport { - export_token: EXPORT_KW@39..48 "export" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + export_token: EXPORT_KW@38..46 "export" [Newline("\n")] [Whitespace(" ")], export_clause: JsFunctionDeclaration { async_token: missing (optional), - function_token: FUNCTION_KW@48..57 "function" [] [Whitespace(" ")], + function_token: FUNCTION_KW@46..55 "function" [] [Whitespace(" ")], star_token: missing (optional), id: JsIdentifierBinding { - name_token: IDENT@57..60 "foo" [] [], + name_token: IDENT@55..58 "foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@60..61 "<" [] [], + l_angle_token: L_ANGLE@58..59 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: OUT_KW@61..65 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@59..63 "out" [] [Whitespace(" ")], name: TsTypeParameterName { - ident_token: IDENT@65..66 "T" [] [], + ident_token: IDENT@63..64 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@66..67 ">" [] [], + r_angle_token: R_ANGLE@64..65 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@67..68 "(" [] [], + l_paren_token: L_PAREN@65..66 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@68..70 ")" [] [Whitespace(" ")], + r_paren_token: R_PAREN@66..68 ")" [] [Whitespace(" ")], }, return_type_annotation: missing (optional), body: JsFunctionBody { - l_curly_token: L_CURLY@70..71 "{" [] [], + l_curly_token: L_CURLY@68..69 "{" [] [], directives: JsDirectiveList [], statements: JsStatementList [], - r_curly_token: R_CURLY@71..72 "}" [] [], + r_curly_token: R_CURLY@69..70 "}" [] [], }, }, }, JsExport { - export_token: EXPORT_KW@72..81 "export" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + export_token: EXPORT_KW@70..78 "export" [Newline("\n")] [Whitespace(" ")], export_clause: JsFunctionDeclaration { async_token: missing (optional), - function_token: FUNCTION_KW@81..90 "function" [] [Whitespace(" ")], + function_token: FUNCTION_KW@78..87 "function" [] [Whitespace(" ")], star_token: missing (optional), id: JsIdentifierBinding { - name_token: IDENT@90..94 "foo1" [] [], + name_token: IDENT@87..91 "foo1" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@94..95 "<" [] [], + l_angle_token: L_ANGLE@91..92 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - in_modifier_token: IN_KW@95..98 "in" [] [Whitespace(" ")], + in_modifier_token: IN_KW@92..95 "in" [] [Whitespace(" ")], out_modifier_token: missing (optional), name: TsTypeParameterName { - ident_token: IDENT@98..99 "T" [] [], + ident_token: IDENT@95..96 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@99..100 ">" [] [], + r_angle_token: R_ANGLE@96..97 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@100..101 "(" [] [], + l_paren_token: L_PAREN@97..98 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@101..103 ")" [] [Whitespace(" ")], + r_paren_token: R_PAREN@98..100 ")" [] [Whitespace(" ")], }, return_type_annotation: missing (optional), body: JsFunctionBody { - l_curly_token: L_CURLY@103..104 "{" [] [], + l_curly_token: L_CURLY@100..101 "{" [] [], directives: JsDirectiveList [], statements: JsStatementList [], - r_curly_token: R_CURLY@104..105 "}" [] [], + r_curly_token: R_CURLY@101..102 "}" [] [], }, }, }, JsExport { - export_token: EXPORT_KW@105..114 "export" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + export_token: EXPORT_KW@102..110 "export" [Newline("\n")] [Whitespace(" ")], export_clause: JsFunctionDeclaration { async_token: missing (optional), - function_token: FUNCTION_KW@114..123 "function" [] [Whitespace(" ")], + function_token: FUNCTION_KW@110..119 "function" [] [Whitespace(" ")], star_token: missing (optional), id: JsIdentifierBinding { - name_token: IDENT@123..127 "foo2" [] [], + name_token: IDENT@119..123 "foo2" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@127..128 "<" [] [], + l_angle_token: L_ANGLE@123..124 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: OUT_KW@128..132 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@124..128 "out" [] [Whitespace(" ")], name: TsTypeParameterName { - ident_token: IDENT@132..133 "T" [] [], + ident_token: IDENT@128..129 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@133..134 ">" [] [], + r_angle_token: R_ANGLE@129..130 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@134..135 "(" [] [], + l_paren_token: L_PAREN@130..131 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@135..137 ")" [] [Whitespace(" ")], + r_paren_token: R_PAREN@131..133 ")" [] [Whitespace(" ")], }, return_type_annotation: missing (optional), body: JsFunctionBody { - l_curly_token: L_CURLY@137..138 "{" [] [], + l_curly_token: L_CURLY@133..134 "{" [] [], directives: JsDirectiveList [], statements: JsStatementList [], - r_curly_token: R_CURLY@138..139 "}" [] [], + r_curly_token: R_CURLY@134..135 "}" [] [], }, }, }, JsVariableStatement { declaration: JsVariableDeclaration { - kind: LET_KW@139..145 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + kind: LET_KW@135..140 "let" [Newline("\n")] [Whitespace(" ")], declarators: JsVariableDeclaratorList [ JsVariableDeclarator { id: JsIdentifierBinding { - name_token: IDENT@145..148 "foo" [] [], + name_token: IDENT@140..143 "foo" [] [], }, variable_annotation: TsTypeAnnotation { - colon_token: COLON@148..150 ":" [] [Whitespace(" ")], + colon_token: COLON@143..145 ":" [] [Whitespace(" ")], ty: TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@150..153 "Foo" [] [], + value_token: IDENT@145..148 "Foo" [] [], }, type_arguments: TsTypeArguments { - l_angle_token: L_ANGLE@153..154 "<" [] [], + l_angle_token: L_ANGLE@148..149 "<" [] [], ts_type_argument_list: TsTypeArgumentList [ TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@154..157 "in" [] [Whitespace(" ")], + value_token: IDENT@149..152 "in" [] [Whitespace(" ")], }, type_arguments: missing (optional), }, missing separator, TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@157..158 "T" [] [], + value_token: IDENT@152..153 "T" [] [], }, type_arguments: missing (optional), }, ], - r_angle_token: R_ANGLE@158..159 ">" [] [], + r_angle_token: R_ANGLE@153..154 ">" [] [], }, }, }, @@ -201,36 +201,36 @@ JsModule { }, JsVariableStatement { declaration: JsVariableDeclaration { - kind: LET_KW@159..165 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + kind: LET_KW@154..159 "let" [Newline("\n")] [Whitespace(" ")], declarators: JsVariableDeclaratorList [ JsVariableDeclarator { id: JsIdentifierBinding { - name_token: IDENT@165..168 "foo" [] [], + name_token: IDENT@159..162 "foo" [] [], }, variable_annotation: TsTypeAnnotation { - colon_token: COLON@168..170 ":" [] [Whitespace(" ")], + colon_token: COLON@162..164 ":" [] [Whitespace(" ")], ty: TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@170..173 "Foo" [] [], + value_token: IDENT@164..167 "Foo" [] [], }, type_arguments: TsTypeArguments { - l_angle_token: L_ANGLE@173..174 "<" [] [], + l_angle_token: L_ANGLE@167..168 "<" [] [], ts_type_argument_list: TsTypeArgumentList [ TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@174..178 "out" [] [Whitespace(" ")], + value_token: IDENT@168..172 "out" [] [Whitespace(" ")], }, type_arguments: missing (optional), }, missing separator, TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@178..179 "T" [] [], + value_token: IDENT@172..173 "T" [] [], }, type_arguments: missing (optional), }, ], - r_angle_token: R_ANGLE@179..180 ">" [] [], + r_angle_token: R_ANGLE@173..174 ">" [] [], }, }, }, @@ -241,103 +241,103 @@ JsModule { semicolon_token: missing (optional), }, TsDeclareStatement { - declare_token: DECLARE_KW@180..190 "declare" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + declare_token: DECLARE_KW@174..183 "declare" [Newline("\n")] [Whitespace(" ")], declaration: TsDeclareFunctionDeclaration { async_token: missing (optional), - function_token: FUNCTION_KW@190..199 "function" [] [Whitespace(" ")], + function_token: FUNCTION_KW@183..192 "function" [] [Whitespace(" ")], id: JsIdentifierBinding { - name_token: IDENT@199..202 "foo" [] [], + name_token: IDENT@192..195 "foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@202..203 "<" [] [], + l_angle_token: L_ANGLE@195..196 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - in_modifier_token: IN_KW@203..206 "in" [] [Whitespace(" ")], + in_modifier_token: IN_KW@196..199 "in" [] [Whitespace(" ")], out_modifier_token: missing (optional), name: TsTypeParameterName { - ident_token: IDENT@206..207 "T" [] [], + ident_token: IDENT@199..200 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@207..208 ">" [] [], + r_angle_token: R_ANGLE@200..201 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@208..209 "(" [] [], + l_paren_token: L_PAREN@201..202 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@209..210 ")" [] [], + r_paren_token: R_PAREN@202..203 ")" [] [], }, return_type_annotation: missing (optional), semicolon_token: missing (optional), }, }, TsDeclareStatement { - declare_token: DECLARE_KW@210..220 "declare" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + declare_token: DECLARE_KW@203..212 "declare" [Newline("\n")] [Whitespace(" ")], declaration: TsDeclareFunctionDeclaration { async_token: missing (optional), - function_token: FUNCTION_KW@220..229 "function" [] [Whitespace(" ")], + function_token: FUNCTION_KW@212..221 "function" [] [Whitespace(" ")], id: JsIdentifierBinding { - name_token: IDENT@229..232 "foo" [] [], + name_token: IDENT@221..224 "foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@232..233 "<" [] [], + l_angle_token: L_ANGLE@224..225 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: OUT_KW@233..237 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@225..229 "out" [] [Whitespace(" ")], name: TsTypeParameterName { - ident_token: IDENT@237..238 "T" [] [], + ident_token: IDENT@229..230 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@238..239 ">" [] [], + r_angle_token: R_ANGLE@230..231 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@239..240 "(" [] [], + l_paren_token: L_PAREN@231..232 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@240..241 ")" [] [], + r_paren_token: R_PAREN@232..233 ")" [] [], }, return_type_annotation: missing (optional), semicolon_token: missing (optional), }, }, TsDeclareStatement { - declare_token: DECLARE_KW@241..251 "declare" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + declare_token: DECLARE_KW@233..242 "declare" [Newline("\n")] [Whitespace(" ")], declaration: JsVariableDeclarationClause { declaration: JsVariableDeclaration { - kind: LET_KW@251..255 "let" [] [Whitespace(" ")], + kind: LET_KW@242..246 "let" [] [Whitespace(" ")], declarators: JsVariableDeclaratorList [ JsVariableDeclarator { id: JsIdentifierBinding { - name_token: IDENT@255..258 "foo" [] [], + name_token: IDENT@246..249 "foo" [] [], }, variable_annotation: TsTypeAnnotation { - colon_token: COLON@258..260 ":" [] [Whitespace(" ")], + colon_token: COLON@249..251 ":" [] [Whitespace(" ")], ty: TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@260..263 "Foo" [] [], + value_token: IDENT@251..254 "Foo" [] [], }, type_arguments: TsTypeArguments { - l_angle_token: L_ANGLE@263..264 "<" [] [], + l_angle_token: L_ANGLE@254..255 "<" [] [], ts_type_argument_list: TsTypeArgumentList [ TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@264..267 "in" [] [Whitespace(" ")], + value_token: IDENT@255..258 "in" [] [Whitespace(" ")], }, type_arguments: missing (optional), }, missing separator, TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@267..268 "T" [] [], + value_token: IDENT@258..259 "T" [] [], }, type_arguments: missing (optional), }, ], - r_angle_token: R_ANGLE@268..269 ">" [] [], + r_angle_token: R_ANGLE@259..260 ">" [] [], }, }, }, @@ -349,39 +349,39 @@ JsModule { }, }, TsDeclareStatement { - declare_token: DECLARE_KW@269..279 "declare" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + declare_token: DECLARE_KW@260..269 "declare" [Newline("\n")] [Whitespace(" ")], declaration: JsVariableDeclarationClause { declaration: JsVariableDeclaration { - kind: LET_KW@279..283 "let" [] [Whitespace(" ")], + kind: LET_KW@269..273 "let" [] [Whitespace(" ")], declarators: JsVariableDeclaratorList [ JsVariableDeclarator { id: JsIdentifierBinding { - name_token: IDENT@283..286 "foo" [] [], + name_token: IDENT@273..276 "foo" [] [], }, variable_annotation: TsTypeAnnotation { - colon_token: COLON@286..288 ":" [] [Whitespace(" ")], + colon_token: COLON@276..278 ":" [] [Whitespace(" ")], ty: TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@288..291 "Foo" [] [], + value_token: IDENT@278..281 "Foo" [] [], }, type_arguments: TsTypeArguments { - l_angle_token: L_ANGLE@291..292 "<" [] [], + l_angle_token: L_ANGLE@281..282 "<" [] [], ts_type_argument_list: TsTypeArgumentList [ TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@292..296 "out" [] [Whitespace(" ")], + value_token: IDENT@282..286 "out" [] [Whitespace(" ")], }, type_arguments: missing (optional), }, missing separator, TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@296..297 "T" [] [], + value_token: IDENT@286..287 "T" [] [], }, type_arguments: missing (optional), }, ], - r_angle_token: R_ANGLE@297..298 ">" [] [], + r_angle_token: R_ANGLE@287..288 ">" [] [], }, }, }, @@ -395,106 +395,40 @@ JsModule { JsExpressionStatement { expression: JsAssignmentExpression { left: JsIdentifierAssignment { - name_token: IDENT@298..304 "Foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + name_token: IDENT@288..293 "foo" [Newline("\n")] [Whitespace(" ")], }, - operator_token: EQ@304..306 "=" [] [Whitespace(" ")], - right: JsClassExpression { - class_token: CLASS_KW@306..312 "class" [] [Whitespace(" ")], - id: missing (optional), - type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@312..313 "<" [] [], - items: TsTypeParameterList [ - TsTypeParameter { - in_modifier_token: IN_KW@313..316 "in" [] [Whitespace(" ")], - out_modifier_token: missing (optional), - name: TsTypeParameterName { - ident_token: IDENT@316..317 "T" [] [], - }, - constraint: missing (optional), - default: missing (optional), - }, - ], - r_angle_token: R_ANGLE@317..319 ">" [] [Whitespace(" ")], - }, - extends_clause: missing (optional), - implements_clause: missing (optional), - l_curly_token: L_CURLY@319..320 "{" [] [], - members: JsClassMemberList [], - r_curly_token: R_CURLY@320..321 "}" [] [], - }, - }, - semicolon_token: missing (optional), - }, - JsExpressionStatement { - expression: JsAssignmentExpression { - left: JsIdentifierAssignment { - name_token: IDENT@321..327 "Foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], - }, - operator_token: EQ@327..329 "=" [] [Whitespace(" ")], - right: JsClassExpression { - class_token: CLASS_KW@329..335 "class" [] [Whitespace(" ")], - id: missing (optional), - type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@335..336 "<" [] [], - items: TsTypeParameterList [ - TsTypeParameter { - in_modifier_token: missing (optional), - out_modifier_token: OUT_KW@336..340 "out" [] [Whitespace(" ")], - name: TsTypeParameterName { - ident_token: IDENT@340..341 "T" [] [], - }, - constraint: missing (optional), - default: missing (optional), - }, - ], - r_angle_token: R_ANGLE@341..343 ">" [] [Whitespace(" ")], - }, - extends_clause: missing (optional), - implements_clause: missing (optional), - l_curly_token: L_CURLY@343..344 "{" [] [], - members: JsClassMemberList [], - r_curly_token: R_CURLY@344..345 "}" [] [], - }, - }, - semicolon_token: missing (optional), - }, - JsExpressionStatement { - expression: JsAssignmentExpression { - left: JsIdentifierAssignment { - name_token: IDENT@345..351 "foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], - }, - operator_token: EQ@351..353 "=" [] [Whitespace(" ")], + operator_token: EQ@293..295 "=" [] [Whitespace(" ")], right: JsFunctionExpression { async_token: missing (optional), - function_token: FUNCTION_KW@353..362 "function" [] [Whitespace(" ")], + function_token: FUNCTION_KW@295..304 "function" [] [Whitespace(" ")], star_token: missing (optional), id: missing (optional), type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@362..363 "<" [] [], + l_angle_token: L_ANGLE@304..305 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - in_modifier_token: IN_KW@363..366 "in" [] [Whitespace(" ")], + in_modifier_token: IN_KW@305..308 "in" [] [Whitespace(" ")], out_modifier_token: missing (optional), name: TsTypeParameterName { - ident_token: IDENT@366..367 "T" [] [], + ident_token: IDENT@308..309 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@367..368 ">" [] [], + r_angle_token: R_ANGLE@309..310 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@368..369 "(" [] [], + l_paren_token: L_PAREN@310..311 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@369..371 ")" [] [Whitespace(" ")], + r_paren_token: R_PAREN@311..313 ")" [] [Whitespace(" ")], }, return_type_annotation: missing (optional), body: JsFunctionBody { - l_curly_token: L_CURLY@371..372 "{" [] [], + l_curly_token: L_CURLY@313..314 "{" [] [], directives: JsDirectiveList [], statements: JsStatementList [], - r_curly_token: R_CURLY@372..373 "}" [] [], + r_curly_token: R_CURLY@314..315 "}" [] [], }, }, }, @@ -503,40 +437,40 @@ JsModule { JsExpressionStatement { expression: JsAssignmentExpression { left: JsIdentifierAssignment { - name_token: IDENT@373..379 "foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + name_token: IDENT@315..320 "foo" [Newline("\n")] [Whitespace(" ")], }, - operator_token: EQ@379..381 "=" [] [Whitespace(" ")], + operator_token: EQ@320..322 "=" [] [Whitespace(" ")], right: JsFunctionExpression { async_token: missing (optional), - function_token: FUNCTION_KW@381..390 "function" [] [Whitespace(" ")], + function_token: FUNCTION_KW@322..331 "function" [] [Whitespace(" ")], star_token: missing (optional), id: missing (optional), type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@390..391 "<" [] [], + l_angle_token: L_ANGLE@331..332 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: OUT_KW@391..395 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@332..336 "out" [] [Whitespace(" ")], name: TsTypeParameterName { - ident_token: IDENT@395..396 "T" [] [], + ident_token: IDENT@336..337 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@396..397 ">" [] [], + r_angle_token: R_ANGLE@337..338 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@397..398 "(" [] [], + l_paren_token: L_PAREN@338..339 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@398..400 ")" [] [Whitespace(" ")], + r_paren_token: R_PAREN@339..341 ")" [] [Whitespace(" ")], }, return_type_annotation: missing (optional), body: JsFunctionBody { - l_curly_token: L_CURLY@400..401 "{" [] [], + l_curly_token: L_CURLY@341..342 "{" [] [], directives: JsDirectiveList [], statements: JsStatementList [], - r_curly_token: R_CURLY@401..402 "}" [] [], + r_curly_token: R_CURLY@342..343 "}" [] [], }, }, }, @@ -544,328 +478,328 @@ JsModule { }, JsClassDeclaration { abstract_token: missing (optional), - class_token: CLASS_KW@402..410 "class" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + class_token: CLASS_KW@343..350 "class" [Newline("\n")] [Whitespace(" ")], id: JsIdentifierBinding { - name_token: IDENT@410..414 "Foo" [] [Whitespace(" ")], + name_token: IDENT@350..354 "Foo" [] [Whitespace(" ")], }, type_parameters: missing (optional), extends_clause: missing (optional), implements_clause: missing (optional), - l_curly_token: L_CURLY@414..416 "{" [] [Whitespace(" ")], + l_curly_token: L_CURLY@354..356 "{" [] [Whitespace(" ")], members: JsClassMemberList [ JsMethodClassMember { modifiers: JsMethodModifierList [], async_token: missing (optional), star_token: missing (optional), name: JsLiteralMemberName { - value: IDENT@416..419 "foo" [] [], + value: IDENT@356..359 "foo" [] [], }, question_mark_token: missing (optional), type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@419..420 "<" [] [], + l_angle_token: L_ANGLE@359..360 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - in_modifier_token: IN_KW@420..423 "in" [] [Whitespace(" ")], + in_modifier_token: IN_KW@360..363 "in" [] [Whitespace(" ")], out_modifier_token: missing (optional), name: TsTypeParameterName { - ident_token: IDENT@423..424 "T" [] [], + ident_token: IDENT@363..364 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@424..425 ">" [] [], + r_angle_token: R_ANGLE@364..365 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@425..426 "(" [] [], + l_paren_token: L_PAREN@365..366 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@426..427 ")" [] [], + r_paren_token: R_PAREN@366..367 ")" [] [], }, return_type_annotation: TsReturnTypeAnnotation { - colon_token: COLON@427..429 ":" [] [Whitespace(" ")], + colon_token: COLON@367..369 ":" [] [Whitespace(" ")], ty: TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@429..431 "T" [] [Whitespace(" ")], + value_token: IDENT@369..371 "T" [] [Whitespace(" ")], }, type_arguments: missing (optional), }, }, body: JsFunctionBody { - l_curly_token: L_CURLY@431..432 "{" [] [], + l_curly_token: L_CURLY@371..372 "{" [] [], directives: JsDirectiveList [], statements: JsStatementList [], - r_curly_token: R_CURLY@432..434 "}" [] [Whitespace(" ")], + r_curly_token: R_CURLY@372..374 "}" [] [Whitespace(" ")], }, }, ], - r_curly_token: R_CURLY@434..435 "}" [] [], + r_curly_token: R_CURLY@374..375 "}" [] [], }, JsClassDeclaration { abstract_token: missing (optional), - class_token: CLASS_KW@435..443 "class" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + class_token: CLASS_KW@375..382 "class" [Newline("\n")] [Whitespace(" ")], id: JsIdentifierBinding { - name_token: IDENT@443..447 "Foo" [] [Whitespace(" ")], + name_token: IDENT@382..386 "Foo" [] [Whitespace(" ")], }, type_parameters: missing (optional), extends_clause: missing (optional), implements_clause: missing (optional), - l_curly_token: L_CURLY@447..449 "{" [] [Whitespace(" ")], + l_curly_token: L_CURLY@386..388 "{" [] [Whitespace(" ")], members: JsClassMemberList [ JsMethodClassMember { modifiers: JsMethodModifierList [], async_token: missing (optional), star_token: missing (optional), name: JsLiteralMemberName { - value: IDENT@449..452 "foo" [] [], + value: IDENT@388..391 "foo" [] [], }, question_mark_token: missing (optional), type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@452..453 "<" [] [], + l_angle_token: L_ANGLE@391..392 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: OUT_KW@453..457 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@392..396 "out" [] [Whitespace(" ")], name: TsTypeParameterName { - ident_token: IDENT@457..458 "T" [] [], + ident_token: IDENT@396..397 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@458..459 ">" [] [], + r_angle_token: R_ANGLE@397..398 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@459..460 "(" [] [], + l_paren_token: L_PAREN@398..399 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@460..461 ")" [] [], + r_paren_token: R_PAREN@399..400 ")" [] [], }, return_type_annotation: TsReturnTypeAnnotation { - colon_token: COLON@461..463 ":" [] [Whitespace(" ")], + colon_token: COLON@400..402 ":" [] [Whitespace(" ")], ty: TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@463..465 "T" [] [Whitespace(" ")], + value_token: IDENT@402..404 "T" [] [Whitespace(" ")], }, type_arguments: missing (optional), }, }, body: JsFunctionBody { - l_curly_token: L_CURLY@465..466 "{" [] [], + l_curly_token: L_CURLY@404..405 "{" [] [], directives: JsDirectiveList [], statements: JsStatementList [], - r_curly_token: R_CURLY@466..468 "}" [] [Whitespace(" ")], + r_curly_token: R_CURLY@405..407 "}" [] [Whitespace(" ")], }, }, ], - r_curly_token: R_CURLY@468..469 "}" [] [], + r_curly_token: R_CURLY@407..408 "}" [] [], }, JsExpressionStatement { expression: JsAssignmentExpression { left: JsIdentifierAssignment { - name_token: IDENT@469..475 "foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + name_token: IDENT@408..413 "foo" [Newline("\n")] [Whitespace(" ")], }, - operator_token: EQ@475..477 "=" [] [Whitespace(" ")], + operator_token: EQ@413..415 "=" [] [Whitespace(" ")], right: JsObjectExpression { - l_curly_token: L_CURLY@477..479 "{" [] [Whitespace(" ")], + l_curly_token: L_CURLY@415..417 "{" [] [Whitespace(" ")], members: JsObjectMemberList [ JsMethodObjectMember { async_token: missing (optional), star_token: missing (optional), name: JsLiteralMemberName { - value: IDENT@479..482 "foo" [] [], + value: IDENT@417..420 "foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@482..483 "<" [] [], + l_angle_token: L_ANGLE@420..421 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - in_modifier_token: IN_KW@483..486 "in" [] [Whitespace(" ")], + in_modifier_token: IN_KW@421..424 "in" [] [Whitespace(" ")], out_modifier_token: missing (optional), name: TsTypeParameterName { - ident_token: IDENT@486..487 "T" [] [], + ident_token: IDENT@424..425 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@487..488 ">" [] [], + r_angle_token: R_ANGLE@425..426 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@488..489 "(" [] [], + l_paren_token: L_PAREN@426..427 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@489..490 ")" [] [], + r_paren_token: R_PAREN@427..428 ")" [] [], }, return_type_annotation: TsReturnTypeAnnotation { - colon_token: COLON@490..492 ":" [] [Whitespace(" ")], + colon_token: COLON@428..430 ":" [] [Whitespace(" ")], ty: TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@492..494 "T" [] [Whitespace(" ")], + value_token: IDENT@430..432 "T" [] [Whitespace(" ")], }, type_arguments: missing (optional), }, }, body: JsFunctionBody { - l_curly_token: L_CURLY@494..495 "{" [] [], + l_curly_token: L_CURLY@432..433 "{" [] [], directives: JsDirectiveList [], statements: JsStatementList [], - r_curly_token: R_CURLY@495..497 "}" [] [Whitespace(" ")], + r_curly_token: R_CURLY@433..435 "}" [] [Whitespace(" ")], }, }, ], - r_curly_token: R_CURLY@497..498 "}" [] [], + r_curly_token: R_CURLY@435..436 "}" [] [], }, }, - semicolon_token: SEMICOLON@498..499 ";" [] [], + semicolon_token: SEMICOLON@436..437 ";" [] [], }, JsExpressionStatement { expression: JsAssignmentExpression { left: JsIdentifierAssignment { - name_token: IDENT@499..505 "foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + name_token: IDENT@437..442 "foo" [Newline("\n")] [Whitespace(" ")], }, - operator_token: EQ@505..507 "=" [] [Whitespace(" ")], + operator_token: EQ@442..444 "=" [] [Whitespace(" ")], right: JsObjectExpression { - l_curly_token: L_CURLY@507..509 "{" [] [Whitespace(" ")], + l_curly_token: L_CURLY@444..446 "{" [] [Whitespace(" ")], members: JsObjectMemberList [ JsMethodObjectMember { async_token: missing (optional), star_token: missing (optional), name: JsLiteralMemberName { - value: IDENT@509..512 "foo" [] [], + value: IDENT@446..449 "foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@512..513 "<" [] [], + l_angle_token: L_ANGLE@449..450 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: OUT_KW@513..517 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@450..454 "out" [] [Whitespace(" ")], name: TsTypeParameterName { - ident_token: IDENT@517..518 "T" [] [], + ident_token: IDENT@454..455 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@518..519 ">" [] [], + r_angle_token: R_ANGLE@455..456 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@519..520 "(" [] [], + l_paren_token: L_PAREN@456..457 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@520..521 ")" [] [], + r_paren_token: R_PAREN@457..458 ")" [] [], }, return_type_annotation: TsReturnTypeAnnotation { - colon_token: COLON@521..523 ":" [] [Whitespace(" ")], + colon_token: COLON@458..460 ":" [] [Whitespace(" ")], ty: TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@523..525 "T" [] [Whitespace(" ")], + value_token: IDENT@460..462 "T" [] [Whitespace(" ")], }, type_arguments: missing (optional), }, }, body: JsFunctionBody { - l_curly_token: L_CURLY@525..526 "{" [] [], + l_curly_token: L_CURLY@462..463 "{" [] [], directives: JsDirectiveList [], statements: JsStatementList [], - r_curly_token: R_CURLY@526..528 "}" [] [Whitespace(" ")], + r_curly_token: R_CURLY@463..465 "}" [] [Whitespace(" ")], }, }, ], - r_curly_token: R_CURLY@528..529 "}" [] [], + r_curly_token: R_CURLY@465..466 "}" [] [], }, }, - semicolon_token: SEMICOLON@529..530 ";" [] [], + semicolon_token: SEMICOLON@466..467 ";" [] [], }, JsExpressionStatement { expression: JsBinaryExpression { left: TsTypeAssertionExpression { - l_angle_token: L_ANGLE@530..533 "<" [Newline("\n"), Whitespace("\t")] [], + l_angle_token: L_ANGLE@467..469 "<" [Newline("\n")] [], ty: TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@533..536 "in" [] [Whitespace(" ")], + value_token: IDENT@469..472 "in" [] [Whitespace(" ")], }, type_arguments: missing (optional), }, r_angle_token: missing (required), expression: JsIdentifierExpression { name: JsReferenceIdentifier { - value_token: IDENT@536..537 "T" [] [], + value_token: IDENT@472..473 "T" [] [], }, }, }, - operator_token: R_ANGLE@537..538 ">" [] [], + operator_token: R_ANGLE@473..474 ">" [] [], right: JsParenthesizedExpression { - l_paren_token: L_PAREN@538..539 "(" [] [], + l_paren_token: L_PAREN@474..475 "(" [] [], expression: missing (required), - r_paren_token: R_PAREN@539..541 ")" [] [Whitespace(" ")], + r_paren_token: R_PAREN@475..477 ")" [] [Whitespace(" ")], }, }, semicolon_token: missing (optional), }, JsBogusStatement { items: [ - FAT_ARROW@541..544 "=>" [] [Whitespace(" ")], + FAT_ARROW@477..480 "=>" [] [Whitespace(" ")], ], }, JsBlockStatement { - l_curly_token: L_CURLY@544..545 "{" [] [], + l_curly_token: L_CURLY@480..481 "{" [] [], statements: JsStatementList [], - r_curly_token: R_CURLY@545..546 "}" [] [], + r_curly_token: R_CURLY@481..482 "}" [] [], }, JsEmptyStatement { - semicolon_token: SEMICOLON@546..547 ";" [] [], + semicolon_token: SEMICOLON@482..483 ";" [] [], }, JsExpressionStatement { expression: JsArrowFunctionExpression { async_token: missing (optional), type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@547..550 "<" [Newline("\n"), Whitespace("\t")] [], + l_angle_token: L_ANGLE@483..485 "<" [Newline("\n")] [], items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: OUT_KW@550..554 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@485..489 "out" [] [Whitespace(" ")], name: TsTypeParameterName { - ident_token: IDENT@554..555 "T" [] [], + ident_token: IDENT@489..490 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@555..556 ">" [] [], + r_angle_token: R_ANGLE@490..491 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@556..557 "(" [] [], + l_paren_token: L_PAREN@491..492 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@557..559 ")" [] [Whitespace(" ")], + r_paren_token: R_PAREN@492..494 ")" [] [Whitespace(" ")], }, return_type_annotation: missing (optional), - fat_arrow_token: FAT_ARROW@559..562 "=>" [] [Whitespace(" ")], + fat_arrow_token: FAT_ARROW@494..497 "=>" [] [Whitespace(" ")], body: JsFunctionBody { - l_curly_token: L_CURLY@562..563 "{" [] [], + l_curly_token: L_CURLY@497..498 "{" [] [], directives: JsDirectiveList [], statements: JsStatementList [], - r_curly_token: R_CURLY@563..564 "}" [] [], + r_curly_token: R_CURLY@498..499 "}" [] [], }, }, - semicolon_token: SEMICOLON@564..565 ";" [] [], + semicolon_token: SEMICOLON@499..500 ";" [] [], }, JsExpressionStatement { expression: JsSequenceExpression { left: TsTypeAssertionExpression { - l_angle_token: L_ANGLE@565..568 "<" [Newline("\n"), Whitespace("\t")] [], + l_angle_token: L_ANGLE@500..502 "<" [Newline("\n")] [], ty: TsReferenceType { name: JsReferenceIdentifier { - value_token: IDENT@568..571 "in" [] [Whitespace(" ")], + value_token: IDENT@502..505 "in" [] [Whitespace(" ")], }, type_arguments: missing (optional), }, r_angle_token: missing (required), expression: JsIdentifierExpression { name: JsReferenceIdentifier { - value_token: IDENT@571..572 "T" [] [], + value_token: IDENT@505..506 "T" [] [], }, }, }, - comma_token: COMMA@572..574 "," [] [Whitespace(" ")], + comma_token: COMMA@506..508 "," [] [Whitespace(" ")], right: JsIdentifierExpression { name: JsReferenceIdentifier { - value_token: IDENT@574..578 "out" [] [Whitespace(" ")], + value_token: IDENT@508..512 "out" [] [Whitespace(" ")], }, }, }, @@ -875,67 +809,67 @@ JsModule { expression: JsBinaryExpression { left: JsIdentifierExpression { name: JsReferenceIdentifier { - value_token: IDENT@578..579 "T" [] [], + value_token: IDENT@512..513 "T" [] [], }, }, - operator_token: R_ANGLE@579..580 ">" [] [], + operator_token: R_ANGLE@513..514 ">" [] [], right: JsParenthesizedExpression { - l_paren_token: L_PAREN@580..581 "(" [] [], + l_paren_token: L_PAREN@514..515 "(" [] [], expression: missing (required), - r_paren_token: R_PAREN@581..583 ")" [] [Whitespace(" ")], + r_paren_token: R_PAREN@515..517 ")" [] [Whitespace(" ")], }, }, semicolon_token: missing (optional), }, JsBogusStatement { items: [ - FAT_ARROW@583..586 "=>" [] [Whitespace(" ")], + FAT_ARROW@517..520 "=>" [] [Whitespace(" ")], ], }, JsBlockStatement { - l_curly_token: L_CURLY@586..587 "{" [] [], + l_curly_token: L_CURLY@520..521 "{" [] [], statements: JsStatementList [], - r_curly_token: R_CURLY@587..588 "}" [] [], + r_curly_token: R_CURLY@521..522 "}" [] [], }, JsEmptyStatement { - semicolon_token: SEMICOLON@588..589 ";" [] [], + semicolon_token: SEMICOLON@522..523 ";" [] [], }, JsVariableStatement { declaration: JsVariableDeclaration { - kind: LET_KW@589..595 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + kind: LET_KW@523..528 "let" [Newline("\n")] [Whitespace(" ")], declarators: JsVariableDeclaratorList [ JsVariableDeclarator { id: JsIdentifierBinding { - name_token: IDENT@595..596 "x" [] [], + name_token: IDENT@528..529 "x" [] [], }, variable_annotation: TsTypeAnnotation { - colon_token: COLON@596..598 ":" [] [Whitespace(" ")], + colon_token: COLON@529..531 ":" [] [Whitespace(" ")], ty: TsFunctionType { type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@598..599 "<" [] [], + l_angle_token: L_ANGLE@531..532 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - in_modifier_token: IN_KW@599..602 "in" [] [Whitespace(" ")], + in_modifier_token: IN_KW@532..535 "in" [] [Whitespace(" ")], out_modifier_token: missing (optional), name: TsTypeParameterName { - ident_token: IDENT@602..603 "T" [] [], + ident_token: IDENT@535..536 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@603..604 ">" [] [], + r_angle_token: R_ANGLE@536..537 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@604..605 "(" [] [], + l_paren_token: L_PAREN@537..538 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@605..607 ")" [] [Whitespace(" ")], + r_paren_token: R_PAREN@538..540 ")" [] [Whitespace(" ")], }, - fat_arrow_token: FAT_ARROW@607..610 "=>" [] [Whitespace(" ")], + fat_arrow_token: FAT_ARROW@540..543 "=>" [] [Whitespace(" ")], return_type: TsObjectType { - l_curly_token: L_CURLY@610..611 "{" [] [], + l_curly_token: L_CURLY@543..544 "{" [] [], members: TsTypeMemberList [], - r_curly_token: R_CURLY@611..612 "}" [] [], + r_curly_token: R_CURLY@544..545 "}" [] [], }, }, }, @@ -943,44 +877,44 @@ JsModule { }, ], }, - semicolon_token: SEMICOLON@612..613 ";" [] [], + semicolon_token: SEMICOLON@545..546 ";" [] [], }, JsVariableStatement { declaration: JsVariableDeclaration { - kind: LET_KW@613..619 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + kind: LET_KW@546..551 "let" [Newline("\n")] [Whitespace(" ")], declarators: JsVariableDeclaratorList [ JsVariableDeclarator { id: JsIdentifierBinding { - name_token: IDENT@619..620 "x" [] [], + name_token: IDENT@551..552 "x" [] [], }, variable_annotation: TsTypeAnnotation { - colon_token: COLON@620..622 ":" [] [Whitespace(" ")], + colon_token: COLON@552..554 ":" [] [Whitespace(" ")], ty: TsFunctionType { type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@622..623 "<" [] [], + l_angle_token: L_ANGLE@554..555 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: OUT_KW@623..627 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@555..559 "out" [] [Whitespace(" ")], name: TsTypeParameterName { - ident_token: IDENT@627..628 "T" [] [], + ident_token: IDENT@559..560 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@628..629 ">" [] [], + r_angle_token: R_ANGLE@560..561 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@629..630 "(" [] [], + l_paren_token: L_PAREN@561..562 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@630..632 ")" [] [Whitespace(" ")], + r_paren_token: R_PAREN@562..564 ")" [] [Whitespace(" ")], }, - fat_arrow_token: FAT_ARROW@632..635 "=>" [] [Whitespace(" ")], + fat_arrow_token: FAT_ARROW@564..567 "=>" [] [Whitespace(" ")], return_type: TsObjectType { - l_curly_token: L_CURLY@635..636 "{" [] [], + l_curly_token: L_CURLY@567..568 "{" [] [], members: TsTypeMemberList [], - r_curly_token: R_CURLY@636..637 "}" [] [], + r_curly_token: R_CURLY@568..569 "}" [] [], }, }, }, @@ -988,54 +922,54 @@ JsModule { }, ], }, - semicolon_token: SEMICOLON@637..638 ";" [] [], + semicolon_token: SEMICOLON@569..570 ";" [] [], }, JsVariableStatement { declaration: JsVariableDeclaration { - kind: LET_KW@638..644 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + kind: LET_KW@570..575 "let" [Newline("\n")] [Whitespace(" ")], declarators: JsVariableDeclaratorList [ JsVariableDeclarator { id: JsIdentifierBinding { - name_token: IDENT@644..645 "x" [] [], + name_token: IDENT@575..576 "x" [] [], }, variable_annotation: TsTypeAnnotation { - colon_token: COLON@645..647 ":" [] [Whitespace(" ")], + colon_token: COLON@576..578 ":" [] [Whitespace(" ")], ty: TsFunctionType { type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@647..648 "<" [] [], + l_angle_token: L_ANGLE@578..579 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - in_modifier_token: IN_KW@648..651 "in" [] [Whitespace(" ")], + in_modifier_token: IN_KW@579..582 "in" [] [Whitespace(" ")], out_modifier_token: missing (optional), name: TsTypeParameterName { - ident_token: IDENT@651..652 "T" [] [], + ident_token: IDENT@582..583 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, - COMMA@652..654 "," [] [Whitespace(" ")], + COMMA@583..585 "," [] [Whitespace(" ")], TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: OUT_KW@654..658 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@585..589 "out" [] [Whitespace(" ")], name: TsTypeParameterName { - ident_token: IDENT@658..659 "T" [] [], + ident_token: IDENT@589..590 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@659..660 ">" [] [], + r_angle_token: R_ANGLE@590..591 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@660..661 "(" [] [], + l_paren_token: L_PAREN@591..592 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@661..663 ")" [] [Whitespace(" ")], + r_paren_token: R_PAREN@592..594 ")" [] [Whitespace(" ")], }, - fat_arrow_token: FAT_ARROW@663..666 "=>" [] [Whitespace(" ")], + fat_arrow_token: FAT_ARROW@594..597 "=>" [] [Whitespace(" ")], return_type: TsObjectType { - l_curly_token: L_CURLY@666..667 "{" [] [], + l_curly_token: L_CURLY@597..598 "{" [] [], members: TsTypeMemberList [], - r_curly_token: R_CURLY@667..668 "}" [] [], + r_curly_token: R_CURLY@598..599 "}" [] [], }, }, }, @@ -1043,46 +977,46 @@ JsModule { }, ], }, - semicolon_token: SEMICOLON@668..669 ";" [] [], + semicolon_token: SEMICOLON@599..600 ";" [] [], }, JsVariableStatement { declaration: JsVariableDeclaration { - kind: LET_KW@669..675 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + kind: LET_KW@600..605 "let" [Newline("\n")] [Whitespace(" ")], declarators: JsVariableDeclaratorList [ JsVariableDeclarator { id: JsIdentifierBinding { - name_token: IDENT@675..676 "x" [] [], + name_token: IDENT@605..606 "x" [] [], }, variable_annotation: TsTypeAnnotation { - colon_token: COLON@676..678 ":" [] [Whitespace(" ")], + colon_token: COLON@606..608 ":" [] [Whitespace(" ")], ty: TsConstructorType { abstract_token: missing (optional), - new_token: NEW_KW@678..682 "new" [] [Whitespace(" ")], + new_token: NEW_KW@608..612 "new" [] [Whitespace(" ")], type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@682..683 "<" [] [], + l_angle_token: L_ANGLE@612..613 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - in_modifier_token: IN_KW@683..686 "in" [] [Whitespace(" ")], + in_modifier_token: IN_KW@613..616 "in" [] [Whitespace(" ")], out_modifier_token: missing (optional), name: TsTypeParameterName { - ident_token: IDENT@686..687 "T" [] [], + ident_token: IDENT@616..617 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@687..688 ">" [] [], + r_angle_token: R_ANGLE@617..618 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@688..689 "(" [] [], + l_paren_token: L_PAREN@618..619 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@689..691 ")" [] [Whitespace(" ")], + r_paren_token: R_PAREN@619..621 ")" [] [Whitespace(" ")], }, - fat_arrow_token: FAT_ARROW@691..694 "=>" [] [Whitespace(" ")], + fat_arrow_token: FAT_ARROW@621..624 "=>" [] [Whitespace(" ")], return_type: TsObjectType { - l_curly_token: L_CURLY@694..695 "{" [] [], + l_curly_token: L_CURLY@624..625 "{" [] [], members: TsTypeMemberList [], - r_curly_token: R_CURLY@695..696 "}" [] [], + r_curly_token: R_CURLY@625..626 "}" [] [], }, }, }, @@ -1090,46 +1024,46 @@ JsModule { }, ], }, - semicolon_token: SEMICOLON@696..697 ";" [] [], + semicolon_token: SEMICOLON@626..627 ";" [] [], }, JsVariableStatement { declaration: JsVariableDeclaration { - kind: LET_KW@697..703 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + kind: LET_KW@627..632 "let" [Newline("\n")] [Whitespace(" ")], declarators: JsVariableDeclaratorList [ JsVariableDeclarator { id: JsIdentifierBinding { - name_token: IDENT@703..704 "x" [] [], + name_token: IDENT@632..633 "x" [] [], }, variable_annotation: TsTypeAnnotation { - colon_token: COLON@704..706 ":" [] [Whitespace(" ")], + colon_token: COLON@633..635 ":" [] [Whitespace(" ")], ty: TsConstructorType { abstract_token: missing (optional), - new_token: NEW_KW@706..710 "new" [] [Whitespace(" ")], + new_token: NEW_KW@635..639 "new" [] [Whitespace(" ")], type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@710..711 "<" [] [], + l_angle_token: L_ANGLE@639..640 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: OUT_KW@711..715 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@640..644 "out" [] [Whitespace(" ")], name: TsTypeParameterName { - ident_token: IDENT@715..716 "T" [] [], + ident_token: IDENT@644..645 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@716..717 ">" [] [], + r_angle_token: R_ANGLE@645..646 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@717..718 "(" [] [], + l_paren_token: L_PAREN@646..647 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@718..720 ")" [] [Whitespace(" ")], + r_paren_token: R_PAREN@647..649 ")" [] [Whitespace(" ")], }, - fat_arrow_token: FAT_ARROW@720..723 "=>" [] [Whitespace(" ")], + fat_arrow_token: FAT_ARROW@649..652 "=>" [] [Whitespace(" ")], return_type: TsObjectType { - l_curly_token: L_CURLY@723..724 "{" [] [], + l_curly_token: L_CURLY@652..653 "{" [] [], members: TsTypeMemberList [], - r_curly_token: R_CURLY@724..725 "}" [] [], + r_curly_token: R_CURLY@653..654 "}" [] [], }, }, }, @@ -1137,56 +1071,56 @@ JsModule { }, ], }, - semicolon_token: SEMICOLON@725..726 ";" [] [], + semicolon_token: SEMICOLON@654..655 ";" [] [], }, JsVariableStatement { declaration: JsVariableDeclaration { - kind: LET_KW@726..732 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + kind: LET_KW@655..660 "let" [Newline("\n")] [Whitespace(" ")], declarators: JsVariableDeclaratorList [ JsVariableDeclarator { id: JsIdentifierBinding { - name_token: IDENT@732..733 "x" [] [], + name_token: IDENT@660..661 "x" [] [], }, variable_annotation: TsTypeAnnotation { - colon_token: COLON@733..735 ":" [] [Whitespace(" ")], + colon_token: COLON@661..663 ":" [] [Whitespace(" ")], ty: TsConstructorType { abstract_token: missing (optional), - new_token: NEW_KW@735..739 "new" [] [Whitespace(" ")], + new_token: NEW_KW@663..667 "new" [] [Whitespace(" ")], type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@739..740 "<" [] [], + l_angle_token: L_ANGLE@667..668 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - in_modifier_token: IN_KW@740..743 "in" [] [Whitespace(" ")], + in_modifier_token: IN_KW@668..671 "in" [] [Whitespace(" ")], out_modifier_token: missing (optional), name: TsTypeParameterName { - ident_token: IDENT@743..744 "T" [] [], + ident_token: IDENT@671..672 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, - COMMA@744..746 "," [] [Whitespace(" ")], + COMMA@672..674 "," [] [Whitespace(" ")], TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: OUT_KW@746..750 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@674..678 "out" [] [Whitespace(" ")], name: TsTypeParameterName { - ident_token: IDENT@750..751 "T" [] [], + ident_token: IDENT@678..679 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@751..752 ">" [] [], + r_angle_token: R_ANGLE@679..680 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@752..753 "(" [] [], + l_paren_token: L_PAREN@680..681 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@753..755 ")" [] [Whitespace(" ")], + r_paren_token: R_PAREN@681..683 ")" [] [Whitespace(" ")], }, - fat_arrow_token: FAT_ARROW@755..758 "=>" [] [Whitespace(" ")], + fat_arrow_token: FAT_ARROW@683..686 "=>" [] [Whitespace(" ")], return_type: TsObjectType { - l_curly_token: L_CURLY@758..759 "{" [] [], + l_curly_token: L_CURLY@686..687 "{" [] [], members: TsTypeMemberList [], - r_curly_token: R_CURLY@759..760 "}" [] [], + r_curly_token: R_CURLY@687..688 "}" [] [], }, }, }, @@ -1194,1710 +1128,1658 @@ JsModule { }, ], }, - semicolon_token: SEMICOLON@760..761 ";" [] [], + semicolon_token: SEMICOLON@688..689 ";" [] [], }, JsVariableStatement { declaration: JsVariableDeclaration { - kind: LET_KW@761..767 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + kind: LET_KW@689..694 "let" [Newline("\n")] [Whitespace(" ")], declarators: JsVariableDeclaratorList [ JsVariableDeclarator { id: JsIdentifierBinding { - name_token: IDENT@767..768 "x" [] [], + name_token: IDENT@694..695 "x" [] [], }, variable_annotation: TsTypeAnnotation { - colon_token: COLON@768..770 ":" [] [Whitespace(" ")], + colon_token: COLON@695..697 ":" [] [Whitespace(" ")], ty: TsObjectType { - l_curly_token: L_CURLY@770..772 "{" [] [Whitespace(" ")], + l_curly_token: L_CURLY@697..699 "{" [] [Whitespace(" ")], members: TsTypeMemberList [ TsMethodSignatureTypeMember { name: JsLiteralMemberName { - value: IDENT@772..773 "y" [] [], + value: IDENT@699..700 "y" [] [], }, optional_token: missing (optional), type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@773..774 "<" [] [], + l_angle_token: L_ANGLE@700..701 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - in_modifier_token: IN_KW@774..777 "in" [] [Whitespace(" ")], + in_modifier_token: IN_KW@701..704 "in" [] [Whitespace(" ")], out_modifier_token: missing (optional), name: TsTypeParameterName { - ident_token: IDENT@777..778 "T" [] [], + ident_token: IDENT@704..705 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@778..779 ">" [] [], + r_angle_token: R_ANGLE@705..706 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@779..780 "(" [] [], + l_paren_token: L_PAREN@706..707 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@780..781 ")" [] [], + r_paren_token: R_PAREN@707..708 ")" [] [], }, return_type_annotation: TsReturnTypeAnnotation { - colon_token: COLON@781..783 ":" [] [Whitespace(" ")], + colon_token: COLON@708..710 ":" [] [Whitespace(" ")], ty: TsAnyType { - any_token: ANY_KW@783..787 "any" [] [Whitespace(" ")], + any_token: ANY_KW@710..714 "any" [] [Whitespace(" ")], }, }, separator_token: missing (optional), }, ], - r_curly_token: R_CURLY@787..788 "}" [] [], + r_curly_token: R_CURLY@714..715 "}" [] [], }, }, initializer: missing (optional), }, ], }, - semicolon_token: SEMICOLON@788..789 ";" [] [], + semicolon_token: SEMICOLON@715..716 ";" [] [], }, JsVariableStatement { declaration: JsVariableDeclaration { - kind: LET_KW@789..795 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + kind: LET_KW@716..721 "let" [Newline("\n")] [Whitespace(" ")], declarators: JsVariableDeclaratorList [ JsVariableDeclarator { id: JsIdentifierBinding { - name_token: IDENT@795..796 "x" [] [], + name_token: IDENT@721..722 "x" [] [], }, variable_annotation: TsTypeAnnotation { - colon_token: COLON@796..798 ":" [] [Whitespace(" ")], + colon_token: COLON@722..724 ":" [] [Whitespace(" ")], ty: TsObjectType { - l_curly_token: L_CURLY@798..800 "{" [] [Whitespace(" ")], + l_curly_token: L_CURLY@724..726 "{" [] [Whitespace(" ")], members: TsTypeMemberList [ TsMethodSignatureTypeMember { name: JsLiteralMemberName { - value: IDENT@800..801 "y" [] [], + value: IDENT@726..727 "y" [] [], }, optional_token: missing (optional), type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@801..802 "<" [] [], + l_angle_token: L_ANGLE@727..728 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: OUT_KW@802..806 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@728..732 "out" [] [Whitespace(" ")], name: TsTypeParameterName { - ident_token: IDENT@806..807 "T" [] [], + ident_token: IDENT@732..733 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@807..808 ">" [] [], + r_angle_token: R_ANGLE@733..734 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@808..809 "(" [] [], + l_paren_token: L_PAREN@734..735 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@809..810 ")" [] [], + r_paren_token: R_PAREN@735..736 ")" [] [], }, return_type_annotation: TsReturnTypeAnnotation { - colon_token: COLON@810..812 ":" [] [Whitespace(" ")], + colon_token: COLON@736..738 ":" [] [Whitespace(" ")], ty: TsAnyType { - any_token: ANY_KW@812..816 "any" [] [Whitespace(" ")], + any_token: ANY_KW@738..742 "any" [] [Whitespace(" ")], }, }, separator_token: missing (optional), }, ], - r_curly_token: R_CURLY@816..817 "}" [] [], + r_curly_token: R_CURLY@742..743 "}" [] [], }, }, initializer: missing (optional), }, ], }, - semicolon_token: SEMICOLON@817..818 ";" [] [], + semicolon_token: SEMICOLON@743..744 ";" [] [], }, JsVariableStatement { declaration: JsVariableDeclaration { - kind: LET_KW@818..824 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + kind: LET_KW@744..749 "let" [Newline("\n")] [Whitespace(" ")], declarators: JsVariableDeclaratorList [ JsVariableDeclarator { id: JsIdentifierBinding { - name_token: IDENT@824..825 "x" [] [], + name_token: IDENT@749..750 "x" [] [], }, variable_annotation: TsTypeAnnotation { - colon_token: COLON@825..827 ":" [] [Whitespace(" ")], + colon_token: COLON@750..752 ":" [] [Whitespace(" ")], ty: TsObjectType { - l_curly_token: L_CURLY@827..829 "{" [] [Whitespace(" ")], + l_curly_token: L_CURLY@752..754 "{" [] [Whitespace(" ")], members: TsTypeMemberList [ TsMethodSignatureTypeMember { name: JsLiteralMemberName { - value: IDENT@829..830 "y" [] [], + value: IDENT@754..755 "y" [] [], }, optional_token: missing (optional), type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@830..831 "<" [] [], + l_angle_token: L_ANGLE@755..756 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - in_modifier_token: IN_KW@831..834 "in" [] [Whitespace(" ")], + in_modifier_token: IN_KW@756..759 "in" [] [Whitespace(" ")], out_modifier_token: missing (optional), name: TsTypeParameterName { - ident_token: IDENT@834..835 "T" [] [], + ident_token: IDENT@759..760 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, - COMMA@835..837 "," [] [Whitespace(" ")], + COMMA@760..762 "," [] [Whitespace(" ")], TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: OUT_KW@837..841 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@762..766 "out" [] [Whitespace(" ")], name: TsTypeParameterName { - ident_token: IDENT@841..842 "T" [] [], + ident_token: IDENT@766..767 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@842..843 ">" [] [], + r_angle_token: R_ANGLE@767..768 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@843..844 "(" [] [], + l_paren_token: L_PAREN@768..769 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@844..845 ")" [] [], + r_paren_token: R_PAREN@769..770 ")" [] [], }, return_type_annotation: TsReturnTypeAnnotation { - colon_token: COLON@845..847 ":" [] [Whitespace(" ")], + colon_token: COLON@770..772 ":" [] [Whitespace(" ")], ty: TsAnyType { - any_token: ANY_KW@847..851 "any" [] [Whitespace(" ")], + any_token: ANY_KW@772..776 "any" [] [Whitespace(" ")], }, }, separator_token: missing (optional), }, ], - r_curly_token: R_CURLY@851..852 "}" [] [], + r_curly_token: R_CURLY@776..777 "}" [] [], }, }, initializer: missing (optional), }, ], }, - semicolon_token: SEMICOLON@852..853 ";" [] [], + semicolon_token: SEMICOLON@777..778 ";" [] [], }, ], - eof_token: EOF@853..854 "" [Newline("\n")] [], + eof_token: EOF@778..779 "" [Newline("\n")] [], } -0: JS_MODULE@0..854 +0: JS_MODULE@0..779 0: (empty) 1: JS_DIRECTIVE_LIST@0..0 - 2: JS_MODULE_ITEM_LIST@0..853 - 0: JS_EXPORT@0..39 - 0: EXPORT_KW@0..8 "export" [Whitespace("\t")] [Whitespace(" ")] - 1: JS_EXPORT_DEFAULT_DECLARATION_CLAUSE@8..39 - 0: DEFAULT_KW@8..16 "default" [] [Whitespace(" ")] - 1: JS_FUNCTION_EXPORT_DEFAULT_DECLARATION@16..39 + 2: JS_MODULE_ITEM_LIST@0..778 + 0: JS_EXPORT@0..38 + 0: EXPORT_KW@0..7 "export" [] [Whitespace(" ")] + 1: JS_EXPORT_DEFAULT_DECLARATION_CLAUSE@7..38 + 0: DEFAULT_KW@7..15 "default" [] [Whitespace(" ")] + 1: JS_FUNCTION_EXPORT_DEFAULT_DECLARATION@15..38 0: (empty) - 1: FUNCTION_KW@16..25 "function" [] [Whitespace(" ")] + 1: FUNCTION_KW@15..24 "function" [] [Whitespace(" ")] 2: (empty) - 3: JS_IDENTIFIER_BINDING@25..28 - 0: IDENT@25..28 "foo" [] [] - 4: TS_TYPE_PARAMETERS@28..34 - 0: L_ANGLE@28..29 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@29..33 - 0: TS_TYPE_PARAMETER@29..33 - 0: IN_KW@29..32 "in" [] [Whitespace(" ")] + 3: JS_IDENTIFIER_BINDING@24..27 + 0: IDENT@24..27 "foo" [] [] + 4: TS_TYPE_PARAMETERS@27..33 + 0: L_ANGLE@27..28 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@28..32 + 0: TS_TYPE_PARAMETER@28..32 + 0: IN_KW@28..31 "in" [] [Whitespace(" ")] 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@32..33 - 0: IDENT@32..33 "T" [] [] + 2: TS_TYPE_PARAMETER_NAME@31..32 + 0: IDENT@31..32 "T" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@33..34 ">" [] [] - 5: JS_PARAMETERS@34..37 - 0: L_PAREN@34..35 "(" [] [] - 1: JS_PARAMETER_LIST@35..35 - 2: R_PAREN@35..37 ")" [] [Whitespace(" ")] + 2: R_ANGLE@32..33 ">" [] [] + 5: JS_PARAMETERS@33..36 + 0: L_PAREN@33..34 "(" [] [] + 1: JS_PARAMETER_LIST@34..34 + 2: R_PAREN@34..36 ")" [] [Whitespace(" ")] 6: (empty) - 7: JS_FUNCTION_BODY@37..39 - 0: L_CURLY@37..38 "{" [] [] - 1: JS_DIRECTIVE_LIST@38..38 - 2: JS_STATEMENT_LIST@38..38 - 3: R_CURLY@38..39 "}" [] [] + 7: JS_FUNCTION_BODY@36..38 + 0: L_CURLY@36..37 "{" [] [] + 1: JS_DIRECTIVE_LIST@37..37 + 2: JS_STATEMENT_LIST@37..37 + 3: R_CURLY@37..38 "}" [] [] 2: (empty) - 1: JS_EXPORT@39..72 - 0: EXPORT_KW@39..48 "export" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: JS_FUNCTION_DECLARATION@48..72 + 1: JS_EXPORT@38..70 + 0: EXPORT_KW@38..46 "export" [Newline("\n")] [Whitespace(" ")] + 1: JS_FUNCTION_DECLARATION@46..70 0: (empty) - 1: FUNCTION_KW@48..57 "function" [] [Whitespace(" ")] + 1: FUNCTION_KW@46..55 "function" [] [Whitespace(" ")] 2: (empty) - 3: JS_IDENTIFIER_BINDING@57..60 - 0: IDENT@57..60 "foo" [] [] - 4: TS_TYPE_PARAMETERS@60..67 - 0: L_ANGLE@60..61 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@61..66 - 0: TS_TYPE_PARAMETER@61..66 + 3: JS_IDENTIFIER_BINDING@55..58 + 0: IDENT@55..58 "foo" [] [] + 4: TS_TYPE_PARAMETERS@58..65 + 0: L_ANGLE@58..59 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@59..64 + 0: TS_TYPE_PARAMETER@59..64 0: (empty) - 1: OUT_KW@61..65 "out" [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER_NAME@65..66 - 0: IDENT@65..66 "T" [] [] + 1: OUT_KW@59..63 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@63..64 + 0: IDENT@63..64 "T" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@66..67 ">" [] [] - 5: JS_PARAMETERS@67..70 - 0: L_PAREN@67..68 "(" [] [] - 1: JS_PARAMETER_LIST@68..68 - 2: R_PAREN@68..70 ")" [] [Whitespace(" ")] + 2: R_ANGLE@64..65 ">" [] [] + 5: JS_PARAMETERS@65..68 + 0: L_PAREN@65..66 "(" [] [] + 1: JS_PARAMETER_LIST@66..66 + 2: R_PAREN@66..68 ")" [] [Whitespace(" ")] 6: (empty) - 7: JS_FUNCTION_BODY@70..72 - 0: L_CURLY@70..71 "{" [] [] - 1: JS_DIRECTIVE_LIST@71..71 - 2: JS_STATEMENT_LIST@71..71 - 3: R_CURLY@71..72 "}" [] [] - 2: JS_EXPORT@72..105 - 0: EXPORT_KW@72..81 "export" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: JS_FUNCTION_DECLARATION@81..105 + 7: JS_FUNCTION_BODY@68..70 + 0: L_CURLY@68..69 "{" [] [] + 1: JS_DIRECTIVE_LIST@69..69 + 2: JS_STATEMENT_LIST@69..69 + 3: R_CURLY@69..70 "}" [] [] + 2: JS_EXPORT@70..102 + 0: EXPORT_KW@70..78 "export" [Newline("\n")] [Whitespace(" ")] + 1: JS_FUNCTION_DECLARATION@78..102 0: (empty) - 1: FUNCTION_KW@81..90 "function" [] [Whitespace(" ")] + 1: FUNCTION_KW@78..87 "function" [] [Whitespace(" ")] 2: (empty) - 3: JS_IDENTIFIER_BINDING@90..94 - 0: IDENT@90..94 "foo1" [] [] - 4: TS_TYPE_PARAMETERS@94..100 - 0: L_ANGLE@94..95 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@95..99 - 0: TS_TYPE_PARAMETER@95..99 - 0: IN_KW@95..98 "in" [] [Whitespace(" ")] + 3: JS_IDENTIFIER_BINDING@87..91 + 0: IDENT@87..91 "foo1" [] [] + 4: TS_TYPE_PARAMETERS@91..97 + 0: L_ANGLE@91..92 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@92..96 + 0: TS_TYPE_PARAMETER@92..96 + 0: IN_KW@92..95 "in" [] [Whitespace(" ")] 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@98..99 - 0: IDENT@98..99 "T" [] [] + 2: TS_TYPE_PARAMETER_NAME@95..96 + 0: IDENT@95..96 "T" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@99..100 ">" [] [] - 5: JS_PARAMETERS@100..103 - 0: L_PAREN@100..101 "(" [] [] - 1: JS_PARAMETER_LIST@101..101 - 2: R_PAREN@101..103 ")" [] [Whitespace(" ")] + 2: R_ANGLE@96..97 ">" [] [] + 5: JS_PARAMETERS@97..100 + 0: L_PAREN@97..98 "(" [] [] + 1: JS_PARAMETER_LIST@98..98 + 2: R_PAREN@98..100 ")" [] [Whitespace(" ")] 6: (empty) - 7: JS_FUNCTION_BODY@103..105 - 0: L_CURLY@103..104 "{" [] [] - 1: JS_DIRECTIVE_LIST@104..104 - 2: JS_STATEMENT_LIST@104..104 - 3: R_CURLY@104..105 "}" [] [] - 3: JS_EXPORT@105..139 - 0: EXPORT_KW@105..114 "export" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: JS_FUNCTION_DECLARATION@114..139 + 7: JS_FUNCTION_BODY@100..102 + 0: L_CURLY@100..101 "{" [] [] + 1: JS_DIRECTIVE_LIST@101..101 + 2: JS_STATEMENT_LIST@101..101 + 3: R_CURLY@101..102 "}" [] [] + 3: JS_EXPORT@102..135 + 0: EXPORT_KW@102..110 "export" [Newline("\n")] [Whitespace(" ")] + 1: JS_FUNCTION_DECLARATION@110..135 0: (empty) - 1: FUNCTION_KW@114..123 "function" [] [Whitespace(" ")] + 1: FUNCTION_KW@110..119 "function" [] [Whitespace(" ")] 2: (empty) - 3: JS_IDENTIFIER_BINDING@123..127 - 0: IDENT@123..127 "foo2" [] [] - 4: TS_TYPE_PARAMETERS@127..134 - 0: L_ANGLE@127..128 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@128..133 - 0: TS_TYPE_PARAMETER@128..133 + 3: JS_IDENTIFIER_BINDING@119..123 + 0: IDENT@119..123 "foo2" [] [] + 4: TS_TYPE_PARAMETERS@123..130 + 0: L_ANGLE@123..124 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@124..129 + 0: TS_TYPE_PARAMETER@124..129 0: (empty) - 1: OUT_KW@128..132 "out" [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER_NAME@132..133 - 0: IDENT@132..133 "T" [] [] + 1: OUT_KW@124..128 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@128..129 + 0: IDENT@128..129 "T" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@133..134 ">" [] [] - 5: JS_PARAMETERS@134..137 - 0: L_PAREN@134..135 "(" [] [] - 1: JS_PARAMETER_LIST@135..135 - 2: R_PAREN@135..137 ")" [] [Whitespace(" ")] + 2: R_ANGLE@129..130 ">" [] [] + 5: JS_PARAMETERS@130..133 + 0: L_PAREN@130..131 "(" [] [] + 1: JS_PARAMETER_LIST@131..131 + 2: R_PAREN@131..133 ")" [] [Whitespace(" ")] 6: (empty) - 7: JS_FUNCTION_BODY@137..139 - 0: L_CURLY@137..138 "{" [] [] - 1: JS_DIRECTIVE_LIST@138..138 - 2: JS_STATEMENT_LIST@138..138 - 3: R_CURLY@138..139 "}" [] [] - 4: JS_VARIABLE_STATEMENT@139..159 - 0: JS_VARIABLE_DECLARATION@139..159 - 0: LET_KW@139..145 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: JS_VARIABLE_DECLARATOR_LIST@145..159 - 0: JS_VARIABLE_DECLARATOR@145..159 - 0: JS_IDENTIFIER_BINDING@145..148 - 0: IDENT@145..148 "foo" [] [] - 1: TS_TYPE_ANNOTATION@148..159 - 0: COLON@148..150 ":" [] [Whitespace(" ")] - 1: TS_REFERENCE_TYPE@150..159 - 0: JS_REFERENCE_IDENTIFIER@150..153 - 0: IDENT@150..153 "Foo" [] [] - 1: TS_TYPE_ARGUMENTS@153..159 - 0: L_ANGLE@153..154 "<" [] [] - 1: TS_TYPE_ARGUMENT_LIST@154..158 - 0: TS_REFERENCE_TYPE@154..157 - 0: JS_REFERENCE_IDENTIFIER@154..157 - 0: IDENT@154..157 "in" [] [Whitespace(" ")] + 7: JS_FUNCTION_BODY@133..135 + 0: L_CURLY@133..134 "{" [] [] + 1: JS_DIRECTIVE_LIST@134..134 + 2: JS_STATEMENT_LIST@134..134 + 3: R_CURLY@134..135 "}" [] [] + 4: JS_VARIABLE_STATEMENT@135..154 + 0: JS_VARIABLE_DECLARATION@135..154 + 0: LET_KW@135..140 "let" [Newline("\n")] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATOR_LIST@140..154 + 0: JS_VARIABLE_DECLARATOR@140..154 + 0: JS_IDENTIFIER_BINDING@140..143 + 0: IDENT@140..143 "foo" [] [] + 1: TS_TYPE_ANNOTATION@143..154 + 0: COLON@143..145 ":" [] [Whitespace(" ")] + 1: TS_REFERENCE_TYPE@145..154 + 0: JS_REFERENCE_IDENTIFIER@145..148 + 0: IDENT@145..148 "Foo" [] [] + 1: TS_TYPE_ARGUMENTS@148..154 + 0: L_ANGLE@148..149 "<" [] [] + 1: TS_TYPE_ARGUMENT_LIST@149..153 + 0: TS_REFERENCE_TYPE@149..152 + 0: JS_REFERENCE_IDENTIFIER@149..152 + 0: IDENT@149..152 "in" [] [Whitespace(" ")] 1: (empty) 1: (empty) - 2: TS_REFERENCE_TYPE@157..158 - 0: JS_REFERENCE_IDENTIFIER@157..158 - 0: IDENT@157..158 "T" [] [] + 2: TS_REFERENCE_TYPE@152..153 + 0: JS_REFERENCE_IDENTIFIER@152..153 + 0: IDENT@152..153 "T" [] [] 1: (empty) - 2: R_ANGLE@158..159 ">" [] [] + 2: R_ANGLE@153..154 ">" [] [] 2: (empty) 1: (empty) - 5: JS_VARIABLE_STATEMENT@159..180 - 0: JS_VARIABLE_DECLARATION@159..180 - 0: LET_KW@159..165 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: JS_VARIABLE_DECLARATOR_LIST@165..180 - 0: JS_VARIABLE_DECLARATOR@165..180 - 0: JS_IDENTIFIER_BINDING@165..168 - 0: IDENT@165..168 "foo" [] [] - 1: TS_TYPE_ANNOTATION@168..180 - 0: COLON@168..170 ":" [] [Whitespace(" ")] - 1: TS_REFERENCE_TYPE@170..180 - 0: JS_REFERENCE_IDENTIFIER@170..173 - 0: IDENT@170..173 "Foo" [] [] - 1: TS_TYPE_ARGUMENTS@173..180 - 0: L_ANGLE@173..174 "<" [] [] - 1: TS_TYPE_ARGUMENT_LIST@174..179 - 0: TS_REFERENCE_TYPE@174..178 - 0: JS_REFERENCE_IDENTIFIER@174..178 - 0: IDENT@174..178 "out" [] [Whitespace(" ")] + 5: JS_VARIABLE_STATEMENT@154..174 + 0: JS_VARIABLE_DECLARATION@154..174 + 0: LET_KW@154..159 "let" [Newline("\n")] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATOR_LIST@159..174 + 0: JS_VARIABLE_DECLARATOR@159..174 + 0: JS_IDENTIFIER_BINDING@159..162 + 0: IDENT@159..162 "foo" [] [] + 1: TS_TYPE_ANNOTATION@162..174 + 0: COLON@162..164 ":" [] [Whitespace(" ")] + 1: TS_REFERENCE_TYPE@164..174 + 0: JS_REFERENCE_IDENTIFIER@164..167 + 0: IDENT@164..167 "Foo" [] [] + 1: TS_TYPE_ARGUMENTS@167..174 + 0: L_ANGLE@167..168 "<" [] [] + 1: TS_TYPE_ARGUMENT_LIST@168..173 + 0: TS_REFERENCE_TYPE@168..172 + 0: JS_REFERENCE_IDENTIFIER@168..172 + 0: IDENT@168..172 "out" [] [Whitespace(" ")] 1: (empty) 1: (empty) - 2: TS_REFERENCE_TYPE@178..179 - 0: JS_REFERENCE_IDENTIFIER@178..179 - 0: IDENT@178..179 "T" [] [] + 2: TS_REFERENCE_TYPE@172..173 + 0: JS_REFERENCE_IDENTIFIER@172..173 + 0: IDENT@172..173 "T" [] [] 1: (empty) - 2: R_ANGLE@179..180 ">" [] [] + 2: R_ANGLE@173..174 ">" [] [] 2: (empty) 1: (empty) - 6: TS_DECLARE_STATEMENT@180..210 - 0: DECLARE_KW@180..190 "declare" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: TS_DECLARE_FUNCTION_DECLARATION@190..210 + 6: TS_DECLARE_STATEMENT@174..203 + 0: DECLARE_KW@174..183 "declare" [Newline("\n")] [Whitespace(" ")] + 1: TS_DECLARE_FUNCTION_DECLARATION@183..203 0: (empty) - 1: FUNCTION_KW@190..199 "function" [] [Whitespace(" ")] - 2: JS_IDENTIFIER_BINDING@199..202 - 0: IDENT@199..202 "foo" [] [] - 3: TS_TYPE_PARAMETERS@202..208 - 0: L_ANGLE@202..203 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@203..207 - 0: TS_TYPE_PARAMETER@203..207 - 0: IN_KW@203..206 "in" [] [Whitespace(" ")] + 1: FUNCTION_KW@183..192 "function" [] [Whitespace(" ")] + 2: JS_IDENTIFIER_BINDING@192..195 + 0: IDENT@192..195 "foo" [] [] + 3: TS_TYPE_PARAMETERS@195..201 + 0: L_ANGLE@195..196 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@196..200 + 0: TS_TYPE_PARAMETER@196..200 + 0: IN_KW@196..199 "in" [] [Whitespace(" ")] 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@206..207 - 0: IDENT@206..207 "T" [] [] + 2: TS_TYPE_PARAMETER_NAME@199..200 + 0: IDENT@199..200 "T" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@207..208 ">" [] [] - 4: JS_PARAMETERS@208..210 - 0: L_PAREN@208..209 "(" [] [] - 1: JS_PARAMETER_LIST@209..209 - 2: R_PAREN@209..210 ")" [] [] + 2: R_ANGLE@200..201 ">" [] [] + 4: JS_PARAMETERS@201..203 + 0: L_PAREN@201..202 "(" [] [] + 1: JS_PARAMETER_LIST@202..202 + 2: R_PAREN@202..203 ")" [] [] 5: (empty) 6: (empty) - 7: TS_DECLARE_STATEMENT@210..241 - 0: DECLARE_KW@210..220 "declare" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: TS_DECLARE_FUNCTION_DECLARATION@220..241 + 7: TS_DECLARE_STATEMENT@203..233 + 0: DECLARE_KW@203..212 "declare" [Newline("\n")] [Whitespace(" ")] + 1: TS_DECLARE_FUNCTION_DECLARATION@212..233 0: (empty) - 1: FUNCTION_KW@220..229 "function" [] [Whitespace(" ")] - 2: JS_IDENTIFIER_BINDING@229..232 - 0: IDENT@229..232 "foo" [] [] - 3: TS_TYPE_PARAMETERS@232..239 - 0: L_ANGLE@232..233 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@233..238 - 0: TS_TYPE_PARAMETER@233..238 + 1: FUNCTION_KW@212..221 "function" [] [Whitespace(" ")] + 2: JS_IDENTIFIER_BINDING@221..224 + 0: IDENT@221..224 "foo" [] [] + 3: TS_TYPE_PARAMETERS@224..231 + 0: L_ANGLE@224..225 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@225..230 + 0: TS_TYPE_PARAMETER@225..230 0: (empty) - 1: OUT_KW@233..237 "out" [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER_NAME@237..238 - 0: IDENT@237..238 "T" [] [] + 1: OUT_KW@225..229 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@229..230 + 0: IDENT@229..230 "T" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@238..239 ">" [] [] - 4: JS_PARAMETERS@239..241 - 0: L_PAREN@239..240 "(" [] [] - 1: JS_PARAMETER_LIST@240..240 - 2: R_PAREN@240..241 ")" [] [] + 2: R_ANGLE@230..231 ">" [] [] + 4: JS_PARAMETERS@231..233 + 0: L_PAREN@231..232 "(" [] [] + 1: JS_PARAMETER_LIST@232..232 + 2: R_PAREN@232..233 ")" [] [] 5: (empty) 6: (empty) - 8: TS_DECLARE_STATEMENT@241..269 - 0: DECLARE_KW@241..251 "declare" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: JS_VARIABLE_DECLARATION_CLAUSE@251..269 - 0: JS_VARIABLE_DECLARATION@251..269 - 0: LET_KW@251..255 "let" [] [Whitespace(" ")] - 1: JS_VARIABLE_DECLARATOR_LIST@255..269 - 0: JS_VARIABLE_DECLARATOR@255..269 - 0: JS_IDENTIFIER_BINDING@255..258 - 0: IDENT@255..258 "foo" [] [] - 1: TS_TYPE_ANNOTATION@258..269 - 0: COLON@258..260 ":" [] [Whitespace(" ")] - 1: TS_REFERENCE_TYPE@260..269 - 0: JS_REFERENCE_IDENTIFIER@260..263 - 0: IDENT@260..263 "Foo" [] [] - 1: TS_TYPE_ARGUMENTS@263..269 - 0: L_ANGLE@263..264 "<" [] [] - 1: TS_TYPE_ARGUMENT_LIST@264..268 - 0: TS_REFERENCE_TYPE@264..267 - 0: JS_REFERENCE_IDENTIFIER@264..267 - 0: IDENT@264..267 "in" [] [Whitespace(" ")] + 8: TS_DECLARE_STATEMENT@233..260 + 0: DECLARE_KW@233..242 "declare" [Newline("\n")] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATION_CLAUSE@242..260 + 0: JS_VARIABLE_DECLARATION@242..260 + 0: LET_KW@242..246 "let" [] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATOR_LIST@246..260 + 0: JS_VARIABLE_DECLARATOR@246..260 + 0: JS_IDENTIFIER_BINDING@246..249 + 0: IDENT@246..249 "foo" [] [] + 1: TS_TYPE_ANNOTATION@249..260 + 0: COLON@249..251 ":" [] [Whitespace(" ")] + 1: TS_REFERENCE_TYPE@251..260 + 0: JS_REFERENCE_IDENTIFIER@251..254 + 0: IDENT@251..254 "Foo" [] [] + 1: TS_TYPE_ARGUMENTS@254..260 + 0: L_ANGLE@254..255 "<" [] [] + 1: TS_TYPE_ARGUMENT_LIST@255..259 + 0: TS_REFERENCE_TYPE@255..258 + 0: JS_REFERENCE_IDENTIFIER@255..258 + 0: IDENT@255..258 "in" [] [Whitespace(" ")] 1: (empty) 1: (empty) - 2: TS_REFERENCE_TYPE@267..268 - 0: JS_REFERENCE_IDENTIFIER@267..268 - 0: IDENT@267..268 "T" [] [] + 2: TS_REFERENCE_TYPE@258..259 + 0: JS_REFERENCE_IDENTIFIER@258..259 + 0: IDENT@258..259 "T" [] [] 1: (empty) - 2: R_ANGLE@268..269 ">" [] [] + 2: R_ANGLE@259..260 ">" [] [] 2: (empty) 1: (empty) - 9: TS_DECLARE_STATEMENT@269..298 - 0: DECLARE_KW@269..279 "declare" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: JS_VARIABLE_DECLARATION_CLAUSE@279..298 - 0: JS_VARIABLE_DECLARATION@279..298 - 0: LET_KW@279..283 "let" [] [Whitespace(" ")] - 1: JS_VARIABLE_DECLARATOR_LIST@283..298 - 0: JS_VARIABLE_DECLARATOR@283..298 - 0: JS_IDENTIFIER_BINDING@283..286 - 0: IDENT@283..286 "foo" [] [] - 1: TS_TYPE_ANNOTATION@286..298 - 0: COLON@286..288 ":" [] [Whitespace(" ")] - 1: TS_REFERENCE_TYPE@288..298 - 0: JS_REFERENCE_IDENTIFIER@288..291 - 0: IDENT@288..291 "Foo" [] [] - 1: TS_TYPE_ARGUMENTS@291..298 - 0: L_ANGLE@291..292 "<" [] [] - 1: TS_TYPE_ARGUMENT_LIST@292..297 - 0: TS_REFERENCE_TYPE@292..296 - 0: JS_REFERENCE_IDENTIFIER@292..296 - 0: IDENT@292..296 "out" [] [Whitespace(" ")] + 9: TS_DECLARE_STATEMENT@260..288 + 0: DECLARE_KW@260..269 "declare" [Newline("\n")] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATION_CLAUSE@269..288 + 0: JS_VARIABLE_DECLARATION@269..288 + 0: LET_KW@269..273 "let" [] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATOR_LIST@273..288 + 0: JS_VARIABLE_DECLARATOR@273..288 + 0: JS_IDENTIFIER_BINDING@273..276 + 0: IDENT@273..276 "foo" [] [] + 1: TS_TYPE_ANNOTATION@276..288 + 0: COLON@276..278 ":" [] [Whitespace(" ")] + 1: TS_REFERENCE_TYPE@278..288 + 0: JS_REFERENCE_IDENTIFIER@278..281 + 0: IDENT@278..281 "Foo" [] [] + 1: TS_TYPE_ARGUMENTS@281..288 + 0: L_ANGLE@281..282 "<" [] [] + 1: TS_TYPE_ARGUMENT_LIST@282..287 + 0: TS_REFERENCE_TYPE@282..286 + 0: JS_REFERENCE_IDENTIFIER@282..286 + 0: IDENT@282..286 "out" [] [Whitespace(" ")] 1: (empty) 1: (empty) - 2: TS_REFERENCE_TYPE@296..297 - 0: JS_REFERENCE_IDENTIFIER@296..297 - 0: IDENT@296..297 "T" [] [] + 2: TS_REFERENCE_TYPE@286..287 + 0: JS_REFERENCE_IDENTIFIER@286..287 + 0: IDENT@286..287 "T" [] [] 1: (empty) - 2: R_ANGLE@297..298 ">" [] [] + 2: R_ANGLE@287..288 ">" [] [] 2: (empty) 1: (empty) - 10: JS_EXPRESSION_STATEMENT@298..321 - 0: JS_ASSIGNMENT_EXPRESSION@298..321 - 0: JS_IDENTIFIER_ASSIGNMENT@298..304 - 0: IDENT@298..304 "Foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: EQ@304..306 "=" [] [Whitespace(" ")] - 2: JS_CLASS_EXPRESSION@306..321 - 0: CLASS_KW@306..312 "class" [] [Whitespace(" ")] - 1: (empty) - 2: TS_TYPE_PARAMETERS@312..319 - 0: L_ANGLE@312..313 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@313..317 - 0: TS_TYPE_PARAMETER@313..317 - 0: IN_KW@313..316 "in" [] [Whitespace(" ")] - 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@316..317 - 0: IDENT@316..317 "T" [] [] - 3: (empty) - 4: (empty) - 2: R_ANGLE@317..319 ">" [] [Whitespace(" ")] - 3: (empty) - 4: (empty) - 5: L_CURLY@319..320 "{" [] [] - 6: JS_CLASS_MEMBER_LIST@320..320 - 7: R_CURLY@320..321 "}" [] [] - 1: (empty) - 11: JS_EXPRESSION_STATEMENT@321..345 - 0: JS_ASSIGNMENT_EXPRESSION@321..345 - 0: JS_IDENTIFIER_ASSIGNMENT@321..327 - 0: IDENT@321..327 "Foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: EQ@327..329 "=" [] [Whitespace(" ")] - 2: JS_CLASS_EXPRESSION@329..345 - 0: CLASS_KW@329..335 "class" [] [Whitespace(" ")] - 1: (empty) - 2: TS_TYPE_PARAMETERS@335..343 - 0: L_ANGLE@335..336 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@336..341 - 0: TS_TYPE_PARAMETER@336..341 - 0: (empty) - 1: OUT_KW@336..340 "out" [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER_NAME@340..341 - 0: IDENT@340..341 "T" [] [] - 3: (empty) - 4: (empty) - 2: R_ANGLE@341..343 ">" [] [Whitespace(" ")] - 3: (empty) - 4: (empty) - 5: L_CURLY@343..344 "{" [] [] - 6: JS_CLASS_MEMBER_LIST@344..344 - 7: R_CURLY@344..345 "}" [] [] - 1: (empty) - 12: JS_EXPRESSION_STATEMENT@345..373 - 0: JS_ASSIGNMENT_EXPRESSION@345..373 - 0: JS_IDENTIFIER_ASSIGNMENT@345..351 - 0: IDENT@345..351 "foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: EQ@351..353 "=" [] [Whitespace(" ")] - 2: JS_FUNCTION_EXPRESSION@353..373 + 10: JS_EXPRESSION_STATEMENT@288..315 + 0: JS_ASSIGNMENT_EXPRESSION@288..315 + 0: JS_IDENTIFIER_ASSIGNMENT@288..293 + 0: IDENT@288..293 "foo" [Newline("\n")] [Whitespace(" ")] + 1: EQ@293..295 "=" [] [Whitespace(" ")] + 2: JS_FUNCTION_EXPRESSION@295..315 0: (empty) - 1: FUNCTION_KW@353..362 "function" [] [Whitespace(" ")] + 1: FUNCTION_KW@295..304 "function" [] [Whitespace(" ")] 2: (empty) 3: (empty) - 4: TS_TYPE_PARAMETERS@362..368 - 0: L_ANGLE@362..363 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@363..367 - 0: TS_TYPE_PARAMETER@363..367 - 0: IN_KW@363..366 "in" [] [Whitespace(" ")] + 4: TS_TYPE_PARAMETERS@304..310 + 0: L_ANGLE@304..305 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@305..309 + 0: TS_TYPE_PARAMETER@305..309 + 0: IN_KW@305..308 "in" [] [Whitespace(" ")] 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@366..367 - 0: IDENT@366..367 "T" [] [] + 2: TS_TYPE_PARAMETER_NAME@308..309 + 0: IDENT@308..309 "T" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@367..368 ">" [] [] - 5: JS_PARAMETERS@368..371 - 0: L_PAREN@368..369 "(" [] [] - 1: JS_PARAMETER_LIST@369..369 - 2: R_PAREN@369..371 ")" [] [Whitespace(" ")] + 2: R_ANGLE@309..310 ">" [] [] + 5: JS_PARAMETERS@310..313 + 0: L_PAREN@310..311 "(" [] [] + 1: JS_PARAMETER_LIST@311..311 + 2: R_PAREN@311..313 ")" [] [Whitespace(" ")] 6: (empty) - 7: JS_FUNCTION_BODY@371..373 - 0: L_CURLY@371..372 "{" [] [] - 1: JS_DIRECTIVE_LIST@372..372 - 2: JS_STATEMENT_LIST@372..372 - 3: R_CURLY@372..373 "}" [] [] + 7: JS_FUNCTION_BODY@313..315 + 0: L_CURLY@313..314 "{" [] [] + 1: JS_DIRECTIVE_LIST@314..314 + 2: JS_STATEMENT_LIST@314..314 + 3: R_CURLY@314..315 "}" [] [] 1: (empty) - 13: JS_EXPRESSION_STATEMENT@373..402 - 0: JS_ASSIGNMENT_EXPRESSION@373..402 - 0: JS_IDENTIFIER_ASSIGNMENT@373..379 - 0: IDENT@373..379 "foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: EQ@379..381 "=" [] [Whitespace(" ")] - 2: JS_FUNCTION_EXPRESSION@381..402 + 11: JS_EXPRESSION_STATEMENT@315..343 + 0: JS_ASSIGNMENT_EXPRESSION@315..343 + 0: JS_IDENTIFIER_ASSIGNMENT@315..320 + 0: IDENT@315..320 "foo" [Newline("\n")] [Whitespace(" ")] + 1: EQ@320..322 "=" [] [Whitespace(" ")] + 2: JS_FUNCTION_EXPRESSION@322..343 0: (empty) - 1: FUNCTION_KW@381..390 "function" [] [Whitespace(" ")] + 1: FUNCTION_KW@322..331 "function" [] [Whitespace(" ")] 2: (empty) 3: (empty) - 4: TS_TYPE_PARAMETERS@390..397 - 0: L_ANGLE@390..391 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@391..396 - 0: TS_TYPE_PARAMETER@391..396 + 4: TS_TYPE_PARAMETERS@331..338 + 0: L_ANGLE@331..332 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@332..337 + 0: TS_TYPE_PARAMETER@332..337 0: (empty) - 1: OUT_KW@391..395 "out" [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER_NAME@395..396 - 0: IDENT@395..396 "T" [] [] + 1: OUT_KW@332..336 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@336..337 + 0: IDENT@336..337 "T" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@396..397 ">" [] [] - 5: JS_PARAMETERS@397..400 - 0: L_PAREN@397..398 "(" [] [] - 1: JS_PARAMETER_LIST@398..398 - 2: R_PAREN@398..400 ")" [] [Whitespace(" ")] + 2: R_ANGLE@337..338 ">" [] [] + 5: JS_PARAMETERS@338..341 + 0: L_PAREN@338..339 "(" [] [] + 1: JS_PARAMETER_LIST@339..339 + 2: R_PAREN@339..341 ")" [] [Whitespace(" ")] 6: (empty) - 7: JS_FUNCTION_BODY@400..402 - 0: L_CURLY@400..401 "{" [] [] - 1: JS_DIRECTIVE_LIST@401..401 - 2: JS_STATEMENT_LIST@401..401 - 3: R_CURLY@401..402 "}" [] [] + 7: JS_FUNCTION_BODY@341..343 + 0: L_CURLY@341..342 "{" [] [] + 1: JS_DIRECTIVE_LIST@342..342 + 2: JS_STATEMENT_LIST@342..342 + 3: R_CURLY@342..343 "}" [] [] 1: (empty) - 14: JS_CLASS_DECLARATION@402..435 + 12: JS_CLASS_DECLARATION@343..375 0: (empty) - 1: CLASS_KW@402..410 "class" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 2: JS_IDENTIFIER_BINDING@410..414 - 0: IDENT@410..414 "Foo" [] [Whitespace(" ")] + 1: CLASS_KW@343..350 "class" [Newline("\n")] [Whitespace(" ")] + 2: JS_IDENTIFIER_BINDING@350..354 + 0: IDENT@350..354 "Foo" [] [Whitespace(" ")] 3: (empty) 4: (empty) 5: (empty) - 6: L_CURLY@414..416 "{" [] [Whitespace(" ")] - 7: JS_CLASS_MEMBER_LIST@416..434 - 0: JS_METHOD_CLASS_MEMBER@416..434 - 0: JS_METHOD_MODIFIER_LIST@416..416 + 6: L_CURLY@354..356 "{" [] [Whitespace(" ")] + 7: JS_CLASS_MEMBER_LIST@356..374 + 0: JS_METHOD_CLASS_MEMBER@356..374 + 0: JS_METHOD_MODIFIER_LIST@356..356 1: (empty) 2: (empty) - 3: JS_LITERAL_MEMBER_NAME@416..419 - 0: IDENT@416..419 "foo" [] [] + 3: JS_LITERAL_MEMBER_NAME@356..359 + 0: IDENT@356..359 "foo" [] [] 4: (empty) - 5: TS_TYPE_PARAMETERS@419..425 - 0: L_ANGLE@419..420 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@420..424 - 0: TS_TYPE_PARAMETER@420..424 - 0: IN_KW@420..423 "in" [] [Whitespace(" ")] + 5: TS_TYPE_PARAMETERS@359..365 + 0: L_ANGLE@359..360 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@360..364 + 0: TS_TYPE_PARAMETER@360..364 + 0: IN_KW@360..363 "in" [] [Whitespace(" ")] 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@423..424 - 0: IDENT@423..424 "T" [] [] + 2: TS_TYPE_PARAMETER_NAME@363..364 + 0: IDENT@363..364 "T" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@424..425 ">" [] [] - 6: JS_PARAMETERS@425..427 - 0: L_PAREN@425..426 "(" [] [] - 1: JS_PARAMETER_LIST@426..426 - 2: R_PAREN@426..427 ")" [] [] - 7: TS_RETURN_TYPE_ANNOTATION@427..431 - 0: COLON@427..429 ":" [] [Whitespace(" ")] - 1: TS_REFERENCE_TYPE@429..431 - 0: JS_REFERENCE_IDENTIFIER@429..431 - 0: IDENT@429..431 "T" [] [Whitespace(" ")] + 2: R_ANGLE@364..365 ">" [] [] + 6: JS_PARAMETERS@365..367 + 0: L_PAREN@365..366 "(" [] [] + 1: JS_PARAMETER_LIST@366..366 + 2: R_PAREN@366..367 ")" [] [] + 7: TS_RETURN_TYPE_ANNOTATION@367..371 + 0: COLON@367..369 ":" [] [Whitespace(" ")] + 1: TS_REFERENCE_TYPE@369..371 + 0: JS_REFERENCE_IDENTIFIER@369..371 + 0: IDENT@369..371 "T" [] [Whitespace(" ")] 1: (empty) - 8: JS_FUNCTION_BODY@431..434 - 0: L_CURLY@431..432 "{" [] [] - 1: JS_DIRECTIVE_LIST@432..432 - 2: JS_STATEMENT_LIST@432..432 - 3: R_CURLY@432..434 "}" [] [Whitespace(" ")] - 8: R_CURLY@434..435 "}" [] [] - 15: JS_CLASS_DECLARATION@435..469 + 8: JS_FUNCTION_BODY@371..374 + 0: L_CURLY@371..372 "{" [] [] + 1: JS_DIRECTIVE_LIST@372..372 + 2: JS_STATEMENT_LIST@372..372 + 3: R_CURLY@372..374 "}" [] [Whitespace(" ")] + 8: R_CURLY@374..375 "}" [] [] + 13: JS_CLASS_DECLARATION@375..408 0: (empty) - 1: CLASS_KW@435..443 "class" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 2: JS_IDENTIFIER_BINDING@443..447 - 0: IDENT@443..447 "Foo" [] [Whitespace(" ")] + 1: CLASS_KW@375..382 "class" [Newline("\n")] [Whitespace(" ")] + 2: JS_IDENTIFIER_BINDING@382..386 + 0: IDENT@382..386 "Foo" [] [Whitespace(" ")] 3: (empty) 4: (empty) 5: (empty) - 6: L_CURLY@447..449 "{" [] [Whitespace(" ")] - 7: JS_CLASS_MEMBER_LIST@449..468 - 0: JS_METHOD_CLASS_MEMBER@449..468 - 0: JS_METHOD_MODIFIER_LIST@449..449 + 6: L_CURLY@386..388 "{" [] [Whitespace(" ")] + 7: JS_CLASS_MEMBER_LIST@388..407 + 0: JS_METHOD_CLASS_MEMBER@388..407 + 0: JS_METHOD_MODIFIER_LIST@388..388 1: (empty) 2: (empty) - 3: JS_LITERAL_MEMBER_NAME@449..452 - 0: IDENT@449..452 "foo" [] [] + 3: JS_LITERAL_MEMBER_NAME@388..391 + 0: IDENT@388..391 "foo" [] [] 4: (empty) - 5: TS_TYPE_PARAMETERS@452..459 - 0: L_ANGLE@452..453 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@453..458 - 0: TS_TYPE_PARAMETER@453..458 + 5: TS_TYPE_PARAMETERS@391..398 + 0: L_ANGLE@391..392 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@392..397 + 0: TS_TYPE_PARAMETER@392..397 0: (empty) - 1: OUT_KW@453..457 "out" [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER_NAME@457..458 - 0: IDENT@457..458 "T" [] [] + 1: OUT_KW@392..396 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@396..397 + 0: IDENT@396..397 "T" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@458..459 ">" [] [] - 6: JS_PARAMETERS@459..461 - 0: L_PAREN@459..460 "(" [] [] - 1: JS_PARAMETER_LIST@460..460 - 2: R_PAREN@460..461 ")" [] [] - 7: TS_RETURN_TYPE_ANNOTATION@461..465 - 0: COLON@461..463 ":" [] [Whitespace(" ")] - 1: TS_REFERENCE_TYPE@463..465 - 0: JS_REFERENCE_IDENTIFIER@463..465 - 0: IDENT@463..465 "T" [] [Whitespace(" ")] + 2: R_ANGLE@397..398 ">" [] [] + 6: JS_PARAMETERS@398..400 + 0: L_PAREN@398..399 "(" [] [] + 1: JS_PARAMETER_LIST@399..399 + 2: R_PAREN@399..400 ")" [] [] + 7: TS_RETURN_TYPE_ANNOTATION@400..404 + 0: COLON@400..402 ":" [] [Whitespace(" ")] + 1: TS_REFERENCE_TYPE@402..404 + 0: JS_REFERENCE_IDENTIFIER@402..404 + 0: IDENT@402..404 "T" [] [Whitespace(" ")] 1: (empty) - 8: JS_FUNCTION_BODY@465..468 - 0: L_CURLY@465..466 "{" [] [] - 1: JS_DIRECTIVE_LIST@466..466 - 2: JS_STATEMENT_LIST@466..466 - 3: R_CURLY@466..468 "}" [] [Whitespace(" ")] - 8: R_CURLY@468..469 "}" [] [] - 16: JS_EXPRESSION_STATEMENT@469..499 - 0: JS_ASSIGNMENT_EXPRESSION@469..498 - 0: JS_IDENTIFIER_ASSIGNMENT@469..475 - 0: IDENT@469..475 "foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: EQ@475..477 "=" [] [Whitespace(" ")] - 2: JS_OBJECT_EXPRESSION@477..498 - 0: L_CURLY@477..479 "{" [] [Whitespace(" ")] - 1: JS_OBJECT_MEMBER_LIST@479..497 - 0: JS_METHOD_OBJECT_MEMBER@479..497 + 8: JS_FUNCTION_BODY@404..407 + 0: L_CURLY@404..405 "{" [] [] + 1: JS_DIRECTIVE_LIST@405..405 + 2: JS_STATEMENT_LIST@405..405 + 3: R_CURLY@405..407 "}" [] [Whitespace(" ")] + 8: R_CURLY@407..408 "}" [] [] + 14: JS_EXPRESSION_STATEMENT@408..437 + 0: JS_ASSIGNMENT_EXPRESSION@408..436 + 0: JS_IDENTIFIER_ASSIGNMENT@408..413 + 0: IDENT@408..413 "foo" [Newline("\n")] [Whitespace(" ")] + 1: EQ@413..415 "=" [] [Whitespace(" ")] + 2: JS_OBJECT_EXPRESSION@415..436 + 0: L_CURLY@415..417 "{" [] [Whitespace(" ")] + 1: JS_OBJECT_MEMBER_LIST@417..435 + 0: JS_METHOD_OBJECT_MEMBER@417..435 0: (empty) 1: (empty) - 2: JS_LITERAL_MEMBER_NAME@479..482 - 0: IDENT@479..482 "foo" [] [] - 3: TS_TYPE_PARAMETERS@482..488 - 0: L_ANGLE@482..483 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@483..487 - 0: TS_TYPE_PARAMETER@483..487 - 0: IN_KW@483..486 "in" [] [Whitespace(" ")] + 2: JS_LITERAL_MEMBER_NAME@417..420 + 0: IDENT@417..420 "foo" [] [] + 3: TS_TYPE_PARAMETERS@420..426 + 0: L_ANGLE@420..421 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@421..425 + 0: TS_TYPE_PARAMETER@421..425 + 0: IN_KW@421..424 "in" [] [Whitespace(" ")] 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@486..487 - 0: IDENT@486..487 "T" [] [] + 2: TS_TYPE_PARAMETER_NAME@424..425 + 0: IDENT@424..425 "T" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@487..488 ">" [] [] - 4: JS_PARAMETERS@488..490 - 0: L_PAREN@488..489 "(" [] [] - 1: JS_PARAMETER_LIST@489..489 - 2: R_PAREN@489..490 ")" [] [] - 5: TS_RETURN_TYPE_ANNOTATION@490..494 - 0: COLON@490..492 ":" [] [Whitespace(" ")] - 1: TS_REFERENCE_TYPE@492..494 - 0: JS_REFERENCE_IDENTIFIER@492..494 - 0: IDENT@492..494 "T" [] [Whitespace(" ")] + 2: R_ANGLE@425..426 ">" [] [] + 4: JS_PARAMETERS@426..428 + 0: L_PAREN@426..427 "(" [] [] + 1: JS_PARAMETER_LIST@427..427 + 2: R_PAREN@427..428 ")" [] [] + 5: TS_RETURN_TYPE_ANNOTATION@428..432 + 0: COLON@428..430 ":" [] [Whitespace(" ")] + 1: TS_REFERENCE_TYPE@430..432 + 0: JS_REFERENCE_IDENTIFIER@430..432 + 0: IDENT@430..432 "T" [] [Whitespace(" ")] 1: (empty) - 6: JS_FUNCTION_BODY@494..497 - 0: L_CURLY@494..495 "{" [] [] - 1: JS_DIRECTIVE_LIST@495..495 - 2: JS_STATEMENT_LIST@495..495 - 3: R_CURLY@495..497 "}" [] [Whitespace(" ")] - 2: R_CURLY@497..498 "}" [] [] - 1: SEMICOLON@498..499 ";" [] [] - 17: JS_EXPRESSION_STATEMENT@499..530 - 0: JS_ASSIGNMENT_EXPRESSION@499..529 - 0: JS_IDENTIFIER_ASSIGNMENT@499..505 - 0: IDENT@499..505 "foo" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: EQ@505..507 "=" [] [Whitespace(" ")] - 2: JS_OBJECT_EXPRESSION@507..529 - 0: L_CURLY@507..509 "{" [] [Whitespace(" ")] - 1: JS_OBJECT_MEMBER_LIST@509..528 - 0: JS_METHOD_OBJECT_MEMBER@509..528 + 6: JS_FUNCTION_BODY@432..435 + 0: L_CURLY@432..433 "{" [] [] + 1: JS_DIRECTIVE_LIST@433..433 + 2: JS_STATEMENT_LIST@433..433 + 3: R_CURLY@433..435 "}" [] [Whitespace(" ")] + 2: R_CURLY@435..436 "}" [] [] + 1: SEMICOLON@436..437 ";" [] [] + 15: JS_EXPRESSION_STATEMENT@437..467 + 0: JS_ASSIGNMENT_EXPRESSION@437..466 + 0: JS_IDENTIFIER_ASSIGNMENT@437..442 + 0: IDENT@437..442 "foo" [Newline("\n")] [Whitespace(" ")] + 1: EQ@442..444 "=" [] [Whitespace(" ")] + 2: JS_OBJECT_EXPRESSION@444..466 + 0: L_CURLY@444..446 "{" [] [Whitespace(" ")] + 1: JS_OBJECT_MEMBER_LIST@446..465 + 0: JS_METHOD_OBJECT_MEMBER@446..465 0: (empty) 1: (empty) - 2: JS_LITERAL_MEMBER_NAME@509..512 - 0: IDENT@509..512 "foo" [] [] - 3: TS_TYPE_PARAMETERS@512..519 - 0: L_ANGLE@512..513 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@513..518 - 0: TS_TYPE_PARAMETER@513..518 + 2: JS_LITERAL_MEMBER_NAME@446..449 + 0: IDENT@446..449 "foo" [] [] + 3: TS_TYPE_PARAMETERS@449..456 + 0: L_ANGLE@449..450 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@450..455 + 0: TS_TYPE_PARAMETER@450..455 0: (empty) - 1: OUT_KW@513..517 "out" [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER_NAME@517..518 - 0: IDENT@517..518 "T" [] [] + 1: OUT_KW@450..454 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@454..455 + 0: IDENT@454..455 "T" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@518..519 ">" [] [] - 4: JS_PARAMETERS@519..521 - 0: L_PAREN@519..520 "(" [] [] - 1: JS_PARAMETER_LIST@520..520 - 2: R_PAREN@520..521 ")" [] [] - 5: TS_RETURN_TYPE_ANNOTATION@521..525 - 0: COLON@521..523 ":" [] [Whitespace(" ")] - 1: TS_REFERENCE_TYPE@523..525 - 0: JS_REFERENCE_IDENTIFIER@523..525 - 0: IDENT@523..525 "T" [] [Whitespace(" ")] + 2: R_ANGLE@455..456 ">" [] [] + 4: JS_PARAMETERS@456..458 + 0: L_PAREN@456..457 "(" [] [] + 1: JS_PARAMETER_LIST@457..457 + 2: R_PAREN@457..458 ")" [] [] + 5: TS_RETURN_TYPE_ANNOTATION@458..462 + 0: COLON@458..460 ":" [] [Whitespace(" ")] + 1: TS_REFERENCE_TYPE@460..462 + 0: JS_REFERENCE_IDENTIFIER@460..462 + 0: IDENT@460..462 "T" [] [Whitespace(" ")] 1: (empty) - 6: JS_FUNCTION_BODY@525..528 - 0: L_CURLY@525..526 "{" [] [] - 1: JS_DIRECTIVE_LIST@526..526 - 2: JS_STATEMENT_LIST@526..526 - 3: R_CURLY@526..528 "}" [] [Whitespace(" ")] - 2: R_CURLY@528..529 "}" [] [] - 1: SEMICOLON@529..530 ";" [] [] - 18: JS_EXPRESSION_STATEMENT@530..541 - 0: JS_BINARY_EXPRESSION@530..541 - 0: TS_TYPE_ASSERTION_EXPRESSION@530..537 - 0: L_ANGLE@530..533 "<" [Newline("\n"), Whitespace("\t")] [] - 1: TS_REFERENCE_TYPE@533..536 - 0: JS_REFERENCE_IDENTIFIER@533..536 - 0: IDENT@533..536 "in" [] [Whitespace(" ")] + 6: JS_FUNCTION_BODY@462..465 + 0: L_CURLY@462..463 "{" [] [] + 1: JS_DIRECTIVE_LIST@463..463 + 2: JS_STATEMENT_LIST@463..463 + 3: R_CURLY@463..465 "}" [] [Whitespace(" ")] + 2: R_CURLY@465..466 "}" [] [] + 1: SEMICOLON@466..467 ";" [] [] + 16: JS_EXPRESSION_STATEMENT@467..477 + 0: JS_BINARY_EXPRESSION@467..477 + 0: TS_TYPE_ASSERTION_EXPRESSION@467..473 + 0: L_ANGLE@467..469 "<" [Newline("\n")] [] + 1: TS_REFERENCE_TYPE@469..472 + 0: JS_REFERENCE_IDENTIFIER@469..472 + 0: IDENT@469..472 "in" [] [Whitespace(" ")] 1: (empty) 2: (empty) - 3: JS_IDENTIFIER_EXPRESSION@536..537 - 0: JS_REFERENCE_IDENTIFIER@536..537 - 0: IDENT@536..537 "T" [] [] - 1: R_ANGLE@537..538 ">" [] [] - 2: JS_PARENTHESIZED_EXPRESSION@538..541 - 0: L_PAREN@538..539 "(" [] [] + 3: JS_IDENTIFIER_EXPRESSION@472..473 + 0: JS_REFERENCE_IDENTIFIER@472..473 + 0: IDENT@472..473 "T" [] [] + 1: R_ANGLE@473..474 ">" [] [] + 2: JS_PARENTHESIZED_EXPRESSION@474..477 + 0: L_PAREN@474..475 "(" [] [] 1: (empty) - 2: R_PAREN@539..541 ")" [] [Whitespace(" ")] + 2: R_PAREN@475..477 ")" [] [Whitespace(" ")] 1: (empty) - 19: JS_BOGUS_STATEMENT@541..544 - 0: FAT_ARROW@541..544 "=>" [] [Whitespace(" ")] - 20: JS_BLOCK_STATEMENT@544..546 - 0: L_CURLY@544..545 "{" [] [] - 1: JS_STATEMENT_LIST@545..545 - 2: R_CURLY@545..546 "}" [] [] - 21: JS_EMPTY_STATEMENT@546..547 - 0: SEMICOLON@546..547 ";" [] [] - 22: JS_EXPRESSION_STATEMENT@547..565 - 0: JS_ARROW_FUNCTION_EXPRESSION@547..564 + 17: JS_BOGUS_STATEMENT@477..480 + 0: FAT_ARROW@477..480 "=>" [] [Whitespace(" ")] + 18: JS_BLOCK_STATEMENT@480..482 + 0: L_CURLY@480..481 "{" [] [] + 1: JS_STATEMENT_LIST@481..481 + 2: R_CURLY@481..482 "}" [] [] + 19: JS_EMPTY_STATEMENT@482..483 + 0: SEMICOLON@482..483 ";" [] [] + 20: JS_EXPRESSION_STATEMENT@483..500 + 0: JS_ARROW_FUNCTION_EXPRESSION@483..499 0: (empty) - 1: TS_TYPE_PARAMETERS@547..556 - 0: L_ANGLE@547..550 "<" [Newline("\n"), Whitespace("\t")] [] - 1: TS_TYPE_PARAMETER_LIST@550..555 - 0: TS_TYPE_PARAMETER@550..555 + 1: TS_TYPE_PARAMETERS@483..491 + 0: L_ANGLE@483..485 "<" [Newline("\n")] [] + 1: TS_TYPE_PARAMETER_LIST@485..490 + 0: TS_TYPE_PARAMETER@485..490 0: (empty) - 1: OUT_KW@550..554 "out" [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER_NAME@554..555 - 0: IDENT@554..555 "T" [] [] + 1: OUT_KW@485..489 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@489..490 + 0: IDENT@489..490 "T" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@555..556 ">" [] [] - 2: JS_PARAMETERS@556..559 - 0: L_PAREN@556..557 "(" [] [] - 1: JS_PARAMETER_LIST@557..557 - 2: R_PAREN@557..559 ")" [] [Whitespace(" ")] + 2: R_ANGLE@490..491 ">" [] [] + 2: JS_PARAMETERS@491..494 + 0: L_PAREN@491..492 "(" [] [] + 1: JS_PARAMETER_LIST@492..492 + 2: R_PAREN@492..494 ")" [] [Whitespace(" ")] 3: (empty) - 4: FAT_ARROW@559..562 "=>" [] [Whitespace(" ")] - 5: JS_FUNCTION_BODY@562..564 - 0: L_CURLY@562..563 "{" [] [] - 1: JS_DIRECTIVE_LIST@563..563 - 2: JS_STATEMENT_LIST@563..563 - 3: R_CURLY@563..564 "}" [] [] - 1: SEMICOLON@564..565 ";" [] [] - 23: JS_EXPRESSION_STATEMENT@565..578 - 0: JS_SEQUENCE_EXPRESSION@565..578 - 0: TS_TYPE_ASSERTION_EXPRESSION@565..572 - 0: L_ANGLE@565..568 "<" [Newline("\n"), Whitespace("\t")] [] - 1: TS_REFERENCE_TYPE@568..571 - 0: JS_REFERENCE_IDENTIFIER@568..571 - 0: IDENT@568..571 "in" [] [Whitespace(" ")] + 4: FAT_ARROW@494..497 "=>" [] [Whitespace(" ")] + 5: JS_FUNCTION_BODY@497..499 + 0: L_CURLY@497..498 "{" [] [] + 1: JS_DIRECTIVE_LIST@498..498 + 2: JS_STATEMENT_LIST@498..498 + 3: R_CURLY@498..499 "}" [] [] + 1: SEMICOLON@499..500 ";" [] [] + 21: JS_EXPRESSION_STATEMENT@500..512 + 0: JS_SEQUENCE_EXPRESSION@500..512 + 0: TS_TYPE_ASSERTION_EXPRESSION@500..506 + 0: L_ANGLE@500..502 "<" [Newline("\n")] [] + 1: TS_REFERENCE_TYPE@502..505 + 0: JS_REFERENCE_IDENTIFIER@502..505 + 0: IDENT@502..505 "in" [] [Whitespace(" ")] 1: (empty) 2: (empty) - 3: JS_IDENTIFIER_EXPRESSION@571..572 - 0: JS_REFERENCE_IDENTIFIER@571..572 - 0: IDENT@571..572 "T" [] [] - 1: COMMA@572..574 "," [] [Whitespace(" ")] - 2: JS_IDENTIFIER_EXPRESSION@574..578 - 0: JS_REFERENCE_IDENTIFIER@574..578 - 0: IDENT@574..578 "out" [] [Whitespace(" ")] + 3: JS_IDENTIFIER_EXPRESSION@505..506 + 0: JS_REFERENCE_IDENTIFIER@505..506 + 0: IDENT@505..506 "T" [] [] + 1: COMMA@506..508 "," [] [Whitespace(" ")] + 2: JS_IDENTIFIER_EXPRESSION@508..512 + 0: JS_REFERENCE_IDENTIFIER@508..512 + 0: IDENT@508..512 "out" [] [Whitespace(" ")] 1: (empty) - 24: JS_EXPRESSION_STATEMENT@578..583 - 0: JS_BINARY_EXPRESSION@578..583 - 0: JS_IDENTIFIER_EXPRESSION@578..579 - 0: JS_REFERENCE_IDENTIFIER@578..579 - 0: IDENT@578..579 "T" [] [] - 1: R_ANGLE@579..580 ">" [] [] - 2: JS_PARENTHESIZED_EXPRESSION@580..583 - 0: L_PAREN@580..581 "(" [] [] + 22: JS_EXPRESSION_STATEMENT@512..517 + 0: JS_BINARY_EXPRESSION@512..517 + 0: JS_IDENTIFIER_EXPRESSION@512..513 + 0: JS_REFERENCE_IDENTIFIER@512..513 + 0: IDENT@512..513 "T" [] [] + 1: R_ANGLE@513..514 ">" [] [] + 2: JS_PARENTHESIZED_EXPRESSION@514..517 + 0: L_PAREN@514..515 "(" [] [] 1: (empty) - 2: R_PAREN@581..583 ")" [] [Whitespace(" ")] + 2: R_PAREN@515..517 ")" [] [Whitespace(" ")] 1: (empty) - 25: JS_BOGUS_STATEMENT@583..586 - 0: FAT_ARROW@583..586 "=>" [] [Whitespace(" ")] - 26: JS_BLOCK_STATEMENT@586..588 - 0: L_CURLY@586..587 "{" [] [] - 1: JS_STATEMENT_LIST@587..587 - 2: R_CURLY@587..588 "}" [] [] - 27: JS_EMPTY_STATEMENT@588..589 - 0: SEMICOLON@588..589 ";" [] [] - 28: JS_VARIABLE_STATEMENT@589..613 - 0: JS_VARIABLE_DECLARATION@589..612 - 0: LET_KW@589..595 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: JS_VARIABLE_DECLARATOR_LIST@595..612 - 0: JS_VARIABLE_DECLARATOR@595..612 - 0: JS_IDENTIFIER_BINDING@595..596 - 0: IDENT@595..596 "x" [] [] - 1: TS_TYPE_ANNOTATION@596..612 - 0: COLON@596..598 ":" [] [Whitespace(" ")] - 1: TS_FUNCTION_TYPE@598..612 - 0: TS_TYPE_PARAMETERS@598..604 - 0: L_ANGLE@598..599 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@599..603 - 0: TS_TYPE_PARAMETER@599..603 - 0: IN_KW@599..602 "in" [] [Whitespace(" ")] + 23: JS_BOGUS_STATEMENT@517..520 + 0: FAT_ARROW@517..520 "=>" [] [Whitespace(" ")] + 24: JS_BLOCK_STATEMENT@520..522 + 0: L_CURLY@520..521 "{" [] [] + 1: JS_STATEMENT_LIST@521..521 + 2: R_CURLY@521..522 "}" [] [] + 25: JS_EMPTY_STATEMENT@522..523 + 0: SEMICOLON@522..523 ";" [] [] + 26: JS_VARIABLE_STATEMENT@523..546 + 0: JS_VARIABLE_DECLARATION@523..545 + 0: LET_KW@523..528 "let" [Newline("\n")] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATOR_LIST@528..545 + 0: JS_VARIABLE_DECLARATOR@528..545 + 0: JS_IDENTIFIER_BINDING@528..529 + 0: IDENT@528..529 "x" [] [] + 1: TS_TYPE_ANNOTATION@529..545 + 0: COLON@529..531 ":" [] [Whitespace(" ")] + 1: TS_FUNCTION_TYPE@531..545 + 0: TS_TYPE_PARAMETERS@531..537 + 0: L_ANGLE@531..532 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@532..536 + 0: TS_TYPE_PARAMETER@532..536 + 0: IN_KW@532..535 "in" [] [Whitespace(" ")] 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@602..603 - 0: IDENT@602..603 "T" [] [] + 2: TS_TYPE_PARAMETER_NAME@535..536 + 0: IDENT@535..536 "T" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@603..604 ">" [] [] - 1: JS_PARAMETERS@604..607 - 0: L_PAREN@604..605 "(" [] [] - 1: JS_PARAMETER_LIST@605..605 - 2: R_PAREN@605..607 ")" [] [Whitespace(" ")] - 2: FAT_ARROW@607..610 "=>" [] [Whitespace(" ")] - 3: TS_OBJECT_TYPE@610..612 - 0: L_CURLY@610..611 "{" [] [] - 1: TS_TYPE_MEMBER_LIST@611..611 - 2: R_CURLY@611..612 "}" [] [] + 2: R_ANGLE@536..537 ">" [] [] + 1: JS_PARAMETERS@537..540 + 0: L_PAREN@537..538 "(" [] [] + 1: JS_PARAMETER_LIST@538..538 + 2: R_PAREN@538..540 ")" [] [Whitespace(" ")] + 2: FAT_ARROW@540..543 "=>" [] [Whitespace(" ")] + 3: TS_OBJECT_TYPE@543..545 + 0: L_CURLY@543..544 "{" [] [] + 1: TS_TYPE_MEMBER_LIST@544..544 + 2: R_CURLY@544..545 "}" [] [] 2: (empty) - 1: SEMICOLON@612..613 ";" [] [] - 29: JS_VARIABLE_STATEMENT@613..638 - 0: JS_VARIABLE_DECLARATION@613..637 - 0: LET_KW@613..619 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: JS_VARIABLE_DECLARATOR_LIST@619..637 - 0: JS_VARIABLE_DECLARATOR@619..637 - 0: JS_IDENTIFIER_BINDING@619..620 - 0: IDENT@619..620 "x" [] [] - 1: TS_TYPE_ANNOTATION@620..637 - 0: COLON@620..622 ":" [] [Whitespace(" ")] - 1: TS_FUNCTION_TYPE@622..637 - 0: TS_TYPE_PARAMETERS@622..629 - 0: L_ANGLE@622..623 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@623..628 - 0: TS_TYPE_PARAMETER@623..628 + 1: SEMICOLON@545..546 ";" [] [] + 27: JS_VARIABLE_STATEMENT@546..570 + 0: JS_VARIABLE_DECLARATION@546..569 + 0: LET_KW@546..551 "let" [Newline("\n")] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATOR_LIST@551..569 + 0: JS_VARIABLE_DECLARATOR@551..569 + 0: JS_IDENTIFIER_BINDING@551..552 + 0: IDENT@551..552 "x" [] [] + 1: TS_TYPE_ANNOTATION@552..569 + 0: COLON@552..554 ":" [] [Whitespace(" ")] + 1: TS_FUNCTION_TYPE@554..569 + 0: TS_TYPE_PARAMETERS@554..561 + 0: L_ANGLE@554..555 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@555..560 + 0: TS_TYPE_PARAMETER@555..560 0: (empty) - 1: OUT_KW@623..627 "out" [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER_NAME@627..628 - 0: IDENT@627..628 "T" [] [] + 1: OUT_KW@555..559 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@559..560 + 0: IDENT@559..560 "T" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@628..629 ">" [] [] - 1: JS_PARAMETERS@629..632 - 0: L_PAREN@629..630 "(" [] [] - 1: JS_PARAMETER_LIST@630..630 - 2: R_PAREN@630..632 ")" [] [Whitespace(" ")] - 2: FAT_ARROW@632..635 "=>" [] [Whitespace(" ")] - 3: TS_OBJECT_TYPE@635..637 - 0: L_CURLY@635..636 "{" [] [] - 1: TS_TYPE_MEMBER_LIST@636..636 - 2: R_CURLY@636..637 "}" [] [] + 2: R_ANGLE@560..561 ">" [] [] + 1: JS_PARAMETERS@561..564 + 0: L_PAREN@561..562 "(" [] [] + 1: JS_PARAMETER_LIST@562..562 + 2: R_PAREN@562..564 ")" [] [Whitespace(" ")] + 2: FAT_ARROW@564..567 "=>" [] [Whitespace(" ")] + 3: TS_OBJECT_TYPE@567..569 + 0: L_CURLY@567..568 "{" [] [] + 1: TS_TYPE_MEMBER_LIST@568..568 + 2: R_CURLY@568..569 "}" [] [] 2: (empty) - 1: SEMICOLON@637..638 ";" [] [] - 30: JS_VARIABLE_STATEMENT@638..669 - 0: JS_VARIABLE_DECLARATION@638..668 - 0: LET_KW@638..644 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: JS_VARIABLE_DECLARATOR_LIST@644..668 - 0: JS_VARIABLE_DECLARATOR@644..668 - 0: JS_IDENTIFIER_BINDING@644..645 - 0: IDENT@644..645 "x" [] [] - 1: TS_TYPE_ANNOTATION@645..668 - 0: COLON@645..647 ":" [] [Whitespace(" ")] - 1: TS_FUNCTION_TYPE@647..668 - 0: TS_TYPE_PARAMETERS@647..660 - 0: L_ANGLE@647..648 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@648..659 - 0: TS_TYPE_PARAMETER@648..652 - 0: IN_KW@648..651 "in" [] [Whitespace(" ")] + 1: SEMICOLON@569..570 ";" [] [] + 28: JS_VARIABLE_STATEMENT@570..600 + 0: JS_VARIABLE_DECLARATION@570..599 + 0: LET_KW@570..575 "let" [Newline("\n")] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATOR_LIST@575..599 + 0: JS_VARIABLE_DECLARATOR@575..599 + 0: JS_IDENTIFIER_BINDING@575..576 + 0: IDENT@575..576 "x" [] [] + 1: TS_TYPE_ANNOTATION@576..599 + 0: COLON@576..578 ":" [] [Whitespace(" ")] + 1: TS_FUNCTION_TYPE@578..599 + 0: TS_TYPE_PARAMETERS@578..591 + 0: L_ANGLE@578..579 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@579..590 + 0: TS_TYPE_PARAMETER@579..583 + 0: IN_KW@579..582 "in" [] [Whitespace(" ")] 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@651..652 - 0: IDENT@651..652 "T" [] [] + 2: TS_TYPE_PARAMETER_NAME@582..583 + 0: IDENT@582..583 "T" [] [] 3: (empty) 4: (empty) - 1: COMMA@652..654 "," [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER@654..659 + 1: COMMA@583..585 "," [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER@585..590 0: (empty) - 1: OUT_KW@654..658 "out" [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER_NAME@658..659 - 0: IDENT@658..659 "T" [] [] + 1: OUT_KW@585..589 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@589..590 + 0: IDENT@589..590 "T" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@659..660 ">" [] [] - 1: JS_PARAMETERS@660..663 - 0: L_PAREN@660..661 "(" [] [] - 1: JS_PARAMETER_LIST@661..661 - 2: R_PAREN@661..663 ")" [] [Whitespace(" ")] - 2: FAT_ARROW@663..666 "=>" [] [Whitespace(" ")] - 3: TS_OBJECT_TYPE@666..668 - 0: L_CURLY@666..667 "{" [] [] - 1: TS_TYPE_MEMBER_LIST@667..667 - 2: R_CURLY@667..668 "}" [] [] + 2: R_ANGLE@590..591 ">" [] [] + 1: JS_PARAMETERS@591..594 + 0: L_PAREN@591..592 "(" [] [] + 1: JS_PARAMETER_LIST@592..592 + 2: R_PAREN@592..594 ")" [] [Whitespace(" ")] + 2: FAT_ARROW@594..597 "=>" [] [Whitespace(" ")] + 3: TS_OBJECT_TYPE@597..599 + 0: L_CURLY@597..598 "{" [] [] + 1: TS_TYPE_MEMBER_LIST@598..598 + 2: R_CURLY@598..599 "}" [] [] 2: (empty) - 1: SEMICOLON@668..669 ";" [] [] - 31: JS_VARIABLE_STATEMENT@669..697 - 0: JS_VARIABLE_DECLARATION@669..696 - 0: LET_KW@669..675 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: JS_VARIABLE_DECLARATOR_LIST@675..696 - 0: JS_VARIABLE_DECLARATOR@675..696 - 0: JS_IDENTIFIER_BINDING@675..676 - 0: IDENT@675..676 "x" [] [] - 1: TS_TYPE_ANNOTATION@676..696 - 0: COLON@676..678 ":" [] [Whitespace(" ")] - 1: TS_CONSTRUCTOR_TYPE@678..696 + 1: SEMICOLON@599..600 ";" [] [] + 29: JS_VARIABLE_STATEMENT@600..627 + 0: JS_VARIABLE_DECLARATION@600..626 + 0: LET_KW@600..605 "let" [Newline("\n")] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATOR_LIST@605..626 + 0: JS_VARIABLE_DECLARATOR@605..626 + 0: JS_IDENTIFIER_BINDING@605..606 + 0: IDENT@605..606 "x" [] [] + 1: TS_TYPE_ANNOTATION@606..626 + 0: COLON@606..608 ":" [] [Whitespace(" ")] + 1: TS_CONSTRUCTOR_TYPE@608..626 0: (empty) - 1: NEW_KW@678..682 "new" [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETERS@682..688 - 0: L_ANGLE@682..683 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@683..687 - 0: TS_TYPE_PARAMETER@683..687 - 0: IN_KW@683..686 "in" [] [Whitespace(" ")] + 1: NEW_KW@608..612 "new" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETERS@612..618 + 0: L_ANGLE@612..613 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@613..617 + 0: TS_TYPE_PARAMETER@613..617 + 0: IN_KW@613..616 "in" [] [Whitespace(" ")] 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@686..687 - 0: IDENT@686..687 "T" [] [] + 2: TS_TYPE_PARAMETER_NAME@616..617 + 0: IDENT@616..617 "T" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@687..688 ">" [] [] - 3: JS_PARAMETERS@688..691 - 0: L_PAREN@688..689 "(" [] [] - 1: JS_PARAMETER_LIST@689..689 - 2: R_PAREN@689..691 ")" [] [Whitespace(" ")] - 4: FAT_ARROW@691..694 "=>" [] [Whitespace(" ")] - 5: TS_OBJECT_TYPE@694..696 - 0: L_CURLY@694..695 "{" [] [] - 1: TS_TYPE_MEMBER_LIST@695..695 - 2: R_CURLY@695..696 "}" [] [] + 2: R_ANGLE@617..618 ">" [] [] + 3: JS_PARAMETERS@618..621 + 0: L_PAREN@618..619 "(" [] [] + 1: JS_PARAMETER_LIST@619..619 + 2: R_PAREN@619..621 ")" [] [Whitespace(" ")] + 4: FAT_ARROW@621..624 "=>" [] [Whitespace(" ")] + 5: TS_OBJECT_TYPE@624..626 + 0: L_CURLY@624..625 "{" [] [] + 1: TS_TYPE_MEMBER_LIST@625..625 + 2: R_CURLY@625..626 "}" [] [] 2: (empty) - 1: SEMICOLON@696..697 ";" [] [] - 32: JS_VARIABLE_STATEMENT@697..726 - 0: JS_VARIABLE_DECLARATION@697..725 - 0: LET_KW@697..703 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: JS_VARIABLE_DECLARATOR_LIST@703..725 - 0: JS_VARIABLE_DECLARATOR@703..725 - 0: JS_IDENTIFIER_BINDING@703..704 - 0: IDENT@703..704 "x" [] [] - 1: TS_TYPE_ANNOTATION@704..725 - 0: COLON@704..706 ":" [] [Whitespace(" ")] - 1: TS_CONSTRUCTOR_TYPE@706..725 + 1: SEMICOLON@626..627 ";" [] [] + 30: JS_VARIABLE_STATEMENT@627..655 + 0: JS_VARIABLE_DECLARATION@627..654 + 0: LET_KW@627..632 "let" [Newline("\n")] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATOR_LIST@632..654 + 0: JS_VARIABLE_DECLARATOR@632..654 + 0: JS_IDENTIFIER_BINDING@632..633 + 0: IDENT@632..633 "x" [] [] + 1: TS_TYPE_ANNOTATION@633..654 + 0: COLON@633..635 ":" [] [Whitespace(" ")] + 1: TS_CONSTRUCTOR_TYPE@635..654 0: (empty) - 1: NEW_KW@706..710 "new" [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETERS@710..717 - 0: L_ANGLE@710..711 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@711..716 - 0: TS_TYPE_PARAMETER@711..716 + 1: NEW_KW@635..639 "new" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETERS@639..646 + 0: L_ANGLE@639..640 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@640..645 + 0: TS_TYPE_PARAMETER@640..645 0: (empty) - 1: OUT_KW@711..715 "out" [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER_NAME@715..716 - 0: IDENT@715..716 "T" [] [] + 1: OUT_KW@640..644 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@644..645 + 0: IDENT@644..645 "T" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@716..717 ">" [] [] - 3: JS_PARAMETERS@717..720 - 0: L_PAREN@717..718 "(" [] [] - 1: JS_PARAMETER_LIST@718..718 - 2: R_PAREN@718..720 ")" [] [Whitespace(" ")] - 4: FAT_ARROW@720..723 "=>" [] [Whitespace(" ")] - 5: TS_OBJECT_TYPE@723..725 - 0: L_CURLY@723..724 "{" [] [] - 1: TS_TYPE_MEMBER_LIST@724..724 - 2: R_CURLY@724..725 "}" [] [] + 2: R_ANGLE@645..646 ">" [] [] + 3: JS_PARAMETERS@646..649 + 0: L_PAREN@646..647 "(" [] [] + 1: JS_PARAMETER_LIST@647..647 + 2: R_PAREN@647..649 ")" [] [Whitespace(" ")] + 4: FAT_ARROW@649..652 "=>" [] [Whitespace(" ")] + 5: TS_OBJECT_TYPE@652..654 + 0: L_CURLY@652..653 "{" [] [] + 1: TS_TYPE_MEMBER_LIST@653..653 + 2: R_CURLY@653..654 "}" [] [] 2: (empty) - 1: SEMICOLON@725..726 ";" [] [] - 33: JS_VARIABLE_STATEMENT@726..761 - 0: JS_VARIABLE_DECLARATION@726..760 - 0: LET_KW@726..732 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: JS_VARIABLE_DECLARATOR_LIST@732..760 - 0: JS_VARIABLE_DECLARATOR@732..760 - 0: JS_IDENTIFIER_BINDING@732..733 - 0: IDENT@732..733 "x" [] [] - 1: TS_TYPE_ANNOTATION@733..760 - 0: COLON@733..735 ":" [] [Whitespace(" ")] - 1: TS_CONSTRUCTOR_TYPE@735..760 + 1: SEMICOLON@654..655 ";" [] [] + 31: JS_VARIABLE_STATEMENT@655..689 + 0: JS_VARIABLE_DECLARATION@655..688 + 0: LET_KW@655..660 "let" [Newline("\n")] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATOR_LIST@660..688 + 0: JS_VARIABLE_DECLARATOR@660..688 + 0: JS_IDENTIFIER_BINDING@660..661 + 0: IDENT@660..661 "x" [] [] + 1: TS_TYPE_ANNOTATION@661..688 + 0: COLON@661..663 ":" [] [Whitespace(" ")] + 1: TS_CONSTRUCTOR_TYPE@663..688 0: (empty) - 1: NEW_KW@735..739 "new" [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETERS@739..752 - 0: L_ANGLE@739..740 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@740..751 - 0: TS_TYPE_PARAMETER@740..744 - 0: IN_KW@740..743 "in" [] [Whitespace(" ")] + 1: NEW_KW@663..667 "new" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETERS@667..680 + 0: L_ANGLE@667..668 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@668..679 + 0: TS_TYPE_PARAMETER@668..672 + 0: IN_KW@668..671 "in" [] [Whitespace(" ")] 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@743..744 - 0: IDENT@743..744 "T" [] [] + 2: TS_TYPE_PARAMETER_NAME@671..672 + 0: IDENT@671..672 "T" [] [] 3: (empty) 4: (empty) - 1: COMMA@744..746 "," [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER@746..751 + 1: COMMA@672..674 "," [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER@674..679 0: (empty) - 1: OUT_KW@746..750 "out" [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER_NAME@750..751 - 0: IDENT@750..751 "T" [] [] + 1: OUT_KW@674..678 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@678..679 + 0: IDENT@678..679 "T" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@751..752 ">" [] [] - 3: JS_PARAMETERS@752..755 - 0: L_PAREN@752..753 "(" [] [] - 1: JS_PARAMETER_LIST@753..753 - 2: R_PAREN@753..755 ")" [] [Whitespace(" ")] - 4: FAT_ARROW@755..758 "=>" [] [Whitespace(" ")] - 5: TS_OBJECT_TYPE@758..760 - 0: L_CURLY@758..759 "{" [] [] - 1: TS_TYPE_MEMBER_LIST@759..759 - 2: R_CURLY@759..760 "}" [] [] + 2: R_ANGLE@679..680 ">" [] [] + 3: JS_PARAMETERS@680..683 + 0: L_PAREN@680..681 "(" [] [] + 1: JS_PARAMETER_LIST@681..681 + 2: R_PAREN@681..683 ")" [] [Whitespace(" ")] + 4: FAT_ARROW@683..686 "=>" [] [Whitespace(" ")] + 5: TS_OBJECT_TYPE@686..688 + 0: L_CURLY@686..687 "{" [] [] + 1: TS_TYPE_MEMBER_LIST@687..687 + 2: R_CURLY@687..688 "}" [] [] 2: (empty) - 1: SEMICOLON@760..761 ";" [] [] - 34: JS_VARIABLE_STATEMENT@761..789 - 0: JS_VARIABLE_DECLARATION@761..788 - 0: LET_KW@761..767 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: JS_VARIABLE_DECLARATOR_LIST@767..788 - 0: JS_VARIABLE_DECLARATOR@767..788 - 0: JS_IDENTIFIER_BINDING@767..768 - 0: IDENT@767..768 "x" [] [] - 1: TS_TYPE_ANNOTATION@768..788 - 0: COLON@768..770 ":" [] [Whitespace(" ")] - 1: TS_OBJECT_TYPE@770..788 - 0: L_CURLY@770..772 "{" [] [Whitespace(" ")] - 1: TS_TYPE_MEMBER_LIST@772..787 - 0: TS_METHOD_SIGNATURE_TYPE_MEMBER@772..787 - 0: JS_LITERAL_MEMBER_NAME@772..773 - 0: IDENT@772..773 "y" [] [] + 1: SEMICOLON@688..689 ";" [] [] + 32: JS_VARIABLE_STATEMENT@689..716 + 0: JS_VARIABLE_DECLARATION@689..715 + 0: LET_KW@689..694 "let" [Newline("\n")] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATOR_LIST@694..715 + 0: JS_VARIABLE_DECLARATOR@694..715 + 0: JS_IDENTIFIER_BINDING@694..695 + 0: IDENT@694..695 "x" [] [] + 1: TS_TYPE_ANNOTATION@695..715 + 0: COLON@695..697 ":" [] [Whitespace(" ")] + 1: TS_OBJECT_TYPE@697..715 + 0: L_CURLY@697..699 "{" [] [Whitespace(" ")] + 1: TS_TYPE_MEMBER_LIST@699..714 + 0: TS_METHOD_SIGNATURE_TYPE_MEMBER@699..714 + 0: JS_LITERAL_MEMBER_NAME@699..700 + 0: IDENT@699..700 "y" [] [] 1: (empty) - 2: TS_TYPE_PARAMETERS@773..779 - 0: L_ANGLE@773..774 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@774..778 - 0: TS_TYPE_PARAMETER@774..778 - 0: IN_KW@774..777 "in" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETERS@700..706 + 0: L_ANGLE@700..701 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@701..705 + 0: TS_TYPE_PARAMETER@701..705 + 0: IN_KW@701..704 "in" [] [Whitespace(" ")] 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@777..778 - 0: IDENT@777..778 "T" [] [] + 2: TS_TYPE_PARAMETER_NAME@704..705 + 0: IDENT@704..705 "T" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@778..779 ">" [] [] - 3: JS_PARAMETERS@779..781 - 0: L_PAREN@779..780 "(" [] [] - 1: JS_PARAMETER_LIST@780..780 - 2: R_PAREN@780..781 ")" [] [] - 4: TS_RETURN_TYPE_ANNOTATION@781..787 - 0: COLON@781..783 ":" [] [Whitespace(" ")] - 1: TS_ANY_TYPE@783..787 - 0: ANY_KW@783..787 "any" [] [Whitespace(" ")] + 2: R_ANGLE@705..706 ">" [] [] + 3: JS_PARAMETERS@706..708 + 0: L_PAREN@706..707 "(" [] [] + 1: JS_PARAMETER_LIST@707..707 + 2: R_PAREN@707..708 ")" [] [] + 4: TS_RETURN_TYPE_ANNOTATION@708..714 + 0: COLON@708..710 ":" [] [Whitespace(" ")] + 1: TS_ANY_TYPE@710..714 + 0: ANY_KW@710..714 "any" [] [Whitespace(" ")] 5: (empty) - 2: R_CURLY@787..788 "}" [] [] + 2: R_CURLY@714..715 "}" [] [] 2: (empty) - 1: SEMICOLON@788..789 ";" [] [] - 35: JS_VARIABLE_STATEMENT@789..818 - 0: JS_VARIABLE_DECLARATION@789..817 - 0: LET_KW@789..795 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: JS_VARIABLE_DECLARATOR_LIST@795..817 - 0: JS_VARIABLE_DECLARATOR@795..817 - 0: JS_IDENTIFIER_BINDING@795..796 - 0: IDENT@795..796 "x" [] [] - 1: TS_TYPE_ANNOTATION@796..817 - 0: COLON@796..798 ":" [] [Whitespace(" ")] - 1: TS_OBJECT_TYPE@798..817 - 0: L_CURLY@798..800 "{" [] [Whitespace(" ")] - 1: TS_TYPE_MEMBER_LIST@800..816 - 0: TS_METHOD_SIGNATURE_TYPE_MEMBER@800..816 - 0: JS_LITERAL_MEMBER_NAME@800..801 - 0: IDENT@800..801 "y" [] [] + 1: SEMICOLON@715..716 ";" [] [] + 33: JS_VARIABLE_STATEMENT@716..744 + 0: JS_VARIABLE_DECLARATION@716..743 + 0: LET_KW@716..721 "let" [Newline("\n")] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATOR_LIST@721..743 + 0: JS_VARIABLE_DECLARATOR@721..743 + 0: JS_IDENTIFIER_BINDING@721..722 + 0: IDENT@721..722 "x" [] [] + 1: TS_TYPE_ANNOTATION@722..743 + 0: COLON@722..724 ":" [] [Whitespace(" ")] + 1: TS_OBJECT_TYPE@724..743 + 0: L_CURLY@724..726 "{" [] [Whitespace(" ")] + 1: TS_TYPE_MEMBER_LIST@726..742 + 0: TS_METHOD_SIGNATURE_TYPE_MEMBER@726..742 + 0: JS_LITERAL_MEMBER_NAME@726..727 + 0: IDENT@726..727 "y" [] [] 1: (empty) - 2: TS_TYPE_PARAMETERS@801..808 - 0: L_ANGLE@801..802 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@802..807 - 0: TS_TYPE_PARAMETER@802..807 + 2: TS_TYPE_PARAMETERS@727..734 + 0: L_ANGLE@727..728 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@728..733 + 0: TS_TYPE_PARAMETER@728..733 0: (empty) - 1: OUT_KW@802..806 "out" [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER_NAME@806..807 - 0: IDENT@806..807 "T" [] [] + 1: OUT_KW@728..732 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@732..733 + 0: IDENT@732..733 "T" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@807..808 ">" [] [] - 3: JS_PARAMETERS@808..810 - 0: L_PAREN@808..809 "(" [] [] - 1: JS_PARAMETER_LIST@809..809 - 2: R_PAREN@809..810 ")" [] [] - 4: TS_RETURN_TYPE_ANNOTATION@810..816 - 0: COLON@810..812 ":" [] [Whitespace(" ")] - 1: TS_ANY_TYPE@812..816 - 0: ANY_KW@812..816 "any" [] [Whitespace(" ")] + 2: R_ANGLE@733..734 ">" [] [] + 3: JS_PARAMETERS@734..736 + 0: L_PAREN@734..735 "(" [] [] + 1: JS_PARAMETER_LIST@735..735 + 2: R_PAREN@735..736 ")" [] [] + 4: TS_RETURN_TYPE_ANNOTATION@736..742 + 0: COLON@736..738 ":" [] [Whitespace(" ")] + 1: TS_ANY_TYPE@738..742 + 0: ANY_KW@738..742 "any" [] [Whitespace(" ")] 5: (empty) - 2: R_CURLY@816..817 "}" [] [] + 2: R_CURLY@742..743 "}" [] [] 2: (empty) - 1: SEMICOLON@817..818 ";" [] [] - 36: JS_VARIABLE_STATEMENT@818..853 - 0: JS_VARIABLE_DECLARATION@818..852 - 0: LET_KW@818..824 "let" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: JS_VARIABLE_DECLARATOR_LIST@824..852 - 0: JS_VARIABLE_DECLARATOR@824..852 - 0: JS_IDENTIFIER_BINDING@824..825 - 0: IDENT@824..825 "x" [] [] - 1: TS_TYPE_ANNOTATION@825..852 - 0: COLON@825..827 ":" [] [Whitespace(" ")] - 1: TS_OBJECT_TYPE@827..852 - 0: L_CURLY@827..829 "{" [] [Whitespace(" ")] - 1: TS_TYPE_MEMBER_LIST@829..851 - 0: TS_METHOD_SIGNATURE_TYPE_MEMBER@829..851 - 0: JS_LITERAL_MEMBER_NAME@829..830 - 0: IDENT@829..830 "y" [] [] + 1: SEMICOLON@743..744 ";" [] [] + 34: JS_VARIABLE_STATEMENT@744..778 + 0: JS_VARIABLE_DECLARATION@744..777 + 0: LET_KW@744..749 "let" [Newline("\n")] [Whitespace(" ")] + 1: JS_VARIABLE_DECLARATOR_LIST@749..777 + 0: JS_VARIABLE_DECLARATOR@749..777 + 0: JS_IDENTIFIER_BINDING@749..750 + 0: IDENT@749..750 "x" [] [] + 1: TS_TYPE_ANNOTATION@750..777 + 0: COLON@750..752 ":" [] [Whitespace(" ")] + 1: TS_OBJECT_TYPE@752..777 + 0: L_CURLY@752..754 "{" [] [Whitespace(" ")] + 1: TS_TYPE_MEMBER_LIST@754..776 + 0: TS_METHOD_SIGNATURE_TYPE_MEMBER@754..776 + 0: JS_LITERAL_MEMBER_NAME@754..755 + 0: IDENT@754..755 "y" [] [] 1: (empty) - 2: TS_TYPE_PARAMETERS@830..843 - 0: L_ANGLE@830..831 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@831..842 - 0: TS_TYPE_PARAMETER@831..835 - 0: IN_KW@831..834 "in" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETERS@755..768 + 0: L_ANGLE@755..756 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@756..767 + 0: TS_TYPE_PARAMETER@756..760 + 0: IN_KW@756..759 "in" [] [Whitespace(" ")] 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@834..835 - 0: IDENT@834..835 "T" [] [] + 2: TS_TYPE_PARAMETER_NAME@759..760 + 0: IDENT@759..760 "T" [] [] 3: (empty) 4: (empty) - 1: COMMA@835..837 "," [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER@837..842 + 1: COMMA@760..762 "," [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER@762..767 0: (empty) - 1: OUT_KW@837..841 "out" [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER_NAME@841..842 - 0: IDENT@841..842 "T" [] [] + 1: OUT_KW@762..766 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@766..767 + 0: IDENT@766..767 "T" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@842..843 ">" [] [] - 3: JS_PARAMETERS@843..845 - 0: L_PAREN@843..844 "(" [] [] - 1: JS_PARAMETER_LIST@844..844 - 2: R_PAREN@844..845 ")" [] [] - 4: TS_RETURN_TYPE_ANNOTATION@845..851 - 0: COLON@845..847 ":" [] [Whitespace(" ")] - 1: TS_ANY_TYPE@847..851 - 0: ANY_KW@847..851 "any" [] [Whitespace(" ")] + 2: R_ANGLE@767..768 ">" [] [] + 3: JS_PARAMETERS@768..770 + 0: L_PAREN@768..769 "(" [] [] + 1: JS_PARAMETER_LIST@769..769 + 2: R_PAREN@769..770 ")" [] [] + 4: TS_RETURN_TYPE_ANNOTATION@770..776 + 0: COLON@770..772 ":" [] [Whitespace(" ")] + 1: TS_ANY_TYPE@772..776 + 0: ANY_KW@772..776 "any" [] [Whitespace(" ")] 5: (empty) - 2: R_CURLY@851..852 "}" [] [] + 2: R_CURLY@776..777 "}" [] [] 2: (empty) - 1: SEMICOLON@852..853 ";" [] [] - 3: EOF@853..854 "" [Newline("\n")] [] + 1: SEMICOLON@777..778 ";" [] [] + 3: EOF@778..779 "" [Newline("\n")] [] -- -type_parameter_modifier1.ts:1:30 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:1:29 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × 'in' modifier can only appear on a type parameter of a class, interface or type alias. - > 1 │ export default function foo() {} - │ ^^ - 2 │ export function foo() {} - 3 │ export function foo1() {} + > 1 │ export default function foo() {} + │ ^^ + 2 │ export function foo() {} + 3 │ export function foo1() {} -- -type_parameter_modifier1.ts:2:22 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:2:21 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × 'out' modifier can only appear on a type parameter of a class, interface or type alias. - 1 │ export default function foo() {} - > 2 │ export function foo() {} - │ ^^^ - 3 │ export function foo1() {} - 4 │ export function foo2() {} + 1 │ export default function foo() {} + > 2 │ export function foo() {} + │ ^^^ + 3 │ export function foo1() {} + 4 │ export function foo2() {} -- -type_parameter_modifier1.ts:3:23 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:3:22 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × 'in' modifier can only appear on a type parameter of a class, interface or type alias. - 1 │ export default function foo() {} - 2 │ export function foo() {} - > 3 │ export function foo1() {} - │ ^^ - 4 │ export function foo2() {} - 5 │ let foo: Foo + 1 │ export default function foo() {} + 2 │ export function foo() {} + > 3 │ export function foo1() {} + │ ^^ + 4 │ export function foo2() {} + 5 │ let foo: Foo -- -type_parameter_modifier1.ts:4:23 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:4:22 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × 'out' modifier can only appear on a type parameter of a class, interface or type alias. - 2 │ export function foo() {} - 3 │ export function foo1() {} - > 4 │ export function foo2() {} - │ ^^^ - 5 │ let foo: Foo - 6 │ let foo: Foo + 2 │ export function foo() {} + 3 │ export function foo1() {} + > 4 │ export function foo2() {} + │ ^^^ + 5 │ let foo: Foo + 6 │ let foo: Foo -- -type_parameter_modifier1.ts:5:18 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:5:17 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × expected `,` but instead found `T` - 3 │ export function foo1() {} - 4 │ export function foo2() {} - > 5 │ let foo: Foo - │ ^ - 6 │ let foo: Foo - 7 │ declare function foo() + 3 │ export function foo1() {} + 4 │ export function foo2() {} + > 5 │ let foo: Foo + │ ^ + 6 │ let foo: Foo + 7 │ declare function foo() i Remove T -- -type_parameter_modifier1.ts:6:19 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:6:18 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × expected `,` but instead found `T` - 4 │ export function foo2() {} - 5 │ let foo: Foo - > 6 │ let foo: Foo - │ ^ - 7 │ declare function foo() - 8 │ declare function foo() + 4 │ export function foo2() {} + 5 │ let foo: Foo + > 6 │ let foo: Foo + │ ^ + 7 │ declare function foo() + 8 │ declare function foo() i Remove T -- -type_parameter_modifier1.ts:7:23 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:7:22 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × 'in' modifier can only appear on a type parameter of a class, interface or type alias. - 5 │ let foo: Foo - 6 │ let foo: Foo - > 7 │ declare function foo() - │ ^^ - 8 │ declare function foo() - 9 │ declare let foo: Foo + 5 │ let foo: Foo + 6 │ let foo: Foo + > 7 │ declare function foo() + │ ^^ + 8 │ declare function foo() + 9 │ declare let foo: Foo -- -type_parameter_modifier1.ts:8:23 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:8:22 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × 'out' modifier can only appear on a type parameter of a class, interface or type alias. - 6 │ let foo: Foo - 7 │ declare function foo() - > 8 │ declare function foo() - │ ^^^ - 9 │ declare let foo: Foo - 10 │ declare let foo: Foo + 6 │ let foo: Foo + 7 │ declare function foo() + > 8 │ declare function foo() + │ ^^^ + 9 │ declare let foo: Foo + 10 │ declare let foo: Foo -- -type_parameter_modifier1.ts:9:26 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:9:25 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × expected `,` but instead found `T` - 7 │ declare function foo() - 8 │ declare function foo() - > 9 │ declare let foo: Foo - │ ^ - 10 │ declare let foo: Foo - 11 │ Foo = class {} + 7 │ declare function foo() + 8 │ declare function foo() + > 9 │ declare let foo: Foo + │ ^ + 10 │ declare let foo: Foo + 11 │ foo = function () {} i Remove T -- -type_parameter_modifier1.ts:10:27 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:10:26 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × expected `,` but instead found `T` - 8 │ declare function foo() - 9 │ declare let foo: Foo - > 10 │ declare let foo: Foo - │ ^ - 11 │ Foo = class {} - 12 │ Foo = class {} + 8 │ declare function foo() + 9 │ declare let foo: Foo + > 10 │ declare let foo: Foo + │ ^ + 11 │ foo = function () {} + 12 │ foo = function () {} i Remove T -- -type_parameter_modifier1.ts:13:18 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:11:17 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × 'in' modifier can only appear on a type parameter of a class, interface or type alias. - 11 │ Foo = class {} - 12 │ Foo = class {} - > 13 │ foo = function () {} - │ ^^ - 14 │ foo = function () {} - 15 │ class Foo { foo(): T {} } + 9 │ declare let foo: Foo + 10 │ declare let foo: Foo + > 11 │ foo = function () {} + │ ^^ + 12 │ foo = function () {} + 13 │ class Foo { foo(): T {} } -- -type_parameter_modifier1.ts:14:18 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:12:17 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × 'out' modifier can only appear on a type parameter of a class, interface or type alias. - 12 │ Foo = class {} - 13 │ foo = function () {} - > 14 │ foo = function () {} - │ ^^^ - 15 │ class Foo { foo(): T {} } - 16 │ class Foo { foo(): T {} } + 10 │ declare let foo: Foo + 11 │ foo = function () {} + > 12 │ foo = function () {} + │ ^^^ + 13 │ class Foo { foo(): T {} } + 14 │ class Foo { foo(): T {} } -- -type_parameter_modifier1.ts:15:18 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:13:17 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × 'in' modifier can only appear on a type parameter of a class, interface or type alias. - 13 │ foo = function () {} - 14 │ foo = function () {} - > 15 │ class Foo { foo(): T {} } - │ ^^ - 16 │ class Foo { foo(): T {} } - 17 │ foo = { foo(): T {} }; + 11 │ foo = function () {} + 12 │ foo = function () {} + > 13 │ class Foo { foo(): T {} } + │ ^^ + 14 │ class Foo { foo(): T {} } + 15 │ foo = { foo(): T {} }; -- -type_parameter_modifier1.ts:16:18 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:14:17 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × 'out' modifier can only appear on a type parameter of a class, interface or type alias. - 14 │ foo = function () {} - 15 │ class Foo { foo(): T {} } - > 16 │ class Foo { foo(): T {} } - │ ^^^ - 17 │ foo = { foo(): T {} }; - 18 │ foo = { foo(): T {} }; + 12 │ foo = function () {} + 13 │ class Foo { foo(): T {} } + > 14 │ class Foo { foo(): T {} } + │ ^^^ + 15 │ foo = { foo(): T {} }; + 16 │ foo = { foo(): T {} }; -- -type_parameter_modifier1.ts:17:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:15:13 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × 'in' modifier can only appear on a type parameter of a class, interface or type alias. - 15 │ class Foo { foo(): T {} } - 16 │ class Foo { foo(): T {} } - > 17 │ foo = { foo(): T {} }; - │ ^^ - 18 │ foo = { foo(): T {} }; - 19 │ () => {}; + 13 │ class Foo { foo(): T {} } + 14 │ class Foo { foo(): T {} } + > 15 │ foo = { foo(): T {} }; + │ ^^ + 16 │ foo = { foo(): T {} }; + 17 │ () => {}; -- -type_parameter_modifier1.ts:18:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:16:13 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × 'out' modifier can only appear on a type parameter of a class, interface or type alias. - 16 │ class Foo { foo(): T {} } - 17 │ foo = { foo(): T {} }; - > 18 │ foo = { foo(): T {} }; - │ ^^^ - 19 │ () => {}; - 20 │ () => {}; + 14 │ class Foo { foo(): T {} } + 15 │ foo = { foo(): T {} }; + > 16 │ foo = { foo(): T {} }; + │ ^^^ + 17 │ () => {}; + 18 │ () => {}; -- -type_parameter_modifier1.ts:19:6 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:17:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × expected `>` but instead found `T` - 17 │ foo = { foo(): T {} }; - 18 │ foo = { foo(): T {} }; - > 19 │ () => {}; - │ ^ - 20 │ () => {}; - 21 │ () => {}; + 15 │ foo = { foo(): T {} }; + 16 │ foo = { foo(): T {} }; + > 17 │ () => {}; + │ ^ + 18 │ () => {}; + 19 │ () => {}; i Remove T -- -type_parameter_modifier1.ts:19:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:17:8 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Parenthesized expression didnt contain anything - 17 │ foo = { foo(): T {} }; - 18 │ foo = { foo(): T {} }; - > 19 │ () => {}; - │ ^ - 20 │ () => {}; - 21 │ () => {}; + 15 │ foo = { foo(): T {} }; + 16 │ foo = { foo(): T {} }; + > 17 │ () => {}; + │ ^ + 18 │ () => {}; + 19 │ () => {}; i Expected an expression here -- -type_parameter_modifier1.ts:19:11 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:17:10 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Expected a semicolon or an implicit semicolon after a statement, but found none - 17 │ foo = { foo(): T {} }; - 18 │ foo = { foo(): T {} }; - > 19 │ () => {}; - │ ^^ - 20 │ () => {}; - 21 │ () => {}; + 15 │ foo = { foo(): T {} }; + 16 │ foo = { foo(): T {} }; + > 17 │ () => {}; + │ ^^ + 18 │ () => {}; + 19 │ () => {}; i An explicit or implicit semicolon is expected here... - 17 │ foo = { foo(): T {} }; - 18 │ foo = { foo(): T {} }; - > 19 │ () => {}; - │ ^^ - 20 │ () => {}; - 21 │ () => {}; + 15 │ foo = { foo(): T {} }; + 16 │ foo = { foo(): T {} }; + > 17 │ () => {}; + │ ^^ + 18 │ () => {}; + 19 │ () => {}; i ...Which is required to end this statement - 17 │ foo = { foo(): T {} }; - 18 │ foo = { foo(): T {} }; - > 19 │ () => {}; - │ ^^^^^^^^^^^ - 20 │ () => {}; - 21 │ () => {}; + 15 │ foo = { foo(): T {} }; + 16 │ foo = { foo(): T {} }; + > 17 │ () => {}; + │ ^^^^^^^^^^^ + 18 │ () => {}; + 19 │ () => {}; -- -type_parameter_modifier1.ts:20:3 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:18:2 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × 'out' modifier can only appear on a type parameter of a class, interface or type alias. - 18 │ foo = { foo(): T {} }; - 19 │ () => {}; - > 20 │ () => {}; - │ ^^^ - 21 │ () => {}; - 22 │ let x: () => {}; + 16 │ foo = { foo(): T {} }; + 17 │ () => {}; + > 18 │ () => {}; + │ ^^^ + 19 │ () => {}; + 20 │ let x: () => {}; -- -type_parameter_modifier1.ts:21:6 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:19:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × expected `>` but instead found `T` - 19 │ () => {}; - 20 │ () => {}; - > 21 │ () => {}; - │ ^ - 22 │ let x: () => {}; - 23 │ let x: () => {}; + 17 │ () => {}; + 18 │ () => {}; + > 19 │ () => {}; + │ ^ + 20 │ let x: () => {}; + 21 │ let x: () => {}; i Remove T -- -type_parameter_modifier1.ts:21:13 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:19:12 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Expected a semicolon or an implicit semicolon after a statement, but found none - 19 │ () => {}; - 20 │ () => {}; - > 21 │ () => {}; - │ ^ - 22 │ let x: () => {}; - 23 │ let x: () => {}; + 17 │ () => {}; + 18 │ () => {}; + > 19 │ () => {}; + │ ^ + 20 │ let x: () => {}; + 21 │ let x: () => {}; i An explicit or implicit semicolon is expected here... - 19 │ () => {}; - 20 │ () => {}; - > 21 │ () => {}; - │ ^ - 22 │ let x: () => {}; - 23 │ let x: () => {}; + 17 │ () => {}; + 18 │ () => {}; + > 19 │ () => {}; + │ ^ + 20 │ let x: () => {}; + 21 │ let x: () => {}; i ...Which is required to end this statement - 19 │ () => {}; - 20 │ () => {}; - > 21 │ () => {}; - │ ^^^^^^^^^^^^ - 22 │ let x: () => {}; - 23 │ let x: () => {}; + 17 │ () => {}; + 18 │ () => {}; + > 19 │ () => {}; + │ ^^^^^^^^^^^^ + 20 │ let x: () => {}; + 21 │ let x: () => {}; -- -type_parameter_modifier1.ts:21:16 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:19:15 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Parenthesized expression didnt contain anything - 19 │ () => {}; - 20 │ () => {}; - > 21 │ () => {}; - │ ^ - 22 │ let x: () => {}; - 23 │ let x: () => {}; + 17 │ () => {}; + 18 │ () => {}; + > 19 │ () => {}; + │ ^ + 20 │ let x: () => {}; + 21 │ let x: () => {}; i Expected an expression here -- -type_parameter_modifier1.ts:21:18 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:19:17 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Expected a semicolon or an implicit semicolon after a statement, but found none - 19 │ () => {}; - 20 │ () => {}; - > 21 │ () => {}; - │ ^^ - 22 │ let x: () => {}; - 23 │ let x: () => {}; + 17 │ () => {}; + 18 │ () => {}; + > 19 │ () => {}; + │ ^^ + 20 │ let x: () => {}; + 21 │ let x: () => {}; i An explicit or implicit semicolon is expected here... - 19 │ () => {}; - 20 │ () => {}; - > 21 │ () => {}; - │ ^^ - 22 │ let x: () => {}; - 23 │ let x: () => {}; + 17 │ () => {}; + 18 │ () => {}; + > 19 │ () => {}; + │ ^^ + 20 │ let x: () => {}; + 21 │ let x: () => {}; i ...Which is required to end this statement - 19 │ () => {}; - 20 │ () => {}; - > 21 │ () => {}; - │ ^^^^^^^ - 22 │ let x: () => {}; - 23 │ let x: () => {}; + 17 │ () => {}; + 18 │ () => {}; + > 19 │ () => {}; + │ ^^^^^^^ + 20 │ let x: () => {}; + 21 │ let x: () => {}; -- -type_parameter_modifier1.ts:22:10 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:20:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × 'in' modifier can only appear on a type parameter of a class, interface or type alias. - 20 │ () => {}; - 21 │ () => {}; - > 22 │ let x: () => {}; - │ ^^ - 23 │ let x: () => {}; - 24 │ let x: () => {}; + 18 │ () => {}; + 19 │ () => {}; + > 20 │ let x: () => {}; + │ ^^ + 21 │ let x: () => {}; + 22 │ let x: () => {}; -- -type_parameter_modifier1.ts:23:10 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:21:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × 'out' modifier can only appear on a type parameter of a class, interface or type alias. - 21 │ () => {}; - 22 │ let x: () => {}; - > 23 │ let x: () => {}; - │ ^^^ - 24 │ let x: () => {}; - 25 │ let x: new () => {}; + 19 │ () => {}; + 20 │ let x: () => {}; + > 21 │ let x: () => {}; + │ ^^^ + 22 │ let x: () => {}; + 23 │ let x: new () => {}; -- -type_parameter_modifier1.ts:24:10 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:22:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × 'in' modifier can only appear on a type parameter of a class, interface or type alias. - 22 │ let x: () => {}; - 23 │ let x: () => {}; - > 24 │ let x: () => {}; - │ ^^ - 25 │ let x: new () => {}; - 26 │ let x: new () => {}; + 20 │ let x: () => {}; + 21 │ let x: () => {}; + > 22 │ let x: () => {}; + │ ^^ + 23 │ let x: new () => {}; + 24 │ let x: new () => {}; -- -type_parameter_modifier1.ts:24:16 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:22:15 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × 'out' modifier can only appear on a type parameter of a class, interface or type alias. - 22 │ let x: () => {}; - 23 │ let x: () => {}; - > 24 │ let x: () => {}; - │ ^^^ - 25 │ let x: new () => {}; - 26 │ let x: new () => {}; + 20 │ let x: () => {}; + 21 │ let x: () => {}; + > 22 │ let x: () => {}; + │ ^^^ + 23 │ let x: new () => {}; + 24 │ let x: new () => {}; -- -type_parameter_modifier1.ts:25:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:23:13 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × 'in' modifier can only appear on a type parameter of a class, interface or type alias. - 23 │ let x: () => {}; - 24 │ let x: () => {}; - > 25 │ let x: new () => {}; - │ ^^ - 26 │ let x: new () => {}; - 27 │ let x: new () => {}; + 21 │ let x: () => {}; + 22 │ let x: () => {}; + > 23 │ let x: new () => {}; + │ ^^ + 24 │ let x: new () => {}; + 25 │ let x: new () => {}; -- -type_parameter_modifier1.ts:26:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:24:13 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × 'out' modifier can only appear on a type parameter of a class, interface or type alias. - 24 │ let x: () => {}; - 25 │ let x: new () => {}; - > 26 │ let x: new () => {}; - │ ^^^ - 27 │ let x: new () => {}; - 28 │ let x: { y(): any }; + 22 │ let x: () => {}; + 23 │ let x: new () => {}; + > 24 │ let x: new () => {}; + │ ^^^ + 25 │ let x: new () => {}; + 26 │ let x: { y(): any }; -- -type_parameter_modifier1.ts:27:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:25:13 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × 'in' modifier can only appear on a type parameter of a class, interface or type alias. - 25 │ let x: new () => {}; - 26 │ let x: new () => {}; - > 27 │ let x: new () => {}; - │ ^^ - 28 │ let x: { y(): any }; - 29 │ let x: { y(): any }; + 23 │ let x: new () => {}; + 24 │ let x: new () => {}; + > 25 │ let x: new () => {}; + │ ^^ + 26 │ let x: { y(): any }; + 27 │ let x: { y(): any }; -- -type_parameter_modifier1.ts:27:20 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:25:19 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × 'out' modifier can only appear on a type parameter of a class, interface or type alias. - 25 │ let x: new () => {}; - 26 │ let x: new () => {}; - > 27 │ let x: new () => {}; - │ ^^^ - 28 │ let x: { y(): any }; - 29 │ let x: { y(): any }; + 23 │ let x: new () => {}; + 24 │ let x: new () => {}; + > 25 │ let x: new () => {}; + │ ^^^ + 26 │ let x: { y(): any }; + 27 │ let x: { y(): any }; -- -type_parameter_modifier1.ts:28:13 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:26:12 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × 'in' modifier can only appear on a type parameter of a class, interface or type alias. - 26 │ let x: new () => {}; - 27 │ let x: new () => {}; - > 28 │ let x: { y(): any }; - │ ^^ - 29 │ let x: { y(): any }; - 30 │ let x: { y(): any }; + 24 │ let x: new () => {}; + 25 │ let x: new () => {}; + > 26 │ let x: { y(): any }; + │ ^^ + 27 │ let x: { y(): any }; + 28 │ let x: { y(): any }; -- -type_parameter_modifier1.ts:29:13 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:27:12 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × 'out' modifier can only appear on a type parameter of a class, interface or type alias. - 27 │ let x: new () => {}; - 28 │ let x: { y(): any }; - > 29 │ let x: { y(): any }; - │ ^^^ - 30 │ let x: { y(): any }; - 31 │ + 25 │ let x: new () => {}; + 26 │ let x: { y(): any }; + > 27 │ let x: { y(): any }; + │ ^^^ + 28 │ let x: { y(): any }; + 29 │ -- -type_parameter_modifier1.ts:30:13 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:28:12 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × 'in' modifier can only appear on a type parameter of a class, interface or type alias. - 28 │ let x: { y(): any }; - 29 │ let x: { y(): any }; - > 30 │ let x: { y(): any }; - │ ^^ - 31 │ + 26 │ let x: { y(): any }; + 27 │ let x: { y(): any }; + > 28 │ let x: { y(): any }; + │ ^^ + 29 │ -- -type_parameter_modifier1.ts:30:19 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier1.ts:28:18 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × 'out' modifier can only appear on a type parameter of a class, interface or type alias. - 28 │ let x: { y(): any }; - 29 │ let x: { y(): any }; - > 30 │ let x: { y(): any }; - │ ^^^ - 31 │ + 26 │ let x: { y(): any }; + 27 │ let x: { y(): any }; + > 28 │ let x: { y(): any }; + │ ^^^ + 29 │ -- - export default function foo() {} - export function foo() {} - export function foo1() {} - export function foo2() {} - let foo: Foo - let foo: Foo - declare function foo() - declare function foo() - declare let foo: Foo - declare let foo: Foo - Foo = class {} - Foo = class {} - foo = function () {} - foo = function () {} - class Foo { foo(): T {} } - class Foo { foo(): T {} } - foo = { foo(): T {} }; - foo = { foo(): T {} }; - () => {}; - () => {}; - () => {}; - let x: () => {}; - let x: () => {}; - let x: () => {}; - let x: new () => {}; - let x: new () => {}; - let x: new () => {}; - let x: { y(): any }; - let x: { y(): any }; - let x: { y(): any }; +export default function foo() {} +export function foo() {} +export function foo1() {} +export function foo2() {} +let foo: Foo +let foo: Foo +declare function foo() +declare function foo() +declare let foo: Foo +declare let foo: Foo +foo = function () {} +foo = function () {} +class Foo { foo(): T {} } +class Foo { foo(): T {} } +foo = { foo(): T {} }; +foo = { foo(): T {} }; +() => {}; +() => {}; +() => {}; +let x: () => {}; +let x: () => {}; +let x: () => {}; +let x: new () => {}; +let x: new () => {}; +let x: new () => {}; +let x: { y(): any }; +let x: { y(): any }; +let x: { y(): any }; diff --git a/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier1.ts b/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier1.ts index 5c474f2eda8..4a156c350cf 100644 --- a/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier1.ts +++ b/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier1.ts @@ -1,30 +1,28 @@ - export default function foo() {} - export function foo() {} - export function foo1() {} - export function foo2() {} - let foo: Foo - let foo: Foo - declare function foo() - declare function foo() - declare let foo: Foo - declare let foo: Foo - Foo = class {} - Foo = class {} - foo = function () {} - foo = function () {} - class Foo { foo(): T {} } - class Foo { foo(): T {} } - foo = { foo(): T {} }; - foo = { foo(): T {} }; - () => {}; - () => {}; - () => {}; - let x: () => {}; - let x: () => {}; - let x: () => {}; - let x: new () => {}; - let x: new () => {}; - let x: new () => {}; - let x: { y(): any }; - let x: { y(): any }; - let x: { y(): any }; +export default function foo() {} +export function foo() {} +export function foo1() {} +export function foo2() {} +let foo: Foo +let foo: Foo +declare function foo() +declare function foo() +declare let foo: Foo +declare let foo: Foo +foo = function () {} +foo = function () {} +class Foo { foo(): T {} } +class Foo { foo(): T {} } +foo = { foo(): T {} }; +foo = { foo(): T {} }; +() => {}; +() => {}; +() => {}; +let x: () => {}; +let x: () => {}; +let x: () => {}; +let x: new () => {}; +let x: new () => {}; +let x: new () => {}; +let x: { y(): any }; +let x: { y(): any }; +let x: { y(): any }; From 205ff83eb690a529302740a0cc867f7eb173938a Mon Sep 17 00:00:00 2001 From: nissy-dev Date: Tue, 7 Mar 2023 23:11:42 +0900 Subject: [PATCH 21/22] feat: refactor allow_in_out_modifier arguments --- crates/rome_js_parser/src/syntax/class.rs | 5 +- .../src/syntax/typescript/statement.rs | 6 +- .../src/syntax/typescript/types.rs | 62 +-- .../inline/err/type_parameter_modifier.rast | 430 +++++++++++------- .../inline/err/type_parameter_modifier.ts | 1 + 5 files changed, 286 insertions(+), 218 deletions(-) diff --git a/crates/rome_js_parser/src/syntax/class.rs b/crates/rome_js_parser/src/syntax/class.rs index 947ea80c827..f13c459d45c 100644 --- a/crates/rome_js_parser/src/syntax/class.rs +++ b/crates/rome_js_parser/src/syntax/class.rs @@ -54,8 +54,7 @@ use super::function::LineBreak; use super::js_parse_error::unexpected_body_inside_ambient_context; use super::typescript::ts_parse_error::{self, unexpected_abstract_member_with_body}; use super::typescript::{ - expect_ts_index_signature_member, is_at_ts_index_signature_member, - parse_ts_type_parameters_with_modifiers, MemberParent, + expect_ts_index_signature_member, is_at_ts_index_signature_member, MemberParent, }; pub(crate) fn is_at_ts_abstract_class_declaration( @@ -256,7 +255,7 @@ fn parse_class(p: &mut JsParser, kind: ClassKind) -> CompletedMarker { TypeScript .parse_exclusive_syntax( p, - |p| parse_ts_type_parameters_with_modifiers(p, TypeContext::default(), true), + |p| parse_ts_type_parameters(p, TypeContext::default().and_allow_in_out_modifier(true)), |p, type_parameters| { ts_only_syntax_error(p, "class type parameters", type_parameters.range(p)) }, diff --git a/crates/rome_js_parser/src/syntax/typescript/statement.rs b/crates/rome_js_parser/src/syntax/typescript/statement.rs index 2cb5a58ef60..98867023e68 100644 --- a/crates/rome_js_parser/src/syntax/typescript/statement.rs +++ b/crates/rome_js_parser/src/syntax/typescript/statement.rs @@ -15,7 +15,7 @@ use crate::syntax::stmt::{semi, STMT_RECOVERY_SET}; use crate::syntax::typescript::ts_parse_error::expected_ts_type; use crate::syntax::typescript::{ expect_ts_type_list, parse_ts_identifier_binding, parse_ts_implements_clause, parse_ts_name, - parse_ts_type, parse_ts_type_parameters_with_modifiers, TypeContext, TypeMembers, + parse_ts_type, parse_ts_type_parameters, TypeContext, TypeMembers, }; use crate::{syntax, Absent, JsParser, ParseRecovery, ParsedSyntax, Present}; use rome_js_syntax::{JsSyntaxKind::*, *}; @@ -207,7 +207,7 @@ pub(crate) fn parse_ts_type_alias_declaration(p: &mut JsParser) -> ParsedSyntax p.expect(T![type]); parse_ts_identifier_binding(p, super::TsIdentifierContext::Type) .or_add_diagnostic(p, expected_identifier); - parse_ts_type_parameters_with_modifiers(p, TypeContext::default(), true).ok(); + parse_ts_type_parameters(p, TypeContext::default().and_allow_in_out_modifier(true)).ok(); p.expect(T![=]); parse_ts_type(p, TypeContext::default()).or_add_diagnostic(p, expected_ts_type); @@ -298,7 +298,7 @@ pub(crate) fn parse_ts_interface_declaration(p: &mut JsParser) -> ParsedSyntax { p.expect(T![interface]); parse_ts_identifier_binding(p, super::TsIdentifierContext::Type) .or_add_diagnostic(p, expected_identifier); - parse_ts_type_parameters_with_modifiers(p, TypeContext::default(), true).ok(); + parse_ts_type_parameters(p, TypeContext::default().and_allow_in_out_modifier(true)).ok(); eat_interface_heritage_clause(p); p.expect(T!['{']); TypeMembers.parse_list(p); diff --git a/crates/rome_js_parser/src/syntax/typescript/types.rs b/crates/rome_js_parser/src/syntax/typescript/types.rs index b8d173afef3..19156512b7d 100644 --- a/crates/rome_js_parser/src/syntax/typescript/types.rs +++ b/crates/rome_js_parser/src/syntax/typescript/types.rs @@ -42,6 +42,11 @@ bitflags! { /// /// By default, conditional types are allowed. const DISALLOW_CONDITIONAL_TYPES = 1 << 0; + + /// Whether 'in' and 'out' modifiers are allowed in the current context. + /// + /// By default, 'in' and 'out' modifiers are not allowed. + const ALLOW_IN_OUT_MODIFIER = 1 << 1; } } @@ -50,10 +55,18 @@ impl TypeContext { self.and(TypeContext::DISALLOW_CONDITIONAL_TYPES, !allow) } + pub(crate) fn and_allow_in_out_modifier(self, allow: bool) -> Self { + self.and(TypeContext::ALLOW_IN_OUT_MODIFIER, allow) + } + pub(crate) const fn is_conditional_type_allowed(&self) -> bool { !self.contains(TypeContext::DISALLOW_CONDITIONAL_TYPES) } + pub(crate) const fn is_in_out_modifier_allowed(&self) -> bool { + self.contains(TypeContext::ALLOW_IN_OUT_MODIFIER) + } + /// Adds the `flag` if `set` is `true`, otherwise removes the `flag` fn and(self, flag: TypeContext, set: bool) -> Self { if set { @@ -141,27 +154,7 @@ pub(crate) fn parse_ts_type_parameters(p: &mut JsParser, context: TypeContext) - if p.at(T![>]) { p.error(expected_ts_type_parameter(p, p.cur_range())); } - TsTypeParameterList::new(context, false).parse_list(p); - p.expect(T![>]); - - Present(m.complete(p, TS_TYPE_PARAMETERS)) -} - -pub(crate) fn parse_ts_type_parameters_with_modifiers( - p: &mut JsParser, - context: TypeContext, - allow_in_out_modifier: bool, -) -> ParsedSyntax { - if !is_nth_at_ts_type_parameters(p, 0) { - return Absent; - } - - let m = p.start(); - p.bump(T![<]); - if p.at(T![>]) { - p.error(expected_ts_type_parameter(p, p.cur_range())); - } - TsTypeParameterList::new(context, allow_in_out_modifier).parse_list(p); + TsTypeParameterList::new(context).parse_list(p); p.expect(T![>]); Present(m.complete(p, TS_TYPE_PARAMETERS)) @@ -169,15 +162,11 @@ pub(crate) fn parse_ts_type_parameters_with_modifiers( struct TsTypeParameterList { context: TypeContext, - allow_in_out_modifier: bool, } impl TsTypeParameterList { - pub fn new(context: TypeContext, allow_in_out_modifier: bool) -> Self { - Self { - context, - allow_in_out_modifier, - } + pub fn new(context: TypeContext) -> Self { + Self { context } } } @@ -188,7 +177,7 @@ impl ParseSeparatedList for TsTypeParameterList { const LIST_KIND: Self::Kind = TS_TYPE_PARAMETER_LIST; fn parse_element(&mut self, p: &mut JsParser) -> ParsedSyntax { - parse_ts_type_parameter(p, self.context, self.allow_in_out_modifier) + parse_ts_type_parameter(p, self.context) } fn is_at_list_end(&self, p: &mut JsParser) -> bool { @@ -253,6 +242,7 @@ impl ParseSeparatedList for TsTypeParameterList { // type Foo = {} // type Foo = {} // type Foo = {} +// type Foo = {} // type Foo = {} // type Foo = {} // function foo() {} @@ -288,13 +278,9 @@ impl ParseSeparatedList for TsTypeParameterList { // declare interface Foo {} // declare interface Foo {} -fn parse_ts_type_parameter( - p: &mut JsParser, - context: TypeContext, - allow_in_out_modifier: bool, -) -> ParsedSyntax { +fn parse_ts_type_parameter(p: &mut JsParser, context: TypeContext) -> ParsedSyntax { let m = p.start(); - parse_ts_type_parameter_modifiers(p, allow_in_out_modifier); + parse_ts_type_parameter_modifiers(p, context); let name = parse_ts_type_parameter_name(p); parse_ts_type_constraint_clause(p, context).ok(); @@ -337,10 +323,10 @@ impl ClassMemberModifierList { } } -fn parse_ts_type_parameter_modifiers(p: &mut JsParser, allow_in_out_modifier: bool) { +fn parse_ts_type_parameter_modifiers(p: &mut JsParser, context: TypeContext) { let mut modifiers = ClassMemberModifierList::default(); while p.at_ts(token_set!(T![in], T![out])) && !p.nth_at(1, T![,]) && !p.nth_at(1, T![>]) { - if !allow_in_out_modifier { + if !context.is_in_out_modifier_allowed() { let text_range = p.cur_range(); p.error(p.err_builder( format!( @@ -362,7 +348,7 @@ fn parse_ts_type_parameter_modifiers(p: &mut JsParser, allow_in_out_modifier: bo kind: TypeParameterModifierKind::Out, range: p.cur_range(), }, - _ => unreachable!(), + _ => unreachable!("keywords that are not 'in' and 'out' are checked earlier"), }; // check for duplicate modifiers @@ -1105,7 +1091,7 @@ fn parse_ts_construct_signature_type_member( let m = p.start(); p.expect(T![new]); - parse_ts_type_parameters_with_modifiers(p, context, true).ok(); + parse_ts_type_parameters(p, context.and_allow_in_out_modifier(true)).ok(); parse_parameter_list(p, ParameterContext::Declaration, SignatureFlags::empty()) .or_add_diagnostic(p, expected_parameters); parse_ts_type_annotation(p).ok(); diff --git a/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.rast b/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.rast index 005e89e74fb..650e3bf8ebb 100644 --- a/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.rast +++ b/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.rast @@ -249,152 +249,190 @@ JsModule { }, ], }, + TsTypeAliasDeclaration { + type_token: TYPE_KW@143..149 "type" [Newline("\n")] [Whitespace(" ")], + binding_identifier: TsIdentifierBinding { + name_token: IDENT@149..152 "Foo" [] [], + }, + type_parameters: TsTypeParameters { + l_angle_token: L_ANGLE@152..153 "<" [] [], + items: TsTypeParameterList [ + TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@153..158 "innn" [] [Whitespace(" ")], + }, + constraint: missing (optional), + default: missing (optional), + }, + missing separator, + TsTypeParameter { + in_modifier_token: missing (optional), + out_modifier_token: missing (optional), + name: TsTypeParameterName { + ident_token: IDENT@158..159 "T" [] [], + }, + constraint: missing (optional), + default: missing (optional), + }, + ], + r_angle_token: R_ANGLE@159..161 ">" [] [Whitespace(" ")], + }, + eq_token: EQ@161..163 "=" [] [Whitespace(" ")], + ty: TsObjectType { + l_curly_token: L_CURLY@163..164 "{" [] [], + members: TsTypeMemberList [], + r_curly_token: R_CURLY@164..165 "}" [] [], + }, + semicolon_token: missing (optional), + }, JsBogusStatement { items: [ - TYPE_KW@143..149 "type" [Newline("\n")] [Whitespace(" ")], + TYPE_KW@165..171 "type" [Newline("\n")] [Whitespace(" ")], TsIdentifierBinding { - name_token: IDENT@149..152 "Foo" [] [], + name_token: IDENT@171..174 "Foo" [] [], }, JsBogus { items: [ - L_ANGLE@152..153 "<" [] [], + L_ANGLE@174..175 "<" [] [], JsBogus { items: [ JsBogus { items: [ - IN_KW@153..156 "in" [] [Whitespace(" ")], - OUT_KW@156..160 "out" [] [Whitespace(" ")], - IN_KW@160..163 "in" [] [Whitespace(" ")], + IN_KW@175..178 "in" [] [Whitespace(" ")], + OUT_KW@178..182 "out" [] [Whitespace(" ")], + IN_KW@182..185 "in" [] [Whitespace(" ")], TsTypeParameterName { - ident_token: IDENT@163..164 "T" [] [], + ident_token: IDENT@185..186 "T" [] [], }, ], }, ], }, - R_ANGLE@164..166 ">" [] [Whitespace(" ")], + R_ANGLE@186..188 ">" [] [Whitespace(" ")], ], }, - EQ@166..168 "=" [] [Whitespace(" ")], + EQ@188..190 "=" [] [Whitespace(" ")], TsObjectType { - l_curly_token: L_CURLY@168..169 "{" [] [], + l_curly_token: L_CURLY@190..191 "{" [] [], members: TsTypeMemberList [], - r_curly_token: R_CURLY@169..170 "}" [] [], + r_curly_token: R_CURLY@191..192 "}" [] [], }, ], }, JsBogusStatement { items: [ - TYPE_KW@170..176 "type" [Newline("\n")] [Whitespace(" ")], + TYPE_KW@192..198 "type" [Newline("\n")] [Whitespace(" ")], TsIdentifierBinding { - name_token: IDENT@176..179 "Foo" [] [], + name_token: IDENT@198..201 "Foo" [] [], }, JsBogus { items: [ - L_ANGLE@179..180 "<" [] [], + L_ANGLE@201..202 "<" [] [], JsBogus { items: [ JsBogus { items: [ - IN_KW@180..183 "in" [] [Whitespace(" ")], - OUT_KW@183..187 "out" [] [Whitespace(" ")], - OUT_KW@187..191 "out" [] [Whitespace(" ")], + IN_KW@202..205 "in" [] [Whitespace(" ")], + OUT_KW@205..209 "out" [] [Whitespace(" ")], + OUT_KW@209..213 "out" [] [Whitespace(" ")], TsTypeParameterName { - ident_token: IDENT@191..192 "T" [] [], + ident_token: IDENT@213..214 "T" [] [], }, ], }, ], }, - R_ANGLE@192..194 ">" [] [Whitespace(" ")], + R_ANGLE@214..216 ">" [] [Whitespace(" ")], ], }, - EQ@194..196 "=" [] [Whitespace(" ")], + EQ@216..218 "=" [] [Whitespace(" ")], TsObjectType { - l_curly_token: L_CURLY@196..197 "{" [] [], + l_curly_token: L_CURLY@218..219 "{" [] [], members: TsTypeMemberList [], - r_curly_token: R_CURLY@197..198 "}" [] [], + r_curly_token: R_CURLY@219..220 "}" [] [], }, ], }, JsFunctionDeclaration { async_token: missing (optional), - function_token: FUNCTION_KW@198..208 "function" [Newline("\n")] [Whitespace(" ")], + function_token: FUNCTION_KW@220..230 "function" [Newline("\n")] [Whitespace(" ")], star_token: missing (optional), id: JsIdentifierBinding { - name_token: IDENT@208..211 "foo" [] [], + name_token: IDENT@230..233 "foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@211..212 "<" [] [], + l_angle_token: L_ANGLE@233..234 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { - in_modifier_token: IN_KW@212..215 "in" [] [Whitespace(" ")], + in_modifier_token: IN_KW@234..237 "in" [] [Whitespace(" ")], out_modifier_token: missing (optional), name: TsTypeParameterName { - ident_token: IDENT@215..216 "T" [] [], + ident_token: IDENT@237..238 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@216..217 ">" [] [], + r_angle_token: R_ANGLE@238..239 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@217..218 "(" [] [], + l_paren_token: L_PAREN@239..240 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@218..220 ")" [] [Whitespace(" ")], + r_paren_token: R_PAREN@240..242 ")" [] [Whitespace(" ")], }, return_type_annotation: missing (optional), body: JsFunctionBody { - l_curly_token: L_CURLY@220..221 "{" [] [], + l_curly_token: L_CURLY@242..243 "{" [] [], directives: JsDirectiveList [], statements: JsStatementList [], - r_curly_token: R_CURLY@221..222 "}" [] [], + r_curly_token: R_CURLY@243..244 "}" [] [], }, }, JsFunctionDeclaration { async_token: missing (optional), - function_token: FUNCTION_KW@222..232 "function" [Newline("\n")] [Whitespace(" ")], + function_token: FUNCTION_KW@244..254 "function" [Newline("\n")] [Whitespace(" ")], star_token: missing (optional), id: JsIdentifierBinding { - name_token: IDENT@232..235 "foo" [] [], + name_token: IDENT@254..257 "foo" [] [], }, type_parameters: TsTypeParameters { - l_angle_token: L_ANGLE@235..236 "<" [] [], + l_angle_token: L_ANGLE@257..258 "<" [] [], items: TsTypeParameterList [ TsTypeParameter { in_modifier_token: missing (optional), - out_modifier_token: OUT_KW@236..240 "out" [] [Whitespace(" ")], + out_modifier_token: OUT_KW@258..262 "out" [] [Whitespace(" ")], name: TsTypeParameterName { - ident_token: IDENT@240..241 "T" [] [], + ident_token: IDENT@262..263 "T" [] [], }, constraint: missing (optional), default: missing (optional), }, ], - r_angle_token: R_ANGLE@241..242 ">" [] [], + r_angle_token: R_ANGLE@263..264 ">" [] [], }, parameters: JsParameters { - l_paren_token: L_PAREN@242..243 "(" [] [], + l_paren_token: L_PAREN@264..265 "(" [] [], items: JsParameterList [], - r_paren_token: R_PAREN@243..245 ")" [] [Whitespace(" ")], + r_paren_token: R_PAREN@265..267 ")" [] [Whitespace(" ")], }, return_type_annotation: missing (optional), body: JsFunctionBody { - l_curly_token: L_CURLY@245..246 "{" [] [], + l_curly_token: L_CURLY@267..268 "{" [] [], directives: JsDirectiveList [], statements: JsStatementList [], - r_curly_token: R_CURLY@246..247 "}" [] [], + r_curly_token: R_CURLY@268..269 "}" [] [], }, }, ], - eof_token: EOF@247..248 "" [Newline("\n")] [], + eof_token: EOF@269..270 "" [Newline("\n")] [], } -0: JS_MODULE@0..248 +0: JS_MODULE@0..270 0: (empty) 1: JS_DIRECTIVE_LIST@0..0 - 2: JS_MODULE_ITEM_LIST@0..247 + 2: JS_MODULE_ITEM_LIST@0..269 0: JS_BOGUS_STATEMENT@0..25 0: TYPE_KW@0..5 "type" [] [Whitespace(" ")] 1: TS_IDENTIFIER_BINDING@5..8 @@ -540,99 +578,128 @@ JsModule { 0: L_CURLY@141..142 "{" [] [] 1: TS_TYPE_MEMBER_LIST@142..142 2: R_CURLY@142..143 "}" [] [] - 6: JS_BOGUS_STATEMENT@143..170 + 6: TS_TYPE_ALIAS_DECLARATION@143..165 0: TYPE_KW@143..149 "type" [Newline("\n")] [Whitespace(" ")] 1: TS_IDENTIFIER_BINDING@149..152 0: IDENT@149..152 "Foo" [] [] - 2: JS_BOGUS@152..166 + 2: TS_TYPE_PARAMETERS@152..161 0: L_ANGLE@152..153 "<" [] [] - 1: JS_BOGUS@153..164 - 0: JS_BOGUS@153..164 - 0: IN_KW@153..156 "in" [] [Whitespace(" ")] - 1: OUT_KW@156..160 "out" [] [Whitespace(" ")] - 2: IN_KW@160..163 "in" [] [Whitespace(" ")] - 3: TS_TYPE_PARAMETER_NAME@163..164 - 0: IDENT@163..164 "T" [] [] - 2: R_ANGLE@164..166 ">" [] [Whitespace(" ")] - 3: EQ@166..168 "=" [] [Whitespace(" ")] - 4: TS_OBJECT_TYPE@168..170 - 0: L_CURLY@168..169 "{" [] [] - 1: TS_TYPE_MEMBER_LIST@169..169 - 2: R_CURLY@169..170 "}" [] [] - 7: JS_BOGUS_STATEMENT@170..198 - 0: TYPE_KW@170..176 "type" [Newline("\n")] [Whitespace(" ")] - 1: TS_IDENTIFIER_BINDING@176..179 - 0: IDENT@176..179 "Foo" [] [] - 2: JS_BOGUS@179..194 - 0: L_ANGLE@179..180 "<" [] [] - 1: JS_BOGUS@180..192 - 0: JS_BOGUS@180..192 - 0: IN_KW@180..183 "in" [] [Whitespace(" ")] - 1: OUT_KW@183..187 "out" [] [Whitespace(" ")] - 2: OUT_KW@187..191 "out" [] [Whitespace(" ")] - 3: TS_TYPE_PARAMETER_NAME@191..192 - 0: IDENT@191..192 "T" [] [] - 2: R_ANGLE@192..194 ">" [] [Whitespace(" ")] - 3: EQ@194..196 "=" [] [Whitespace(" ")] - 4: TS_OBJECT_TYPE@196..198 - 0: L_CURLY@196..197 "{" [] [] - 1: TS_TYPE_MEMBER_LIST@197..197 - 2: R_CURLY@197..198 "}" [] [] - 8: JS_FUNCTION_DECLARATION@198..222 + 1: TS_TYPE_PARAMETER_LIST@153..159 + 0: TS_TYPE_PARAMETER@153..158 + 0: (empty) + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@153..158 + 0: IDENT@153..158 "innn" [] [Whitespace(" ")] + 3: (empty) + 4: (empty) + 1: (empty) + 2: TS_TYPE_PARAMETER@158..159 + 0: (empty) + 1: (empty) + 2: TS_TYPE_PARAMETER_NAME@158..159 + 0: IDENT@158..159 "T" [] [] + 3: (empty) + 4: (empty) + 2: R_ANGLE@159..161 ">" [] [Whitespace(" ")] + 3: EQ@161..163 "=" [] [Whitespace(" ")] + 4: TS_OBJECT_TYPE@163..165 + 0: L_CURLY@163..164 "{" [] [] + 1: TS_TYPE_MEMBER_LIST@164..164 + 2: R_CURLY@164..165 "}" [] [] + 5: (empty) + 7: JS_BOGUS_STATEMENT@165..192 + 0: TYPE_KW@165..171 "type" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@171..174 + 0: IDENT@171..174 "Foo" [] [] + 2: JS_BOGUS@174..188 + 0: L_ANGLE@174..175 "<" [] [] + 1: JS_BOGUS@175..186 + 0: JS_BOGUS@175..186 + 0: IN_KW@175..178 "in" [] [Whitespace(" ")] + 1: OUT_KW@178..182 "out" [] [Whitespace(" ")] + 2: IN_KW@182..185 "in" [] [Whitespace(" ")] + 3: TS_TYPE_PARAMETER_NAME@185..186 + 0: IDENT@185..186 "T" [] [] + 2: R_ANGLE@186..188 ">" [] [Whitespace(" ")] + 3: EQ@188..190 "=" [] [Whitespace(" ")] + 4: TS_OBJECT_TYPE@190..192 + 0: L_CURLY@190..191 "{" [] [] + 1: TS_TYPE_MEMBER_LIST@191..191 + 2: R_CURLY@191..192 "}" [] [] + 8: JS_BOGUS_STATEMENT@192..220 + 0: TYPE_KW@192..198 "type" [Newline("\n")] [Whitespace(" ")] + 1: TS_IDENTIFIER_BINDING@198..201 + 0: IDENT@198..201 "Foo" [] [] + 2: JS_BOGUS@201..216 + 0: L_ANGLE@201..202 "<" [] [] + 1: JS_BOGUS@202..214 + 0: JS_BOGUS@202..214 + 0: IN_KW@202..205 "in" [] [Whitespace(" ")] + 1: OUT_KW@205..209 "out" [] [Whitespace(" ")] + 2: OUT_KW@209..213 "out" [] [Whitespace(" ")] + 3: TS_TYPE_PARAMETER_NAME@213..214 + 0: IDENT@213..214 "T" [] [] + 2: R_ANGLE@214..216 ">" [] [Whitespace(" ")] + 3: EQ@216..218 "=" [] [Whitespace(" ")] + 4: TS_OBJECT_TYPE@218..220 + 0: L_CURLY@218..219 "{" [] [] + 1: TS_TYPE_MEMBER_LIST@219..219 + 2: R_CURLY@219..220 "}" [] [] + 9: JS_FUNCTION_DECLARATION@220..244 0: (empty) - 1: FUNCTION_KW@198..208 "function" [Newline("\n")] [Whitespace(" ")] + 1: FUNCTION_KW@220..230 "function" [Newline("\n")] [Whitespace(" ")] 2: (empty) - 3: JS_IDENTIFIER_BINDING@208..211 - 0: IDENT@208..211 "foo" [] [] - 4: TS_TYPE_PARAMETERS@211..217 - 0: L_ANGLE@211..212 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@212..216 - 0: TS_TYPE_PARAMETER@212..216 - 0: IN_KW@212..215 "in" [] [Whitespace(" ")] + 3: JS_IDENTIFIER_BINDING@230..233 + 0: IDENT@230..233 "foo" [] [] + 4: TS_TYPE_PARAMETERS@233..239 + 0: L_ANGLE@233..234 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@234..238 + 0: TS_TYPE_PARAMETER@234..238 + 0: IN_KW@234..237 "in" [] [Whitespace(" ")] 1: (empty) - 2: TS_TYPE_PARAMETER_NAME@215..216 - 0: IDENT@215..216 "T" [] [] + 2: TS_TYPE_PARAMETER_NAME@237..238 + 0: IDENT@237..238 "T" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@216..217 ">" [] [] - 5: JS_PARAMETERS@217..220 - 0: L_PAREN@217..218 "(" [] [] - 1: JS_PARAMETER_LIST@218..218 - 2: R_PAREN@218..220 ")" [] [Whitespace(" ")] + 2: R_ANGLE@238..239 ">" [] [] + 5: JS_PARAMETERS@239..242 + 0: L_PAREN@239..240 "(" [] [] + 1: JS_PARAMETER_LIST@240..240 + 2: R_PAREN@240..242 ")" [] [Whitespace(" ")] 6: (empty) - 7: JS_FUNCTION_BODY@220..222 - 0: L_CURLY@220..221 "{" [] [] - 1: JS_DIRECTIVE_LIST@221..221 - 2: JS_STATEMENT_LIST@221..221 - 3: R_CURLY@221..222 "}" [] [] - 9: JS_FUNCTION_DECLARATION@222..247 + 7: JS_FUNCTION_BODY@242..244 + 0: L_CURLY@242..243 "{" [] [] + 1: JS_DIRECTIVE_LIST@243..243 + 2: JS_STATEMENT_LIST@243..243 + 3: R_CURLY@243..244 "}" [] [] + 10: JS_FUNCTION_DECLARATION@244..269 0: (empty) - 1: FUNCTION_KW@222..232 "function" [Newline("\n")] [Whitespace(" ")] + 1: FUNCTION_KW@244..254 "function" [Newline("\n")] [Whitespace(" ")] 2: (empty) - 3: JS_IDENTIFIER_BINDING@232..235 - 0: IDENT@232..235 "foo" [] [] - 4: TS_TYPE_PARAMETERS@235..242 - 0: L_ANGLE@235..236 "<" [] [] - 1: TS_TYPE_PARAMETER_LIST@236..241 - 0: TS_TYPE_PARAMETER@236..241 + 3: JS_IDENTIFIER_BINDING@254..257 + 0: IDENT@254..257 "foo" [] [] + 4: TS_TYPE_PARAMETERS@257..264 + 0: L_ANGLE@257..258 "<" [] [] + 1: TS_TYPE_PARAMETER_LIST@258..263 + 0: TS_TYPE_PARAMETER@258..263 0: (empty) - 1: OUT_KW@236..240 "out" [] [Whitespace(" ")] - 2: TS_TYPE_PARAMETER_NAME@240..241 - 0: IDENT@240..241 "T" [] [] + 1: OUT_KW@258..262 "out" [] [Whitespace(" ")] + 2: TS_TYPE_PARAMETER_NAME@262..263 + 0: IDENT@262..263 "T" [] [] 3: (empty) 4: (empty) - 2: R_ANGLE@241..242 ">" [] [] - 5: JS_PARAMETERS@242..245 - 0: L_PAREN@242..243 "(" [] [] - 1: JS_PARAMETER_LIST@243..243 - 2: R_PAREN@243..245 ")" [] [Whitespace(" ")] + 2: R_ANGLE@263..264 ">" [] [] + 5: JS_PARAMETERS@264..267 + 0: L_PAREN@264..265 "(" [] [] + 1: JS_PARAMETER_LIST@265..265 + 2: R_PAREN@265..267 ")" [] [Whitespace(" ")] 6: (empty) - 7: JS_FUNCTION_BODY@245..247 - 0: L_CURLY@245..246 "{" [] [] - 1: JS_DIRECTIVE_LIST@246..246 - 2: JS_STATEMENT_LIST@246..246 - 3: R_CURLY@246..247 "}" [] [] - 3: EOF@247..248 "" [Newline("\n")] [] + 7: JS_FUNCTION_BODY@267..269 + 0: L_CURLY@267..268 "{" [] [] + 1: JS_DIRECTIVE_LIST@268..268 + 2: JS_STATEMENT_LIST@268..268 + 3: R_CURLY@268..269 "}" [] [] + 3: EOF@269..270 "" [Newline("\n")] [] -- type_parameter_modifier.ts:1:11 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -756,7 +823,7 @@ type_parameter_modifier.ts:5:14 parse ━━━━━━━━━━━━━━ > 5 │ type Foo = {} │ ^^ 6 │ type Foo = {} - 7 │ type Foo = {} + 7 │ type Foo = {} i move this modifier @@ -765,7 +832,7 @@ type_parameter_modifier.ts:5:14 parse ━━━━━━━━━━━━━━ > 5 │ type Foo = {} │ ^^ 6 │ type Foo = {} - 7 │ type Foo = {} + 7 │ type Foo = {} i before this modifier @@ -774,7 +841,7 @@ type_parameter_modifier.ts:5:14 parse ━━━━━━━━━━━━━━ > 5 │ type Foo = {} │ ^^^ 6 │ type Foo = {} - 7 │ type Foo = {} + 7 │ type Foo = {} -- type_parameter_modifier.ts:6:10 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -785,8 +852,8 @@ type_parameter_modifier.ts:6:10 parse ━━━━━━━━━━━━━━ 5 │ type Foo = {} > 6 │ type Foo = {} │ ^^^^^^ - 7 │ type Foo = {} - 8 │ type Foo = {} + 7 │ type Foo = {} + 8 │ type Foo = {} -- type_parameter_modifier.ts:6:17 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -797,93 +864,107 @@ type_parameter_modifier.ts:6:17 parse ━━━━━━━━━━━━━━ 5 │ type Foo = {} > 6 │ type Foo = {} │ ^ - 7 │ type Foo = {} - 8 │ type Foo = {} + 7 │ type Foo = {} + 8 │ type Foo = {} i Remove T -- -type_parameter_modifier.ts:7:17 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier.ts:7:15 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × 'in' already seen + × expected `,` but instead found `T` 5 │ type Foo = {} 6 │ type Foo = {} - > 7 │ type Foo = {} - │ ^^ - 8 │ type Foo = {} - 9 │ function foo() {} + > 7 │ type Foo = {} + │ ^ + 8 │ type Foo = {} + 9 │ type Foo = {} + + i Remove T + +-- +type_parameter_modifier.ts:8:17 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + × 'in' already seen + + 6 │ type Foo = {} + 7 │ type Foo = {} + > 8 │ type Foo = {} + │ ^^ + 9 │ type Foo = {} + 10 │ function foo() {} i duplicate modifier - 5 │ type Foo = {} - 6 │ type Foo = {} - > 7 │ type Foo = {} - │ ^^ - 8 │ type Foo = {} - 9 │ function foo() {} + 6 │ type Foo = {} + 7 │ type Foo = {} + > 8 │ type Foo = {} + │ ^^ + 9 │ type Foo = {} + 10 │ function foo() {} i first seen here - 5 │ type Foo = {} - 6 │ type Foo = {} - > 7 │ type Foo = {} - │ ^^ - 8 │ type Foo = {} - 9 │ function foo() {} + 6 │ type Foo = {} + 7 │ type Foo = {} + > 8 │ type Foo = {} + │ ^^ + 9 │ type Foo = {} + 10 │ function foo() {} -- -type_parameter_modifier.ts:8:17 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier.ts:9:17 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × 'out' already seen - 6 │ type Foo = {} - 7 │ type Foo = {} - > 8 │ type Foo = {} + 7 │ type Foo = {} + 8 │ type Foo = {} + > 9 │ type Foo = {} │ ^^^ - 9 │ function foo() {} - 10 │ function foo() {} + 10 │ function foo() {} + 11 │ function foo() {} i duplicate modifier - 6 │ type Foo = {} - 7 │ type Foo = {} - > 8 │ type Foo = {} + 7 │ type Foo = {} + 8 │ type Foo = {} + > 9 │ type Foo = {} │ ^^^ - 9 │ function foo() {} - 10 │ function foo() {} + 10 │ function foo() {} + 11 │ function foo() {} i first seen here - 6 │ type Foo = {} - 7 │ type Foo = {} - > 8 │ type Foo = {} + 7 │ type Foo = {} + 8 │ type Foo = {} + > 9 │ type Foo = {} │ ^^^ - 9 │ function foo() {} - 10 │ function foo() {} + 10 │ function foo() {} + 11 │ function foo() {} -- -type_parameter_modifier.ts:9:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier.ts:10:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × 'in' modifier can only appear on a type parameter of a class, interface or type alias. - 7 │ type Foo = {} - 8 │ type Foo = {} - > 9 │ function foo() {} + 8 │ type Foo = {} + 9 │ type Foo = {} + > 10 │ function foo() {} │ ^^ - 10 │ function foo() {} - 11 │ + 11 │ function foo() {} + 12 │ -- -type_parameter_modifier.ts:10:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +type_parameter_modifier.ts:11:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × 'out' modifier can only appear on a type parameter of a class, interface or type alias. - 8 │ type Foo = {} - 9 │ function foo() {} - > 10 │ function foo() {} + 9 │ type Foo = {} + 10 │ function foo() {} + > 11 │ function foo() {} │ ^^^ - 11 │ + 12 │ -- type Foo = {} @@ -892,6 +973,7 @@ type Foo = {} type Foo = {} type Foo = {} type Foo = {} +type Foo = {} type Foo = {} type Foo = {} function foo() {} diff --git a/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.ts b/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.ts index 79634bbe926..b87336dc431 100644 --- a/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.ts +++ b/crates/rome_js_parser/test_data/inline/err/type_parameter_modifier.ts @@ -4,6 +4,7 @@ type Foo = {} type Foo = {} type Foo = {} type Foo = {} +type Foo = {} type Foo = {} type Foo = {} function foo() {} From 7f1ec7e2a23051db692d62328478df47715f9538 Mon Sep 17 00:00:00 2001 From: nissy-dev Date: Tue, 7 Mar 2023 23:17:25 +0900 Subject: [PATCH 22/22] feat: revert unnecessary diff --- .../src/syntax/typescript/types.rs | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/crates/rome_js_parser/src/syntax/typescript/types.rs b/crates/rome_js_parser/src/syntax/typescript/types.rs index 19156512b7d..4a833cb596d 100644 --- a/crates/rome_js_parser/src/syntax/typescript/types.rs +++ b/crates/rome_js_parser/src/syntax/typescript/types.rs @@ -154,21 +154,13 @@ pub(crate) fn parse_ts_type_parameters(p: &mut JsParser, context: TypeContext) - if p.at(T![>]) { p.error(expected_ts_type_parameter(p, p.cur_range())); } - TsTypeParameterList::new(context).parse_list(p); + TsTypeParameterList(context).parse_list(p); p.expect(T![>]); Present(m.complete(p, TS_TYPE_PARAMETERS)) } -struct TsTypeParameterList { - context: TypeContext, -} - -impl TsTypeParameterList { - pub fn new(context: TypeContext) -> Self { - Self { context } - } -} +struct TsTypeParameterList(TypeContext); impl ParseSeparatedList for TsTypeParameterList { type Kind = JsSyntaxKind; @@ -177,7 +169,7 @@ impl ParseSeparatedList for TsTypeParameterList { const LIST_KIND: Self::Kind = TS_TYPE_PARAMETER_LIST; fn parse_element(&mut self, p: &mut JsParser) -> ParsedSyntax { - parse_ts_type_parameter(p, self.context) + parse_ts_type_parameter(p, self.0) } fn is_at_list_end(&self, p: &mut JsParser) -> bool { @@ -1878,5 +1870,3 @@ fn parse_ts_type_member_semi(p: &mut JsParser) { p.error(err); } } - -// TODO: finish all this testing