diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-02-07 13:13:36 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-02-07 13:13:36 +0000 |
commit | 6d6a995e09c74a8b1075842fb3cd7232354389ae (patch) | |
tree | e445538d8619848896b69cfae6a80672b1faceb1 /crates/ra_syntax/test_data/parser/inline/ok/0155_closure_params.txt | |
parent | 4d0d113c7d17483f3a6e0d09db7cc0cb5ed145c4 (diff) | |
parent | 90ff2be4e820601a1d16ba5716916f7424dfa10d (diff) |
Merge #3040
3040: Rework value parameter parsing r=matklad a=tobz1000
Fixes #2847.
- `Fn__(...)` parameters with idents/patterns no longer parse
- Trait function parameters with arbitrary patterns parse
- Trait function parameters without idents/patterns no longer parse
- `fn(...)` parameters no longer parse with patterns other than a single ident
__Question__: The pre-existing test `param_list_opt_patterns` has been kept as-is, although the name no longer makes sense (it's testing `Fn__(...)` params, which aren't allowed patterns any more). What would be best to do about this?
Co-authored-by: Toby Dimmick <[email protected]>
Diffstat (limited to 'crates/ra_syntax/test_data/parser/inline/ok/0155_closure_params.txt')
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0155_closure_params.txt | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0155_closure_params.txt b/crates/ra_syntax/test_data/parser/inline/ok/0155_closure_params.txt new file mode 100644 index 000000000..98727ae98 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0155_closure_params.txt | |||
@@ -0,0 +1,70 @@ | |||
1 | SOURCE_FILE@[0; 63) | ||
2 | FN_DEF@[0; 62) | ||
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; 62) | ||
12 | BLOCK@[10; 62) | ||
13 | L_CURLY@[10; 11) "{" | ||
14 | WHITESPACE@[11; 15) "\n " | ||
15 | LET_STMT@[15; 60) | ||
16 | LET_KW@[15; 18) "let" | ||
17 | WHITESPACE@[18; 19) " " | ||
18 | BIND_PAT@[19; 22) | ||
19 | NAME@[19; 22) | ||
20 | IDENT@[19; 22) "foo" | ||
21 | WHITESPACE@[22; 23) " " | ||
22 | EQ@[23; 24) "=" | ||
23 | WHITESPACE@[24; 25) " " | ||
24 | LAMBDA_EXPR@[25; 59) | ||
25 | PARAM_LIST@[25; 56) | ||
26 | PIPE@[25; 26) "|" | ||
27 | PARAM@[26; 29) | ||
28 | BIND_PAT@[26; 29) | ||
29 | NAME@[26; 29) | ||
30 | IDENT@[26; 29) "bar" | ||
31 | COMMA@[29; 30) "," | ||
32 | WHITESPACE@[30; 31) " " | ||
33 | PARAM@[31; 39) | ||
34 | BIND_PAT@[31; 34) | ||
35 | NAME@[31; 34) | ||
36 | IDENT@[31; 34) "baz" | ||
37 | COLON@[34; 35) ":" | ||
38 | WHITESPACE@[35; 36) " " | ||
39 | PATH_TYPE@[36; 39) | ||
40 | PATH@[36; 39) | ||
41 | PATH_SEGMENT@[36; 39) | ||
42 | NAME_REF@[36; 39) | ||
43 | IDENT@[36; 39) "Baz" | ||
44 | COMMA@[39; 40) "," | ||
45 | WHITESPACE@[40; 41) " " | ||
46 | PARAM@[41; 55) | ||
47 | BIND_PAT@[41; 44) | ||
48 | NAME@[41; 44) | ||
49 | IDENT@[41; 44) "qux" | ||
50 | COLON@[44; 45) ":" | ||
51 | WHITESPACE@[45; 46) " " | ||
52 | PATH_TYPE@[46; 55) | ||
53 | PATH@[46; 55) | ||
54 | PATH@[46; 49) | ||
55 | PATH_SEGMENT@[46; 49) | ||
56 | NAME_REF@[46; 49) | ||
57 | IDENT@[46; 49) "Qux" | ||
58 | COLONCOLON@[49; 51) "::" | ||
59 | PATH_SEGMENT@[51; 55) | ||
60 | NAME_REF@[51; 55) | ||
61 | IDENT@[51; 55) "Quux" | ||
62 | PIPE@[55; 56) "|" | ||
63 | WHITESPACE@[56; 57) " " | ||
64 | TUPLE_EXPR@[57; 59) | ||
65 | L_PAREN@[57; 58) "(" | ||
66 | R_PAREN@[58; 59) ")" | ||
67 | SEMI@[59; 60) ";" | ||
68 | WHITESPACE@[60; 61) "\n" | ||
69 | R_CURLY@[61; 62) "}" | ||
70 | WHITESPACE@[62; 63) "\n" | ||