diff options
Diffstat (limited to 'crates/ra_syntax/test_data')
4 files changed, 143 insertions, 0 deletions
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0145_record_field_pat.rs b/crates/ra_syntax/test_data/parser/inline/ok/0145_record_field_pat.rs new file mode 100644 index 000000000..26b1d5f89 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0145_record_field_pat.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn foo() { | ||
2 | let S { 0: 1 } = (); | ||
3 | let S { x: 1 } = (); | ||
4 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0145_record_field_pat.txt b/crates/ra_syntax/test_data/parser/inline/ok/0145_record_field_pat.txt new file mode 100644 index 000000000..06fbdfabf --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0145_record_field_pat.txt | |||
@@ -0,0 +1,75 @@ | |||
1 | SOURCE_FILE@[0; 63) | ||
2 | FN_DEF@[0; 62) | ||
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_EXPR@[9; 62) | ||
12 | BLOCK@[9; 62) | ||
13 | L_CURLY@[9; 10) "{" | ||
14 | WHITESPACE@[10; 15) "\n " | ||
15 | LET_STMT@[15; 35) | ||
16 | LET_KW@[15; 18) "let" | ||
17 | WHITESPACE@[18; 19) " " | ||
18 | RECORD_PAT@[19; 29) | ||
19 | PATH@[19; 20) | ||
20 | PATH_SEGMENT@[19; 20) | ||
21 | NAME_REF@[19; 20) | ||
22 | IDENT@[19; 20) "S" | ||
23 | WHITESPACE@[20; 21) " " | ||
24 | RECORD_FIELD_PAT_LIST@[21; 29) | ||
25 | L_CURLY@[21; 22) "{" | ||
26 | WHITESPACE@[22; 23) " " | ||
27 | RECORD_FIELD_PAT@[23; 27) | ||
28 | INT_NUMBER@[23; 24) "0" | ||
29 | COLON@[24; 25) ":" | ||
30 | WHITESPACE@[25; 26) " " | ||
31 | LITERAL_PAT@[26; 27) | ||
32 | LITERAL@[26; 27) | ||
33 | INT_NUMBER@[26; 27) "1" | ||
34 | WHITESPACE@[27; 28) " " | ||
35 | R_CURLY@[28; 29) "}" | ||
36 | WHITESPACE@[29; 30) " " | ||
37 | EQ@[30; 31) "=" | ||
38 | WHITESPACE@[31; 32) " " | ||
39 | TUPLE_EXPR@[32; 34) | ||
40 | L_PAREN@[32; 33) "(" | ||
41 | R_PAREN@[33; 34) ")" | ||
42 | SEMI@[34; 35) ";" | ||
43 | WHITESPACE@[35; 40) "\n " | ||
44 | LET_STMT@[40; 60) | ||
45 | LET_KW@[40; 43) "let" | ||
46 | WHITESPACE@[43; 44) " " | ||
47 | RECORD_PAT@[44; 54) | ||
48 | PATH@[44; 45) | ||
49 | PATH_SEGMENT@[44; 45) | ||
50 | NAME_REF@[44; 45) | ||
51 | IDENT@[44; 45) "S" | ||
52 | WHITESPACE@[45; 46) " " | ||
53 | RECORD_FIELD_PAT_LIST@[46; 54) | ||
54 | L_CURLY@[46; 47) "{" | ||
55 | WHITESPACE@[47; 48) " " | ||
56 | RECORD_FIELD_PAT@[48; 52) | ||
57 | NAME@[48; 49) | ||
58 | IDENT@[48; 49) "x" | ||
59 | COLON@[49; 50) ":" | ||
60 | WHITESPACE@[50; 51) " " | ||
61 | LITERAL_PAT@[51; 52) | ||
62 | LITERAL@[51; 52) | ||
63 | INT_NUMBER@[51; 52) "1" | ||
64 | WHITESPACE@[52; 53) " " | ||
65 | R_CURLY@[53; 54) "}" | ||
66 | WHITESPACE@[54; 55) " " | ||
67 | EQ@[55; 56) "=" | ||
68 | WHITESPACE@[56; 57) " " | ||
69 | TUPLE_EXPR@[57; 59) | ||
70 | L_PAREN@[57; 58) "(" | ||
71 | R_PAREN@[58; 59) ")" | ||
72 | SEMI@[59; 60) ";" | ||
73 | WHITESPACE@[60; 61) "\n" | ||
74 | R_CURLY@[61; 62) "}" | ||
75 | WHITESPACE@[62; 63) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/ok/0057_loop_in_call.rs b/crates/ra_syntax/test_data/parser/ok/0057_loop_in_call.rs new file mode 100644 index 000000000..31c12522f --- /dev/null +++ b/crates/ra_syntax/test_data/parser/ok/0057_loop_in_call.rs | |||
@@ -0,0 +1,5 @@ | |||
1 | fn foo(x: i32) {} | ||
2 | |||
3 | fn main() { | ||
4 | foo(loop {}); | ||
5 | } \ No newline at end of file | ||
diff --git a/crates/ra_syntax/test_data/parser/ok/0057_loop_in_call.txt b/crates/ra_syntax/test_data/parser/ok/0057_loop_in_call.txt new file mode 100644 index 000000000..cc8c3f7ec --- /dev/null +++ b/crates/ra_syntax/test_data/parser/ok/0057_loop_in_call.txt | |||
@@ -0,0 +1,59 @@ | |||
1 | SOURCE_FILE@[0; 50) | ||
2 | FN_DEF@[0; 17) | ||
3 | FN_KW@[0; 2) "fn" | ||
4 | WHITESPACE@[2; 3) " " | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 14) | ||
8 | L_PAREN@[6; 7) "(" | ||
9 | PARAM@[7; 13) | ||
10 | BIND_PAT@[7; 8) | ||
11 | NAME@[7; 8) | ||
12 | IDENT@[7; 8) "x" | ||
13 | COLON@[8; 9) ":" | ||
14 | WHITESPACE@[9; 10) " " | ||
15 | PATH_TYPE@[10; 13) | ||
16 | PATH@[10; 13) | ||
17 | PATH_SEGMENT@[10; 13) | ||
18 | NAME_REF@[10; 13) | ||
19 | IDENT@[10; 13) "i32" | ||
20 | R_PAREN@[13; 14) ")" | ||
21 | WHITESPACE@[14; 15) " " | ||
22 | BLOCK_EXPR@[15; 17) | ||
23 | BLOCK@[15; 17) | ||
24 | L_CURLY@[15; 16) "{" | ||
25 | R_CURLY@[16; 17) "}" | ||
26 | WHITESPACE@[17; 19) "\n\n" | ||
27 | FN_DEF@[19; 50) | ||
28 | FN_KW@[19; 21) "fn" | ||
29 | WHITESPACE@[21; 22) " " | ||
30 | NAME@[22; 26) | ||
31 | IDENT@[22; 26) "main" | ||
32 | PARAM_LIST@[26; 28) | ||
33 | L_PAREN@[26; 27) "(" | ||
34 | R_PAREN@[27; 28) ")" | ||
35 | WHITESPACE@[28; 29) " " | ||
36 | BLOCK_EXPR@[29; 50) | ||
37 | BLOCK@[29; 50) | ||
38 | L_CURLY@[29; 30) "{" | ||
39 | WHITESPACE@[30; 35) "\n " | ||
40 | EXPR_STMT@[35; 48) | ||
41 | CALL_EXPR@[35; 47) | ||
42 | PATH_EXPR@[35; 38) | ||
43 | PATH@[35; 38) | ||
44 | PATH_SEGMENT@[35; 38) | ||
45 | NAME_REF@[35; 38) | ||
46 | IDENT@[35; 38) "foo" | ||
47 | ARG_LIST@[38; 47) | ||
48 | L_PAREN@[38; 39) "(" | ||
49 | LOOP_EXPR@[39; 46) | ||
50 | LOOP_KW@[39; 43) "loop" | ||
51 | WHITESPACE@[43; 44) " " | ||
52 | BLOCK_EXPR@[44; 46) | ||
53 | BLOCK@[44; 46) | ||
54 | L_CURLY@[44; 45) "{" | ||
55 | R_CURLY@[45; 46) "}" | ||
56 | R_PAREN@[46; 47) ")" | ||
57 | SEMI@[47; 48) ";" | ||
58 | WHITESPACE@[48; 49) "\n" | ||
59 | R_CURLY@[49; 50) "}" | ||