This repository has been archived by the owner on Aug 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 659
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
17d66a1
commit 2716986
Showing
17 changed files
with
295 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
259 changes: 259 additions & 0 deletions
259
crates/rome_js_parser/test_data/inline/err/ts_broken_class_member_modifiers.rast
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,259 @@ | ||
JsModule { | ||
interpreter_token: missing (optional), | ||
directives: JsDirectiveList [], | ||
items: JsModuleItemList [ | ||
JsBogusStatement { | ||
items: [ | ||
JsDecoratorList [], | ||
[email protected] "class" [] [Whitespace(" ")], | ||
JsIdentifierBinding { | ||
name_token: [email protected] "C" [] [Whitespace(" ")], | ||
}, | ||
[email protected] "{" [] [], | ||
JsBogus { | ||
items: [ | ||
JsDecorator { | ||
at_token: [email protected] "@" [Newline("\n"), Whitespace("\t")] [], | ||
expression: JsIdentifierExpression { | ||
name: JsReferenceIdentifier { | ||
value_token: [email protected] "decorator" [] [], | ||
}, | ||
}, | ||
}, | ||
], | ||
}, | ||
[email protected] "}" [Newline("\n"), Whitespace("\t")] [], | ||
], | ||
}, | ||
JsBogusStatement { | ||
items: [ | ||
JsDecoratorList [], | ||
[email protected] "class" [Newline("\n")] [Whitespace(" ")], | ||
JsIdentifierBinding { | ||
name_token: [email protected] "CC" [] [Whitespace(" ")], | ||
}, | ||
[email protected] "{" [] [], | ||
JsBogus { | ||
items: [ | ||
JsDecorator { | ||
at_token: [email protected] "@" [Newline("\n"), Whitespace("\t")] [], | ||
expression: missing (required), | ||
}, | ||
], | ||
}, | ||
[email protected] "}" [Newline("\n"), Whitespace("\t")] [], | ||
], | ||
}, | ||
JsBogusStatement { | ||
items: [ | ||
JsDecoratorList [], | ||
[email protected] "class" [Newline("\n")] [Whitespace(" ")], | ||
JsBogus { | ||
items: [ | ||
JsDecorator { | ||
at_token: [email protected] "@" [] [], | ||
expression: JsBogusExpression { | ||
items: [ | ||
JsDecoratorList [], | ||
[email protected] "class" [Newline("\n")] [Whitespace(" ")], | ||
JsIdentifierBinding { | ||
name_token: [email protected] "C" [] [], | ||
}, | ||
JsBogus { | ||
items: [ | ||
JsDecorator { | ||
at_token: [email protected] "@" [] [], | ||
expression: missing (required), | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
], | ||
eof_token: [email protected] "" [Newline("\n")] [], | ||
} | ||
|
||
0: [email protected] | ||
0: (empty) | ||
1: [email protected] | ||
2: [email protected] | ||
0: [email protected] | ||
0: [email protected] | ||
1: [email protected] "class" [] [Whitespace(" ")] | ||
2: [email protected] | ||
0: [email protected] "C" [] [Whitespace(" ")] | ||
3: [email protected] "{" [] [] | ||
4: [email protected] | ||
0: [email protected] | ||
0: [email protected] "@" [Newline("\n"), Whitespace("\t")] [] | ||
1: [email protected] | ||
0: [email protected] | ||
0: [email protected] "decorator" [] [] | ||
5: [email protected] "}" [Newline("\n"), Whitespace("\t")] [] | ||
1: [email protected] | ||
0: [email protected] | ||
1: [email protected] "class" [Newline("\n")] [Whitespace(" ")] | ||
2: [email protected] | ||
0: [email protected] "CC" [] [Whitespace(" ")] | ||
3: [email protected] "{" [] [] | ||
4: [email protected] | ||
0: [email protected] | ||
0: [email protected] "@" [Newline("\n"), Whitespace("\t")] [] | ||
1: (empty) | ||
5: [email protected] "}" [Newline("\n"), Whitespace("\t")] [] | ||
2: [email protected] | ||
0: [email protected] | ||
1: [email protected] "class" [Newline("\n")] [Whitespace(" ")] | ||
2: [email protected] | ||
0: [email protected] | ||
0: [email protected] "@" [] [] | ||
1: [email protected] | ||
0: [email protected] | ||
1: [email protected] "class" [Newline("\n")] [Whitespace(" ")] | ||
2: [email protected] | ||
0: [email protected] "C" [] [] | ||
3: [email protected] | ||
0: [email protected] | ||
0: [email protected] "@" [] [] | ||
1: (empty) | ||
3: [email protected] "" [Newline("\n")] [] | ||
-- | ||
ts_broken_class_member_modifiers.ts:3:2 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
|
||
× expected an identifier, a string literal, a number literal, a private field name, or a computed name but instead found '}' | ||
|
||
1 │ class C { | ||
2 │ @decorator | ||
> 3 │ } | ||
│ ^ | ||
4 │ class CC { | ||
5 │ @ | ||
|
||
i Expected an identifier, a string literal, a number literal, a private field name, or a computed name here | ||
|
||
1 │ class C { | ||
2 │ @decorator | ||
> 3 │ } | ||
│ ^ | ||
4 │ class CC { | ||
5 │ @ | ||
|
||
-- | ||
ts_broken_class_member_modifiers.ts:6:2 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
|
||
× expected an expression but instead found '}' | ||
|
||
4 │ class CC { | ||
5 │ @ | ||
> 6 │ } | ||
│ ^ | ||
7 │ class @ | ||
8 │ class C@ | ||
|
||
i Expected an expression here | ||
|
||
4 │ class CC { | ||
5 │ @ | ||
> 6 │ } | ||
│ ^ | ||
7 │ class @ | ||
8 │ class C@ | ||
|
||
-- | ||
ts_broken_class_member_modifiers.ts:7:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
|
||
× class declarations must have a name | ||
|
||
5 │ @ | ||
6 │ } | ||
> 7 │ class @ | ||
│ ^^^^^^ | ||
8 │ class C@ | ||
9 │ | ||
|
||
-- | ||
ts_broken_class_member_modifiers.ts:7:7 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
|
||
× expected `{` but instead found `@` | ||
|
||
5 │ @ | ||
6 │ } | ||
> 7 │ class @ | ||
│ ^ | ||
8 │ class C@ | ||
9 │ | ||
|
||
i Remove @ | ||
|
||
-- | ||
ts_broken_class_member_modifiers.ts:8:8 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
|
||
× expected `{` but instead found `@` | ||
|
||
6 │ } | ||
7 │ class @ | ||
> 8 │ class C@ | ||
│ ^ | ||
9 │ | ||
|
||
i Remove @ | ||
|
||
-- | ||
ts_broken_class_member_modifiers.ts:9:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
|
||
× expected an expression but instead found the end of the file | ||
|
||
7 │ class @ | ||
8 │ class C@ | ||
> 9 │ | ||
│ | ||
|
||
i Expected an expression here | ||
|
||
7 │ class @ | ||
8 │ class C@ | ||
> 9 │ | ||
│ | ||
|
||
-- | ||
ts_broken_class_member_modifiers.ts:8:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
|
||
× Invalid decorator `class C@` | ||
|
||
6 │ } | ||
7 │ class @ | ||
> 8 │ class C@ | ||
│ ^^^^^^^^ | ||
9 │ | ||
|
||
-- | ||
ts_broken_class_member_modifiers.ts:9:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
|
||
× expected an identifier, a string literal, a number literal, a private field name, or a computed name but instead found the end of the file | ||
|
||
7 │ class @ | ||
8 │ class C@ | ||
> 9 │ | ||
│ | ||
|
||
i Expected an identifier, a string literal, a number literal, a private field name, or a computed name here | ||
|
||
7 │ class @ | ||
8 │ class C@ | ||
> 9 │ | ||
│ | ||
|
||
-- | ||
class C { | ||
@decorator | ||
} | ||
class CC { | ||
@ | ||
} | ||
class @ | ||
class C@ |
8 changes: 8 additions & 0 deletions
8
crates/rome_js_parser/test_data/inline/err/ts_broken_class_member_modifiers.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
class C { | ||
@decorator | ||
} | ||
class CC { | ||
@ | ||
} | ||
class @ | ||
class C@ |
2 changes: 1 addition & 1 deletion
2
crates/rome_js_parser/test_data/inline/err/ts_decorator_object.options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{ "parse_class_parameter_decorators": true } | ||
{ "parse_class_parameter_decorators": true } |
2 changes: 1 addition & 1 deletion
2
crates/rome_js_parser/test_data/inline/err/ts_decorator_on_ambient_function.options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{ "parse_class_parameter_decorators": true } | ||
{ "parse_class_parameter_decorators": true } |
2 changes: 1 addition & 1 deletion
2
crates/rome_js_parser/test_data/inline/err/ts_decorator_on_arrow_function.options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{ "parse_class_parameter_decorators": true } | ||
{ "parse_class_parameter_decorators": true } |
2 changes: 1 addition & 1 deletion
2
crates/rome_js_parser/test_data/inline/err/ts_decorator_on_constructor_type.options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{ "parse_class_parameter_decorators": true } | ||
{ "parse_class_parameter_decorators": true } |
2 changes: 1 addition & 1 deletion
2
crates/rome_js_parser/test_data/inline/err/ts_decorator_on_function_declaration.options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{ "parse_class_parameter_decorators": true } | ||
{ "parse_class_parameter_decorators": true } |
2 changes: 1 addition & 1 deletion
2
crates/rome_js_parser/test_data/inline/err/ts_decorator_on_function_expression.options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{ "parse_class_parameter_decorators": true } | ||
{ "parse_class_parameter_decorators": true } |
2 changes: 1 addition & 1 deletion
2
crates/rome_js_parser/test_data/inline/err/ts_decorator_on_function_type.options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{ "parse_class_parameter_decorators": true } | ||
{ "parse_class_parameter_decorators": true } |
2 changes: 1 addition & 1 deletion
2
crates/rome_js_parser/test_data/inline/err/ts_decorator_on_signature_member.options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{ "parse_class_parameter_decorators": true } | ||
{ "parse_class_parameter_decorators": true } |
2 changes: 1 addition & 1 deletion
2
crates/rome_js_parser/test_data/inline/err/ts_decorator_this_parameter_option.options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{ "parse_class_parameter_decorators": true } | ||
{ "parse_class_parameter_decorators": true } |
2 changes: 1 addition & 1 deletion
2
crates/rome_js_parser/test_data/inline/err/ts_formal_parameter_decorator.options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{ "parse_class_parameter_decorators": true } | ||
{ "parse_class_parameter_decorators": true } |
2 changes: 1 addition & 1 deletion
2
crates/rome_js_parser/test_data/inline/ok/ts_decorator_constructor.options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{ "parse_class_parameter_decorators": true } | ||
{ "parse_class_parameter_decorators": true } |
2 changes: 1 addition & 1 deletion
2
crates/rome_js_parser/test_data/inline/ok/ts_decorator_on_class_method.options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{ "parse_class_parameter_decorators": true } | ||
{ "parse_class_parameter_decorators": true } |
2 changes: 1 addition & 1 deletion
2
crates/rome_js_parser/test_data/inline/ok/ts_decorator_on_class_setter.options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{ "parse_class_parameter_decorators": true } | ||
{ "parse_class_parameter_decorators": true } |
2 changes: 1 addition & 1 deletion
2
crates/rome_js_parser/test_data/inline/ok/ts_formal_parameter_decorator.options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{ "parse_class_parameter_decorators": true } | ||
{ "parse_class_parameter_decorators": true } |