diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-08-13 13:46:47 +0100 |
---|---|---|
committer | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-08-13 13:46:47 +0100 |
commit | 978e3e384b045ea72ba952e7f94a2a4c82297e66 (patch) | |
tree | 934770bc4dd73e3c829a67e13858bbd941b92f27 /crates/ra_syntax/test_data/parser/inline | |
parent | 2c65a059840dd2092a00e90337a8221cd832c456 (diff) | |
parent | eb0e9bd98132dabbd908b473c5c1131f0787ffac (diff) |
Merge #1636
1636: fix block parse problem r=matklad a=bravomikekilo
try to fix [issue-1598](https://github.com/rust-analyzer/rust-analyzer/issues/1598).
Co-authored-by: bravomikekilo <[email protected]>
Diffstat (limited to 'crates/ra_syntax/test_data/parser/inline')
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0138_expression_after_block.rs | 4 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0138_expression_after_block.txt | 65 |
2 files changed, 69 insertions, 0 deletions
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0138_expression_after_block.rs b/crates/ra_syntax/test_data/parser/inline/ok/0138_expression_after_block.rs new file mode 100644 index 000000000..76007e3ee --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0138_expression_after_block.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn foo() { | ||
2 | let mut p = F{x: 5}; | ||
3 | {p}.x = 10; | ||
4 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0138_expression_after_block.txt b/crates/ra_syntax/test_data/parser/inline/ok/0138_expression_after_block.txt new file mode 100644 index 000000000..08128f365 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0138_expression_after_block.txt | |||
@@ -0,0 +1,65 @@ | |||
1 | SOURCE_FILE@[0; 52) | ||
2 | FN_DEF@[0; 51) | ||
3 | FN_KW@[0; 2) "fn" | ||
4 | WHITESPACE@[2; 3) " " | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) "(" | ||
9 | R_PAREN@[7; 8) ")" | ||
10 | WHITESPACE@[8; 9) " " | ||
11 | BLOCK@[9; 51) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 14) "\n " | ||
14 | LET_STMT@[14; 34) | ||
15 | LET_KW@[14; 17) "let" | ||
16 | WHITESPACE@[17; 18) " " | ||
17 | BIND_PAT@[18; 23) | ||
18 | MUT_KW@[18; 21) "mut" | ||
19 | WHITESPACE@[21; 22) " " | ||
20 | NAME@[22; 23) | ||
21 | IDENT@[22; 23) "p" | ||
22 | WHITESPACE@[23; 24) " " | ||
23 | EQ@[24; 25) "=" | ||
24 | WHITESPACE@[25; 26) " " | ||
25 | STRUCT_LIT@[26; 33) | ||
26 | PATH@[26; 27) | ||
27 | PATH_SEGMENT@[26; 27) | ||
28 | NAME_REF@[26; 27) | ||
29 | IDENT@[26; 27) "F" | ||
30 | NAMED_FIELD_LIST@[27; 33) | ||
31 | L_CURLY@[27; 28) "{" | ||
32 | NAMED_FIELD@[28; 32) | ||
33 | NAME_REF@[28; 29) | ||
34 | IDENT@[28; 29) "x" | ||
35 | COLON@[29; 30) ":" | ||
36 | WHITESPACE@[30; 31) " " | ||
37 | LITERAL@[31; 32) | ||
38 | INT_NUMBER@[31; 32) "5" | ||
39 | R_CURLY@[32; 33) "}" | ||
40 | SEMI@[33; 34) ";" | ||
41 | WHITESPACE@[34; 38) "\n " | ||
42 | EXPR_STMT@[38; 49) | ||
43 | BIN_EXPR@[38; 48) | ||
44 | FIELD_EXPR@[38; 43) | ||
45 | BLOCK_EXPR@[38; 41) | ||
46 | BLOCK@[38; 41) | ||
47 | L_CURLY@[38; 39) "{" | ||
48 | PATH_EXPR@[39; 40) | ||
49 | PATH@[39; 40) | ||
50 | PATH_SEGMENT@[39; 40) | ||
51 | NAME_REF@[39; 40) | ||
52 | IDENT@[39; 40) "p" | ||
53 | R_CURLY@[40; 41) "}" | ||
54 | DOT@[41; 42) "." | ||
55 | NAME_REF@[42; 43) | ||
56 | IDENT@[42; 43) "x" | ||
57 | WHITESPACE@[43; 44) " " | ||
58 | EQ@[44; 45) "=" | ||
59 | WHITESPACE@[45; 46) " " | ||
60 | LITERAL@[46; 48) | ||
61 | INT_NUMBER@[46; 48) "10" | ||
62 | SEMI@[48; 49) ";" | ||
63 | WHITESPACE@[49; 50) "\n" | ||
64 | R_CURLY@[50; 51) "}" | ||
65 | WHITESPACE@[51; 52) "\n" | ||