diff options
author | Geoffry Song <[email protected]> | 2019-10-03 07:38:03 +0100 |
---|---|---|
committer | Geoffry Song <[email protected]> | 2019-10-03 08:39:52 +0100 |
commit | 9638adaa40d22adcf9b4002d95a13977c0f1436f (patch) | |
tree | 9a6b2a477a371499f7a9012b26bf639acd801cb6 /crates/ra_syntax/test_data/parser/inline/ok/0080_postfix_range.txt | |
parent | e1c367595139f109fb6f53811bed7d67a384793e (diff) |
Fix parsing of block expressions in "forbid_structs" contexts.
Forbidding block expressions entirely is too strict; instead, we should only
forbid them in contexts where we are parsing an optional RHS (i.e. the RHS of a
range expression).
Diffstat (limited to 'crates/ra_syntax/test_data/parser/inline/ok/0080_postfix_range.txt')
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0080_postfix_range.txt | 107 |
1 files changed, 86 insertions, 21 deletions
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0080_postfix_range.txt b/crates/ra_syntax/test_data/parser/inline/ok/0080_postfix_range.txt index f3c292f5e..9f8a6b0f6 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0080_postfix_range.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0080_postfix_range.txt | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@[0; 26) | 1 | SOURCE_FILE@[0; 89) |
2 | FN_DEF@[0; 25) | 2 | FN_DEF@[0; 88) |
3 | FN_KW@[0; 2) "fn" | 3 | FN_KW@[0; 2) "fn" |
4 | WHITESPACE@[2; 3) " " | 4 | WHITESPACE@[2; 3) " " |
5 | NAME@[3; 6) | 5 | NAME@[3; 6) |
@@ -8,24 +8,89 @@ SOURCE_FILE@[0; 26) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK_EXPR@[9; 25) | 11 | BLOCK_EXPR@[9; 88) |
12 | BLOCK@[9; 25) | 12 | BLOCK@[9; 88) |
13 | L_CURLY@[9; 10) "{" | 13 | L_CURLY@[9; 10) "{" |
14 | WHITESPACE@[10; 11) " " | 14 | WHITESPACE@[10; 15) "\n " |
15 | LET_STMT@[11; 23) | 15 | LET_STMT@[15; 27) |
16 | LET_KW@[11; 14) "let" | 16 | LET_KW@[15; 18) "let" |
17 | WHITESPACE@[14; 15) " " | ||
18 | BIND_PAT@[15; 16) | ||
19 | NAME@[15; 16) | ||
20 | IDENT@[15; 16) "x" | ||
21 | WHITESPACE@[16; 17) " " | ||
22 | EQ@[17; 18) "=" | ||
23 | WHITESPACE@[18; 19) " " | 17 | WHITESPACE@[18; 19) " " |
24 | RANGE_EXPR@[19; 22) | 18 | BIND_PAT@[19; 20) |
25 | LITERAL@[19; 20) | 19 | NAME@[19; 20) |
26 | INT_NUMBER@[19; 20) "1" | 20 | IDENT@[19; 20) "x" |
27 | DOTDOT@[20; 22) ".." | 21 | WHITESPACE@[20; 21) " " |
28 | SEMI@[22; 23) ";" | 22 | EQ@[21; 22) "=" |
29 | WHITESPACE@[23; 24) " " | 23 | WHITESPACE@[22; 23) " " |
30 | R_CURLY@[24; 25) "}" | 24 | RANGE_EXPR@[23; 26) |
31 | WHITESPACE@[25; 26) "\n" | 25 | LITERAL@[23; 24) |
26 | INT_NUMBER@[23; 24) "1" | ||
27 | DOTDOT@[24; 26) ".." | ||
28 | SEMI@[26; 27) ";" | ||
29 | WHITESPACE@[27; 32) "\n " | ||
30 | EXPR_STMT@[32; 54) | ||
31 | MATCH_EXPR@[32; 53) | ||
32 | MATCH_KW@[32; 37) "match" | ||
33 | WHITESPACE@[37; 38) " " | ||
34 | RANGE_EXPR@[38; 41) | ||
35 | LITERAL@[38; 39) | ||
36 | INT_NUMBER@[38; 39) "1" | ||
37 | DOTDOT@[39; 41) ".." | ||
38 | WHITESPACE@[41; 42) " " | ||
39 | MATCH_ARM_LIST@[42; 53) | ||
40 | L_CURLY@[42; 43) "{" | ||
41 | WHITESPACE@[43; 44) " " | ||
42 | MATCH_ARM@[44; 51) | ||
43 | PLACEHOLDER_PAT@[44; 45) | ||
44 | UNDERSCORE@[44; 45) "_" | ||
45 | WHITESPACE@[45; 46) " " | ||
46 | FAT_ARROW@[46; 48) "=>" | ||
47 | WHITESPACE@[48; 49) " " | ||
48 | TUPLE_EXPR@[49; 51) | ||
49 | L_PAREN@[49; 50) "(" | ||
50 | R_PAREN@[50; 51) ")" | ||
51 | WHITESPACE@[51; 52) " " | ||
52 | R_CURLY@[52; 53) "}" | ||
53 | SEMI@[53; 54) ";" | ||
54 | WHITESPACE@[54; 59) "\n " | ||
55 | EXPR_STMT@[59; 86) | ||
56 | MATCH_EXPR@[59; 85) | ||
57 | MATCH_KW@[59; 64) "match" | ||
58 | WHITESPACE@[64; 65) " " | ||
59 | RANGE_EXPR@[65; 73) | ||
60 | METHOD_CALL_EXPR@[65; 70) | ||
61 | PATH_EXPR@[65; 66) | ||
62 | PATH@[65; 66) | ||
63 | PATH_SEGMENT@[65; 66) | ||
64 | NAME_REF@[65; 66) | ||
65 | IDENT@[65; 66) "a" | ||
66 | DOT@[66; 67) "." | ||
67 | NAME_REF@[67; 68) | ||
68 | IDENT@[67; 68) "b" | ||
69 | ARG_LIST@[68; 70) | ||
70 | L_PAREN@[68; 69) "(" | ||
71 | R_PAREN@[69; 70) ")" | ||
72 | DOTDOT@[70; 72) ".." | ||
73 | PATH_EXPR@[72; 73) | ||
74 | PATH@[72; 73) | ||
75 | PATH_SEGMENT@[72; 73) | ||
76 | NAME_REF@[72; 73) | ||
77 | IDENT@[72; 73) "S" | ||
78 | WHITESPACE@[73; 74) " " | ||
79 | MATCH_ARM_LIST@[74; 85) | ||
80 | L_CURLY@[74; 75) "{" | ||
81 | WHITESPACE@[75; 76) " " | ||
82 | MATCH_ARM@[76; 83) | ||
83 | PLACEHOLDER_PAT@[76; 77) | ||
84 | UNDERSCORE@[76; 77) "_" | ||
85 | WHITESPACE@[77; 78) " " | ||
86 | FAT_ARROW@[78; 80) "=>" | ||
87 | WHITESPACE@[80; 81) " " | ||
88 | TUPLE_EXPR@[81; 83) | ||
89 | L_PAREN@[81; 82) "(" | ||
90 | R_PAREN@[82; 83) ")" | ||
91 | WHITESPACE@[83; 84) " " | ||
92 | R_CURLY@[84; 85) "}" | ||
93 | SEMI@[85; 86) ";" | ||
94 | WHITESPACE@[86; 87) "\n" | ||
95 | R_CURLY@[87; 88) "}" | ||
96 | WHITESPACE@[88; 89) "\n" | ||