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.
- Loading branch information
1 parent
1b63b56
commit b1d53e7
Showing
3 changed files
with
92 additions
and
0 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
88 changes: 88 additions & 0 deletions
88
crates/rome_js_parser/test_data/inline/err/ts_new_operator.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,88 @@ | ||
JsModule { | ||
interpreter_token: missing (optional), | ||
directives: JsDirectiveList [], | ||
items: JsModuleItemList [ | ||
JsExpressionStatement { | ||
expression: JsBinaryExpression { | ||
left: JsBinaryExpression { | ||
left: JsNewExpression { | ||
new_token: NEW_KW@0..4 "new" [] [Whitespace(" ")], | ||
callee: JsIdentifierExpression { | ||
name: JsReferenceIdentifier { | ||
value_token: IDENT@4..5 "A" [] [], | ||
}, | ||
}, | ||
type_arguments: missing (optional), | ||
arguments: missing (optional), | ||
}, | ||
operator_token: L_ANGLE@5..6 "<" [] [], | ||
right: JsIdentifierExpression { | ||
name: JsReferenceIdentifier { | ||
value_token: IDENT@6..10 "test" [] [], | ||
}, | ||
}, | ||
}, | ||
operator_token: R_ANGLE@10..11 ">" [] [], | ||
right: TsTypeAssertionExpression { | ||
l_angle_token: L_ANGLE@11..12 "<" [] [], | ||
ty: TsReferenceType { | ||
name: JsReferenceIdentifier { | ||
value_token: IDENT@12..16 "test" [] [], | ||
}, | ||
type_arguments: missing (optional), | ||
}, | ||
r_angle_token: R_ANGLE@16..17 ">" [] [], | ||
expression: JsParenthesizedExpression { | ||
l_paren_token: L_PAREN@17..18 "(" [] [], | ||
expression: missing (required), | ||
r_paren_token: R_PAREN@18..19 ")" [] [], | ||
}, | ||
}, | ||
}, | ||
semicolon_token: SEMICOLON@19..20 ";" [] [], | ||
}, | ||
], | ||
eof_token: EOF@20..21 "" [Newline("\n")] [], | ||
} | ||
|
||
0: JS_MODULE@0..21 | ||
0: (empty) | ||
1: JS_DIRECTIVE_LIST@0..0 | ||
2: JS_MODULE_ITEM_LIST@0..20 | ||
0: JS_EXPRESSION_STATEMENT@0..20 | ||
0: JS_BINARY_EXPRESSION@0..19 | ||
0: JS_BINARY_EXPRESSION@0..10 | ||
0: JS_NEW_EXPRESSION@0..5 | ||
0: NEW_KW@0..4 "new" [] [Whitespace(" ")] | ||
1: JS_IDENTIFIER_EXPRESSION@4..5 | ||
0: JS_REFERENCE_IDENTIFIER@4..5 | ||
0: IDENT@4..5 "A" [] [] | ||
2: (empty) | ||
3: (empty) | ||
1: L_ANGLE@5..6 "<" [] [] | ||
2: JS_IDENTIFIER_EXPRESSION@6..10 | ||
0: JS_REFERENCE_IDENTIFIER@6..10 | ||
0: IDENT@6..10 "test" [] [] | ||
1: R_ANGLE@10..11 ">" [] [] | ||
2: TS_TYPE_ASSERTION_EXPRESSION@11..19 | ||
0: L_ANGLE@11..12 "<" [] [] | ||
1: TS_REFERENCE_TYPE@12..16 | ||
0: JS_REFERENCE_IDENTIFIER@12..16 | ||
0: IDENT@12..16 "test" [] [] | ||
1: (empty) | ||
2: R_ANGLE@16..17 ">" [] [] | ||
3: JS_PARENTHESIZED_EXPRESSION@17..19 | ||
0: L_PAREN@17..18 "(" [] [] | ||
1: (empty) | ||
2: R_PAREN@18..19 ")" [] [] | ||
1: SEMICOLON@19..20 ";" [] [] | ||
3: EOF@20..21 "" [Newline("\n")] [] | ||
-- | ||
error[SyntaxError]: Parenthesized expression didnt contain anything | ||
┌─ ts_new_operator.ts:1:19 | ||
│ | ||
1 │ new A<test><test>(); | ||
│ ^ Expected an expression here | ||
|
||
-- | ||
new A<test><test>(); |
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 @@ | ||
new A<test><test>(); |