Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
chore: 🤖 update snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
IWANABETHATGUY committed Aug 27, 2022
1 parent 370c825 commit b6ee4c0
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 48 deletions.
2 changes: 1 addition & 1 deletion crates/rome_js_parser/src/syntax/typescript/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1246,7 +1246,7 @@ pub(crate) fn parse_ts_type_arguments_in_expression(p: &mut Parser) -> ParsedSyn
p.re_lex(ReLexContext::TypeArgumentLessThan);
let arguments = parse_ts_type_arguments_impl(p, false);

if p.last() == Some(T![>]) && matches!(p.cur(), T!['('] | BACKTICK) {
if p.last() == Some(T![>]) && matches!(p.cur(), T!['('] | BACKTICK | T![?.]) {
Ok(Present(arguments))
} else {
Err(())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,39 @@ JsModule {
directives: JsDirectiveList [],
items: JsModuleItemList [
JsExpressionStatement {
expression: JsBinaryExpression {
left: JsBinaryExpression {
left: JsNewExpression {
expression: JsCallExpression {
callee: JsStaticMemberExpression {
object: JsNewExpression {
new_token: NEW_KW@0..4 "new" [] [Whitespace(" ")],
callee: JsIdentifierExpression {
name: JsReferenceIdentifier {
value_token: IDENT@4..8 "Test" [] [],
},
},
type_arguments: missing (optional),
type_arguments: TsTypeArguments {
l_angle_token: L_ANGLE@8..9 "<" [] [],
ts_type_argument_list: TsTypeArgumentList [
TsStringType {
string_token: STRING_KW@9..15 "string" [] [],
},
],
r_angle_token: R_ANGLE@15..16 ">" [] [],
},
arguments: missing (optional),
},
operator_token: L_ANGLE@8..9 "<" [] [],
right: JsIdentifierExpression {
name: JsReferenceIdentifier {
value_token: IDENT@9..15 "string" [] [],
},
operator_token: QUESTIONDOT@16..18 "?." [] [],
member: JsName {
value_token: IDENT@18..22 "test" [] [],
},
},
operator_token: R_ANGLE@15..16 ">" [] [],
right: missing (required),
optional_chain_token: missing (optional),
type_arguments: missing (optional),
arguments: JsCallArguments {
l_paren_token: L_PAREN@22..23 "(" [] [],
args: JsCallArgumentList [],
r_paren_token: R_PAREN@23..24 ")" [] [],
},
},
semicolon_token: missing (optional),
},
JsUnknownStatement {
items: [
QUESTIONDOT@16..18 "?." [] [],
IDENT@18..22 "test" [] [],
L_PAREN@22..23 "(" [] [],
R_PAREN@23..24 ")" [] [],
],
},
JsEmptyStatement {
semicolon_token: SEMICOLON@24..25 ";" [] [],
},
JsExpressionStatement {
Expand Down Expand Up @@ -225,31 +225,32 @@ JsModule {
0: (empty)
1: JS_DIRECTIVE_LIST@0..0
2: JS_MODULE_ITEM_LIST@0..103
0: JS_EXPRESSION_STATEMENT@0..16
0: JS_BINARY_EXPRESSION@0..16
0: JS_BINARY_EXPRESSION@0..15
0: JS_NEW_EXPRESSION@0..8
0: JS_EXPRESSION_STATEMENT@0..25
0: JS_CALL_EXPRESSION@0..24
0: JS_STATIC_MEMBER_EXPRESSION@0..22
0: JS_NEW_EXPRESSION@0..16
0: NEW_KW@0..4 "new" [] [Whitespace(" ")]
1: JS_IDENTIFIER_EXPRESSION@4..8
0: JS_REFERENCE_IDENTIFIER@4..8
0: IDENT@4..8 "Test" [] []
2: (empty)
2: TS_TYPE_ARGUMENTS@8..16
0: L_ANGLE@8..9 "<" [] []
1: TS_TYPE_ARGUMENT_LIST@9..15
0: TS_STRING_TYPE@9..15
0: STRING_KW@9..15 "string" [] []
2: R_ANGLE@15..16 ">" [] []
3: (empty)
1: L_ANGLE@8..9 "<" [] []
2: JS_IDENTIFIER_EXPRESSION@9..15
0: JS_REFERENCE_IDENTIFIER@9..15
0: IDENT@9..15 "string" [] []
1: R_ANGLE@15..16 ">" [] []
1: QUESTIONDOT@16..18 "?." [] []
2: JS_NAME@18..22
0: IDENT@18..22 "test" [] []
1: (empty)
2: (empty)
1: (empty)
1: JS_UNKNOWN_STATEMENT@16..24
0: QUESTIONDOT@16..18 "?." [] []
1: IDENT@18..22 "test" [] []
2: L_PAREN@22..23 "(" [] []
3: R_PAREN@23..24 ")" [] []
2: JS_EMPTY_STATEMENT@24..25
0: SEMICOLON@24..25 ";" [] []
3: JS_EXPRESSION_STATEMENT@25..43
3: JS_CALL_ARGUMENTS@22..24
0: L_PAREN@22..23 "(" [] []
1: JS_CALL_ARGUMENT_LIST@23..23
2: R_PAREN@23..24 ")" [] []
1: SEMICOLON@24..25 ";" [] []
1: JS_EXPRESSION_STATEMENT@25..43
0: JS_CALL_EXPRESSION@25..42
0: JS_STATIC_MEMBER_EXPRESSION@25..40
0: JS_NEW_EXPRESSION@25..34
Expand All @@ -269,7 +270,7 @@ JsModule {
1: JS_CALL_ARGUMENT_LIST@41..41
2: R_PAREN@41..42 ")" [] []
1: SEMICOLON@42..43 ";" [] []
4: JS_EXPRESSION_STATEMENT@43..56
2: JS_EXPRESSION_STATEMENT@43..56
0: JS_CALL_EXPRESSION@43..56
0: JS_STATIC_MEMBER_EXPRESSION@43..54
0: JS_NEW_EXPRESSION@43..51
Expand All @@ -293,7 +294,7 @@ JsModule {
1: JS_CALL_ARGUMENT_LIST@55..55
2: R_PAREN@55..56 ")" [] []
1: (empty)
5: JS_EXPRESSION_STATEMENT@56..71
3: JS_EXPRESSION_STATEMENT@56..71
0: JS_CALL_EXPRESSION@56..71
0: JS_STATIC_MEMBER_EXPRESSION@56..69
0: JS_NEW_EXPRESSION@56..66
Expand All @@ -320,7 +321,7 @@ JsModule {
1: JS_CALL_ARGUMENT_LIST@70..70
2: R_PAREN@70..71 ")" [] []
1: (empty)
6: JS_EXPRESSION_STATEMENT@71..89
4: JS_EXPRESSION_STATEMENT@71..89
0: JS_NEW_EXPRESSION@71..89
0: NEW_KW@71..76 "new" [Newline("\n")] [Whitespace(" ")]
1: JS_STATIC_MEMBER_EXPRESSION@76..87
Expand Down Expand Up @@ -350,7 +351,7 @@ JsModule {
1: JS_CALL_ARGUMENT_LIST@88..88
2: R_PAREN@88..89 ")" [] []
1: (empty)
7: JS_EXPRESSION_STATEMENT@89..103
5: JS_EXPRESSION_STATEMENT@89..103
0: JS_CALL_EXPRESSION@89..103
0: JS_CALL_EXPRESSION@89..101
0: JS_NEW_EXPRESSION@89..97
Expand Down Expand Up @@ -379,11 +380,11 @@ JsModule {
1: (empty)
3: EOF@103..104 "" [Newline("\n")] []
--
error[SyntaxError]: expected an expression but instead found '?.'
error[SyntaxError]: Invalid optional chain from new expression.
┌─ invalid_optional_chain_from_new_expressions.ts:1:17
1 │ new Test<string>?.test();
│ ^^ Expected an expression here
│ ^^

--
error[SyntaxError]: Invalid optional chain from new expression.
Expand Down

0 comments on commit b6ee4c0

Please sign in to comment.