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/0071_match_expr.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/0071_match_expr.txt')
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0071_match_expr.txt | 65 |
1 files changed, 58 insertions, 7 deletions
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0071_match_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0071_match_expr.txt index f62b6c6d5..0af668056 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0071_match_expr.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0071_match_expr.txt | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@[0; 47) | 1 | SOURCE_FILE@[0; 97) |
2 | FN_DEF@[0; 46) | 2 | FN_DEF@[0; 96) |
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,8 +8,8 @@ SOURCE_FILE@[0; 47) | |||
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; 46) | 11 | BLOCK_EXPR@[9; 96) |
12 | BLOCK@[9; 46) | 12 | BLOCK@[9; 96) |
13 | L_CURLY@[9; 10) "{" | 13 | L_CURLY@[9; 10) "{" |
14 | WHITESPACE@[10; 15) "\n " | 14 | WHITESPACE@[10; 15) "\n " |
15 | EXPR_STMT@[15; 28) | 15 | EXPR_STMT@[15; 28) |
@@ -40,6 +40,57 @@ SOURCE_FILE@[0; 47) | |||
40 | L_CURLY@[41; 42) "{" | 40 | L_CURLY@[41; 42) "{" |
41 | R_CURLY@[42; 43) "}" | 41 | R_CURLY@[42; 43) "}" |
42 | SEMI@[43; 44) ";" | 42 | SEMI@[43; 44) ";" |
43 | WHITESPACE@[44; 45) "\n" | 43 | WHITESPACE@[44; 49) "\n " |
44 | R_CURLY@[45; 46) "}" | 44 | EXPR_STMT@[49; 71) |
45 | WHITESPACE@[46; 47) "\n" | 45 | MATCH_EXPR@[49; 70) |
46 | MATCH_KW@[49; 54) "match" | ||
47 | WHITESPACE@[54; 55) " " | ||
48 | BLOCK_EXPR@[55; 58) | ||
49 | BLOCK@[55; 58) | ||
50 | L_CURLY@[55; 56) "{" | ||
51 | WHITESPACE@[56; 57) " " | ||
52 | R_CURLY@[57; 58) "}" | ||
53 | WHITESPACE@[58; 59) " " | ||
54 | MATCH_ARM_LIST@[59; 70) | ||
55 | L_CURLY@[59; 60) "{" | ||
56 | WHITESPACE@[60; 61) " " | ||
57 | MATCH_ARM@[61; 68) | ||
58 | PLACEHOLDER_PAT@[61; 62) | ||
59 | UNDERSCORE@[61; 62) "_" | ||
60 | WHITESPACE@[62; 63) " " | ||
61 | FAT_ARROW@[63; 65) "=>" | ||
62 | WHITESPACE@[65; 66) " " | ||
63 | TUPLE_EXPR@[66; 68) | ||
64 | L_PAREN@[66; 67) "(" | ||
65 | R_PAREN@[67; 68) ")" | ||
66 | WHITESPACE@[68; 69) " " | ||
67 | R_CURLY@[69; 70) "}" | ||
68 | SEMI@[70; 71) ";" | ||
69 | WHITESPACE@[71; 76) "\n " | ||
70 | EXPR_STMT@[76; 94) | ||
71 | MATCH_EXPR@[76; 93) | ||
72 | MATCH_KW@[76; 81) "match" | ||
73 | WHITESPACE@[81; 82) " " | ||
74 | BLOCK_EXPR@[82; 90) | ||
75 | BLOCK@[82; 90) | ||
76 | L_CURLY@[82; 83) "{" | ||
77 | WHITESPACE@[83; 84) " " | ||
78 | RECORD_LIT@[84; 88) | ||
79 | PATH@[84; 85) | ||
80 | PATH_SEGMENT@[84; 85) | ||
81 | NAME_REF@[84; 85) | ||
82 | IDENT@[84; 85) "S" | ||
83 | WHITESPACE@[85; 86) " " | ||
84 | RECORD_FIELD_LIST@[86; 88) | ||
85 | L_CURLY@[86; 87) "{" | ||
86 | R_CURLY@[87; 88) "}" | ||
87 | WHITESPACE@[88; 89) " " | ||
88 | R_CURLY@[89; 90) "}" | ||
89 | WHITESPACE@[90; 91) " " | ||
90 | MATCH_ARM_LIST@[91; 93) | ||
91 | L_CURLY@[91; 92) "{" | ||
92 | R_CURLY@[92; 93) "}" | ||
93 | SEMI@[93; 94) ";" | ||
94 | WHITESPACE@[94; 95) "\n" | ||
95 | R_CURLY@[95; 96) "}" | ||
96 | WHITESPACE@[96; 97) "\n" | ||