aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/test_data/parser/inline
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-03-25 15:41:50 +0000
committerAleksey Kladov <[email protected]>2020-03-25 16:01:28 +0000
commitf6188caaa0d226bef88418c9ff3f13a63ae95358 (patch)
tree86cd80fad18be823a01cf945762f35b12d34eec5 /crates/ra_syntax/test_data/parser/inline
parent785eb32f49653fbc5789396af4fa6ad61f89fb38 (diff)
Fix parsing lambdas with return type
We should eat only a single block, and not whatever larger expression may start with a block. closes #3721
Diffstat (limited to 'crates/ra_syntax/test_data/parser/inline')
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0158_lambda_ret_block.rs1
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0158_lambda_ret_block.txt45
2 files changed, 46 insertions, 0 deletions
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0158_lambda_ret_block.rs b/crates/ra_syntax/test_data/parser/inline/ok/0158_lambda_ret_block.rs
new file mode 100644
index 000000000..061118d3a
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0158_lambda_ret_block.rs
@@ -0,0 +1 @@
fn main() { || -> i32 { 92 }(); }
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0158_lambda_ret_block.txt b/crates/ra_syntax/test_data/parser/inline/ok/0158_lambda_ret_block.txt
new file mode 100644
index 000000000..ba8779094
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0158_lambda_ret_block.txt
@@ -0,0 +1,45 @@
1SOURCE_FILE@[0; 34)
2 FN_DEF@[0; 33)
3 FN_KW@[0; 2) "fn"
4 WHITESPACE@[2; 3) " "
5 NAME@[3; 7)
6 IDENT@[3; 7) "main"
7 PARAM_LIST@[7; 9)
8 L_PAREN@[7; 8) "("
9 R_PAREN@[8; 9) ")"
10 WHITESPACE@[9; 10) " "
11 BLOCK_EXPR@[10; 33)
12 BLOCK@[10; 33)
13 L_CURLY@[10; 11) "{"
14 WHITESPACE@[11; 12) " "
15 EXPR_STMT@[12; 31)
16 CALL_EXPR@[12; 30)
17 LAMBDA_EXPR@[12; 28)
18 PARAM_LIST@[12; 14)
19 PIPE@[12; 13) "|"
20 PIPE@[13; 14) "|"
21 WHITESPACE@[14; 15) " "
22 RET_TYPE@[15; 21)
23 THIN_ARROW@[15; 17) "->"
24 WHITESPACE@[17; 18) " "
25 PATH_TYPE@[18; 21)
26 PATH@[18; 21)
27 PATH_SEGMENT@[18; 21)
28 NAME_REF@[18; 21)
29 IDENT@[18; 21) "i32"
30 WHITESPACE@[21; 22) " "
31 BLOCK_EXPR@[22; 28)
32 BLOCK@[22; 28)
33 L_CURLY@[22; 23) "{"
34 WHITESPACE@[23; 24) " "
35 LITERAL@[24; 26)
36 INT_NUMBER@[24; 26) "92"
37 WHITESPACE@[26; 27) " "
38 R_CURLY@[27; 28) "}"
39 ARG_LIST@[28; 30)
40 L_PAREN@[28; 29) "("
41 R_PAREN@[29; 30) ")"
42 SEMI@[30; 31) ";"
43 WHITESPACE@[31; 32) " "
44 R_CURLY@[32; 33) "}"
45 WHITESPACE@[33; 34) "\n"