diff options
Diffstat (limited to 'crates/ra_syntax/test_data/parser/inline')
298 files changed, 8747 insertions, 0 deletions
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0001_array_type_missing_semi.rs b/crates/ra_syntax/test_data/parser/inline/err/0001_array_type_missing_semi.rs new file mode 100644 index 000000000..a94851443 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/err/0001_array_type_missing_semi.rs | |||
@@ -0,0 +1 @@ | |||
type T = [() 92]; | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0001_array_type_missing_semi.txt b/crates/ra_syntax/test_data/parser/inline/err/0001_array_type_missing_semi.txt new file mode 100644 index 000000000..3f0f1b480 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/err/0001_array_type_missing_semi.txt | |||
@@ -0,0 +1,27 @@ | |||
1 | SOURCE_FILE@[0; 18) | ||
2 | TYPE_ALIAS_DEF@[0; 12) | ||
3 | TYPE_KW@[0; 4) "type" | ||
4 | WHITESPACE@[4; 5) " " | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "T" | ||
7 | WHITESPACE@[6; 7) " " | ||
8 | EQ@[7; 8) "=" | ||
9 | WHITESPACE@[8; 9) " " | ||
10 | SLICE_TYPE@[9; 12) | ||
11 | L_BRACK@[9; 10) "[" | ||
12 | TUPLE_TYPE@[10; 12) | ||
13 | L_PAREN@[10; 11) "(" | ||
14 | R_PAREN@[11; 12) ")" | ||
15 | WHITESPACE@[12; 13) " " | ||
16 | ERROR@[13; 15) | ||
17 | INT_NUMBER@[13; 15) "92" | ||
18 | ERROR@[15; 16) | ||
19 | R_BRACK@[15; 16) "]" | ||
20 | ERROR@[16; 17) | ||
21 | SEMI@[16; 17) ";" | ||
22 | WHITESPACE@[17; 18) "\n" | ||
23 | error 12: expected `;` or `]` | ||
24 | error 12: expected SEMI | ||
25 | error 13: expected an item | ||
26 | error 15: expected an item | ||
27 | error 16: expected an item | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0002_misplaced_label_err.rs b/crates/ra_syntax/test_data/parser/inline/err/0002_misplaced_label_err.rs new file mode 100644 index 000000000..a2164c510 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/err/0002_misplaced_label_err.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn main() { | ||
2 | 'loop: impl | ||
3 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0002_misplaced_label_err.txt b/crates/ra_syntax/test_data/parser/inline/err/0002_misplaced_label_err.txt new file mode 100644 index 000000000..7abc49d5e --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/err/0002_misplaced_label_err.txt | |||
@@ -0,0 +1,28 @@ | |||
1 | SOURCE_FILE@[0; 30) | ||
2 | FN_DEF@[0; 29) | ||
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@[10; 29) | ||
12 | L_CURLY@[10; 11) "{" | ||
13 | WHITESPACE@[11; 16) "\n " | ||
14 | EXPR_STMT@[16; 22) | ||
15 | ERROR@[16; 22) | ||
16 | LABEL@[16; 22) | ||
17 | LIFETIME@[16; 21) "\'loop" | ||
18 | COLON@[21; 22) ":" | ||
19 | WHITESPACE@[22; 23) " " | ||
20 | IMPL_BLOCK@[23; 27) | ||
21 | IMPL_KW@[23; 27) "impl" | ||
22 | WHITESPACE@[27; 28) "\n" | ||
23 | R_CURLY@[28; 29) "}" | ||
24 | WHITESPACE@[29; 30) "\n" | ||
25 | error 22: expected a loop | ||
26 | error 22: expected SEMI | ||
27 | error 27: expected type | ||
28 | error 27: expected `{` | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0003_pointer_type_no_mutability.rs b/crates/ra_syntax/test_data/parser/inline/err/0003_pointer_type_no_mutability.rs new file mode 100644 index 000000000..fae705131 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/err/0003_pointer_type_no_mutability.rs | |||
@@ -0,0 +1 @@ | |||
type T = *(); | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0003_pointer_type_no_mutability.txt b/crates/ra_syntax/test_data/parser/inline/err/0003_pointer_type_no_mutability.txt new file mode 100644 index 000000000..b97e339bb --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/err/0003_pointer_type_no_mutability.txt | |||
@@ -0,0 +1,17 @@ | |||
1 | SOURCE_FILE@[0; 14) | ||
2 | TYPE_ALIAS_DEF@[0; 13) | ||
3 | TYPE_KW@[0; 4) "type" | ||
4 | WHITESPACE@[4; 5) " " | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "T" | ||
7 | WHITESPACE@[6; 7) " " | ||
8 | EQ@[7; 8) "=" | ||
9 | WHITESPACE@[8; 9) " " | ||
10 | POINTER_TYPE@[9; 12) | ||
11 | STAR@[9; 10) "*" | ||
12 | TUPLE_TYPE@[10; 12) | ||
13 | L_PAREN@[10; 11) "(" | ||
14 | R_PAREN@[11; 12) ")" | ||
15 | SEMI@[12; 13) ";" | ||
16 | WHITESPACE@[13; 14) "\n" | ||
17 | error 10: expected mut or const in raw pointer type (use `*mut T` or `*const T` as appropriate) | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0004_impl_type.rs b/crates/ra_syntax/test_data/parser/inline/err/0004_impl_type.rs new file mode 100644 index 000000000..b8c7b65e3 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/err/0004_impl_type.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | impl Type {} | ||
2 | impl Trait1 for T {} | ||
3 | impl impl NotType {} | ||
4 | impl Trait2 for impl NotType {} | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0004_impl_type.txt b/crates/ra_syntax/test_data/parser/inline/err/0004_impl_type.txt new file mode 100644 index 000000000..43321b1ed --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/err/0004_impl_type.txt | |||
@@ -0,0 +1,79 @@ | |||
1 | SOURCE_FILE@[0; 87) | ||
2 | IMPL_BLOCK@[0; 12) | ||
3 | IMPL_KW@[0; 4) "impl" | ||
4 | WHITESPACE@[4; 5) " " | ||
5 | PATH_TYPE@[5; 9) | ||
6 | PATH@[5; 9) | ||
7 | PATH_SEGMENT@[5; 9) | ||
8 | NAME_REF@[5; 9) | ||
9 | IDENT@[5; 9) "Type" | ||
10 | WHITESPACE@[9; 10) " " | ||
11 | ITEM_LIST@[10; 12) | ||
12 | L_CURLY@[10; 11) "{" | ||
13 | R_CURLY@[11; 12) "}" | ||
14 | WHITESPACE@[12; 13) "\n" | ||
15 | IMPL_BLOCK@[13; 33) | ||
16 | IMPL_KW@[13; 17) "impl" | ||
17 | WHITESPACE@[17; 18) " " | ||
18 | PATH_TYPE@[18; 24) | ||
19 | PATH@[18; 24) | ||
20 | PATH_SEGMENT@[18; 24) | ||
21 | NAME_REF@[18; 24) | ||
22 | IDENT@[18; 24) "Trait1" | ||
23 | WHITESPACE@[24; 25) " " | ||
24 | FOR_KW@[25; 28) "for" | ||
25 | WHITESPACE@[28; 29) " " | ||
26 | PATH_TYPE@[29; 30) | ||
27 | PATH@[29; 30) | ||
28 | PATH_SEGMENT@[29; 30) | ||
29 | NAME_REF@[29; 30) | ||
30 | IDENT@[29; 30) "T" | ||
31 | WHITESPACE@[30; 31) " " | ||
32 | ITEM_LIST@[31; 33) | ||
33 | L_CURLY@[31; 32) "{" | ||
34 | R_CURLY@[32; 33) "}" | ||
35 | WHITESPACE@[33; 34) "\n" | ||
36 | IMPL_BLOCK@[34; 38) | ||
37 | IMPL_KW@[34; 38) "impl" | ||
38 | WHITESPACE@[38; 39) " " | ||
39 | IMPL_BLOCK@[39; 54) | ||
40 | IMPL_KW@[39; 43) "impl" | ||
41 | WHITESPACE@[43; 44) " " | ||
42 | PATH_TYPE@[44; 51) | ||
43 | PATH@[44; 51) | ||
44 | PATH_SEGMENT@[44; 51) | ||
45 | NAME_REF@[44; 51) | ||
46 | IDENT@[44; 51) "NotType" | ||
47 | WHITESPACE@[51; 52) " " | ||
48 | ITEM_LIST@[52; 54) | ||
49 | L_CURLY@[52; 53) "{" | ||
50 | R_CURLY@[53; 54) "}" | ||
51 | WHITESPACE@[54; 55) "\n" | ||
52 | IMPL_BLOCK@[55; 70) | ||
53 | IMPL_KW@[55; 59) "impl" | ||
54 | WHITESPACE@[59; 60) " " | ||
55 | PATH_TYPE@[60; 66) | ||
56 | PATH@[60; 66) | ||
57 | PATH_SEGMENT@[60; 66) | ||
58 | NAME_REF@[60; 66) | ||
59 | IDENT@[60; 66) "Trait2" | ||
60 | WHITESPACE@[66; 67) " " | ||
61 | FOR_KW@[67; 70) "for" | ||
62 | WHITESPACE@[70; 71) " " | ||
63 | IMPL_BLOCK@[71; 86) | ||
64 | IMPL_KW@[71; 75) "impl" | ||
65 | WHITESPACE@[75; 76) " " | ||
66 | PATH_TYPE@[76; 83) | ||
67 | PATH@[76; 83) | ||
68 | PATH_SEGMENT@[76; 83) | ||
69 | NAME_REF@[76; 83) | ||
70 | IDENT@[76; 83) "NotType" | ||
71 | WHITESPACE@[83; 84) " " | ||
72 | ITEM_LIST@[84; 86) | ||
73 | L_CURLY@[84; 85) "{" | ||
74 | R_CURLY@[85; 86) "}" | ||
75 | WHITESPACE@[86; 87) "\n" | ||
76 | error 38: expected trait or type | ||
77 | error 38: expected `{` | ||
78 | error 70: expected trait or type | ||
79 | error 70: expected `{` | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.rs b/crates/ra_syntax/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.rs new file mode 100644 index 000000000..f014914ff --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.rs | |||
@@ -0,0 +1 @@ | |||
type F = unsafe (); | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.txt b/crates/ra_syntax/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.txt new file mode 100644 index 000000000..451f29d39 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.txt | |||
@@ -0,0 +1,23 @@ | |||
1 | SOURCE_FILE@[0; 20) | ||
2 | TYPE_ALIAS_DEF@[0; 15) | ||
3 | TYPE_KW@[0; 4) "type" | ||
4 | WHITESPACE@[4; 5) " " | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "F" | ||
7 | WHITESPACE@[6; 7) " " | ||
8 | EQ@[7; 8) "=" | ||
9 | WHITESPACE@[8; 9) " " | ||
10 | UNSAFE_KW@[9; 15) "unsafe" | ||
11 | WHITESPACE@[15; 16) " " | ||
12 | ERROR@[16; 17) | ||
13 | L_PAREN@[16; 17) "(" | ||
14 | ERROR@[17; 18) | ||
15 | R_PAREN@[17; 18) ")" | ||
16 | ERROR@[18; 19) | ||
17 | SEMI@[18; 19) ";" | ||
18 | WHITESPACE@[19; 20) "\n" | ||
19 | error 15: expected `fn` | ||
20 | error 15: expected SEMI | ||
21 | error 16: expected an item | ||
22 | error 17: expected an item | ||
23 | error 18: expected an item | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0006_unsafe_block_in_mod.rs b/crates/ra_syntax/test_data/parser/inline/err/0006_unsafe_block_in_mod.rs new file mode 100644 index 000000000..26141e904 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/err/0006_unsafe_block_in_mod.rs | |||
@@ -0,0 +1 @@ | |||
fn foo(){} unsafe { } fn bar(){} | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0006_unsafe_block_in_mod.txt b/crates/ra_syntax/test_data/parser/inline/err/0006_unsafe_block_in_mod.txt new file mode 100644 index 000000000..a1871ec08 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/err/0006_unsafe_block_in_mod.txt | |||
@@ -0,0 +1,35 @@ | |||
1 | SOURCE_FILE@[0; 33) | ||
2 | FN_DEF@[0; 10) | ||
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 | BLOCK@[8; 10) | ||
11 | L_CURLY@[8; 9) "{" | ||
12 | R_CURLY@[9; 10) "}" | ||
13 | WHITESPACE@[10; 11) " " | ||
14 | ERROR@[11; 17) | ||
15 | UNSAFE_KW@[11; 17) "unsafe" | ||
16 | WHITESPACE@[17; 18) " " | ||
17 | ERROR@[18; 21) | ||
18 | L_CURLY@[18; 19) "{" | ||
19 | WHITESPACE@[19; 20) " " | ||
20 | R_CURLY@[20; 21) "}" | ||
21 | WHITESPACE@[21; 22) " " | ||
22 | FN_DEF@[22; 32) | ||
23 | FN_KW@[22; 24) "fn" | ||
24 | WHITESPACE@[24; 25) " " | ||
25 | NAME@[25; 28) | ||
26 | IDENT@[25; 28) "bar" | ||
27 | PARAM_LIST@[28; 30) | ||
28 | L_PAREN@[28; 29) "(" | ||
29 | R_PAREN@[29; 30) ")" | ||
30 | BLOCK@[30; 32) | ||
31 | L_CURLY@[30; 31) "{" | ||
32 | R_CURLY@[31; 32) "}" | ||
33 | WHITESPACE@[32; 33) "\n" | ||
34 | error 11: expected an item | ||
35 | error 18: expected an item | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0007_async_without_semicolon.rs b/crates/ra_syntax/test_data/parser/inline/err/0007_async_without_semicolon.rs new file mode 100644 index 000000000..9a423248c --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/err/0007_async_without_semicolon.rs | |||
@@ -0,0 +1 @@ | |||
fn foo() { let _ = async {} } | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0007_async_without_semicolon.txt b/crates/ra_syntax/test_data/parser/inline/err/0007_async_without_semicolon.txt new file mode 100644 index 000000000..f70adc25d --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/err/0007_async_without_semicolon.txt | |||
@@ -0,0 +1,31 @@ | |||
1 | SOURCE_FILE@[0; 30) | ||
2 | FN_DEF@[0; 29) | ||
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; 29) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 11) " " | ||
14 | LET_STMT@[11; 27) | ||
15 | LET_KW@[11; 14) "let" | ||
16 | WHITESPACE@[14; 15) " " | ||
17 | PLACEHOLDER_PAT@[15; 16) | ||
18 | UNDERSCORE@[15; 16) "_" | ||
19 | WHITESPACE@[16; 17) " " | ||
20 | EQ@[17; 18) "=" | ||
21 | WHITESPACE@[18; 19) " " | ||
22 | BLOCK_EXPR@[19; 27) | ||
23 | ASYNC_KW@[19; 24) "async" | ||
24 | WHITESPACE@[24; 25) " " | ||
25 | BLOCK@[25; 27) | ||
26 | L_CURLY@[25; 26) "{" | ||
27 | R_CURLY@[26; 27) "}" | ||
28 | WHITESPACE@[27; 28) " " | ||
29 | R_CURLY@[28; 29) "}" | ||
30 | WHITESPACE@[29; 30) "\n" | ||
31 | error 27: expected SEMI | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0008_pub_expr.rs b/crates/ra_syntax/test_data/parser/inline/err/0008_pub_expr.rs new file mode 100644 index 000000000..2976f6862 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/err/0008_pub_expr.rs | |||
@@ -0,0 +1 @@ | |||
fn foo() { pub 92; } | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0008_pub_expr.txt b/crates/ra_syntax/test_data/parser/inline/err/0008_pub_expr.txt new file mode 100644 index 000000000..1dbfca698 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/err/0008_pub_expr.txt | |||
@@ -0,0 +1,25 @@ | |||
1 | SOURCE_FILE@[0; 21) | ||
2 | FN_DEF@[0; 20) | ||
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; 20) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 11) " " | ||
14 | ERROR@[11; 14) | ||
15 | VISIBILITY@[11; 14) | ||
16 | PUB_KW@[11; 14) "pub" | ||
17 | WHITESPACE@[14; 15) " " | ||
18 | EXPR_STMT@[15; 18) | ||
19 | LITERAL@[15; 17) | ||
20 | INT_NUMBER@[15; 17) "92" | ||
21 | SEMI@[17; 18) ";" | ||
22 | WHITESPACE@[18; 19) " " | ||
23 | R_CURLY@[19; 20) "}" | ||
24 | WHITESPACE@[20; 21) "\n" | ||
25 | error 14: expected an item | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0009_attr_on_expr_not_allowed.rs b/crates/ra_syntax/test_data/parser/inline/err/0009_attr_on_expr_not_allowed.rs new file mode 100644 index 000000000..d725a07ce --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/err/0009_attr_on_expr_not_allowed.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn foo() { | ||
2 | #[A] 1 + 2; | ||
3 | #[B] if true {}; | ||
4 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0009_attr_on_expr_not_allowed.txt b/crates/ra_syntax/test_data/parser/inline/err/0009_attr_on_expr_not_allowed.txt new file mode 100644 index 000000000..338776a72 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/err/0009_attr_on_expr_not_allowed.txt | |||
@@ -0,0 +1,55 @@ | |||
1 | SOURCE_FILE@[0; 48) | ||
2 | FN_DEF@[0; 47) | ||
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; 47) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 14) "\n " | ||
14 | EXPR_STMT@[14; 25) | ||
15 | ATTR@[14; 18) | ||
16 | POUND@[14; 15) "#" | ||
17 | TOKEN_TREE@[15; 18) | ||
18 | L_BRACK@[15; 16) "[" | ||
19 | IDENT@[16; 17) "A" | ||
20 | R_BRACK@[17; 18) "]" | ||
21 | WHITESPACE@[18; 19) " " | ||
22 | BIN_EXPR@[19; 24) | ||
23 | LITERAL@[19; 20) | ||
24 | INT_NUMBER@[19; 20) "1" | ||
25 | WHITESPACE@[20; 21) " " | ||
26 | PLUS@[21; 22) "+" | ||
27 | WHITESPACE@[22; 23) " " | ||
28 | LITERAL@[23; 24) | ||
29 | INT_NUMBER@[23; 24) "2" | ||
30 | SEMI@[24; 25) ";" | ||
31 | WHITESPACE@[25; 29) "\n " | ||
32 | EXPR_STMT@[29; 45) | ||
33 | ATTR@[29; 33) | ||
34 | POUND@[29; 30) "#" | ||
35 | TOKEN_TREE@[30; 33) | ||
36 | L_BRACK@[30; 31) "[" | ||
37 | IDENT@[31; 32) "B" | ||
38 | R_BRACK@[32; 33) "]" | ||
39 | WHITESPACE@[33; 34) " " | ||
40 | IF_EXPR@[34; 44) | ||
41 | IF_KW@[34; 36) "if" | ||
42 | WHITESPACE@[36; 37) " " | ||
43 | CONDITION@[37; 41) | ||
44 | LITERAL@[37; 41) | ||
45 | TRUE_KW@[37; 41) "true" | ||
46 | WHITESPACE@[41; 42) " " | ||
47 | BLOCK@[42; 44) | ||
48 | L_CURLY@[42; 43) "{" | ||
49 | R_CURLY@[43; 44) "}" | ||
50 | SEMI@[44; 45) ";" | ||
51 | WHITESPACE@[45; 46) "\n" | ||
52 | R_CURLY@[46; 47) "}" | ||
53 | WHITESPACE@[47; 48) "\n" | ||
54 | error 24: attributes are not allowed on BIN_EXPR | ||
55 | error 44: attributes are not allowed on IF_EXPR | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0010_bad_tuple_index_expr.rs b/crates/ra_syntax/test_data/parser/inline/err/0010_bad_tuple_index_expr.rs new file mode 100644 index 000000000..30cc49138 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/err/0010_bad_tuple_index_expr.rs | |||
@@ -0,0 +1,5 @@ | |||
1 | fn foo() { | ||
2 | x.0.; | ||
3 | x.1i32; | ||
4 | x.0x01; | ||
5 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0010_bad_tuple_index_expr.txt b/crates/ra_syntax/test_data/parser/inline/err/0010_bad_tuple_index_expr.txt new file mode 100644 index 000000000..a21b29c80 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/err/0010_bad_tuple_index_expr.txt | |||
@@ -0,0 +1,51 @@ | |||
1 | SOURCE_FILE@[0; 47) | ||
2 | FN_DEF@[0; 46) | ||
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; 46) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 15) "\n " | ||
14 | EXPR_STMT@[15; 20) | ||
15 | FIELD_EXPR@[15; 19) | ||
16 | PATH_EXPR@[15; 16) | ||
17 | PATH@[15; 16) | ||
18 | PATH_SEGMENT@[15; 16) | ||
19 | NAME_REF@[15; 16) | ||
20 | IDENT@[15; 16) "x" | ||
21 | DOT@[16; 17) "." | ||
22 | FLOAT_NUMBER@[17; 19) "0." | ||
23 | SEMI@[19; 20) ";" | ||
24 | WHITESPACE@[20; 25) "\n " | ||
25 | EXPR_STMT@[25; 32) | ||
26 | FIELD_EXPR@[25; 31) | ||
27 | PATH_EXPR@[25; 26) | ||
28 | PATH@[25; 26) | ||
29 | PATH_SEGMENT@[25; 26) | ||
30 | NAME_REF@[25; 26) | ||
31 | IDENT@[25; 26) "x" | ||
32 | DOT@[26; 27) "." | ||
33 | INT_NUMBER@[27; 31) "1i32" | ||
34 | SEMI@[31; 32) ";" | ||
35 | WHITESPACE@[32; 37) "\n " | ||
36 | EXPR_STMT@[37; 44) | ||
37 | FIELD_EXPR@[37; 43) | ||
38 | PATH_EXPR@[37; 38) | ||
39 | PATH@[37; 38) | ||
40 | PATH_SEGMENT@[37; 38) | ||
41 | NAME_REF@[37; 38) | ||
42 | IDENT@[37; 38) "x" | ||
43 | DOT@[38; 39) "." | ||
44 | INT_NUMBER@[39; 43) "0x01" | ||
45 | SEMI@[43; 44) ";" | ||
46 | WHITESPACE@[44; 45) "\n" | ||
47 | R_CURLY@[45; 46) "}" | ||
48 | WHITESPACE@[46; 47) "\n" | ||
49 | error [17; 19): Tuple (struct) field access is only allowed through decimal integers with no underscores or suffix | ||
50 | error [27; 31): Tuple (struct) field access is only allowed through decimal integers with no underscores or suffix | ||
51 | error [39; 43): Tuple (struct) field access is only allowed through decimal integers with no underscores or suffix | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0010_wrong_order_fns.rs b/crates/ra_syntax/test_data/parser/inline/err/0010_wrong_order_fns.rs new file mode 100644 index 000000000..16edee95d --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/err/0010_wrong_order_fns.rs | |||
@@ -0,0 +1,2 @@ | |||
1 | async unsafe fn foo() {} | ||
2 | unsafe const fn bar() {} | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0010_wrong_order_fns.txt b/crates/ra_syntax/test_data/parser/inline/err/0010_wrong_order_fns.txt new file mode 100644 index 000000000..b1ef210d3 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/err/0010_wrong_order_fns.txt | |||
@@ -0,0 +1,39 @@ | |||
1 | SOURCE_FILE@[0; 50) | ||
2 | ERROR@[0; 5) | ||
3 | ASYNC_KW@[0; 5) "async" | ||
4 | WHITESPACE@[5; 6) " " | ||
5 | FN_DEF@[6; 24) | ||
6 | UNSAFE_KW@[6; 12) "unsafe" | ||
7 | WHITESPACE@[12; 13) " " | ||
8 | FN_KW@[13; 15) "fn" | ||
9 | WHITESPACE@[15; 16) " " | ||
10 | NAME@[16; 19) | ||
11 | IDENT@[16; 19) "foo" | ||
12 | PARAM_LIST@[19; 21) | ||
13 | L_PAREN@[19; 20) "(" | ||
14 | R_PAREN@[20; 21) ")" | ||
15 | WHITESPACE@[21; 22) " " | ||
16 | BLOCK@[22; 24) | ||
17 | L_CURLY@[22; 23) "{" | ||
18 | R_CURLY@[23; 24) "}" | ||
19 | WHITESPACE@[24; 25) "\n" | ||
20 | ERROR@[25; 31) | ||
21 | UNSAFE_KW@[25; 31) "unsafe" | ||
22 | WHITESPACE@[31; 32) " " | ||
23 | FN_DEF@[32; 49) | ||
24 | CONST_KW@[32; 37) "const" | ||
25 | WHITESPACE@[37; 38) " " | ||
26 | FN_KW@[38; 40) "fn" | ||
27 | WHITESPACE@[40; 41) " " | ||
28 | NAME@[41; 44) | ||
29 | IDENT@[41; 44) "bar" | ||
30 | PARAM_LIST@[44; 46) | ||
31 | L_PAREN@[44; 45) "(" | ||
32 | R_PAREN@[45; 46) ")" | ||
33 | WHITESPACE@[46; 47) " " | ||
34 | BLOCK@[47; 49) | ||
35 | L_CURLY@[47; 48) "{" | ||
36 | R_CURLY@[48; 49) "}" | ||
37 | WHITESPACE@[49; 50) "\n" | ||
38 | error 5: expected existential, fn, trait or impl | ||
39 | error 31: expected existential, fn, trait or impl | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.rs b/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.rs new file mode 100644 index 000000000..15ba8f4a8 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | trait T { | ||
2 | default type T = Bar; | ||
3 | default fn foo() {} | ||
4 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.txt b/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.txt new file mode 100644 index 000000000..7da4e243f --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.txt | |||
@@ -0,0 +1,58 @@ | |||
1 | SOURCE_FILE@[0; 62) | ||
2 | TRAIT_DEF@[0; 61) | ||
3 | TRAIT_KW@[0; 5) "trait" | ||
4 | WHITESPACE@[5; 6) " " | ||
5 | NAME@[6; 7) | ||
6 | IDENT@[6; 7) "T" | ||
7 | WHITESPACE@[7; 8) " " | ||
8 | ITEM_LIST@[8; 61) | ||
9 | L_CURLY@[8; 9) "{" | ||
10 | WHITESPACE@[9; 14) "\n " | ||
11 | MACRO_CALL@[14; 21) | ||
12 | PATH@[14; 21) | ||
13 | PATH_SEGMENT@[14; 21) | ||
14 | NAME_REF@[14; 21) | ||
15 | IDENT@[14; 21) "default" | ||
16 | WHITESPACE@[21; 22) " " | ||
17 | TYPE_ALIAS_DEF@[22; 35) | ||
18 | TYPE_KW@[22; 26) "type" | ||
19 | WHITESPACE@[26; 27) " " | ||
20 | NAME@[27; 28) | ||
21 | IDENT@[27; 28) "T" | ||
22 | WHITESPACE@[28; 29) " " | ||
23 | EQ@[29; 30) "=" | ||
24 | WHITESPACE@[30; 31) " " | ||
25 | PATH_TYPE@[31; 34) | ||
26 | PATH@[31; 34) | ||
27 | PATH_SEGMENT@[31; 34) | ||
28 | NAME_REF@[31; 34) | ||
29 | IDENT@[31; 34) "Bar" | ||
30 | SEMI@[34; 35) ";" | ||
31 | WHITESPACE@[35; 40) "\n " | ||
32 | MACRO_CALL@[40; 47) | ||
33 | PATH@[40; 47) | ||
34 | PATH_SEGMENT@[40; 47) | ||
35 | NAME_REF@[40; 47) | ||
36 | IDENT@[40; 47) "default" | ||
37 | WHITESPACE@[47; 48) " " | ||
38 | FN_DEF@[48; 59) | ||
39 | FN_KW@[48; 50) "fn" | ||
40 | WHITESPACE@[50; 51) " " | ||
41 | NAME@[51; 54) | ||
42 | IDENT@[51; 54) "foo" | ||
43 | PARAM_LIST@[54; 56) | ||
44 | L_PAREN@[54; 55) "(" | ||
45 | R_PAREN@[55; 56) ")" | ||
46 | WHITESPACE@[56; 57) " " | ||
47 | BLOCK@[57; 59) | ||
48 | L_CURLY@[57; 58) "{" | ||
49 | R_CURLY@[58; 59) "}" | ||
50 | WHITESPACE@[59; 60) "\n" | ||
51 | R_CURLY@[60; 61) "}" | ||
52 | WHITESPACE@[61; 62) "\n" | ||
53 | error 21: expected EXCL | ||
54 | error 21: expected `{`, `[`, `(` | ||
55 | error 21: expected SEMI | ||
56 | error 47: expected EXCL | ||
57 | error 47: expected `{`, `[`, `(` | ||
58 | error 47: expected SEMI | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0001_trait_item_list.rs b/crates/ra_syntax/test_data/parser/inline/ok/0001_trait_item_list.rs new file mode 100644 index 000000000..a5ec3239f --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0001_trait_item_list.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | impl F { | ||
2 | type A: Clone; | ||
3 | const B: i32; | ||
4 | fn foo() {} | ||
5 | fn bar(&self); | ||
6 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0001_trait_item_list.txt b/crates/ra_syntax/test_data/parser/inline/ok/0001_trait_item_list.txt new file mode 100644 index 000000000..18f02bb22 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0001_trait_item_list.txt | |||
@@ -0,0 +1,71 @@ | |||
1 | SOURCE_FILE@[0; 83) | ||
2 | IMPL_BLOCK@[0; 82) | ||
3 | IMPL_KW@[0; 4) "impl" | ||
4 | WHITESPACE@[4; 5) " " | ||
5 | PATH_TYPE@[5; 6) | ||
6 | PATH@[5; 6) | ||
7 | PATH_SEGMENT@[5; 6) | ||
8 | NAME_REF@[5; 6) | ||
9 | IDENT@[5; 6) "F" | ||
10 | WHITESPACE@[6; 7) " " | ||
11 | ITEM_LIST@[7; 82) | ||
12 | L_CURLY@[7; 8) "{" | ||
13 | WHITESPACE@[8; 13) "\n " | ||
14 | TYPE_ALIAS_DEF@[13; 27) | ||
15 | TYPE_KW@[13; 17) "type" | ||
16 | WHITESPACE@[17; 18) " " | ||
17 | NAME@[18; 19) | ||
18 | IDENT@[18; 19) "A" | ||
19 | COLON@[19; 20) ":" | ||
20 | WHITESPACE@[20; 21) " " | ||
21 | TYPE_BOUND_LIST@[21; 26) | ||
22 | TYPE_BOUND@[21; 26) | ||
23 | PATH_TYPE@[21; 26) | ||
24 | PATH@[21; 26) | ||
25 | PATH_SEGMENT@[21; 26) | ||
26 | NAME_REF@[21; 26) | ||
27 | IDENT@[21; 26) "Clone" | ||
28 | SEMI@[26; 27) ";" | ||
29 | WHITESPACE@[27; 32) "\n " | ||
30 | CONST_DEF@[32; 45) | ||
31 | CONST_KW@[32; 37) "const" | ||
32 | WHITESPACE@[37; 38) " " | ||
33 | NAME@[38; 39) | ||
34 | IDENT@[38; 39) "B" | ||
35 | COLON@[39; 40) ":" | ||
36 | WHITESPACE@[40; 41) " " | ||
37 | PATH_TYPE@[41; 44) | ||
38 | PATH@[41; 44) | ||
39 | PATH_SEGMENT@[41; 44) | ||
40 | NAME_REF@[41; 44) | ||
41 | IDENT@[41; 44) "i32" | ||
42 | SEMI@[44; 45) ";" | ||
43 | WHITESPACE@[45; 50) "\n " | ||
44 | FN_DEF@[50; 61) | ||
45 | FN_KW@[50; 52) "fn" | ||
46 | WHITESPACE@[52; 53) " " | ||
47 | NAME@[53; 56) | ||
48 | IDENT@[53; 56) "foo" | ||
49 | PARAM_LIST@[56; 58) | ||
50 | L_PAREN@[56; 57) "(" | ||
51 | R_PAREN@[57; 58) ")" | ||
52 | WHITESPACE@[58; 59) " " | ||
53 | BLOCK@[59; 61) | ||
54 | L_CURLY@[59; 60) "{" | ||
55 | R_CURLY@[60; 61) "}" | ||
56 | WHITESPACE@[61; 66) "\n " | ||
57 | FN_DEF@[66; 80) | ||
58 | FN_KW@[66; 68) "fn" | ||
59 | WHITESPACE@[68; 69) " " | ||
60 | NAME@[69; 72) | ||
61 | IDENT@[69; 72) "bar" | ||
62 | PARAM_LIST@[72; 79) | ||
63 | L_PAREN@[72; 73) "(" | ||
64 | SELF_PARAM@[73; 78) | ||
65 | AMP@[73; 74) "&" | ||
66 | SELF_KW@[74; 78) "self" | ||
67 | R_PAREN@[78; 79) ")" | ||
68 | SEMI@[79; 80) ";" | ||
69 | WHITESPACE@[80; 81) "\n" | ||
70 | R_CURLY@[81; 82) "}" | ||
71 | WHITESPACE@[82; 83) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0002_use_tree_list.rs b/crates/ra_syntax/test_data/parser/inline/ok/0002_use_tree_list.rs new file mode 100644 index 000000000..06c387cee --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0002_use_tree_list.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | use {crate::path::from::root, or::path::from::crate_name}; // Rust 2018 (with a crate named `or`) | ||
2 | use {path::from::root}; // Rust 2015 | ||
3 | use ::{some::arbritrary::path}; // Rust 2015 | ||
4 | use ::{{{crate::export}}}; // Nonsensical but perfectly legal nestnig | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0002_use_tree_list.txt b/crates/ra_syntax/test_data/parser/inline/ok/0002_use_tree_list.txt new file mode 100644 index 000000000..1b318dfb9 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0002_use_tree_list.txt | |||
@@ -0,0 +1,135 @@ | |||
1 | SOURCE_FILE@[0; 250) | ||
2 | USE_ITEM@[0; 58) | ||
3 | USE_KW@[0; 3) "use" | ||
4 | WHITESPACE@[3; 4) " " | ||
5 | USE_TREE@[4; 57) | ||
6 | USE_TREE_LIST@[4; 57) | ||
7 | L_CURLY@[4; 5) "{" | ||
8 | USE_TREE@[5; 28) | ||
9 | PATH@[5; 28) | ||
10 | PATH@[5; 22) | ||
11 | PATH@[5; 16) | ||
12 | PATH@[5; 10) | ||
13 | PATH_SEGMENT@[5; 10) | ||
14 | CRATE_KW@[5; 10) "crate" | ||
15 | COLONCOLON@[10; 12) "::" | ||
16 | PATH_SEGMENT@[12; 16) | ||
17 | NAME_REF@[12; 16) | ||
18 | IDENT@[12; 16) "path" | ||
19 | COLONCOLON@[16; 18) "::" | ||
20 | PATH_SEGMENT@[18; 22) | ||
21 | NAME_REF@[18; 22) | ||
22 | IDENT@[18; 22) "from" | ||
23 | COLONCOLON@[22; 24) "::" | ||
24 | PATH_SEGMENT@[24; 28) | ||
25 | NAME_REF@[24; 28) | ||
26 | IDENT@[24; 28) "root" | ||
27 | COMMA@[28; 29) "," | ||
28 | WHITESPACE@[29; 30) " " | ||
29 | USE_TREE@[30; 56) | ||
30 | PATH@[30; 56) | ||
31 | PATH@[30; 44) | ||
32 | PATH@[30; 38) | ||
33 | PATH@[30; 32) | ||
34 | PATH_SEGMENT@[30; 32) | ||
35 | NAME_REF@[30; 32) | ||
36 | IDENT@[30; 32) "or" | ||
37 | COLONCOLON@[32; 34) "::" | ||
38 | PATH_SEGMENT@[34; 38) | ||
39 | NAME_REF@[34; 38) | ||
40 | IDENT@[34; 38) "path" | ||
41 | COLONCOLON@[38; 40) "::" | ||
42 | PATH_SEGMENT@[40; 44) | ||
43 | NAME_REF@[40; 44) | ||
44 | IDENT@[40; 44) "from" | ||
45 | COLONCOLON@[44; 46) "::" | ||
46 | PATH_SEGMENT@[46; 56) | ||
47 | NAME_REF@[46; 56) | ||
48 | IDENT@[46; 56) "crate_name" | ||
49 | R_CURLY@[56; 57) "}" | ||
50 | SEMI@[57; 58) ";" | ||
51 | WHITESPACE@[58; 59) " " | ||
52 | COMMENT@[59; 97) "// Rust 2018 (with a ..." | ||
53 | WHITESPACE@[97; 98) "\n" | ||
54 | USE_ITEM@[98; 121) | ||
55 | USE_KW@[98; 101) "use" | ||
56 | WHITESPACE@[101; 102) " " | ||
57 | USE_TREE@[102; 120) | ||
58 | USE_TREE_LIST@[102; 120) | ||
59 | L_CURLY@[102; 103) "{" | ||
60 | USE_TREE@[103; 119) | ||
61 | PATH@[103; 119) | ||
62 | PATH@[103; 113) | ||
63 | PATH@[103; 107) | ||
64 | PATH_SEGMENT@[103; 107) | ||
65 | NAME_REF@[103; 107) | ||
66 | IDENT@[103; 107) "path" | ||
67 | COLONCOLON@[107; 109) "::" | ||
68 | PATH_SEGMENT@[109; 113) | ||
69 | NAME_REF@[109; 113) | ||
70 | IDENT@[109; 113) "from" | ||
71 | COLONCOLON@[113; 115) "::" | ||
72 | PATH_SEGMENT@[115; 119) | ||
73 | NAME_REF@[115; 119) | ||
74 | IDENT@[115; 119) "root" | ||
75 | R_CURLY@[119; 120) "}" | ||
76 | SEMI@[120; 121) ";" | ||
77 | WHITESPACE@[121; 122) " " | ||
78 | COMMENT@[122; 134) "// Rust 2015" | ||
79 | WHITESPACE@[134; 135) "\n" | ||
80 | USE_ITEM@[135; 166) | ||
81 | USE_KW@[135; 138) "use" | ||
82 | WHITESPACE@[138; 139) " " | ||
83 | USE_TREE@[139; 165) | ||
84 | COLONCOLON@[139; 141) "::" | ||
85 | USE_TREE_LIST@[141; 165) | ||
86 | L_CURLY@[141; 142) "{" | ||
87 | USE_TREE@[142; 164) | ||
88 | PATH@[142; 164) | ||
89 | PATH@[142; 158) | ||
90 | PATH@[142; 146) | ||
91 | PATH_SEGMENT@[142; 146) | ||
92 | NAME_REF@[142; 146) | ||
93 | IDENT@[142; 146) "some" | ||
94 | COLONCOLON@[146; 148) "::" | ||
95 | PATH_SEGMENT@[148; 158) | ||
96 | NAME_REF@[148; 158) | ||
97 | IDENT@[148; 158) "arbritrary" | ||
98 | COLONCOLON@[158; 160) "::" | ||
99 | PATH_SEGMENT@[160; 164) | ||
100 | NAME_REF@[160; 164) | ||
101 | IDENT@[160; 164) "path" | ||
102 | R_CURLY@[164; 165) "}" | ||
103 | SEMI@[165; 166) ";" | ||
104 | WHITESPACE@[166; 167) " " | ||
105 | COMMENT@[167; 179) "// Rust 2015" | ||
106 | WHITESPACE@[179; 180) "\n" | ||
107 | USE_ITEM@[180; 206) | ||
108 | USE_KW@[180; 183) "use" | ||
109 | WHITESPACE@[183; 184) " " | ||
110 | USE_TREE@[184; 205) | ||
111 | COLONCOLON@[184; 186) "::" | ||
112 | USE_TREE_LIST@[186; 205) | ||
113 | L_CURLY@[186; 187) "{" | ||
114 | USE_TREE@[187; 204) | ||
115 | USE_TREE_LIST@[187; 204) | ||
116 | L_CURLY@[187; 188) "{" | ||
117 | USE_TREE@[188; 203) | ||
118 | USE_TREE_LIST@[188; 203) | ||
119 | L_CURLY@[188; 189) "{" | ||
120 | USE_TREE@[189; 202) | ||
121 | PATH@[189; 202) | ||
122 | PATH@[189; 194) | ||
123 | PATH_SEGMENT@[189; 194) | ||
124 | CRATE_KW@[189; 194) "crate" | ||
125 | COLONCOLON@[194; 196) "::" | ||
126 | PATH_SEGMENT@[196; 202) | ||
127 | NAME_REF@[196; 202) | ||
128 | IDENT@[196; 202) "export" | ||
129 | R_CURLY@[202; 203) "}" | ||
130 | R_CURLY@[203; 204) "}" | ||
131 | R_CURLY@[204; 205) "}" | ||
132 | SEMI@[205; 206) ";" | ||
133 | WHITESPACE@[206; 207) " " | ||
134 | COMMENT@[207; 249) "// Nonsensical but pe ..." | ||
135 | WHITESPACE@[249; 250) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0003_where_pred_for.rs b/crates/ra_syntax/test_data/parser/inline/ok/0003_where_pred_for.rs new file mode 100644 index 000000000..b448c6178 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0003_where_pred_for.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn test<F>() | ||
2 | where | ||
3 | for<'a> F: Fn(&'a str) | ||
4 | { } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0003_where_pred_for.txt b/crates/ra_syntax/test_data/parser/inline/ok/0003_where_pred_for.txt new file mode 100644 index 000000000..8a21ee968 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0003_where_pred_for.txt | |||
@@ -0,0 +1,61 @@ | |||
1 | SOURCE_FILE@[0; 49) | ||
2 | FN_DEF@[0; 48) | ||
3 | FN_KW@[0; 2) "fn" | ||
4 | WHITESPACE@[2; 3) " " | ||
5 | NAME@[3; 7) | ||
6 | IDENT@[3; 7) "test" | ||
7 | TYPE_PARAM_LIST@[7; 10) | ||
8 | L_ANGLE@[7; 8) "<" | ||
9 | TYPE_PARAM@[8; 9) | ||
10 | NAME@[8; 9) | ||
11 | IDENT@[8; 9) "F" | ||
12 | R_ANGLE@[9; 10) ">" | ||
13 | PARAM_LIST@[10; 12) | ||
14 | L_PAREN@[10; 11) "(" | ||
15 | R_PAREN@[11; 12) ")" | ||
16 | WHITESPACE@[12; 13) "\n" | ||
17 | WHERE_CLAUSE@[13; 44) | ||
18 | WHERE_KW@[13; 18) "where" | ||
19 | WHITESPACE@[18; 22) "\n " | ||
20 | WHERE_PRED@[22; 44) | ||
21 | FOR_TYPE@[22; 31) | ||
22 | FOR_KW@[22; 25) "for" | ||
23 | TYPE_PARAM_LIST@[25; 29) | ||
24 | L_ANGLE@[25; 26) "<" | ||
25 | LIFETIME_PARAM@[26; 28) | ||
26 | LIFETIME@[26; 28) "\'a" | ||
27 | R_ANGLE@[28; 29) ">" | ||
28 | WHITESPACE@[29; 30) " " | ||
29 | PATH_TYPE@[30; 31) | ||
30 | PATH@[30; 31) | ||
31 | PATH_SEGMENT@[30; 31) | ||
32 | NAME_REF@[30; 31) | ||
33 | IDENT@[30; 31) "F" | ||
34 | COLON@[31; 32) ":" | ||
35 | WHITESPACE@[32; 33) " " | ||
36 | TYPE_BOUND_LIST@[33; 44) | ||
37 | TYPE_BOUND@[33; 44) | ||
38 | PATH_TYPE@[33; 44) | ||
39 | PATH@[33; 44) | ||
40 | PATH_SEGMENT@[33; 44) | ||
41 | NAME_REF@[33; 35) | ||
42 | IDENT@[33; 35) "Fn" | ||
43 | PARAM_LIST@[35; 44) | ||
44 | L_PAREN@[35; 36) "(" | ||
45 | PARAM@[36; 43) | ||
46 | REFERENCE_TYPE@[36; 43) | ||
47 | AMP@[36; 37) "&" | ||
48 | LIFETIME@[37; 39) "\'a" | ||
49 | WHITESPACE@[39; 40) " " | ||
50 | PATH_TYPE@[40; 43) | ||
51 | PATH@[40; 43) | ||
52 | PATH_SEGMENT@[40; 43) | ||
53 | NAME_REF@[40; 43) | ||
54 | IDENT@[40; 43) "str" | ||
55 | R_PAREN@[43; 44) ")" | ||
56 | WHITESPACE@[44; 45) "\n" | ||
57 | BLOCK@[45; 48) | ||
58 | L_CURLY@[45; 46) "{" | ||
59 | WHITESPACE@[46; 47) " " | ||
60 | R_CURLY@[47; 48) "}" | ||
61 | WHITESPACE@[48; 49) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0004_value_parameters_no_patterns.rs b/crates/ra_syntax/test_data/parser/inline/ok/0004_value_parameters_no_patterns.rs new file mode 100644 index 000000000..d8c23c76a --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0004_value_parameters_no_patterns.rs | |||
@@ -0,0 +1 @@ | |||
type F = Box<Fn(a: i32, &b: &i32, &mut c: &i32, ())>; | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0004_value_parameters_no_patterns.txt b/crates/ra_syntax/test_data/parser/inline/ok/0004_value_parameters_no_patterns.txt new file mode 100644 index 000000000..8cfba8420 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0004_value_parameters_no_patterns.txt | |||
@@ -0,0 +1,81 @@ | |||
1 | SOURCE_FILE@[0; 54) | ||
2 | TYPE_ALIAS_DEF@[0; 53) | ||
3 | TYPE_KW@[0; 4) "type" | ||
4 | WHITESPACE@[4; 5) " " | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "F" | ||
7 | WHITESPACE@[6; 7) " " | ||
8 | EQ@[7; 8) "=" | ||
9 | WHITESPACE@[8; 9) " " | ||
10 | PATH_TYPE@[9; 52) | ||
11 | PATH@[9; 52) | ||
12 | PATH_SEGMENT@[9; 52) | ||
13 | NAME_REF@[9; 12) | ||
14 | IDENT@[9; 12) "Box" | ||
15 | TYPE_ARG_LIST@[12; 52) | ||
16 | L_ANGLE@[12; 13) "<" | ||
17 | TYPE_ARG@[13; 51) | ||
18 | PATH_TYPE@[13; 51) | ||
19 | PATH@[13; 51) | ||
20 | PATH_SEGMENT@[13; 51) | ||
21 | NAME_REF@[13; 15) | ||
22 | IDENT@[13; 15) "Fn" | ||
23 | PARAM_LIST@[15; 51) | ||
24 | L_PAREN@[15; 16) "(" | ||
25 | PARAM@[16; 22) | ||
26 | BIND_PAT@[16; 17) | ||
27 | NAME@[16; 17) | ||
28 | IDENT@[16; 17) "a" | ||
29 | COLON@[17; 18) ":" | ||
30 | WHITESPACE@[18; 19) " " | ||
31 | PATH_TYPE@[19; 22) | ||
32 | PATH@[19; 22) | ||
33 | PATH_SEGMENT@[19; 22) | ||
34 | NAME_REF@[19; 22) | ||
35 | IDENT@[19; 22) "i32" | ||
36 | COMMA@[22; 23) "," | ||
37 | WHITESPACE@[23; 24) " " | ||
38 | PARAM@[24; 32) | ||
39 | REF_PAT@[24; 26) | ||
40 | AMP@[24; 25) "&" | ||
41 | BIND_PAT@[25; 26) | ||
42 | NAME@[25; 26) | ||
43 | IDENT@[25; 26) "b" | ||
44 | COLON@[26; 27) ":" | ||
45 | WHITESPACE@[27; 28) " " | ||
46 | REFERENCE_TYPE@[28; 32) | ||
47 | AMP@[28; 29) "&" | ||
48 | PATH_TYPE@[29; 32) | ||
49 | PATH@[29; 32) | ||
50 | PATH_SEGMENT@[29; 32) | ||
51 | NAME_REF@[29; 32) | ||
52 | IDENT@[29; 32) "i32" | ||
53 | COMMA@[32; 33) "," | ||
54 | WHITESPACE@[33; 34) " " | ||
55 | PARAM@[34; 46) | ||
56 | REF_PAT@[34; 40) | ||
57 | AMP@[34; 35) "&" | ||
58 | MUT_KW@[35; 38) "mut" | ||
59 | WHITESPACE@[38; 39) " " | ||
60 | BIND_PAT@[39; 40) | ||
61 | NAME@[39; 40) | ||
62 | IDENT@[39; 40) "c" | ||
63 | COLON@[40; 41) ":" | ||
64 | WHITESPACE@[41; 42) " " | ||
65 | REFERENCE_TYPE@[42; 46) | ||
66 | AMP@[42; 43) "&" | ||
67 | PATH_TYPE@[43; 46) | ||
68 | PATH@[43; 46) | ||
69 | PATH_SEGMENT@[43; 46) | ||
70 | NAME_REF@[43; 46) | ||
71 | IDENT@[43; 46) "i32" | ||
72 | COMMA@[46; 47) "," | ||
73 | WHITESPACE@[47; 48) " " | ||
74 | PARAM@[48; 50) | ||
75 | TUPLE_TYPE@[48; 50) | ||
76 | L_PAREN@[48; 49) "(" | ||
77 | R_PAREN@[49; 50) ")" | ||
78 | R_PAREN@[50; 51) ")" | ||
79 | R_ANGLE@[51; 52) ">" | ||
80 | SEMI@[52; 53) ";" | ||
81 | WHITESPACE@[53; 54) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0005_function_type_params.rs b/crates/ra_syntax/test_data/parser/inline/ok/0005_function_type_params.rs new file mode 100644 index 000000000..9df40ed39 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0005_function_type_params.rs | |||
@@ -0,0 +1 @@ | |||
fn foo<T: Clone + Copy>(){} | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0005_function_type_params.txt b/crates/ra_syntax/test_data/parser/inline/ok/0005_function_type_params.txt new file mode 100644 index 000000000..c1a70d566 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0005_function_type_params.txt | |||
@@ -0,0 +1,37 @@ | |||
1 | SOURCE_FILE@[0; 28) | ||
2 | FN_DEF@[0; 27) | ||
3 | FN_KW@[0; 2) "fn" | ||
4 | WHITESPACE@[2; 3) " " | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | TYPE_PARAM_LIST@[6; 23) | ||
8 | L_ANGLE@[6; 7) "<" | ||
9 | TYPE_PARAM@[7; 22) | ||
10 | NAME@[7; 8) | ||
11 | IDENT@[7; 8) "T" | ||
12 | COLON@[8; 9) ":" | ||
13 | WHITESPACE@[9; 10) " " | ||
14 | TYPE_BOUND_LIST@[10; 22) | ||
15 | TYPE_BOUND@[10; 15) | ||
16 | PATH_TYPE@[10; 15) | ||
17 | PATH@[10; 15) | ||
18 | PATH_SEGMENT@[10; 15) | ||
19 | NAME_REF@[10; 15) | ||
20 | IDENT@[10; 15) "Clone" | ||
21 | WHITESPACE@[15; 16) " " | ||
22 | PLUS@[16; 17) "+" | ||
23 | WHITESPACE@[17; 18) " " | ||
24 | TYPE_BOUND@[18; 22) | ||
25 | PATH_TYPE@[18; 22) | ||
26 | PATH@[18; 22) | ||
27 | PATH_SEGMENT@[18; 22) | ||
28 | NAME_REF@[18; 22) | ||
29 | IDENT@[18; 22) "Copy" | ||
30 | R_ANGLE@[22; 23) ">" | ||
31 | PARAM_LIST@[23; 25) | ||
32 | L_PAREN@[23; 24) "(" | ||
33 | R_PAREN@[24; 25) ")" | ||
34 | BLOCK@[25; 27) | ||
35 | L_CURLY@[25; 26) "{" | ||
36 | R_CURLY@[26; 27) "}" | ||
37 | WHITESPACE@[27; 28) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0006_self_param.rs b/crates/ra_syntax/test_data/parser/inline/ok/0006_self_param.rs new file mode 100644 index 000000000..80c0a43f5 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0006_self_param.rs | |||
@@ -0,0 +1,7 @@ | |||
1 | impl S { | ||
2 | fn a(self) {} | ||
3 | fn b(&self,) {} | ||
4 | fn c(&'a self,) {} | ||
5 | fn d(&'a mut self, x: i32) {} | ||
6 | fn e(mut self) {} | ||
7 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0006_self_param.txt b/crates/ra_syntax/test_data/parser/inline/ok/0006_self_param.txt new file mode 100644 index 000000000..8e210a6ca --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0006_self_param.txt | |||
@@ -0,0 +1,116 @@ | |||
1 | SOURCE_FILE@[0; 128) | ||
2 | IMPL_BLOCK@[0; 127) | ||
3 | IMPL_KW@[0; 4) "impl" | ||
4 | WHITESPACE@[4; 5) " " | ||
5 | PATH_TYPE@[5; 6) | ||
6 | PATH@[5; 6) | ||
7 | PATH_SEGMENT@[5; 6) | ||
8 | NAME_REF@[5; 6) | ||
9 | IDENT@[5; 6) "S" | ||
10 | WHITESPACE@[6; 7) " " | ||
11 | ITEM_LIST@[7; 127) | ||
12 | L_CURLY@[7; 8) "{" | ||
13 | WHITESPACE@[8; 13) "\n " | ||
14 | FN_DEF@[13; 26) | ||
15 | FN_KW@[13; 15) "fn" | ||
16 | WHITESPACE@[15; 16) " " | ||
17 | NAME@[16; 17) | ||
18 | IDENT@[16; 17) "a" | ||
19 | PARAM_LIST@[17; 23) | ||
20 | L_PAREN@[17; 18) "(" | ||
21 | SELF_PARAM@[18; 22) | ||
22 | SELF_KW@[18; 22) "self" | ||
23 | R_PAREN@[22; 23) ")" | ||
24 | WHITESPACE@[23; 24) " " | ||
25 | BLOCK@[24; 26) | ||
26 | L_CURLY@[24; 25) "{" | ||
27 | R_CURLY@[25; 26) "}" | ||
28 | WHITESPACE@[26; 31) "\n " | ||
29 | FN_DEF@[31; 46) | ||
30 | FN_KW@[31; 33) "fn" | ||
31 | WHITESPACE@[33; 34) " " | ||
32 | NAME@[34; 35) | ||
33 | IDENT@[34; 35) "b" | ||
34 | PARAM_LIST@[35; 43) | ||
35 | L_PAREN@[35; 36) "(" | ||
36 | SELF_PARAM@[36; 41) | ||
37 | AMP@[36; 37) "&" | ||
38 | SELF_KW@[37; 41) "self" | ||
39 | COMMA@[41; 42) "," | ||
40 | R_PAREN@[42; 43) ")" | ||
41 | WHITESPACE@[43; 44) " " | ||
42 | BLOCK@[44; 46) | ||
43 | L_CURLY@[44; 45) "{" | ||
44 | R_CURLY@[45; 46) "}" | ||
45 | WHITESPACE@[46; 51) "\n " | ||
46 | FN_DEF@[51; 69) | ||
47 | FN_KW@[51; 53) "fn" | ||
48 | WHITESPACE@[53; 54) " " | ||
49 | NAME@[54; 55) | ||
50 | IDENT@[54; 55) "c" | ||
51 | PARAM_LIST@[55; 66) | ||
52 | L_PAREN@[55; 56) "(" | ||
53 | SELF_PARAM@[56; 64) | ||
54 | AMP@[56; 57) "&" | ||
55 | LIFETIME@[57; 59) "\'a" | ||
56 | WHITESPACE@[59; 60) " " | ||
57 | SELF_KW@[60; 64) "self" | ||
58 | COMMA@[64; 65) "," | ||
59 | R_PAREN@[65; 66) ")" | ||
60 | WHITESPACE@[66; 67) " " | ||
61 | BLOCK@[67; 69) | ||
62 | L_CURLY@[67; 68) "{" | ||
63 | R_CURLY@[68; 69) "}" | ||
64 | WHITESPACE@[69; 74) "\n " | ||
65 | FN_DEF@[74; 103) | ||
66 | FN_KW@[74; 76) "fn" | ||
67 | WHITESPACE@[76; 77) " " | ||
68 | NAME@[77; 78) | ||
69 | IDENT@[77; 78) "d" | ||
70 | PARAM_LIST@[78; 100) | ||
71 | L_PAREN@[78; 79) "(" | ||
72 | SELF_PARAM@[79; 91) | ||
73 | AMP@[79; 80) "&" | ||
74 | LIFETIME@[80; 82) "\'a" | ||
75 | WHITESPACE@[82; 83) " " | ||
76 | MUT_KW@[83; 86) "mut" | ||
77 | WHITESPACE@[86; 87) " " | ||
78 | SELF_KW@[87; 91) "self" | ||
79 | COMMA@[91; 92) "," | ||
80 | WHITESPACE@[92; 93) " " | ||
81 | PARAM@[93; 99) | ||
82 | BIND_PAT@[93; 94) | ||
83 | NAME@[93; 94) | ||
84 | IDENT@[93; 94) "x" | ||
85 | COLON@[94; 95) ":" | ||
86 | WHITESPACE@[95; 96) " " | ||
87 | PATH_TYPE@[96; 99) | ||
88 | PATH@[96; 99) | ||
89 | PATH_SEGMENT@[96; 99) | ||
90 | NAME_REF@[96; 99) | ||
91 | IDENT@[96; 99) "i32" | ||
92 | R_PAREN@[99; 100) ")" | ||
93 | WHITESPACE@[100; 101) " " | ||
94 | BLOCK@[101; 103) | ||
95 | L_CURLY@[101; 102) "{" | ||
96 | R_CURLY@[102; 103) "}" | ||
97 | WHITESPACE@[103; 108) "\n " | ||
98 | FN_DEF@[108; 125) | ||
99 | FN_KW@[108; 110) "fn" | ||
100 | WHITESPACE@[110; 111) " " | ||
101 | NAME@[111; 112) | ||
102 | IDENT@[111; 112) "e" | ||
103 | PARAM_LIST@[112; 122) | ||
104 | L_PAREN@[112; 113) "(" | ||
105 | SELF_PARAM@[113; 121) | ||
106 | MUT_KW@[113; 116) "mut" | ||
107 | WHITESPACE@[116; 117) " " | ||
108 | SELF_KW@[117; 121) "self" | ||
109 | R_PAREN@[121; 122) ")" | ||
110 | WHITESPACE@[122; 123) " " | ||
111 | BLOCK@[123; 125) | ||
112 | L_CURLY@[123; 124) "{" | ||
113 | R_CURLY@[124; 125) "}" | ||
114 | WHITESPACE@[125; 126) "\n" | ||
115 | R_CURLY@[126; 127) "}" | ||
116 | WHITESPACE@[127; 128) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0007_type_param_bounds.rs b/crates/ra_syntax/test_data/parser/inline/ok/0007_type_param_bounds.rs new file mode 100644 index 000000000..919bde0ee --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0007_type_param_bounds.rs | |||
@@ -0,0 +1 @@ | |||
struct S<T: 'a + ?Sized + (Copy)>; | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0007_type_param_bounds.txt b/crates/ra_syntax/test_data/parser/inline/ok/0007_type_param_bounds.txt new file mode 100644 index 000000000..a7186c7a8 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0007_type_param_bounds.txt | |||
@@ -0,0 +1,40 @@ | |||
1 | SOURCE_FILE@[0; 35) | ||
2 | STRUCT_DEF@[0; 34) | ||
3 | STRUCT_KW@[0; 6) "struct" | ||
4 | WHITESPACE@[6; 7) " " | ||
5 | NAME@[7; 8) | ||
6 | IDENT@[7; 8) "S" | ||
7 | TYPE_PARAM_LIST@[8; 33) | ||
8 | L_ANGLE@[8; 9) "<" | ||
9 | TYPE_PARAM@[9; 32) | ||
10 | NAME@[9; 10) | ||
11 | IDENT@[9; 10) "T" | ||
12 | COLON@[10; 11) ":" | ||
13 | WHITESPACE@[11; 12) " " | ||
14 | TYPE_BOUND_LIST@[12; 32) | ||
15 | TYPE_BOUND@[12; 14) | ||
16 | LIFETIME@[12; 14) "\'a" | ||
17 | WHITESPACE@[14; 15) " " | ||
18 | PLUS@[15; 16) "+" | ||
19 | WHITESPACE@[16; 17) " " | ||
20 | TYPE_BOUND@[17; 23) | ||
21 | QUESTION@[17; 18) "?" | ||
22 | PATH_TYPE@[18; 23) | ||
23 | PATH@[18; 23) | ||
24 | PATH_SEGMENT@[18; 23) | ||
25 | NAME_REF@[18; 23) | ||
26 | IDENT@[18; 23) "Sized" | ||
27 | WHITESPACE@[23; 24) " " | ||
28 | PLUS@[24; 25) "+" | ||
29 | WHITESPACE@[25; 26) " " | ||
30 | TYPE_BOUND@[26; 32) | ||
31 | L_PAREN@[26; 27) "(" | ||
32 | PATH_TYPE@[27; 31) | ||
33 | PATH@[27; 31) | ||
34 | PATH_SEGMENT@[27; 31) | ||
35 | NAME_REF@[27; 31) | ||
36 | IDENT@[27; 31) "Copy" | ||
37 | R_PAREN@[31; 32) ")" | ||
38 | R_ANGLE@[32; 33) ">" | ||
39 | SEMI@[33; 34) ";" | ||
40 | WHITESPACE@[34; 35) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0008_path_part.rs b/crates/ra_syntax/test_data/parser/inline/ok/0008_path_part.rs new file mode 100644 index 000000000..f6e32c7c1 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0008_path_part.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | fn foo() { | ||
2 | let foo::Bar = (); | ||
3 | let ::Bar = (); | ||
4 | let Bar { .. } = (); | ||
5 | let Bar(..) = (); | ||
6 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0008_path_part.txt b/crates/ra_syntax/test_data/parser/inline/ok/0008_path_part.txt new file mode 100644 index 000000000..0c6be485e --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0008_path_part.txt | |||
@@ -0,0 +1,95 @@ | |||
1 | SOURCE_FILE@[0; 103) | ||
2 | FN_DEF@[0; 102) | ||
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; 102) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 15) "\n " | ||
14 | LET_STMT@[15; 33) | ||
15 | LET_KW@[15; 18) "let" | ||
16 | WHITESPACE@[18; 19) " " | ||
17 | PATH_PAT@[19; 27) | ||
18 | PATH@[19; 27) | ||
19 | PATH@[19; 22) | ||
20 | PATH_SEGMENT@[19; 22) | ||
21 | NAME_REF@[19; 22) | ||
22 | IDENT@[19; 22) "foo" | ||
23 | COLONCOLON@[22; 24) "::" | ||
24 | PATH_SEGMENT@[24; 27) | ||
25 | NAME_REF@[24; 27) | ||
26 | IDENT@[24; 27) "Bar" | ||
27 | WHITESPACE@[27; 28) " " | ||
28 | EQ@[28; 29) "=" | ||
29 | WHITESPACE@[29; 30) " " | ||
30 | TUPLE_EXPR@[30; 32) | ||
31 | L_PAREN@[30; 31) "(" | ||
32 | R_PAREN@[31; 32) ")" | ||
33 | SEMI@[32; 33) ";" | ||
34 | WHITESPACE@[33; 38) "\n " | ||
35 | LET_STMT@[38; 53) | ||
36 | LET_KW@[38; 41) "let" | ||
37 | WHITESPACE@[41; 42) " " | ||
38 | PATH_PAT@[42; 47) | ||
39 | PATH@[42; 47) | ||
40 | PATH_SEGMENT@[42; 47) | ||
41 | COLONCOLON@[42; 44) "::" | ||
42 | NAME_REF@[44; 47) | ||
43 | IDENT@[44; 47) "Bar" | ||
44 | WHITESPACE@[47; 48) " " | ||
45 | EQ@[48; 49) "=" | ||
46 | WHITESPACE@[49; 50) " " | ||
47 | TUPLE_EXPR@[50; 52) | ||
48 | L_PAREN@[50; 51) "(" | ||
49 | R_PAREN@[51; 52) ")" | ||
50 | SEMI@[52; 53) ";" | ||
51 | WHITESPACE@[53; 58) "\n " | ||
52 | LET_STMT@[58; 78) | ||
53 | LET_KW@[58; 61) "let" | ||
54 | WHITESPACE@[61; 62) " " | ||
55 | STRUCT_PAT@[62; 72) | ||
56 | PATH@[62; 65) | ||
57 | PATH_SEGMENT@[62; 65) | ||
58 | NAME_REF@[62; 65) | ||
59 | IDENT@[62; 65) "Bar" | ||
60 | WHITESPACE@[65; 66) " " | ||
61 | FIELD_PAT_LIST@[66; 72) | ||
62 | L_CURLY@[66; 67) "{" | ||
63 | WHITESPACE@[67; 68) " " | ||
64 | DOTDOT@[68; 70) ".." | ||
65 | WHITESPACE@[70; 71) " " | ||
66 | R_CURLY@[71; 72) "}" | ||
67 | WHITESPACE@[72; 73) " " | ||
68 | EQ@[73; 74) "=" | ||
69 | WHITESPACE@[74; 75) " " | ||
70 | TUPLE_EXPR@[75; 77) | ||
71 | L_PAREN@[75; 76) "(" | ||
72 | R_PAREN@[76; 77) ")" | ||
73 | SEMI@[77; 78) ";" | ||
74 | WHITESPACE@[78; 83) "\n " | ||
75 | LET_STMT@[83; 100) | ||
76 | LET_KW@[83; 86) "let" | ||
77 | WHITESPACE@[86; 87) " " | ||
78 | TUPLE_STRUCT_PAT@[87; 94) | ||
79 | PATH@[87; 90) | ||
80 | PATH_SEGMENT@[87; 90) | ||
81 | NAME_REF@[87; 90) | ||
82 | IDENT@[87; 90) "Bar" | ||
83 | L_PAREN@[90; 91) "(" | ||
84 | DOTDOT@[91; 93) ".." | ||
85 | R_PAREN@[93; 94) ")" | ||
86 | WHITESPACE@[94; 95) " " | ||
87 | EQ@[95; 96) "=" | ||
88 | WHITESPACE@[96; 97) " " | ||
89 | TUPLE_EXPR@[97; 99) | ||
90 | L_PAREN@[97; 98) "(" | ||
91 | R_PAREN@[98; 99) ")" | ||
92 | SEMI@[99; 100) ";" | ||
93 | WHITESPACE@[100; 101) "\n" | ||
94 | R_CURLY@[101; 102) "}" | ||
95 | WHITESPACE@[102; 103) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0009_loop_expr.rs b/crates/ra_syntax/test_data/parser/inline/ok/0009_loop_expr.rs new file mode 100644 index 000000000..9f078fa48 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0009_loop_expr.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn foo() { | ||
2 | loop {}; | ||
3 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0009_loop_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0009_loop_expr.txt new file mode 100644 index 000000000..8240aba15 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0009_loop_expr.txt | |||
@@ -0,0 +1,24 @@ | |||
1 | SOURCE_FILE@[0; 26) | ||
2 | FN_DEF@[0; 25) | ||
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; 25) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 15) "\n " | ||
14 | EXPR_STMT@[15; 23) | ||
15 | LOOP_EXPR@[15; 22) | ||
16 | LOOP_KW@[15; 19) "loop" | ||
17 | WHITESPACE@[19; 20) " " | ||
18 | BLOCK@[20; 22) | ||
19 | L_CURLY@[20; 21) "{" | ||
20 | R_CURLY@[21; 22) "}" | ||
21 | SEMI@[22; 23) ";" | ||
22 | WHITESPACE@[23; 24) "\n" | ||
23 | R_CURLY@[24; 25) "}" | ||
24 | WHITESPACE@[25; 26) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0010_extern_block.rs b/crates/ra_syntax/test_data/parser/inline/ok/0010_extern_block.rs new file mode 100644 index 000000000..26a9ccd1e --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0010_extern_block.rs | |||
@@ -0,0 +1 @@ | |||
extern {} | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0010_extern_block.txt b/crates/ra_syntax/test_data/parser/inline/ok/0010_extern_block.txt new file mode 100644 index 000000000..506f56fff --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0010_extern_block.txt | |||
@@ -0,0 +1,9 @@ | |||
1 | SOURCE_FILE@[0; 10) | ||
2 | EXTERN_BLOCK@[0; 9) | ||
3 | ABI@[0; 6) | ||
4 | EXTERN_KW@[0; 6) "extern" | ||
5 | WHITESPACE@[6; 7) " " | ||
6 | EXTERN_ITEM_LIST@[7; 9) | ||
7 | L_CURLY@[7; 8) "{" | ||
8 | R_CURLY@[8; 9) "}" | ||
9 | WHITESPACE@[9; 10) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0011_field_expr.rs b/crates/ra_syntax/test_data/parser/inline/ok/0011_field_expr.rs new file mode 100644 index 000000000..b8da2ddc3 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0011_field_expr.rs | |||
@@ -0,0 +1,5 @@ | |||
1 | fn foo() { | ||
2 | x.foo; | ||
3 | x.0.bar; | ||
4 | x.0(); | ||
5 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0011_field_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0011_field_expr.txt new file mode 100644 index 000000000..78054ec5a --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0011_field_expr.txt | |||
@@ -0,0 +1,57 @@ | |||
1 | SOURCE_FILE@[0; 48) | ||
2 | FN_DEF@[0; 47) | ||
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; 47) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 15) "\n " | ||
14 | EXPR_STMT@[15; 21) | ||
15 | FIELD_EXPR@[15; 20) | ||
16 | PATH_EXPR@[15; 16) | ||
17 | PATH@[15; 16) | ||
18 | PATH_SEGMENT@[15; 16) | ||
19 | NAME_REF@[15; 16) | ||
20 | IDENT@[15; 16) "x" | ||
21 | DOT@[16; 17) "." | ||
22 | NAME_REF@[17; 20) | ||
23 | IDENT@[17; 20) "foo" | ||
24 | SEMI@[20; 21) ";" | ||
25 | WHITESPACE@[21; 26) "\n " | ||
26 | EXPR_STMT@[26; 34) | ||
27 | FIELD_EXPR@[26; 33) | ||
28 | FIELD_EXPR@[26; 29) | ||
29 | PATH_EXPR@[26; 27) | ||
30 | PATH@[26; 27) | ||
31 | PATH_SEGMENT@[26; 27) | ||
32 | NAME_REF@[26; 27) | ||
33 | IDENT@[26; 27) "x" | ||
34 | DOT@[27; 28) "." | ||
35 | INT_NUMBER@[28; 29) "0" | ||
36 | DOT@[29; 30) "." | ||
37 | NAME_REF@[30; 33) | ||
38 | IDENT@[30; 33) "bar" | ||
39 | SEMI@[33; 34) ";" | ||
40 | WHITESPACE@[34; 39) "\n " | ||
41 | EXPR_STMT@[39; 45) | ||
42 | CALL_EXPR@[39; 44) | ||
43 | FIELD_EXPR@[39; 42) | ||
44 | PATH_EXPR@[39; 40) | ||
45 | PATH@[39; 40) | ||
46 | PATH_SEGMENT@[39; 40) | ||
47 | NAME_REF@[39; 40) | ||
48 | IDENT@[39; 40) "x" | ||
49 | DOT@[40; 41) "." | ||
50 | INT_NUMBER@[41; 42) "0" | ||
51 | ARG_LIST@[42; 44) | ||
52 | L_PAREN@[42; 43) "(" | ||
53 | R_PAREN@[43; 44) ")" | ||
54 | SEMI@[44; 45) ";" | ||
55 | WHITESPACE@[45; 46) "\n" | ||
56 | R_CURLY@[46; 47) "}" | ||
57 | WHITESPACE@[47; 48) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0012_type_item_where_clause.rs b/crates/ra_syntax/test_data/parser/inline/ok/0012_type_item_where_clause.rs new file mode 100644 index 000000000..a602d07f0 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0012_type_item_where_clause.rs | |||
@@ -0,0 +1 @@ | |||
type Foo where Foo: Copy = (); | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0012_type_item_where_clause.txt b/crates/ra_syntax/test_data/parser/inline/ok/0012_type_item_where_clause.txt new file mode 100644 index 000000000..da04dac5c --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0012_type_item_where_clause.txt | |||
@@ -0,0 +1,33 @@ | |||
1 | SOURCE_FILE@[0; 31) | ||
2 | TYPE_ALIAS_DEF@[0; 30) | ||
3 | TYPE_KW@[0; 4) "type" | ||
4 | WHITESPACE@[4; 5) " " | ||
5 | NAME@[5; 8) | ||
6 | IDENT@[5; 8) "Foo" | ||
7 | WHITESPACE@[8; 9) " " | ||
8 | WHERE_CLAUSE@[9; 24) | ||
9 | WHERE_KW@[9; 14) "where" | ||
10 | WHITESPACE@[14; 15) " " | ||
11 | WHERE_PRED@[15; 24) | ||
12 | PATH_TYPE@[15; 18) | ||
13 | PATH@[15; 18) | ||
14 | PATH_SEGMENT@[15; 18) | ||
15 | NAME_REF@[15; 18) | ||
16 | IDENT@[15; 18) "Foo" | ||
17 | COLON@[18; 19) ":" | ||
18 | WHITESPACE@[19; 20) " " | ||
19 | TYPE_BOUND_LIST@[20; 24) | ||
20 | TYPE_BOUND@[20; 24) | ||
21 | PATH_TYPE@[20; 24) | ||
22 | PATH@[20; 24) | ||
23 | PATH_SEGMENT@[20; 24) | ||
24 | NAME_REF@[20; 24) | ||
25 | IDENT@[20; 24) "Copy" | ||
26 | WHITESPACE@[24; 25) " " | ||
27 | EQ@[25; 26) "=" | ||
28 | WHITESPACE@[26; 27) " " | ||
29 | TUPLE_TYPE@[27; 29) | ||
30 | L_PAREN@[27; 28) "(" | ||
31 | R_PAREN@[28; 29) ")" | ||
32 | SEMI@[29; 30) ";" | ||
33 | WHITESPACE@[30; 31) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0013_pointer_type_mut.rs b/crates/ra_syntax/test_data/parser/inline/ok/0013_pointer_type_mut.rs new file mode 100644 index 000000000..04b2bb9ba --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0013_pointer_type_mut.rs | |||
@@ -0,0 +1,2 @@ | |||
1 | type M = *mut (); | ||
2 | type C = *mut (); | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0013_pointer_type_mut.txt b/crates/ra_syntax/test_data/parser/inline/ok/0013_pointer_type_mut.txt new file mode 100644 index 000000000..c05f873d6 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0013_pointer_type_mut.txt | |||
@@ -0,0 +1,35 @@ | |||
1 | SOURCE_FILE@[0; 36) | ||
2 | TYPE_ALIAS_DEF@[0; 17) | ||
3 | TYPE_KW@[0; 4) "type" | ||
4 | WHITESPACE@[4; 5) " " | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "M" | ||
7 | WHITESPACE@[6; 7) " " | ||
8 | EQ@[7; 8) "=" | ||
9 | WHITESPACE@[8; 9) " " | ||
10 | POINTER_TYPE@[9; 16) | ||
11 | STAR@[9; 10) "*" | ||
12 | MUT_KW@[10; 13) "mut" | ||
13 | WHITESPACE@[13; 14) " " | ||
14 | TUPLE_TYPE@[14; 16) | ||
15 | L_PAREN@[14; 15) "(" | ||
16 | R_PAREN@[15; 16) ")" | ||
17 | SEMI@[16; 17) ";" | ||
18 | WHITESPACE@[17; 18) "\n" | ||
19 | TYPE_ALIAS_DEF@[18; 35) | ||
20 | TYPE_KW@[18; 22) "type" | ||
21 | WHITESPACE@[22; 23) " " | ||
22 | NAME@[23; 24) | ||
23 | IDENT@[23; 24) "C" | ||
24 | WHITESPACE@[24; 25) " " | ||
25 | EQ@[25; 26) "=" | ||
26 | WHITESPACE@[26; 27) " " | ||
27 | POINTER_TYPE@[27; 34) | ||
28 | STAR@[27; 28) "*" | ||
29 | MUT_KW@[28; 31) "mut" | ||
30 | WHITESPACE@[31; 32) " " | ||
31 | TUPLE_TYPE@[32; 34) | ||
32 | L_PAREN@[32; 33) "(" | ||
33 | R_PAREN@[33; 34) ")" | ||
34 | SEMI@[34; 35) ";" | ||
35 | WHITESPACE@[35; 36) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0014_never_type.rs b/crates/ra_syntax/test_data/parser/inline/ok/0014_never_type.rs new file mode 100644 index 000000000..de399fcf4 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0014_never_type.rs | |||
@@ -0,0 +1 @@ | |||
type Never = !; | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0014_never_type.txt b/crates/ra_syntax/test_data/parser/inline/ok/0014_never_type.txt new file mode 100644 index 000000000..ac53e4fd3 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0014_never_type.txt | |||
@@ -0,0 +1,13 @@ | |||
1 | SOURCE_FILE@[0; 16) | ||
2 | TYPE_ALIAS_DEF@[0; 15) | ||
3 | TYPE_KW@[0; 4) "type" | ||
4 | WHITESPACE@[4; 5) " " | ||
5 | NAME@[5; 10) | ||
6 | IDENT@[5; 10) "Never" | ||
7 | WHITESPACE@[10; 11) " " | ||
8 | EQ@[11; 12) "=" | ||
9 | WHITESPACE@[12; 13) " " | ||
10 | NEVER_TYPE@[13; 14) | ||
11 | EXCL@[13; 14) "!" | ||
12 | SEMI@[14; 15) ";" | ||
13 | WHITESPACE@[15; 16) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0015_continue_expr.rs b/crates/ra_syntax/test_data/parser/inline/ok/0015_continue_expr.rs new file mode 100644 index 000000000..474cc3f0e --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0015_continue_expr.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | fn foo() { | ||
2 | loop { | ||
3 | continue; | ||
4 | continue 'l; | ||
5 | } | ||
6 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0015_continue_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0015_continue_expr.txt new file mode 100644 index 000000000..e8cc32f2c --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0015_continue_expr.txt | |||
@@ -0,0 +1,35 @@ | |||
1 | SOURCE_FILE@[0; 69) | ||
2 | FN_DEF@[0; 68) | ||
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; 68) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 15) "\n " | ||
14 | LOOP_EXPR@[15; 66) | ||
15 | LOOP_KW@[15; 19) "loop" | ||
16 | WHITESPACE@[19; 20) " " | ||
17 | BLOCK@[20; 66) | ||
18 | L_CURLY@[20; 21) "{" | ||
19 | WHITESPACE@[21; 30) "\n " | ||
20 | EXPR_STMT@[30; 39) | ||
21 | CONTINUE_EXPR@[30; 38) | ||
22 | CONTINUE_KW@[30; 38) "continue" | ||
23 | SEMI@[38; 39) ";" | ||
24 | WHITESPACE@[39; 48) "\n " | ||
25 | EXPR_STMT@[48; 60) | ||
26 | CONTINUE_EXPR@[48; 59) | ||
27 | CONTINUE_KW@[48; 56) "continue" | ||
28 | WHITESPACE@[56; 57) " " | ||
29 | LIFETIME@[57; 59) "\'l" | ||
30 | SEMI@[59; 60) ";" | ||
31 | WHITESPACE@[60; 65) "\n " | ||
32 | R_CURLY@[65; 66) "}" | ||
33 | WHITESPACE@[66; 67) "\n" | ||
34 | R_CURLY@[67; 68) "}" | ||
35 | WHITESPACE@[68; 69) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0016_unsafe_trait.rs b/crates/ra_syntax/test_data/parser/inline/ok/0016_unsafe_trait.rs new file mode 100644 index 000000000..04e021550 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0016_unsafe_trait.rs | |||
@@ -0,0 +1 @@ | |||
unsafe trait T {} | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0016_unsafe_trait.txt b/crates/ra_syntax/test_data/parser/inline/ok/0016_unsafe_trait.txt new file mode 100644 index 000000000..7b43f1294 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0016_unsafe_trait.txt | |||
@@ -0,0 +1,13 @@ | |||
1 | SOURCE_FILE@[0; 18) | ||
2 | TRAIT_DEF@[0; 17) | ||
3 | UNSAFE_KW@[0; 6) "unsafe" | ||
4 | WHITESPACE@[6; 7) " " | ||
5 | TRAIT_KW@[7; 12) "trait" | ||
6 | WHITESPACE@[12; 13) " " | ||
7 | NAME@[13; 14) | ||
8 | IDENT@[13; 14) "T" | ||
9 | WHITESPACE@[14; 15) " " | ||
10 | ITEM_LIST@[15; 17) | ||
11 | L_CURLY@[15; 16) "{" | ||
12 | R_CURLY@[16; 17) "}" | ||
13 | WHITESPACE@[17; 18) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0017_array_type.rs b/crates/ra_syntax/test_data/parser/inline/ok/0017_array_type.rs new file mode 100644 index 000000000..27eb22f22 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0017_array_type.rs | |||
@@ -0,0 +1 @@ | |||
type T = [(); 92]; | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0017_array_type.txt b/crates/ra_syntax/test_data/parser/inline/ok/0017_array_type.txt new file mode 100644 index 000000000..b4055c9f0 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0017_array_type.txt | |||
@@ -0,0 +1,21 @@ | |||
1 | SOURCE_FILE@[0; 19) | ||
2 | TYPE_ALIAS_DEF@[0; 18) | ||
3 | TYPE_KW@[0; 4) "type" | ||
4 | WHITESPACE@[4; 5) " " | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "T" | ||
7 | WHITESPACE@[6; 7) " " | ||
8 | EQ@[7; 8) "=" | ||
9 | WHITESPACE@[8; 9) " " | ||
10 | ARRAY_TYPE@[9; 17) | ||
11 | L_BRACK@[9; 10) "[" | ||
12 | TUPLE_TYPE@[10; 12) | ||
13 | L_PAREN@[10; 11) "(" | ||
14 | R_PAREN@[11; 12) ")" | ||
15 | SEMI@[12; 13) ";" | ||
16 | WHITESPACE@[13; 14) " " | ||
17 | LITERAL@[14; 16) | ||
18 | INT_NUMBER@[14; 16) "92" | ||
19 | R_BRACK@[16; 17) "]" | ||
20 | SEMI@[17; 18) ";" | ||
21 | WHITESPACE@[18; 19) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0018_arb_self_types.rs b/crates/ra_syntax/test_data/parser/inline/ok/0018_arb_self_types.rs new file mode 100644 index 000000000..6a170d5ac --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0018_arb_self_types.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | impl S { | ||
2 | fn a(self: &Self) {} | ||
3 | fn b(mut self: Box<Self>) {} | ||
4 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0018_arb_self_types.txt b/crates/ra_syntax/test_data/parser/inline/ok/0018_arb_self_types.txt new file mode 100644 index 000000000..67d0de0f0 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0018_arb_self_types.txt | |||
@@ -0,0 +1,72 @@ | |||
1 | SOURCE_FILE@[0; 69) | ||
2 | IMPL_BLOCK@[0; 68) | ||
3 | IMPL_KW@[0; 4) "impl" | ||
4 | WHITESPACE@[4; 5) " " | ||
5 | PATH_TYPE@[5; 6) | ||
6 | PATH@[5; 6) | ||
7 | PATH_SEGMENT@[5; 6) | ||
8 | NAME_REF@[5; 6) | ||
9 | IDENT@[5; 6) "S" | ||
10 | WHITESPACE@[6; 7) " " | ||
11 | ITEM_LIST@[7; 68) | ||
12 | L_CURLY@[7; 8) "{" | ||
13 | WHITESPACE@[8; 13) "\n " | ||
14 | FN_DEF@[13; 33) | ||
15 | FN_KW@[13; 15) "fn" | ||
16 | WHITESPACE@[15; 16) " " | ||
17 | NAME@[16; 17) | ||
18 | IDENT@[16; 17) "a" | ||
19 | PARAM_LIST@[17; 30) | ||
20 | L_PAREN@[17; 18) "(" | ||
21 | SELF_PARAM@[18; 29) | ||
22 | SELF_KW@[18; 22) "self" | ||
23 | COLON@[22; 23) ":" | ||
24 | WHITESPACE@[23; 24) " " | ||
25 | REFERENCE_TYPE@[24; 29) | ||
26 | AMP@[24; 25) "&" | ||
27 | PATH_TYPE@[25; 29) | ||
28 | PATH@[25; 29) | ||
29 | PATH_SEGMENT@[25; 29) | ||
30 | NAME_REF@[25; 29) | ||
31 | IDENT@[25; 29) "Self" | ||
32 | R_PAREN@[29; 30) ")" | ||
33 | WHITESPACE@[30; 31) " " | ||
34 | BLOCK@[31; 33) | ||
35 | L_CURLY@[31; 32) "{" | ||
36 | R_CURLY@[32; 33) "}" | ||
37 | WHITESPACE@[33; 38) "\n " | ||
38 | FN_DEF@[38; 66) | ||
39 | FN_KW@[38; 40) "fn" | ||
40 | WHITESPACE@[40; 41) " " | ||
41 | NAME@[41; 42) | ||
42 | IDENT@[41; 42) "b" | ||
43 | PARAM_LIST@[42; 63) | ||
44 | L_PAREN@[42; 43) "(" | ||
45 | SELF_PARAM@[43; 62) | ||
46 | MUT_KW@[43; 46) "mut" | ||
47 | WHITESPACE@[46; 47) " " | ||
48 | SELF_KW@[47; 51) "self" | ||
49 | COLON@[51; 52) ":" | ||
50 | WHITESPACE@[52; 53) " " | ||
51 | PATH_TYPE@[53; 62) | ||
52 | PATH@[53; 62) | ||
53 | PATH_SEGMENT@[53; 62) | ||
54 | NAME_REF@[53; 56) | ||
55 | IDENT@[53; 56) "Box" | ||
56 | TYPE_ARG_LIST@[56; 62) | ||
57 | L_ANGLE@[56; 57) "<" | ||
58 | TYPE_ARG@[57; 61) | ||
59 | PATH_TYPE@[57; 61) | ||
60 | PATH@[57; 61) | ||
61 | PATH_SEGMENT@[57; 61) | ||
62 | NAME_REF@[57; 61) | ||
63 | IDENT@[57; 61) "Self" | ||
64 | R_ANGLE@[61; 62) ">" | ||
65 | R_PAREN@[62; 63) ")" | ||
66 | WHITESPACE@[63; 64) " " | ||
67 | BLOCK@[64; 66) | ||
68 | L_CURLY@[64; 65) "{" | ||
69 | R_CURLY@[65; 66) "}" | ||
70 | WHITESPACE@[66; 67) "\n" | ||
71 | R_CURLY@[67; 68) "}" | ||
72 | WHITESPACE@[68; 69) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0019_unary_expr.rs b/crates/ra_syntax/test_data/parser/inline/ok/0019_unary_expr.rs new file mode 100644 index 000000000..f1c3f7118 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0019_unary_expr.rs | |||
@@ -0,0 +1,5 @@ | |||
1 | fn foo() { | ||
2 | **&1; | ||
3 | !!true; | ||
4 | --1; | ||
5 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0019_unary_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0019_unary_expr.txt new file mode 100644 index 000000000..42032f56c --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0019_unary_expr.txt | |||
@@ -0,0 +1,44 @@ | |||
1 | SOURCE_FILE@[0; 44) | ||
2 | FN_DEF@[0; 43) | ||
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; 43) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 15) "\n " | ||
14 | EXPR_STMT@[15; 20) | ||
15 | PREFIX_EXPR@[15; 19) | ||
16 | STAR@[15; 16) "*" | ||
17 | PREFIX_EXPR@[16; 19) | ||
18 | STAR@[16; 17) "*" | ||
19 | REF_EXPR@[17; 19) | ||
20 | AMP@[17; 18) "&" | ||
21 | LITERAL@[18; 19) | ||
22 | INT_NUMBER@[18; 19) "1" | ||
23 | SEMI@[19; 20) ";" | ||
24 | WHITESPACE@[20; 25) "\n " | ||
25 | EXPR_STMT@[25; 32) | ||
26 | PREFIX_EXPR@[25; 31) | ||
27 | EXCL@[25; 26) "!" | ||
28 | PREFIX_EXPR@[26; 31) | ||
29 | EXCL@[26; 27) "!" | ||
30 | LITERAL@[27; 31) | ||
31 | TRUE_KW@[27; 31) "true" | ||
32 | SEMI@[31; 32) ";" | ||
33 | WHITESPACE@[32; 37) "\n " | ||
34 | EXPR_STMT@[37; 41) | ||
35 | PREFIX_EXPR@[37; 40) | ||
36 | MINUS@[37; 38) "-" | ||
37 | PREFIX_EXPR@[38; 40) | ||
38 | MINUS@[38; 39) "-" | ||
39 | LITERAL@[39; 40) | ||
40 | INT_NUMBER@[39; 40) "1" | ||
41 | SEMI@[40; 41) ";" | ||
42 | WHITESPACE@[41; 42) "\n" | ||
43 | R_CURLY@[42; 43) "}" | ||
44 | WHITESPACE@[43; 44) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0020_use_star.rs b/crates/ra_syntax/test_data/parser/inline/ok/0020_use_star.rs new file mode 100644 index 000000000..6f15769a8 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0020_use_star.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | use *; | ||
2 | use ::*; | ||
3 | use some::path::{*}; | ||
4 | use some::path::{::*}; | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0020_use_star.txt b/crates/ra_syntax/test_data/parser/inline/ok/0020_use_star.txt new file mode 100644 index 000000000..dd2095d90 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0020_use_star.txt | |||
@@ -0,0 +1,59 @@ | |||
1 | SOURCE_FILE@[0; 60) | ||
2 | USE_ITEM@[0; 6) | ||
3 | USE_KW@[0; 3) "use" | ||
4 | WHITESPACE@[3; 4) " " | ||
5 | USE_TREE@[4; 5) | ||
6 | STAR@[4; 5) "*" | ||
7 | SEMI@[5; 6) ";" | ||
8 | WHITESPACE@[6; 7) "\n" | ||
9 | USE_ITEM@[7; 15) | ||
10 | USE_KW@[7; 10) "use" | ||
11 | WHITESPACE@[10; 11) " " | ||
12 | USE_TREE@[11; 14) | ||
13 | COLONCOLON@[11; 13) "::" | ||
14 | STAR@[13; 14) "*" | ||
15 | SEMI@[14; 15) ";" | ||
16 | WHITESPACE@[15; 16) "\n" | ||
17 | USE_ITEM@[16; 36) | ||
18 | USE_KW@[16; 19) "use" | ||
19 | WHITESPACE@[19; 20) " " | ||
20 | USE_TREE@[20; 35) | ||
21 | PATH@[20; 30) | ||
22 | PATH@[20; 24) | ||
23 | PATH_SEGMENT@[20; 24) | ||
24 | NAME_REF@[20; 24) | ||
25 | IDENT@[20; 24) "some" | ||
26 | COLONCOLON@[24; 26) "::" | ||
27 | PATH_SEGMENT@[26; 30) | ||
28 | NAME_REF@[26; 30) | ||
29 | IDENT@[26; 30) "path" | ||
30 | COLONCOLON@[30; 32) "::" | ||
31 | USE_TREE_LIST@[32; 35) | ||
32 | L_CURLY@[32; 33) "{" | ||
33 | USE_TREE@[33; 34) | ||
34 | STAR@[33; 34) "*" | ||
35 | R_CURLY@[34; 35) "}" | ||
36 | SEMI@[35; 36) ";" | ||
37 | WHITESPACE@[36; 37) "\n" | ||
38 | USE_ITEM@[37; 59) | ||
39 | USE_KW@[37; 40) "use" | ||
40 | WHITESPACE@[40; 41) " " | ||
41 | USE_TREE@[41; 58) | ||
42 | PATH@[41; 51) | ||
43 | PATH@[41; 45) | ||
44 | PATH_SEGMENT@[41; 45) | ||
45 | NAME_REF@[41; 45) | ||
46 | IDENT@[41; 45) "some" | ||
47 | COLONCOLON@[45; 47) "::" | ||
48 | PATH_SEGMENT@[47; 51) | ||
49 | NAME_REF@[47; 51) | ||
50 | IDENT@[47; 51) "path" | ||
51 | COLONCOLON@[51; 53) "::" | ||
52 | USE_TREE_LIST@[53; 58) | ||
53 | L_CURLY@[53; 54) "{" | ||
54 | USE_TREE@[54; 57) | ||
55 | COLONCOLON@[54; 56) "::" | ||
56 | STAR@[56; 57) "*" | ||
57 | R_CURLY@[57; 58) "}" | ||
58 | SEMI@[58; 59) ";" | ||
59 | WHITESPACE@[59; 60) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0021_impl_item_list.rs b/crates/ra_syntax/test_data/parser/inline/ok/0021_impl_item_list.rs new file mode 100644 index 000000000..f10851487 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0021_impl_item_list.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | impl F { | ||
2 | type A = i32; | ||
3 | const B: i32 = 92; | ||
4 | fn foo() {} | ||
5 | fn bar(&self) {} | ||
6 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0021_impl_item_list.txt b/crates/ra_syntax/test_data/parser/inline/ok/0021_impl_item_list.txt new file mode 100644 index 000000000..a893833e1 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0021_impl_item_list.txt | |||
@@ -0,0 +1,78 @@ | |||
1 | SOURCE_FILE@[0; 89) | ||
2 | IMPL_BLOCK@[0; 88) | ||
3 | IMPL_KW@[0; 4) "impl" | ||
4 | WHITESPACE@[4; 5) " " | ||
5 | PATH_TYPE@[5; 6) | ||
6 | PATH@[5; 6) | ||
7 | PATH_SEGMENT@[5; 6) | ||
8 | NAME_REF@[5; 6) | ||
9 | IDENT@[5; 6) "F" | ||
10 | WHITESPACE@[6; 7) " " | ||
11 | ITEM_LIST@[7; 88) | ||
12 | L_CURLY@[7; 8) "{" | ||
13 | WHITESPACE@[8; 13) "\n " | ||
14 | TYPE_ALIAS_DEF@[13; 26) | ||
15 | TYPE_KW@[13; 17) "type" | ||
16 | WHITESPACE@[17; 18) " " | ||
17 | NAME@[18; 19) | ||
18 | IDENT@[18; 19) "A" | ||
19 | WHITESPACE@[19; 20) " " | ||
20 | EQ@[20; 21) "=" | ||
21 | WHITESPACE@[21; 22) " " | ||
22 | PATH_TYPE@[22; 25) | ||
23 | PATH@[22; 25) | ||
24 | PATH_SEGMENT@[22; 25) | ||
25 | NAME_REF@[22; 25) | ||
26 | IDENT@[22; 25) "i32" | ||
27 | SEMI@[25; 26) ";" | ||
28 | WHITESPACE@[26; 31) "\n " | ||
29 | CONST_DEF@[31; 49) | ||
30 | CONST_KW@[31; 36) "const" | ||
31 | WHITESPACE@[36; 37) " " | ||
32 | NAME@[37; 38) | ||
33 | IDENT@[37; 38) "B" | ||
34 | COLON@[38; 39) ":" | ||
35 | WHITESPACE@[39; 40) " " | ||
36 | PATH_TYPE@[40; 43) | ||
37 | PATH@[40; 43) | ||
38 | PATH_SEGMENT@[40; 43) | ||
39 | NAME_REF@[40; 43) | ||
40 | IDENT@[40; 43) "i32" | ||
41 | WHITESPACE@[43; 44) " " | ||
42 | EQ@[44; 45) "=" | ||
43 | WHITESPACE@[45; 46) " " | ||
44 | LITERAL@[46; 48) | ||
45 | INT_NUMBER@[46; 48) "92" | ||
46 | SEMI@[48; 49) ";" | ||
47 | WHITESPACE@[49; 54) "\n " | ||
48 | FN_DEF@[54; 65) | ||
49 | FN_KW@[54; 56) "fn" | ||
50 | WHITESPACE@[56; 57) " " | ||
51 | NAME@[57; 60) | ||
52 | IDENT@[57; 60) "foo" | ||
53 | PARAM_LIST@[60; 62) | ||
54 | L_PAREN@[60; 61) "(" | ||
55 | R_PAREN@[61; 62) ")" | ||
56 | WHITESPACE@[62; 63) " " | ||
57 | BLOCK@[63; 65) | ||
58 | L_CURLY@[63; 64) "{" | ||
59 | R_CURLY@[64; 65) "}" | ||
60 | WHITESPACE@[65; 70) "\n " | ||
61 | FN_DEF@[70; 86) | ||
62 | FN_KW@[70; 72) "fn" | ||
63 | WHITESPACE@[72; 73) " " | ||
64 | NAME@[73; 76) | ||
65 | IDENT@[73; 76) "bar" | ||
66 | PARAM_LIST@[76; 83) | ||
67 | L_PAREN@[76; 77) "(" | ||
68 | SELF_PARAM@[77; 82) | ||
69 | AMP@[77; 78) "&" | ||
70 | SELF_KW@[78; 82) "self" | ||
71 | R_PAREN@[82; 83) ")" | ||
72 | WHITESPACE@[83; 84) " " | ||
73 | BLOCK@[84; 86) | ||
74 | L_CURLY@[84; 85) "{" | ||
75 | R_CURLY@[85; 86) "}" | ||
76 | WHITESPACE@[86; 87) "\n" | ||
77 | R_CURLY@[87; 88) "}" | ||
78 | WHITESPACE@[88; 89) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0022_crate_visibility.rs b/crates/ra_syntax/test_data/parser/inline/ok/0022_crate_visibility.rs new file mode 100644 index 000000000..faeefde94 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0022_crate_visibility.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | pub(crate) struct S; | ||
2 | pub(self) struct S; | ||
3 | pub(self) struct S; | ||
4 | pub(self) struct S; | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0022_crate_visibility.txt b/crates/ra_syntax/test_data/parser/inline/ok/0022_crate_visibility.txt new file mode 100644 index 000000000..891943f6e --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0022_crate_visibility.txt | |||
@@ -0,0 +1,53 @@ | |||
1 | SOURCE_FILE@[0; 81) | ||
2 | STRUCT_DEF@[0; 20) | ||
3 | VISIBILITY@[0; 10) | ||
4 | PUB_KW@[0; 3) "pub" | ||
5 | L_PAREN@[3; 4) "(" | ||
6 | CRATE_KW@[4; 9) "crate" | ||
7 | R_PAREN@[9; 10) ")" | ||
8 | WHITESPACE@[10; 11) " " | ||
9 | STRUCT_KW@[11; 17) "struct" | ||
10 | WHITESPACE@[17; 18) " " | ||
11 | NAME@[18; 19) | ||
12 | IDENT@[18; 19) "S" | ||
13 | SEMI@[19; 20) ";" | ||
14 | WHITESPACE@[20; 21) "\n" | ||
15 | STRUCT_DEF@[21; 40) | ||
16 | VISIBILITY@[21; 30) | ||
17 | PUB_KW@[21; 24) "pub" | ||
18 | L_PAREN@[24; 25) "(" | ||
19 | SELF_KW@[25; 29) "self" | ||
20 | R_PAREN@[29; 30) ")" | ||
21 | WHITESPACE@[30; 31) " " | ||
22 | STRUCT_KW@[31; 37) "struct" | ||
23 | WHITESPACE@[37; 38) " " | ||
24 | NAME@[38; 39) | ||
25 | IDENT@[38; 39) "S" | ||
26 | SEMI@[39; 40) ";" | ||
27 | WHITESPACE@[40; 41) "\n" | ||
28 | STRUCT_DEF@[41; 60) | ||
29 | VISIBILITY@[41; 50) | ||
30 | PUB_KW@[41; 44) "pub" | ||
31 | L_PAREN@[44; 45) "(" | ||
32 | SELF_KW@[45; 49) "self" | ||
33 | R_PAREN@[49; 50) ")" | ||
34 | WHITESPACE@[50; 51) " " | ||
35 | STRUCT_KW@[51; 57) "struct" | ||
36 | WHITESPACE@[57; 58) " " | ||
37 | NAME@[58; 59) | ||
38 | IDENT@[58; 59) "S" | ||
39 | SEMI@[59; 60) ";" | ||
40 | WHITESPACE@[60; 61) "\n" | ||
41 | STRUCT_DEF@[61; 80) | ||
42 | VISIBILITY@[61; 70) | ||
43 | PUB_KW@[61; 64) "pub" | ||
44 | L_PAREN@[64; 65) "(" | ||
45 | SELF_KW@[65; 69) "self" | ||
46 | R_PAREN@[69; 70) ")" | ||
47 | WHITESPACE@[70; 71) " " | ||
48 | STRUCT_KW@[71; 77) "struct" | ||
49 | WHITESPACE@[77; 78) " " | ||
50 | NAME@[78; 79) | ||
51 | IDENT@[78; 79) "S" | ||
52 | SEMI@[79; 80) ";" | ||
53 | WHITESPACE@[80; 81) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0023_placeholder_type.rs b/crates/ra_syntax/test_data/parser/inline/ok/0023_placeholder_type.rs new file mode 100644 index 000000000..7952dbd57 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0023_placeholder_type.rs | |||
@@ -0,0 +1 @@ | |||
type Placeholder = _; | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0023_placeholder_type.txt b/crates/ra_syntax/test_data/parser/inline/ok/0023_placeholder_type.txt new file mode 100644 index 000000000..0f32aec9e --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0023_placeholder_type.txt | |||
@@ -0,0 +1,13 @@ | |||
1 | SOURCE_FILE@[0; 22) | ||
2 | TYPE_ALIAS_DEF@[0; 21) | ||
3 | TYPE_KW@[0; 4) "type" | ||
4 | WHITESPACE@[4; 5) " " | ||
5 | NAME@[5; 16) | ||
6 | IDENT@[5; 16) "Placeholder" | ||
7 | WHITESPACE@[16; 17) " " | ||
8 | EQ@[17; 18) "=" | ||
9 | WHITESPACE@[18; 19) " " | ||
10 | PLACEHOLDER_TYPE@[19; 20) | ||
11 | UNDERSCORE@[19; 20) "_" | ||
12 | SEMI@[20; 21) ";" | ||
13 | WHITESPACE@[21; 22) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0024_slice_pat.rs b/crates/ra_syntax/test_data/parser/inline/ok/0024_slice_pat.rs new file mode 100644 index 000000000..7955973b9 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0024_slice_pat.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn main() { | ||
2 | let [a, b, ..] = []; | ||
3 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0024_slice_pat.txt b/crates/ra_syntax/test_data/parser/inline/ok/0024_slice_pat.txt new file mode 100644 index 000000000..40ddbfbf6 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0024_slice_pat.txt | |||
@@ -0,0 +1,40 @@ | |||
1 | SOURCE_FILE@[0; 39) | ||
2 | FN_DEF@[0; 38) | ||
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@[10; 38) | ||
12 | L_CURLY@[10; 11) "{" | ||
13 | WHITESPACE@[11; 16) "\n " | ||
14 | LET_STMT@[16; 36) | ||
15 | LET_KW@[16; 19) "let" | ||
16 | WHITESPACE@[19; 20) " " | ||
17 | SLICE_PAT@[20; 30) | ||
18 | L_BRACK@[20; 21) "[" | ||
19 | BIND_PAT@[21; 22) | ||
20 | NAME@[21; 22) | ||
21 | IDENT@[21; 22) "a" | ||
22 | COMMA@[22; 23) "," | ||
23 | WHITESPACE@[23; 24) " " | ||
24 | BIND_PAT@[24; 25) | ||
25 | NAME@[24; 25) | ||
26 | IDENT@[24; 25) "b" | ||
27 | COMMA@[25; 26) "," | ||
28 | WHITESPACE@[26; 27) " " | ||
29 | DOTDOT@[27; 29) ".." | ||
30 | R_BRACK@[29; 30) "]" | ||
31 | WHITESPACE@[30; 31) " " | ||
32 | EQ@[31; 32) "=" | ||
33 | WHITESPACE@[32; 33) " " | ||
34 | ARRAY_EXPR@[33; 35) | ||
35 | L_BRACK@[33; 34) "[" | ||
36 | R_BRACK@[34; 35) "]" | ||
37 | SEMI@[35; 36) ";" | ||
38 | WHITESPACE@[36; 37) "\n" | ||
39 | R_CURLY@[37; 38) "}" | ||
40 | WHITESPACE@[38; 39) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0025_slice_type.rs b/crates/ra_syntax/test_data/parser/inline/ok/0025_slice_type.rs new file mode 100644 index 000000000..4da1af827 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0025_slice_type.rs | |||
@@ -0,0 +1 @@ | |||
type T = [()]; | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0025_slice_type.txt b/crates/ra_syntax/test_data/parser/inline/ok/0025_slice_type.txt new file mode 100644 index 000000000..b3a24281e --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0025_slice_type.txt | |||
@@ -0,0 +1,17 @@ | |||
1 | SOURCE_FILE@[0; 15) | ||
2 | TYPE_ALIAS_DEF@[0; 14) | ||
3 | TYPE_KW@[0; 4) "type" | ||
4 | WHITESPACE@[4; 5) " " | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "T" | ||
7 | WHITESPACE@[6; 7) " " | ||
8 | EQ@[7; 8) "=" | ||
9 | WHITESPACE@[8; 9) " " | ||
10 | SLICE_TYPE@[9; 13) | ||
11 | L_BRACK@[9; 10) "[" | ||
12 | TUPLE_TYPE@[10; 12) | ||
13 | L_PAREN@[10; 11) "(" | ||
14 | R_PAREN@[11; 12) ")" | ||
15 | R_BRACK@[12; 13) "]" | ||
16 | SEMI@[13; 14) ";" | ||
17 | WHITESPACE@[14; 15) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0026_tuple_pat_fields.rs b/crates/ra_syntax/test_data/parser/inline/ok/0026_tuple_pat_fields.rs new file mode 100644 index 000000000..0dfe63629 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0026_tuple_pat_fields.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | fn foo() { | ||
2 | let S() = (); | ||
3 | let S(_) = (); | ||
4 | let S(_,) = (); | ||
5 | let S(_, .. , x) = (); | ||
6 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0026_tuple_pat_fields.txt b/crates/ra_syntax/test_data/parser/inline/ok/0026_tuple_pat_fields.txt new file mode 100644 index 000000000..0ff936471 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0026_tuple_pat_fields.txt | |||
@@ -0,0 +1,103 @@ | |||
1 | SOURCE_FILE@[0; 97) | ||
2 | FN_DEF@[0; 96) | ||
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; 96) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 15) "\n " | ||
14 | LET_STMT@[15; 28) | ||
15 | LET_KW@[15; 18) "let" | ||
16 | WHITESPACE@[18; 19) " " | ||
17 | TUPLE_STRUCT_PAT@[19; 22) | ||
18 | PATH@[19; 20) | ||
19 | PATH_SEGMENT@[19; 20) | ||
20 | NAME_REF@[19; 20) | ||
21 | IDENT@[19; 20) "S" | ||
22 | L_PAREN@[20; 21) "(" | ||
23 | R_PAREN@[21; 22) ")" | ||
24 | WHITESPACE@[22; 23) " " | ||
25 | EQ@[23; 24) "=" | ||
26 | WHITESPACE@[24; 25) " " | ||
27 | TUPLE_EXPR@[25; 27) | ||
28 | L_PAREN@[25; 26) "(" | ||
29 | R_PAREN@[26; 27) ")" | ||
30 | SEMI@[27; 28) ";" | ||
31 | WHITESPACE@[28; 33) "\n " | ||
32 | LET_STMT@[33; 47) | ||
33 | LET_KW@[33; 36) "let" | ||
34 | WHITESPACE@[36; 37) " " | ||
35 | TUPLE_STRUCT_PAT@[37; 41) | ||
36 | PATH@[37; 38) | ||
37 | PATH_SEGMENT@[37; 38) | ||
38 | NAME_REF@[37; 38) | ||
39 | IDENT@[37; 38) "S" | ||
40 | L_PAREN@[38; 39) "(" | ||
41 | PLACEHOLDER_PAT@[39; 40) | ||
42 | UNDERSCORE@[39; 40) "_" | ||
43 | R_PAREN@[40; 41) ")" | ||
44 | WHITESPACE@[41; 42) " " | ||
45 | EQ@[42; 43) "=" | ||
46 | WHITESPACE@[43; 44) " " | ||
47 | TUPLE_EXPR@[44; 46) | ||
48 | L_PAREN@[44; 45) "(" | ||
49 | R_PAREN@[45; 46) ")" | ||
50 | SEMI@[46; 47) ";" | ||
51 | WHITESPACE@[47; 52) "\n " | ||
52 | LET_STMT@[52; 67) | ||
53 | LET_KW@[52; 55) "let" | ||
54 | WHITESPACE@[55; 56) " " | ||
55 | TUPLE_STRUCT_PAT@[56; 61) | ||
56 | PATH@[56; 57) | ||
57 | PATH_SEGMENT@[56; 57) | ||
58 | NAME_REF@[56; 57) | ||
59 | IDENT@[56; 57) "S" | ||
60 | L_PAREN@[57; 58) "(" | ||
61 | PLACEHOLDER_PAT@[58; 59) | ||
62 | UNDERSCORE@[58; 59) "_" | ||
63 | COMMA@[59; 60) "," | ||
64 | R_PAREN@[60; 61) ")" | ||
65 | WHITESPACE@[61; 62) " " | ||
66 | EQ@[62; 63) "=" | ||
67 | WHITESPACE@[63; 64) " " | ||
68 | TUPLE_EXPR@[64; 66) | ||
69 | L_PAREN@[64; 65) "(" | ||
70 | R_PAREN@[65; 66) ")" | ||
71 | SEMI@[66; 67) ";" | ||
72 | WHITESPACE@[67; 72) "\n " | ||
73 | LET_STMT@[72; 94) | ||
74 | LET_KW@[72; 75) "let" | ||
75 | WHITESPACE@[75; 76) " " | ||
76 | TUPLE_STRUCT_PAT@[76; 88) | ||
77 | PATH@[76; 77) | ||
78 | PATH_SEGMENT@[76; 77) | ||
79 | NAME_REF@[76; 77) | ||
80 | IDENT@[76; 77) "S" | ||
81 | L_PAREN@[77; 78) "(" | ||
82 | PLACEHOLDER_PAT@[78; 79) | ||
83 | UNDERSCORE@[78; 79) "_" | ||
84 | COMMA@[79; 80) "," | ||
85 | WHITESPACE@[80; 81) " " | ||
86 | DOTDOT@[81; 83) ".." | ||
87 | WHITESPACE@[83; 84) " " | ||
88 | COMMA@[84; 85) "," | ||
89 | WHITESPACE@[85; 86) " " | ||
90 | BIND_PAT@[86; 87) | ||
91 | NAME@[86; 87) | ||
92 | IDENT@[86; 87) "x" | ||
93 | R_PAREN@[87; 88) ")" | ||
94 | WHITESPACE@[88; 89) " " | ||
95 | EQ@[89; 90) "=" | ||
96 | WHITESPACE@[90; 91) " " | ||
97 | TUPLE_EXPR@[91; 93) | ||
98 | L_PAREN@[91; 92) "(" | ||
99 | R_PAREN@[92; 93) ")" | ||
100 | SEMI@[93; 94) ";" | ||
101 | WHITESPACE@[94; 95) "\n" | ||
102 | R_CURLY@[95; 96) "}" | ||
103 | WHITESPACE@[96; 97) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0027_ref_pat.rs b/crates/ra_syntax/test_data/parser/inline/ok/0027_ref_pat.rs new file mode 100644 index 000000000..de41f5cae --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0027_ref_pat.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn main() { | ||
2 | let &a = (); | ||
3 | let &mut b = (); | ||
4 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0027_ref_pat.txt b/crates/ra_syntax/test_data/parser/inline/ok/0027_ref_pat.txt new file mode 100644 index 000000000..a833b1b96 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0027_ref_pat.txt | |||
@@ -0,0 +1,49 @@ | |||
1 | SOURCE_FILE@[0; 52) | ||
2 | FN_DEF@[0; 51) | ||
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@[10; 51) | ||
12 | L_CURLY@[10; 11) "{" | ||
13 | WHITESPACE@[11; 16) "\n " | ||
14 | LET_STMT@[16; 28) | ||
15 | LET_KW@[16; 19) "let" | ||
16 | WHITESPACE@[19; 20) " " | ||
17 | REF_PAT@[20; 22) | ||
18 | AMP@[20; 21) "&" | ||
19 | BIND_PAT@[21; 22) | ||
20 | NAME@[21; 22) | ||
21 | IDENT@[21; 22) "a" | ||
22 | WHITESPACE@[22; 23) " " | ||
23 | EQ@[23; 24) "=" | ||
24 | WHITESPACE@[24; 25) " " | ||
25 | TUPLE_EXPR@[25; 27) | ||
26 | L_PAREN@[25; 26) "(" | ||
27 | R_PAREN@[26; 27) ")" | ||
28 | SEMI@[27; 28) ";" | ||
29 | WHITESPACE@[28; 33) "\n " | ||
30 | LET_STMT@[33; 49) | ||
31 | LET_KW@[33; 36) "let" | ||
32 | WHITESPACE@[36; 37) " " | ||
33 | REF_PAT@[37; 43) | ||
34 | AMP@[37; 38) "&" | ||
35 | MUT_KW@[38; 41) "mut" | ||
36 | WHITESPACE@[41; 42) " " | ||
37 | BIND_PAT@[42; 43) | ||
38 | NAME@[42; 43) | ||
39 | IDENT@[42; 43) "b" | ||
40 | WHITESPACE@[43; 44) " " | ||
41 | EQ@[44; 45) "=" | ||
42 | WHITESPACE@[45; 46) " " | ||
43 | TUPLE_EXPR@[46; 48) | ||
44 | L_PAREN@[46; 47) "(" | ||
45 | R_PAREN@[47; 48) ")" | ||
46 | SEMI@[48; 49) ";" | ||
47 | WHITESPACE@[49; 50) "\n" | ||
48 | R_CURLY@[50; 51) "}" | ||
49 | WHITESPACE@[51; 52) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0028_impl_trait_type.rs b/crates/ra_syntax/test_data/parser/inline/ok/0028_impl_trait_type.rs new file mode 100644 index 000000000..54c5a7c46 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0028_impl_trait_type.rs | |||
@@ -0,0 +1 @@ | |||
type A = impl Iterator<Item=Foo<'a>> + 'a; | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0028_impl_trait_type.txt b/crates/ra_syntax/test_data/parser/inline/ok/0028_impl_trait_type.txt new file mode 100644 index 000000000..f07027fa7 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0028_impl_trait_type.txt | |||
@@ -0,0 +1,43 @@ | |||
1 | SOURCE_FILE@[0; 43) | ||
2 | TYPE_ALIAS_DEF@[0; 42) | ||
3 | TYPE_KW@[0; 4) "type" | ||
4 | WHITESPACE@[4; 5) " " | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "A" | ||
7 | WHITESPACE@[6; 7) " " | ||
8 | EQ@[7; 8) "=" | ||
9 | WHITESPACE@[8; 9) " " | ||
10 | IMPL_TRAIT_TYPE@[9; 41) | ||
11 | IMPL_KW@[9; 13) "impl" | ||
12 | WHITESPACE@[13; 14) " " | ||
13 | TYPE_BOUND_LIST@[14; 41) | ||
14 | TYPE_BOUND@[14; 36) | ||
15 | PATH_TYPE@[14; 36) | ||
16 | PATH@[14; 36) | ||
17 | PATH_SEGMENT@[14; 36) | ||
18 | NAME_REF@[14; 22) | ||
19 | IDENT@[14; 22) "Iterator" | ||
20 | TYPE_ARG_LIST@[22; 36) | ||
21 | L_ANGLE@[22; 23) "<" | ||
22 | ASSOC_TYPE_ARG@[23; 35) | ||
23 | NAME_REF@[23; 27) | ||
24 | IDENT@[23; 27) "Item" | ||
25 | EQ@[27; 28) "=" | ||
26 | PATH_TYPE@[28; 35) | ||
27 | PATH@[28; 35) | ||
28 | PATH_SEGMENT@[28; 35) | ||
29 | NAME_REF@[28; 31) | ||
30 | IDENT@[28; 31) "Foo" | ||
31 | TYPE_ARG_LIST@[31; 35) | ||
32 | L_ANGLE@[31; 32) "<" | ||
33 | LIFETIME_ARG@[32; 34) | ||
34 | LIFETIME@[32; 34) "\'a" | ||
35 | R_ANGLE@[34; 35) ">" | ||
36 | R_ANGLE@[35; 36) ">" | ||
37 | WHITESPACE@[36; 37) " " | ||
38 | PLUS@[37; 38) "+" | ||
39 | WHITESPACE@[38; 39) " " | ||
40 | TYPE_BOUND@[39; 41) | ||
41 | LIFETIME@[39; 41) "\'a" | ||
42 | SEMI@[41; 42) ";" | ||
43 | WHITESPACE@[42; 43) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0029_cast_expr.rs b/crates/ra_syntax/test_data/parser/inline/ok/0029_cast_expr.rs new file mode 100644 index 000000000..bfe8e4b36 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0029_cast_expr.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | fn foo() { | ||
2 | 82 as i32; | ||
3 | 81 as i8 + 1; | ||
4 | 79 as i16 - 1; | ||
5 | 0x36 as u8 <= 0x37; | ||
6 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0029_cast_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0029_cast_expr.txt new file mode 100644 index 000000000..11c14e3b4 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0029_cast_expr.txt | |||
@@ -0,0 +1,89 @@ | |||
1 | SOURCE_FILE@[0; 89) | ||
2 | FN_DEF@[0; 88) | ||
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; 88) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 15) "\n " | ||
14 | EXPR_STMT@[15; 25) | ||
15 | CAST_EXPR@[15; 24) | ||
16 | LITERAL@[15; 17) | ||
17 | INT_NUMBER@[15; 17) "82" | ||
18 | WHITESPACE@[17; 18) " " | ||
19 | AS_KW@[18; 20) "as" | ||
20 | WHITESPACE@[20; 21) " " | ||
21 | PATH_TYPE@[21; 24) | ||
22 | PATH@[21; 24) | ||
23 | PATH_SEGMENT@[21; 24) | ||
24 | NAME_REF@[21; 24) | ||
25 | IDENT@[21; 24) "i32" | ||
26 | SEMI@[24; 25) ";" | ||
27 | WHITESPACE@[25; 30) "\n " | ||
28 | EXPR_STMT@[30; 43) | ||
29 | BIN_EXPR@[30; 42) | ||
30 | CAST_EXPR@[30; 38) | ||
31 | LITERAL@[30; 32) | ||
32 | INT_NUMBER@[30; 32) "81" | ||
33 | WHITESPACE@[32; 33) " " | ||
34 | AS_KW@[33; 35) "as" | ||
35 | WHITESPACE@[35; 36) " " | ||
36 | PATH_TYPE@[36; 38) | ||
37 | PATH@[36; 38) | ||
38 | PATH_SEGMENT@[36; 38) | ||
39 | NAME_REF@[36; 38) | ||
40 | IDENT@[36; 38) "i8" | ||
41 | WHITESPACE@[38; 39) " " | ||
42 | PLUS@[39; 40) "+" | ||
43 | WHITESPACE@[40; 41) " " | ||
44 | LITERAL@[41; 42) | ||
45 | INT_NUMBER@[41; 42) "1" | ||
46 | SEMI@[42; 43) ";" | ||
47 | WHITESPACE@[43; 48) "\n " | ||
48 | EXPR_STMT@[48; 62) | ||
49 | BIN_EXPR@[48; 61) | ||
50 | CAST_EXPR@[48; 57) | ||
51 | LITERAL@[48; 50) | ||
52 | INT_NUMBER@[48; 50) "79" | ||
53 | WHITESPACE@[50; 51) " " | ||
54 | AS_KW@[51; 53) "as" | ||
55 | WHITESPACE@[53; 54) " " | ||
56 | PATH_TYPE@[54; 57) | ||
57 | PATH@[54; 57) | ||
58 | PATH_SEGMENT@[54; 57) | ||
59 | NAME_REF@[54; 57) | ||
60 | IDENT@[54; 57) "i16" | ||
61 | WHITESPACE@[57; 58) " " | ||
62 | MINUS@[58; 59) "-" | ||
63 | WHITESPACE@[59; 60) " " | ||
64 | LITERAL@[60; 61) | ||
65 | INT_NUMBER@[60; 61) "1" | ||
66 | SEMI@[61; 62) ";" | ||
67 | WHITESPACE@[62; 67) "\n " | ||
68 | EXPR_STMT@[67; 86) | ||
69 | BIN_EXPR@[67; 85) | ||
70 | CAST_EXPR@[67; 77) | ||
71 | LITERAL@[67; 71) | ||
72 | INT_NUMBER@[67; 71) "0x36" | ||
73 | WHITESPACE@[71; 72) " " | ||
74 | AS_KW@[72; 74) "as" | ||
75 | WHITESPACE@[74; 75) " " | ||
76 | PATH_TYPE@[75; 77) | ||
77 | PATH@[75; 77) | ||
78 | PATH_SEGMENT@[75; 77) | ||
79 | NAME_REF@[75; 77) | ||
80 | IDENT@[75; 77) "u8" | ||
81 | WHITESPACE@[77; 78) " " | ||
82 | LTEQ@[78; 80) "<=" | ||
83 | WHITESPACE@[80; 81) " " | ||
84 | LITERAL@[81; 85) | ||
85 | INT_NUMBER@[81; 85) "0x37" | ||
86 | SEMI@[85; 86) ";" | ||
87 | WHITESPACE@[86; 87) "\n" | ||
88 | R_CURLY@[87; 88) "}" | ||
89 | WHITESPACE@[88; 89) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0030_cond.rs b/crates/ra_syntax/test_data/parser/inline/ok/0030_cond.rs new file mode 100644 index 000000000..2552a2621 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0030_cond.rs | |||
@@ -0,0 +1,7 @@ | |||
1 | fn foo() { if let Some(_) = None {} } | ||
2 | fn bar() { | ||
3 | if let Some(_) | Some(_) = None {} | ||
4 | if let | Some(_) = None {} | ||
5 | while let Some(_) | Some(_) = None {} | ||
6 | while let | Some(_) = None {} | ||
7 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0030_cond.txt b/crates/ra_syntax/test_data/parser/inline/ok/0030_cond.txt new file mode 100644 index 000000000..1c9414b21 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0030_cond.txt | |||
@@ -0,0 +1,200 @@ | |||
1 | SOURCE_FILE@[0; 197) | ||
2 | FN_DEF@[0; 37) | ||
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; 37) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 11) " " | ||
14 | IF_EXPR@[11; 35) | ||
15 | IF_KW@[11; 13) "if" | ||
16 | WHITESPACE@[13; 14) " " | ||
17 | CONDITION@[14; 32) | ||
18 | LET_KW@[14; 17) "let" | ||
19 | WHITESPACE@[17; 18) " " | ||
20 | TUPLE_STRUCT_PAT@[18; 25) | ||
21 | PATH@[18; 22) | ||
22 | PATH_SEGMENT@[18; 22) | ||
23 | NAME_REF@[18; 22) | ||
24 | IDENT@[18; 22) "Some" | ||
25 | L_PAREN@[22; 23) "(" | ||
26 | PLACEHOLDER_PAT@[23; 24) | ||
27 | UNDERSCORE@[23; 24) "_" | ||
28 | R_PAREN@[24; 25) ")" | ||
29 | WHITESPACE@[25; 26) " " | ||
30 | EQ@[26; 27) "=" | ||
31 | WHITESPACE@[27; 28) " " | ||
32 | PATH_EXPR@[28; 32) | ||
33 | PATH@[28; 32) | ||
34 | PATH_SEGMENT@[28; 32) | ||
35 | NAME_REF@[28; 32) | ||
36 | IDENT@[28; 32) "None" | ||
37 | WHITESPACE@[32; 33) " " | ||
38 | BLOCK@[33; 35) | ||
39 | L_CURLY@[33; 34) "{" | ||
40 | R_CURLY@[34; 35) "}" | ||
41 | WHITESPACE@[35; 36) " " | ||
42 | R_CURLY@[36; 37) "}" | ||
43 | WHITESPACE@[37; 38) "\n" | ||
44 | FN_DEF@[38; 196) | ||
45 | FN_KW@[38; 40) "fn" | ||
46 | WHITESPACE@[40; 41) " " | ||
47 | NAME@[41; 44) | ||
48 | IDENT@[41; 44) "bar" | ||
49 | PARAM_LIST@[44; 46) | ||
50 | L_PAREN@[44; 45) "(" | ||
51 | R_PAREN@[45; 46) ")" | ||
52 | WHITESPACE@[46; 47) " " | ||
53 | BLOCK@[47; 196) | ||
54 | L_CURLY@[47; 48) "{" | ||
55 | WHITESPACE@[48; 53) "\n " | ||
56 | EXPR_STMT@[53; 87) | ||
57 | IF_EXPR@[53; 87) | ||
58 | IF_KW@[53; 55) "if" | ||
59 | WHITESPACE@[55; 56) " " | ||
60 | CONDITION@[56; 84) | ||
61 | LET_KW@[56; 59) "let" | ||
62 | WHITESPACE@[59; 60) " " | ||
63 | TUPLE_STRUCT_PAT@[60; 67) | ||
64 | PATH@[60; 64) | ||
65 | PATH_SEGMENT@[60; 64) | ||
66 | NAME_REF@[60; 64) | ||
67 | IDENT@[60; 64) "Some" | ||
68 | L_PAREN@[64; 65) "(" | ||
69 | PLACEHOLDER_PAT@[65; 66) | ||
70 | UNDERSCORE@[65; 66) "_" | ||
71 | R_PAREN@[66; 67) ")" | ||
72 | WHITESPACE@[67; 68) " " | ||
73 | PIPE@[68; 69) "|" | ||
74 | WHITESPACE@[69; 70) " " | ||
75 | TUPLE_STRUCT_PAT@[70; 77) | ||
76 | PATH@[70; 74) | ||
77 | PATH_SEGMENT@[70; 74) | ||
78 | NAME_REF@[70; 74) | ||
79 | IDENT@[70; 74) "Some" | ||
80 | L_PAREN@[74; 75) "(" | ||
81 | PLACEHOLDER_PAT@[75; 76) | ||
82 | UNDERSCORE@[75; 76) "_" | ||
83 | R_PAREN@[76; 77) ")" | ||
84 | WHITESPACE@[77; 78) " " | ||
85 | EQ@[78; 79) "=" | ||
86 | WHITESPACE@[79; 80) " " | ||
87 | PATH_EXPR@[80; 84) | ||
88 | PATH@[80; 84) | ||
89 | PATH_SEGMENT@[80; 84) | ||
90 | NAME_REF@[80; 84) | ||
91 | IDENT@[80; 84) "None" | ||
92 | WHITESPACE@[84; 85) " " | ||
93 | BLOCK@[85; 87) | ||
94 | L_CURLY@[85; 86) "{" | ||
95 | R_CURLY@[86; 87) "}" | ||
96 | WHITESPACE@[87; 92) "\n " | ||
97 | EXPR_STMT@[92; 118) | ||
98 | IF_EXPR@[92; 118) | ||
99 | IF_KW@[92; 94) "if" | ||
100 | WHITESPACE@[94; 95) " " | ||
101 | CONDITION@[95; 115) | ||
102 | LET_KW@[95; 98) "let" | ||
103 | WHITESPACE@[98; 99) " " | ||
104 | PIPE@[99; 100) "|" | ||
105 | WHITESPACE@[100; 101) " " | ||
106 | TUPLE_STRUCT_PAT@[101; 108) | ||
107 | PATH@[101; 105) | ||
108 | PATH_SEGMENT@[101; 105) | ||
109 | NAME_REF@[101; 105) | ||
110 | IDENT@[101; 105) "Some" | ||
111 | L_PAREN@[105; 106) "(" | ||
112 | PLACEHOLDER_PAT@[106; 107) | ||
113 | UNDERSCORE@[106; 107) "_" | ||
114 | R_PAREN@[107; 108) ")" | ||
115 | WHITESPACE@[108; 109) " " | ||
116 | EQ@[109; 110) "=" | ||
117 | WHITESPACE@[110; 111) " " | ||
118 | PATH_EXPR@[111; 115) | ||
119 | PATH@[111; 115) | ||
120 | PATH_SEGMENT@[111; 115) | ||
121 | NAME_REF@[111; 115) | ||
122 | IDENT@[111; 115) "None" | ||
123 | WHITESPACE@[115; 116) " " | ||
124 | BLOCK@[116; 118) | ||
125 | L_CURLY@[116; 117) "{" | ||
126 | R_CURLY@[117; 118) "}" | ||
127 | WHITESPACE@[118; 123) "\n " | ||
128 | EXPR_STMT@[123; 160) | ||
129 | WHILE_EXPR@[123; 160) | ||
130 | WHILE_KW@[123; 128) "while" | ||
131 | WHITESPACE@[128; 129) " " | ||
132 | CONDITION@[129; 157) | ||
133 | LET_KW@[129; 132) "let" | ||
134 | WHITESPACE@[132; 133) " " | ||
135 | TUPLE_STRUCT_PAT@[133; 140) | ||
136 | PATH@[133; 137) | ||
137 | PATH_SEGMENT@[133; 137) | ||
138 | NAME_REF@[133; 137) | ||
139 | IDENT@[133; 137) "Some" | ||
140 | L_PAREN@[137; 138) "(" | ||
141 | PLACEHOLDER_PAT@[138; 139) | ||
142 | UNDERSCORE@[138; 139) "_" | ||
143 | R_PAREN@[139; 140) ")" | ||
144 | WHITESPACE@[140; 141) " " | ||
145 | PIPE@[141; 142) "|" | ||
146 | WHITESPACE@[142; 143) " " | ||
147 | TUPLE_STRUCT_PAT@[143; 150) | ||
148 | PATH@[143; 147) | ||
149 | PATH_SEGMENT@[143; 147) | ||
150 | NAME_REF@[143; 147) | ||
151 | IDENT@[143; 147) "Some" | ||
152 | L_PAREN@[147; 148) "(" | ||
153 | PLACEHOLDER_PAT@[148; 149) | ||
154 | UNDERSCORE@[148; 149) "_" | ||
155 | R_PAREN@[149; 150) ")" | ||
156 | WHITESPACE@[150; 151) " " | ||
157 | EQ@[151; 152) "=" | ||
158 | WHITESPACE@[152; 153) " " | ||
159 | PATH_EXPR@[153; 157) | ||
160 | PATH@[153; 157) | ||
161 | PATH_SEGMENT@[153; 157) | ||
162 | NAME_REF@[153; 157) | ||
163 | IDENT@[153; 157) "None" | ||
164 | WHITESPACE@[157; 158) " " | ||
165 | BLOCK@[158; 160) | ||
166 | L_CURLY@[158; 159) "{" | ||
167 | R_CURLY@[159; 160) "}" | ||
168 | WHITESPACE@[160; 165) "\n " | ||
169 | WHILE_EXPR@[165; 194) | ||
170 | WHILE_KW@[165; 170) "while" | ||
171 | WHITESPACE@[170; 171) " " | ||
172 | CONDITION@[171; 191) | ||
173 | LET_KW@[171; 174) "let" | ||
174 | WHITESPACE@[174; 175) " " | ||
175 | PIPE@[175; 176) "|" | ||
176 | WHITESPACE@[176; 177) " " | ||
177 | TUPLE_STRUCT_PAT@[177; 184) | ||
178 | PATH@[177; 181) | ||
179 | PATH_SEGMENT@[177; 181) | ||
180 | NAME_REF@[177; 181) | ||
181 | IDENT@[177; 181) "Some" | ||
182 | L_PAREN@[181; 182) "(" | ||
183 | PLACEHOLDER_PAT@[182; 183) | ||
184 | UNDERSCORE@[182; 183) "_" | ||
185 | R_PAREN@[183; 184) ")" | ||
186 | WHITESPACE@[184; 185) " " | ||
187 | EQ@[185; 186) "=" | ||
188 | WHITESPACE@[186; 187) " " | ||
189 | PATH_EXPR@[187; 191) | ||
190 | PATH@[187; 191) | ||
191 | PATH_SEGMENT@[187; 191) | ||
192 | NAME_REF@[187; 191) | ||
193 | IDENT@[187; 191) "None" | ||
194 | WHITESPACE@[191; 192) " " | ||
195 | BLOCK@[192; 194) | ||
196 | L_CURLY@[192; 193) "{" | ||
197 | R_CURLY@[193; 194) "}" | ||
198 | WHITESPACE@[194; 195) "\n" | ||
199 | R_CURLY@[195; 196) "}" | ||
200 | WHITESPACE@[196; 197) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0031_while_expr.rs b/crates/ra_syntax/test_data/parser/inline/ok/0031_while_expr.rs new file mode 100644 index 000000000..293046a04 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0031_while_expr.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn foo() { | ||
2 | while true {}; | ||
3 | while let Some(x) = it.next() {}; | ||
4 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0031_while_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0031_while_expr.txt new file mode 100644 index 000000000..a772117a1 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0031_while_expr.txt | |||
@@ -0,0 +1,66 @@ | |||
1 | SOURCE_FILE@[0; 70) | ||
2 | FN_DEF@[0; 69) | ||
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; 69) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 15) "\n " | ||
14 | EXPR_STMT@[15; 29) | ||
15 | WHILE_EXPR@[15; 28) | ||
16 | WHILE_KW@[15; 20) "while" | ||
17 | WHITESPACE@[20; 21) " " | ||
18 | CONDITION@[21; 25) | ||
19 | LITERAL@[21; 25) | ||
20 | TRUE_KW@[21; 25) "true" | ||
21 | WHITESPACE@[25; 26) " " | ||
22 | BLOCK@[26; 28) | ||
23 | L_CURLY@[26; 27) "{" | ||
24 | R_CURLY@[27; 28) "}" | ||
25 | SEMI@[28; 29) ";" | ||
26 | WHITESPACE@[29; 34) "\n " | ||
27 | EXPR_STMT@[34; 67) | ||
28 | WHILE_EXPR@[34; 66) | ||
29 | WHILE_KW@[34; 39) "while" | ||
30 | WHITESPACE@[39; 40) " " | ||
31 | CONDITION@[40; 63) | ||
32 | LET_KW@[40; 43) "let" | ||
33 | WHITESPACE@[43; 44) " " | ||
34 | TUPLE_STRUCT_PAT@[44; 51) | ||
35 | PATH@[44; 48) | ||
36 | PATH_SEGMENT@[44; 48) | ||
37 | NAME_REF@[44; 48) | ||
38 | IDENT@[44; 48) "Some" | ||
39 | L_PAREN@[48; 49) "(" | ||
40 | BIND_PAT@[49; 50) | ||
41 | NAME@[49; 50) | ||
42 | IDENT@[49; 50) "x" | ||
43 | R_PAREN@[50; 51) ")" | ||
44 | WHITESPACE@[51; 52) " " | ||
45 | EQ@[52; 53) "=" | ||
46 | WHITESPACE@[53; 54) " " | ||
47 | METHOD_CALL_EXPR@[54; 63) | ||
48 | PATH_EXPR@[54; 56) | ||
49 | PATH@[54; 56) | ||
50 | PATH_SEGMENT@[54; 56) | ||
51 | NAME_REF@[54; 56) | ||
52 | IDENT@[54; 56) "it" | ||
53 | DOT@[56; 57) "." | ||
54 | NAME_REF@[57; 61) | ||
55 | IDENT@[57; 61) "next" | ||
56 | ARG_LIST@[61; 63) | ||
57 | L_PAREN@[61; 62) "(" | ||
58 | R_PAREN@[62; 63) ")" | ||
59 | WHITESPACE@[63; 64) " " | ||
60 | BLOCK@[64; 66) | ||
61 | L_CURLY@[64; 65) "{" | ||
62 | R_CURLY@[65; 66) "}" | ||
63 | SEMI@[66; 67) ";" | ||
64 | WHITESPACE@[67; 68) "\n" | ||
65 | R_CURLY@[68; 69) "}" | ||
66 | WHITESPACE@[69; 70) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0032_fn_pointer_type.rs b/crates/ra_syntax/test_data/parser/inline/ok/0032_fn_pointer_type.rs new file mode 100644 index 000000000..9493da83d --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0032_fn_pointer_type.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | type A = fn(); | ||
2 | type B = unsafe fn(); | ||
3 | type C = unsafe extern "C" fn(); | ||
4 | type D = extern "C" fn ( u8 , ... ) -> u8; | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0032_fn_pointer_type.txt b/crates/ra_syntax/test_data/parser/inline/ok/0032_fn_pointer_type.txt new file mode 100644 index 000000000..a0a8aea76 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0032_fn_pointer_type.txt | |||
@@ -0,0 +1,97 @@ | |||
1 | SOURCE_FILE@[0; 113) | ||
2 | TYPE_ALIAS_DEF@[0; 14) | ||
3 | TYPE_KW@[0; 4) "type" | ||
4 | WHITESPACE@[4; 5) " " | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "A" | ||
7 | WHITESPACE@[6; 7) " " | ||
8 | EQ@[7; 8) "=" | ||
9 | WHITESPACE@[8; 9) " " | ||
10 | FN_POINTER_TYPE@[9; 13) | ||
11 | FN_KW@[9; 11) "fn" | ||
12 | PARAM_LIST@[11; 13) | ||
13 | L_PAREN@[11; 12) "(" | ||
14 | R_PAREN@[12; 13) ")" | ||
15 | SEMI@[13; 14) ";" | ||
16 | WHITESPACE@[14; 15) "\n" | ||
17 | TYPE_ALIAS_DEF@[15; 36) | ||
18 | TYPE_KW@[15; 19) "type" | ||
19 | WHITESPACE@[19; 20) " " | ||
20 | NAME@[20; 21) | ||
21 | IDENT@[20; 21) "B" | ||
22 | WHITESPACE@[21; 22) " " | ||
23 | EQ@[22; 23) "=" | ||
24 | WHITESPACE@[23; 24) " " | ||
25 | FN_POINTER_TYPE@[24; 35) | ||
26 | UNSAFE_KW@[24; 30) "unsafe" | ||
27 | WHITESPACE@[30; 31) " " | ||
28 | FN_KW@[31; 33) "fn" | ||
29 | PARAM_LIST@[33; 35) | ||
30 | L_PAREN@[33; 34) "(" | ||
31 | R_PAREN@[34; 35) ")" | ||
32 | SEMI@[35; 36) ";" | ||
33 | WHITESPACE@[36; 37) "\n" | ||
34 | TYPE_ALIAS_DEF@[37; 69) | ||
35 | TYPE_KW@[37; 41) "type" | ||
36 | WHITESPACE@[41; 42) " " | ||
37 | NAME@[42; 43) | ||
38 | IDENT@[42; 43) "C" | ||
39 | WHITESPACE@[43; 44) " " | ||
40 | EQ@[44; 45) "=" | ||
41 | WHITESPACE@[45; 46) " " | ||
42 | FN_POINTER_TYPE@[46; 68) | ||
43 | UNSAFE_KW@[46; 52) "unsafe" | ||
44 | WHITESPACE@[52; 53) " " | ||
45 | ABI@[53; 63) | ||
46 | EXTERN_KW@[53; 59) "extern" | ||
47 | WHITESPACE@[59; 60) " " | ||
48 | STRING@[60; 63) "\"C\"" | ||
49 | WHITESPACE@[63; 64) " " | ||
50 | FN_KW@[64; 66) "fn" | ||
51 | PARAM_LIST@[66; 68) | ||
52 | L_PAREN@[66; 67) "(" | ||
53 | R_PAREN@[67; 68) ")" | ||
54 | SEMI@[68; 69) ";" | ||
55 | WHITESPACE@[69; 70) "\n" | ||
56 | TYPE_ALIAS_DEF@[70; 112) | ||
57 | TYPE_KW@[70; 74) "type" | ||
58 | WHITESPACE@[74; 75) " " | ||
59 | NAME@[75; 76) | ||
60 | IDENT@[75; 76) "D" | ||
61 | WHITESPACE@[76; 77) " " | ||
62 | EQ@[77; 78) "=" | ||
63 | WHITESPACE@[78; 79) " " | ||
64 | FN_POINTER_TYPE@[79; 111) | ||
65 | ABI@[79; 89) | ||
66 | EXTERN_KW@[79; 85) "extern" | ||
67 | WHITESPACE@[85; 86) " " | ||
68 | STRING@[86; 89) "\"C\"" | ||
69 | WHITESPACE@[89; 90) " " | ||
70 | FN_KW@[90; 92) "fn" | ||
71 | WHITESPACE@[92; 93) " " | ||
72 | PARAM_LIST@[93; 105) | ||
73 | L_PAREN@[93; 94) "(" | ||
74 | WHITESPACE@[94; 95) " " | ||
75 | PARAM@[95; 97) | ||
76 | PATH_TYPE@[95; 97) | ||
77 | PATH@[95; 97) | ||
78 | PATH_SEGMENT@[95; 97) | ||
79 | NAME_REF@[95; 97) | ||
80 | IDENT@[95; 97) "u8" | ||
81 | WHITESPACE@[97; 98) " " | ||
82 | COMMA@[98; 99) "," | ||
83 | WHITESPACE@[99; 100) " " | ||
84 | DOTDOTDOT@[100; 103) "..." | ||
85 | WHITESPACE@[103; 104) " " | ||
86 | R_PAREN@[104; 105) ")" | ||
87 | WHITESPACE@[105; 106) " " | ||
88 | RET_TYPE@[106; 111) | ||
89 | THIN_ARROW@[106; 108) "->" | ||
90 | WHITESPACE@[108; 109) " " | ||
91 | PATH_TYPE@[109; 111) | ||
92 | PATH@[109; 111) | ||
93 | PATH_SEGMENT@[109; 111) | ||
94 | NAME_REF@[109; 111) | ||
95 | IDENT@[109; 111) "u8" | ||
96 | SEMI@[111; 112) ";" | ||
97 | WHITESPACE@[112; 113) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0033_reference_type;.rs b/crates/ra_syntax/test_data/parser/inline/ok/0033_reference_type;.rs new file mode 100644 index 000000000..3ac0badab --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0033_reference_type;.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | type A = &(); | ||
2 | type B = &'static (); | ||
3 | type C = &mut (); | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0033_reference_type;.txt b/crates/ra_syntax/test_data/parser/inline/ok/0033_reference_type;.txt new file mode 100644 index 000000000..7642ea659 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0033_reference_type;.txt | |||
@@ -0,0 +1,50 @@ | |||
1 | SOURCE_FILE@[0; 54) | ||
2 | TYPE_ALIAS_DEF@[0; 13) | ||
3 | TYPE_KW@[0; 4) "type" | ||
4 | WHITESPACE@[4; 5) " " | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "A" | ||
7 | WHITESPACE@[6; 7) " " | ||
8 | EQ@[7; 8) "=" | ||
9 | WHITESPACE@[8; 9) " " | ||
10 | REFERENCE_TYPE@[9; 12) | ||
11 | AMP@[9; 10) "&" | ||
12 | TUPLE_TYPE@[10; 12) | ||
13 | L_PAREN@[10; 11) "(" | ||
14 | R_PAREN@[11; 12) ")" | ||
15 | SEMI@[12; 13) ";" | ||
16 | WHITESPACE@[13; 14) "\n" | ||
17 | TYPE_ALIAS_DEF@[14; 35) | ||
18 | TYPE_KW@[14; 18) "type" | ||
19 | WHITESPACE@[18; 19) " " | ||
20 | NAME@[19; 20) | ||
21 | IDENT@[19; 20) "B" | ||
22 | WHITESPACE@[20; 21) " " | ||
23 | EQ@[21; 22) "=" | ||
24 | WHITESPACE@[22; 23) " " | ||
25 | REFERENCE_TYPE@[23; 34) | ||
26 | AMP@[23; 24) "&" | ||
27 | LIFETIME@[24; 31) "\'static" | ||
28 | WHITESPACE@[31; 32) " " | ||
29 | TUPLE_TYPE@[32; 34) | ||
30 | L_PAREN@[32; 33) "(" | ||
31 | R_PAREN@[33; 34) ")" | ||
32 | SEMI@[34; 35) ";" | ||
33 | WHITESPACE@[35; 36) "\n" | ||
34 | TYPE_ALIAS_DEF@[36; 53) | ||
35 | TYPE_KW@[36; 40) "type" | ||
36 | WHITESPACE@[40; 41) " " | ||
37 | NAME@[41; 42) | ||
38 | IDENT@[41; 42) "C" | ||
39 | WHITESPACE@[42; 43) " " | ||
40 | EQ@[43; 44) "=" | ||
41 | WHITESPACE@[44; 45) " " | ||
42 | REFERENCE_TYPE@[45; 52) | ||
43 | AMP@[45; 46) "&" | ||
44 | MUT_KW@[46; 49) "mut" | ||
45 | WHITESPACE@[49; 50) " " | ||
46 | TUPLE_TYPE@[50; 52) | ||
47 | L_PAREN@[50; 51) "(" | ||
48 | R_PAREN@[51; 52) ")" | ||
49 | SEMI@[52; 53) ";" | ||
50 | WHITESPACE@[53; 54) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0034_break_expr.rs b/crates/ra_syntax/test_data/parser/inline/ok/0034_break_expr.rs new file mode 100644 index 000000000..1b4094636 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0034_break_expr.rs | |||
@@ -0,0 +1,8 @@ | |||
1 | fn foo() { | ||
2 | loop { | ||
3 | break; | ||
4 | break 'l; | ||
5 | break 92; | ||
6 | break 'l 92; | ||
7 | } | ||
8 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0034_break_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0034_break_expr.txt new file mode 100644 index 000000000..4ece7cd7e --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0034_break_expr.txt | |||
@@ -0,0 +1,53 @@ | |||
1 | SOURCE_FILE@[0; 102) | ||
2 | FN_DEF@[0; 101) | ||
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; 101) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 15) "\n " | ||
14 | LOOP_EXPR@[15; 99) | ||
15 | LOOP_KW@[15; 19) "loop" | ||
16 | WHITESPACE@[19; 20) " " | ||
17 | BLOCK@[20; 99) | ||
18 | L_CURLY@[20; 21) "{" | ||
19 | WHITESPACE@[21; 30) "\n " | ||
20 | EXPR_STMT@[30; 36) | ||
21 | BREAK_EXPR@[30; 35) | ||
22 | BREAK_KW@[30; 35) "break" | ||
23 | SEMI@[35; 36) ";" | ||
24 | WHITESPACE@[36; 45) "\n " | ||
25 | EXPR_STMT@[45; 54) | ||
26 | BREAK_EXPR@[45; 53) | ||
27 | BREAK_KW@[45; 50) "break" | ||
28 | WHITESPACE@[50; 51) " " | ||
29 | LIFETIME@[51; 53) "\'l" | ||
30 | SEMI@[53; 54) ";" | ||
31 | WHITESPACE@[54; 63) "\n " | ||
32 | EXPR_STMT@[63; 72) | ||
33 | BREAK_EXPR@[63; 71) | ||
34 | BREAK_KW@[63; 68) "break" | ||
35 | WHITESPACE@[68; 69) " " | ||
36 | LITERAL@[69; 71) | ||
37 | INT_NUMBER@[69; 71) "92" | ||
38 | SEMI@[71; 72) ";" | ||
39 | WHITESPACE@[72; 81) "\n " | ||
40 | EXPR_STMT@[81; 93) | ||
41 | BREAK_EXPR@[81; 92) | ||
42 | BREAK_KW@[81; 86) "break" | ||
43 | WHITESPACE@[86; 87) " " | ||
44 | LIFETIME@[87; 89) "\'l" | ||
45 | WHITESPACE@[89; 90) " " | ||
46 | LITERAL@[90; 92) | ||
47 | INT_NUMBER@[90; 92) "92" | ||
48 | SEMI@[92; 93) ";" | ||
49 | WHITESPACE@[93; 98) "\n " | ||
50 | R_CURLY@[98; 99) "}" | ||
51 | WHITESPACE@[99; 100) "\n" | ||
52 | R_CURLY@[100; 101) "}" | ||
53 | WHITESPACE@[101; 102) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0036_unsafe_extern_fn.rs b/crates/ra_syntax/test_data/parser/inline/ok/0036_unsafe_extern_fn.rs new file mode 100644 index 000000000..1295c2cd2 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0036_unsafe_extern_fn.rs | |||
@@ -0,0 +1 @@ | |||
unsafe extern "C" fn foo() {} | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0036_unsafe_extern_fn.txt b/crates/ra_syntax/test_data/parser/inline/ok/0036_unsafe_extern_fn.txt new file mode 100644 index 000000000..b5b09b2e5 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0036_unsafe_extern_fn.txt | |||
@@ -0,0 +1,21 @@ | |||
1 | SOURCE_FILE@[0; 30) | ||
2 | FN_DEF@[0; 29) | ||
3 | UNSAFE_KW@[0; 6) "unsafe" | ||
4 | WHITESPACE@[6; 7) " " | ||
5 | ABI@[7; 17) | ||
6 | EXTERN_KW@[7; 13) "extern" | ||
7 | WHITESPACE@[13; 14) " " | ||
8 | STRING@[14; 17) "\"C\"" | ||
9 | WHITESPACE@[17; 18) " " | ||
10 | FN_KW@[18; 20) "fn" | ||
11 | WHITESPACE@[20; 21) " " | ||
12 | NAME@[21; 24) | ||
13 | IDENT@[21; 24) "foo" | ||
14 | PARAM_LIST@[24; 26) | ||
15 | L_PAREN@[24; 25) "(" | ||
16 | R_PAREN@[25; 26) ")" | ||
17 | WHITESPACE@[26; 27) " " | ||
18 | BLOCK@[27; 29) | ||
19 | L_CURLY@[27; 28) "{" | ||
20 | R_CURLY@[28; 29) "}" | ||
21 | WHITESPACE@[29; 30) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0037_qual_paths.rs b/crates/ra_syntax/test_data/parser/inline/ok/0037_qual_paths.rs new file mode 100644 index 000000000..d140692e2 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0037_qual_paths.rs | |||
@@ -0,0 +1,2 @@ | |||
1 | type X = <A as B>::Output; | ||
2 | fn foo() { <usize as Default>::default(); } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0037_qual_paths.txt b/crates/ra_syntax/test_data/parser/inline/ok/0037_qual_paths.txt new file mode 100644 index 000000000..9bfddf5d2 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0037_qual_paths.txt | |||
@@ -0,0 +1,78 @@ | |||
1 | SOURCE_FILE@[0; 71) | ||
2 | TYPE_ALIAS_DEF@[0; 26) | ||
3 | TYPE_KW@[0; 4) "type" | ||
4 | WHITESPACE@[4; 5) " " | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "X" | ||
7 | WHITESPACE@[6; 7) " " | ||
8 | EQ@[7; 8) "=" | ||
9 | WHITESPACE@[8; 9) " " | ||
10 | PATH_TYPE@[9; 25) | ||
11 | PATH@[9; 25) | ||
12 | PATH@[9; 17) | ||
13 | PATH_SEGMENT@[9; 17) | ||
14 | L_ANGLE@[9; 10) "<" | ||
15 | PATH_TYPE@[10; 11) | ||
16 | PATH@[10; 11) | ||
17 | PATH_SEGMENT@[10; 11) | ||
18 | NAME_REF@[10; 11) | ||
19 | IDENT@[10; 11) "A" | ||
20 | WHITESPACE@[11; 12) " " | ||
21 | AS_KW@[12; 14) "as" | ||
22 | WHITESPACE@[14; 15) " " | ||
23 | PATH_TYPE@[15; 16) | ||
24 | PATH@[15; 16) | ||
25 | PATH_SEGMENT@[15; 16) | ||
26 | NAME_REF@[15; 16) | ||
27 | IDENT@[15; 16) "B" | ||
28 | R_ANGLE@[16; 17) ">" | ||
29 | COLONCOLON@[17; 19) "::" | ||
30 | PATH_SEGMENT@[19; 25) | ||
31 | NAME_REF@[19; 25) | ||
32 | IDENT@[19; 25) "Output" | ||
33 | SEMI@[25; 26) ";" | ||
34 | WHITESPACE@[26; 27) "\n" | ||
35 | FN_DEF@[27; 70) | ||
36 | FN_KW@[27; 29) "fn" | ||
37 | WHITESPACE@[29; 30) " " | ||
38 | NAME@[30; 33) | ||
39 | IDENT@[30; 33) "foo" | ||
40 | PARAM_LIST@[33; 35) | ||
41 | L_PAREN@[33; 34) "(" | ||
42 | R_PAREN@[34; 35) ")" | ||
43 | WHITESPACE@[35; 36) " " | ||
44 | BLOCK@[36; 70) | ||
45 | L_CURLY@[36; 37) "{" | ||
46 | WHITESPACE@[37; 38) " " | ||
47 | EXPR_STMT@[38; 68) | ||
48 | CALL_EXPR@[38; 67) | ||
49 | PATH_EXPR@[38; 65) | ||
50 | PATH@[38; 65) | ||
51 | PATH@[38; 56) | ||
52 | PATH_SEGMENT@[38; 56) | ||
53 | L_ANGLE@[38; 39) "<" | ||
54 | PATH_TYPE@[39; 44) | ||
55 | PATH@[39; 44) | ||
56 | PATH_SEGMENT@[39; 44) | ||
57 | NAME_REF@[39; 44) | ||
58 | IDENT@[39; 44) "usize" | ||
59 | WHITESPACE@[44; 45) " " | ||
60 | AS_KW@[45; 47) "as" | ||
61 | WHITESPACE@[47; 48) " " | ||
62 | PATH_TYPE@[48; 55) | ||
63 | PATH@[48; 55) | ||
64 | PATH_SEGMENT@[48; 55) | ||
65 | NAME_REF@[48; 55) | ||
66 | IDENT@[48; 55) "Default" | ||
67 | R_ANGLE@[55; 56) ">" | ||
68 | COLONCOLON@[56; 58) "::" | ||
69 | PATH_SEGMENT@[58; 65) | ||
70 | NAME_REF@[58; 65) | ||
71 | IDENT@[58; 65) "default" | ||
72 | ARG_LIST@[65; 67) | ||
73 | L_PAREN@[65; 66) "(" | ||
74 | R_PAREN@[66; 67) ")" | ||
75 | SEMI@[67; 68) ";" | ||
76 | WHITESPACE@[68; 69) " " | ||
77 | R_CURLY@[69; 70) "}" | ||
78 | WHITESPACE@[70; 71) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0038_full_range_expr.rs b/crates/ra_syntax/test_data/parser/inline/ok/0038_full_range_expr.rs new file mode 100644 index 000000000..ae21ad94c --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0038_full_range_expr.rs | |||
@@ -0,0 +1 @@ | |||
fn foo() { xs[..]; } | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0038_full_range_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0038_full_range_expr.txt new file mode 100644 index 000000000..477c645d1 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0038_full_range_expr.txt | |||
@@ -0,0 +1,28 @@ | |||
1 | SOURCE_FILE@[0; 21) | ||
2 | FN_DEF@[0; 20) | ||
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; 20) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 11) " " | ||
14 | EXPR_STMT@[11; 18) | ||
15 | INDEX_EXPR@[11; 17) | ||
16 | PATH_EXPR@[11; 13) | ||
17 | PATH@[11; 13) | ||
18 | PATH_SEGMENT@[11; 13) | ||
19 | NAME_REF@[11; 13) | ||
20 | IDENT@[11; 13) "xs" | ||
21 | L_BRACK@[13; 14) "[" | ||
22 | RANGE_EXPR@[14; 16) | ||
23 | DOTDOT@[14; 16) ".." | ||
24 | R_BRACK@[16; 17) "]" | ||
25 | SEMI@[17; 18) ";" | ||
26 | WHITESPACE@[18; 19) " " | ||
27 | R_CURLY@[19; 20) "}" | ||
28 | WHITESPACE@[20; 21) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0039_type_arg.rs b/crates/ra_syntax/test_data/parser/inline/ok/0039_type_arg.rs new file mode 100644 index 000000000..385c43131 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0039_type_arg.rs | |||
@@ -0,0 +1 @@ | |||
type A = B<'static, i32, Item=u64>; | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0039_type_arg.txt b/crates/ra_syntax/test_data/parser/inline/ok/0039_type_arg.txt new file mode 100644 index 000000000..4786bf77a --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0039_type_arg.txt | |||
@@ -0,0 +1,40 @@ | |||
1 | SOURCE_FILE@[0; 36) | ||
2 | TYPE_ALIAS_DEF@[0; 35) | ||
3 | TYPE_KW@[0; 4) "type" | ||
4 | WHITESPACE@[4; 5) " " | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "A" | ||
7 | WHITESPACE@[6; 7) " " | ||
8 | EQ@[7; 8) "=" | ||
9 | WHITESPACE@[8; 9) " " | ||
10 | PATH_TYPE@[9; 34) | ||
11 | PATH@[9; 34) | ||
12 | PATH_SEGMENT@[9; 34) | ||
13 | NAME_REF@[9; 10) | ||
14 | IDENT@[9; 10) "B" | ||
15 | TYPE_ARG_LIST@[10; 34) | ||
16 | L_ANGLE@[10; 11) "<" | ||
17 | LIFETIME_ARG@[11; 18) | ||
18 | LIFETIME@[11; 18) "\'static" | ||
19 | COMMA@[18; 19) "," | ||
20 | WHITESPACE@[19; 20) " " | ||
21 | TYPE_ARG@[20; 23) | ||
22 | PATH_TYPE@[20; 23) | ||
23 | PATH@[20; 23) | ||
24 | PATH_SEGMENT@[20; 23) | ||
25 | NAME_REF@[20; 23) | ||
26 | IDENT@[20; 23) "i32" | ||
27 | COMMA@[23; 24) "," | ||
28 | WHITESPACE@[24; 25) " " | ||
29 | ASSOC_TYPE_ARG@[25; 33) | ||
30 | NAME_REF@[25; 29) | ||
31 | IDENT@[25; 29) "Item" | ||
32 | EQ@[29; 30) "=" | ||
33 | PATH_TYPE@[30; 33) | ||
34 | PATH@[30; 33) | ||
35 | PATH_SEGMENT@[30; 33) | ||
36 | NAME_REF@[30; 33) | ||
37 | IDENT@[30; 33) "u64" | ||
38 | R_ANGLE@[33; 34) ">" | ||
39 | SEMI@[34; 35) ";" | ||
40 | WHITESPACE@[35; 36) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0040_crate_keyword_vis.rs b/crates/ra_syntax/test_data/parser/inline/ok/0040_crate_keyword_vis.rs new file mode 100644 index 000000000..e2b5f2161 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0040_crate_keyword_vis.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | crate fn main() { } | ||
2 | struct S { crate field: u32 } | ||
3 | struct T(crate u32); | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0040_crate_keyword_vis.txt b/crates/ra_syntax/test_data/parser/inline/ok/0040_crate_keyword_vis.txt new file mode 100644 index 000000000..fb8246174 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0040_crate_keyword_vis.txt | |||
@@ -0,0 +1,62 @@ | |||
1 | SOURCE_FILE@[0; 71) | ||
2 | FN_DEF@[0; 19) | ||
3 | VISIBILITY@[0; 5) | ||
4 | CRATE_KW@[0; 5) "crate" | ||
5 | WHITESPACE@[5; 6) " " | ||
6 | FN_KW@[6; 8) "fn" | ||
7 | WHITESPACE@[8; 9) " " | ||
8 | NAME@[9; 13) | ||
9 | IDENT@[9; 13) "main" | ||
10 | PARAM_LIST@[13; 15) | ||
11 | L_PAREN@[13; 14) "(" | ||
12 | R_PAREN@[14; 15) ")" | ||
13 | WHITESPACE@[15; 16) " " | ||
14 | BLOCK@[16; 19) | ||
15 | L_CURLY@[16; 17) "{" | ||
16 | WHITESPACE@[17; 18) " " | ||
17 | R_CURLY@[18; 19) "}" | ||
18 | WHITESPACE@[19; 20) "\n" | ||
19 | STRUCT_DEF@[20; 49) | ||
20 | STRUCT_KW@[20; 26) "struct" | ||
21 | WHITESPACE@[26; 27) " " | ||
22 | NAME@[27; 28) | ||
23 | IDENT@[27; 28) "S" | ||
24 | WHITESPACE@[28; 29) " " | ||
25 | NAMED_FIELD_DEF_LIST@[29; 49) | ||
26 | L_CURLY@[29; 30) "{" | ||
27 | WHITESPACE@[30; 31) " " | ||
28 | NAMED_FIELD_DEF@[31; 47) | ||
29 | VISIBILITY@[31; 36) | ||
30 | CRATE_KW@[31; 36) "crate" | ||
31 | WHITESPACE@[36; 37) " " | ||
32 | NAME@[37; 42) | ||
33 | IDENT@[37; 42) "field" | ||
34 | COLON@[42; 43) ":" | ||
35 | WHITESPACE@[43; 44) " " | ||
36 | PATH_TYPE@[44; 47) | ||
37 | PATH@[44; 47) | ||
38 | PATH_SEGMENT@[44; 47) | ||
39 | NAME_REF@[44; 47) | ||
40 | IDENT@[44; 47) "u32" | ||
41 | WHITESPACE@[47; 48) " " | ||
42 | R_CURLY@[48; 49) "}" | ||
43 | WHITESPACE@[49; 50) "\n" | ||
44 | STRUCT_DEF@[50; 70) | ||
45 | STRUCT_KW@[50; 56) "struct" | ||
46 | WHITESPACE@[56; 57) " " | ||
47 | NAME@[57; 58) | ||
48 | IDENT@[57; 58) "T" | ||
49 | POS_FIELD_DEF_LIST@[58; 69) | ||
50 | L_PAREN@[58; 59) "(" | ||
51 | POS_FIELD_DEF@[59; 68) | ||
52 | VISIBILITY@[59; 64) | ||
53 | CRATE_KW@[59; 64) "crate" | ||
54 | WHITESPACE@[64; 65) " " | ||
55 | PATH_TYPE@[65; 68) | ||
56 | PATH@[65; 68) | ||
57 | PATH_SEGMENT@[65; 68) | ||
58 | NAME_REF@[65; 68) | ||
59 | IDENT@[65; 68) "u32" | ||
60 | R_PAREN@[68; 69) ")" | ||
61 | SEMI@[69; 70) ";" | ||
62 | WHITESPACE@[70; 71) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0041_trait_item.rs b/crates/ra_syntax/test_data/parser/inline/ok/0041_trait_item.rs new file mode 100644 index 000000000..32761dd03 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0041_trait_item.rs | |||
@@ -0,0 +1,2 @@ | |||
1 | trait T<U>: Hash + Clone where U: Copy {} | ||
2 | trait X<U: Debug + Display>: Hash + Clone where U: Copy {} | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0041_trait_item.txt b/crates/ra_syntax/test_data/parser/inline/ok/0041_trait_item.txt new file mode 100644 index 000000000..578361715 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0041_trait_item.txt | |||
@@ -0,0 +1,125 @@ | |||
1 | SOURCE_FILE@[0; 101) | ||
2 | TRAIT_DEF@[0; 41) | ||
3 | TRAIT_KW@[0; 5) "trait" | ||
4 | WHITESPACE@[5; 6) " " | ||
5 | NAME@[6; 7) | ||
6 | IDENT@[6; 7) "T" | ||
7 | TYPE_PARAM_LIST@[7; 10) | ||
8 | L_ANGLE@[7; 8) "<" | ||
9 | TYPE_PARAM@[8; 9) | ||
10 | NAME@[8; 9) | ||
11 | IDENT@[8; 9) "U" | ||
12 | R_ANGLE@[9; 10) ">" | ||
13 | COLON@[10; 11) ":" | ||
14 | WHITESPACE@[11; 12) " " | ||
15 | TYPE_BOUND_LIST@[12; 24) | ||
16 | TYPE_BOUND@[12; 16) | ||
17 | PATH_TYPE@[12; 16) | ||
18 | PATH@[12; 16) | ||
19 | PATH_SEGMENT@[12; 16) | ||
20 | NAME_REF@[12; 16) | ||
21 | IDENT@[12; 16) "Hash" | ||
22 | WHITESPACE@[16; 17) " " | ||
23 | PLUS@[17; 18) "+" | ||
24 | WHITESPACE@[18; 19) " " | ||
25 | TYPE_BOUND@[19; 24) | ||
26 | PATH_TYPE@[19; 24) | ||
27 | PATH@[19; 24) | ||
28 | PATH_SEGMENT@[19; 24) | ||
29 | NAME_REF@[19; 24) | ||
30 | IDENT@[19; 24) "Clone" | ||
31 | WHITESPACE@[24; 25) " " | ||
32 | WHERE_CLAUSE@[25; 38) | ||
33 | WHERE_KW@[25; 30) "where" | ||
34 | WHITESPACE@[30; 31) " " | ||
35 | WHERE_PRED@[31; 38) | ||
36 | PATH_TYPE@[31; 32) | ||
37 | PATH@[31; 32) | ||
38 | PATH_SEGMENT@[31; 32) | ||
39 | NAME_REF@[31; 32) | ||
40 | IDENT@[31; 32) "U" | ||
41 | COLON@[32; 33) ":" | ||
42 | WHITESPACE@[33; 34) " " | ||
43 | TYPE_BOUND_LIST@[34; 38) | ||
44 | TYPE_BOUND@[34; 38) | ||
45 | PATH_TYPE@[34; 38) | ||
46 | PATH@[34; 38) | ||
47 | PATH_SEGMENT@[34; 38) | ||
48 | NAME_REF@[34; 38) | ||
49 | IDENT@[34; 38) "Copy" | ||
50 | WHITESPACE@[38; 39) " " | ||
51 | ITEM_LIST@[39; 41) | ||
52 | L_CURLY@[39; 40) "{" | ||
53 | R_CURLY@[40; 41) "}" | ||
54 | WHITESPACE@[41; 42) "\n" | ||
55 | TRAIT_DEF@[42; 100) | ||
56 | TRAIT_KW@[42; 47) "trait" | ||
57 | WHITESPACE@[47; 48) " " | ||
58 | NAME@[48; 49) | ||
59 | IDENT@[48; 49) "X" | ||
60 | TYPE_PARAM_LIST@[49; 69) | ||
61 | L_ANGLE@[49; 50) "<" | ||
62 | TYPE_PARAM@[50; 68) | ||
63 | NAME@[50; 51) | ||
64 | IDENT@[50; 51) "U" | ||
65 | COLON@[51; 52) ":" | ||
66 | WHITESPACE@[52; 53) " " | ||
67 | TYPE_BOUND_LIST@[53; 68) | ||
68 | TYPE_BOUND@[53; 58) | ||
69 | PATH_TYPE@[53; 58) | ||
70 | PATH@[53; 58) | ||
71 | PATH_SEGMENT@[53; 58) | ||
72 | NAME_REF@[53; 58) | ||
73 | IDENT@[53; 58) "Debug" | ||
74 | WHITESPACE@[58; 59) " " | ||
75 | PLUS@[59; 60) "+" | ||
76 | WHITESPACE@[60; 61) " " | ||
77 | TYPE_BOUND@[61; 68) | ||
78 | PATH_TYPE@[61; 68) | ||
79 | PATH@[61; 68) | ||
80 | PATH_SEGMENT@[61; 68) | ||
81 | NAME_REF@[61; 68) | ||
82 | IDENT@[61; 68) "Display" | ||
83 | R_ANGLE@[68; 69) ">" | ||
84 | COLON@[69; 70) ":" | ||
85 | WHITESPACE@[70; 71) " " | ||
86 | TYPE_BOUND_LIST@[71; 83) | ||
87 | TYPE_BOUND@[71; 75) | ||
88 | PATH_TYPE@[71; 75) | ||
89 | PATH@[71; 75) | ||
90 | PATH_SEGMENT@[71; 75) | ||
91 | NAME_REF@[71; 75) | ||
92 | IDENT@[71; 75) "Hash" | ||
93 | WHITESPACE@[75; 76) " " | ||
94 | PLUS@[76; 77) "+" | ||
95 | WHITESPACE@[77; 78) " " | ||
96 | TYPE_BOUND@[78; 83) | ||
97 | PATH_TYPE@[78; 83) | ||
98 | PATH@[78; 83) | ||
99 | PATH_SEGMENT@[78; 83) | ||
100 | NAME_REF@[78; 83) | ||
101 | IDENT@[78; 83) "Clone" | ||
102 | WHITESPACE@[83; 84) " " | ||
103 | WHERE_CLAUSE@[84; 97) | ||
104 | WHERE_KW@[84; 89) "where" | ||
105 | WHITESPACE@[89; 90) " " | ||
106 | WHERE_PRED@[90; 97) | ||
107 | PATH_TYPE@[90; 91) | ||
108 | PATH@[90; 91) | ||
109 | PATH_SEGMENT@[90; 91) | ||
110 | NAME_REF@[90; 91) | ||
111 | IDENT@[90; 91) "U" | ||
112 | COLON@[91; 92) ":" | ||
113 | WHITESPACE@[92; 93) " " | ||
114 | TYPE_BOUND_LIST@[93; 97) | ||
115 | TYPE_BOUND@[93; 97) | ||
116 | PATH_TYPE@[93; 97) | ||
117 | PATH@[93; 97) | ||
118 | PATH_SEGMENT@[93; 97) | ||
119 | NAME_REF@[93; 97) | ||
120 | IDENT@[93; 97) "Copy" | ||
121 | WHITESPACE@[97; 98) " " | ||
122 | ITEM_LIST@[98; 100) | ||
123 | L_CURLY@[98; 99) "{" | ||
124 | R_CURLY@[99; 100) "}" | ||
125 | WHITESPACE@[100; 101) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0042_call_expr.rs b/crates/ra_syntax/test_data/parser/inline/ok/0042_call_expr.rs new file mode 100644 index 000000000..ffbf46d6d --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0042_call_expr.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | fn foo() { | ||
2 | let _ = f(); | ||
3 | let _ = f()(1)(1, 2,); | ||
4 | let _ = f(<Foo>::func()); | ||
5 | f(<Foo as Trait>::func()); | ||
6 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0042_call_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0042_call_expr.txt new file mode 100644 index 000000000..dd8946ad2 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0042_call_expr.txt | |||
@@ -0,0 +1,147 @@ | |||
1 | SOURCE_FILE@[0; 118) | ||
2 | FN_DEF@[0; 117) | ||
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; 117) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 15) "\n " | ||
14 | LET_STMT@[15; 27) | ||
15 | LET_KW@[15; 18) "let" | ||
16 | WHITESPACE@[18; 19) " " | ||
17 | PLACEHOLDER_PAT@[19; 20) | ||
18 | UNDERSCORE@[19; 20) "_" | ||
19 | WHITESPACE@[20; 21) " " | ||
20 | EQ@[21; 22) "=" | ||
21 | WHITESPACE@[22; 23) " " | ||
22 | CALL_EXPR@[23; 26) | ||
23 | PATH_EXPR@[23; 24) | ||
24 | PATH@[23; 24) | ||
25 | PATH_SEGMENT@[23; 24) | ||
26 | NAME_REF@[23; 24) | ||
27 | IDENT@[23; 24) "f" | ||
28 | ARG_LIST@[24; 26) | ||
29 | L_PAREN@[24; 25) "(" | ||
30 | R_PAREN@[25; 26) ")" | ||
31 | SEMI@[26; 27) ";" | ||
32 | WHITESPACE@[27; 32) "\n " | ||
33 | LET_STMT@[32; 54) | ||
34 | LET_KW@[32; 35) "let" | ||
35 | WHITESPACE@[35; 36) " " | ||
36 | PLACEHOLDER_PAT@[36; 37) | ||
37 | UNDERSCORE@[36; 37) "_" | ||
38 | WHITESPACE@[37; 38) " " | ||
39 | EQ@[38; 39) "=" | ||
40 | WHITESPACE@[39; 40) " " | ||
41 | CALL_EXPR@[40; 53) | ||
42 | CALL_EXPR@[40; 46) | ||
43 | CALL_EXPR@[40; 43) | ||
44 | PATH_EXPR@[40; 41) | ||
45 | PATH@[40; 41) | ||
46 | PATH_SEGMENT@[40; 41) | ||
47 | NAME_REF@[40; 41) | ||
48 | IDENT@[40; 41) "f" | ||
49 | ARG_LIST@[41; 43) | ||
50 | L_PAREN@[41; 42) "(" | ||
51 | R_PAREN@[42; 43) ")" | ||
52 | ARG_LIST@[43; 46) | ||
53 | L_PAREN@[43; 44) "(" | ||
54 | LITERAL@[44; 45) | ||
55 | INT_NUMBER@[44; 45) "1" | ||
56 | R_PAREN@[45; 46) ")" | ||
57 | ARG_LIST@[46; 53) | ||
58 | L_PAREN@[46; 47) "(" | ||
59 | LITERAL@[47; 48) | ||
60 | INT_NUMBER@[47; 48) "1" | ||
61 | COMMA@[48; 49) "," | ||
62 | WHITESPACE@[49; 50) " " | ||
63 | LITERAL@[50; 51) | ||
64 | INT_NUMBER@[50; 51) "2" | ||
65 | COMMA@[51; 52) "," | ||
66 | R_PAREN@[52; 53) ")" | ||
67 | SEMI@[53; 54) ";" | ||
68 | WHITESPACE@[54; 59) "\n " | ||
69 | LET_STMT@[59; 84) | ||
70 | LET_KW@[59; 62) "let" | ||
71 | WHITESPACE@[62; 63) " " | ||
72 | PLACEHOLDER_PAT@[63; 64) | ||
73 | UNDERSCORE@[63; 64) "_" | ||
74 | WHITESPACE@[64; 65) " " | ||
75 | EQ@[65; 66) "=" | ||
76 | WHITESPACE@[66; 67) " " | ||
77 | CALL_EXPR@[67; 83) | ||
78 | PATH_EXPR@[67; 68) | ||
79 | PATH@[67; 68) | ||
80 | PATH_SEGMENT@[67; 68) | ||
81 | NAME_REF@[67; 68) | ||
82 | IDENT@[67; 68) "f" | ||
83 | ARG_LIST@[68; 83) | ||
84 | L_PAREN@[68; 69) "(" | ||
85 | CALL_EXPR@[69; 82) | ||
86 | PATH_EXPR@[69; 80) | ||
87 | PATH@[69; 80) | ||
88 | PATH@[69; 74) | ||
89 | PATH_SEGMENT@[69; 74) | ||
90 | L_ANGLE@[69; 70) "<" | ||
91 | PATH_TYPE@[70; 73) | ||
92 | PATH@[70; 73) | ||
93 | PATH_SEGMENT@[70; 73) | ||
94 | NAME_REF@[70; 73) | ||
95 | IDENT@[70; 73) "Foo" | ||
96 | R_ANGLE@[73; 74) ">" | ||
97 | COLONCOLON@[74; 76) "::" | ||
98 | PATH_SEGMENT@[76; 80) | ||
99 | NAME_REF@[76; 80) | ||
100 | IDENT@[76; 80) "func" | ||
101 | ARG_LIST@[80; 82) | ||
102 | L_PAREN@[80; 81) "(" | ||
103 | R_PAREN@[81; 82) ")" | ||
104 | R_PAREN@[82; 83) ")" | ||
105 | SEMI@[83; 84) ";" | ||
106 | WHITESPACE@[84; 89) "\n " | ||
107 | EXPR_STMT@[89; 115) | ||
108 | CALL_EXPR@[89; 114) | ||
109 | PATH_EXPR@[89; 90) | ||
110 | PATH@[89; 90) | ||
111 | PATH_SEGMENT@[89; 90) | ||
112 | NAME_REF@[89; 90) | ||
113 | IDENT@[89; 90) "f" | ||
114 | ARG_LIST@[90; 114) | ||
115 | L_PAREN@[90; 91) "(" | ||
116 | CALL_EXPR@[91; 113) | ||
117 | PATH_EXPR@[91; 111) | ||
118 | PATH@[91; 111) | ||
119 | PATH@[91; 105) | ||
120 | PATH_SEGMENT@[91; 105) | ||
121 | L_ANGLE@[91; 92) "<" | ||
122 | PATH_TYPE@[92; 95) | ||
123 | PATH@[92; 95) | ||
124 | PATH_SEGMENT@[92; 95) | ||
125 | NAME_REF@[92; 95) | ||
126 | IDENT@[92; 95) "Foo" | ||
127 | WHITESPACE@[95; 96) " " | ||
128 | AS_KW@[96; 98) "as" | ||
129 | WHITESPACE@[98; 99) " " | ||
130 | PATH_TYPE@[99; 104) | ||
131 | PATH@[99; 104) | ||
132 | PATH_SEGMENT@[99; 104) | ||
133 | NAME_REF@[99; 104) | ||
134 | IDENT@[99; 104) "Trait" | ||
135 | R_ANGLE@[104; 105) ">" | ||
136 | COLONCOLON@[105; 107) "::" | ||
137 | PATH_SEGMENT@[107; 111) | ||
138 | NAME_REF@[107; 111) | ||
139 | IDENT@[107; 111) "func" | ||
140 | ARG_LIST@[111; 113) | ||
141 | L_PAREN@[111; 112) "(" | ||
142 | R_PAREN@[112; 113) ")" | ||
143 | R_PAREN@[113; 114) ")" | ||
144 | SEMI@[114; 115) ";" | ||
145 | WHITESPACE@[115; 116) "\n" | ||
146 | R_CURLY@[116; 117) "}" | ||
147 | WHITESPACE@[117; 118) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0043_use_alias.rs b/crates/ra_syntax/test_data/parser/inline/ok/0043_use_alias.rs new file mode 100644 index 000000000..9be50f877 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0043_use_alias.rs | |||
@@ -0,0 +1,8 @@ | |||
1 | use some::path as some_name; | ||
2 | use some::{ | ||
3 | other::path as some_other_name, | ||
4 | different::path as different_name, | ||
5 | yet::another::path, | ||
6 | running::out::of::synonyms::for_::different::* | ||
7 | }; | ||
8 | use Trait as _; | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0043_use_alias.txt b/crates/ra_syntax/test_data/parser/inline/ok/0043_use_alias.txt new file mode 100644 index 000000000..18d8a151f --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0043_use_alias.txt | |||
@@ -0,0 +1,138 @@ | |||
1 | SOURCE_FILE@[0; 198) | ||
2 | USE_ITEM@[0; 28) | ||
3 | USE_KW@[0; 3) "use" | ||
4 | WHITESPACE@[3; 4) " " | ||
5 | USE_TREE@[4; 27) | ||
6 | PATH@[4; 14) | ||
7 | PATH@[4; 8) | ||
8 | PATH_SEGMENT@[4; 8) | ||
9 | NAME_REF@[4; 8) | ||
10 | IDENT@[4; 8) "some" | ||
11 | COLONCOLON@[8; 10) "::" | ||
12 | PATH_SEGMENT@[10; 14) | ||
13 | NAME_REF@[10; 14) | ||
14 | IDENT@[10; 14) "path" | ||
15 | WHITESPACE@[14; 15) " " | ||
16 | ALIAS@[15; 27) | ||
17 | AS_KW@[15; 17) "as" | ||
18 | WHITESPACE@[17; 18) " " | ||
19 | NAME@[18; 27) | ||
20 | IDENT@[18; 27) "some_name" | ||
21 | SEMI@[27; 28) ";" | ||
22 | WHITESPACE@[28; 29) "\n" | ||
23 | USE_ITEM@[29; 181) | ||
24 | USE_KW@[29; 32) "use" | ||
25 | WHITESPACE@[32; 33) " " | ||
26 | USE_TREE@[33; 180) | ||
27 | PATH@[33; 37) | ||
28 | PATH_SEGMENT@[33; 37) | ||
29 | NAME_REF@[33; 37) | ||
30 | IDENT@[33; 37) "some" | ||
31 | COLONCOLON@[37; 39) "::" | ||
32 | USE_TREE_LIST@[39; 180) | ||
33 | L_CURLY@[39; 40) "{" | ||
34 | WHITESPACE@[40; 42) "\n " | ||
35 | USE_TREE@[42; 72) | ||
36 | PATH@[42; 53) | ||
37 | PATH@[42; 47) | ||
38 | PATH_SEGMENT@[42; 47) | ||
39 | NAME_REF@[42; 47) | ||
40 | IDENT@[42; 47) "other" | ||
41 | COLONCOLON@[47; 49) "::" | ||
42 | PATH_SEGMENT@[49; 53) | ||
43 | NAME_REF@[49; 53) | ||
44 | IDENT@[49; 53) "path" | ||
45 | WHITESPACE@[53; 54) " " | ||
46 | ALIAS@[54; 72) | ||
47 | AS_KW@[54; 56) "as" | ||
48 | WHITESPACE@[56; 57) " " | ||
49 | NAME@[57; 72) | ||
50 | IDENT@[57; 72) "some_other_name" | ||
51 | COMMA@[72; 73) "," | ||
52 | WHITESPACE@[73; 75) "\n " | ||
53 | USE_TREE@[75; 108) | ||
54 | PATH@[75; 90) | ||
55 | PATH@[75; 84) | ||
56 | PATH_SEGMENT@[75; 84) | ||
57 | NAME_REF@[75; 84) | ||
58 | IDENT@[75; 84) "different" | ||
59 | COLONCOLON@[84; 86) "::" | ||
60 | PATH_SEGMENT@[86; 90) | ||
61 | NAME_REF@[86; 90) | ||
62 | IDENT@[86; 90) "path" | ||
63 | WHITESPACE@[90; 91) " " | ||
64 | ALIAS@[91; 108) | ||
65 | AS_KW@[91; 93) "as" | ||
66 | WHITESPACE@[93; 94) " " | ||
67 | NAME@[94; 108) | ||
68 | IDENT@[94; 108) "different_name" | ||
69 | COMMA@[108; 109) "," | ||
70 | WHITESPACE@[109; 111) "\n " | ||
71 | USE_TREE@[111; 129) | ||
72 | PATH@[111; 129) | ||
73 | PATH@[111; 123) | ||
74 | PATH@[111; 114) | ||
75 | PATH_SEGMENT@[111; 114) | ||
76 | NAME_REF@[111; 114) | ||
77 | IDENT@[111; 114) "yet" | ||
78 | COLONCOLON@[114; 116) "::" | ||
79 | PATH_SEGMENT@[116; 123) | ||
80 | NAME_REF@[116; 123) | ||
81 | IDENT@[116; 123) "another" | ||
82 | COLONCOLON@[123; 125) "::" | ||
83 | PATH_SEGMENT@[125; 129) | ||
84 | NAME_REF@[125; 129) | ||
85 | IDENT@[125; 129) "path" | ||
86 | COMMA@[129; 130) "," | ||
87 | WHITESPACE@[130; 132) "\n " | ||
88 | USE_TREE@[132; 178) | ||
89 | PATH@[132; 175) | ||
90 | PATH@[132; 164) | ||
91 | PATH@[132; 158) | ||
92 | PATH@[132; 148) | ||
93 | PATH@[132; 144) | ||
94 | PATH@[132; 139) | ||
95 | PATH_SEGMENT@[132; 139) | ||
96 | NAME_REF@[132; 139) | ||
97 | IDENT@[132; 139) "running" | ||
98 | COLONCOLON@[139; 141) "::" | ||
99 | PATH_SEGMENT@[141; 144) | ||
100 | NAME_REF@[141; 144) | ||
101 | IDENT@[141; 144) "out" | ||
102 | COLONCOLON@[144; 146) "::" | ||
103 | PATH_SEGMENT@[146; 148) | ||
104 | NAME_REF@[146; 148) | ||
105 | IDENT@[146; 148) "of" | ||
106 | COLONCOLON@[148; 150) "::" | ||
107 | PATH_SEGMENT@[150; 158) | ||
108 | NAME_REF@[150; 158) | ||
109 | IDENT@[150; 158) "synonyms" | ||
110 | COLONCOLON@[158; 160) "::" | ||
111 | PATH_SEGMENT@[160; 164) | ||
112 | NAME_REF@[160; 164) | ||
113 | IDENT@[160; 164) "for_" | ||
114 | COLONCOLON@[164; 166) "::" | ||
115 | PATH_SEGMENT@[166; 175) | ||
116 | NAME_REF@[166; 175) | ||
117 | IDENT@[166; 175) "different" | ||
118 | COLONCOLON@[175; 177) "::" | ||
119 | STAR@[177; 178) "*" | ||
120 | WHITESPACE@[178; 179) "\n" | ||
121 | R_CURLY@[179; 180) "}" | ||
122 | SEMI@[180; 181) ";" | ||
123 | WHITESPACE@[181; 182) "\n" | ||
124 | USE_ITEM@[182; 197) | ||
125 | USE_KW@[182; 185) "use" | ||
126 | WHITESPACE@[185; 186) " " | ||
127 | USE_TREE@[186; 196) | ||
128 | PATH@[186; 191) | ||
129 | PATH_SEGMENT@[186; 191) | ||
130 | NAME_REF@[186; 191) | ||
131 | IDENT@[186; 191) "Trait" | ||
132 | WHITESPACE@[191; 192) " " | ||
133 | ALIAS@[192; 196) | ||
134 | AS_KW@[192; 194) "as" | ||
135 | WHITESPACE@[194; 195) " " | ||
136 | UNDERSCORE@[195; 196) "_" | ||
137 | SEMI@[196; 197) ";" | ||
138 | WHITESPACE@[197; 198) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0044_block_items.rs b/crates/ra_syntax/test_data/parser/inline/ok/0044_block_items.rs new file mode 100644 index 000000000..d9868718c --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0044_block_items.rs | |||
@@ -0,0 +1 @@ | |||
fn a() { fn b() {} } | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0044_block_items.txt b/crates/ra_syntax/test_data/parser/inline/ok/0044_block_items.txt new file mode 100644 index 000000000..d1a8c560a --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0044_block_items.txt | |||
@@ -0,0 +1,28 @@ | |||
1 | SOURCE_FILE@[0; 21) | ||
2 | FN_DEF@[0; 20) | ||
3 | FN_KW@[0; 2) "fn" | ||
4 | WHITESPACE@[2; 3) " " | ||
5 | NAME@[3; 4) | ||
6 | IDENT@[3; 4) "a" | ||
7 | PARAM_LIST@[4; 6) | ||
8 | L_PAREN@[4; 5) "(" | ||
9 | R_PAREN@[5; 6) ")" | ||
10 | WHITESPACE@[6; 7) " " | ||
11 | BLOCK@[7; 20) | ||
12 | L_CURLY@[7; 8) "{" | ||
13 | WHITESPACE@[8; 9) " " | ||
14 | FN_DEF@[9; 18) | ||
15 | FN_KW@[9; 11) "fn" | ||
16 | WHITESPACE@[11; 12) " " | ||
17 | NAME@[12; 13) | ||
18 | IDENT@[12; 13) "b" | ||
19 | PARAM_LIST@[13; 15) | ||
20 | L_PAREN@[13; 14) "(" | ||
21 | R_PAREN@[14; 15) ")" | ||
22 | WHITESPACE@[15; 16) " " | ||
23 | BLOCK@[16; 18) | ||
24 | L_CURLY@[16; 17) "{" | ||
25 | R_CURLY@[17; 18) "}" | ||
26 | WHITESPACE@[18; 19) " " | ||
27 | R_CURLY@[19; 20) "}" | ||
28 | WHITESPACE@[20; 21) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0045_param_list_opt_patterns.rs b/crates/ra_syntax/test_data/parser/inline/ok/0045_param_list_opt_patterns.rs new file mode 100644 index 000000000..9b93442c0 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0045_param_list_opt_patterns.rs | |||
@@ -0,0 +1 @@ | |||
fn foo<F: FnMut(&mut Foo<'a>)>(){} | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0045_param_list_opt_patterns.txt b/crates/ra_syntax/test_data/parser/inline/ok/0045_param_list_opt_patterns.txt new file mode 100644 index 000000000..f85d6a4bc --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0045_param_list_opt_patterns.txt | |||
@@ -0,0 +1,46 @@ | |||
1 | SOURCE_FILE@[0; 35) | ||
2 | FN_DEF@[0; 34) | ||
3 | FN_KW@[0; 2) "fn" | ||
4 | WHITESPACE@[2; 3) " " | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | TYPE_PARAM_LIST@[6; 30) | ||
8 | L_ANGLE@[6; 7) "<" | ||
9 | TYPE_PARAM@[7; 29) | ||
10 | NAME@[7; 8) | ||
11 | IDENT@[7; 8) "F" | ||
12 | COLON@[8; 9) ":" | ||
13 | WHITESPACE@[9; 10) " " | ||
14 | TYPE_BOUND_LIST@[10; 29) | ||
15 | TYPE_BOUND@[10; 29) | ||
16 | PATH_TYPE@[10; 29) | ||
17 | PATH@[10; 29) | ||
18 | PATH_SEGMENT@[10; 29) | ||
19 | NAME_REF@[10; 15) | ||
20 | IDENT@[10; 15) "FnMut" | ||
21 | PARAM_LIST@[15; 29) | ||
22 | L_PAREN@[15; 16) "(" | ||
23 | PARAM@[16; 28) | ||
24 | REFERENCE_TYPE@[16; 28) | ||
25 | AMP@[16; 17) "&" | ||
26 | MUT_KW@[17; 20) "mut" | ||
27 | WHITESPACE@[20; 21) " " | ||
28 | PATH_TYPE@[21; 28) | ||
29 | PATH@[21; 28) | ||
30 | PATH_SEGMENT@[21; 28) | ||
31 | NAME_REF@[21; 24) | ||
32 | IDENT@[21; 24) "Foo" | ||
33 | TYPE_ARG_LIST@[24; 28) | ||
34 | L_ANGLE@[24; 25) "<" | ||
35 | LIFETIME_ARG@[25; 27) | ||
36 | LIFETIME@[25; 27) "\'a" | ||
37 | R_ANGLE@[27; 28) ">" | ||
38 | R_PAREN@[28; 29) ")" | ||
39 | R_ANGLE@[29; 30) ">" | ||
40 | PARAM_LIST@[30; 32) | ||
41 | L_PAREN@[30; 31) "(" | ||
42 | R_PAREN@[31; 32) ")" | ||
43 | BLOCK@[32; 34) | ||
44 | L_CURLY@[32; 33) "{" | ||
45 | R_CURLY@[33; 34) "}" | ||
46 | WHITESPACE@[34; 35) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0046_singleton_tuple_type.rs b/crates/ra_syntax/test_data/parser/inline/ok/0046_singleton_tuple_type.rs new file mode 100644 index 000000000..cb66bad24 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0046_singleton_tuple_type.rs | |||
@@ -0,0 +1 @@ | |||
type T = (i32,); | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0046_singleton_tuple_type.txt b/crates/ra_syntax/test_data/parser/inline/ok/0046_singleton_tuple_type.txt new file mode 100644 index 000000000..c7b4e614d --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0046_singleton_tuple_type.txt | |||
@@ -0,0 +1,20 @@ | |||
1 | SOURCE_FILE@[0; 17) | ||
2 | TYPE_ALIAS_DEF@[0; 16) | ||
3 | TYPE_KW@[0; 4) "type" | ||
4 | WHITESPACE@[4; 5) " " | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "T" | ||
7 | WHITESPACE@[6; 7) " " | ||
8 | EQ@[7; 8) "=" | ||
9 | WHITESPACE@[8; 9) " " | ||
10 | TUPLE_TYPE@[9; 15) | ||
11 | L_PAREN@[9; 10) "(" | ||
12 | PATH_TYPE@[10; 13) | ||
13 | PATH@[10; 13) | ||
14 | PATH_SEGMENT@[10; 13) | ||
15 | NAME_REF@[10; 13) | ||
16 | IDENT@[10; 13) "i32" | ||
17 | COMMA@[13; 14) "," | ||
18 | R_PAREN@[14; 15) ")" | ||
19 | SEMI@[15; 16) ";" | ||
20 | WHITESPACE@[16; 17) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0047_unsafe_default_impl.rs b/crates/ra_syntax/test_data/parser/inline/ok/0047_unsafe_default_impl.rs new file mode 100644 index 000000000..9cd6c57bd --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0047_unsafe_default_impl.rs | |||
@@ -0,0 +1 @@ | |||
unsafe default impl Foo {} | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0047_unsafe_default_impl.txt b/crates/ra_syntax/test_data/parser/inline/ok/0047_unsafe_default_impl.txt new file mode 100644 index 000000000..8f3dcaf88 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0047_unsafe_default_impl.txt | |||
@@ -0,0 +1,18 @@ | |||
1 | SOURCE_FILE@[0; 27) | ||
2 | IMPL_BLOCK@[0; 26) | ||
3 | UNSAFE_KW@[0; 6) "unsafe" | ||
4 | WHITESPACE@[6; 7) " " | ||
5 | DEFAULT_KW@[7; 14) "default" | ||
6 | WHITESPACE@[14; 15) " " | ||
7 | IMPL_KW@[15; 19) "impl" | ||
8 | WHITESPACE@[19; 20) " " | ||
9 | PATH_TYPE@[20; 23) | ||
10 | PATH@[20; 23) | ||
11 | PATH_SEGMENT@[20; 23) | ||
12 | NAME_REF@[20; 23) | ||
13 | IDENT@[20; 23) "Foo" | ||
14 | WHITESPACE@[23; 24) " " | ||
15 | ITEM_LIST@[24; 26) | ||
16 | L_CURLY@[24; 25) "{" | ||
17 | R_CURLY@[25; 26) "}" | ||
18 | WHITESPACE@[26; 27) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0048_path_type_with_bounds.rs b/crates/ra_syntax/test_data/parser/inline/ok/0048_path_type_with_bounds.rs new file mode 100644 index 000000000..4bb0f63b7 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0048_path_type_with_bounds.rs | |||
@@ -0,0 +1,2 @@ | |||
1 | fn foo() -> Box<T + 'f> {} | ||
2 | fn foo() -> Box<dyn T + 'f> {} | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0048_path_type_with_bounds.txt b/crates/ra_syntax/test_data/parser/inline/ok/0048_path_type_with_bounds.txt new file mode 100644 index 000000000..bb948c8d8 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0048_path_type_with_bounds.txt | |||
@@ -0,0 +1,81 @@ | |||
1 | SOURCE_FILE@[0; 58) | ||
2 | FN_DEF@[0; 26) | ||
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 | RET_TYPE@[9; 23) | ||
12 | THIN_ARROW@[9; 11) "->" | ||
13 | WHITESPACE@[11; 12) " " | ||
14 | PATH_TYPE@[12; 23) | ||
15 | PATH@[12; 23) | ||
16 | PATH_SEGMENT@[12; 23) | ||
17 | NAME_REF@[12; 15) | ||
18 | IDENT@[12; 15) "Box" | ||
19 | TYPE_ARG_LIST@[15; 23) | ||
20 | L_ANGLE@[15; 16) "<" | ||
21 | TYPE_ARG@[16; 22) | ||
22 | DYN_TRAIT_TYPE@[16; 22) | ||
23 | TYPE_BOUND_LIST@[16; 22) | ||
24 | TYPE_BOUND@[16; 17) | ||
25 | PATH_TYPE@[16; 17) | ||
26 | PATH@[16; 17) | ||
27 | PATH_SEGMENT@[16; 17) | ||
28 | NAME_REF@[16; 17) | ||
29 | IDENT@[16; 17) "T" | ||
30 | WHITESPACE@[17; 18) " " | ||
31 | PLUS@[18; 19) "+" | ||
32 | WHITESPACE@[19; 20) " " | ||
33 | TYPE_BOUND@[20; 22) | ||
34 | LIFETIME@[20; 22) "\'f" | ||
35 | R_ANGLE@[22; 23) ">" | ||
36 | WHITESPACE@[23; 24) " " | ||
37 | BLOCK@[24; 26) | ||
38 | L_CURLY@[24; 25) "{" | ||
39 | R_CURLY@[25; 26) "}" | ||
40 | WHITESPACE@[26; 27) "\n" | ||
41 | FN_DEF@[27; 57) | ||
42 | FN_KW@[27; 29) "fn" | ||
43 | WHITESPACE@[29; 30) " " | ||
44 | NAME@[30; 33) | ||
45 | IDENT@[30; 33) "foo" | ||
46 | PARAM_LIST@[33; 35) | ||
47 | L_PAREN@[33; 34) "(" | ||
48 | R_PAREN@[34; 35) ")" | ||
49 | WHITESPACE@[35; 36) " " | ||
50 | RET_TYPE@[36; 54) | ||
51 | THIN_ARROW@[36; 38) "->" | ||
52 | WHITESPACE@[38; 39) " " | ||
53 | PATH_TYPE@[39; 54) | ||
54 | PATH@[39; 54) | ||
55 | PATH_SEGMENT@[39; 54) | ||
56 | NAME_REF@[39; 42) | ||
57 | IDENT@[39; 42) "Box" | ||
58 | TYPE_ARG_LIST@[42; 54) | ||
59 | L_ANGLE@[42; 43) "<" | ||
60 | TYPE_ARG@[43; 53) | ||
61 | DYN_TRAIT_TYPE@[43; 53) | ||
62 | DYN_KW@[43; 46) "dyn" | ||
63 | WHITESPACE@[46; 47) " " | ||
64 | TYPE_BOUND_LIST@[47; 53) | ||
65 | TYPE_BOUND@[47; 48) | ||
66 | PATH_TYPE@[47; 48) | ||
67 | PATH@[47; 48) | ||
68 | PATH_SEGMENT@[47; 48) | ||
69 | NAME_REF@[47; 48) | ||
70 | IDENT@[47; 48) "T" | ||
71 | WHITESPACE@[48; 49) " " | ||
72 | PLUS@[49; 50) "+" | ||
73 | WHITESPACE@[50; 51) " " | ||
74 | TYPE_BOUND@[51; 53) | ||
75 | LIFETIME@[51; 53) "\'f" | ||
76 | R_ANGLE@[53; 54) ">" | ||
77 | WHITESPACE@[54; 55) " " | ||
78 | BLOCK@[55; 57) | ||
79 | L_CURLY@[55; 56) "{" | ||
80 | R_CURLY@[56; 57) "}" | ||
81 | WHITESPACE@[57; 58) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0050_fn_decl.rs b/crates/ra_syntax/test_data/parser/inline/ok/0050_fn_decl.rs new file mode 100644 index 000000000..c9f74f7f5 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0050_fn_decl.rs | |||
@@ -0,0 +1 @@ | |||
trait T { fn foo(); } | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0050_fn_decl.txt b/crates/ra_syntax/test_data/parser/inline/ok/0050_fn_decl.txt new file mode 100644 index 000000000..19f961e29 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0050_fn_decl.txt | |||
@@ -0,0 +1,22 @@ | |||
1 | SOURCE_FILE@[0; 22) | ||
2 | TRAIT_DEF@[0; 21) | ||
3 | TRAIT_KW@[0; 5) "trait" | ||
4 | WHITESPACE@[5; 6) " " | ||
5 | NAME@[6; 7) | ||
6 | IDENT@[6; 7) "T" | ||
7 | WHITESPACE@[7; 8) " " | ||
8 | ITEM_LIST@[8; 21) | ||
9 | L_CURLY@[8; 9) "{" | ||
10 | WHITESPACE@[9; 10) " " | ||
11 | FN_DEF@[10; 19) | ||
12 | FN_KW@[10; 12) "fn" | ||
13 | WHITESPACE@[12; 13) " " | ||
14 | NAME@[13; 16) | ||
15 | IDENT@[13; 16) "foo" | ||
16 | PARAM_LIST@[16; 18) | ||
17 | L_PAREN@[16; 17) "(" | ||
18 | R_PAREN@[17; 18) ")" | ||
19 | SEMI@[18; 19) ";" | ||
20 | WHITESPACE@[19; 20) " " | ||
21 | R_CURLY@[20; 21) "}" | ||
22 | WHITESPACE@[21; 22) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0051_unit_type.rs b/crates/ra_syntax/test_data/parser/inline/ok/0051_unit_type.rs new file mode 100644 index 000000000..c039cf7d3 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0051_unit_type.rs | |||
@@ -0,0 +1 @@ | |||
type T = (); | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0051_unit_type.txt b/crates/ra_syntax/test_data/parser/inline/ok/0051_unit_type.txt new file mode 100644 index 000000000..6a469f8aa --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0051_unit_type.txt | |||
@@ -0,0 +1,14 @@ | |||
1 | SOURCE_FILE@[0; 13) | ||
2 | TYPE_ALIAS_DEF@[0; 12) | ||
3 | TYPE_KW@[0; 4) "type" | ||
4 | WHITESPACE@[4; 5) " " | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "T" | ||
7 | WHITESPACE@[6; 7) " " | ||
8 | EQ@[7; 8) "=" | ||
9 | WHITESPACE@[8; 9) " " | ||
10 | TUPLE_TYPE@[9; 11) | ||
11 | L_PAREN@[9; 10) "(" | ||
12 | R_PAREN@[10; 11) ")" | ||
13 | SEMI@[11; 12) ";" | ||
14 | WHITESPACE@[12; 13) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0052_path_type.rs b/crates/ra_syntax/test_data/parser/inline/ok/0052_path_type.rs new file mode 100644 index 000000000..bf94f32e1 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0052_path_type.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | type A = Foo; | ||
2 | type B = ::Foo; | ||
3 | type C = self::Foo; | ||
4 | type D = super::Foo; | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0052_path_type.txt b/crates/ra_syntax/test_data/parser/inline/ok/0052_path_type.txt new file mode 100644 index 000000000..ee55ee219 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0052_path_type.txt | |||
@@ -0,0 +1,70 @@ | |||
1 | SOURCE_FILE@[0; 71) | ||
2 | TYPE_ALIAS_DEF@[0; 13) | ||
3 | TYPE_KW@[0; 4) "type" | ||
4 | WHITESPACE@[4; 5) " " | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "A" | ||
7 | WHITESPACE@[6; 7) " " | ||
8 | EQ@[7; 8) "=" | ||
9 | WHITESPACE@[8; 9) " " | ||
10 | PATH_TYPE@[9; 12) | ||
11 | PATH@[9; 12) | ||
12 | PATH_SEGMENT@[9; 12) | ||
13 | NAME_REF@[9; 12) | ||
14 | IDENT@[9; 12) "Foo" | ||
15 | SEMI@[12; 13) ";" | ||
16 | WHITESPACE@[13; 14) "\n" | ||
17 | TYPE_ALIAS_DEF@[14; 29) | ||
18 | TYPE_KW@[14; 18) "type" | ||
19 | WHITESPACE@[18; 19) " " | ||
20 | NAME@[19; 20) | ||
21 | IDENT@[19; 20) "B" | ||
22 | WHITESPACE@[20; 21) " " | ||
23 | EQ@[21; 22) "=" | ||
24 | WHITESPACE@[22; 23) " " | ||
25 | PATH_TYPE@[23; 28) | ||
26 | PATH@[23; 28) | ||
27 | PATH_SEGMENT@[23; 28) | ||
28 | COLONCOLON@[23; 25) "::" | ||
29 | NAME_REF@[25; 28) | ||
30 | IDENT@[25; 28) "Foo" | ||
31 | SEMI@[28; 29) ";" | ||
32 | WHITESPACE@[29; 30) "\n" | ||
33 | TYPE_ALIAS_DEF@[30; 49) | ||
34 | TYPE_KW@[30; 34) "type" | ||
35 | WHITESPACE@[34; 35) " " | ||
36 | NAME@[35; 36) | ||
37 | IDENT@[35; 36) "C" | ||
38 | WHITESPACE@[36; 37) " " | ||
39 | EQ@[37; 38) "=" | ||
40 | WHITESPACE@[38; 39) " " | ||
41 | PATH_TYPE@[39; 48) | ||
42 | PATH@[39; 48) | ||
43 | PATH@[39; 43) | ||
44 | PATH_SEGMENT@[39; 43) | ||
45 | SELF_KW@[39; 43) "self" | ||
46 | COLONCOLON@[43; 45) "::" | ||
47 | PATH_SEGMENT@[45; 48) | ||
48 | NAME_REF@[45; 48) | ||
49 | IDENT@[45; 48) "Foo" | ||
50 | SEMI@[48; 49) ";" | ||
51 | WHITESPACE@[49; 50) "\n" | ||
52 | TYPE_ALIAS_DEF@[50; 70) | ||
53 | TYPE_KW@[50; 54) "type" | ||
54 | WHITESPACE@[54; 55) " " | ||
55 | NAME@[55; 56) | ||
56 | IDENT@[55; 56) "D" | ||
57 | WHITESPACE@[56; 57) " " | ||
58 | EQ@[57; 58) "=" | ||
59 | WHITESPACE@[58; 59) " " | ||
60 | PATH_TYPE@[59; 69) | ||
61 | PATH@[59; 69) | ||
62 | PATH@[59; 64) | ||
63 | PATH_SEGMENT@[59; 64) | ||
64 | SUPER_KW@[59; 64) "super" | ||
65 | COLONCOLON@[64; 66) "::" | ||
66 | PATH_SEGMENT@[66; 69) | ||
67 | NAME_REF@[66; 69) | ||
68 | IDENT@[66; 69) "Foo" | ||
69 | SEMI@[69; 70) ";" | ||
70 | WHITESPACE@[70; 71) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0053_path_expr.rs b/crates/ra_syntax/test_data/parser/inline/ok/0053_path_expr.rs new file mode 100644 index 000000000..333ebabef --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0053_path_expr.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | fn foo() { | ||
2 | let _ = a; | ||
3 | let _ = a::b; | ||
4 | let _ = ::a::<b>; | ||
5 | let _ = format!(); | ||
6 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0053_path_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0053_path_expr.txt new file mode 100644 index 000000000..bc4b97c9f --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0053_path_expr.txt | |||
@@ -0,0 +1,95 @@ | |||
1 | SOURCE_FILE@[0; 91) | ||
2 | FN_DEF@[0; 90) | ||
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; 90) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 15) "\n " | ||
14 | LET_STMT@[15; 25) | ||
15 | LET_KW@[15; 18) "let" | ||
16 | WHITESPACE@[18; 19) " " | ||
17 | PLACEHOLDER_PAT@[19; 20) | ||
18 | UNDERSCORE@[19; 20) "_" | ||
19 | WHITESPACE@[20; 21) " " | ||
20 | EQ@[21; 22) "=" | ||
21 | WHITESPACE@[22; 23) " " | ||
22 | PATH_EXPR@[23; 24) | ||
23 | PATH@[23; 24) | ||
24 | PATH_SEGMENT@[23; 24) | ||
25 | NAME_REF@[23; 24) | ||
26 | IDENT@[23; 24) "a" | ||
27 | SEMI@[24; 25) ";" | ||
28 | WHITESPACE@[25; 30) "\n " | ||
29 | LET_STMT@[30; 43) | ||
30 | LET_KW@[30; 33) "let" | ||
31 | WHITESPACE@[33; 34) " " | ||
32 | PLACEHOLDER_PAT@[34; 35) | ||
33 | UNDERSCORE@[34; 35) "_" | ||
34 | WHITESPACE@[35; 36) " " | ||
35 | EQ@[36; 37) "=" | ||
36 | WHITESPACE@[37; 38) " " | ||
37 | PATH_EXPR@[38; 42) | ||
38 | PATH@[38; 42) | ||
39 | PATH@[38; 39) | ||
40 | PATH_SEGMENT@[38; 39) | ||
41 | NAME_REF@[38; 39) | ||
42 | IDENT@[38; 39) "a" | ||
43 | COLONCOLON@[39; 41) "::" | ||
44 | PATH_SEGMENT@[41; 42) | ||
45 | NAME_REF@[41; 42) | ||
46 | IDENT@[41; 42) "b" | ||
47 | SEMI@[42; 43) ";" | ||
48 | WHITESPACE@[43; 48) "\n " | ||
49 | LET_STMT@[48; 65) | ||
50 | LET_KW@[48; 51) "let" | ||
51 | WHITESPACE@[51; 52) " " | ||
52 | PLACEHOLDER_PAT@[52; 53) | ||
53 | UNDERSCORE@[52; 53) "_" | ||
54 | WHITESPACE@[53; 54) " " | ||
55 | EQ@[54; 55) "=" | ||
56 | WHITESPACE@[55; 56) " " | ||
57 | PATH_EXPR@[56; 64) | ||
58 | PATH@[56; 64) | ||
59 | PATH_SEGMENT@[56; 64) | ||
60 | COLONCOLON@[56; 58) "::" | ||
61 | NAME_REF@[58; 59) | ||
62 | IDENT@[58; 59) "a" | ||
63 | TYPE_ARG_LIST@[59; 64) | ||
64 | COLONCOLON@[59; 61) "::" | ||
65 | L_ANGLE@[61; 62) "<" | ||
66 | TYPE_ARG@[62; 63) | ||
67 | PATH_TYPE@[62; 63) | ||
68 | PATH@[62; 63) | ||
69 | PATH_SEGMENT@[62; 63) | ||
70 | NAME_REF@[62; 63) | ||
71 | IDENT@[62; 63) "b" | ||
72 | R_ANGLE@[63; 64) ">" | ||
73 | SEMI@[64; 65) ";" | ||
74 | WHITESPACE@[65; 70) "\n " | ||
75 | LET_STMT@[70; 88) | ||
76 | LET_KW@[70; 73) "let" | ||
77 | WHITESPACE@[73; 74) " " | ||
78 | PLACEHOLDER_PAT@[74; 75) | ||
79 | UNDERSCORE@[74; 75) "_" | ||
80 | WHITESPACE@[75; 76) " " | ||
81 | EQ@[76; 77) "=" | ||
82 | WHITESPACE@[77; 78) " " | ||
83 | MACRO_CALL@[78; 87) | ||
84 | PATH@[78; 84) | ||
85 | PATH_SEGMENT@[78; 84) | ||
86 | NAME_REF@[78; 84) | ||
87 | IDENT@[78; 84) "format" | ||
88 | EXCL@[84; 85) "!" | ||
89 | TOKEN_TREE@[85; 87) | ||
90 | L_PAREN@[85; 86) "(" | ||
91 | R_PAREN@[86; 87) ")" | ||
92 | SEMI@[87; 88) ";" | ||
93 | WHITESPACE@[88; 89) "\n" | ||
94 | R_CURLY@[89; 90) "}" | ||
95 | WHITESPACE@[90; 91) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0054_field_attrs.rs b/crates/ra_syntax/test_data/parser/inline/ok/0054_field_attrs.rs new file mode 100644 index 000000000..4744d8ac0 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0054_field_attrs.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | struct S { | ||
2 | #[serde(with = "url_serde")] | ||
3 | pub uri: Uri, | ||
4 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0054_field_attrs.txt b/crates/ra_syntax/test_data/parser/inline/ok/0054_field_attrs.txt new file mode 100644 index 000000000..f214d1d47 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0054_field_attrs.txt | |||
@@ -0,0 +1,42 @@ | |||
1 | SOURCE_FILE@[0; 64) | ||
2 | STRUCT_DEF@[0; 63) | ||
3 | STRUCT_KW@[0; 6) "struct" | ||
4 | WHITESPACE@[6; 7) " " | ||
5 | NAME@[7; 8) | ||
6 | IDENT@[7; 8) "S" | ||
7 | WHITESPACE@[8; 9) " " | ||
8 | NAMED_FIELD_DEF_LIST@[9; 63) | ||
9 | L_CURLY@[9; 10) "{" | ||
10 | WHITESPACE@[10; 15) "\n " | ||
11 | NAMED_FIELD_DEF@[15; 60) | ||
12 | ATTR@[15; 43) | ||
13 | POUND@[15; 16) "#" | ||
14 | TOKEN_TREE@[16; 43) | ||
15 | L_BRACK@[16; 17) "[" | ||
16 | IDENT@[17; 22) "serde" | ||
17 | TOKEN_TREE@[22; 42) | ||
18 | L_PAREN@[22; 23) "(" | ||
19 | IDENT@[23; 27) "with" | ||
20 | WHITESPACE@[27; 28) " " | ||
21 | EQ@[28; 29) "=" | ||
22 | WHITESPACE@[29; 30) " " | ||
23 | STRING@[30; 41) "\"url_serde\"" | ||
24 | R_PAREN@[41; 42) ")" | ||
25 | R_BRACK@[42; 43) "]" | ||
26 | WHITESPACE@[43; 48) "\n " | ||
27 | VISIBILITY@[48; 51) | ||
28 | PUB_KW@[48; 51) "pub" | ||
29 | WHITESPACE@[51; 52) " " | ||
30 | NAME@[52; 55) | ||
31 | IDENT@[52; 55) "uri" | ||
32 | COLON@[55; 56) ":" | ||
33 | WHITESPACE@[56; 57) " " | ||
34 | PATH_TYPE@[57; 60) | ||
35 | PATH@[57; 60) | ||
36 | PATH_SEGMENT@[57; 60) | ||
37 | NAME_REF@[57; 60) | ||
38 | IDENT@[57; 60) "Uri" | ||
39 | COMMA@[60; 61) "," | ||
40 | WHITESPACE@[61; 62) "\n" | ||
41 | R_CURLY@[62; 63) "}" | ||
42 | WHITESPACE@[63; 64) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0055_literal_pattern.rs b/crates/ra_syntax/test_data/parser/inline/ok/0055_literal_pattern.rs new file mode 100644 index 000000000..6dfd67b4c --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0055_literal_pattern.rs | |||
@@ -0,0 +1,8 @@ | |||
1 | fn main() { | ||
2 | match () { | ||
3 | -1 => (), | ||
4 | 92 => (), | ||
5 | 'c' => (), | ||
6 | "hello" => (), | ||
7 | } | ||
8 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0055_literal_pattern.txt b/crates/ra_syntax/test_data/parser/inline/ok/0055_literal_pattern.txt new file mode 100644 index 000000000..ab5dad438 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0055_literal_pattern.txt | |||
@@ -0,0 +1,76 @@ | |||
1 | SOURCE_FILE@[0; 113) | ||
2 | FN_DEF@[0; 112) | ||
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@[10; 112) | ||
12 | L_CURLY@[10; 11) "{" | ||
13 | WHITESPACE@[11; 16) "\n " | ||
14 | MATCH_EXPR@[16; 110) | ||
15 | MATCH_KW@[16; 21) "match" | ||
16 | WHITESPACE@[21; 22) " " | ||
17 | TUPLE_EXPR@[22; 24) | ||
18 | L_PAREN@[22; 23) "(" | ||
19 | R_PAREN@[23; 24) ")" | ||
20 | WHITESPACE@[24; 25) " " | ||
21 | MATCH_ARM_LIST@[25; 110) | ||
22 | L_CURLY@[25; 26) "{" | ||
23 | WHITESPACE@[26; 35) "\n " | ||
24 | MATCH_ARM@[35; 43) | ||
25 | LITERAL_PAT@[35; 37) | ||
26 | MINUS@[35; 36) "-" | ||
27 | LITERAL@[36; 37) | ||
28 | INT_NUMBER@[36; 37) "1" | ||
29 | WHITESPACE@[37; 38) " " | ||
30 | FAT_ARROW@[38; 40) "=>" | ||
31 | WHITESPACE@[40; 41) " " | ||
32 | TUPLE_EXPR@[41; 43) | ||
33 | L_PAREN@[41; 42) "(" | ||
34 | R_PAREN@[42; 43) ")" | ||
35 | COMMA@[43; 44) "," | ||
36 | WHITESPACE@[44; 53) "\n " | ||
37 | MATCH_ARM@[53; 61) | ||
38 | LITERAL_PAT@[53; 55) | ||
39 | LITERAL@[53; 55) | ||
40 | INT_NUMBER@[53; 55) "92" | ||
41 | WHITESPACE@[55; 56) " " | ||
42 | FAT_ARROW@[56; 58) "=>" | ||
43 | WHITESPACE@[58; 59) " " | ||
44 | TUPLE_EXPR@[59; 61) | ||
45 | L_PAREN@[59; 60) "(" | ||
46 | R_PAREN@[60; 61) ")" | ||
47 | COMMA@[61; 62) "," | ||
48 | WHITESPACE@[62; 71) "\n " | ||
49 | MATCH_ARM@[71; 80) | ||
50 | LITERAL_PAT@[71; 74) | ||
51 | LITERAL@[71; 74) | ||
52 | CHAR@[71; 74) "\'c\'" | ||
53 | WHITESPACE@[74; 75) " " | ||
54 | FAT_ARROW@[75; 77) "=>" | ||
55 | WHITESPACE@[77; 78) " " | ||
56 | TUPLE_EXPR@[78; 80) | ||
57 | L_PAREN@[78; 79) "(" | ||
58 | R_PAREN@[79; 80) ")" | ||
59 | COMMA@[80; 81) "," | ||
60 | WHITESPACE@[81; 90) "\n " | ||
61 | MATCH_ARM@[90; 103) | ||
62 | LITERAL_PAT@[90; 97) | ||
63 | LITERAL@[90; 97) | ||
64 | STRING@[90; 97) "\"hello\"" | ||
65 | WHITESPACE@[97; 98) " " | ||
66 | FAT_ARROW@[98; 100) "=>" | ||
67 | WHITESPACE@[100; 101) " " | ||
68 | TUPLE_EXPR@[101; 103) | ||
69 | L_PAREN@[101; 102) "(" | ||
70 | R_PAREN@[102; 103) ")" | ||
71 | COMMA@[103; 104) "," | ||
72 | WHITESPACE@[104; 109) "\n " | ||
73 | R_CURLY@[109; 110) "}" | ||
74 | WHITESPACE@[110; 111) "\n" | ||
75 | R_CURLY@[111; 112) "}" | ||
76 | WHITESPACE@[112; 113) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0056_where_clause.rs b/crates/ra_syntax/test_data/parser/inline/ok/0056_where_clause.rs new file mode 100644 index 000000000..19d7e571b --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0056_where_clause.rs | |||
@@ -0,0 +1,7 @@ | |||
1 | fn foo() | ||
2 | where | ||
3 | 'a: 'b + 'c, | ||
4 | T: Clone + Copy + 'static, | ||
5 | Iterator::Item: 'a, | ||
6 | <T as Iterator>::Item: 'a | ||
7 | {} | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0056_where_clause.txt b/crates/ra_syntax/test_data/parser/inline/ok/0056_where_clause.txt new file mode 100644 index 000000000..c86a0db3f --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0056_where_clause.txt | |||
@@ -0,0 +1,110 @@ | |||
1 | SOURCE_FILE@[0; 116) | ||
2 | FN_DEF@[0; 115) | ||
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) "\n" | ||
11 | WHERE_CLAUSE@[9; 112) | ||
12 | WHERE_KW@[9; 14) "where" | ||
13 | WHITESPACE@[14; 18) "\n " | ||
14 | WHERE_PRED@[18; 29) | ||
15 | LIFETIME@[18; 20) "\'a" | ||
16 | COLON@[20; 21) ":" | ||
17 | WHITESPACE@[21; 22) " " | ||
18 | TYPE_BOUND_LIST@[22; 29) | ||
19 | TYPE_BOUND@[22; 24) | ||
20 | LIFETIME@[22; 24) "\'b" | ||
21 | WHITESPACE@[24; 25) " " | ||
22 | PLUS@[25; 26) "+" | ||
23 | WHITESPACE@[26; 27) " " | ||
24 | TYPE_BOUND@[27; 29) | ||
25 | LIFETIME@[27; 29) "\'c" | ||
26 | COMMA@[29; 30) "," | ||
27 | WHITESPACE@[30; 34) "\n " | ||
28 | WHERE_PRED@[34; 59) | ||
29 | PATH_TYPE@[34; 35) | ||
30 | PATH@[34; 35) | ||
31 | PATH_SEGMENT@[34; 35) | ||
32 | NAME_REF@[34; 35) | ||
33 | IDENT@[34; 35) "T" | ||
34 | COLON@[35; 36) ":" | ||
35 | WHITESPACE@[36; 37) " " | ||
36 | TYPE_BOUND_LIST@[37; 59) | ||
37 | TYPE_BOUND@[37; 42) | ||
38 | PATH_TYPE@[37; 42) | ||
39 | PATH@[37; 42) | ||
40 | PATH_SEGMENT@[37; 42) | ||
41 | NAME_REF@[37; 42) | ||
42 | IDENT@[37; 42) "Clone" | ||
43 | WHITESPACE@[42; 43) " " | ||
44 | PLUS@[43; 44) "+" | ||
45 | WHITESPACE@[44; 45) " " | ||
46 | TYPE_BOUND@[45; 49) | ||
47 | PATH_TYPE@[45; 49) | ||
48 | PATH@[45; 49) | ||
49 | PATH_SEGMENT@[45; 49) | ||
50 | NAME_REF@[45; 49) | ||
51 | IDENT@[45; 49) "Copy" | ||
52 | WHITESPACE@[49; 50) " " | ||
53 | PLUS@[50; 51) "+" | ||
54 | WHITESPACE@[51; 52) " " | ||
55 | TYPE_BOUND@[52; 59) | ||
56 | LIFETIME@[52; 59) "\'static" | ||
57 | COMMA@[59; 60) "," | ||
58 | WHITESPACE@[60; 64) "\n " | ||
59 | WHERE_PRED@[64; 82) | ||
60 | PATH_TYPE@[64; 78) | ||
61 | PATH@[64; 78) | ||
62 | PATH@[64; 72) | ||
63 | PATH_SEGMENT@[64; 72) | ||
64 | NAME_REF@[64; 72) | ||
65 | IDENT@[64; 72) "Iterator" | ||
66 | COLONCOLON@[72; 74) "::" | ||
67 | PATH_SEGMENT@[74; 78) | ||
68 | NAME_REF@[74; 78) | ||
69 | IDENT@[74; 78) "Item" | ||
70 | COLON@[78; 79) ":" | ||
71 | WHITESPACE@[79; 80) " " | ||
72 | TYPE_BOUND_LIST@[80; 82) | ||
73 | TYPE_BOUND@[80; 82) | ||
74 | LIFETIME@[80; 82) "\'a" | ||
75 | COMMA@[82; 83) "," | ||
76 | WHITESPACE@[83; 87) "\n " | ||
77 | WHERE_PRED@[87; 112) | ||
78 | PATH_TYPE@[87; 108) | ||
79 | PATH@[87; 108) | ||
80 | PATH@[87; 102) | ||
81 | PATH_SEGMENT@[87; 102) | ||
82 | L_ANGLE@[87; 88) "<" | ||
83 | PATH_TYPE@[88; 89) | ||
84 | PATH@[88; 89) | ||
85 | PATH_SEGMENT@[88; 89) | ||
86 | NAME_REF@[88; 89) | ||
87 | IDENT@[88; 89) "T" | ||
88 | WHITESPACE@[89; 90) " " | ||
89 | AS_KW@[90; 92) "as" | ||
90 | WHITESPACE@[92; 93) " " | ||
91 | PATH_TYPE@[93; 101) | ||
92 | PATH@[93; 101) | ||
93 | PATH_SEGMENT@[93; 101) | ||
94 | NAME_REF@[93; 101) | ||
95 | IDENT@[93; 101) "Iterator" | ||
96 | R_ANGLE@[101; 102) ">" | ||
97 | COLONCOLON@[102; 104) "::" | ||
98 | PATH_SEGMENT@[104; 108) | ||
99 | NAME_REF@[104; 108) | ||
100 | IDENT@[104; 108) "Item" | ||
101 | COLON@[108; 109) ":" | ||
102 | WHITESPACE@[109; 110) " " | ||
103 | TYPE_BOUND_LIST@[110; 112) | ||
104 | TYPE_BOUND@[110; 112) | ||
105 | LIFETIME@[110; 112) "\'a" | ||
106 | WHITESPACE@[112; 113) "\n" | ||
107 | BLOCK@[113; 115) | ||
108 | L_CURLY@[113; 114) "{" | ||
109 | R_CURLY@[114; 115) "}" | ||
110 | WHITESPACE@[115; 116) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0057_const_fn.rs b/crates/ra_syntax/test_data/parser/inline/ok/0057_const_fn.rs new file mode 100644 index 000000000..8c84d9cd7 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0057_const_fn.rs | |||
@@ -0,0 +1 @@ | |||
const fn foo() {} | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0057_const_fn.txt b/crates/ra_syntax/test_data/parser/inline/ok/0057_const_fn.txt new file mode 100644 index 000000000..7a8b81983 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0057_const_fn.txt | |||
@@ -0,0 +1,16 @@ | |||
1 | SOURCE_FILE@[0; 18) | ||
2 | FN_DEF@[0; 17) | ||
3 | CONST_KW@[0; 5) "const" | ||
4 | WHITESPACE@[5; 6) " " | ||
5 | FN_KW@[6; 8) "fn" | ||
6 | WHITESPACE@[8; 9) " " | ||
7 | NAME@[9; 12) | ||
8 | IDENT@[9; 12) "foo" | ||
9 | PARAM_LIST@[12; 14) | ||
10 | L_PAREN@[12; 13) "(" | ||
11 | R_PAREN@[13; 14) ")" | ||
12 | WHITESPACE@[14; 15) " " | ||
13 | BLOCK@[15; 17) | ||
14 | L_CURLY@[15; 16) "{" | ||
15 | R_CURLY@[16; 17) "}" | ||
16 | WHITESPACE@[17; 18) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0058_range_pat.rs b/crates/ra_syntax/test_data/parser/inline/ok/0058_range_pat.rs new file mode 100644 index 000000000..c12ab6fce --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0058_range_pat.rs | |||
@@ -0,0 +1,7 @@ | |||
1 | fn main() { | ||
2 | match 92 { | ||
3 | 0 ... 100 => (), | ||
4 | 101 ..= 200 => (), | ||
5 | 200 .. 301=> (), | ||
6 | } | ||
7 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0058_range_pat.txt b/crates/ra_syntax/test_data/parser/inline/ok/0058_range_pat.txt new file mode 100644 index 000000000..1b7e9b905 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0058_range_pat.txt | |||
@@ -0,0 +1,82 @@ | |||
1 | SOURCE_FILE@[0; 112) | ||
2 | FN_DEF@[0; 111) | ||
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@[10; 111) | ||
12 | L_CURLY@[10; 11) "{" | ||
13 | WHITESPACE@[11; 16) "\n " | ||
14 | MATCH_EXPR@[16; 109) | ||
15 | MATCH_KW@[16; 21) "match" | ||
16 | WHITESPACE@[21; 22) " " | ||
17 | LITERAL@[22; 24) | ||
18 | INT_NUMBER@[22; 24) "92" | ||
19 | WHITESPACE@[24; 25) " " | ||
20 | MATCH_ARM_LIST@[25; 109) | ||
21 | L_CURLY@[25; 26) "{" | ||
22 | WHITESPACE@[26; 35) "\n " | ||
23 | MATCH_ARM@[35; 50) | ||
24 | RANGE_PAT@[35; 44) | ||
25 | LITERAL_PAT@[35; 36) | ||
26 | LITERAL@[35; 36) | ||
27 | INT_NUMBER@[35; 36) "0" | ||
28 | WHITESPACE@[36; 37) " " | ||
29 | DOTDOTDOT@[37; 40) "..." | ||
30 | WHITESPACE@[40; 41) " " | ||
31 | LITERAL_PAT@[41; 44) | ||
32 | LITERAL@[41; 44) | ||
33 | INT_NUMBER@[41; 44) "100" | ||
34 | WHITESPACE@[44; 45) " " | ||
35 | FAT_ARROW@[45; 47) "=>" | ||
36 | WHITESPACE@[47; 48) " " | ||
37 | TUPLE_EXPR@[48; 50) | ||
38 | L_PAREN@[48; 49) "(" | ||
39 | R_PAREN@[49; 50) ")" | ||
40 | COMMA@[50; 51) "," | ||
41 | WHITESPACE@[51; 60) "\n " | ||
42 | MATCH_ARM@[60; 77) | ||
43 | RANGE_PAT@[60; 71) | ||
44 | LITERAL_PAT@[60; 63) | ||
45 | LITERAL@[60; 63) | ||
46 | INT_NUMBER@[60; 63) "101" | ||
47 | WHITESPACE@[63; 64) " " | ||
48 | DOTDOTEQ@[64; 67) "..=" | ||
49 | WHITESPACE@[67; 68) " " | ||
50 | LITERAL_PAT@[68; 71) | ||
51 | LITERAL@[68; 71) | ||
52 | INT_NUMBER@[68; 71) "200" | ||
53 | WHITESPACE@[71; 72) " " | ||
54 | FAT_ARROW@[72; 74) "=>" | ||
55 | WHITESPACE@[74; 75) " " | ||
56 | TUPLE_EXPR@[75; 77) | ||
57 | L_PAREN@[75; 76) "(" | ||
58 | R_PAREN@[76; 77) ")" | ||
59 | COMMA@[77; 78) "," | ||
60 | WHITESPACE@[78; 87) "\n " | ||
61 | MATCH_ARM@[87; 102) | ||
62 | RANGE_PAT@[87; 97) | ||
63 | LITERAL_PAT@[87; 90) | ||
64 | LITERAL@[87; 90) | ||
65 | INT_NUMBER@[87; 90) "200" | ||
66 | WHITESPACE@[90; 91) " " | ||
67 | DOTDOT@[91; 93) ".." | ||
68 | WHITESPACE@[93; 94) " " | ||
69 | LITERAL_PAT@[94; 97) | ||
70 | LITERAL@[94; 97) | ||
71 | INT_NUMBER@[94; 97) "301" | ||
72 | FAT_ARROW@[97; 99) "=>" | ||
73 | WHITESPACE@[99; 100) " " | ||
74 | TUPLE_EXPR@[100; 102) | ||
75 | L_PAREN@[100; 101) "(" | ||
76 | R_PAREN@[101; 102) ")" | ||
77 | COMMA@[102; 103) "," | ||
78 | WHITESPACE@[103; 108) "\n " | ||
79 | R_CURLY@[108; 109) "}" | ||
80 | WHITESPACE@[109; 110) "\n" | ||
81 | R_CURLY@[110; 111) "}" | ||
82 | WHITESPACE@[111; 112) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0059_match_arms_commas.rs b/crates/ra_syntax/test_data/parser/inline/ok/0059_match_arms_commas.rs new file mode 100644 index 000000000..1f25d577a --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0059_match_arms_commas.rs | |||
@@ -0,0 +1,7 @@ | |||
1 | fn foo() { | ||
2 | match () { | ||
3 | _ => (), | ||
4 | _ => {} | ||
5 | _ => () | ||
6 | } | ||
7 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0059_match_arms_commas.txt b/crates/ra_syntax/test_data/parser/inline/ok/0059_match_arms_commas.txt new file mode 100644 index 000000000..949117134 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0059_match_arms_commas.txt | |||
@@ -0,0 +1,59 @@ | |||
1 | SOURCE_FILE@[0; 83) | ||
2 | FN_DEF@[0; 82) | ||
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; 82) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 15) "\n " | ||
14 | MATCH_EXPR@[15; 80) | ||
15 | MATCH_KW@[15; 20) "match" | ||
16 | WHITESPACE@[20; 21) " " | ||
17 | TUPLE_EXPR@[21; 23) | ||
18 | L_PAREN@[21; 22) "(" | ||
19 | R_PAREN@[22; 23) ")" | ||
20 | WHITESPACE@[23; 24) " " | ||
21 | MATCH_ARM_LIST@[24; 80) | ||
22 | L_CURLY@[24; 25) "{" | ||
23 | WHITESPACE@[25; 34) "\n " | ||
24 | MATCH_ARM@[34; 41) | ||
25 | PLACEHOLDER_PAT@[34; 35) | ||
26 | UNDERSCORE@[34; 35) "_" | ||
27 | WHITESPACE@[35; 36) " " | ||
28 | FAT_ARROW@[36; 38) "=>" | ||
29 | WHITESPACE@[38; 39) " " | ||
30 | TUPLE_EXPR@[39; 41) | ||
31 | L_PAREN@[39; 40) "(" | ||
32 | R_PAREN@[40; 41) ")" | ||
33 | COMMA@[41; 42) "," | ||
34 | WHITESPACE@[42; 51) "\n " | ||
35 | MATCH_ARM@[51; 58) | ||
36 | PLACEHOLDER_PAT@[51; 52) | ||
37 | UNDERSCORE@[51; 52) "_" | ||
38 | WHITESPACE@[52; 53) " " | ||
39 | FAT_ARROW@[53; 55) "=>" | ||
40 | WHITESPACE@[55; 56) " " | ||
41 | BLOCK_EXPR@[56; 58) | ||
42 | BLOCK@[56; 58) | ||
43 | L_CURLY@[56; 57) "{" | ||
44 | R_CURLY@[57; 58) "}" | ||
45 | WHITESPACE@[58; 67) "\n " | ||
46 | MATCH_ARM@[67; 74) | ||
47 | PLACEHOLDER_PAT@[67; 68) | ||
48 | UNDERSCORE@[67; 68) "_" | ||
49 | WHITESPACE@[68; 69) " " | ||
50 | FAT_ARROW@[69; 71) "=>" | ||
51 | WHITESPACE@[71; 72) " " | ||
52 | TUPLE_EXPR@[72; 74) | ||
53 | L_PAREN@[72; 73) "(" | ||
54 | R_PAREN@[73; 74) ")" | ||
55 | WHITESPACE@[74; 79) "\n " | ||
56 | R_CURLY@[79; 80) "}" | ||
57 | WHITESPACE@[80; 81) "\n" | ||
58 | R_CURLY@[81; 82) "}" | ||
59 | WHITESPACE@[82; 83) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0060_extern_crate.rs b/crates/ra_syntax/test_data/parser/inline/ok/0060_extern_crate.rs new file mode 100644 index 000000000..49af74e1b --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0060_extern_crate.rs | |||
@@ -0,0 +1 @@ | |||
extern crate foo; | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0060_extern_crate.txt b/crates/ra_syntax/test_data/parser/inline/ok/0060_extern_crate.txt new file mode 100644 index 000000000..7667201ba --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0060_extern_crate.txt | |||
@@ -0,0 +1,10 @@ | |||
1 | SOURCE_FILE@[0; 18) | ||
2 | EXTERN_CRATE_ITEM@[0; 17) | ||
3 | EXTERN_KW@[0; 6) "extern" | ||
4 | WHITESPACE@[6; 7) " " | ||
5 | CRATE_KW@[7; 12) "crate" | ||
6 | WHITESPACE@[12; 13) " " | ||
7 | NAME_REF@[13; 16) | ||
8 | IDENT@[13; 16) "foo" | ||
9 | SEMI@[16; 17) ";" | ||
10 | WHITESPACE@[17; 18) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0061_struct_lit.rs b/crates/ra_syntax/test_data/parser/inline/ok/0061_struct_lit.rs new file mode 100644 index 000000000..eb711f68a --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0061_struct_lit.rs | |||
@@ -0,0 +1,5 @@ | |||
1 | fn foo() { | ||
2 | S {}; | ||
3 | S { x, y: 32, }; | ||
4 | S { x, y: 32, ..Default::default() }; | ||
5 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0061_struct_lit.txt b/crates/ra_syntax/test_data/parser/inline/ok/0061_struct_lit.txt new file mode 100644 index 000000000..94d1bfe2e --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0061_struct_lit.txt | |||
@@ -0,0 +1,97 @@ | |||
1 | SOURCE_FILE@[0; 86) | ||
2 | FN_DEF@[0; 85) | ||
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; 85) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 15) "\n " | ||
14 | EXPR_STMT@[15; 20) | ||
15 | STRUCT_LIT@[15; 19) | ||
16 | PATH@[15; 16) | ||
17 | PATH_SEGMENT@[15; 16) | ||
18 | NAME_REF@[15; 16) | ||
19 | IDENT@[15; 16) "S" | ||
20 | WHITESPACE@[16; 17) " " | ||
21 | NAMED_FIELD_LIST@[17; 19) | ||
22 | L_CURLY@[17; 18) "{" | ||
23 | R_CURLY@[18; 19) "}" | ||
24 | SEMI@[19; 20) ";" | ||
25 | WHITESPACE@[20; 25) "\n " | ||
26 | EXPR_STMT@[25; 41) | ||
27 | STRUCT_LIT@[25; 40) | ||
28 | PATH@[25; 26) | ||
29 | PATH_SEGMENT@[25; 26) | ||
30 | NAME_REF@[25; 26) | ||
31 | IDENT@[25; 26) "S" | ||
32 | WHITESPACE@[26; 27) " " | ||
33 | NAMED_FIELD_LIST@[27; 40) | ||
34 | L_CURLY@[27; 28) "{" | ||
35 | WHITESPACE@[28; 29) " " | ||
36 | NAMED_FIELD@[29; 30) | ||
37 | NAME_REF@[29; 30) | ||
38 | IDENT@[29; 30) "x" | ||
39 | COMMA@[30; 31) "," | ||
40 | WHITESPACE@[31; 32) " " | ||
41 | NAMED_FIELD@[32; 37) | ||
42 | NAME_REF@[32; 33) | ||
43 | IDENT@[32; 33) "y" | ||
44 | COLON@[33; 34) ":" | ||
45 | WHITESPACE@[34; 35) " " | ||
46 | LITERAL@[35; 37) | ||
47 | INT_NUMBER@[35; 37) "32" | ||
48 | COMMA@[37; 38) "," | ||
49 | WHITESPACE@[38; 39) " " | ||
50 | R_CURLY@[39; 40) "}" | ||
51 | SEMI@[40; 41) ";" | ||
52 | WHITESPACE@[41; 46) "\n " | ||
53 | EXPR_STMT@[46; 83) | ||
54 | STRUCT_LIT@[46; 82) | ||
55 | PATH@[46; 47) | ||
56 | PATH_SEGMENT@[46; 47) | ||
57 | NAME_REF@[46; 47) | ||
58 | IDENT@[46; 47) "S" | ||
59 | WHITESPACE@[47; 48) " " | ||
60 | NAMED_FIELD_LIST@[48; 82) | ||
61 | L_CURLY@[48; 49) "{" | ||
62 | WHITESPACE@[49; 50) " " | ||
63 | NAMED_FIELD@[50; 51) | ||
64 | NAME_REF@[50; 51) | ||
65 | IDENT@[50; 51) "x" | ||
66 | COMMA@[51; 52) "," | ||
67 | WHITESPACE@[52; 53) " " | ||
68 | NAMED_FIELD@[53; 58) | ||
69 | NAME_REF@[53; 54) | ||
70 | IDENT@[53; 54) "y" | ||
71 | COLON@[54; 55) ":" | ||
72 | WHITESPACE@[55; 56) " " | ||
73 | LITERAL@[56; 58) | ||
74 | INT_NUMBER@[56; 58) "32" | ||
75 | COMMA@[58; 59) "," | ||
76 | WHITESPACE@[59; 60) " " | ||
77 | DOTDOT@[60; 62) ".." | ||
78 | CALL_EXPR@[62; 80) | ||
79 | PATH_EXPR@[62; 78) | ||
80 | PATH@[62; 78) | ||
81 | PATH@[62; 69) | ||
82 | PATH_SEGMENT@[62; 69) | ||
83 | NAME_REF@[62; 69) | ||
84 | IDENT@[62; 69) "Default" | ||
85 | COLONCOLON@[69; 71) "::" | ||
86 | PATH_SEGMENT@[71; 78) | ||
87 | NAME_REF@[71; 78) | ||
88 | IDENT@[71; 78) "default" | ||
89 | ARG_LIST@[78; 80) | ||
90 | L_PAREN@[78; 79) "(" | ||
91 | R_PAREN@[79; 80) ")" | ||
92 | WHITESPACE@[80; 81) " " | ||
93 | R_CURLY@[81; 82) "}" | ||
94 | SEMI@[82; 83) ";" | ||
95 | WHITESPACE@[83; 84) "\n" | ||
96 | R_CURLY@[84; 85) "}" | ||
97 | WHITESPACE@[85; 86) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0062_mod_contents.rs b/crates/ra_syntax/test_data/parser/inline/ok/0062_mod_contents.rs new file mode 100644 index 000000000..24a15c5c5 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0062_mod_contents.rs | |||
@@ -0,0 +1,5 @@ | |||
1 | fn foo() {} | ||
2 | macro_rules! foo {} | ||
3 | foo::bar!(); | ||
4 | super::baz! {} | ||
5 | struct S; | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0062_mod_contents.txt b/crates/ra_syntax/test_data/parser/inline/ok/0062_mod_contents.txt new file mode 100644 index 000000000..db2b9a582 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0062_mod_contents.txt | |||
@@ -0,0 +1,66 @@ | |||
1 | SOURCE_FILE@[0; 70) | ||
2 | FN_DEF@[0; 11) | ||
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; 11) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | R_CURLY@[10; 11) "}" | ||
14 | WHITESPACE@[11; 12) "\n" | ||
15 | MACRO_CALL@[12; 31) | ||
16 | PATH@[12; 23) | ||
17 | PATH_SEGMENT@[12; 23) | ||
18 | NAME_REF@[12; 23) | ||
19 | IDENT@[12; 23) "macro_rules" | ||
20 | EXCL@[23; 24) "!" | ||
21 | WHITESPACE@[24; 25) " " | ||
22 | NAME@[25; 28) | ||
23 | IDENT@[25; 28) "foo" | ||
24 | WHITESPACE@[28; 29) " " | ||
25 | TOKEN_TREE@[29; 31) | ||
26 | L_CURLY@[29; 30) "{" | ||
27 | R_CURLY@[30; 31) "}" | ||
28 | WHITESPACE@[31; 32) "\n" | ||
29 | MACRO_CALL@[32; 44) | ||
30 | PATH@[32; 40) | ||
31 | PATH@[32; 35) | ||
32 | PATH_SEGMENT@[32; 35) | ||
33 | NAME_REF@[32; 35) | ||
34 | IDENT@[32; 35) "foo" | ||
35 | COLONCOLON@[35; 37) "::" | ||
36 | PATH_SEGMENT@[37; 40) | ||
37 | NAME_REF@[37; 40) | ||
38 | IDENT@[37; 40) "bar" | ||
39 | EXCL@[40; 41) "!" | ||
40 | TOKEN_TREE@[41; 43) | ||
41 | L_PAREN@[41; 42) "(" | ||
42 | R_PAREN@[42; 43) ")" | ||
43 | SEMI@[43; 44) ";" | ||
44 | WHITESPACE@[44; 45) "\n" | ||
45 | MACRO_CALL@[45; 59) | ||
46 | PATH@[45; 55) | ||
47 | PATH@[45; 50) | ||
48 | PATH_SEGMENT@[45; 50) | ||
49 | SUPER_KW@[45; 50) "super" | ||
50 | COLONCOLON@[50; 52) "::" | ||
51 | PATH_SEGMENT@[52; 55) | ||
52 | NAME_REF@[52; 55) | ||
53 | IDENT@[52; 55) "baz" | ||
54 | EXCL@[55; 56) "!" | ||
55 | WHITESPACE@[56; 57) " " | ||
56 | TOKEN_TREE@[57; 59) | ||
57 | L_CURLY@[57; 58) "{" | ||
58 | R_CURLY@[58; 59) "}" | ||
59 | WHITESPACE@[59; 60) "\n" | ||
60 | STRUCT_DEF@[60; 69) | ||
61 | STRUCT_KW@[60; 66) "struct" | ||
62 | WHITESPACE@[66; 67) " " | ||
63 | NAME@[67; 68) | ||
64 | IDENT@[67; 68) "S" | ||
65 | SEMI@[68; 69) ";" | ||
66 | WHITESPACE@[69; 70) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0063_impl_block_neg.rs b/crates/ra_syntax/test_data/parser/inline/ok/0063_impl_block_neg.rs new file mode 100644 index 000000000..b7527c870 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0063_impl_block_neg.rs | |||
@@ -0,0 +1 @@ | |||
impl !Send for X {} | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0063_impl_block_neg.txt b/crates/ra_syntax/test_data/parser/inline/ok/0063_impl_block_neg.txt new file mode 100644 index 000000000..dfff947fe --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0063_impl_block_neg.txt | |||
@@ -0,0 +1,23 @@ | |||
1 | SOURCE_FILE@[0; 20) | ||
2 | IMPL_BLOCK@[0; 19) | ||
3 | IMPL_KW@[0; 4) "impl" | ||
4 | WHITESPACE@[4; 5) " " | ||
5 | EXCL@[5; 6) "!" | ||
6 | PATH_TYPE@[6; 10) | ||
7 | PATH@[6; 10) | ||
8 | PATH_SEGMENT@[6; 10) | ||
9 | NAME_REF@[6; 10) | ||
10 | IDENT@[6; 10) "Send" | ||
11 | WHITESPACE@[10; 11) " " | ||
12 | FOR_KW@[11; 14) "for" | ||
13 | WHITESPACE@[14; 15) " " | ||
14 | PATH_TYPE@[15; 16) | ||
15 | PATH@[15; 16) | ||
16 | PATH_SEGMENT@[15; 16) | ||
17 | NAME_REF@[15; 16) | ||
18 | IDENT@[15; 16) "X" | ||
19 | WHITESPACE@[16; 17) " " | ||
20 | ITEM_LIST@[17; 19) | ||
21 | L_CURLY@[17; 18) "{" | ||
22 | R_CURLY@[18; 19) "}" | ||
23 | WHITESPACE@[19; 20) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0064_if_expr.rs b/crates/ra_syntax/test_data/parser/inline/ok/0064_if_expr.rs new file mode 100644 index 000000000..4b0d9af89 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0064_if_expr.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | fn foo() { | ||
2 | if true {}; | ||
3 | if true {} else {}; | ||
4 | if true {} else if false {} else {}; | ||
5 | if S {}; | ||
6 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0064_if_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0064_if_expr.txt new file mode 100644 index 000000000..554bda6fb --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0064_if_expr.txt | |||
@@ -0,0 +1,95 @@ | |||
1 | SOURCE_FILE@[0; 107) | ||
2 | FN_DEF@[0; 106) | ||
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; 106) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 15) "\n " | ||
14 | EXPR_STMT@[15; 26) | ||
15 | IF_EXPR@[15; 25) | ||
16 | IF_KW@[15; 17) "if" | ||
17 | WHITESPACE@[17; 18) " " | ||
18 | CONDITION@[18; 22) | ||
19 | LITERAL@[18; 22) | ||
20 | TRUE_KW@[18; 22) "true" | ||
21 | WHITESPACE@[22; 23) " " | ||
22 | BLOCK@[23; 25) | ||
23 | L_CURLY@[23; 24) "{" | ||
24 | R_CURLY@[24; 25) "}" | ||
25 | SEMI@[25; 26) ";" | ||
26 | WHITESPACE@[26; 31) "\n " | ||
27 | EXPR_STMT@[31; 50) | ||
28 | IF_EXPR@[31; 49) | ||
29 | IF_KW@[31; 33) "if" | ||
30 | WHITESPACE@[33; 34) " " | ||
31 | CONDITION@[34; 38) | ||
32 | LITERAL@[34; 38) | ||
33 | TRUE_KW@[34; 38) "true" | ||
34 | WHITESPACE@[38; 39) " " | ||
35 | BLOCK@[39; 41) | ||
36 | L_CURLY@[39; 40) "{" | ||
37 | R_CURLY@[40; 41) "}" | ||
38 | WHITESPACE@[41; 42) " " | ||
39 | ELSE_KW@[42; 46) "else" | ||
40 | WHITESPACE@[46; 47) " " | ||
41 | BLOCK@[47; 49) | ||
42 | L_CURLY@[47; 48) "{" | ||
43 | R_CURLY@[48; 49) "}" | ||
44 | SEMI@[49; 50) ";" | ||
45 | WHITESPACE@[50; 55) "\n " | ||
46 | EXPR_STMT@[55; 91) | ||
47 | IF_EXPR@[55; 90) | ||
48 | IF_KW@[55; 57) "if" | ||
49 | WHITESPACE@[57; 58) " " | ||
50 | CONDITION@[58; 62) | ||
51 | LITERAL@[58; 62) | ||
52 | TRUE_KW@[58; 62) "true" | ||
53 | WHITESPACE@[62; 63) " " | ||
54 | BLOCK@[63; 65) | ||
55 | L_CURLY@[63; 64) "{" | ||
56 | R_CURLY@[64; 65) "}" | ||
57 | WHITESPACE@[65; 66) " " | ||
58 | ELSE_KW@[66; 70) "else" | ||
59 | WHITESPACE@[70; 71) " " | ||
60 | IF_EXPR@[71; 90) | ||
61 | IF_KW@[71; 73) "if" | ||
62 | WHITESPACE@[73; 74) " " | ||
63 | CONDITION@[74; 79) | ||
64 | LITERAL@[74; 79) | ||
65 | FALSE_KW@[74; 79) "false" | ||
66 | WHITESPACE@[79; 80) " " | ||
67 | BLOCK@[80; 82) | ||
68 | L_CURLY@[80; 81) "{" | ||
69 | R_CURLY@[81; 82) "}" | ||
70 | WHITESPACE@[82; 83) " " | ||
71 | ELSE_KW@[83; 87) "else" | ||
72 | WHITESPACE@[87; 88) " " | ||
73 | BLOCK@[88; 90) | ||
74 | L_CURLY@[88; 89) "{" | ||
75 | R_CURLY@[89; 90) "}" | ||
76 | SEMI@[90; 91) ";" | ||
77 | WHITESPACE@[91; 96) "\n " | ||
78 | EXPR_STMT@[96; 104) | ||
79 | IF_EXPR@[96; 103) | ||
80 | IF_KW@[96; 98) "if" | ||
81 | WHITESPACE@[98; 99) " " | ||
82 | CONDITION@[99; 100) | ||
83 | PATH_EXPR@[99; 100) | ||
84 | PATH@[99; 100) | ||
85 | PATH_SEGMENT@[99; 100) | ||
86 | NAME_REF@[99; 100) | ||
87 | IDENT@[99; 100) "S" | ||
88 | WHITESPACE@[100; 101) " " | ||
89 | BLOCK@[101; 103) | ||
90 | L_CURLY@[101; 102) "{" | ||
91 | R_CURLY@[102; 103) "}" | ||
92 | SEMI@[103; 104) ";" | ||
93 | WHITESPACE@[104; 105) "\n" | ||
94 | R_CURLY@[105; 106) "}" | ||
95 | WHITESPACE@[106; 107) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0065_dyn_trait_type.rs b/crates/ra_syntax/test_data/parser/inline/ok/0065_dyn_trait_type.rs new file mode 100644 index 000000000..c3ecabb99 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0065_dyn_trait_type.rs | |||
@@ -0,0 +1 @@ | |||
type A = dyn Iterator<Item=Foo<'a>> + 'a; | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0065_dyn_trait_type.txt b/crates/ra_syntax/test_data/parser/inline/ok/0065_dyn_trait_type.txt new file mode 100644 index 000000000..2ee0dc199 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0065_dyn_trait_type.txt | |||
@@ -0,0 +1,43 @@ | |||
1 | SOURCE_FILE@[0; 42) | ||
2 | TYPE_ALIAS_DEF@[0; 41) | ||
3 | TYPE_KW@[0; 4) "type" | ||
4 | WHITESPACE@[4; 5) " " | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "A" | ||
7 | WHITESPACE@[6; 7) " " | ||
8 | EQ@[7; 8) "=" | ||
9 | WHITESPACE@[8; 9) " " | ||
10 | DYN_TRAIT_TYPE@[9; 40) | ||
11 | DYN_KW@[9; 12) "dyn" | ||
12 | WHITESPACE@[12; 13) " " | ||
13 | TYPE_BOUND_LIST@[13; 40) | ||
14 | TYPE_BOUND@[13; 35) | ||
15 | PATH_TYPE@[13; 35) | ||
16 | PATH@[13; 35) | ||
17 | PATH_SEGMENT@[13; 35) | ||
18 | NAME_REF@[13; 21) | ||
19 | IDENT@[13; 21) "Iterator" | ||
20 | TYPE_ARG_LIST@[21; 35) | ||
21 | L_ANGLE@[21; 22) "<" | ||
22 | ASSOC_TYPE_ARG@[22; 34) | ||
23 | NAME_REF@[22; 26) | ||
24 | IDENT@[22; 26) "Item" | ||
25 | EQ@[26; 27) "=" | ||
26 | PATH_TYPE@[27; 34) | ||
27 | PATH@[27; 34) | ||
28 | PATH_SEGMENT@[27; 34) | ||
29 | NAME_REF@[27; 30) | ||
30 | IDENT@[27; 30) "Foo" | ||
31 | TYPE_ARG_LIST@[30; 34) | ||
32 | L_ANGLE@[30; 31) "<" | ||
33 | LIFETIME_ARG@[31; 33) | ||
34 | LIFETIME@[31; 33) "\'a" | ||
35 | R_ANGLE@[33; 34) ">" | ||
36 | R_ANGLE@[34; 35) ">" | ||
37 | WHITESPACE@[35; 36) " " | ||
38 | PLUS@[36; 37) "+" | ||
39 | WHITESPACE@[37; 38) " " | ||
40 | TYPE_BOUND@[38; 40) | ||
41 | LIFETIME@[38; 40) "\'a" | ||
42 | SEMI@[40; 41) ";" | ||
43 | WHITESPACE@[41; 42) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0066_match_arm.rs b/crates/ra_syntax/test_data/parser/inline/ok/0066_match_arm.rs new file mode 100644 index 000000000..9e009e24f --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0066_match_arm.rs | |||
@@ -0,0 +1,9 @@ | |||
1 | fn foo() { | ||
2 | match () { | ||
3 | _ => (), | ||
4 | _ if Test > Test{field: 0} => (), | ||
5 | X | Y if Z => (), | ||
6 | | X | Y if Z => (), | ||
7 | | X => (), | ||
8 | }; | ||
9 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0066_match_arm.txt b/crates/ra_syntax/test_data/parser/inline/ok/0066_match_arm.txt new file mode 100644 index 000000000..041e7179e --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0066_match_arm.txt | |||
@@ -0,0 +1,149 @@ | |||
1 | SOURCE_FILE@[0; 167) | ||
2 | FN_DEF@[0; 166) | ||
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; 166) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 15) "\n " | ||
14 | EXPR_STMT@[15; 164) | ||
15 | MATCH_EXPR@[15; 163) | ||
16 | MATCH_KW@[15; 20) "match" | ||
17 | WHITESPACE@[20; 21) " " | ||
18 | TUPLE_EXPR@[21; 23) | ||
19 | L_PAREN@[21; 22) "(" | ||
20 | R_PAREN@[22; 23) ")" | ||
21 | WHITESPACE@[23; 24) " " | ||
22 | MATCH_ARM_LIST@[24; 163) | ||
23 | L_CURLY@[24; 25) "{" | ||
24 | WHITESPACE@[25; 34) "\n " | ||
25 | MATCH_ARM@[34; 41) | ||
26 | PLACEHOLDER_PAT@[34; 35) | ||
27 | UNDERSCORE@[34; 35) "_" | ||
28 | WHITESPACE@[35; 36) " " | ||
29 | FAT_ARROW@[36; 38) "=>" | ||
30 | WHITESPACE@[38; 39) " " | ||
31 | TUPLE_EXPR@[39; 41) | ||
32 | L_PAREN@[39; 40) "(" | ||
33 | R_PAREN@[40; 41) ")" | ||
34 | COMMA@[41; 42) "," | ||
35 | WHITESPACE@[42; 51) "\n " | ||
36 | MATCH_ARM@[51; 83) | ||
37 | PLACEHOLDER_PAT@[51; 52) | ||
38 | UNDERSCORE@[51; 52) "_" | ||
39 | WHITESPACE@[52; 53) " " | ||
40 | MATCH_GUARD@[53; 77) | ||
41 | IF_KW@[53; 55) "if" | ||
42 | WHITESPACE@[55; 56) " " | ||
43 | BIN_EXPR@[56; 77) | ||
44 | PATH_EXPR@[56; 60) | ||
45 | PATH@[56; 60) | ||
46 | PATH_SEGMENT@[56; 60) | ||
47 | NAME_REF@[56; 60) | ||
48 | IDENT@[56; 60) "Test" | ||
49 | WHITESPACE@[60; 61) " " | ||
50 | R_ANGLE@[61; 62) ">" | ||
51 | WHITESPACE@[62; 63) " " | ||
52 | STRUCT_LIT@[63; 77) | ||
53 | PATH@[63; 67) | ||
54 | PATH_SEGMENT@[63; 67) | ||
55 | NAME_REF@[63; 67) | ||
56 | IDENT@[63; 67) "Test" | ||
57 | NAMED_FIELD_LIST@[67; 77) | ||
58 | L_CURLY@[67; 68) "{" | ||
59 | NAMED_FIELD@[68; 76) | ||
60 | NAME_REF@[68; 73) | ||
61 | IDENT@[68; 73) "field" | ||
62 | COLON@[73; 74) ":" | ||
63 | WHITESPACE@[74; 75) " " | ||
64 | LITERAL@[75; 76) | ||
65 | INT_NUMBER@[75; 76) "0" | ||
66 | R_CURLY@[76; 77) "}" | ||
67 | WHITESPACE@[77; 78) " " | ||
68 | FAT_ARROW@[78; 80) "=>" | ||
69 | WHITESPACE@[80; 81) " " | ||
70 | TUPLE_EXPR@[81; 83) | ||
71 | L_PAREN@[81; 82) "(" | ||
72 | R_PAREN@[82; 83) ")" | ||
73 | COMMA@[83; 84) "," | ||
74 | WHITESPACE@[84; 93) "\n " | ||
75 | MATCH_ARM@[93; 109) | ||
76 | BIND_PAT@[93; 94) | ||
77 | NAME@[93; 94) | ||
78 | IDENT@[93; 94) "X" | ||
79 | WHITESPACE@[94; 95) " " | ||
80 | PIPE@[95; 96) "|" | ||
81 | WHITESPACE@[96; 97) " " | ||
82 | BIND_PAT@[97; 98) | ||
83 | NAME@[97; 98) | ||
84 | IDENT@[97; 98) "Y" | ||
85 | WHITESPACE@[98; 99) " " | ||
86 | MATCH_GUARD@[99; 103) | ||
87 | IF_KW@[99; 101) "if" | ||
88 | WHITESPACE@[101; 102) " " | ||
89 | PATH_EXPR@[102; 103) | ||
90 | PATH@[102; 103) | ||
91 | PATH_SEGMENT@[102; 103) | ||
92 | NAME_REF@[102; 103) | ||
93 | IDENT@[102; 103) "Z" | ||
94 | WHITESPACE@[103; 104) " " | ||
95 | FAT_ARROW@[104; 106) "=>" | ||
96 | WHITESPACE@[106; 107) " " | ||
97 | TUPLE_EXPR@[107; 109) | ||
98 | L_PAREN@[107; 108) "(" | ||
99 | R_PAREN@[108; 109) ")" | ||
100 | COMMA@[109; 110) "," | ||
101 | WHITESPACE@[110; 119) "\n " | ||
102 | MATCH_ARM@[119; 137) | ||
103 | PIPE@[119; 120) "|" | ||
104 | WHITESPACE@[120; 121) " " | ||
105 | BIND_PAT@[121; 122) | ||
106 | NAME@[121; 122) | ||
107 | IDENT@[121; 122) "X" | ||
108 | WHITESPACE@[122; 123) " " | ||
109 | PIPE@[123; 124) "|" | ||
110 | WHITESPACE@[124; 125) " " | ||
111 | BIND_PAT@[125; 126) | ||
112 | NAME@[125; 126) | ||
113 | IDENT@[125; 126) "Y" | ||
114 | WHITESPACE@[126; 127) " " | ||
115 | MATCH_GUARD@[127; 131) | ||
116 | IF_KW@[127; 129) "if" | ||
117 | WHITESPACE@[129; 130) " " | ||
118 | PATH_EXPR@[130; 131) | ||
119 | PATH@[130; 131) | ||
120 | PATH_SEGMENT@[130; 131) | ||
121 | NAME_REF@[130; 131) | ||
122 | IDENT@[130; 131) "Z" | ||
123 | WHITESPACE@[131; 132) " " | ||
124 | FAT_ARROW@[132; 134) "=>" | ||
125 | WHITESPACE@[134; 135) " " | ||
126 | TUPLE_EXPR@[135; 137) | ||
127 | L_PAREN@[135; 136) "(" | ||
128 | R_PAREN@[136; 137) ")" | ||
129 | COMMA@[137; 138) "," | ||
130 | WHITESPACE@[138; 147) "\n " | ||
131 | MATCH_ARM@[147; 156) | ||
132 | PIPE@[147; 148) "|" | ||
133 | WHITESPACE@[148; 149) " " | ||
134 | BIND_PAT@[149; 150) | ||
135 | NAME@[149; 150) | ||
136 | IDENT@[149; 150) "X" | ||
137 | WHITESPACE@[150; 151) " " | ||
138 | FAT_ARROW@[151; 153) "=>" | ||
139 | WHITESPACE@[153; 154) " " | ||
140 | TUPLE_EXPR@[154; 156) | ||
141 | L_PAREN@[154; 155) "(" | ||
142 | R_PAREN@[155; 156) ")" | ||
143 | COMMA@[156; 157) "," | ||
144 | WHITESPACE@[157; 162) "\n " | ||
145 | R_CURLY@[162; 163) "}" | ||
146 | SEMI@[163; 164) ";" | ||
147 | WHITESPACE@[164; 165) "\n" | ||
148 | R_CURLY@[165; 166) "}" | ||
149 | WHITESPACE@[166; 167) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0067_crate_path.rs b/crates/ra_syntax/test_data/parser/inline/ok/0067_crate_path.rs new file mode 100644 index 000000000..1bbb5930b --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0067_crate_path.rs | |||
@@ -0,0 +1 @@ | |||
use crate::foo; | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0067_crate_path.txt b/crates/ra_syntax/test_data/parser/inline/ok/0067_crate_path.txt new file mode 100644 index 000000000..f2ba4e909 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0067_crate_path.txt | |||
@@ -0,0 +1,15 @@ | |||
1 | SOURCE_FILE@[0; 16) | ||
2 | USE_ITEM@[0; 15) | ||
3 | USE_KW@[0; 3) "use" | ||
4 | WHITESPACE@[3; 4) " " | ||
5 | USE_TREE@[4; 14) | ||
6 | PATH@[4; 14) | ||
7 | PATH@[4; 9) | ||
8 | PATH_SEGMENT@[4; 9) | ||
9 | CRATE_KW@[4; 9) "crate" | ||
10 | COLONCOLON@[9; 11) "::" | ||
11 | PATH_SEGMENT@[11; 14) | ||
12 | NAME_REF@[11; 14) | ||
13 | IDENT@[11; 14) "foo" | ||
14 | SEMI@[14; 15) ";" | ||
15 | WHITESPACE@[15; 16) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0068_union_items.rs b/crates/ra_syntax/test_data/parser/inline/ok/0068_union_items.rs new file mode 100644 index 000000000..b7dd610d8 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0068_union_items.rs | |||
@@ -0,0 +1,5 @@ | |||
1 | union Foo {} | ||
2 | union Foo { | ||
3 | a: i32, | ||
4 | b: f32, | ||
5 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0068_union_items.txt b/crates/ra_syntax/test_data/parser/inline/ok/0068_union_items.txt new file mode 100644 index 000000000..4b653317b --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0068_union_items.txt | |||
@@ -0,0 +1,46 @@ | |||
1 | SOURCE_FILE@[0; 51) | ||
2 | STRUCT_DEF@[0; 12) | ||
3 | UNION_KW@[0; 5) "union" | ||
4 | WHITESPACE@[5; 6) " " | ||
5 | NAME@[6; 9) | ||
6 | IDENT@[6; 9) "Foo" | ||
7 | WHITESPACE@[9; 10) " " | ||
8 | NAMED_FIELD_DEF_LIST@[10; 12) | ||
9 | L_CURLY@[10; 11) "{" | ||
10 | R_CURLY@[11; 12) "}" | ||
11 | WHITESPACE@[12; 13) "\n" | ||
12 | STRUCT_DEF@[13; 50) | ||
13 | UNION_KW@[13; 18) "union" | ||
14 | WHITESPACE@[18; 19) " " | ||
15 | NAME@[19; 22) | ||
16 | IDENT@[19; 22) "Foo" | ||
17 | WHITESPACE@[22; 23) " " | ||
18 | NAMED_FIELD_DEF_LIST@[23; 50) | ||
19 | L_CURLY@[23; 24) "{" | ||
20 | WHITESPACE@[24; 29) "\n " | ||
21 | NAMED_FIELD_DEF@[29; 35) | ||
22 | NAME@[29; 30) | ||
23 | IDENT@[29; 30) "a" | ||
24 | COLON@[30; 31) ":" | ||
25 | WHITESPACE@[31; 32) " " | ||
26 | PATH_TYPE@[32; 35) | ||
27 | PATH@[32; 35) | ||
28 | PATH_SEGMENT@[32; 35) | ||
29 | NAME_REF@[32; 35) | ||
30 | IDENT@[32; 35) "i32" | ||
31 | COMMA@[35; 36) "," | ||
32 | WHITESPACE@[36; 41) "\n " | ||
33 | NAMED_FIELD_DEF@[41; 47) | ||
34 | NAME@[41; 42) | ||
35 | IDENT@[41; 42) "b" | ||
36 | COLON@[42; 43) ":" | ||
37 | WHITESPACE@[43; 44) " " | ||
38 | PATH_TYPE@[44; 47) | ||
39 | PATH@[44; 47) | ||
40 | PATH_SEGMENT@[44; 47) | ||
41 | NAME_REF@[44; 47) | ||
42 | IDENT@[44; 47) "f32" | ||
43 | COMMA@[47; 48) "," | ||
44 | WHITESPACE@[48; 49) "\n" | ||
45 | R_CURLY@[49; 50) "}" | ||
46 | WHITESPACE@[50; 51) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0069_use_tree_list_after_path.rs b/crates/ra_syntax/test_data/parser/inline/ok/0069_use_tree_list_after_path.rs new file mode 100644 index 000000000..c0a3d634e --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0069_use_tree_list_after_path.rs | |||
@@ -0,0 +1,2 @@ | |||
1 | use crate::{Item}; | ||
2 | use self::{Item}; | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0069_use_tree_list_after_path.txt b/crates/ra_syntax/test_data/parser/inline/ok/0069_use_tree_list_after_path.txt new file mode 100644 index 000000000..86afc9362 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0069_use_tree_list_after_path.txt | |||
@@ -0,0 +1,37 @@ | |||
1 | SOURCE_FILE@[0; 37) | ||
2 | USE_ITEM@[0; 18) | ||
3 | USE_KW@[0; 3) "use" | ||
4 | WHITESPACE@[3; 4) " " | ||
5 | USE_TREE@[4; 17) | ||
6 | PATH@[4; 9) | ||
7 | PATH_SEGMENT@[4; 9) | ||
8 | CRATE_KW@[4; 9) "crate" | ||
9 | COLONCOLON@[9; 11) "::" | ||
10 | USE_TREE_LIST@[11; 17) | ||
11 | L_CURLY@[11; 12) "{" | ||
12 | USE_TREE@[12; 16) | ||
13 | PATH@[12; 16) | ||
14 | PATH_SEGMENT@[12; 16) | ||
15 | NAME_REF@[12; 16) | ||
16 | IDENT@[12; 16) "Item" | ||
17 | R_CURLY@[16; 17) "}" | ||
18 | SEMI@[17; 18) ";" | ||
19 | WHITESPACE@[18; 19) "\n" | ||
20 | USE_ITEM@[19; 36) | ||
21 | USE_KW@[19; 22) "use" | ||
22 | WHITESPACE@[22; 23) " " | ||
23 | USE_TREE@[23; 35) | ||
24 | PATH@[23; 27) | ||
25 | PATH_SEGMENT@[23; 27) | ||
26 | SELF_KW@[23; 27) "self" | ||
27 | COLONCOLON@[27; 29) "::" | ||
28 | USE_TREE_LIST@[29; 35) | ||
29 | L_CURLY@[29; 30) "{" | ||
30 | USE_TREE@[30; 34) | ||
31 | PATH@[30; 34) | ||
32 | PATH_SEGMENT@[30; 34) | ||
33 | NAME_REF@[30; 34) | ||
34 | IDENT@[30; 34) "Item" | ||
35 | R_CURLY@[34; 35) "}" | ||
36 | SEMI@[35; 36) ";" | ||
37 | WHITESPACE@[36; 37) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.rs b/crates/ra_syntax/test_data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.rs new file mode 100644 index 000000000..37b843742 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn foo() { | ||
2 | let _ = {1} & 2; | ||
3 | {1} &2; | ||
4 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.txt b/crates/ra_syntax/test_data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.txt new file mode 100644 index 000000000..40333d565 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.txt | |||
@@ -0,0 +1,52 @@ | |||
1 | SOURCE_FILE@[0; 46) | ||
2 | FN_DEF@[0; 45) | ||
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; 45) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 15) "\n " | ||
14 | LET_STMT@[15; 31) | ||
15 | LET_KW@[15; 18) "let" | ||
16 | WHITESPACE@[18; 19) " " | ||
17 | PLACEHOLDER_PAT@[19; 20) | ||
18 | UNDERSCORE@[19; 20) "_" | ||
19 | WHITESPACE@[20; 21) " " | ||
20 | EQ@[21; 22) "=" | ||
21 | WHITESPACE@[22; 23) " " | ||
22 | BIN_EXPR@[23; 30) | ||
23 | BLOCK_EXPR@[23; 26) | ||
24 | BLOCK@[23; 26) | ||
25 | L_CURLY@[23; 24) "{" | ||
26 | LITERAL@[24; 25) | ||
27 | INT_NUMBER@[24; 25) "1" | ||
28 | R_CURLY@[25; 26) "}" | ||
29 | WHITESPACE@[26; 27) " " | ||
30 | AMP@[27; 28) "&" | ||
31 | WHITESPACE@[28; 29) " " | ||
32 | LITERAL@[29; 30) | ||
33 | INT_NUMBER@[29; 30) "2" | ||
34 | SEMI@[30; 31) ";" | ||
35 | WHITESPACE@[31; 36) "\n " | ||
36 | EXPR_STMT@[36; 39) | ||
37 | BLOCK_EXPR@[36; 39) | ||
38 | BLOCK@[36; 39) | ||
39 | L_CURLY@[36; 37) "{" | ||
40 | LITERAL@[37; 38) | ||
41 | INT_NUMBER@[37; 38) "1" | ||
42 | R_CURLY@[38; 39) "}" | ||
43 | WHITESPACE@[39; 40) " " | ||
44 | EXPR_STMT@[40; 43) | ||
45 | REF_EXPR@[40; 42) | ||
46 | AMP@[40; 41) "&" | ||
47 | LITERAL@[41; 42) | ||
48 | INT_NUMBER@[41; 42) "2" | ||
49 | SEMI@[42; 43) ";" | ||
50 | WHITESPACE@[43; 44) "\n" | ||
51 | R_CURLY@[44; 45) "}" | ||
52 | WHITESPACE@[45; 46) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0071_match_expr.rs b/crates/ra_syntax/test_data/parser/inline/ok/0071_match_expr.rs new file mode 100644 index 000000000..c9205dfa3 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0071_match_expr.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn foo() { | ||
2 | match () { }; | ||
3 | match S {}; | ||
4 | } | ||
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 new file mode 100644 index 000000000..658948c66 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0071_match_expr.txt | |||
@@ -0,0 +1,44 @@ | |||
1 | SOURCE_FILE@[0; 47) | ||
2 | FN_DEF@[0; 46) | ||
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; 46) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 15) "\n " | ||
14 | EXPR_STMT@[15; 28) | ||
15 | MATCH_EXPR@[15; 27) | ||
16 | MATCH_KW@[15; 20) "match" | ||
17 | WHITESPACE@[20; 21) " " | ||
18 | TUPLE_EXPR@[21; 23) | ||
19 | L_PAREN@[21; 22) "(" | ||
20 | R_PAREN@[22; 23) ")" | ||
21 | WHITESPACE@[23; 24) " " | ||
22 | MATCH_ARM_LIST@[24; 27) | ||
23 | L_CURLY@[24; 25) "{" | ||
24 | WHITESPACE@[25; 26) " " | ||
25 | R_CURLY@[26; 27) "}" | ||
26 | SEMI@[27; 28) ";" | ||
27 | WHITESPACE@[28; 33) "\n " | ||
28 | EXPR_STMT@[33; 44) | ||
29 | MATCH_EXPR@[33; 43) | ||
30 | MATCH_KW@[33; 38) "match" | ||
31 | WHITESPACE@[38; 39) " " | ||
32 | PATH_EXPR@[39; 40) | ||
33 | PATH@[39; 40) | ||
34 | PATH_SEGMENT@[39; 40) | ||
35 | NAME_REF@[39; 40) | ||
36 | IDENT@[39; 40) "S" | ||
37 | WHITESPACE@[40; 41) " " | ||
38 | MATCH_ARM_LIST@[41; 43) | ||
39 | L_CURLY@[41; 42) "{" | ||
40 | R_CURLY@[42; 43) "}" | ||
41 | SEMI@[43; 44) ";" | ||
42 | WHITESPACE@[44; 45) "\n" | ||
43 | R_CURLY@[45; 46) "}" | ||
44 | WHITESPACE@[46; 47) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0072_return_expr.rs b/crates/ra_syntax/test_data/parser/inline/ok/0072_return_expr.rs new file mode 100644 index 000000000..5733666b6 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0072_return_expr.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn foo() { | ||
2 | return; | ||
3 | return 92; | ||
4 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0072_return_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0072_return_expr.txt new file mode 100644 index 000000000..cd9e10bed --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0072_return_expr.txt | |||
@@ -0,0 +1,28 @@ | |||
1 | SOURCE_FILE@[0; 40) | ||
2 | FN_DEF@[0; 39) | ||
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; 39) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 15) "\n " | ||
14 | EXPR_STMT@[15; 22) | ||
15 | RETURN_EXPR@[15; 21) | ||
16 | RETURN_KW@[15; 21) "return" | ||
17 | SEMI@[21; 22) ";" | ||
18 | WHITESPACE@[22; 27) "\n " | ||
19 | EXPR_STMT@[27; 37) | ||
20 | RETURN_EXPR@[27; 36) | ||
21 | RETURN_KW@[27; 33) "return" | ||
22 | WHITESPACE@[33; 34) " " | ||
23 | LITERAL@[34; 36) | ||
24 | INT_NUMBER@[34; 36) "92" | ||
25 | SEMI@[36; 37) ";" | ||
26 | WHITESPACE@[37; 38) "\n" | ||
27 | R_CURLY@[38; 39) "}" | ||
28 | WHITESPACE@[39; 40) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0073_type_item_type_params.rs b/crates/ra_syntax/test_data/parser/inline/ok/0073_type_item_type_params.rs new file mode 100644 index 000000000..defd110c4 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0073_type_item_type_params.rs | |||
@@ -0,0 +1 @@ | |||
type Result<T> = (); | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0073_type_item_type_params.txt b/crates/ra_syntax/test_data/parser/inline/ok/0073_type_item_type_params.txt new file mode 100644 index 000000000..2dd6db28f --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0073_type_item_type_params.txt | |||
@@ -0,0 +1,20 @@ | |||
1 | SOURCE_FILE@[0; 21) | ||
2 | TYPE_ALIAS_DEF@[0; 20) | ||
3 | TYPE_KW@[0; 4) "type" | ||
4 | WHITESPACE@[4; 5) " " | ||
5 | NAME@[5; 11) | ||
6 | IDENT@[5; 11) "Result" | ||
7 | TYPE_PARAM_LIST@[11; 14) | ||
8 | L_ANGLE@[11; 12) "<" | ||
9 | TYPE_PARAM@[12; 13) | ||
10 | NAME@[12; 13) | ||
11 | IDENT@[12; 13) "T" | ||
12 | R_ANGLE@[13; 14) ">" | ||
13 | WHITESPACE@[14; 15) " " | ||
14 | EQ@[15; 16) "=" | ||
15 | WHITESPACE@[16; 17) " " | ||
16 | TUPLE_TYPE@[17; 19) | ||
17 | L_PAREN@[17; 18) "(" | ||
18 | R_PAREN@[18; 19) ")" | ||
19 | SEMI@[19; 20) ";" | ||
20 | WHITESPACE@[20; 21) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.rs b/crates/ra_syntax/test_data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.rs new file mode 100644 index 000000000..2edd578f9 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.rs | |||
@@ -0,0 +1,7 @@ | |||
1 | fn foo() { | ||
2 | match () { | ||
3 | _ => {} | ||
4 | () => {} | ||
5 | [] => {} | ||
6 | } | ||
7 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.txt b/crates/ra_syntax/test_data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.txt new file mode 100644 index 000000000..48af2f350 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.txt | |||
@@ -0,0 +1,62 @@ | |||
1 | SOURCE_FILE@[0; 84) | ||
2 | FN_DEF@[0; 83) | ||
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; 83) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 15) "\n " | ||
14 | MATCH_EXPR@[15; 81) | ||
15 | MATCH_KW@[15; 20) "match" | ||
16 | WHITESPACE@[20; 21) " " | ||
17 | TUPLE_EXPR@[21; 23) | ||
18 | L_PAREN@[21; 22) "(" | ||
19 | R_PAREN@[22; 23) ")" | ||
20 | WHITESPACE@[23; 24) " " | ||
21 | MATCH_ARM_LIST@[24; 81) | ||
22 | L_CURLY@[24; 25) "{" | ||
23 | WHITESPACE@[25; 34) "\n " | ||
24 | MATCH_ARM@[34; 41) | ||
25 | PLACEHOLDER_PAT@[34; 35) | ||
26 | UNDERSCORE@[34; 35) "_" | ||
27 | WHITESPACE@[35; 36) " " | ||
28 | FAT_ARROW@[36; 38) "=>" | ||
29 | WHITESPACE@[38; 39) " " | ||
30 | BLOCK_EXPR@[39; 41) | ||
31 | BLOCK@[39; 41) | ||
32 | L_CURLY@[39; 40) "{" | ||
33 | R_CURLY@[40; 41) "}" | ||
34 | WHITESPACE@[41; 50) "\n " | ||
35 | MATCH_ARM@[50; 58) | ||
36 | TUPLE_PAT@[50; 52) | ||
37 | L_PAREN@[50; 51) "(" | ||
38 | R_PAREN@[51; 52) ")" | ||
39 | WHITESPACE@[52; 53) " " | ||
40 | FAT_ARROW@[53; 55) "=>" | ||
41 | WHITESPACE@[55; 56) " " | ||
42 | BLOCK_EXPR@[56; 58) | ||
43 | BLOCK@[56; 58) | ||
44 | L_CURLY@[56; 57) "{" | ||
45 | R_CURLY@[57; 58) "}" | ||
46 | WHITESPACE@[58; 67) "\n " | ||
47 | MATCH_ARM@[67; 75) | ||
48 | SLICE_PAT@[67; 69) | ||
49 | L_BRACK@[67; 68) "[" | ||
50 | R_BRACK@[68; 69) "]" | ||
51 | WHITESPACE@[69; 70) " " | ||
52 | FAT_ARROW@[70; 72) "=>" | ||
53 | WHITESPACE@[72; 73) " " | ||
54 | BLOCK_EXPR@[73; 75) | ||
55 | BLOCK@[73; 75) | ||
56 | L_CURLY@[73; 74) "{" | ||
57 | R_CURLY@[74; 75) "}" | ||
58 | WHITESPACE@[75; 80) "\n " | ||
59 | R_CURLY@[80; 81) "}" | ||
60 | WHITESPACE@[81; 82) "\n" | ||
61 | R_CURLY@[82; 83) "}" | ||
62 | WHITESPACE@[83; 84) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0075_block.rs b/crates/ra_syntax/test_data/parser/inline/ok/0075_block.rs new file mode 100644 index 000000000..81f44c533 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0075_block.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn a() {} | ||
2 | fn b() { let _ = 1; } | ||
3 | fn c() { 1; 2; } | ||
4 | fn d() { 1; 2 } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0075_block.txt b/crates/ra_syntax/test_data/parser/inline/ok/0075_block.txt new file mode 100644 index 000000000..36983590f --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0075_block.txt | |||
@@ -0,0 +1,86 @@ | |||
1 | SOURCE_FILE@[0; 65) | ||
2 | FN_DEF@[0; 9) | ||
3 | FN_KW@[0; 2) "fn" | ||
4 | WHITESPACE@[2; 3) " " | ||
5 | NAME@[3; 4) | ||
6 | IDENT@[3; 4) "a" | ||
7 | PARAM_LIST@[4; 6) | ||
8 | L_PAREN@[4; 5) "(" | ||
9 | R_PAREN@[5; 6) ")" | ||
10 | WHITESPACE@[6; 7) " " | ||
11 | BLOCK@[7; 9) | ||
12 | L_CURLY@[7; 8) "{" | ||
13 | R_CURLY@[8; 9) "}" | ||
14 | WHITESPACE@[9; 10) "\n" | ||
15 | FN_DEF@[10; 31) | ||
16 | FN_KW@[10; 12) "fn" | ||
17 | WHITESPACE@[12; 13) " " | ||
18 | NAME@[13; 14) | ||
19 | IDENT@[13; 14) "b" | ||
20 | PARAM_LIST@[14; 16) | ||
21 | L_PAREN@[14; 15) "(" | ||
22 | R_PAREN@[15; 16) ")" | ||
23 | WHITESPACE@[16; 17) " " | ||
24 | BLOCK@[17; 31) | ||
25 | L_CURLY@[17; 18) "{" | ||
26 | WHITESPACE@[18; 19) " " | ||
27 | LET_STMT@[19; 29) | ||
28 | LET_KW@[19; 22) "let" | ||
29 | WHITESPACE@[22; 23) " " | ||
30 | PLACEHOLDER_PAT@[23; 24) | ||
31 | UNDERSCORE@[23; 24) "_" | ||
32 | WHITESPACE@[24; 25) " " | ||
33 | EQ@[25; 26) "=" | ||
34 | WHITESPACE@[26; 27) " " | ||
35 | LITERAL@[27; 28) | ||
36 | INT_NUMBER@[27; 28) "1" | ||
37 | SEMI@[28; 29) ";" | ||
38 | WHITESPACE@[29; 30) " " | ||
39 | R_CURLY@[30; 31) "}" | ||
40 | WHITESPACE@[31; 32) "\n" | ||
41 | FN_DEF@[32; 48) | ||
42 | FN_KW@[32; 34) "fn" | ||
43 | WHITESPACE@[34; 35) " " | ||
44 | NAME@[35; 36) | ||
45 | IDENT@[35; 36) "c" | ||
46 | PARAM_LIST@[36; 38) | ||
47 | L_PAREN@[36; 37) "(" | ||
48 | R_PAREN@[37; 38) ")" | ||
49 | WHITESPACE@[38; 39) " " | ||
50 | BLOCK@[39; 48) | ||
51 | L_CURLY@[39; 40) "{" | ||
52 | WHITESPACE@[40; 41) " " | ||
53 | EXPR_STMT@[41; 43) | ||
54 | LITERAL@[41; 42) | ||
55 | INT_NUMBER@[41; 42) "1" | ||
56 | SEMI@[42; 43) ";" | ||
57 | WHITESPACE@[43; 44) " " | ||
58 | EXPR_STMT@[44; 46) | ||
59 | LITERAL@[44; 45) | ||
60 | INT_NUMBER@[44; 45) "2" | ||
61 | SEMI@[45; 46) ";" | ||
62 | WHITESPACE@[46; 47) " " | ||
63 | R_CURLY@[47; 48) "}" | ||
64 | WHITESPACE@[48; 49) "\n" | ||
65 | FN_DEF@[49; 64) | ||
66 | FN_KW@[49; 51) "fn" | ||
67 | WHITESPACE@[51; 52) " " | ||
68 | NAME@[52; 53) | ||
69 | IDENT@[52; 53) "d" | ||
70 | PARAM_LIST@[53; 55) | ||
71 | L_PAREN@[53; 54) "(" | ||
72 | R_PAREN@[54; 55) ")" | ||
73 | WHITESPACE@[55; 56) " " | ||
74 | BLOCK@[56; 64) | ||
75 | L_CURLY@[56; 57) "{" | ||
76 | WHITESPACE@[57; 58) " " | ||
77 | EXPR_STMT@[58; 60) | ||
78 | LITERAL@[58; 59) | ||
79 | INT_NUMBER@[58; 59) "1" | ||
80 | SEMI@[59; 60) ";" | ||
81 | WHITESPACE@[60; 61) " " | ||
82 | LITERAL@[61; 62) | ||
83 | INT_NUMBER@[61; 62) "2" | ||
84 | WHITESPACE@[62; 63) " " | ||
85 | R_CURLY@[63; 64) "}" | ||
86 | WHITESPACE@[64; 65) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0076_function_where_clause.rs b/crates/ra_syntax/test_data/parser/inline/ok/0076_function_where_clause.rs new file mode 100644 index 000000000..f0920b2a8 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0076_function_where_clause.rs | |||
@@ -0,0 +1 @@ | |||
fn foo<T>() where T: Copy {} | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0076_function_where_clause.txt b/crates/ra_syntax/test_data/parser/inline/ok/0076_function_where_clause.txt new file mode 100644 index 000000000..32979c523 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0076_function_where_clause.txt | |||
@@ -0,0 +1,39 @@ | |||
1 | SOURCE_FILE@[0; 29) | ||
2 | FN_DEF@[0; 28) | ||
3 | FN_KW@[0; 2) "fn" | ||
4 | WHITESPACE@[2; 3) " " | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | TYPE_PARAM_LIST@[6; 9) | ||
8 | L_ANGLE@[6; 7) "<" | ||
9 | TYPE_PARAM@[7; 8) | ||
10 | NAME@[7; 8) | ||
11 | IDENT@[7; 8) "T" | ||
12 | R_ANGLE@[8; 9) ">" | ||
13 | PARAM_LIST@[9; 11) | ||
14 | L_PAREN@[9; 10) "(" | ||
15 | R_PAREN@[10; 11) ")" | ||
16 | WHITESPACE@[11; 12) " " | ||
17 | WHERE_CLAUSE@[12; 25) | ||
18 | WHERE_KW@[12; 17) "where" | ||
19 | WHITESPACE@[17; 18) " " | ||
20 | WHERE_PRED@[18; 25) | ||
21 | PATH_TYPE@[18; 19) | ||
22 | PATH@[18; 19) | ||
23 | PATH_SEGMENT@[18; 19) | ||
24 | NAME_REF@[18; 19) | ||
25 | IDENT@[18; 19) "T" | ||
26 | COLON@[19; 20) ":" | ||
27 | WHITESPACE@[20; 21) " " | ||
28 | TYPE_BOUND_LIST@[21; 25) | ||
29 | TYPE_BOUND@[21; 25) | ||
30 | PATH_TYPE@[21; 25) | ||
31 | PATH@[21; 25) | ||
32 | PATH_SEGMENT@[21; 25) | ||
33 | NAME_REF@[21; 25) | ||
34 | IDENT@[21; 25) "Copy" | ||
35 | WHITESPACE@[25; 26) " " | ||
36 | BLOCK@[26; 28) | ||
37 | L_CURLY@[26; 27) "{" | ||
38 | R_CURLY@[27; 28) "}" | ||
39 | WHITESPACE@[28; 29) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0077_try_expr.rs b/crates/ra_syntax/test_data/parser/inline/ok/0077_try_expr.rs new file mode 100644 index 000000000..8b74f7bc8 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0077_try_expr.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn foo() { | ||
2 | x?; | ||
3 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0077_try_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0077_try_expr.txt new file mode 100644 index 000000000..72de14b98 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0077_try_expr.txt | |||
@@ -0,0 +1,25 @@ | |||
1 | SOURCE_FILE@[0; 21) | ||
2 | FN_DEF@[0; 20) | ||
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; 20) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 15) "\n " | ||
14 | EXPR_STMT@[15; 18) | ||
15 | TRY_EXPR@[15; 17) | ||
16 | PATH_EXPR@[15; 16) | ||
17 | PATH@[15; 16) | ||
18 | PATH_SEGMENT@[15; 16) | ||
19 | NAME_REF@[15; 16) | ||
20 | IDENT@[15; 16) "x" | ||
21 | QUESTION@[16; 17) "?" | ||
22 | SEMI@[17; 18) ";" | ||
23 | WHITESPACE@[18; 19) "\n" | ||
24 | R_CURLY@[19; 20) "}" | ||
25 | WHITESPACE@[20; 21) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0078_type_item.rs b/crates/ra_syntax/test_data/parser/inline/ok/0078_type_item.rs new file mode 100644 index 000000000..04c0344fa --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0078_type_item.rs | |||
@@ -0,0 +1 @@ | |||
type Foo = Bar; | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0078_type_item.txt b/crates/ra_syntax/test_data/parser/inline/ok/0078_type_item.txt new file mode 100644 index 000000000..4bc0b1858 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0078_type_item.txt | |||
@@ -0,0 +1,16 @@ | |||
1 | SOURCE_FILE@[0; 16) | ||
2 | TYPE_ALIAS_DEF@[0; 15) | ||
3 | TYPE_KW@[0; 4) "type" | ||
4 | WHITESPACE@[4; 5) " " | ||
5 | NAME@[5; 8) | ||
6 | IDENT@[5; 8) "Foo" | ||
7 | WHITESPACE@[8; 9) " " | ||
8 | EQ@[9; 10) "=" | ||
9 | WHITESPACE@[10; 11) " " | ||
10 | PATH_TYPE@[11; 14) | ||
11 | PATH@[11; 14) | ||
12 | PATH_SEGMENT@[11; 14) | ||
13 | NAME_REF@[11; 14) | ||
14 | IDENT@[11; 14) "Bar" | ||
15 | SEMI@[14; 15) ";" | ||
16 | WHITESPACE@[15; 16) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0079_impl_block.rs b/crates/ra_syntax/test_data/parser/inline/ok/0079_impl_block.rs new file mode 100644 index 000000000..d6337f6b3 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0079_impl_block.rs | |||
@@ -0,0 +1 @@ | |||
impl Foo {} | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0079_impl_block.txt b/crates/ra_syntax/test_data/parser/inline/ok/0079_impl_block.txt new file mode 100644 index 000000000..bda3435e8 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0079_impl_block.txt | |||
@@ -0,0 +1,14 @@ | |||
1 | SOURCE_FILE@[0; 12) | ||
2 | IMPL_BLOCK@[0; 11) | ||
3 | IMPL_KW@[0; 4) "impl" | ||
4 | WHITESPACE@[4; 5) " " | ||
5 | PATH_TYPE@[5; 8) | ||
6 | PATH@[5; 8) | ||
7 | PATH_SEGMENT@[5; 8) | ||
8 | NAME_REF@[5; 8) | ||
9 | IDENT@[5; 8) "Foo" | ||
10 | WHITESPACE@[8; 9) " " | ||
11 | ITEM_LIST@[9; 11) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | R_CURLY@[10; 11) "}" | ||
14 | WHITESPACE@[11; 12) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0080_postfix_range.rs b/crates/ra_syntax/test_data/parser/inline/ok/0080_postfix_range.rs new file mode 100644 index 000000000..c39fe8e68 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0080_postfix_range.rs | |||
@@ -0,0 +1 @@ | |||
fn foo() { let x = 1..; } | |||
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 new file mode 100644 index 000000000..541add812 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0080_postfix_range.txt | |||
@@ -0,0 +1,30 @@ | |||
1 | SOURCE_FILE@[0; 26) | ||
2 | FN_DEF@[0; 25) | ||
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; 25) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 11) " " | ||
14 | LET_STMT@[11; 23) | ||
15 | LET_KW@[11; 14) "let" | ||
16 | WHITESPACE@[14; 15) " " | ||
17 | BIND_PAT@[15; 16) | ||
18 | NAME@[15; 16) | ||
19 | IDENT@[15; 16) "x" | ||
20 | WHITESPACE@[16; 17) " " | ||
21 | EQ@[17; 18) "=" | ||
22 | WHITESPACE@[18; 19) " " | ||
23 | RANGE_EXPR@[19; 22) | ||
24 | LITERAL@[19; 20) | ||
25 | INT_NUMBER@[19; 20) "1" | ||
26 | DOTDOT@[20; 22) ".." | ||
27 | SEMI@[22; 23) ";" | ||
28 | WHITESPACE@[23; 24) " " | ||
29 | R_CURLY@[24; 25) "}" | ||
30 | WHITESPACE@[25; 26) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0081_for_type.rs b/crates/ra_syntax/test_data/parser/inline/ok/0081_for_type.rs new file mode 100644 index 000000000..7cde5c532 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0081_for_type.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | type A = for<'a> fn() -> (); | ||
2 | fn foo<T>(_t: &T) where for<'a> &'a T: Iterator {} | ||
3 | fn bar<T>(_t: &T) where for<'a> &'a mut T: Iterator {} | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0081_for_type.txt b/crates/ra_syntax/test_data/parser/inline/ok/0081_for_type.txt new file mode 100644 index 000000000..599cf9452 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0081_for_type.txt | |||
@@ -0,0 +1,159 @@ | |||
1 | SOURCE_FILE@[0; 135) | ||
2 | TYPE_ALIAS_DEF@[0; 28) | ||
3 | TYPE_KW@[0; 4) "type" | ||
4 | WHITESPACE@[4; 5) " " | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "A" | ||
7 | WHITESPACE@[6; 7) " " | ||
8 | EQ@[7; 8) "=" | ||
9 | WHITESPACE@[8; 9) " " | ||
10 | FOR_TYPE@[9; 27) | ||
11 | FOR_KW@[9; 12) "for" | ||
12 | TYPE_PARAM_LIST@[12; 16) | ||
13 | L_ANGLE@[12; 13) "<" | ||
14 | LIFETIME_PARAM@[13; 15) | ||
15 | LIFETIME@[13; 15) "\'a" | ||
16 | R_ANGLE@[15; 16) ">" | ||
17 | WHITESPACE@[16; 17) " " | ||
18 | FN_POINTER_TYPE@[17; 27) | ||
19 | FN_KW@[17; 19) "fn" | ||
20 | PARAM_LIST@[19; 21) | ||
21 | L_PAREN@[19; 20) "(" | ||
22 | R_PAREN@[20; 21) ")" | ||
23 | WHITESPACE@[21; 22) " " | ||
24 | RET_TYPE@[22; 27) | ||
25 | THIN_ARROW@[22; 24) "->" | ||
26 | WHITESPACE@[24; 25) " " | ||
27 | TUPLE_TYPE@[25; 27) | ||
28 | L_PAREN@[25; 26) "(" | ||
29 | R_PAREN@[26; 27) ")" | ||
30 | SEMI@[27; 28) ";" | ||
31 | WHITESPACE@[28; 29) "\n" | ||
32 | FN_DEF@[29; 79) | ||
33 | FN_KW@[29; 31) "fn" | ||
34 | WHITESPACE@[31; 32) " " | ||
35 | NAME@[32; 35) | ||
36 | IDENT@[32; 35) "foo" | ||
37 | TYPE_PARAM_LIST@[35; 38) | ||
38 | L_ANGLE@[35; 36) "<" | ||
39 | TYPE_PARAM@[36; 37) | ||
40 | NAME@[36; 37) | ||
41 | IDENT@[36; 37) "T" | ||
42 | R_ANGLE@[37; 38) ">" | ||
43 | PARAM_LIST@[38; 46) | ||
44 | L_PAREN@[38; 39) "(" | ||
45 | PARAM@[39; 45) | ||
46 | BIND_PAT@[39; 41) | ||
47 | NAME@[39; 41) | ||
48 | IDENT@[39; 41) "_t" | ||
49 | COLON@[41; 42) ":" | ||
50 | WHITESPACE@[42; 43) " " | ||
51 | REFERENCE_TYPE@[43; 45) | ||
52 | AMP@[43; 44) "&" | ||
53 | PATH_TYPE@[44; 45) | ||
54 | PATH@[44; 45) | ||
55 | PATH_SEGMENT@[44; 45) | ||
56 | NAME_REF@[44; 45) | ||
57 | IDENT@[44; 45) "T" | ||
58 | R_PAREN@[45; 46) ")" | ||
59 | WHITESPACE@[46; 47) " " | ||
60 | WHERE_CLAUSE@[47; 76) | ||
61 | WHERE_KW@[47; 52) "where" | ||
62 | WHITESPACE@[52; 53) " " | ||
63 | WHERE_PRED@[53; 76) | ||
64 | FOR_TYPE@[53; 66) | ||
65 | FOR_KW@[53; 56) "for" | ||
66 | TYPE_PARAM_LIST@[56; 60) | ||
67 | L_ANGLE@[56; 57) "<" | ||
68 | LIFETIME_PARAM@[57; 59) | ||
69 | LIFETIME@[57; 59) "\'a" | ||
70 | R_ANGLE@[59; 60) ">" | ||
71 | WHITESPACE@[60; 61) " " | ||
72 | REFERENCE_TYPE@[61; 66) | ||
73 | AMP@[61; 62) "&" | ||
74 | LIFETIME@[62; 64) "\'a" | ||
75 | WHITESPACE@[64; 65) " " | ||
76 | PATH_TYPE@[65; 66) | ||
77 | PATH@[65; 66) | ||
78 | PATH_SEGMENT@[65; 66) | ||
79 | NAME_REF@[65; 66) | ||
80 | IDENT@[65; 66) "T" | ||
81 | COLON@[66; 67) ":" | ||
82 | WHITESPACE@[67; 68) " " | ||
83 | TYPE_BOUND_LIST@[68; 76) | ||
84 | TYPE_BOUND@[68; 76) | ||
85 | PATH_TYPE@[68; 76) | ||
86 | PATH@[68; 76) | ||
87 | PATH_SEGMENT@[68; 76) | ||
88 | NAME_REF@[68; 76) | ||
89 | IDENT@[68; 76) "Iterator" | ||
90 | WHITESPACE@[76; 77) " " | ||
91 | BLOCK@[77; 79) | ||
92 | L_CURLY@[77; 78) "{" | ||
93 | R_CURLY@[78; 79) "}" | ||
94 | WHITESPACE@[79; 80) "\n" | ||
95 | FN_DEF@[80; 134) | ||
96 | FN_KW@[80; 82) "fn" | ||
97 | WHITESPACE@[82; 83) " " | ||
98 | NAME@[83; 86) | ||
99 | IDENT@[83; 86) "bar" | ||
100 | TYPE_PARAM_LIST@[86; 89) | ||
101 | L_ANGLE@[86; 87) "<" | ||
102 | TYPE_PARAM@[87; 88) | ||
103 | NAME@[87; 88) | ||
104 | IDENT@[87; 88) "T" | ||
105 | R_ANGLE@[88; 89) ">" | ||
106 | PARAM_LIST@[89; 97) | ||
107 | L_PAREN@[89; 90) "(" | ||
108 | PARAM@[90; 96) | ||
109 | BIND_PAT@[90; 92) | ||
110 | NAME@[90; 92) | ||
111 | IDENT@[90; 92) "_t" | ||
112 | COLON@[92; 93) ":" | ||
113 | WHITESPACE@[93; 94) " " | ||
114 | REFERENCE_TYPE@[94; 96) | ||
115 | AMP@[94; 95) "&" | ||
116 | PATH_TYPE@[95; 96) | ||
117 | PATH@[95; 96) | ||
118 | PATH_SEGMENT@[95; 96) | ||
119 | NAME_REF@[95; 96) | ||
120 | IDENT@[95; 96) "T" | ||
121 | R_PAREN@[96; 97) ")" | ||
122 | WHITESPACE@[97; 98) " " | ||
123 | WHERE_CLAUSE@[98; 131) | ||
124 | WHERE_KW@[98; 103) "where" | ||
125 | WHITESPACE@[103; 104) " " | ||
126 | WHERE_PRED@[104; 131) | ||
127 | FOR_TYPE@[104; 121) | ||
128 | FOR_KW@[104; 107) "for" | ||
129 | TYPE_PARAM_LIST@[107; 111) | ||
130 | L_ANGLE@[107; 108) "<" | ||
131 | LIFETIME_PARAM@[108; 110) | ||
132 | LIFETIME@[108; 110) "\'a" | ||
133 | R_ANGLE@[110; 111) ">" | ||
134 | WHITESPACE@[111; 112) " " | ||
135 | REFERENCE_TYPE@[112; 121) | ||
136 | AMP@[112; 113) "&" | ||
137 | LIFETIME@[113; 115) "\'a" | ||
138 | WHITESPACE@[115; 116) " " | ||
139 | MUT_KW@[116; 119) "mut" | ||
140 | WHITESPACE@[119; 120) " " | ||
141 | PATH_TYPE@[120; 121) | ||
142 | PATH@[120; 121) | ||
143 | PATH_SEGMENT@[120; 121) | ||
144 | NAME_REF@[120; 121) | ||
145 | IDENT@[120; 121) "T" | ||
146 | COLON@[121; 122) ":" | ||
147 | WHITESPACE@[122; 123) " " | ||
148 | TYPE_BOUND_LIST@[123; 131) | ||
149 | TYPE_BOUND@[123; 131) | ||
150 | PATH_TYPE@[123; 131) | ||
151 | PATH@[123; 131) | ||
152 | PATH_SEGMENT@[123; 131) | ||
153 | NAME_REF@[123; 131) | ||
154 | IDENT@[123; 131) "Iterator" | ||
155 | WHITESPACE@[131; 132) " " | ||
156 | BLOCK@[132; 134) | ||
157 | L_CURLY@[132; 133) "{" | ||
158 | R_CURLY@[133; 134) "}" | ||
159 | WHITESPACE@[134; 135) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0082_ref_expr.rs b/crates/ra_syntax/test_data/parser/inline/ok/0082_ref_expr.rs new file mode 100644 index 000000000..2dac6be95 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0082_ref_expr.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn foo() { | ||
2 | let _ = &1; | ||
3 | let _ = &mut &f(); | ||
4 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0082_ref_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0082_ref_expr.txt new file mode 100644 index 000000000..87a56d8ce --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0082_ref_expr.txt | |||
@@ -0,0 +1,54 @@ | |||
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; 15) "\n " | ||
14 | LET_STMT@[15; 26) | ||
15 | LET_KW@[15; 18) "let" | ||
16 | WHITESPACE@[18; 19) " " | ||
17 | PLACEHOLDER_PAT@[19; 20) | ||
18 | UNDERSCORE@[19; 20) "_" | ||
19 | WHITESPACE@[20; 21) " " | ||
20 | EQ@[21; 22) "=" | ||
21 | WHITESPACE@[22; 23) " " | ||
22 | REF_EXPR@[23; 25) | ||
23 | AMP@[23; 24) "&" | ||
24 | LITERAL@[24; 25) | ||
25 | INT_NUMBER@[24; 25) "1" | ||
26 | SEMI@[25; 26) ";" | ||
27 | WHITESPACE@[26; 31) "\n " | ||
28 | LET_STMT@[31; 49) | ||
29 | LET_KW@[31; 34) "let" | ||
30 | WHITESPACE@[34; 35) " " | ||
31 | PLACEHOLDER_PAT@[35; 36) | ||
32 | UNDERSCORE@[35; 36) "_" | ||
33 | WHITESPACE@[36; 37) " " | ||
34 | EQ@[37; 38) "=" | ||
35 | WHITESPACE@[38; 39) " " | ||
36 | REF_EXPR@[39; 48) | ||
37 | AMP@[39; 40) "&" | ||
38 | MUT_KW@[40; 43) "mut" | ||
39 | WHITESPACE@[43; 44) " " | ||
40 | REF_EXPR@[44; 48) | ||
41 | AMP@[44; 45) "&" | ||
42 | CALL_EXPR@[45; 48) | ||
43 | PATH_EXPR@[45; 46) | ||
44 | PATH@[45; 46) | ||
45 | PATH_SEGMENT@[45; 46) | ||
46 | NAME_REF@[45; 46) | ||
47 | IDENT@[45; 46) "f" | ||
48 | ARG_LIST@[46; 48) | ||
49 | L_PAREN@[46; 47) "(" | ||
50 | R_PAREN@[47; 48) ")" | ||
51 | SEMI@[48; 49) ";" | ||
52 | WHITESPACE@[49; 50) "\n" | ||
53 | R_CURLY@[50; 51) "}" | ||
54 | WHITESPACE@[51; 52) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0083_struct_items.rs b/crates/ra_syntax/test_data/parser/inline/ok/0083_struct_items.rs new file mode 100644 index 000000000..693e3f3ee --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0083_struct_items.rs | |||
@@ -0,0 +1,8 @@ | |||
1 | struct Foo; | ||
2 | struct Foo {} | ||
3 | struct Foo(); | ||
4 | struct Foo(String, usize); | ||
5 | struct Foo { | ||
6 | a: i32, | ||
7 | b: f32, | ||
8 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0083_struct_items.txt b/crates/ra_syntax/test_data/parser/inline/ok/0083_struct_items.txt new file mode 100644 index 000000000..62d93512b --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0083_struct_items.txt | |||
@@ -0,0 +1,87 @@ | |||
1 | SOURCE_FILE@[0; 106) | ||
2 | STRUCT_DEF@[0; 11) | ||
3 | STRUCT_KW@[0; 6) "struct" | ||
4 | WHITESPACE@[6; 7) " " | ||
5 | NAME@[7; 10) | ||
6 | IDENT@[7; 10) "Foo" | ||
7 | SEMI@[10; 11) ";" | ||
8 | WHITESPACE@[11; 12) "\n" | ||
9 | STRUCT_DEF@[12; 25) | ||
10 | STRUCT_KW@[12; 18) "struct" | ||
11 | WHITESPACE@[18; 19) " " | ||
12 | NAME@[19; 22) | ||
13 | IDENT@[19; 22) "Foo" | ||
14 | WHITESPACE@[22; 23) " " | ||
15 | NAMED_FIELD_DEF_LIST@[23; 25) | ||
16 | L_CURLY@[23; 24) "{" | ||
17 | R_CURLY@[24; 25) "}" | ||
18 | WHITESPACE@[25; 26) "\n" | ||
19 | STRUCT_DEF@[26; 39) | ||
20 | STRUCT_KW@[26; 32) "struct" | ||
21 | WHITESPACE@[32; 33) " " | ||
22 | NAME@[33; 36) | ||
23 | IDENT@[33; 36) "Foo" | ||
24 | POS_FIELD_DEF_LIST@[36; 38) | ||
25 | L_PAREN@[36; 37) "(" | ||
26 | R_PAREN@[37; 38) ")" | ||
27 | SEMI@[38; 39) ";" | ||
28 | WHITESPACE@[39; 40) "\n" | ||
29 | STRUCT_DEF@[40; 66) | ||
30 | STRUCT_KW@[40; 46) "struct" | ||
31 | WHITESPACE@[46; 47) " " | ||
32 | NAME@[47; 50) | ||
33 | IDENT@[47; 50) "Foo" | ||
34 | POS_FIELD_DEF_LIST@[50; 65) | ||
35 | L_PAREN@[50; 51) "(" | ||
36 | POS_FIELD_DEF@[51; 57) | ||
37 | PATH_TYPE@[51; 57) | ||
38 | PATH@[51; 57) | ||
39 | PATH_SEGMENT@[51; 57) | ||
40 | NAME_REF@[51; 57) | ||
41 | IDENT@[51; 57) "String" | ||
42 | COMMA@[57; 58) "," | ||
43 | WHITESPACE@[58; 59) " " | ||
44 | POS_FIELD_DEF@[59; 64) | ||
45 | PATH_TYPE@[59; 64) | ||
46 | PATH@[59; 64) | ||
47 | PATH_SEGMENT@[59; 64) | ||
48 | NAME_REF@[59; 64) | ||
49 | IDENT@[59; 64) "usize" | ||
50 | R_PAREN@[64; 65) ")" | ||
51 | SEMI@[65; 66) ";" | ||
52 | WHITESPACE@[66; 67) "\n" | ||
53 | STRUCT_DEF@[67; 105) | ||
54 | STRUCT_KW@[67; 73) "struct" | ||
55 | WHITESPACE@[73; 74) " " | ||
56 | NAME@[74; 77) | ||
57 | IDENT@[74; 77) "Foo" | ||
58 | WHITESPACE@[77; 78) " " | ||
59 | NAMED_FIELD_DEF_LIST@[78; 105) | ||
60 | L_CURLY@[78; 79) "{" | ||
61 | WHITESPACE@[79; 84) "\n " | ||
62 | NAMED_FIELD_DEF@[84; 90) | ||
63 | NAME@[84; 85) | ||
64 | IDENT@[84; 85) "a" | ||
65 | COLON@[85; 86) ":" | ||
66 | WHITESPACE@[86; 87) " " | ||
67 | PATH_TYPE@[87; 90) | ||
68 | PATH@[87; 90) | ||
69 | PATH_SEGMENT@[87; 90) | ||
70 | NAME_REF@[87; 90) | ||
71 | IDENT@[87; 90) "i32" | ||
72 | COMMA@[90; 91) "," | ||
73 | WHITESPACE@[91; 96) "\n " | ||
74 | NAMED_FIELD_DEF@[96; 102) | ||
75 | NAME@[96; 97) | ||
76 | IDENT@[96; 97) "b" | ||
77 | COLON@[97; 98) ":" | ||
78 | WHITESPACE@[98; 99) " " | ||
79 | PATH_TYPE@[99; 102) | ||
80 | PATH@[99; 102) | ||
81 | PATH_SEGMENT@[99; 102) | ||
82 | NAME_REF@[99; 102) | ||
83 | IDENT@[99; 102) "f32" | ||
84 | COMMA@[102; 103) "," | ||
85 | WHITESPACE@[103; 104) "\n" | ||
86 | R_CURLY@[104; 105) "}" | ||
87 | WHITESPACE@[105; 106) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0084_paren_type.rs b/crates/ra_syntax/test_data/parser/inline/ok/0084_paren_type.rs new file mode 100644 index 000000000..6e1b25101 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0084_paren_type.rs | |||
@@ -0,0 +1 @@ | |||
type T = (i32); | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0084_paren_type.txt b/crates/ra_syntax/test_data/parser/inline/ok/0084_paren_type.txt new file mode 100644 index 000000000..c0cf48af5 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0084_paren_type.txt | |||
@@ -0,0 +1,19 @@ | |||
1 | SOURCE_FILE@[0; 16) | ||
2 | TYPE_ALIAS_DEF@[0; 15) | ||
3 | TYPE_KW@[0; 4) "type" | ||
4 | WHITESPACE@[4; 5) " " | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "T" | ||
7 | WHITESPACE@[6; 7) " " | ||
8 | EQ@[7; 8) "=" | ||
9 | WHITESPACE@[8; 9) " " | ||
10 | PAREN_TYPE@[9; 14) | ||
11 | L_PAREN@[9; 10) "(" | ||
12 | PATH_TYPE@[10; 13) | ||
13 | PATH@[10; 13) | ||
14 | PATH_SEGMENT@[10; 13) | ||
15 | NAME_REF@[10; 13) | ||
16 | IDENT@[10; 13) "i32" | ||
17 | R_PAREN@[13; 14) ")" | ||
18 | SEMI@[14; 15) ";" | ||
19 | WHITESPACE@[15; 16) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0085_expr_literals.rs b/crates/ra_syntax/test_data/parser/inline/ok/0085_expr_literals.rs new file mode 100644 index 000000000..2e11a5a6e --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0085_expr_literals.rs | |||
@@ -0,0 +1,12 @@ | |||
1 | fn foo() { | ||
2 | let _ = true; | ||
3 | let _ = false; | ||
4 | let _ = 1; | ||
5 | let _ = 2.0; | ||
6 | let _ = b'a'; | ||
7 | let _ = 'b'; | ||
8 | let _ = "c"; | ||
9 | let _ = r"d"; | ||
10 | let _ = b"e"; | ||
11 | let _ = br"f"; | ||
12 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0085_expr_literals.txt b/crates/ra_syntax/test_data/parser/inline/ok/0085_expr_literals.txt new file mode 100644 index 000000000..2f2be32b9 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0085_expr_literals.txt | |||
@@ -0,0 +1,135 @@ | |||
1 | SOURCE_FILE@[0; 189) | ||
2 | FN_DEF@[0; 188) | ||
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; 188) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 15) "\n " | ||
14 | LET_STMT@[15; 28) | ||
15 | LET_KW@[15; 18) "let" | ||
16 | WHITESPACE@[18; 19) " " | ||
17 | PLACEHOLDER_PAT@[19; 20) | ||
18 | UNDERSCORE@[19; 20) "_" | ||
19 | WHITESPACE@[20; 21) " " | ||
20 | EQ@[21; 22) "=" | ||
21 | WHITESPACE@[22; 23) " " | ||
22 | LITERAL@[23; 27) | ||
23 | TRUE_KW@[23; 27) "true" | ||
24 | SEMI@[27; 28) ";" | ||
25 | WHITESPACE@[28; 33) "\n " | ||
26 | LET_STMT@[33; 47) | ||
27 | LET_KW@[33; 36) "let" | ||
28 | WHITESPACE@[36; 37) " " | ||
29 | PLACEHOLDER_PAT@[37; 38) | ||
30 | UNDERSCORE@[37; 38) "_" | ||
31 | WHITESPACE@[38; 39) " " | ||
32 | EQ@[39; 40) "=" | ||
33 | WHITESPACE@[40; 41) " " | ||
34 | LITERAL@[41; 46) | ||
35 | FALSE_KW@[41; 46) "false" | ||
36 | SEMI@[46; 47) ";" | ||
37 | WHITESPACE@[47; 52) "\n " | ||
38 | LET_STMT@[52; 62) | ||
39 | LET_KW@[52; 55) "let" | ||
40 | WHITESPACE@[55; 56) " " | ||
41 | PLACEHOLDER_PAT@[56; 57) | ||
42 | UNDERSCORE@[56; 57) "_" | ||
43 | WHITESPACE@[57; 58) " " | ||
44 | EQ@[58; 59) "=" | ||
45 | WHITESPACE@[59; 60) " " | ||
46 | LITERAL@[60; 61) | ||
47 | INT_NUMBER@[60; 61) "1" | ||
48 | SEMI@[61; 62) ";" | ||
49 | WHITESPACE@[62; 67) "\n " | ||
50 | LET_STMT@[67; 79) | ||
51 | LET_KW@[67; 70) "let" | ||
52 | WHITESPACE@[70; 71) " " | ||
53 | PLACEHOLDER_PAT@[71; 72) | ||
54 | UNDERSCORE@[71; 72) "_" | ||
55 | WHITESPACE@[72; 73) " " | ||
56 | EQ@[73; 74) "=" | ||
57 | WHITESPACE@[74; 75) " " | ||
58 | LITERAL@[75; 78) | ||
59 | FLOAT_NUMBER@[75; 78) "2.0" | ||
60 | SEMI@[78; 79) ";" | ||
61 | WHITESPACE@[79; 84) "\n " | ||
62 | LET_STMT@[84; 97) | ||
63 | LET_KW@[84; 87) "let" | ||
64 | WHITESPACE@[87; 88) " " | ||
65 | PLACEHOLDER_PAT@[88; 89) | ||
66 | UNDERSCORE@[88; 89) "_" | ||
67 | WHITESPACE@[89; 90) " " | ||
68 | EQ@[90; 91) "=" | ||
69 | WHITESPACE@[91; 92) " " | ||
70 | LITERAL@[92; 96) | ||
71 | BYTE@[92; 96) "b\'a\'" | ||
72 | SEMI@[96; 97) ";" | ||
73 | WHITESPACE@[97; 102) "\n " | ||
74 | LET_STMT@[102; 114) | ||
75 | LET_KW@[102; 105) "let" | ||
76 | WHITESPACE@[105; 106) " " | ||
77 | PLACEHOLDER_PAT@[106; 107) | ||
78 | UNDERSCORE@[106; 107) "_" | ||
79 | WHITESPACE@[107; 108) " " | ||
80 | EQ@[108; 109) "=" | ||
81 | WHITESPACE@[109; 110) " " | ||
82 | LITERAL@[110; 113) | ||
83 | CHAR@[110; 113) "\'b\'" | ||
84 | SEMI@[113; 114) ";" | ||
85 | WHITESPACE@[114; 119) "\n " | ||
86 | LET_STMT@[119; 131) | ||
87 | LET_KW@[119; 122) "let" | ||
88 | WHITESPACE@[122; 123) " " | ||
89 | PLACEHOLDER_PAT@[123; 124) | ||
90 | UNDERSCORE@[123; 124) "_" | ||
91 | WHITESPACE@[124; 125) " " | ||
92 | EQ@[125; 126) "=" | ||
93 | WHITESPACE@[126; 127) " " | ||
94 | LITERAL@[127; 130) | ||
95 | STRING@[127; 130) "\"c\"" | ||
96 | SEMI@[130; 131) ";" | ||
97 | WHITESPACE@[131; 136) "\n " | ||
98 | LET_STMT@[136; 149) | ||
99 | LET_KW@[136; 139) "let" | ||
100 | WHITESPACE@[139; 140) " " | ||
101 | PLACEHOLDER_PAT@[140; 141) | ||
102 | UNDERSCORE@[140; 141) "_" | ||
103 | WHITESPACE@[141; 142) " " | ||
104 | EQ@[142; 143) "=" | ||
105 | WHITESPACE@[143; 144) " " | ||
106 | LITERAL@[144; 148) | ||
107 | RAW_STRING@[144; 148) "r\"d\"" | ||
108 | SEMI@[148; 149) ";" | ||
109 | WHITESPACE@[149; 154) "\n " | ||
110 | LET_STMT@[154; 167) | ||
111 | LET_KW@[154; 157) "let" | ||
112 | WHITESPACE@[157; 158) " " | ||
113 | PLACEHOLDER_PAT@[158; 159) | ||
114 | UNDERSCORE@[158; 159) "_" | ||
115 | WHITESPACE@[159; 160) " " | ||
116 | EQ@[160; 161) "=" | ||
117 | WHITESPACE@[161; 162) " " | ||
118 | LITERAL@[162; 166) | ||
119 | BYTE_STRING@[162; 166) "b\"e\"" | ||
120 | SEMI@[166; 167) ";" | ||
121 | WHITESPACE@[167; 172) "\n " | ||
122 | LET_STMT@[172; 186) | ||
123 | LET_KW@[172; 175) "let" | ||
124 | WHITESPACE@[175; 176) " " | ||
125 | PLACEHOLDER_PAT@[176; 177) | ||
126 | UNDERSCORE@[176; 177) "_" | ||
127 | WHITESPACE@[177; 178) " " | ||
128 | EQ@[178; 179) "=" | ||
129 | WHITESPACE@[179; 180) " " | ||
130 | LITERAL@[180; 185) | ||
131 | RAW_BYTE_STRING@[180; 185) "br\"f\"" | ||
132 | SEMI@[185; 186) ";" | ||
133 | WHITESPACE@[186; 187) "\n" | ||
134 | R_CURLY@[187; 188) "}" | ||
135 | WHITESPACE@[188; 189) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0086_function_ret_type.rs b/crates/ra_syntax/test_data/parser/inline/ok/0086_function_ret_type.rs new file mode 100644 index 000000000..d22d8cada --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0086_function_ret_type.rs | |||
@@ -0,0 +1,2 @@ | |||
1 | fn foo() {} | ||
2 | fn bar() -> () {} | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0086_function_ret_type.txt b/crates/ra_syntax/test_data/parser/inline/ok/0086_function_ret_type.txt new file mode 100644 index 000000000..ac793c95c --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0086_function_ret_type.txt | |||
@@ -0,0 +1,34 @@ | |||
1 | SOURCE_FILE@[0; 30) | ||
2 | FN_DEF@[0; 11) | ||
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; 11) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | R_CURLY@[10; 11) "}" | ||
14 | WHITESPACE@[11; 12) "\n" | ||
15 | FN_DEF@[12; 29) | ||
16 | FN_KW@[12; 14) "fn" | ||
17 | WHITESPACE@[14; 15) " " | ||
18 | NAME@[15; 18) | ||
19 | IDENT@[15; 18) "bar" | ||
20 | PARAM_LIST@[18; 20) | ||
21 | L_PAREN@[18; 19) "(" | ||
22 | R_PAREN@[19; 20) ")" | ||
23 | WHITESPACE@[20; 21) " " | ||
24 | RET_TYPE@[21; 26) | ||
25 | THIN_ARROW@[21; 23) "->" | ||
26 | WHITESPACE@[23; 24) " " | ||
27 | TUPLE_TYPE@[24; 26) | ||
28 | L_PAREN@[24; 25) "(" | ||
29 | R_PAREN@[25; 26) ")" | ||
30 | WHITESPACE@[26; 27) " " | ||
31 | BLOCK@[27; 29) | ||
32 | L_CURLY@[27; 28) "{" | ||
33 | R_CURLY@[28; 29) "}" | ||
34 | WHITESPACE@[29; 30) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0087_unsafe_impl.rs b/crates/ra_syntax/test_data/parser/inline/ok/0087_unsafe_impl.rs new file mode 100644 index 000000000..41055f41d --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0087_unsafe_impl.rs | |||
@@ -0,0 +1 @@ | |||
unsafe impl Foo {} | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0087_unsafe_impl.txt b/crates/ra_syntax/test_data/parser/inline/ok/0087_unsafe_impl.txt new file mode 100644 index 000000000..590e2a88f --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0087_unsafe_impl.txt | |||
@@ -0,0 +1,16 @@ | |||
1 | SOURCE_FILE@[0; 19) | ||
2 | IMPL_BLOCK@[0; 18) | ||
3 | UNSAFE_KW@[0; 6) "unsafe" | ||
4 | WHITESPACE@[6; 7) " " | ||
5 | IMPL_KW@[7; 11) "impl" | ||
6 | WHITESPACE@[11; 12) " " | ||
7 | PATH_TYPE@[12; 15) | ||
8 | PATH@[12; 15) | ||
9 | PATH_SEGMENT@[12; 15) | ||
10 | NAME_REF@[12; 15) | ||
11 | IDENT@[12; 15) "Foo" | ||
12 | WHITESPACE@[15; 16) " " | ||
13 | ITEM_LIST@[16; 18) | ||
14 | L_CURLY@[16; 17) "{" | ||
15 | R_CURLY@[17; 18) "}" | ||
16 | WHITESPACE@[18; 19) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0088_break_ambiguity.rs b/crates/ra_syntax/test_data/parser/inline/ok/0088_break_ambiguity.rs new file mode 100644 index 000000000..560eb05b9 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0088_break_ambiguity.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | fn foo(){ | ||
2 | if break {} | ||
3 | while break {} | ||
4 | for i in break {} | ||
5 | match break {} | ||
6 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0088_break_ambiguity.txt b/crates/ra_syntax/test_data/parser/inline/ok/0088_break_ambiguity.txt new file mode 100644 index 000000000..b93a10c5b --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0088_break_ambiguity.txt | |||
@@ -0,0 +1,65 @@ | |||
1 | SOURCE_FILE@[0; 88) | ||
2 | FN_DEF@[0; 87) | ||
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 | BLOCK@[8; 87) | ||
11 | L_CURLY@[8; 9) "{" | ||
12 | WHITESPACE@[9; 14) "\n " | ||
13 | EXPR_STMT@[14; 25) | ||
14 | IF_EXPR@[14; 25) | ||
15 | IF_KW@[14; 16) "if" | ||
16 | WHITESPACE@[16; 17) " " | ||
17 | CONDITION@[17; 22) | ||
18 | BREAK_EXPR@[17; 22) | ||
19 | BREAK_KW@[17; 22) "break" | ||
20 | WHITESPACE@[22; 23) " " | ||
21 | BLOCK@[23; 25) | ||
22 | L_CURLY@[23; 24) "{" | ||
23 | R_CURLY@[24; 25) "}" | ||
24 | WHITESPACE@[25; 30) "\n " | ||
25 | EXPR_STMT@[30; 44) | ||
26 | WHILE_EXPR@[30; 44) | ||
27 | WHILE_KW@[30; 35) "while" | ||
28 | WHITESPACE@[35; 36) " " | ||
29 | CONDITION@[36; 41) | ||
30 | BREAK_EXPR@[36; 41) | ||
31 | BREAK_KW@[36; 41) "break" | ||
32 | WHITESPACE@[41; 42) " " | ||
33 | BLOCK@[42; 44) | ||
34 | L_CURLY@[42; 43) "{" | ||
35 | R_CURLY@[43; 44) "}" | ||
36 | WHITESPACE@[44; 49) "\n " | ||
37 | EXPR_STMT@[49; 66) | ||
38 | FOR_EXPR@[49; 66) | ||
39 | FOR_KW@[49; 52) "for" | ||
40 | WHITESPACE@[52; 53) " " | ||
41 | BIND_PAT@[53; 54) | ||
42 | NAME@[53; 54) | ||
43 | IDENT@[53; 54) "i" | ||
44 | WHITESPACE@[54; 55) " " | ||
45 | IN_KW@[55; 57) "in" | ||
46 | WHITESPACE@[57; 58) " " | ||
47 | BREAK_EXPR@[58; 63) | ||
48 | BREAK_KW@[58; 63) "break" | ||
49 | WHITESPACE@[63; 64) " " | ||
50 | BLOCK@[64; 66) | ||
51 | L_CURLY@[64; 65) "{" | ||
52 | R_CURLY@[65; 66) "}" | ||
53 | WHITESPACE@[66; 71) "\n " | ||
54 | MATCH_EXPR@[71; 85) | ||
55 | MATCH_KW@[71; 76) "match" | ||
56 | WHITESPACE@[76; 77) " " | ||
57 | BREAK_EXPR@[77; 82) | ||
58 | BREAK_KW@[77; 82) "break" | ||
59 | WHITESPACE@[82; 83) " " | ||
60 | MATCH_ARM_LIST@[83; 85) | ||
61 | L_CURLY@[83; 84) "{" | ||
62 | R_CURLY@[84; 85) "}" | ||
63 | WHITESPACE@[85; 86) "\n" | ||
64 | R_CURLY@[86; 87) "}" | ||
65 | WHITESPACE@[87; 88) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0089_extern_fn.rs b/crates/ra_syntax/test_data/parser/inline/ok/0089_extern_fn.rs new file mode 100644 index 000000000..394a049f0 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0089_extern_fn.rs | |||
@@ -0,0 +1 @@ | |||
extern fn foo() {} | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0089_extern_fn.txt b/crates/ra_syntax/test_data/parser/inline/ok/0089_extern_fn.txt new file mode 100644 index 000000000..ed5339e64 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0089_extern_fn.txt | |||
@@ -0,0 +1,17 @@ | |||
1 | SOURCE_FILE@[0; 19) | ||
2 | FN_DEF@[0; 18) | ||
3 | ABI@[0; 6) | ||
4 | EXTERN_KW@[0; 6) "extern" | ||
5 | WHITESPACE@[6; 7) " " | ||
6 | FN_KW@[7; 9) "fn" | ||
7 | WHITESPACE@[9; 10) " " | ||
8 | NAME@[10; 13) | ||
9 | IDENT@[10; 13) "foo" | ||
10 | PARAM_LIST@[13; 15) | ||
11 | L_PAREN@[13; 14) "(" | ||
12 | R_PAREN@[14; 15) ")" | ||
13 | WHITESPACE@[15; 16) " " | ||
14 | BLOCK@[16; 18) | ||
15 | L_CURLY@[16; 17) "{" | ||
16 | R_CURLY@[17; 18) "}" | ||
17 | WHITESPACE@[18; 19) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0090_type_param_default.rs b/crates/ra_syntax/test_data/parser/inline/ok/0090_type_param_default.rs new file mode 100644 index 000000000..540eacb02 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0090_type_param_default.rs | |||
@@ -0,0 +1 @@ | |||
struct S<T = i32>; | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0090_type_param_default.txt b/crates/ra_syntax/test_data/parser/inline/ok/0090_type_param_default.txt new file mode 100644 index 000000000..8d2579cd6 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0090_type_param_default.txt | |||
@@ -0,0 +1,22 @@ | |||
1 | SOURCE_FILE@[0; 19) | ||
2 | STRUCT_DEF@[0; 18) | ||
3 | STRUCT_KW@[0; 6) "struct" | ||
4 | WHITESPACE@[6; 7) " " | ||
5 | NAME@[7; 8) | ||
6 | IDENT@[7; 8) "S" | ||
7 | TYPE_PARAM_LIST@[8; 17) | ||
8 | L_ANGLE@[8; 9) "<" | ||
9 | TYPE_PARAM@[9; 16) | ||
10 | NAME@[9; 10) | ||
11 | IDENT@[9; 10) "T" | ||
12 | WHITESPACE@[10; 11) " " | ||
13 | EQ@[11; 12) "=" | ||
14 | WHITESPACE@[12; 13) " " | ||
15 | PATH_TYPE@[13; 16) | ||
16 | PATH@[13; 16) | ||
17 | PATH_SEGMENT@[13; 16) | ||
18 | NAME_REF@[13; 16) | ||
19 | IDENT@[13; 16) "i32" | ||
20 | R_ANGLE@[16; 17) ">" | ||
21 | SEMI@[17; 18) ";" | ||
22 | WHITESPACE@[18; 19) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0091_auto_trait.rs b/crates/ra_syntax/test_data/parser/inline/ok/0091_auto_trait.rs new file mode 100644 index 000000000..72adf6035 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0091_auto_trait.rs | |||
@@ -0,0 +1 @@ | |||
auto trait T {} | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0091_auto_trait.txt b/crates/ra_syntax/test_data/parser/inline/ok/0091_auto_trait.txt new file mode 100644 index 000000000..7093c2b1f --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0091_auto_trait.txt | |||
@@ -0,0 +1,13 @@ | |||
1 | SOURCE_FILE@[0; 16) | ||
2 | TRAIT_DEF@[0; 15) | ||
3 | AUTO_KW@[0; 4) "auto" | ||
4 | WHITESPACE@[4; 5) " " | ||
5 | TRAIT_KW@[5; 10) "trait" | ||
6 | WHITESPACE@[10; 11) " " | ||
7 | NAME@[11; 12) | ||
8 | IDENT@[11; 12) "T" | ||
9 | WHITESPACE@[12; 13) " " | ||
10 | ITEM_LIST@[13; 15) | ||
11 | L_CURLY@[13; 14) "{" | ||
12 | R_CURLY@[14; 15) "}" | ||
13 | WHITESPACE@[15; 16) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0092_fn_pointer_type_with_ret.rs b/crates/ra_syntax/test_data/parser/inline/ok/0092_fn_pointer_type_with_ret.rs new file mode 100644 index 000000000..e3ba5e87f --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0092_fn_pointer_type_with_ret.rs | |||
@@ -0,0 +1 @@ | |||
type F = fn() -> (); | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0092_fn_pointer_type_with_ret.txt b/crates/ra_syntax/test_data/parser/inline/ok/0092_fn_pointer_type_with_ret.txt new file mode 100644 index 000000000..fae822367 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0092_fn_pointer_type_with_ret.txt | |||
@@ -0,0 +1,23 @@ | |||
1 | SOURCE_FILE@[0; 21) | ||
2 | TYPE_ALIAS_DEF@[0; 20) | ||
3 | TYPE_KW@[0; 4) "type" | ||
4 | WHITESPACE@[4; 5) " " | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "F" | ||
7 | WHITESPACE@[6; 7) " " | ||
8 | EQ@[7; 8) "=" | ||
9 | WHITESPACE@[8; 9) " " | ||
10 | FN_POINTER_TYPE@[9; 19) | ||
11 | FN_KW@[9; 11) "fn" | ||
12 | PARAM_LIST@[11; 13) | ||
13 | L_PAREN@[11; 12) "(" | ||
14 | R_PAREN@[12; 13) ")" | ||
15 | WHITESPACE@[13; 14) " " | ||
16 | RET_TYPE@[14; 19) | ||
17 | THIN_ARROW@[14; 16) "->" | ||
18 | WHITESPACE@[16; 17) " " | ||
19 | TUPLE_TYPE@[17; 19) | ||
20 | L_PAREN@[17; 18) "(" | ||
21 | R_PAREN@[18; 19) ")" | ||
22 | SEMI@[19; 20) ";" | ||
23 | WHITESPACE@[20; 21) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0093_index_expr.rs b/crates/ra_syntax/test_data/parser/inline/ok/0093_index_expr.rs new file mode 100644 index 000000000..b9ba78a6c --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0093_index_expr.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn foo() { | ||
2 | x[1][2]; | ||
3 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0093_index_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0093_index_expr.txt new file mode 100644 index 000000000..b4a71f925 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0093_index_expr.txt | |||
@@ -0,0 +1,33 @@ | |||
1 | SOURCE_FILE@[0; 26) | ||
2 | FN_DEF@[0; 25) | ||
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; 25) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 15) "\n " | ||
14 | EXPR_STMT@[15; 23) | ||
15 | INDEX_EXPR@[15; 22) | ||
16 | INDEX_EXPR@[15; 19) | ||
17 | PATH_EXPR@[15; 16) | ||
18 | PATH@[15; 16) | ||
19 | PATH_SEGMENT@[15; 16) | ||
20 | NAME_REF@[15; 16) | ||
21 | IDENT@[15; 16) "x" | ||
22 | L_BRACK@[16; 17) "[" | ||
23 | LITERAL@[17; 18) | ||
24 | INT_NUMBER@[17; 18) "1" | ||
25 | R_BRACK@[18; 19) "]" | ||
26 | L_BRACK@[19; 20) "[" | ||
27 | LITERAL@[20; 21) | ||
28 | INT_NUMBER@[20; 21) "2" | ||
29 | R_BRACK@[21; 22) "]" | ||
30 | SEMI@[22; 23) ";" | ||
31 | WHITESPACE@[23; 24) "\n" | ||
32 | R_CURLY@[24; 25) "}" | ||
33 | WHITESPACE@[25; 26) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0094_unsafe_auto_trait.rs b/crates/ra_syntax/test_data/parser/inline/ok/0094_unsafe_auto_trait.rs new file mode 100644 index 000000000..03d29f324 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0094_unsafe_auto_trait.rs | |||
@@ -0,0 +1 @@ | |||
unsafe auto trait T {} | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0094_unsafe_auto_trait.txt b/crates/ra_syntax/test_data/parser/inline/ok/0094_unsafe_auto_trait.txt new file mode 100644 index 000000000..3da3beaf4 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0094_unsafe_auto_trait.txt | |||
@@ -0,0 +1,15 @@ | |||
1 | SOURCE_FILE@[0; 23) | ||
2 | TRAIT_DEF@[0; 22) | ||
3 | UNSAFE_KW@[0; 6) "unsafe" | ||
4 | WHITESPACE@[6; 7) " " | ||
5 | AUTO_KW@[7; 11) "auto" | ||
6 | WHITESPACE@[11; 12) " " | ||
7 | TRAIT_KW@[12; 17) "trait" | ||
8 | WHITESPACE@[17; 18) " " | ||
9 | NAME@[18; 19) | ||
10 | IDENT@[18; 19) "T" | ||
11 | WHITESPACE@[19; 20) " " | ||
12 | ITEM_LIST@[20; 22) | ||
13 | L_CURLY@[20; 21) "{" | ||
14 | R_CURLY@[21; 22) "}" | ||
15 | WHITESPACE@[22; 23) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0095_placeholder_pat.rs b/crates/ra_syntax/test_data/parser/inline/ok/0095_placeholder_pat.rs new file mode 100644 index 000000000..4d719c433 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0095_placeholder_pat.rs | |||
@@ -0,0 +1 @@ | |||
fn main() { let _ = (); } | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0095_placeholder_pat.txt b/crates/ra_syntax/test_data/parser/inline/ok/0095_placeholder_pat.txt new file mode 100644 index 000000000..f11bc1fc8 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0095_placeholder_pat.txt | |||
@@ -0,0 +1,28 @@ | |||
1 | SOURCE_FILE@[0; 26) | ||
2 | FN_DEF@[0; 25) | ||
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@[10; 25) | ||
12 | L_CURLY@[10; 11) "{" | ||
13 | WHITESPACE@[11; 12) " " | ||
14 | LET_STMT@[12; 23) | ||
15 | LET_KW@[12; 15) "let" | ||
16 | WHITESPACE@[15; 16) " " | ||
17 | PLACEHOLDER_PAT@[16; 17) | ||
18 | UNDERSCORE@[16; 17) "_" | ||
19 | WHITESPACE@[17; 18) " " | ||
20 | EQ@[18; 19) "=" | ||
21 | WHITESPACE@[19; 20) " " | ||
22 | TUPLE_EXPR@[20; 22) | ||
23 | L_PAREN@[20; 21) "(" | ||
24 | R_PAREN@[21; 22) ")" | ||
25 | SEMI@[22; 23) ";" | ||
26 | WHITESPACE@[23; 24) " " | ||
27 | R_CURLY@[24; 25) "}" | ||
28 | WHITESPACE@[25; 26) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0096_no_semi_after_block.rs b/crates/ra_syntax/test_data/parser/inline/ok/0096_no_semi_after_block.rs new file mode 100644 index 000000000..4919665cb --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0096_no_semi_after_block.rs | |||
@@ -0,0 +1,13 @@ | |||
1 | fn foo() { | ||
2 | if true {} | ||
3 | loop {} | ||
4 | match () {} | ||
5 | while true {} | ||
6 | for _ in () {} | ||
7 | {} | ||
8 | {} | ||
9 | macro_rules! test { | ||
10 | () => {} | ||
11 | } | ||
12 | test!{} | ||
13 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0096_no_semi_after_block.txt b/crates/ra_syntax/test_data/parser/inline/ok/0096_no_semi_after_block.txt new file mode 100644 index 000000000..6d24f214e --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0096_no_semi_after_block.txt | |||
@@ -0,0 +1,125 @@ | |||
1 | SOURCE_FILE@[0; 167) | ||
2 | FN_DEF@[0; 166) | ||
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; 166) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 15) "\n " | ||
14 | EXPR_STMT@[15; 25) | ||
15 | IF_EXPR@[15; 25) | ||
16 | IF_KW@[15; 17) "if" | ||
17 | WHITESPACE@[17; 18) " " | ||
18 | CONDITION@[18; 22) | ||
19 | LITERAL@[18; 22) | ||
20 | TRUE_KW@[18; 22) "true" | ||
21 | WHITESPACE@[22; 23) " " | ||
22 | BLOCK@[23; 25) | ||
23 | L_CURLY@[23; 24) "{" | ||
24 | R_CURLY@[24; 25) "}" | ||
25 | WHITESPACE@[25; 30) "\n " | ||
26 | EXPR_STMT@[30; 37) | ||
27 | LOOP_EXPR@[30; 37) | ||
28 | LOOP_KW@[30; 34) "loop" | ||
29 | WHITESPACE@[34; 35) " " | ||
30 | BLOCK@[35; 37) | ||
31 | L_CURLY@[35; 36) "{" | ||
32 | R_CURLY@[36; 37) "}" | ||
33 | WHITESPACE@[37; 42) "\n " | ||
34 | EXPR_STMT@[42; 53) | ||
35 | MATCH_EXPR@[42; 53) | ||
36 | MATCH_KW@[42; 47) "match" | ||
37 | WHITESPACE@[47; 48) " " | ||
38 | TUPLE_EXPR@[48; 50) | ||
39 | L_PAREN@[48; 49) "(" | ||
40 | R_PAREN@[49; 50) ")" | ||
41 | WHITESPACE@[50; 51) " " | ||
42 | MATCH_ARM_LIST@[51; 53) | ||
43 | L_CURLY@[51; 52) "{" | ||
44 | R_CURLY@[52; 53) "}" | ||
45 | WHITESPACE@[53; 58) "\n " | ||
46 | EXPR_STMT@[58; 71) | ||
47 | WHILE_EXPR@[58; 71) | ||
48 | WHILE_KW@[58; 63) "while" | ||
49 | WHITESPACE@[63; 64) " " | ||
50 | CONDITION@[64; 68) | ||
51 | LITERAL@[64; 68) | ||
52 | TRUE_KW@[64; 68) "true" | ||
53 | WHITESPACE@[68; 69) " " | ||
54 | BLOCK@[69; 71) | ||
55 | L_CURLY@[69; 70) "{" | ||
56 | R_CURLY@[70; 71) "}" | ||
57 | WHITESPACE@[71; 76) "\n " | ||
58 | EXPR_STMT@[76; 90) | ||
59 | FOR_EXPR@[76; 90) | ||
60 | FOR_KW@[76; 79) "for" | ||
61 | WHITESPACE@[79; 80) " " | ||
62 | PLACEHOLDER_PAT@[80; 81) | ||
63 | UNDERSCORE@[80; 81) "_" | ||
64 | WHITESPACE@[81; 82) " " | ||
65 | IN_KW@[82; 84) "in" | ||
66 | WHITESPACE@[84; 85) " " | ||
67 | TUPLE_EXPR@[85; 87) | ||
68 | L_PAREN@[85; 86) "(" | ||
69 | R_PAREN@[86; 87) ")" | ||
70 | WHITESPACE@[87; 88) " " | ||
71 | BLOCK@[88; 90) | ||
72 | L_CURLY@[88; 89) "{" | ||
73 | R_CURLY@[89; 90) "}" | ||
74 | WHITESPACE@[90; 95) "\n " | ||
75 | EXPR_STMT@[95; 97) | ||
76 | BLOCK_EXPR@[95; 97) | ||
77 | BLOCK@[95; 97) | ||
78 | L_CURLY@[95; 96) "{" | ||
79 | R_CURLY@[96; 97) "}" | ||
80 | WHITESPACE@[97; 102) "\n " | ||
81 | EXPR_STMT@[102; 104) | ||
82 | BLOCK_EXPR@[102; 104) | ||
83 | BLOCK@[102; 104) | ||
84 | L_CURLY@[102; 103) "{" | ||
85 | R_CURLY@[103; 104) "}" | ||
86 | WHITESPACE@[104; 109) "\n " | ||
87 | EXPR_STMT@[109; 152) | ||
88 | MACRO_CALL@[109; 152) | ||
89 | PATH@[109; 120) | ||
90 | PATH_SEGMENT@[109; 120) | ||
91 | NAME_REF@[109; 120) | ||
92 | IDENT@[109; 120) "macro_rules" | ||
93 | EXCL@[120; 121) "!" | ||
94 | WHITESPACE@[121; 122) " " | ||
95 | NAME@[122; 126) | ||
96 | IDENT@[122; 126) "test" | ||
97 | WHITESPACE@[126; 127) " " | ||
98 | TOKEN_TREE@[127; 152) | ||
99 | L_CURLY@[127; 128) "{" | ||
100 | WHITESPACE@[128; 138) "\n " | ||
101 | TOKEN_TREE@[138; 140) | ||
102 | L_PAREN@[138; 139) "(" | ||
103 | R_PAREN@[139; 140) ")" | ||
104 | WHITESPACE@[140; 141) " " | ||
105 | EQ@[141; 142) "=" | ||
106 | R_ANGLE@[142; 143) ">" | ||
107 | WHITESPACE@[143; 144) " " | ||
108 | TOKEN_TREE@[144; 146) | ||
109 | L_CURLY@[144; 145) "{" | ||
110 | R_CURLY@[145; 146) "}" | ||
111 | WHITESPACE@[146; 151) "\n " | ||
112 | R_CURLY@[151; 152) "}" | ||
113 | WHITESPACE@[152; 157) "\n " | ||
114 | MACRO_CALL@[157; 164) | ||
115 | PATH@[157; 161) | ||
116 | PATH_SEGMENT@[157; 161) | ||
117 | NAME_REF@[157; 161) | ||
118 | IDENT@[157; 161) "test" | ||
119 | EXCL@[161; 162) "!" | ||
120 | TOKEN_TREE@[162; 164) | ||
121 | L_CURLY@[162; 163) "{" | ||
122 | R_CURLY@[163; 164) "}" | ||
123 | WHITESPACE@[164; 165) "\n" | ||
124 | R_CURLY@[165; 166) "}" | ||
125 | WHITESPACE@[166; 167) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0097_default_impl.rs b/crates/ra_syntax/test_data/parser/inline/ok/0097_default_impl.rs new file mode 100644 index 000000000..ef6aa84a2 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0097_default_impl.rs | |||
@@ -0,0 +1 @@ | |||
default impl Foo {} | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0097_default_impl.txt b/crates/ra_syntax/test_data/parser/inline/ok/0097_default_impl.txt new file mode 100644 index 000000000..ada94a824 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0097_default_impl.txt | |||
@@ -0,0 +1,16 @@ | |||
1 | SOURCE_FILE@[0; 20) | ||
2 | IMPL_BLOCK@[0; 19) | ||
3 | DEFAULT_KW@[0; 7) "default" | ||
4 | WHITESPACE@[7; 8) " " | ||
5 | IMPL_KW@[8; 12) "impl" | ||
6 | WHITESPACE@[12; 13) " " | ||
7 | PATH_TYPE@[13; 16) | ||
8 | PATH@[13; 16) | ||
9 | PATH_SEGMENT@[13; 16) | ||
10 | NAME_REF@[13; 16) | ||
11 | IDENT@[13; 16) "Foo" | ||
12 | WHITESPACE@[16; 17) " " | ||
13 | ITEM_LIST@[17; 19) | ||
14 | L_CURLY@[17; 18) "{" | ||
15 | R_CURLY@[18; 19) "}" | ||
16 | WHITESPACE@[19; 20) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0098_const_unsafe_fn.rs b/crates/ra_syntax/test_data/parser/inline/ok/0098_const_unsafe_fn.rs new file mode 100644 index 000000000..31a1e435f --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0098_const_unsafe_fn.rs | |||
@@ -0,0 +1 @@ | |||
const unsafe fn foo() {} | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0098_const_unsafe_fn.txt b/crates/ra_syntax/test_data/parser/inline/ok/0098_const_unsafe_fn.txt new file mode 100644 index 000000000..0dd42ab8e --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0098_const_unsafe_fn.txt | |||
@@ -0,0 +1,18 @@ | |||
1 | SOURCE_FILE@[0; 25) | ||
2 | FN_DEF@[0; 24) | ||
3 | CONST_KW@[0; 5) "const" | ||
4 | WHITESPACE@[5; 6) " " | ||
5 | UNSAFE_KW@[6; 12) "unsafe" | ||
6 | WHITESPACE@[12; 13) " " | ||
7 | FN_KW@[13; 15) "fn" | ||
8 | WHITESPACE@[15; 16) " " | ||
9 | NAME@[16; 19) | ||
10 | IDENT@[16; 19) "foo" | ||
11 | PARAM_LIST@[19; 21) | ||
12 | L_PAREN@[19; 20) "(" | ||
13 | R_PAREN@[20; 21) ")" | ||
14 | WHITESPACE@[21; 22) " " | ||
15 | BLOCK@[22; 24) | ||
16 | L_CURLY@[22; 23) "{" | ||
17 | R_CURLY@[23; 24) "}" | ||
18 | WHITESPACE@[24; 25) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0099_param_list.rs b/crates/ra_syntax/test_data/parser/inline/ok/0099_param_list.rs new file mode 100644 index 000000000..9d55bedbb --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0099_param_list.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn a() {} | ||
2 | fn b(x: i32) {} | ||
3 | fn c(x: i32, ) {} | ||
4 | fn d(x: i32, y: ()) {} | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0099_param_list.txt b/crates/ra_syntax/test_data/parser/inline/ok/0099_param_list.txt new file mode 100644 index 000000000..80d636819 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0099_param_list.txt | |||
@@ -0,0 +1,99 @@ | |||
1 | SOURCE_FILE@[0; 67) | ||
2 | FN_DEF@[0; 9) | ||
3 | FN_KW@[0; 2) "fn" | ||
4 | WHITESPACE@[2; 3) " " | ||
5 | NAME@[3; 4) | ||
6 | IDENT@[3; 4) "a" | ||
7 | PARAM_LIST@[4; 6) | ||
8 | L_PAREN@[4; 5) "(" | ||
9 | R_PAREN@[5; 6) ")" | ||
10 | WHITESPACE@[6; 7) " " | ||
11 | BLOCK@[7; 9) | ||
12 | L_CURLY@[7; 8) "{" | ||
13 | R_CURLY@[8; 9) "}" | ||
14 | WHITESPACE@[9; 10) "\n" | ||
15 | FN_DEF@[10; 25) | ||
16 | FN_KW@[10; 12) "fn" | ||
17 | WHITESPACE@[12; 13) " " | ||
18 | NAME@[13; 14) | ||
19 | IDENT@[13; 14) "b" | ||
20 | PARAM_LIST@[14; 22) | ||
21 | L_PAREN@[14; 15) "(" | ||
22 | PARAM@[15; 21) | ||
23 | BIND_PAT@[15; 16) | ||
24 | NAME@[15; 16) | ||
25 | IDENT@[15; 16) "x" | ||
26 | COLON@[16; 17) ":" | ||
27 | WHITESPACE@[17; 18) " " | ||
28 | PATH_TYPE@[18; 21) | ||
29 | PATH@[18; 21) | ||
30 | PATH_SEGMENT@[18; 21) | ||
31 | NAME_REF@[18; 21) | ||
32 | IDENT@[18; 21) "i32" | ||
33 | R_PAREN@[21; 22) ")" | ||
34 | WHITESPACE@[22; 23) " " | ||
35 | BLOCK@[23; 25) | ||
36 | L_CURLY@[23; 24) "{" | ||
37 | R_CURLY@[24; 25) "}" | ||
38 | WHITESPACE@[25; 26) "\n" | ||
39 | FN_DEF@[26; 43) | ||
40 | FN_KW@[26; 28) "fn" | ||
41 | WHITESPACE@[28; 29) " " | ||
42 | NAME@[29; 30) | ||
43 | IDENT@[29; 30) "c" | ||
44 | PARAM_LIST@[30; 40) | ||
45 | L_PAREN@[30; 31) "(" | ||
46 | PARAM@[31; 37) | ||
47 | BIND_PAT@[31; 32) | ||
48 | NAME@[31; 32) | ||
49 | IDENT@[31; 32) "x" | ||
50 | COLON@[32; 33) ":" | ||
51 | WHITESPACE@[33; 34) " " | ||
52 | PATH_TYPE@[34; 37) | ||
53 | PATH@[34; 37) | ||
54 | PATH_SEGMENT@[34; 37) | ||
55 | NAME_REF@[34; 37) | ||
56 | IDENT@[34; 37) "i32" | ||
57 | COMMA@[37; 38) "," | ||
58 | WHITESPACE@[38; 39) " " | ||
59 | R_PAREN@[39; 40) ")" | ||
60 | WHITESPACE@[40; 41) " " | ||
61 | BLOCK@[41; 43) | ||
62 | L_CURLY@[41; 42) "{" | ||
63 | R_CURLY@[42; 43) "}" | ||
64 | WHITESPACE@[43; 44) "\n" | ||
65 | FN_DEF@[44; 66) | ||
66 | FN_KW@[44; 46) "fn" | ||
67 | WHITESPACE@[46; 47) " " | ||
68 | NAME@[47; 48) | ||
69 | IDENT@[47; 48) "d" | ||
70 | PARAM_LIST@[48; 63) | ||
71 | L_PAREN@[48; 49) "(" | ||
72 | PARAM@[49; 55) | ||
73 | BIND_PAT@[49; 50) | ||
74 | NAME@[49; 50) | ||
75 | IDENT@[49; 50) "x" | ||
76 | COLON@[50; 51) ":" | ||
77 | WHITESPACE@[51; 52) " " | ||
78 | PATH_TYPE@[52; 55) | ||
79 | PATH@[52; 55) | ||
80 | PATH_SEGMENT@[52; 55) | ||
81 | NAME_REF@[52; 55) | ||
82 | IDENT@[52; 55) "i32" | ||
83 | COMMA@[55; 56) "," | ||
84 | WHITESPACE@[56; 57) " " | ||
85 | PARAM@[57; 62) | ||
86 | BIND_PAT@[57; 58) | ||
87 | NAME@[57; 58) | ||
88 | IDENT@[57; 58) "y" | ||
89 | COLON@[58; 59) ":" | ||
90 | WHITESPACE@[59; 60) " " | ||
91 | TUPLE_TYPE@[60; 62) | ||
92 | L_PAREN@[60; 61) "(" | ||
93 | R_PAREN@[61; 62) ")" | ||
94 | R_PAREN@[62; 63) ")" | ||
95 | WHITESPACE@[63; 64) " " | ||
96 | BLOCK@[64; 66) | ||
97 | L_CURLY@[64; 65) "{" | ||
98 | R_CURLY@[65; 66) "}" | ||
99 | WHITESPACE@[66; 67) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0100_for_expr.rs b/crates/ra_syntax/test_data/parser/inline/ok/0100_for_expr.rs new file mode 100644 index 000000000..972197d2a --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0100_for_expr.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn foo() { | ||
2 | for x in [] {}; | ||
3 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0100_for_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0100_for_expr.txt new file mode 100644 index 000000000..09e108570 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0100_for_expr.txt | |||
@@ -0,0 +1,34 @@ | |||
1 | SOURCE_FILE@[0; 33) | ||
2 | FN_DEF@[0; 32) | ||
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; 32) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 15) "\n " | ||
14 | EXPR_STMT@[15; 30) | ||
15 | FOR_EXPR@[15; 29) | ||
16 | FOR_KW@[15; 18) "for" | ||
17 | WHITESPACE@[18; 19) " " | ||
18 | BIND_PAT@[19; 20) | ||
19 | NAME@[19; 20) | ||
20 | IDENT@[19; 20) "x" | ||
21 | WHITESPACE@[20; 21) " " | ||
22 | IN_KW@[21; 23) "in" | ||
23 | WHITESPACE@[23; 24) " " | ||
24 | ARRAY_EXPR@[24; 26) | ||
25 | L_BRACK@[24; 25) "[" | ||
26 | R_BRACK@[25; 26) "]" | ||
27 | WHITESPACE@[26; 27) " " | ||
28 | BLOCK@[27; 29) | ||
29 | L_CURLY@[27; 28) "{" | ||
30 | R_CURLY@[28; 29) "}" | ||
31 | SEMI@[29; 30) ";" | ||
32 | WHITESPACE@[30; 31) "\n" | ||
33 | R_CURLY@[31; 32) "}" | ||
34 | WHITESPACE@[32; 33) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0101_unsafe_fn.rs b/crates/ra_syntax/test_data/parser/inline/ok/0101_unsafe_fn.rs new file mode 100644 index 000000000..33cfc4cd7 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0101_unsafe_fn.rs | |||
@@ -0,0 +1 @@ | |||
unsafe fn foo() {} | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0101_unsafe_fn.txt b/crates/ra_syntax/test_data/parser/inline/ok/0101_unsafe_fn.txt new file mode 100644 index 000000000..1a60f6ffe --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0101_unsafe_fn.txt | |||
@@ -0,0 +1,16 @@ | |||
1 | SOURCE_FILE@[0; 19) | ||
2 | FN_DEF@[0; 18) | ||
3 | UNSAFE_KW@[0; 6) "unsafe" | ||
4 | WHITESPACE@[6; 7) " " | ||
5 | FN_KW@[7; 9) "fn" | ||
6 | WHITESPACE@[9; 10) " " | ||
7 | NAME@[10; 13) | ||
8 | IDENT@[10; 13) "foo" | ||
9 | PARAM_LIST@[13; 15) | ||
10 | L_PAREN@[13; 14) "(" | ||
11 | R_PAREN@[14; 15) ")" | ||
12 | WHITESPACE@[15; 16) " " | ||
13 | BLOCK@[16; 18) | ||
14 | L_CURLY@[16; 17) "{" | ||
15 | R_CURLY@[17; 18) "}" | ||
16 | WHITESPACE@[18; 19) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0102_field_pat_list.rs b/crates/ra_syntax/test_data/parser/inline/ok/0102_field_pat_list.rs new file mode 100644 index 000000000..da3412fa8 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0102_field_pat_list.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | fn foo() { | ||
2 | let S {} = (); | ||
3 | let S { f, ref mut g } = (); | ||
4 | let S { h: _, ..} = (); | ||
5 | let S { h: _, } = (); | ||
6 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0102_field_pat_list.txt b/crates/ra_syntax/test_data/parser/inline/ok/0102_field_pat_list.txt new file mode 100644 index 000000000..a2af4fc60 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0102_field_pat_list.txt | |||
@@ -0,0 +1,130 @@ | |||
1 | SOURCE_FILE@[0; 119) | ||
2 | FN_DEF@[0; 118) | ||
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; 118) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 15) "\n " | ||
14 | LET_STMT@[15; 29) | ||
15 | LET_KW@[15; 18) "let" | ||
16 | WHITESPACE@[18; 19) " " | ||
17 | STRUCT_PAT@[19; 23) | ||
18 | PATH@[19; 20) | ||
19 | PATH_SEGMENT@[19; 20) | ||
20 | NAME_REF@[19; 20) | ||
21 | IDENT@[19; 20) "S" | ||
22 | WHITESPACE@[20; 21) " " | ||
23 | FIELD_PAT_LIST@[21; 23) | ||
24 | L_CURLY@[21; 22) "{" | ||
25 | R_CURLY@[22; 23) "}" | ||
26 | WHITESPACE@[23; 24) " " | ||
27 | EQ@[24; 25) "=" | ||
28 | WHITESPACE@[25; 26) " " | ||
29 | TUPLE_EXPR@[26; 28) | ||
30 | L_PAREN@[26; 27) "(" | ||
31 | R_PAREN@[27; 28) ")" | ||
32 | SEMI@[28; 29) ";" | ||
33 | WHITESPACE@[29; 34) "\n " | ||
34 | LET_STMT@[34; 62) | ||
35 | LET_KW@[34; 37) "let" | ||
36 | WHITESPACE@[37; 38) " " | ||
37 | STRUCT_PAT@[38; 56) | ||
38 | PATH@[38; 39) | ||
39 | PATH_SEGMENT@[38; 39) | ||
40 | NAME_REF@[38; 39) | ||
41 | IDENT@[38; 39) "S" | ||
42 | WHITESPACE@[39; 40) " " | ||
43 | FIELD_PAT_LIST@[40; 56) | ||
44 | L_CURLY@[40; 41) "{" | ||
45 | WHITESPACE@[41; 42) " " | ||
46 | BIND_PAT@[42; 43) | ||
47 | NAME@[42; 43) | ||
48 | IDENT@[42; 43) "f" | ||
49 | COMMA@[43; 44) "," | ||
50 | WHITESPACE@[44; 45) " " | ||
51 | BIND_PAT@[45; 54) | ||
52 | REF_KW@[45; 48) "ref" | ||
53 | WHITESPACE@[48; 49) " " | ||
54 | MUT_KW@[49; 52) "mut" | ||
55 | WHITESPACE@[52; 53) " " | ||
56 | NAME@[53; 54) | ||
57 | IDENT@[53; 54) "g" | ||
58 | WHITESPACE@[54; 55) " " | ||
59 | R_CURLY@[55; 56) "}" | ||
60 | WHITESPACE@[56; 57) " " | ||
61 | EQ@[57; 58) "=" | ||
62 | WHITESPACE@[58; 59) " " | ||
63 | TUPLE_EXPR@[59; 61) | ||
64 | L_PAREN@[59; 60) "(" | ||
65 | R_PAREN@[60; 61) ")" | ||
66 | SEMI@[61; 62) ";" | ||
67 | WHITESPACE@[62; 67) "\n " | ||
68 | LET_STMT@[67; 90) | ||
69 | LET_KW@[67; 70) "let" | ||
70 | WHITESPACE@[70; 71) " " | ||
71 | STRUCT_PAT@[71; 84) | ||
72 | PATH@[71; 72) | ||
73 | PATH_SEGMENT@[71; 72) | ||
74 | NAME_REF@[71; 72) | ||
75 | IDENT@[71; 72) "S" | ||
76 | WHITESPACE@[72; 73) " " | ||
77 | FIELD_PAT_LIST@[73; 84) | ||
78 | L_CURLY@[73; 74) "{" | ||
79 | WHITESPACE@[74; 75) " " | ||
80 | FIELD_PAT@[75; 79) | ||
81 | NAME@[75; 76) | ||
82 | IDENT@[75; 76) "h" | ||
83 | COLON@[76; 77) ":" | ||
84 | WHITESPACE@[77; 78) " " | ||
85 | PLACEHOLDER_PAT@[78; 79) | ||
86 | UNDERSCORE@[78; 79) "_" | ||
87 | COMMA@[79; 80) "," | ||
88 | WHITESPACE@[80; 81) " " | ||
89 | DOTDOT@[81; 83) ".." | ||
90 | R_CURLY@[83; 84) "}" | ||
91 | WHITESPACE@[84; 85) " " | ||
92 | EQ@[85; 86) "=" | ||
93 | WHITESPACE@[86; 87) " " | ||
94 | TUPLE_EXPR@[87; 89) | ||
95 | L_PAREN@[87; 88) "(" | ||
96 | R_PAREN@[88; 89) ")" | ||
97 | SEMI@[89; 90) ";" | ||
98 | WHITESPACE@[90; 95) "\n " | ||
99 | LET_STMT@[95; 116) | ||
100 | LET_KW@[95; 98) "let" | ||
101 | WHITESPACE@[98; 99) " " | ||
102 | STRUCT_PAT@[99; 110) | ||
103 | PATH@[99; 100) | ||
104 | PATH_SEGMENT@[99; 100) | ||
105 | NAME_REF@[99; 100) | ||
106 | IDENT@[99; 100) "S" | ||
107 | WHITESPACE@[100; 101) " " | ||
108 | FIELD_PAT_LIST@[101; 110) | ||
109 | L_CURLY@[101; 102) "{" | ||
110 | WHITESPACE@[102; 103) " " | ||
111 | FIELD_PAT@[103; 107) | ||
112 | NAME@[103; 104) | ||
113 | IDENT@[103; 104) "h" | ||
114 | COLON@[104; 105) ":" | ||
115 | WHITESPACE@[105; 106) " " | ||
116 | PLACEHOLDER_PAT@[106; 107) | ||
117 | UNDERSCORE@[106; 107) "_" | ||
118 | COMMA@[107; 108) "," | ||
119 | WHITESPACE@[108; 109) " " | ||
120 | R_CURLY@[109; 110) "}" | ||
121 | WHITESPACE@[110; 111) " " | ||
122 | EQ@[111; 112) "=" | ||
123 | WHITESPACE@[112; 113) " " | ||
124 | TUPLE_EXPR@[113; 115) | ||
125 | L_PAREN@[113; 114) "(" | ||
126 | R_PAREN@[114; 115) ")" | ||
127 | SEMI@[115; 116) ";" | ||
128 | WHITESPACE@[116; 117) "\n" | ||
129 | R_CURLY@[117; 118) "}" | ||
130 | WHITESPACE@[118; 119) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0103_array_expr.rs b/crates/ra_syntax/test_data/parser/inline/ok/0103_array_expr.rs new file mode 100644 index 000000000..4dc1999d1 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0103_array_expr.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | fn foo() { | ||
2 | []; | ||
3 | [1]; | ||
4 | [1, 2,]; | ||
5 | [1; 2]; | ||
6 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0103_array_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0103_array_expr.txt new file mode 100644 index 000000000..e74e231b3 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0103_array_expr.txt | |||
@@ -0,0 +1,54 @@ | |||
1 | SOURCE_FILE@[0; 55) | ||
2 | FN_DEF@[0; 54) | ||
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; 54) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 15) "\n " | ||
14 | EXPR_STMT@[15; 18) | ||
15 | ARRAY_EXPR@[15; 17) | ||
16 | L_BRACK@[15; 16) "[" | ||
17 | R_BRACK@[16; 17) "]" | ||
18 | SEMI@[17; 18) ";" | ||
19 | WHITESPACE@[18; 23) "\n " | ||
20 | EXPR_STMT@[23; 27) | ||
21 | ARRAY_EXPR@[23; 26) | ||
22 | L_BRACK@[23; 24) "[" | ||
23 | LITERAL@[24; 25) | ||
24 | INT_NUMBER@[24; 25) "1" | ||
25 | R_BRACK@[25; 26) "]" | ||
26 | SEMI@[26; 27) ";" | ||
27 | WHITESPACE@[27; 32) "\n " | ||
28 | EXPR_STMT@[32; 40) | ||
29 | ARRAY_EXPR@[32; 39) | ||
30 | L_BRACK@[32; 33) "[" | ||
31 | LITERAL@[33; 34) | ||
32 | INT_NUMBER@[33; 34) "1" | ||
33 | COMMA@[34; 35) "," | ||
34 | WHITESPACE@[35; 36) " " | ||
35 | LITERAL@[36; 37) | ||
36 | INT_NUMBER@[36; 37) "2" | ||
37 | COMMA@[37; 38) "," | ||
38 | R_BRACK@[38; 39) "]" | ||
39 | SEMI@[39; 40) ";" | ||
40 | WHITESPACE@[40; 45) "\n " | ||
41 | EXPR_STMT@[45; 52) | ||
42 | ARRAY_EXPR@[45; 51) | ||
43 | L_BRACK@[45; 46) "[" | ||
44 | LITERAL@[46; 47) | ||
45 | INT_NUMBER@[46; 47) "1" | ||
46 | SEMI@[47; 48) ";" | ||
47 | WHITESPACE@[48; 49) " " | ||
48 | LITERAL@[49; 50) | ||
49 | INT_NUMBER@[49; 50) "2" | ||
50 | R_BRACK@[50; 51) "]" | ||
51 | SEMI@[51; 52) ";" | ||
52 | WHITESPACE@[52; 53) "\n" | ||
53 | R_CURLY@[53; 54) "}" | ||
54 | WHITESPACE@[54; 55) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0104_path_fn_trait_args.rs b/crates/ra_syntax/test_data/parser/inline/ok/0104_path_fn_trait_args.rs new file mode 100644 index 000000000..aef45e561 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0104_path_fn_trait_args.rs | |||
@@ -0,0 +1 @@ | |||
type F = Box<Fn(x: i32) -> ()>; | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0104_path_fn_trait_args.txt b/crates/ra_syntax/test_data/parser/inline/ok/0104_path_fn_trait_args.txt new file mode 100644 index 000000000..d6f196811 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0104_path_fn_trait_args.txt | |||
@@ -0,0 +1,46 @@ | |||
1 | SOURCE_FILE@[0; 32) | ||
2 | TYPE_ALIAS_DEF@[0; 31) | ||
3 | TYPE_KW@[0; 4) "type" | ||
4 | WHITESPACE@[4; 5) " " | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "F" | ||
7 | WHITESPACE@[6; 7) " " | ||
8 | EQ@[7; 8) "=" | ||
9 | WHITESPACE@[8; 9) " " | ||
10 | PATH_TYPE@[9; 30) | ||
11 | PATH@[9; 30) | ||
12 | PATH_SEGMENT@[9; 30) | ||
13 | NAME_REF@[9; 12) | ||
14 | IDENT@[9; 12) "Box" | ||
15 | TYPE_ARG_LIST@[12; 30) | ||
16 | L_ANGLE@[12; 13) "<" | ||
17 | TYPE_ARG@[13; 29) | ||
18 | PATH_TYPE@[13; 29) | ||
19 | PATH@[13; 29) | ||
20 | PATH_SEGMENT@[13; 29) | ||
21 | NAME_REF@[13; 15) | ||
22 | IDENT@[13; 15) "Fn" | ||
23 | PARAM_LIST@[15; 23) | ||
24 | L_PAREN@[15; 16) "(" | ||
25 | PARAM@[16; 22) | ||
26 | BIND_PAT@[16; 17) | ||
27 | NAME@[16; 17) | ||
28 | IDENT@[16; 17) "x" | ||
29 | COLON@[17; 18) ":" | ||
30 | WHITESPACE@[18; 19) " " | ||
31 | PATH_TYPE@[19; 22) | ||
32 | PATH@[19; 22) | ||
33 | PATH_SEGMENT@[19; 22) | ||
34 | NAME_REF@[19; 22) | ||
35 | IDENT@[19; 22) "i32" | ||
36 | R_PAREN@[22; 23) ")" | ||
37 | WHITESPACE@[23; 24) " " | ||
38 | RET_TYPE@[24; 29) | ||
39 | THIN_ARROW@[24; 26) "->" | ||
40 | WHITESPACE@[26; 27) " " | ||
41 | TUPLE_TYPE@[27; 29) | ||
42 | L_PAREN@[27; 28) "(" | ||
43 | R_PAREN@[28; 29) ")" | ||
44 | R_ANGLE@[29; 30) ">" | ||
45 | SEMI@[30; 31) ";" | ||
46 | WHITESPACE@[31; 32) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0105_block_expr.rs b/crates/ra_syntax/test_data/parser/inline/ok/0105_block_expr.rs new file mode 100644 index 000000000..2fed74c5e --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0105_block_expr.rs | |||
@@ -0,0 +1,5 @@ | |||
1 | fn foo() { | ||
2 | {}; | ||
3 | unsafe {}; | ||
4 | 'label: {}; | ||
5 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0105_block_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0105_block_expr.txt new file mode 100644 index 000000000..4bc446a55 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0105_block_expr.txt | |||
@@ -0,0 +1,42 @@ | |||
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; 15) "\n " | ||
14 | EXPR_STMT@[15; 18) | ||
15 | BLOCK_EXPR@[15; 17) | ||
16 | BLOCK@[15; 17) | ||
17 | L_CURLY@[15; 16) "{" | ||
18 | R_CURLY@[16; 17) "}" | ||
19 | SEMI@[17; 18) ";" | ||
20 | WHITESPACE@[18; 23) "\n " | ||
21 | EXPR_STMT@[23; 33) | ||
22 | BLOCK_EXPR@[23; 32) | ||
23 | UNSAFE_KW@[23; 29) "unsafe" | ||
24 | WHITESPACE@[29; 30) " " | ||
25 | BLOCK@[30; 32) | ||
26 | L_CURLY@[30; 31) "{" | ||
27 | R_CURLY@[31; 32) "}" | ||
28 | SEMI@[32; 33) ";" | ||
29 | WHITESPACE@[33; 38) "\n " | ||
30 | EXPR_STMT@[38; 49) | ||
31 | BLOCK_EXPR@[38; 48) | ||
32 | LABEL@[38; 45) | ||
33 | LIFETIME@[38; 44) "\'label" | ||
34 | COLON@[44; 45) ":" | ||
35 | WHITESPACE@[45; 46) " " | ||
36 | BLOCK@[46; 48) | ||
37 | L_CURLY@[46; 47) "{" | ||
38 | R_CURLY@[47; 48) "}" | ||
39 | SEMI@[48; 49) ";" | ||
40 | WHITESPACE@[49; 50) "\n" | ||
41 | R_CURLY@[50; 51) "}" | ||
42 | WHITESPACE@[51; 52) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0106_lambda_expr.rs b/crates/ra_syntax/test_data/parser/inline/ok/0106_lambda_expr.rs new file mode 100644 index 000000000..075717823 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0106_lambda_expr.rs | |||
@@ -0,0 +1,9 @@ | |||
1 | fn foo() { | ||
2 | || (); | ||
3 | || -> i32 { 92 }; | ||
4 | |x| x; | ||
5 | move |x: i32,| x; | ||
6 | async || {}; | ||
7 | move || {}; | ||
8 | async move || {}; | ||
9 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0106_lambda_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0106_lambda_expr.txt new file mode 100644 index 000000000..a05218118 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0106_lambda_expr.txt | |||
@@ -0,0 +1,139 @@ | |||
1 | SOURCE_FILE@[0; 134) | ||
2 | FN_DEF@[0; 133) | ||
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; 133) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 15) "\n " | ||
14 | EXPR_STMT@[15; 21) | ||
15 | LAMBDA_EXPR@[15; 20) | ||
16 | PARAM_LIST@[15; 17) | ||
17 | PIPE@[15; 16) "|" | ||
18 | PIPE@[16; 17) "|" | ||
19 | WHITESPACE@[17; 18) " " | ||
20 | TUPLE_EXPR@[18; 20) | ||
21 | L_PAREN@[18; 19) "(" | ||
22 | R_PAREN@[19; 20) ")" | ||
23 | SEMI@[20; 21) ";" | ||
24 | WHITESPACE@[21; 26) "\n " | ||
25 | EXPR_STMT@[26; 43) | ||
26 | LAMBDA_EXPR@[26; 42) | ||
27 | PARAM_LIST@[26; 28) | ||
28 | PIPE@[26; 27) "|" | ||
29 | PIPE@[27; 28) "|" | ||
30 | WHITESPACE@[28; 29) " " | ||
31 | RET_TYPE@[29; 35) | ||
32 | THIN_ARROW@[29; 31) "->" | ||
33 | WHITESPACE@[31; 32) " " | ||
34 | PATH_TYPE@[32; 35) | ||
35 | PATH@[32; 35) | ||
36 | PATH_SEGMENT@[32; 35) | ||
37 | NAME_REF@[32; 35) | ||
38 | IDENT@[32; 35) "i32" | ||
39 | WHITESPACE@[35; 36) " " | ||
40 | BLOCK_EXPR@[36; 42) | ||
41 | BLOCK@[36; 42) | ||
42 | L_CURLY@[36; 37) "{" | ||
43 | WHITESPACE@[37; 38) " " | ||
44 | LITERAL@[38; 40) | ||
45 | INT_NUMBER@[38; 40) "92" | ||
46 | WHITESPACE@[40; 41) " " | ||
47 | R_CURLY@[41; 42) "}" | ||
48 | SEMI@[42; 43) ";" | ||
49 | WHITESPACE@[43; 48) "\n " | ||
50 | EXPR_STMT@[48; 54) | ||
51 | LAMBDA_EXPR@[48; 53) | ||
52 | PARAM_LIST@[48; 51) | ||
53 | PIPE@[48; 49) "|" | ||
54 | PARAM@[49; 50) | ||
55 | BIND_PAT@[49; 50) | ||
56 | NAME@[49; 50) | ||
57 | IDENT@[49; 50) "x" | ||
58 | PIPE@[50; 51) "|" | ||
59 | WHITESPACE@[51; 52) " " | ||
60 | PATH_EXPR@[52; 53) | ||
61 | PATH@[52; 53) | ||
62 | PATH_SEGMENT@[52; 53) | ||
63 | NAME_REF@[52; 53) | ||
64 | IDENT@[52; 53) "x" | ||
65 | SEMI@[53; 54) ";" | ||
66 | WHITESPACE@[54; 59) "\n " | ||
67 | EXPR_STMT@[59; 76) | ||
68 | LAMBDA_EXPR@[59; 75) | ||
69 | MOVE_KW@[59; 63) "move" | ||
70 | WHITESPACE@[63; 64) " " | ||
71 | PARAM_LIST@[64; 73) | ||
72 | PIPE@[64; 65) "|" | ||
73 | PARAM@[65; 71) | ||
74 | BIND_PAT@[65; 66) | ||
75 | NAME@[65; 66) | ||
76 | IDENT@[65; 66) "x" | ||
77 | COLON@[66; 67) ":" | ||
78 | WHITESPACE@[67; 68) " " | ||
79 | PATH_TYPE@[68; 71) | ||
80 | PATH@[68; 71) | ||
81 | PATH_SEGMENT@[68; 71) | ||
82 | NAME_REF@[68; 71) | ||
83 | IDENT@[68; 71) "i32" | ||
84 | COMMA@[71; 72) "," | ||
85 | PIPE@[72; 73) "|" | ||
86 | WHITESPACE@[73; 74) " " | ||
87 | PATH_EXPR@[74; 75) | ||
88 | PATH@[74; 75) | ||
89 | PATH_SEGMENT@[74; 75) | ||
90 | NAME_REF@[74; 75) | ||
91 | IDENT@[74; 75) "x" | ||
92 | SEMI@[75; 76) ";" | ||
93 | WHITESPACE@[76; 81) "\n " | ||
94 | EXPR_STMT@[81; 93) | ||
95 | LAMBDA_EXPR@[81; 92) | ||
96 | ASYNC_KW@[81; 86) "async" | ||
97 | WHITESPACE@[86; 87) " " | ||
98 | PARAM_LIST@[87; 89) | ||
99 | PIPE@[87; 88) "|" | ||
100 | PIPE@[88; 89) "|" | ||
101 | WHITESPACE@[89; 90) " " | ||
102 | BLOCK_EXPR@[90; 92) | ||
103 | BLOCK@[90; 92) | ||
104 | L_CURLY@[90; 91) "{" | ||
105 | R_CURLY@[91; 92) "}" | ||
106 | SEMI@[92; 93) ";" | ||
107 | WHITESPACE@[93; 98) "\n " | ||
108 | EXPR_STMT@[98; 109) | ||
109 | LAMBDA_EXPR@[98; 108) | ||
110 | MOVE_KW@[98; 102) "move" | ||
111 | WHITESPACE@[102; 103) " " | ||
112 | PARAM_LIST@[103; 105) | ||
113 | PIPE@[103; 104) "|" | ||
114 | PIPE@[104; 105) "|" | ||
115 | WHITESPACE@[105; 106) " " | ||
116 | BLOCK_EXPR@[106; 108) | ||
117 | BLOCK@[106; 108) | ||
118 | L_CURLY@[106; 107) "{" | ||
119 | R_CURLY@[107; 108) "}" | ||
120 | SEMI@[108; 109) ";" | ||
121 | WHITESPACE@[109; 114) "\n " | ||
122 | EXPR_STMT@[114; 131) | ||
123 | LAMBDA_EXPR@[114; 130) | ||
124 | ASYNC_KW@[114; 119) "async" | ||
125 | WHITESPACE@[119; 120) " " | ||
126 | MOVE_KW@[120; 124) "move" | ||
127 | WHITESPACE@[124; 125) " " | ||
128 | PARAM_LIST@[125; 127) | ||
129 | PIPE@[125; 126) "|" | ||
130 | PIPE@[126; 127) "|" | ||
131 | WHITESPACE@[127; 128) " " | ||
132 | BLOCK_EXPR@[128; 130) | ||
133 | BLOCK@[128; 130) | ||
134 | L_CURLY@[128; 129) "{" | ||
135 | R_CURLY@[129; 130) "}" | ||
136 | SEMI@[130; 131) ";" | ||
137 | WHITESPACE@[131; 132) "\n" | ||
138 | R_CURLY@[132; 133) "}" | ||
139 | WHITESPACE@[133; 134) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0107_method_call_expr.rs b/crates/ra_syntax/test_data/parser/inline/ok/0107_method_call_expr.rs new file mode 100644 index 000000000..1a3aa35ae --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0107_method_call_expr.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn foo() { | ||
2 | x.foo(); | ||
3 | y.bar::<T>(1, 2,); | ||
4 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0107_method_call_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0107_method_call_expr.txt new file mode 100644 index 000000000..bc28b293e --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0107_method_call_expr.txt | |||
@@ -0,0 +1,62 @@ | |||
1 | SOURCE_FILE@[0; 49) | ||
2 | FN_DEF@[0; 48) | ||
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; 48) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 15) "\n " | ||
14 | EXPR_STMT@[15; 23) | ||
15 | METHOD_CALL_EXPR@[15; 22) | ||
16 | PATH_EXPR@[15; 16) | ||
17 | PATH@[15; 16) | ||
18 | PATH_SEGMENT@[15; 16) | ||
19 | NAME_REF@[15; 16) | ||
20 | IDENT@[15; 16) "x" | ||
21 | DOT@[16; 17) "." | ||
22 | NAME_REF@[17; 20) | ||
23 | IDENT@[17; 20) "foo" | ||
24 | ARG_LIST@[20; 22) | ||
25 | L_PAREN@[20; 21) "(" | ||
26 | R_PAREN@[21; 22) ")" | ||
27 | SEMI@[22; 23) ";" | ||
28 | WHITESPACE@[23; 28) "\n " | ||
29 | EXPR_STMT@[28; 46) | ||
30 | METHOD_CALL_EXPR@[28; 45) | ||
31 | PATH_EXPR@[28; 29) | ||
32 | PATH@[28; 29) | ||
33 | PATH_SEGMENT@[28; 29) | ||
34 | NAME_REF@[28; 29) | ||
35 | IDENT@[28; 29) "y" | ||
36 | DOT@[29; 30) "." | ||
37 | NAME_REF@[30; 33) | ||
38 | IDENT@[30; 33) "bar" | ||
39 | TYPE_ARG_LIST@[33; 38) | ||
40 | COLONCOLON@[33; 35) "::" | ||
41 | L_ANGLE@[35; 36) "<" | ||
42 | TYPE_ARG@[36; 37) | ||
43 | PATH_TYPE@[36; 37) | ||
44 | PATH@[36; 37) | ||
45 | PATH_SEGMENT@[36; 37) | ||
46 | NAME_REF@[36; 37) | ||
47 | IDENT@[36; 37) "T" | ||
48 | R_ANGLE@[37; 38) ">" | ||
49 | ARG_LIST@[38; 45) | ||
50 | L_PAREN@[38; 39) "(" | ||
51 | LITERAL@[39; 40) | ||
52 | INT_NUMBER@[39; 40) "1" | ||
53 | COMMA@[40; 41) "," | ||
54 | WHITESPACE@[41; 42) " " | ||
55 | LITERAL@[42; 43) | ||
56 | INT_NUMBER@[42; 43) "2" | ||
57 | COMMA@[43; 44) "," | ||
58 | R_PAREN@[44; 45) ")" | ||
59 | SEMI@[45; 46) ";" | ||
60 | WHITESPACE@[46; 47) "\n" | ||
61 | R_CURLY@[47; 48) "}" | ||
62 | WHITESPACE@[48; 49) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0108_tuple_expr.rs b/crates/ra_syntax/test_data/parser/inline/ok/0108_tuple_expr.rs new file mode 100644 index 000000000..e4f774280 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0108_tuple_expr.rs | |||
@@ -0,0 +1,5 @@ | |||
1 | fn foo() { | ||
2 | (); | ||
3 | (1); | ||
4 | (1,); | ||
5 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0108_tuple_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0108_tuple_expr.txt new file mode 100644 index 000000000..32be7a849 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0108_tuple_expr.txt | |||
@@ -0,0 +1,38 @@ | |||
1 | SOURCE_FILE@[0; 40) | ||
2 | FN_DEF@[0; 39) | ||
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; 39) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 15) "\n " | ||
14 | EXPR_STMT@[15; 18) | ||
15 | TUPLE_EXPR@[15; 17) | ||
16 | L_PAREN@[15; 16) "(" | ||
17 | R_PAREN@[16; 17) ")" | ||
18 | SEMI@[17; 18) ";" | ||
19 | WHITESPACE@[18; 23) "\n " | ||
20 | EXPR_STMT@[23; 27) | ||
21 | PAREN_EXPR@[23; 26) | ||
22 | L_PAREN@[23; 24) "(" | ||
23 | LITERAL@[24; 25) | ||
24 | INT_NUMBER@[24; 25) "1" | ||
25 | R_PAREN@[25; 26) ")" | ||
26 | SEMI@[26; 27) ";" | ||
27 | WHITESPACE@[27; 32) "\n " | ||
28 | EXPR_STMT@[32; 37) | ||
29 | TUPLE_EXPR@[32; 36) | ||
30 | L_PAREN@[32; 33) "(" | ||
31 | LITERAL@[33; 34) | ||
32 | INT_NUMBER@[33; 34) "1" | ||
33 | COMMA@[34; 35) "," | ||
34 | R_PAREN@[35; 36) ")" | ||
35 | SEMI@[36; 37) ";" | ||
36 | WHITESPACE@[37; 38) "\n" | ||
37 | R_CURLY@[38; 39) "}" | ||
38 | WHITESPACE@[39; 40) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0109_label.rs b/crates/ra_syntax/test_data/parser/inline/ok/0109_label.rs new file mode 100644 index 000000000..48e83f263 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0109_label.rs | |||
@@ -0,0 +1,5 @@ | |||
1 | fn foo() { | ||
2 | 'a: loop {} | ||
3 | 'b: while true {} | ||
4 | 'c: for x in () {} | ||
5 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0109_label.txt b/crates/ra_syntax/test_data/parser/inline/ok/0109_label.txt new file mode 100644 index 000000000..39e4f4b3e --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0109_label.txt | |||
@@ -0,0 +1,64 @@ | |||
1 | SOURCE_FILE@[0; 74) | ||
2 | FN_DEF@[0; 73) | ||
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; 73) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 15) "\n " | ||
14 | EXPR_STMT@[15; 26) | ||
15 | LOOP_EXPR@[15; 26) | ||
16 | LABEL@[15; 18) | ||
17 | LIFETIME@[15; 17) "\'a" | ||
18 | COLON@[17; 18) ":" | ||
19 | WHITESPACE@[18; 19) " " | ||
20 | LOOP_KW@[19; 23) "loop" | ||
21 | WHITESPACE@[23; 24) " " | ||
22 | BLOCK@[24; 26) | ||
23 | L_CURLY@[24; 25) "{" | ||
24 | R_CURLY@[25; 26) "}" | ||
25 | WHITESPACE@[26; 31) "\n " | ||
26 | EXPR_STMT@[31; 48) | ||
27 | WHILE_EXPR@[31; 48) | ||
28 | LABEL@[31; 34) | ||
29 | LIFETIME@[31; 33) "\'b" | ||
30 | COLON@[33; 34) ":" | ||
31 | WHITESPACE@[34; 35) " " | ||
32 | WHILE_KW@[35; 40) "while" | ||
33 | WHITESPACE@[40; 41) " " | ||
34 | CONDITION@[41; 45) | ||
35 | LITERAL@[41; 45) | ||
36 | TRUE_KW@[41; 45) "true" | ||
37 | WHITESPACE@[45; 46) " " | ||
38 | BLOCK@[46; 48) | ||
39 | L_CURLY@[46; 47) "{" | ||
40 | R_CURLY@[47; 48) "}" | ||
41 | WHITESPACE@[48; 53) "\n " | ||
42 | FOR_EXPR@[53; 71) | ||
43 | LABEL@[53; 56) | ||
44 | LIFETIME@[53; 55) "\'c" | ||
45 | COLON@[55; 56) ":" | ||
46 | WHITESPACE@[56; 57) " " | ||
47 | FOR_KW@[57; 60) "for" | ||
48 | WHITESPACE@[60; 61) " " | ||
49 | BIND_PAT@[61; 62) | ||
50 | NAME@[61; 62) | ||
51 | IDENT@[61; 62) "x" | ||
52 | WHITESPACE@[62; 63) " " | ||
53 | IN_KW@[63; 65) "in" | ||
54 | WHITESPACE@[65; 66) " " | ||
55 | TUPLE_EXPR@[66; 68) | ||
56 | L_PAREN@[66; 67) "(" | ||
57 | R_PAREN@[67; 68) ")" | ||
58 | WHITESPACE@[68; 69) " " | ||
59 | BLOCK@[69; 71) | ||
60 | L_CURLY@[69; 70) "{" | ||
61 | R_CURLY@[70; 71) "}" | ||
62 | WHITESPACE@[71; 72) "\n" | ||
63 | R_CURLY@[72; 73) "}" | ||
64 | WHITESPACE@[73; 74) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0110_use_path.rs b/crates/ra_syntax/test_data/parser/inline/ok/0110_use_path.rs new file mode 100644 index 000000000..328e94736 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0110_use_path.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | use ::crate_name; // Rust 2018 - All flavours | ||
2 | use crate_name; // Rust 2018 - Anchored paths | ||
3 | use item_in_scope_or_crate_name; // Rust 2018 - Uniform Paths | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0110_use_path.txt b/crates/ra_syntax/test_data/parser/inline/ok/0110_use_path.txt new file mode 100644 index 000000000..7dbcd3927 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0110_use_path.txt | |||
@@ -0,0 +1,38 @@ | |||
1 | SOURCE_FILE@[0; 154) | ||
2 | USE_ITEM@[0; 17) | ||
3 | USE_KW@[0; 3) "use" | ||
4 | WHITESPACE@[3; 4) " " | ||
5 | USE_TREE@[4; 16) | ||
6 | PATH@[4; 16) | ||
7 | PATH_SEGMENT@[4; 16) | ||
8 | COLONCOLON@[4; 6) "::" | ||
9 | NAME_REF@[6; 16) | ||
10 | IDENT@[6; 16) "crate_name" | ||
11 | SEMI@[16; 17) ";" | ||
12 | WHITESPACE@[17; 18) " " | ||
13 | COMMENT@[18; 45) "// Rust 2018 - All fl ..." | ||
14 | WHITESPACE@[45; 46) "\n" | ||
15 | USE_ITEM@[46; 61) | ||
16 | USE_KW@[46; 49) "use" | ||
17 | WHITESPACE@[49; 50) " " | ||
18 | USE_TREE@[50; 60) | ||
19 | PATH@[50; 60) | ||
20 | PATH_SEGMENT@[50; 60) | ||
21 | NAME_REF@[50; 60) | ||
22 | IDENT@[50; 60) "crate_name" | ||
23 | SEMI@[60; 61) ";" | ||
24 | WHITESPACE@[61; 62) " " | ||
25 | COMMENT@[62; 91) "// Rust 2018 - Anchor ..." | ||
26 | WHITESPACE@[91; 92) "\n" | ||
27 | USE_ITEM@[92; 124) | ||
28 | USE_KW@[92; 95) "use" | ||
29 | WHITESPACE@[95; 96) " " | ||
30 | USE_TREE@[96; 123) | ||
31 | PATH@[96; 123) | ||
32 | PATH_SEGMENT@[96; 123) | ||
33 | NAME_REF@[96; 123) | ||
34 | IDENT@[96; 123) "item_in_scope_or_crat ..." | ||
35 | SEMI@[123; 124) ";" | ||
36 | WHITESPACE@[124; 125) " " | ||
37 | COMMENT@[125; 153) "// Rust 2018 - Unifor ..." | ||
38 | WHITESPACE@[153; 154) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0111_tuple_pat.rs b/crates/ra_syntax/test_data/parser/inline/ok/0111_tuple_pat.rs new file mode 100644 index 000000000..f785acd36 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0111_tuple_pat.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn main() { | ||
2 | let (a, b, ..) = (); | ||
3 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0111_tuple_pat.txt b/crates/ra_syntax/test_data/parser/inline/ok/0111_tuple_pat.txt new file mode 100644 index 000000000..aef3f7e0f --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0111_tuple_pat.txt | |||
@@ -0,0 +1,40 @@ | |||
1 | SOURCE_FILE@[0; 39) | ||
2 | FN_DEF@[0; 38) | ||
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@[10; 38) | ||
12 | L_CURLY@[10; 11) "{" | ||
13 | WHITESPACE@[11; 16) "\n " | ||
14 | LET_STMT@[16; 36) | ||
15 | LET_KW@[16; 19) "let" | ||
16 | WHITESPACE@[19; 20) " " | ||
17 | TUPLE_PAT@[20; 30) | ||
18 | L_PAREN@[20; 21) "(" | ||
19 | BIND_PAT@[21; 22) | ||
20 | NAME@[21; 22) | ||
21 | IDENT@[21; 22) "a" | ||
22 | COMMA@[22; 23) "," | ||
23 | WHITESPACE@[23; 24) " " | ||
24 | BIND_PAT@[24; 25) | ||
25 | NAME@[24; 25) | ||
26 | IDENT@[24; 25) "b" | ||
27 | COMMA@[25; 26) "," | ||
28 | WHITESPACE@[26; 27) " " | ||
29 | DOTDOT@[27; 29) ".." | ||
30 | R_PAREN@[29; 30) ")" | ||
31 | WHITESPACE@[30; 31) " " | ||
32 | EQ@[31; 32) "=" | ||
33 | WHITESPACE@[32; 33) " " | ||
34 | TUPLE_EXPR@[33; 35) | ||
35 | L_PAREN@[33; 34) "(" | ||
36 | R_PAREN@[34; 35) ")" | ||
37 | SEMI@[35; 36) ";" | ||
38 | WHITESPACE@[36; 37) "\n" | ||
39 | R_CURLY@[37; 38) "}" | ||
40 | WHITESPACE@[38; 39) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0112_bind_pat.rs b/crates/ra_syntax/test_data/parser/inline/ok/0112_bind_pat.rs new file mode 100644 index 000000000..5a93469af --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0112_bind_pat.rs | |||
@@ -0,0 +1,9 @@ | |||
1 | fn main() { | ||
2 | let a = (); | ||
3 | let mut b = (); | ||
4 | let ref c = (); | ||
5 | let ref mut d = (); | ||
6 | let e @ _ = (); | ||
7 | let ref mut f @ g @ _ = (); | ||
8 | let box i = Box::new(1i32); | ||
9 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0112_bind_pat.txt b/crates/ra_syntax/test_data/parser/inline/ok/0112_bind_pat.txt new file mode 100644 index 000000000..189254a19 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0112_bind_pat.txt | |||
@@ -0,0 +1,156 @@ | |||
1 | SOURCE_FILE@[0; 178) | ||
2 | FN_DEF@[0; 177) | ||
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@[10; 177) | ||
12 | L_CURLY@[10; 11) "{" | ||
13 | WHITESPACE@[11; 16) "\n " | ||
14 | LET_STMT@[16; 27) | ||
15 | LET_KW@[16; 19) "let" | ||
16 | WHITESPACE@[19; 20) " " | ||
17 | BIND_PAT@[20; 21) | ||
18 | NAME@[20; 21) | ||
19 | IDENT@[20; 21) "a" | ||
20 | WHITESPACE@[21; 22) " " | ||
21 | EQ@[22; 23) "=" | ||
22 | WHITESPACE@[23; 24) " " | ||
23 | TUPLE_EXPR@[24; 26) | ||
24 | L_PAREN@[24; 25) "(" | ||
25 | R_PAREN@[25; 26) ")" | ||
26 | SEMI@[26; 27) ";" | ||
27 | WHITESPACE@[27; 32) "\n " | ||
28 | LET_STMT@[32; 47) | ||
29 | LET_KW@[32; 35) "let" | ||
30 | WHITESPACE@[35; 36) " " | ||
31 | BIND_PAT@[36; 41) | ||
32 | MUT_KW@[36; 39) "mut" | ||
33 | WHITESPACE@[39; 40) " " | ||
34 | NAME@[40; 41) | ||
35 | IDENT@[40; 41) "b" | ||
36 | WHITESPACE@[41; 42) " " | ||
37 | EQ@[42; 43) "=" | ||
38 | WHITESPACE@[43; 44) " " | ||
39 | TUPLE_EXPR@[44; 46) | ||
40 | L_PAREN@[44; 45) "(" | ||
41 | R_PAREN@[45; 46) ")" | ||
42 | SEMI@[46; 47) ";" | ||
43 | WHITESPACE@[47; 52) "\n " | ||
44 | LET_STMT@[52; 67) | ||
45 | LET_KW@[52; 55) "let" | ||
46 | WHITESPACE@[55; 56) " " | ||
47 | BIND_PAT@[56; 61) | ||
48 | REF_KW@[56; 59) "ref" | ||
49 | WHITESPACE@[59; 60) " " | ||
50 | NAME@[60; 61) | ||
51 | IDENT@[60; 61) "c" | ||
52 | WHITESPACE@[61; 62) " " | ||
53 | EQ@[62; 63) "=" | ||
54 | WHITESPACE@[63; 64) " " | ||
55 | TUPLE_EXPR@[64; 66) | ||
56 | L_PAREN@[64; 65) "(" | ||
57 | R_PAREN@[65; 66) ")" | ||
58 | SEMI@[66; 67) ";" | ||
59 | WHITESPACE@[67; 72) "\n " | ||
60 | LET_STMT@[72; 91) | ||
61 | LET_KW@[72; 75) "let" | ||
62 | WHITESPACE@[75; 76) " " | ||
63 | BIND_PAT@[76; 85) | ||
64 | REF_KW@[76; 79) "ref" | ||
65 | WHITESPACE@[79; 80) " " | ||
66 | MUT_KW@[80; 83) "mut" | ||
67 | WHITESPACE@[83; 84) " " | ||
68 | NAME@[84; 85) | ||
69 | IDENT@[84; 85) "d" | ||
70 | WHITESPACE@[85; 86) " " | ||
71 | EQ@[86; 87) "=" | ||
72 | WHITESPACE@[87; 88) " " | ||
73 | TUPLE_EXPR@[88; 90) | ||
74 | L_PAREN@[88; 89) "(" | ||
75 | R_PAREN@[89; 90) ")" | ||
76 | SEMI@[90; 91) ";" | ||
77 | WHITESPACE@[91; 96) "\n " | ||
78 | LET_STMT@[96; 111) | ||
79 | LET_KW@[96; 99) "let" | ||
80 | WHITESPACE@[99; 100) " " | ||
81 | BIND_PAT@[100; 105) | ||
82 | NAME@[100; 101) | ||
83 | IDENT@[100; 101) "e" | ||
84 | WHITESPACE@[101; 102) " " | ||
85 | AT@[102; 103) "@" | ||
86 | WHITESPACE@[103; 104) " " | ||
87 | PLACEHOLDER_PAT@[104; 105) | ||
88 | UNDERSCORE@[104; 105) "_" | ||
89 | WHITESPACE@[105; 106) " " | ||
90 | EQ@[106; 107) "=" | ||
91 | WHITESPACE@[107; 108) " " | ||
92 | TUPLE_EXPR@[108; 110) | ||
93 | L_PAREN@[108; 109) "(" | ||
94 | R_PAREN@[109; 110) ")" | ||
95 | SEMI@[110; 111) ";" | ||
96 | WHITESPACE@[111; 116) "\n " | ||
97 | LET_STMT@[116; 143) | ||
98 | LET_KW@[116; 119) "let" | ||
99 | WHITESPACE@[119; 120) " " | ||
100 | BIND_PAT@[120; 137) | ||
101 | REF_KW@[120; 123) "ref" | ||
102 | WHITESPACE@[123; 124) " " | ||
103 | MUT_KW@[124; 127) "mut" | ||
104 | WHITESPACE@[127; 128) " " | ||
105 | NAME@[128; 129) | ||
106 | IDENT@[128; 129) "f" | ||
107 | WHITESPACE@[129; 130) " " | ||
108 | AT@[130; 131) "@" | ||
109 | WHITESPACE@[131; 132) " " | ||
110 | BIND_PAT@[132; 137) | ||
111 | NAME@[132; 133) | ||
112 | IDENT@[132; 133) "g" | ||
113 | WHITESPACE@[133; 134) " " | ||
114 | AT@[134; 135) "@" | ||
115 | WHITESPACE@[135; 136) " " | ||
116 | PLACEHOLDER_PAT@[136; 137) | ||
117 | UNDERSCORE@[136; 137) "_" | ||
118 | WHITESPACE@[137; 138) " " | ||
119 | EQ@[138; 139) "=" | ||
120 | WHITESPACE@[139; 140) " " | ||
121 | TUPLE_EXPR@[140; 142) | ||
122 | L_PAREN@[140; 141) "(" | ||
123 | R_PAREN@[141; 142) ")" | ||
124 | SEMI@[142; 143) ";" | ||
125 | WHITESPACE@[143; 148) "\n " | ||
126 | LET_STMT@[148; 175) | ||
127 | LET_KW@[148; 151) "let" | ||
128 | WHITESPACE@[151; 152) " " | ||
129 | BIND_PAT@[152; 157) | ||
130 | BOX_KW@[152; 155) "box" | ||
131 | WHITESPACE@[155; 156) " " | ||
132 | NAME@[156; 157) | ||
133 | IDENT@[156; 157) "i" | ||
134 | WHITESPACE@[157; 158) " " | ||
135 | EQ@[158; 159) "=" | ||
136 | WHITESPACE@[159; 160) " " | ||
137 | CALL_EXPR@[160; 174) | ||
138 | PATH_EXPR@[160; 168) | ||
139 | PATH@[160; 168) | ||
140 | PATH@[160; 163) | ||
141 | PATH_SEGMENT@[160; 163) | ||
142 | NAME_REF@[160; 163) | ||
143 | IDENT@[160; 163) "Box" | ||
144 | COLONCOLON@[163; 165) "::" | ||
145 | PATH_SEGMENT@[165; 168) | ||
146 | NAME_REF@[165; 168) | ||
147 | IDENT@[165; 168) "new" | ||
148 | ARG_LIST@[168; 174) | ||
149 | L_PAREN@[168; 169) "(" | ||
150 | LITERAL@[169; 173) | ||
151 | INT_NUMBER@[169; 173) "1i32" | ||
152 | R_PAREN@[173; 174) ")" | ||
153 | SEMI@[174; 175) ";" | ||
154 | WHITESPACE@[175; 176) "\n" | ||
155 | R_CURLY@[176; 177) "}" | ||
156 | WHITESPACE@[177; 178) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0113_nocontentexpr.rs b/crates/ra_syntax/test_data/parser/inline/ok/0113_nocontentexpr.rs new file mode 100644 index 000000000..bbf09e367 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0113_nocontentexpr.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn foo(){ | ||
2 | ;;;some_expr();;;;{;;;};;;;Ok(()) | ||
3 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0113_nocontentexpr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0113_nocontentexpr.txt new file mode 100644 index 000000000..601a5bae9 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0113_nocontentexpr.txt | |||
@@ -0,0 +1,56 @@ | |||
1 | SOURCE_FILE@[0; 50) | ||
2 | FN_DEF@[0; 49) | ||
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 | BLOCK@[8; 49) | ||
11 | L_CURLY@[8; 9) "{" | ||
12 | WHITESPACE@[9; 14) "\n " | ||
13 | SEMI@[14; 15) ";" | ||
14 | SEMI@[15; 16) ";" | ||
15 | SEMI@[16; 17) ";" | ||
16 | EXPR_STMT@[17; 29) | ||
17 | CALL_EXPR@[17; 28) | ||
18 | PATH_EXPR@[17; 26) | ||
19 | PATH@[17; 26) | ||
20 | PATH_SEGMENT@[17; 26) | ||
21 | NAME_REF@[17; 26) | ||
22 | IDENT@[17; 26) "some_expr" | ||
23 | ARG_LIST@[26; 28) | ||
24 | L_PAREN@[26; 27) "(" | ||
25 | R_PAREN@[27; 28) ")" | ||
26 | SEMI@[28; 29) ";" | ||
27 | SEMI@[29; 30) ";" | ||
28 | SEMI@[30; 31) ";" | ||
29 | SEMI@[31; 32) ";" | ||
30 | EXPR_STMT@[32; 38) | ||
31 | BLOCK_EXPR@[32; 37) | ||
32 | BLOCK@[32; 37) | ||
33 | L_CURLY@[32; 33) "{" | ||
34 | SEMI@[33; 34) ";" | ||
35 | SEMI@[34; 35) ";" | ||
36 | SEMI@[35; 36) ";" | ||
37 | R_CURLY@[36; 37) "}" | ||
38 | SEMI@[37; 38) ";" | ||
39 | SEMI@[38; 39) ";" | ||
40 | SEMI@[39; 40) ";" | ||
41 | SEMI@[40; 41) ";" | ||
42 | CALL_EXPR@[41; 47) | ||
43 | PATH_EXPR@[41; 43) | ||
44 | PATH@[41; 43) | ||
45 | PATH_SEGMENT@[41; 43) | ||
46 | NAME_REF@[41; 43) | ||
47 | IDENT@[41; 43) "Ok" | ||
48 | ARG_LIST@[43; 47) | ||
49 | L_PAREN@[43; 44) "(" | ||
50 | TUPLE_EXPR@[44; 46) | ||
51 | L_PAREN@[44; 45) "(" | ||
52 | R_PAREN@[45; 46) ")" | ||
53 | R_PAREN@[46; 47) ")" | ||
54 | WHITESPACE@[47; 48) "\n" | ||
55 | R_CURLY@[48; 49) "}" | ||
56 | WHITESPACE@[49; 50) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0114_tuple_struct_where.rs b/crates/ra_syntax/test_data/parser/inline/ok/0114_tuple_struct_where.rs new file mode 100644 index 000000000..ddd59016d --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0114_tuple_struct_where.rs | |||
@@ -0,0 +1,2 @@ | |||
1 | struct Test<T>(T) where T: Clone; | ||
2 | struct Test<T>(T); | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0114_tuple_struct_where.txt b/crates/ra_syntax/test_data/parser/inline/ok/0114_tuple_struct_where.txt new file mode 100644 index 000000000..8534592b9 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0114_tuple_struct_where.txt | |||
@@ -0,0 +1,64 @@ | |||
1 | SOURCE_FILE@[0; 53) | ||
2 | STRUCT_DEF@[0; 33) | ||
3 | STRUCT_KW@[0; 6) "struct" | ||
4 | WHITESPACE@[6; 7) " " | ||
5 | NAME@[7; 11) | ||
6 | IDENT@[7; 11) "Test" | ||
7 | TYPE_PARAM_LIST@[11; 14) | ||
8 | L_ANGLE@[11; 12) "<" | ||
9 | TYPE_PARAM@[12; 13) | ||
10 | NAME@[12; 13) | ||
11 | IDENT@[12; 13) "T" | ||
12 | R_ANGLE@[13; 14) ">" | ||
13 | POS_FIELD_DEF_LIST@[14; 17) | ||
14 | L_PAREN@[14; 15) "(" | ||
15 | POS_FIELD_DEF@[15; 16) | ||
16 | PATH_TYPE@[15; 16) | ||
17 | PATH@[15; 16) | ||
18 | PATH_SEGMENT@[15; 16) | ||
19 | NAME_REF@[15; 16) | ||
20 | IDENT@[15; 16) "T" | ||
21 | R_PAREN@[16; 17) ")" | ||
22 | WHITESPACE@[17; 18) " " | ||
23 | WHERE_CLAUSE@[18; 32) | ||
24 | WHERE_KW@[18; 23) "where" | ||
25 | WHITESPACE@[23; 24) " " | ||
26 | WHERE_PRED@[24; 32) | ||
27 | PATH_TYPE@[24; 25) | ||
28 | PATH@[24; 25) | ||
29 | PATH_SEGMENT@[24; 25) | ||
30 | NAME_REF@[24; 25) | ||
31 | IDENT@[24; 25) "T" | ||
32 | COLON@[25; 26) ":" | ||
33 | WHITESPACE@[26; 27) " " | ||
34 | TYPE_BOUND_LIST@[27; 32) | ||
35 | TYPE_BOUND@[27; 32) | ||
36 | PATH_TYPE@[27; 32) | ||
37 | PATH@[27; 32) | ||
38 | PATH_SEGMENT@[27; 32) | ||
39 | NAME_REF@[27; 32) | ||
40 | IDENT@[27; 32) "Clone" | ||
41 | SEMI@[32; 33) ";" | ||
42 | WHITESPACE@[33; 34) "\n" | ||
43 | STRUCT_DEF@[34; 52) | ||
44 | STRUCT_KW@[34; 40) "struct" | ||
45 | WHITESPACE@[40; 41) " " | ||
46 | NAME@[41; 45) | ||
47 | IDENT@[41; 45) "Test" | ||
48 | TYPE_PARAM_LIST@[45; 48) | ||
49 | L_ANGLE@[45; 46) "<" | ||
50 | TYPE_PARAM@[46; 47) | ||
51 | NAME@[46; 47) | ||
52 | IDENT@[46; 47) "T" | ||
53 | R_ANGLE@[47; 48) ">" | ||
54 | POS_FIELD_DEF_LIST@[48; 51) | ||
55 | L_PAREN@[48; 49) "(" | ||
56 | POS_FIELD_DEF@[49; 50) | ||
57 | PATH_TYPE@[49; 50) | ||
58 | PATH@[49; 50) | ||
59 | PATH_SEGMENT@[49; 50) | ||
60 | NAME_REF@[49; 50) | ||
61 | IDENT@[49; 50) "T" | ||
62 | R_PAREN@[50; 51) ")" | ||
63 | SEMI@[51; 52) ";" | ||
64 | WHITESPACE@[52; 53) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0115_pos_field_attrs.rs b/crates/ra_syntax/test_data/parser/inline/ok/0115_pos_field_attrs.rs new file mode 100644 index 000000000..635b9ac21 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0115_pos_field_attrs.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | struct S ( | ||
2 | #[serde(with = "url_serde")] | ||
3 | pub Uri, | ||
4 | ); | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0115_pos_field_attrs.txt b/crates/ra_syntax/test_data/parser/inline/ok/0115_pos_field_attrs.txt new file mode 100644 index 000000000..6dd3a9b93 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0115_pos_field_attrs.txt | |||
@@ -0,0 +1,39 @@ | |||
1 | SOURCE_FILE@[0; 60) | ||
2 | STRUCT_DEF@[0; 59) | ||
3 | STRUCT_KW@[0; 6) "struct" | ||
4 | WHITESPACE@[6; 7) " " | ||
5 | NAME@[7; 8) | ||
6 | IDENT@[7; 8) "S" | ||
7 | WHITESPACE@[8; 9) " " | ||
8 | POS_FIELD_DEF_LIST@[9; 58) | ||
9 | L_PAREN@[9; 10) "(" | ||
10 | WHITESPACE@[10; 15) "\n " | ||
11 | POS_FIELD_DEF@[15; 55) | ||
12 | ATTR@[15; 43) | ||
13 | POUND@[15; 16) "#" | ||
14 | TOKEN_TREE@[16; 43) | ||
15 | L_BRACK@[16; 17) "[" | ||
16 | IDENT@[17; 22) "serde" | ||
17 | TOKEN_TREE@[22; 42) | ||
18 | L_PAREN@[22; 23) "(" | ||
19 | IDENT@[23; 27) "with" | ||
20 | WHITESPACE@[27; 28) " " | ||
21 | EQ@[28; 29) "=" | ||
22 | WHITESPACE@[29; 30) " " | ||
23 | STRING@[30; 41) "\"url_serde\"" | ||
24 | R_PAREN@[41; 42) ")" | ||
25 | R_BRACK@[42; 43) "]" | ||
26 | WHITESPACE@[43; 48) "\n " | ||
27 | VISIBILITY@[48; 51) | ||
28 | PUB_KW@[48; 51) "pub" | ||
29 | WHITESPACE@[51; 52) " " | ||
30 | PATH_TYPE@[52; 55) | ||
31 | PATH@[52; 55) | ||
32 | PATH_SEGMENT@[52; 55) | ||
33 | NAME_REF@[52; 55) | ||
34 | IDENT@[52; 55) "Uri" | ||
35 | COMMA@[55; 56) "," | ||
36 | WHITESPACE@[56; 57) "\n" | ||
37 | R_PAREN@[57; 58) ")" | ||
38 | SEMI@[58; 59) ";" | ||
39 | WHITESPACE@[59; 60) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0116_trait_fn_placeholder_parameter.rs b/crates/ra_syntax/test_data/parser/inline/ok/0116_trait_fn_placeholder_parameter.rs new file mode 100644 index 000000000..472cb8803 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0116_trait_fn_placeholder_parameter.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | trait Foo { | ||
2 | fn bar(_: u64, mut x: i32); | ||
3 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0116_trait_fn_placeholder_parameter.txt b/crates/ra_syntax/test_data/parser/inline/ok/0116_trait_fn_placeholder_parameter.txt new file mode 100644 index 000000000..158236c5a --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0116_trait_fn_placeholder_parameter.txt | |||
@@ -0,0 +1,47 @@ | |||
1 | SOURCE_FILE@[0; 46) | ||
2 | TRAIT_DEF@[0; 45) | ||
3 | TRAIT_KW@[0; 5) "trait" | ||
4 | WHITESPACE@[5; 6) " " | ||
5 | NAME@[6; 9) | ||
6 | IDENT@[6; 9) "Foo" | ||
7 | WHITESPACE@[9; 10) " " | ||
8 | ITEM_LIST@[10; 45) | ||
9 | L_CURLY@[10; 11) "{" | ||
10 | WHITESPACE@[11; 16) "\n " | ||
11 | FN_DEF@[16; 43) | ||
12 | FN_KW@[16; 18) "fn" | ||
13 | WHITESPACE@[18; 19) " " | ||
14 | NAME@[19; 22) | ||
15 | IDENT@[19; 22) "bar" | ||
16 | PARAM_LIST@[22; 42) | ||
17 | L_PAREN@[22; 23) "(" | ||
18 | PARAM@[23; 29) | ||
19 | PLACEHOLDER_PAT@[23; 24) | ||
20 | UNDERSCORE@[23; 24) "_" | ||
21 | COLON@[24; 25) ":" | ||
22 | WHITESPACE@[25; 26) " " | ||
23 | PATH_TYPE@[26; 29) | ||
24 | PATH@[26; 29) | ||
25 | PATH_SEGMENT@[26; 29) | ||
26 | NAME_REF@[26; 29) | ||
27 | IDENT@[26; 29) "u64" | ||
28 | COMMA@[29; 30) "," | ||
29 | WHITESPACE@[30; 31) " " | ||
30 | PARAM@[31; 41) | ||
31 | BIND_PAT@[31; 36) | ||
32 | MUT_KW@[31; 34) "mut" | ||
33 | WHITESPACE@[34; 35) " " | ||
34 | NAME@[35; 36) | ||
35 | IDENT@[35; 36) "x" | ||
36 | COLON@[36; 37) ":" | ||
37 | WHITESPACE@[37; 38) " " | ||
38 | PATH_TYPE@[38; 41) | ||
39 | PATH@[38; 41) | ||
40 | PATH_SEGMENT@[38; 41) | ||
41 | NAME_REF@[38; 41) | ||
42 | IDENT@[38; 41) "i32" | ||
43 | R_PAREN@[41; 42) ")" | ||
44 | SEMI@[42; 43) ";" | ||
45 | WHITESPACE@[43; 44) "\n" | ||
46 | R_CURLY@[44; 45) "}" | ||
47 | WHITESPACE@[45; 46) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0117_macro_call_type.rs b/crates/ra_syntax/test_data/parser/inline/ok/0117_macro_call_type.rs new file mode 100644 index 000000000..edb470c89 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0117_macro_call_type.rs | |||
@@ -0,0 +1,2 @@ | |||
1 | type A = foo!(); | ||
2 | type B = crate::foo!(); | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0117_macro_call_type.txt b/crates/ra_syntax/test_data/parser/inline/ok/0117_macro_call_type.txt new file mode 100644 index 000000000..892dc813a --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0117_macro_call_type.txt | |||
@@ -0,0 +1,43 @@ | |||
1 | SOURCE_FILE@[0; 41) | ||
2 | TYPE_ALIAS_DEF@[0; 16) | ||
3 | TYPE_KW@[0; 4) "type" | ||
4 | WHITESPACE@[4; 5) " " | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "A" | ||
7 | WHITESPACE@[6; 7) " " | ||
8 | EQ@[7; 8) "=" | ||
9 | WHITESPACE@[8; 9) " " | ||
10 | MACRO_CALL@[9; 15) | ||
11 | PATH@[9; 12) | ||
12 | PATH_SEGMENT@[9; 12) | ||
13 | NAME_REF@[9; 12) | ||
14 | IDENT@[9; 12) "foo" | ||
15 | EXCL@[12; 13) "!" | ||
16 | TOKEN_TREE@[13; 15) | ||
17 | L_PAREN@[13; 14) "(" | ||
18 | R_PAREN@[14; 15) ")" | ||
19 | SEMI@[15; 16) ";" | ||
20 | WHITESPACE@[16; 17) "\n" | ||
21 | TYPE_ALIAS_DEF@[17; 40) | ||
22 | TYPE_KW@[17; 21) "type" | ||
23 | WHITESPACE@[21; 22) " " | ||
24 | NAME@[22; 23) | ||
25 | IDENT@[22; 23) "B" | ||
26 | WHITESPACE@[23; 24) " " | ||
27 | EQ@[24; 25) "=" | ||
28 | WHITESPACE@[25; 26) " " | ||
29 | MACRO_CALL@[26; 39) | ||
30 | PATH@[26; 36) | ||
31 | PATH@[26; 31) | ||
32 | PATH_SEGMENT@[26; 31) | ||
33 | CRATE_KW@[26; 31) "crate" | ||
34 | COLONCOLON@[31; 33) "::" | ||
35 | PATH_SEGMENT@[33; 36) | ||
36 | NAME_REF@[33; 36) | ||
37 | IDENT@[33; 36) "foo" | ||
38 | EXCL@[36; 37) "!" | ||
39 | TOKEN_TREE@[37; 39) | ||
40 | L_PAREN@[37; 38) "(" | ||
41 | R_PAREN@[38; 39) ")" | ||
42 | SEMI@[39; 40) ";" | ||
43 | WHITESPACE@[40; 41) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0118_impl_inner_attributes.rs b/crates/ra_syntax/test_data/parser/inline/ok/0118_impl_inner_attributes.rs new file mode 100644 index 000000000..4d68cceb7 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0118_impl_inner_attributes.rs | |||
@@ -0,0 +1,5 @@ | |||
1 | enum F{} | ||
2 | impl F { | ||
3 | //! This is a doc comment | ||
4 | #![doc("This is also a doc comment")] | ||
5 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0118_impl_inner_attributes.txt b/crates/ra_syntax/test_data/parser/inline/ok/0118_impl_inner_attributes.txt new file mode 100644 index 000000000..0ef3eeb75 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0118_impl_inner_attributes.txt | |||
@@ -0,0 +1,38 @@ | |||
1 | SOURCE_FILE@[0; 94) | ||
2 | ENUM_DEF@[0; 8) | ||
3 | ENUM_KW@[0; 4) "enum" | ||
4 | WHITESPACE@[4; 5) " " | ||
5 | NAME@[5; 6) | ||
6 | IDENT@[5; 6) "F" | ||
7 | ENUM_VARIANT_LIST@[6; 8) | ||
8 | L_CURLY@[6; 7) "{" | ||
9 | R_CURLY@[7; 8) "}" | ||
10 | WHITESPACE@[8; 9) "\n" | ||
11 | IMPL_BLOCK@[9; 93) | ||
12 | IMPL_KW@[9; 13) "impl" | ||
13 | WHITESPACE@[13; 14) " " | ||
14 | PATH_TYPE@[14; 15) | ||
15 | PATH@[14; 15) | ||
16 | PATH_SEGMENT@[14; 15) | ||
17 | NAME_REF@[14; 15) | ||
18 | IDENT@[14; 15) "F" | ||
19 | WHITESPACE@[15; 16) " " | ||
20 | ITEM_LIST@[16; 93) | ||
21 | L_CURLY@[16; 17) "{" | ||
22 | WHITESPACE@[17; 23) "\n " | ||
23 | COMMENT@[23; 48) "//! This is a doc com ..." | ||
24 | WHITESPACE@[48; 54) "\n " | ||
25 | ATTR@[54; 91) | ||
26 | POUND@[54; 55) "#" | ||
27 | EXCL@[55; 56) "!" | ||
28 | TOKEN_TREE@[56; 91) | ||
29 | L_BRACK@[56; 57) "[" | ||
30 | IDENT@[57; 60) "doc" | ||
31 | TOKEN_TREE@[60; 90) | ||
32 | L_PAREN@[60; 61) "(" | ||
33 | STRING@[61; 89) "\"This is also a doc c ..." | ||
34 | R_PAREN@[89; 90) ")" | ||
35 | R_BRACK@[90; 91) "]" | ||
36 | WHITESPACE@[91; 92) "\n" | ||
37 | R_CURLY@[92; 93) "}" | ||
38 | WHITESPACE@[93; 94) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0118_match_guard.rs b/crates/ra_syntax/test_data/parser/inline/ok/0118_match_guard.rs new file mode 100644 index 000000000..f1bd72fc4 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0118_match_guard.rs | |||
@@ -0,0 +1,5 @@ | |||
1 | fn foo() { | ||
2 | match () { | ||
3 | _ if foo => (), | ||
4 | } | ||
5 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0118_match_guard.txt b/crates/ra_syntax/test_data/parser/inline/ok/0118_match_guard.txt new file mode 100644 index 000000000..d53e10e86 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0118_match_guard.txt | |||
@@ -0,0 +1,47 @@ | |||
1 | SOURCE_FILE@[0; 58) | ||
2 | FN_DEF@[0; 57) | ||
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; 57) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 15) "\n " | ||
14 | MATCH_EXPR@[15; 55) | ||
15 | MATCH_KW@[15; 20) "match" | ||
16 | WHITESPACE@[20; 21) " " | ||
17 | TUPLE_EXPR@[21; 23) | ||
18 | L_PAREN@[21; 22) "(" | ||
19 | R_PAREN@[22; 23) ")" | ||
20 | WHITESPACE@[23; 24) " " | ||
21 | MATCH_ARM_LIST@[24; 55) | ||
22 | L_CURLY@[24; 25) "{" | ||
23 | WHITESPACE@[25; 34) "\n " | ||
24 | MATCH_ARM@[34; 48) | ||
25 | PLACEHOLDER_PAT@[34; 35) | ||
26 | UNDERSCORE@[34; 35) "_" | ||
27 | WHITESPACE@[35; 36) " " | ||
28 | MATCH_GUARD@[36; 42) | ||
29 | IF_KW@[36; 38) "if" | ||
30 | WHITESPACE@[38; 39) " " | ||
31 | PATH_EXPR@[39; 42) | ||
32 | PATH@[39; 42) | ||
33 | PATH_SEGMENT@[39; 42) | ||
34 | NAME_REF@[39; 42) | ||
35 | IDENT@[39; 42) "foo" | ||
36 | WHITESPACE@[42; 43) " " | ||
37 | FAT_ARROW@[43; 45) "=>" | ||
38 | WHITESPACE@[45; 46) " " | ||
39 | TUPLE_EXPR@[46; 48) | ||
40 | L_PAREN@[46; 47) "(" | ||
41 | R_PAREN@[47; 48) ")" | ||
42 | COMMA@[48; 49) "," | ||
43 | WHITESPACE@[49; 54) "\n " | ||
44 | R_CURLY@[54; 55) "}" | ||
45 | WHITESPACE@[55; 56) "\n" | ||
46 | R_CURLY@[56; 57) "}" | ||
47 | WHITESPACE@[57; 58) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0120_match_arms_inner_attribute.rs b/crates/ra_syntax/test_data/parser/inline/ok/0120_match_arms_inner_attribute.rs new file mode 100644 index 000000000..54a67c9d7 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0120_match_arms_inner_attribute.rs | |||
@@ -0,0 +1,8 @@ | |||
1 | fn foo() { | ||
2 | match () { | ||
3 | #![doc("Inner attribute")] | ||
4 | #![doc("Can be")] | ||
5 | #![doc("Stacked")] | ||
6 | _ => (), | ||
7 | } | ||
8 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0120_match_arms_inner_attribute.txt b/crates/ra_syntax/test_data/parser/inline/ok/0120_match_arms_inner_attribute.txt new file mode 100644 index 000000000..17c296327 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0120_match_arms_inner_attribute.txt | |||
@@ -0,0 +1,74 @@ | |||
1 | SOURCE_FILE@[0; 139) | ||
2 | FN_DEF@[0; 138) | ||
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; 138) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 15) "\n " | ||
14 | MATCH_EXPR@[15; 136) | ||
15 | MATCH_KW@[15; 20) "match" | ||
16 | WHITESPACE@[20; 21) " " | ||
17 | TUPLE_EXPR@[21; 23) | ||
18 | L_PAREN@[21; 22) "(" | ||
19 | R_PAREN@[22; 23) ")" | ||
20 | WHITESPACE@[23; 24) " " | ||
21 | MATCH_ARM_LIST@[24; 136) | ||
22 | L_CURLY@[24; 25) "{" | ||
23 | WHITESPACE@[25; 34) "\n " | ||
24 | ATTR@[34; 60) | ||
25 | POUND@[34; 35) "#" | ||
26 | EXCL@[35; 36) "!" | ||
27 | TOKEN_TREE@[36; 60) | ||
28 | L_BRACK@[36; 37) "[" | ||
29 | IDENT@[37; 40) "doc" | ||
30 | TOKEN_TREE@[40; 59) | ||
31 | L_PAREN@[40; 41) "(" | ||
32 | STRING@[41; 58) "\"Inner attribute\"" | ||
33 | R_PAREN@[58; 59) ")" | ||
34 | R_BRACK@[59; 60) "]" | ||
35 | WHITESPACE@[60; 69) "\n " | ||
36 | ATTR@[69; 86) | ||
37 | POUND@[69; 70) "#" | ||
38 | EXCL@[70; 71) "!" | ||
39 | TOKEN_TREE@[71; 86) | ||
40 | L_BRACK@[71; 72) "[" | ||
41 | IDENT@[72; 75) "doc" | ||
42 | TOKEN_TREE@[75; 85) | ||
43 | L_PAREN@[75; 76) "(" | ||
44 | STRING@[76; 84) "\"Can be\"" | ||
45 | R_PAREN@[84; 85) ")" | ||
46 | R_BRACK@[85; 86) "]" | ||
47 | WHITESPACE@[86; 95) "\n " | ||
48 | ATTR@[95; 113) | ||
49 | POUND@[95; 96) "#" | ||
50 | EXCL@[96; 97) "!" | ||
51 | TOKEN_TREE@[97; 113) | ||
52 | L_BRACK@[97; 98) "[" | ||
53 | IDENT@[98; 101) "doc" | ||
54 | TOKEN_TREE@[101; 112) | ||
55 | L_PAREN@[101; 102) "(" | ||
56 | STRING@[102; 111) "\"Stacked\"" | ||
57 | R_PAREN@[111; 112) ")" | ||
58 | R_BRACK@[112; 113) "]" | ||
59 | WHITESPACE@[113; 122) "\n " | ||
60 | MATCH_ARM@[122; 129) | ||
61 | PLACEHOLDER_PAT@[122; 123) | ||
62 | UNDERSCORE@[122; 123) "_" | ||
63 | WHITESPACE@[123; 124) " " | ||
64 | FAT_ARROW@[124; 126) "=>" | ||
65 | WHITESPACE@[126; 127) " " | ||
66 | TUPLE_EXPR@[127; 129) | ||
67 | L_PAREN@[127; 128) "(" | ||
68 | R_PAREN@[128; 129) ")" | ||
69 | COMMA@[129; 130) "," | ||
70 | WHITESPACE@[130; 135) "\n " | ||
71 | R_CURLY@[135; 136) "}" | ||
72 | WHITESPACE@[136; 137) "\n" | ||
73 | R_CURLY@[137; 138) "}" | ||
74 | WHITESPACE@[138; 139) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0121_match_arms_outer_attributes.rs b/crates/ra_syntax/test_data/parser/inline/ok/0121_match_arms_outer_attributes.rs new file mode 100644 index 000000000..676db42d1 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0121_match_arms_outer_attributes.rs | |||
@@ -0,0 +1,12 @@ | |||
1 | fn foo() { | ||
2 | match () { | ||
3 | #[cfg(feature = "some")] | ||
4 | _ => (), | ||
5 | #[cfg(feature = "other")] | ||
6 | _ => (), | ||
7 | #[cfg(feature = "many")] | ||
8 | #[cfg(feature = "attributes")] | ||
9 | #[cfg(feature = "before")] | ||
10 | _ => (), | ||
11 | } | ||
12 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0121_match_arms_outer_attributes.txt b/crates/ra_syntax/test_data/parser/inline/ok/0121_match_arms_outer_attributes.txt new file mode 100644 index 000000000..9c238e869 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0121_match_arms_outer_attributes.txt | |||
@@ -0,0 +1,135 @@ | |||
1 | SOURCE_FILE@[0; 259) | ||
2 | FN_DEF@[0; 258) | ||
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; 258) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 15) "\n " | ||
14 | MATCH_EXPR@[15; 256) | ||
15 | MATCH_KW@[15; 20) "match" | ||
16 | WHITESPACE@[20; 21) " " | ||
17 | TUPLE_EXPR@[21; 23) | ||
18 | L_PAREN@[21; 22) "(" | ||
19 | R_PAREN@[22; 23) ")" | ||
20 | WHITESPACE@[23; 24) " " | ||
21 | MATCH_ARM_LIST@[24; 256) | ||
22 | L_CURLY@[24; 25) "{" | ||
23 | WHITESPACE@[25; 34) "\n " | ||
24 | MATCH_ARM@[34; 74) | ||
25 | ATTR@[34; 58) | ||
26 | POUND@[34; 35) "#" | ||
27 | TOKEN_TREE@[35; 58) | ||
28 | L_BRACK@[35; 36) "[" | ||
29 | IDENT@[36; 39) "cfg" | ||
30 | TOKEN_TREE@[39; 57) | ||
31 | L_PAREN@[39; 40) "(" | ||
32 | IDENT@[40; 47) "feature" | ||
33 | WHITESPACE@[47; 48) " " | ||
34 | EQ@[48; 49) "=" | ||
35 | WHITESPACE@[49; 50) " " | ||
36 | STRING@[50; 56) "\"some\"" | ||
37 | R_PAREN@[56; 57) ")" | ||
38 | R_BRACK@[57; 58) "]" | ||
39 | WHITESPACE@[58; 67) "\n " | ||
40 | PLACEHOLDER_PAT@[67; 68) | ||
41 | UNDERSCORE@[67; 68) "_" | ||
42 | WHITESPACE@[68; 69) " " | ||
43 | FAT_ARROW@[69; 71) "=>" | ||
44 | WHITESPACE@[71; 72) " " | ||
45 | TUPLE_EXPR@[72; 74) | ||
46 | L_PAREN@[72; 73) "(" | ||
47 | R_PAREN@[73; 74) ")" | ||
48 | COMMA@[74; 75) "," | ||
49 | WHITESPACE@[75; 84) "\n " | ||
50 | MATCH_ARM@[84; 125) | ||
51 | ATTR@[84; 109) | ||
52 | POUND@[84; 85) "#" | ||
53 | TOKEN_TREE@[85; 109) | ||
54 | L_BRACK@[85; 86) "[" | ||
55 | IDENT@[86; 89) "cfg" | ||
56 | TOKEN_TREE@[89; 108) | ||
57 | L_PAREN@[89; 90) "(" | ||
58 | IDENT@[90; 97) "feature" | ||
59 | WHITESPACE@[97; 98) " " | ||
60 | EQ@[98; 99) "=" | ||
61 | WHITESPACE@[99; 100) " " | ||
62 | STRING@[100; 107) "\"other\"" | ||
63 | R_PAREN@[107; 108) ")" | ||
64 | R_BRACK@[108; 109) "]" | ||
65 | WHITESPACE@[109; 118) "\n " | ||
66 | PLACEHOLDER_PAT@[118; 119) | ||
67 | UNDERSCORE@[118; 119) "_" | ||
68 | WHITESPACE@[119; 120) " " | ||
69 | FAT_ARROW@[120; 122) "=>" | ||
70 | WHITESPACE@[122; 123) " " | ||
71 | TUPLE_EXPR@[123; 125) | ||
72 | L_PAREN@[123; 124) "(" | ||
73 | R_PAREN@[124; 125) ")" | ||
74 | COMMA@[125; 126) "," | ||
75 | WHITESPACE@[126; 135) "\n " | ||
76 | MATCH_ARM@[135; 249) | ||
77 | ATTR@[135; 159) | ||
78 | POUND@[135; 136) "#" | ||
79 | TOKEN_TREE@[136; 159) | ||
80 | L_BRACK@[136; 137) "[" | ||
81 | IDENT@[137; 140) "cfg" | ||
82 | TOKEN_TREE@[140; 158) | ||
83 | L_PAREN@[140; 141) "(" | ||
84 | IDENT@[141; 148) "feature" | ||
85 | WHITESPACE@[148; 149) " " | ||
86 | EQ@[149; 150) "=" | ||
87 | WHITESPACE@[150; 151) " " | ||
88 | STRING@[151; 157) "\"many\"" | ||
89 | R_PAREN@[157; 158) ")" | ||
90 | R_BRACK@[158; 159) "]" | ||
91 | WHITESPACE@[159; 168) "\n " | ||
92 | ATTR@[168; 198) | ||
93 | POUND@[168; 169) "#" | ||
94 | TOKEN_TREE@[169; 198) | ||
95 | L_BRACK@[169; 170) "[" | ||
96 | IDENT@[170; 173) "cfg" | ||
97 | TOKEN_TREE@[173; 197) | ||
98 | L_PAREN@[173; 174) "(" | ||
99 | IDENT@[174; 181) "feature" | ||
100 | WHITESPACE@[181; 182) " " | ||
101 | EQ@[182; 183) "=" | ||
102 | WHITESPACE@[183; 184) " " | ||
103 | STRING@[184; 196) "\"attributes\"" | ||
104 | R_PAREN@[196; 197) ")" | ||
105 | R_BRACK@[197; 198) "]" | ||
106 | WHITESPACE@[198; 207) "\n " | ||
107 | ATTR@[207; 233) | ||
108 | POUND@[207; 208) "#" | ||
109 | TOKEN_TREE@[208; 233) | ||
110 | L_BRACK@[208; 209) "[" | ||
111 | IDENT@[209; 212) "cfg" | ||
112 | TOKEN_TREE@[212; 232) | ||
113 | L_PAREN@[212; 213) "(" | ||
114 | IDENT@[213; 220) "feature" | ||
115 | WHITESPACE@[220; 221) " " | ||
116 | EQ@[221; 222) "=" | ||
117 | WHITESPACE@[222; 223) " " | ||
118 | STRING@[223; 231) "\"before\"" | ||
119 | R_PAREN@[231; 232) ")" | ||
120 | R_BRACK@[232; 233) "]" | ||
121 | WHITESPACE@[233; 242) "\n " | ||
122 | PLACEHOLDER_PAT@[242; 243) | ||
123 | UNDERSCORE@[242; 243) "_" | ||
124 | WHITESPACE@[243; 244) " " | ||
125 | FAT_ARROW@[244; 246) "=>" | ||
126 | WHITESPACE@[246; 247) " " | ||
127 | TUPLE_EXPR@[247; 249) | ||
128 | L_PAREN@[247; 248) "(" | ||
129 | R_PAREN@[248; 249) ")" | ||
130 | COMMA@[249; 250) "," | ||
131 | WHITESPACE@[250; 255) "\n " | ||
132 | R_CURLY@[255; 256) "}" | ||
133 | WHITESPACE@[256; 257) "\n" | ||
134 | R_CURLY@[257; 258) "}" | ||
135 | WHITESPACE@[258; 259) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0122_generic_lifetime_type_attribute.rs b/crates/ra_syntax/test_data/parser/inline/ok/0122_generic_lifetime_type_attribute.rs new file mode 100644 index 000000000..e8fdf741f --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0122_generic_lifetime_type_attribute.rs | |||
@@ -0,0 +1,2 @@ | |||
1 | fn foo<#[derive(Lifetime)] 'a, #[derive(Type)] T>(_: &'a T) { | ||
2 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0122_generic_lifetime_type_attribute.txt b/crates/ra_syntax/test_data/parser/inline/ok/0122_generic_lifetime_type_attribute.txt new file mode 100644 index 000000000..a45995236 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0122_generic_lifetime_type_attribute.txt | |||
@@ -0,0 +1,61 @@ | |||
1 | SOURCE_FILE@[0; 64) | ||
2 | FN_DEF@[0; 63) | ||
3 | FN_KW@[0; 2) "fn" | ||
4 | WHITESPACE@[2; 3) " " | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | TYPE_PARAM_LIST@[6; 49) | ||
8 | L_ANGLE@[6; 7) "<" | ||
9 | LIFETIME_PARAM@[7; 29) | ||
10 | ATTR@[7; 26) | ||
11 | POUND@[7; 8) "#" | ||
12 | TOKEN_TREE@[8; 26) | ||
13 | L_BRACK@[8; 9) "[" | ||
14 | IDENT@[9; 15) "derive" | ||
15 | TOKEN_TREE@[15; 25) | ||
16 | L_PAREN@[15; 16) "(" | ||
17 | IDENT@[16; 24) "Lifetime" | ||
18 | R_PAREN@[24; 25) ")" | ||
19 | R_BRACK@[25; 26) "]" | ||
20 | WHITESPACE@[26; 27) " " | ||
21 | LIFETIME@[27; 29) "\'a" | ||
22 | COMMA@[29; 30) "," | ||
23 | WHITESPACE@[30; 31) " " | ||
24 | TYPE_PARAM@[31; 48) | ||
25 | ATTR@[31; 46) | ||
26 | POUND@[31; 32) "#" | ||
27 | TOKEN_TREE@[32; 46) | ||
28 | L_BRACK@[32; 33) "[" | ||
29 | IDENT@[33; 39) "derive" | ||
30 | TOKEN_TREE@[39; 45) | ||
31 | L_PAREN@[39; 40) "(" | ||
32 | IDENT@[40; 44) "Type" | ||
33 | R_PAREN@[44; 45) ")" | ||
34 | R_BRACK@[45; 46) "]" | ||
35 | WHITESPACE@[46; 47) " " | ||
36 | NAME@[47; 48) | ||
37 | IDENT@[47; 48) "T" | ||
38 | R_ANGLE@[48; 49) ">" | ||
39 | PARAM_LIST@[49; 59) | ||
40 | L_PAREN@[49; 50) "(" | ||
41 | PARAM@[50; 58) | ||
42 | PLACEHOLDER_PAT@[50; 51) | ||
43 | UNDERSCORE@[50; 51) "_" | ||
44 | COLON@[51; 52) ":" | ||
45 | WHITESPACE@[52; 53) " " | ||
46 | REFERENCE_TYPE@[53; 58) | ||
47 | AMP@[53; 54) "&" | ||
48 | LIFETIME@[54; 56) "\'a" | ||
49 | WHITESPACE@[56; 57) " " | ||
50 | PATH_TYPE@[57; 58) | ||
51 | PATH@[57; 58) | ||
52 | PATH_SEGMENT@[57; 58) | ||
53 | NAME_REF@[57; 58) | ||
54 | IDENT@[57; 58) "T" | ||
55 | R_PAREN@[58; 59) ")" | ||
56 | WHITESPACE@[59; 60) " " | ||
57 | BLOCK@[60; 63) | ||
58 | L_CURLY@[60; 61) "{" | ||
59 | WHITESPACE@[61; 62) "\n" | ||
60 | R_CURLY@[62; 63) "}" | ||
61 | WHITESPACE@[63; 64) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0123_param_list_vararg.rs b/crates/ra_syntax/test_data/parser/inline/ok/0123_param_list_vararg.rs new file mode 100644 index 000000000..c59addaf4 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0123_param_list_vararg.rs | |||
@@ -0,0 +1 @@ | |||
extern "C" { fn printf(format: *const i8, ...) -> i32; } | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0123_param_list_vararg.txt b/crates/ra_syntax/test_data/parser/inline/ok/0123_param_list_vararg.txt new file mode 100644 index 000000000..836e8e55b --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0123_param_list_vararg.txt | |||
@@ -0,0 +1,49 @@ | |||
1 | SOURCE_FILE@[0; 57) | ||
2 | EXTERN_BLOCK@[0; 56) | ||
3 | ABI@[0; 10) | ||
4 | EXTERN_KW@[0; 6) "extern" | ||
5 | WHITESPACE@[6; 7) " " | ||
6 | STRING@[7; 10) "\"C\"" | ||
7 | WHITESPACE@[10; 11) " " | ||
8 | EXTERN_ITEM_LIST@[11; 56) | ||
9 | L_CURLY@[11; 12) "{" | ||
10 | WHITESPACE@[12; 13) " " | ||
11 | FN_DEF@[13; 54) | ||
12 | FN_KW@[13; 15) "fn" | ||
13 | WHITESPACE@[15; 16) " " | ||
14 | NAME@[16; 22) | ||
15 | IDENT@[16; 22) "printf" | ||
16 | PARAM_LIST@[22; 46) | ||
17 | L_PAREN@[22; 23) "(" | ||
18 | PARAM@[23; 40) | ||
19 | BIND_PAT@[23; 29) | ||
20 | NAME@[23; 29) | ||
21 | IDENT@[23; 29) "format" | ||
22 | COLON@[29; 30) ":" | ||
23 | WHITESPACE@[30; 31) " " | ||
24 | POINTER_TYPE@[31; 40) | ||
25 | STAR@[31; 32) "*" | ||
26 | CONST_KW@[32; 37) "const" | ||
27 | WHITESPACE@[37; 38) " " | ||
28 | PATH_TYPE@[38; 40) | ||
29 | PATH@[38; 40) | ||
30 | PATH_SEGMENT@[38; 40) | ||
31 | NAME_REF@[38; 40) | ||
32 | IDENT@[38; 40) "i8" | ||
33 | COMMA@[40; 41) "," | ||
34 | WHITESPACE@[41; 42) " " | ||
35 | DOTDOTDOT@[42; 45) "..." | ||
36 | R_PAREN@[45; 46) ")" | ||
37 | WHITESPACE@[46; 47) " " | ||
38 | RET_TYPE@[47; 53) | ||
39 | THIN_ARROW@[47; 49) "->" | ||
40 | WHITESPACE@[49; 50) " " | ||
41 | PATH_TYPE@[50; 53) | ||
42 | PATH@[50; 53) | ||
43 | PATH_SEGMENT@[50; 53) | ||
44 | NAME_REF@[50; 53) | ||
45 | IDENT@[50; 53) "i32" | ||
46 | SEMI@[53; 54) ";" | ||
47 | WHITESPACE@[54; 55) " " | ||
48 | R_CURLY@[55; 56) "}" | ||
49 | WHITESPACE@[56; 57) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0124_async_fn.rs b/crates/ra_syntax/test_data/parser/inline/ok/0124_async_fn.rs new file mode 100644 index 000000000..f4adcb62b --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0124_async_fn.rs | |||
@@ -0,0 +1 @@ | |||
async fn foo() {} | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0124_async_fn.txt b/crates/ra_syntax/test_data/parser/inline/ok/0124_async_fn.txt new file mode 100644 index 000000000..f0610e781 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0124_async_fn.txt | |||
@@ -0,0 +1,16 @@ | |||
1 | SOURCE_FILE@[0; 18) | ||
2 | FN_DEF@[0; 17) | ||
3 | ASYNC_KW@[0; 5) "async" | ||
4 | WHITESPACE@[5; 6) " " | ||
5 | FN_KW@[6; 8) "fn" | ||
6 | WHITESPACE@[8; 9) " " | ||
7 | NAME@[9; 12) | ||
8 | IDENT@[9; 12) "foo" | ||
9 | PARAM_LIST@[12; 14) | ||
10 | L_PAREN@[12; 13) "(" | ||
11 | R_PAREN@[13; 14) ")" | ||
12 | WHITESPACE@[14; 15) " " | ||
13 | BLOCK@[15; 17) | ||
14 | L_CURLY@[15; 16) "{" | ||
15 | R_CURLY@[16; 17) "}" | ||
16 | WHITESPACE@[17; 18) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0125_crate_keyword_path.rs b/crates/ra_syntax/test_data/parser/inline/ok/0125_crate_keyword_path.rs new file mode 100644 index 000000000..0f454d121 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0125_crate_keyword_path.rs | |||
@@ -0,0 +1 @@ | |||
fn foo() { crate::foo(); } | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0125_crate_keyword_path.txt b/crates/ra_syntax/test_data/parser/inline/ok/0125_crate_keyword_path.txt new file mode 100644 index 000000000..4afe9c555 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0125_crate_keyword_path.txt | |||
@@ -0,0 +1,31 @@ | |||
1 | SOURCE_FILE@[0; 27) | ||
2 | FN_DEF@[0; 26) | ||
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; 26) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 11) " " | ||
14 | EXPR_STMT@[11; 24) | ||
15 | CALL_EXPR@[11; 23) | ||
16 | PATH_EXPR@[11; 21) | ||
17 | PATH@[11; 21) | ||
18 | PATH@[11; 16) | ||
19 | PATH_SEGMENT@[11; 16) | ||
20 | CRATE_KW@[11; 16) "crate" | ||
21 | COLONCOLON@[16; 18) "::" | ||
22 | PATH_SEGMENT@[18; 21) | ||
23 | NAME_REF@[18; 21) | ||
24 | IDENT@[18; 21) "foo" | ||
25 | ARG_LIST@[21; 23) | ||
26 | L_PAREN@[21; 22) "(" | ||
27 | R_PAREN@[22; 23) ")" | ||
28 | SEMI@[23; 24) ";" | ||
29 | WHITESPACE@[24; 25) " " | ||
30 | R_CURLY@[25; 26) "}" | ||
31 | WHITESPACE@[26; 27) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0125_struct_literal_field_with_attr.rs b/crates/ra_syntax/test_data/parser/inline/ok/0125_struct_literal_field_with_attr.rs new file mode 100644 index 000000000..a6c7760c7 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0125_struct_literal_field_with_attr.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn main() { | ||
2 | S { #[cfg(test)] field: 1 } | ||
3 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0125_struct_literal_field_with_attr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0125_struct_literal_field_with_attr.txt new file mode 100644 index 000000000..f9c5ec124 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0125_struct_literal_field_with_attr.txt | |||
@@ -0,0 +1,45 @@ | |||
1 | SOURCE_FILE@[0; 46) | ||
2 | FN_DEF@[0; 45) | ||
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@[10; 45) | ||
12 | L_CURLY@[10; 11) "{" | ||
13 | WHITESPACE@[11; 16) "\n " | ||
14 | STRUCT_LIT@[16; 43) | ||
15 | PATH@[16; 17) | ||
16 | PATH_SEGMENT@[16; 17) | ||
17 | NAME_REF@[16; 17) | ||
18 | IDENT@[16; 17) "S" | ||
19 | WHITESPACE@[17; 18) " " | ||
20 | NAMED_FIELD_LIST@[18; 43) | ||
21 | L_CURLY@[18; 19) "{" | ||
22 | WHITESPACE@[19; 20) " " | ||
23 | NAMED_FIELD@[20; 41) | ||
24 | ATTR@[20; 32) | ||
25 | POUND@[20; 21) "#" | ||
26 | TOKEN_TREE@[21; 32) | ||
27 | L_BRACK@[21; 22) "[" | ||
28 | IDENT@[22; 25) "cfg" | ||
29 | TOKEN_TREE@[25; 31) | ||
30 | L_PAREN@[25; 26) "(" | ||
31 | IDENT@[26; 30) "test" | ||
32 | R_PAREN@[30; 31) ")" | ||
33 | R_BRACK@[31; 32) "]" | ||
34 | WHITESPACE@[32; 33) " " | ||
35 | NAME_REF@[33; 38) | ||
36 | IDENT@[33; 38) "field" | ||
37 | COLON@[38; 39) ":" | ||
38 | WHITESPACE@[39; 40) " " | ||
39 | LITERAL@[40; 41) | ||
40 | INT_NUMBER@[40; 41) "1" | ||
41 | WHITESPACE@[41; 42) " " | ||
42 | R_CURLY@[42; 43) "}" | ||
43 | WHITESPACE@[43; 44) "\n" | ||
44 | R_CURLY@[44; 45) "}" | ||
45 | WHITESPACE@[45; 46) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0126_attr_on_expr_stmt.rs b/crates/ra_syntax/test_data/parser/inline/ok/0126_attr_on_expr_stmt.rs new file mode 100644 index 000000000..b28c078f9 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0126_attr_on_expr_stmt.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | fn foo() { | ||
2 | #[A] foo(); | ||
3 | #[B] bar!{} | ||
4 | #[C] #[D] {} | ||
5 | #[D] return (); | ||
6 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0126_attr_on_expr_stmt.txt b/crates/ra_syntax/test_data/parser/inline/ok/0126_attr_on_expr_stmt.txt new file mode 100644 index 000000000..c15c7573a --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0126_attr_on_expr_stmt.txt | |||
@@ -0,0 +1,88 @@ | |||
1 | SOURCE_FILE@[0; 82) | ||
2 | FN_DEF@[0; 81) | ||
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; 81) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 15) "\n " | ||
14 | EXPR_STMT@[15; 26) | ||
15 | ATTR@[15; 19) | ||
16 | POUND@[15; 16) "#" | ||
17 | TOKEN_TREE@[16; 19) | ||
18 | L_BRACK@[16; 17) "[" | ||
19 | IDENT@[17; 18) "A" | ||
20 | R_BRACK@[18; 19) "]" | ||
21 | WHITESPACE@[19; 20) " " | ||
22 | CALL_EXPR@[20; 25) | ||
23 | PATH_EXPR@[20; 23) | ||
24 | PATH@[20; 23) | ||
25 | PATH_SEGMENT@[20; 23) | ||
26 | NAME_REF@[20; 23) | ||
27 | IDENT@[20; 23) "foo" | ||
28 | ARG_LIST@[23; 25) | ||
29 | L_PAREN@[23; 24) "(" | ||
30 | R_PAREN@[24; 25) ")" | ||
31 | SEMI@[25; 26) ";" | ||
32 | WHITESPACE@[26; 31) "\n " | ||
33 | EXPR_STMT@[31; 42) | ||
34 | ATTR@[31; 35) | ||
35 | POUND@[31; 32) "#" | ||
36 | TOKEN_TREE@[32; 35) | ||
37 | L_BRACK@[32; 33) "[" | ||
38 | IDENT@[33; 34) "B" | ||
39 | R_BRACK@[34; 35) "]" | ||
40 | WHITESPACE@[35; 36) " " | ||
41 | MACRO_CALL@[36; 42) | ||
42 | PATH@[36; 39) | ||
43 | PATH_SEGMENT@[36; 39) | ||
44 | NAME_REF@[36; 39) | ||
45 | IDENT@[36; 39) "bar" | ||
46 | EXCL@[39; 40) "!" | ||
47 | TOKEN_TREE@[40; 42) | ||
48 | L_CURLY@[40; 41) "{" | ||
49 | R_CURLY@[41; 42) "}" | ||
50 | WHITESPACE@[42; 47) "\n " | ||
51 | EXPR_STMT@[47; 59) | ||
52 | ATTR@[47; 51) | ||
53 | POUND@[47; 48) "#" | ||
54 | TOKEN_TREE@[48; 51) | ||
55 | L_BRACK@[48; 49) "[" | ||
56 | IDENT@[49; 50) "C" | ||
57 | R_BRACK@[50; 51) "]" | ||
58 | WHITESPACE@[51; 52) " " | ||
59 | ATTR@[52; 56) | ||
60 | POUND@[52; 53) "#" | ||
61 | TOKEN_TREE@[53; 56) | ||
62 | L_BRACK@[53; 54) "[" | ||
63 | IDENT@[54; 55) "D" | ||
64 | R_BRACK@[55; 56) "]" | ||
65 | WHITESPACE@[56; 57) " " | ||
66 | BLOCK_EXPR@[57; 59) | ||
67 | BLOCK@[57; 59) | ||
68 | L_CURLY@[57; 58) "{" | ||
69 | R_CURLY@[58; 59) "}" | ||
70 | WHITESPACE@[59; 64) "\n " | ||
71 | EXPR_STMT@[64; 79) | ||
72 | ATTR@[64; 68) | ||
73 | POUND@[64; 65) "#" | ||
74 | TOKEN_TREE@[65; 68) | ||
75 | L_BRACK@[65; 66) "[" | ||
76 | IDENT@[66; 67) "D" | ||
77 | R_BRACK@[67; 68) "]" | ||
78 | WHITESPACE@[68; 69) " " | ||
79 | RETURN_EXPR@[69; 78) | ||
80 | RETURN_KW@[69; 75) "return" | ||
81 | WHITESPACE@[75; 76) " " | ||
82 | TUPLE_EXPR@[76; 78) | ||
83 | L_PAREN@[76; 77) "(" | ||
84 | R_PAREN@[77; 78) ")" | ||
85 | SEMI@[78; 79) ";" | ||
86 | WHITESPACE@[79; 80) "\n" | ||
87 | R_CURLY@[80; 81) "}" | ||
88 | WHITESPACE@[81; 82) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0127_attr_on_last_expr_in_block.rs b/crates/ra_syntax/test_data/parser/inline/ok/0127_attr_on_last_expr_in_block.rs new file mode 100644 index 000000000..9c5c8eb36 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0127_attr_on_last_expr_in_block.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn foo() { | ||
2 | { #[A] bar!()? } | ||
3 | #[B] &() | ||
4 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0127_attr_on_last_expr_in_block.txt b/crates/ra_syntax/test_data/parser/inline/ok/0127_attr_on_last_expr_in_block.txt new file mode 100644 index 000000000..62a6a7bc0 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0127_attr_on_last_expr_in_block.txt | |||
@@ -0,0 +1,54 @@ | |||
1 | SOURCE_FILE@[0; 47) | ||
2 | FN_DEF@[0; 46) | ||
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; 46) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 15) "\n " | ||
14 | EXPR_STMT@[15; 31) | ||
15 | BLOCK_EXPR@[15; 31) | ||
16 | BLOCK@[15; 31) | ||
17 | L_CURLY@[15; 16) "{" | ||
18 | WHITESPACE@[16; 17) " " | ||
19 | TRY_EXPR@[17; 29) | ||
20 | ATTR@[17; 21) | ||
21 | POUND@[17; 18) "#" | ||
22 | TOKEN_TREE@[18; 21) | ||
23 | L_BRACK@[18; 19) "[" | ||
24 | IDENT@[19; 20) "A" | ||
25 | R_BRACK@[20; 21) "]" | ||
26 | WHITESPACE@[21; 22) " " | ||
27 | MACRO_CALL@[22; 28) | ||
28 | PATH@[22; 25) | ||
29 | PATH_SEGMENT@[22; 25) | ||
30 | NAME_REF@[22; 25) | ||
31 | IDENT@[22; 25) "bar" | ||
32 | EXCL@[25; 26) "!" | ||
33 | TOKEN_TREE@[26; 28) | ||
34 | L_PAREN@[26; 27) "(" | ||
35 | R_PAREN@[27; 28) ")" | ||
36 | QUESTION@[28; 29) "?" | ||
37 | WHITESPACE@[29; 30) " " | ||
38 | R_CURLY@[30; 31) "}" | ||
39 | WHITESPACE@[31; 36) "\n " | ||
40 | REF_EXPR@[36; 44) | ||
41 | ATTR@[36; 40) | ||
42 | POUND@[36; 37) "#" | ||
43 | TOKEN_TREE@[37; 40) | ||
44 | L_BRACK@[37; 38) "[" | ||
45 | IDENT@[38; 39) "B" | ||
46 | R_BRACK@[39; 40) "]" | ||
47 | WHITESPACE@[40; 41) " " | ||
48 | AMP@[41; 42) "&" | ||
49 | TUPLE_EXPR@[42; 44) | ||
50 | L_PAREN@[42; 43) "(" | ||
51 | R_PAREN@[43; 44) ")" | ||
52 | WHITESPACE@[44; 45) "\n" | ||
53 | R_CURLY@[45; 46) "}" | ||
54 | WHITESPACE@[46; 47) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0128_combined_fns.rs b/crates/ra_syntax/test_data/parser/inline/ok/0128_combined_fns.rs new file mode 100644 index 000000000..46af91b82 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0128_combined_fns.rs | |||
@@ -0,0 +1,2 @@ | |||
1 | unsafe async fn foo() {} | ||
2 | const unsafe fn bar() {} | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0128_combined_fns.txt b/crates/ra_syntax/test_data/parser/inline/ok/0128_combined_fns.txt new file mode 100644 index 000000000..2a16aeb61 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0128_combined_fns.txt | |||
@@ -0,0 +1,35 @@ | |||
1 | SOURCE_FILE@[0; 50) | ||
2 | FN_DEF@[0; 24) | ||
3 | UNSAFE_KW@[0; 6) "unsafe" | ||
4 | WHITESPACE@[6; 7) " " | ||
5 | ASYNC_KW@[7; 12) "async" | ||
6 | WHITESPACE@[12; 13) " " | ||
7 | FN_KW@[13; 15) "fn" | ||
8 | WHITESPACE@[15; 16) " " | ||
9 | NAME@[16; 19) | ||
10 | IDENT@[16; 19) "foo" | ||
11 | PARAM_LIST@[19; 21) | ||
12 | L_PAREN@[19; 20) "(" | ||
13 | R_PAREN@[20; 21) ")" | ||
14 | WHITESPACE@[21; 22) " " | ||
15 | BLOCK@[22; 24) | ||
16 | L_CURLY@[22; 23) "{" | ||
17 | R_CURLY@[23; 24) "}" | ||
18 | WHITESPACE@[24; 25) "\n" | ||
19 | FN_DEF@[25; 49) | ||
20 | CONST_KW@[25; 30) "const" | ||
21 | WHITESPACE@[30; 31) " " | ||
22 | UNSAFE_KW@[31; 37) "unsafe" | ||
23 | WHITESPACE@[37; 38) " " | ||
24 | FN_KW@[38; 40) "fn" | ||
25 | WHITESPACE@[40; 41) " " | ||
26 | NAME@[41; 44) | ||
27 | IDENT@[41; 44) "bar" | ||
28 | PARAM_LIST@[44; 46) | ||
29 | L_PAREN@[44; 45) "(" | ||
30 | R_PAREN@[45; 46) ")" | ||
31 | WHITESPACE@[46; 47) " " | ||
32 | BLOCK@[47; 49) | ||
33 | L_CURLY@[47; 48) "{" | ||
34 | R_CURLY@[48; 49) "}" | ||
35 | WHITESPACE@[49; 50) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0129_marco_pat.rs b/crates/ra_syntax/test_data/parser/inline/ok/0129_marco_pat.rs new file mode 100644 index 000000000..811181d9b --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0129_marco_pat.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn main() { | ||
2 | let m!(x) = 0; | ||
3 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0129_marco_pat.txt b/crates/ra_syntax/test_data/parser/inline/ok/0129_marco_pat.txt new file mode 100644 index 000000000..50b4ab2e7 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0129_marco_pat.txt | |||
@@ -0,0 +1,36 @@ | |||
1 | SOURCE_FILE@[0; 33) | ||
2 | FN_DEF@[0; 32) | ||
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@[10; 32) | ||
12 | L_CURLY@[10; 11) "{" | ||
13 | WHITESPACE@[11; 16) "\n " | ||
14 | LET_STMT@[16; 30) | ||
15 | LET_KW@[16; 19) "let" | ||
16 | WHITESPACE@[19; 20) " " | ||
17 | MACRO_CALL@[20; 25) | ||
18 | PATH_PAT@[20; 21) | ||
19 | PATH@[20; 21) | ||
20 | PATH_SEGMENT@[20; 21) | ||
21 | NAME_REF@[20; 21) | ||
22 | IDENT@[20; 21) "m" | ||
23 | EXCL@[21; 22) "!" | ||
24 | TOKEN_TREE@[22; 25) | ||
25 | L_PAREN@[22; 23) "(" | ||
26 | IDENT@[23; 24) "x" | ||
27 | R_PAREN@[24; 25) ")" | ||
28 | WHITESPACE@[25; 26) " " | ||
29 | EQ@[26; 27) "=" | ||
30 | WHITESPACE@[27; 28) " " | ||
31 | LITERAL@[28; 29) | ||
32 | INT_NUMBER@[28; 29) "0" | ||
33 | SEMI@[29; 30) ";" | ||
34 | WHITESPACE@[30; 31) "\n" | ||
35 | R_CURLY@[31; 32) "}" | ||
36 | WHITESPACE@[32; 33) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0130_let_stmt.rs b/crates/ra_syntax/test_data/parser/inline/ok/0130_let_stmt.rs new file mode 100644 index 000000000..86803fe08 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0130_let_stmt.rs | |||
@@ -0,0 +1,8 @@ | |||
1 | fn foo() { | ||
2 | let a; | ||
3 | let b: i32; | ||
4 | let c = 92; | ||
5 | let d: i32 = 92; | ||
6 | let e: !; | ||
7 | let _: ! = {}; | ||
8 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0130_let_stmt.txt b/crates/ra_syntax/test_data/parser/inline/ok/0130_let_stmt.txt new file mode 100644 index 000000000..82c1eb009 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0130_let_stmt.txt | |||
@@ -0,0 +1,101 @@ | |||
1 | SOURCE_FILE@[0; 110) | ||
2 | FN_DEF@[0; 109) | ||
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; 109) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 15) "\n " | ||
14 | LET_STMT@[15; 21) | ||
15 | LET_KW@[15; 18) "let" | ||
16 | WHITESPACE@[18; 19) " " | ||
17 | BIND_PAT@[19; 20) | ||
18 | NAME@[19; 20) | ||
19 | IDENT@[19; 20) "a" | ||
20 | SEMI@[20; 21) ";" | ||
21 | WHITESPACE@[21; 26) "\n " | ||
22 | LET_STMT@[26; 37) | ||
23 | LET_KW@[26; 29) "let" | ||
24 | WHITESPACE@[29; 30) " " | ||
25 | BIND_PAT@[30; 31) | ||
26 | NAME@[30; 31) | ||
27 | IDENT@[30; 31) "b" | ||
28 | COLON@[31; 32) ":" | ||
29 | WHITESPACE@[32; 33) " " | ||
30 | PATH_TYPE@[33; 36) | ||
31 | PATH@[33; 36) | ||
32 | PATH_SEGMENT@[33; 36) | ||
33 | NAME_REF@[33; 36) | ||
34 | IDENT@[33; 36) "i32" | ||
35 | SEMI@[36; 37) ";" | ||
36 | WHITESPACE@[37; 42) "\n " | ||
37 | LET_STMT@[42; 53) | ||
38 | LET_KW@[42; 45) "let" | ||
39 | WHITESPACE@[45; 46) " " | ||
40 | BIND_PAT@[46; 47) | ||
41 | NAME@[46; 47) | ||
42 | IDENT@[46; 47) "c" | ||
43 | WHITESPACE@[47; 48) " " | ||
44 | EQ@[48; 49) "=" | ||
45 | WHITESPACE@[49; 50) " " | ||
46 | LITERAL@[50; 52) | ||
47 | INT_NUMBER@[50; 52) "92" | ||
48 | SEMI@[52; 53) ";" | ||
49 | WHITESPACE@[53; 58) "\n " | ||
50 | LET_STMT@[58; 74) | ||
51 | LET_KW@[58; 61) "let" | ||
52 | WHITESPACE@[61; 62) " " | ||
53 | BIND_PAT@[62; 63) | ||
54 | NAME@[62; 63) | ||
55 | IDENT@[62; 63) "d" | ||
56 | COLON@[63; 64) ":" | ||
57 | WHITESPACE@[64; 65) " " | ||
58 | PATH_TYPE@[65; 68) | ||
59 | PATH@[65; 68) | ||
60 | PATH_SEGMENT@[65; 68) | ||
61 | NAME_REF@[65; 68) | ||
62 | IDENT@[65; 68) "i32" | ||
63 | WHITESPACE@[68; 69) " " | ||
64 | EQ@[69; 70) "=" | ||
65 | WHITESPACE@[70; 71) " " | ||
66 | LITERAL@[71; 73) | ||
67 | INT_NUMBER@[71; 73) "92" | ||
68 | SEMI@[73; 74) ";" | ||
69 | WHITESPACE@[74; 79) "\n " | ||
70 | LET_STMT@[79; 88) | ||
71 | LET_KW@[79; 82) "let" | ||
72 | WHITESPACE@[82; 83) " " | ||
73 | BIND_PAT@[83; 84) | ||
74 | NAME@[83; 84) | ||
75 | IDENT@[83; 84) "e" | ||
76 | COLON@[84; 85) ":" | ||
77 | WHITESPACE@[85; 86) " " | ||
78 | NEVER_TYPE@[86; 87) | ||
79 | EXCL@[86; 87) "!" | ||
80 | SEMI@[87; 88) ";" | ||
81 | WHITESPACE@[88; 93) "\n " | ||
82 | LET_STMT@[93; 107) | ||
83 | LET_KW@[93; 96) "let" | ||
84 | WHITESPACE@[96; 97) " " | ||
85 | PLACEHOLDER_PAT@[97; 98) | ||
86 | UNDERSCORE@[97; 98) "_" | ||
87 | COLON@[98; 99) ":" | ||
88 | WHITESPACE@[99; 100) " " | ||
89 | NEVER_TYPE@[100; 101) | ||
90 | EXCL@[100; 101) "!" | ||
91 | WHITESPACE@[101; 102) " " | ||
92 | EQ@[102; 103) "=" | ||
93 | WHITESPACE@[103; 104) " " | ||
94 | BLOCK_EXPR@[104; 106) | ||
95 | BLOCK@[104; 106) | ||
96 | L_CURLY@[104; 105) "{" | ||
97 | R_CURLY@[105; 106) "}" | ||
98 | SEMI@[106; 107) ";" | ||
99 | WHITESPACE@[107; 108) "\n" | ||
100 | R_CURLY@[108; 109) "}" | ||
101 | WHITESPACE@[109; 110) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0130_try_block_expr.rs b/crates/ra_syntax/test_data/parser/inline/ok/0130_try_block_expr.rs new file mode 100644 index 000000000..0f1b41eb6 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0130_try_block_expr.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn foo() { | ||
2 | let _ = try {}; | ||
3 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0130_try_block_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0130_try_block_expr.txt new file mode 100644 index 000000000..53f49b9b5 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0130_try_block_expr.txt | |||
@@ -0,0 +1,31 @@ | |||
1 | SOURCE_FILE@[0; 33) | ||
2 | FN_DEF@[0; 32) | ||
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; 32) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 15) "\n " | ||
14 | LET_STMT@[15; 30) | ||
15 | LET_KW@[15; 18) "let" | ||
16 | WHITESPACE@[18; 19) " " | ||
17 | PLACEHOLDER_PAT@[19; 20) | ||
18 | UNDERSCORE@[19; 20) "_" | ||
19 | WHITESPACE@[20; 21) " " | ||
20 | EQ@[21; 22) "=" | ||
21 | WHITESPACE@[22; 23) " " | ||
22 | TRY_EXPR@[23; 29) | ||
23 | TRY_KW@[23; 26) "try" | ||
24 | WHITESPACE@[26; 27) " " | ||
25 | BLOCK@[27; 29) | ||
26 | L_CURLY@[27; 28) "{" | ||
27 | R_CURLY@[28; 29) "}" | ||
28 | SEMI@[29; 30) ";" | ||
29 | WHITESPACE@[30; 31) "\n" | ||
30 | R_CURLY@[31; 32) "}" | ||
31 | WHITESPACE@[32; 33) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0131_existential_type.rs b/crates/ra_syntax/test_data/parser/inline/ok/0131_existential_type.rs new file mode 100644 index 000000000..23baf7145 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0131_existential_type.rs | |||
@@ -0,0 +1 @@ | |||
existential type Foo: Fn() -> usize; | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0131_existential_type.txt b/crates/ra_syntax/test_data/parser/inline/ok/0131_existential_type.txt new file mode 100644 index 000000000..6bfac985a --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0131_existential_type.txt | |||
@@ -0,0 +1,31 @@ | |||
1 | SOURCE_FILE@[0; 37) | ||
2 | TYPE_ALIAS_DEF@[0; 36) | ||
3 | EXISTENTIAL_KW@[0; 11) "existential" | ||
4 | WHITESPACE@[11; 12) " " | ||
5 | TYPE_KW@[12; 16) "type" | ||
6 | WHITESPACE@[16; 17) " " | ||
7 | NAME@[17; 20) | ||
8 | IDENT@[17; 20) "Foo" | ||
9 | COLON@[20; 21) ":" | ||
10 | WHITESPACE@[21; 22) " " | ||
11 | TYPE_BOUND_LIST@[22; 35) | ||
12 | TYPE_BOUND@[22; 35) | ||
13 | PATH_TYPE@[22; 35) | ||
14 | PATH@[22; 35) | ||
15 | PATH_SEGMENT@[22; 35) | ||
16 | NAME_REF@[22; 24) | ||
17 | IDENT@[22; 24) "Fn" | ||
18 | PARAM_LIST@[24; 26) | ||
19 | L_PAREN@[24; 25) "(" | ||
20 | R_PAREN@[25; 26) ")" | ||
21 | WHITESPACE@[26; 27) " " | ||
22 | RET_TYPE@[27; 35) | ||
23 | THIN_ARROW@[27; 29) "->" | ||
24 | WHITESPACE@[29; 30) " " | ||
25 | PATH_TYPE@[30; 35) | ||
26 | PATH@[30; 35) | ||
27 | PATH_SEGMENT@[30; 35) | ||
28 | NAME_REF@[30; 35) | ||
29 | IDENT@[30; 35) "usize" | ||
30 | SEMI@[35; 36) ";" | ||
31 | WHITESPACE@[36; 37) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0132_box_expr.rs b/crates/ra_syntax/test_data/parser/inline/ok/0132_box_expr.rs new file mode 100644 index 000000000..fc9923b71 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0132_box_expr.rs | |||
@@ -0,0 +1,5 @@ | |||
1 | fn foo() { | ||
2 | let x = box 1i32; | ||
3 | let y = (box 1i32, box 2i32); | ||
4 | let z = Foo(box 1i32, box 2i32); | ||
5 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0132_box_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0132_box_expr.txt new file mode 100644 index 000000000..3d22002a1 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0132_box_expr.txt | |||
@@ -0,0 +1,89 @@ | |||
1 | SOURCE_FILE@[0; 106) | ||
2 | FN_DEF@[0; 105) | ||
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; 105) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 15) "\n " | ||
14 | LET_STMT@[15; 32) | ||
15 | LET_KW@[15; 18) "let" | ||
16 | WHITESPACE@[18; 19) " " | ||
17 | BIND_PAT@[19; 20) | ||
18 | NAME@[19; 20) | ||
19 | IDENT@[19; 20) "x" | ||
20 | WHITESPACE@[20; 21) " " | ||
21 | EQ@[21; 22) "=" | ||
22 | WHITESPACE@[22; 23) " " | ||
23 | BOX_EXPR@[23; 31) | ||
24 | BOX_KW@[23; 26) "box" | ||
25 | WHITESPACE@[26; 27) " " | ||
26 | LITERAL@[27; 31) | ||
27 | INT_NUMBER@[27; 31) "1i32" | ||
28 | SEMI@[31; 32) ";" | ||
29 | WHITESPACE@[32; 37) "\n " | ||
30 | LET_STMT@[37; 66) | ||
31 | LET_KW@[37; 40) "let" | ||
32 | WHITESPACE@[40; 41) " " | ||
33 | BIND_PAT@[41; 42) | ||
34 | NAME@[41; 42) | ||
35 | IDENT@[41; 42) "y" | ||
36 | WHITESPACE@[42; 43) " " | ||
37 | EQ@[43; 44) "=" | ||
38 | WHITESPACE@[44; 45) " " | ||
39 | TUPLE_EXPR@[45; 65) | ||
40 | L_PAREN@[45; 46) "(" | ||
41 | BOX_EXPR@[46; 54) | ||
42 | BOX_KW@[46; 49) "box" | ||
43 | WHITESPACE@[49; 50) " " | ||
44 | LITERAL@[50; 54) | ||
45 | INT_NUMBER@[50; 54) "1i32" | ||
46 | COMMA@[54; 55) "," | ||
47 | WHITESPACE@[55; 56) " " | ||
48 | BOX_EXPR@[56; 64) | ||
49 | BOX_KW@[56; 59) "box" | ||
50 | WHITESPACE@[59; 60) " " | ||
51 | LITERAL@[60; 64) | ||
52 | INT_NUMBER@[60; 64) "2i32" | ||
53 | R_PAREN@[64; 65) ")" | ||
54 | SEMI@[65; 66) ";" | ||
55 | WHITESPACE@[66; 71) "\n " | ||
56 | LET_STMT@[71; 103) | ||
57 | LET_KW@[71; 74) "let" | ||
58 | WHITESPACE@[74; 75) " " | ||
59 | BIND_PAT@[75; 76) | ||
60 | NAME@[75; 76) | ||
61 | IDENT@[75; 76) "z" | ||
62 | WHITESPACE@[76; 77) " " | ||
63 | EQ@[77; 78) "=" | ||
64 | WHITESPACE@[78; 79) " " | ||
65 | CALL_EXPR@[79; 102) | ||
66 | PATH_EXPR@[79; 82) | ||
67 | PATH@[79; 82) | ||
68 | PATH_SEGMENT@[79; 82) | ||
69 | NAME_REF@[79; 82) | ||
70 | IDENT@[79; 82) "Foo" | ||
71 | ARG_LIST@[82; 102) | ||
72 | L_PAREN@[82; 83) "(" | ||
73 | BOX_EXPR@[83; 91) | ||
74 | BOX_KW@[83; 86) "box" | ||
75 | WHITESPACE@[86; 87) " " | ||
76 | LITERAL@[87; 91) | ||
77 | INT_NUMBER@[87; 91) "1i32" | ||
78 | COMMA@[91; 92) "," | ||
79 | WHITESPACE@[92; 93) " " | ||
80 | BOX_EXPR@[93; 101) | ||
81 | BOX_KW@[93; 96) "box" | ||
82 | WHITESPACE@[96; 97) " " | ||
83 | LITERAL@[97; 101) | ||
84 | INT_NUMBER@[97; 101) "2i32" | ||
85 | R_PAREN@[101; 102) ")" | ||
86 | SEMI@[102; 103) ";" | ||
87 | WHITESPACE@[103; 104) "\n" | ||
88 | R_CURLY@[104; 105) "}" | ||
89 | WHITESPACE@[105; 106) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0132_default_fn_type.rs b/crates/ra_syntax/test_data/parser/inline/ok/0132_default_fn_type.rs new file mode 100644 index 000000000..8f5d61113 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0132_default_fn_type.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | impl T for Foo { | ||
2 | default type T = Bar; | ||
3 | default fn foo() {} | ||
4 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0132_default_fn_type.txt b/crates/ra_syntax/test_data/parser/inline/ok/0132_default_fn_type.txt new file mode 100644 index 000000000..384b203d3 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0132_default_fn_type.txt | |||
@@ -0,0 +1,55 @@ | |||
1 | SOURCE_FILE@[0; 69) | ||
2 | IMPL_BLOCK@[0; 68) | ||
3 | IMPL_KW@[0; 4) "impl" | ||
4 | WHITESPACE@[4; 5) " " | ||
5 | PATH_TYPE@[5; 6) | ||
6 | PATH@[5; 6) | ||
7 | PATH_SEGMENT@[5; 6) | ||
8 | NAME_REF@[5; 6) | ||
9 | IDENT@[5; 6) "T" | ||
10 | WHITESPACE@[6; 7) " " | ||
11 | FOR_KW@[7; 10) "for" | ||
12 | WHITESPACE@[10; 11) " " | ||
13 | PATH_TYPE@[11; 14) | ||
14 | PATH@[11; 14) | ||
15 | PATH_SEGMENT@[11; 14) | ||
16 | NAME_REF@[11; 14) | ||
17 | IDENT@[11; 14) "Foo" | ||
18 | WHITESPACE@[14; 15) " " | ||
19 | ITEM_LIST@[15; 68) | ||
20 | L_CURLY@[15; 16) "{" | ||
21 | WHITESPACE@[16; 21) "\n " | ||
22 | TYPE_ALIAS_DEF@[21; 42) | ||
23 | DEFAULT_KW@[21; 28) "default" | ||
24 | WHITESPACE@[28; 29) " " | ||
25 | TYPE_KW@[29; 33) "type" | ||
26 | WHITESPACE@[33; 34) " " | ||
27 | NAME@[34; 35) | ||
28 | IDENT@[34; 35) "T" | ||
29 | WHITESPACE@[35; 36) " " | ||
30 | EQ@[36; 37) "=" | ||
31 | WHITESPACE@[37; 38) " " | ||
32 | PATH_TYPE@[38; 41) | ||
33 | PATH@[38; 41) | ||
34 | PATH_SEGMENT@[38; 41) | ||
35 | NAME_REF@[38; 41) | ||
36 | IDENT@[38; 41) "Bar" | ||
37 | SEMI@[41; 42) ";" | ||
38 | WHITESPACE@[42; 47) "\n " | ||
39 | FN_DEF@[47; 66) | ||
40 | DEFAULT_KW@[47; 54) "default" | ||
41 | WHITESPACE@[54; 55) " " | ||
42 | FN_KW@[55; 57) "fn" | ||
43 | WHITESPACE@[57; 58) " " | ||
44 | NAME@[58; 61) | ||
45 | IDENT@[58; 61) "foo" | ||
46 | PARAM_LIST@[61; 63) | ||
47 | L_PAREN@[61; 62) "(" | ||
48 | R_PAREN@[62; 63) ")" | ||
49 | WHITESPACE@[63; 64) " " | ||
50 | BLOCK@[64; 66) | ||
51 | L_CURLY@[64; 65) "{" | ||
52 | R_CURLY@[65; 66) "}" | ||
53 | WHITESPACE@[66; 67) "\n" | ||
54 | R_CURLY@[67; 68) "}" | ||
55 | WHITESPACE@[68; 69) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0134_nocontentexpr_after_item.rs b/crates/ra_syntax/test_data/parser/inline/ok/0134_nocontentexpr_after_item.rs new file mode 100644 index 000000000..eadc7fffb --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0134_nocontentexpr_after_item.rs | |||
@@ -0,0 +1,8 @@ | |||
1 | fn simple_function() { | ||
2 | enum LocalEnum { | ||
3 | One, | ||
4 | Two, | ||
5 | }; | ||
6 | fn f() {}; | ||
7 | struct S {}; | ||
8 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0134_nocontentexpr_after_item.txt b/crates/ra_syntax/test_data/parser/inline/ok/0134_nocontentexpr_after_item.txt new file mode 100644 index 000000000..50d3b5def --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0134_nocontentexpr_after_item.txt | |||
@@ -0,0 +1,62 @@ | |||
1 | SOURCE_FILE@[0; 111) | ||
2 | FN_DEF@[0; 110) | ||
3 | FN_KW@[0; 2) "fn" | ||
4 | WHITESPACE@[2; 3) " " | ||
5 | NAME@[3; 18) | ||
6 | IDENT@[3; 18) "simple_function" | ||
7 | PARAM_LIST@[18; 20) | ||
8 | L_PAREN@[18; 19) "(" | ||
9 | R_PAREN@[19; 20) ")" | ||
10 | WHITESPACE@[20; 21) " " | ||
11 | BLOCK@[21; 110) | ||
12 | L_CURLY@[21; 22) "{" | ||
13 | WHITESPACE@[22; 27) "\n " | ||
14 | ENUM_DEF@[27; 75) | ||
15 | ENUM_KW@[27; 31) "enum" | ||
16 | WHITESPACE@[31; 32) " " | ||
17 | NAME@[32; 41) | ||
18 | IDENT@[32; 41) "LocalEnum" | ||
19 | WHITESPACE@[41; 42) " " | ||
20 | ENUM_VARIANT_LIST@[42; 75) | ||
21 | L_CURLY@[42; 43) "{" | ||
22 | WHITESPACE@[43; 52) "\n " | ||
23 | ENUM_VARIANT@[52; 55) | ||
24 | NAME@[52; 55) | ||
25 | IDENT@[52; 55) "One" | ||
26 | COMMA@[55; 56) "," | ||
27 | WHITESPACE@[56; 65) "\n " | ||
28 | ENUM_VARIANT@[65; 68) | ||
29 | NAME@[65; 68) | ||
30 | IDENT@[65; 68) "Two" | ||
31 | COMMA@[68; 69) "," | ||
32 | WHITESPACE@[69; 74) "\n " | ||
33 | R_CURLY@[74; 75) "}" | ||
34 | SEMI@[75; 76) ";" | ||
35 | WHITESPACE@[76; 81) "\n " | ||
36 | FN_DEF@[81; 90) | ||
37 | FN_KW@[81; 83) "fn" | ||
38 | WHITESPACE@[83; 84) " " | ||
39 | NAME@[84; 85) | ||
40 | IDENT@[84; 85) "f" | ||
41 | PARAM_LIST@[85; 87) | ||
42 | L_PAREN@[85; 86) "(" | ||
43 | R_PAREN@[86; 87) ")" | ||
44 | WHITESPACE@[87; 88) " " | ||
45 | BLOCK@[88; 90) | ||
46 | L_CURLY@[88; 89) "{" | ||
47 | R_CURLY@[89; 90) "}" | ||
48 | SEMI@[90; 91) ";" | ||
49 | WHITESPACE@[91; 96) "\n " | ||
50 | STRUCT_DEF@[96; 107) | ||
51 | STRUCT_KW@[96; 102) "struct" | ||
52 | WHITESPACE@[102; 103) " " | ||
53 | NAME@[103; 104) | ||
54 | IDENT@[103; 104) "S" | ||
55 | WHITESPACE@[104; 105) " " | ||
56 | NAMED_FIELD_DEF_LIST@[105; 107) | ||
57 | L_CURLY@[105; 106) "{" | ||
58 | R_CURLY@[106; 107) "}" | ||
59 | SEMI@[107; 108) ";" | ||
60 | WHITESPACE@[108; 109) "\n" | ||
61 | R_CURLY@[109; 110) "}" | ||
62 | WHITESPACE@[110; 111) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0135_first_array_member_attributes.rs b/crates/ra_syntax/test_data/parser/inline/ok/0135_first_array_member_attributes.rs new file mode 100644 index 000000000..f59e13771 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0135_first_array_member_attributes.rs | |||
@@ -0,0 +1,5 @@ | |||
1 | pub const A: &[i64] = &[ | ||
2 | #[cfg(test)] | ||
3 | 1, | ||
4 | 2, | ||
5 | ]; | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0135_first_array_member_attributes.txt b/crates/ra_syntax/test_data/parser/inline/ok/0135_first_array_member_attributes.txt new file mode 100644 index 000000000..eac4f6f30 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0135_first_array_member_attributes.txt | |||
@@ -0,0 +1,51 @@ | |||
1 | SOURCE_FILE@[0; 56) | ||
2 | CONST_DEF@[0; 55) | ||
3 | VISIBILITY@[0; 3) | ||
4 | PUB_KW@[0; 3) "pub" | ||
5 | WHITESPACE@[3; 4) " " | ||
6 | CONST_KW@[4; 9) "const" | ||
7 | WHITESPACE@[9; 10) " " | ||
8 | NAME@[10; 11) | ||
9 | IDENT@[10; 11) "A" | ||
10 | COLON@[11; 12) ":" | ||
11 | WHITESPACE@[12; 13) " " | ||
12 | REFERENCE_TYPE@[13; 19) | ||
13 | AMP@[13; 14) "&" | ||
14 | SLICE_TYPE@[14; 19) | ||
15 | L_BRACK@[14; 15) "[" | ||
16 | PATH_TYPE@[15; 18) | ||
17 | PATH@[15; 18) | ||
18 | PATH_SEGMENT@[15; 18) | ||
19 | NAME_REF@[15; 18) | ||
20 | IDENT@[15; 18) "i64" | ||
21 | R_BRACK@[18; 19) "]" | ||
22 | WHITESPACE@[19; 20) " " | ||
23 | EQ@[20; 21) "=" | ||
24 | WHITESPACE@[21; 22) " " | ||
25 | REF_EXPR@[22; 54) | ||
26 | AMP@[22; 23) "&" | ||
27 | ARRAY_EXPR@[23; 54) | ||
28 | L_BRACK@[23; 24) "[" | ||
29 | WHITESPACE@[24; 28) "\n " | ||
30 | ATTR@[28; 40) | ||
31 | POUND@[28; 29) "#" | ||
32 | TOKEN_TREE@[29; 40) | ||
33 | L_BRACK@[29; 30) "[" | ||
34 | IDENT@[30; 33) "cfg" | ||
35 | TOKEN_TREE@[33; 39) | ||
36 | L_PAREN@[33; 34) "(" | ||
37 | IDENT@[34; 38) "test" | ||
38 | R_PAREN@[38; 39) ")" | ||
39 | R_BRACK@[39; 40) "]" | ||
40 | WHITESPACE@[40; 44) "\n " | ||
41 | LITERAL@[44; 45) | ||
42 | INT_NUMBER@[44; 45) "1" | ||
43 | COMMA@[45; 46) "," | ||
44 | WHITESPACE@[46; 50) "\n " | ||
45 | LITERAL@[50; 51) | ||
46 | INT_NUMBER@[50; 51) "2" | ||
47 | COMMA@[51; 52) "," | ||
48 | WHITESPACE@[52; 53) "\n" | ||
49 | R_BRACK@[53; 54) "]" | ||
50 | SEMI@[54; 55) ";" | ||
51 | WHITESPACE@[55; 56) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0136_subsequent_array_member_attributes.rs b/crates/ra_syntax/test_data/parser/inline/ok/0136_subsequent_array_member_attributes.rs new file mode 100644 index 000000000..1324acb3f --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0136_subsequent_array_member_attributes.rs | |||
@@ -0,0 +1,5 @@ | |||
1 | pub const A: &[i64] = &[ | ||
2 | 1, | ||
3 | #[cfg(test)] | ||
4 | 2, | ||
5 | ]; | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0136_subsequent_array_member_attributes.txt b/crates/ra_syntax/test_data/parser/inline/ok/0136_subsequent_array_member_attributes.txt new file mode 100644 index 000000000..6fa1b42d9 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0136_subsequent_array_member_attributes.txt | |||
@@ -0,0 +1,51 @@ | |||
1 | SOURCE_FILE@[0; 56) | ||
2 | CONST_DEF@[0; 55) | ||
3 | VISIBILITY@[0; 3) | ||
4 | PUB_KW@[0; 3) "pub" | ||
5 | WHITESPACE@[3; 4) " " | ||
6 | CONST_KW@[4; 9) "const" | ||
7 | WHITESPACE@[9; 10) " " | ||
8 | NAME@[10; 11) | ||
9 | IDENT@[10; 11) "A" | ||
10 | COLON@[11; 12) ":" | ||
11 | WHITESPACE@[12; 13) " " | ||
12 | REFERENCE_TYPE@[13; 19) | ||
13 | AMP@[13; 14) "&" | ||
14 | SLICE_TYPE@[14; 19) | ||
15 | L_BRACK@[14; 15) "[" | ||
16 | PATH_TYPE@[15; 18) | ||
17 | PATH@[15; 18) | ||
18 | PATH_SEGMENT@[15; 18) | ||
19 | NAME_REF@[15; 18) | ||
20 | IDENT@[15; 18) "i64" | ||
21 | R_BRACK@[18; 19) "]" | ||
22 | WHITESPACE@[19; 20) " " | ||
23 | EQ@[20; 21) "=" | ||
24 | WHITESPACE@[21; 22) " " | ||
25 | REF_EXPR@[22; 54) | ||
26 | AMP@[22; 23) "&" | ||
27 | ARRAY_EXPR@[23; 54) | ||
28 | L_BRACK@[23; 24) "[" | ||
29 | WHITESPACE@[24; 28) "\n " | ||
30 | LITERAL@[28; 29) | ||
31 | INT_NUMBER@[28; 29) "1" | ||
32 | COMMA@[29; 30) "," | ||
33 | WHITESPACE@[30; 34) "\n " | ||
34 | ATTR@[34; 46) | ||
35 | POUND@[34; 35) "#" | ||
36 | TOKEN_TREE@[35; 46) | ||
37 | L_BRACK@[35; 36) "[" | ||
38 | IDENT@[36; 39) "cfg" | ||
39 | TOKEN_TREE@[39; 45) | ||
40 | L_PAREN@[39; 40) "(" | ||
41 | IDENT@[40; 44) "test" | ||
42 | R_PAREN@[44; 45) ")" | ||
43 | R_BRACK@[45; 46) "]" | ||
44 | WHITESPACE@[46; 50) "\n " | ||
45 | LITERAL@[50; 51) | ||
46 | INT_NUMBER@[50; 51) "2" | ||
47 | COMMA@[51; 52) "," | ||
48 | WHITESPACE@[52; 53) "\n" | ||
49 | R_BRACK@[53; 54) "]" | ||
50 | SEMI@[54; 55) ";" | ||
51 | WHITESPACE@[55; 56) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0137_await_expr.rs b/crates/ra_syntax/test_data/parser/inline/ok/0137_await_expr.rs new file mode 100644 index 000000000..d2ba89ca6 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0137_await_expr.rs | |||
@@ -0,0 +1,5 @@ | |||
1 | fn foo() { | ||
2 | x.await; | ||
3 | x.0.await; | ||
4 | x.0().await?.hello(); | ||
5 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0137_await_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0137_await_expr.txt new file mode 100644 index 000000000..99bd76ace --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0137_await_expr.txt | |||
@@ -0,0 +1,67 @@ | |||
1 | SOURCE_FILE@[0; 67) | ||
2 | FN_DEF@[0; 66) | ||
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; 66) | ||
12 | L_CURLY@[9; 10) "{" | ||
13 | WHITESPACE@[10; 15) "\n " | ||
14 | EXPR_STMT@[15; 23) | ||
15 | AWAIT_EXPR@[15; 22) | ||
16 | PATH_EXPR@[15; 16) | ||
17 | PATH@[15; 16) | ||
18 | PATH_SEGMENT@[15; 16) | ||
19 | NAME_REF@[15; 16) | ||
20 | IDENT@[15; 16) "x" | ||
21 | DOT@[16; 17) "." | ||
22 | AWAIT_KW@[17; 22) "await" | ||
23 | SEMI@[22; 23) ";" | ||
24 | WHITESPACE@[23; 28) "\n " | ||
25 | EXPR_STMT@[28; 38) | ||
26 | AWAIT_EXPR@[28; 37) | ||
27 | FIELD_EXPR@[28; 31) | ||
28 | PATH_EXPR@[28; 29) | ||
29 | PATH@[28; 29) | ||
30 | PATH_SEGMENT@[28; 29) | ||
31 | NAME_REF@[28; 29) | ||
32 | IDENT@[28; 29) "x" | ||
33 | DOT@[29; 30) "." | ||
34 | INT_NUMBER@[30; 31) "0" | ||
35 | DOT@[31; 32) "." | ||
36 | AWAIT_KW@[32; 37) "await" | ||
37 | SEMI@[37; 38) ";" | ||
38 | WHITESPACE@[38; 43) "\n " | ||
39 | EXPR_STMT@[43; 64) | ||
40 | METHOD_CALL_EXPR@[43; 63) | ||
41 | TRY_EXPR@[43; 55) | ||
42 | AWAIT_EXPR@[43; 54) | ||
43 | CALL_EXPR@[43; 48) | ||
44 | FIELD_EXPR@[43; 46) | ||
45 | PATH_EXPR@[43; 44) | ||
46 | PATH@[43; 44) | ||
47 | PATH_SEGMENT@[43; 44) | ||
48 | NAME_REF@[43; 44) | ||
49 | IDENT@[43; 44) "x" | ||
50 | DOT@[44; 45) "." | ||
51 | INT_NUMBER@[45; 46) "0" | ||
52 | ARG_LIST@[46; 48) | ||
53 | L_PAREN@[46; 47) "(" | ||
54 | R_PAREN@[47; 48) ")" | ||
55 | DOT@[48; 49) "." | ||
56 | AWAIT_KW@[49; 54) "await" | ||
57 | QUESTION@[54; 55) "?" | ||
58 | DOT@[55; 56) "." | ||
59 | NAME_REF@[56; 61) | ||
60 | IDENT@[56; 61) "hello" | ||
61 | ARG_LIST@[61; 63) | ||
62 | L_PAREN@[61; 62) "(" | ||
63 | R_PAREN@[62; 63) ")" | ||
64 | SEMI@[63; 64) ";" | ||
65 | WHITESPACE@[64; 65) "\n" | ||
66 | R_CURLY@[65; 66) "}" | ||
67 | WHITESPACE@[66; 67) "\n" | ||