diff options
Diffstat (limited to 'crates/libsyntax2/tests/data/parser/inline')
197 files changed, 4676 insertions, 0 deletions
diff --git a/crates/libsyntax2/tests/data/parser/inline/0001_const_unsafe_fn.rs b/crates/libsyntax2/tests/data/parser/inline/0001_const_unsafe_fn.rs new file mode 100644 index 000000000..31a1e435f --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0001_const_unsafe_fn.rs | |||
@@ -0,0 +1 @@ | |||
const unsafe fn foo() {} | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0001_const_unsafe_fn.txt b/crates/libsyntax2/tests/data/parser/inline/0001_const_unsafe_fn.txt new file mode 100644 index 000000000..3932d033c --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0001_const_unsafe_fn.txt | |||
@@ -0,0 +1,18 @@ | |||
1 | FILE@[0; 25) | ||
2 | FUNCTION@[0; 24) | ||
3 | CONST_KW@[0; 5) | ||
4 | WHITESPACE@[5; 6) | ||
5 | UNSAFE_KW@[6; 12) | ||
6 | WHITESPACE@[12; 13) | ||
7 | FN_KW@[13; 15) | ||
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_EXPR@[22; 24) | ||
16 | L_CURLY@[22; 23) | ||
17 | R_CURLY@[23; 24) | ||
18 | WHITESPACE@[24; 25) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0002_const_fn.rs b/crates/libsyntax2/tests/data/parser/inline/0002_const_fn.rs new file mode 100644 index 000000000..8c84d9cd7 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0002_const_fn.rs | |||
@@ -0,0 +1 @@ | |||
const fn foo() {} | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0002_const_fn.txt b/crates/libsyntax2/tests/data/parser/inline/0002_const_fn.txt new file mode 100644 index 000000000..bc72ab235 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0002_const_fn.txt | |||
@@ -0,0 +1,16 @@ | |||
1 | FILE@[0; 18) | ||
2 | FUNCTION@[0; 17) | ||
3 | CONST_KW@[0; 5) | ||
4 | WHITESPACE@[5; 6) | ||
5 | FN_KW@[6; 8) | ||
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_EXPR@[15; 17) | ||
14 | L_CURLY@[15; 16) | ||
15 | R_CURLY@[16; 17) | ||
16 | WHITESPACE@[17; 18) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0003_extern_block.rs b/crates/libsyntax2/tests/data/parser/inline/0003_extern_block.rs new file mode 100644 index 000000000..26a9ccd1e --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0003_extern_block.rs | |||
@@ -0,0 +1 @@ | |||
extern {} | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0003_extern_block.txt b/crates/libsyntax2/tests/data/parser/inline/0003_extern_block.txt new file mode 100644 index 000000000..cbe9a1ebc --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0003_extern_block.txt | |||
@@ -0,0 +1,8 @@ | |||
1 | FILE@[0; 10) | ||
2 | EXTERN_BLOCK_EXPR@[0; 9) | ||
3 | ABI@[0; 6) | ||
4 | EXTERN_KW@[0; 6) | ||
5 | WHITESPACE@[6; 7) | ||
6 | L_CURLY@[7; 8) | ||
7 | R_CURLY@[8; 9) | ||
8 | WHITESPACE@[9; 10) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0004_extern_fn.rs b/crates/libsyntax2/tests/data/parser/inline/0004_extern_fn.rs new file mode 100644 index 000000000..394a049f0 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0004_extern_fn.rs | |||
@@ -0,0 +1 @@ | |||
extern fn foo() {} | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0004_extern_fn.txt b/crates/libsyntax2/tests/data/parser/inline/0004_extern_fn.txt new file mode 100644 index 000000000..e7787d4ab --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0004_extern_fn.txt | |||
@@ -0,0 +1,17 @@ | |||
1 | FILE@[0; 19) | ||
2 | FUNCTION@[0; 18) | ||
3 | ABI@[0; 6) | ||
4 | EXTERN_KW@[0; 6) | ||
5 | WHITESPACE@[6; 7) | ||
6 | FN_KW@[7; 9) | ||
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_EXPR@[16; 18) | ||
15 | L_CURLY@[16; 17) | ||
16 | R_CURLY@[17; 18) | ||
17 | WHITESPACE@[18; 19) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0005_extern_crate.rs b/crates/libsyntax2/tests/data/parser/inline/0005_extern_crate.rs new file mode 100644 index 000000000..49af74e1b --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0005_extern_crate.rs | |||
@@ -0,0 +1 @@ | |||
extern crate foo; | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0005_extern_crate.txt b/crates/libsyntax2/tests/data/parser/inline/0005_extern_crate.txt new file mode 100644 index 000000000..eac8656ac --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0005_extern_crate.txt | |||
@@ -0,0 +1,10 @@ | |||
1 | FILE@[0; 18) | ||
2 | EXTERN_CRATE_ITEM@[0; 17) | ||
3 | EXTERN_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | CRATE_KW@[7; 12) | ||
6 | WHITESPACE@[12; 13) | ||
7 | NAME@[13; 16) | ||
8 | IDENT@[13; 16) "foo" | ||
9 | SEMI@[16; 17) | ||
10 | WHITESPACE@[17; 18) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0007_unsafe_trait.rs b/crates/libsyntax2/tests/data/parser/inline/0007_unsafe_trait.rs new file mode 100644 index 000000000..04e021550 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0007_unsafe_trait.rs | |||
@@ -0,0 +1 @@ | |||
unsafe trait T {} | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0007_unsafe_trait.txt b/crates/libsyntax2/tests/data/parser/inline/0007_unsafe_trait.txt new file mode 100644 index 000000000..afa6637d3 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0007_unsafe_trait.txt | |||
@@ -0,0 +1,12 @@ | |||
1 | FILE@[0; 18) | ||
2 | TRAIT_ITEM@[0; 17) | ||
3 | UNSAFE_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | TRAIT_KW@[7; 12) | ||
6 | WHITESPACE@[12; 13) | ||
7 | NAME@[13; 14) | ||
8 | IDENT@[13; 14) "T" | ||
9 | WHITESPACE@[14; 15) | ||
10 | L_CURLY@[15; 16) | ||
11 | R_CURLY@[16; 17) | ||
12 | WHITESPACE@[17; 18) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0008_unsafe_impl.rs b/crates/libsyntax2/tests/data/parser/inline/0008_unsafe_impl.rs new file mode 100644 index 000000000..41055f41d --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0008_unsafe_impl.rs | |||
@@ -0,0 +1 @@ | |||
unsafe impl Foo {} | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0008_unsafe_impl.txt b/crates/libsyntax2/tests/data/parser/inline/0008_unsafe_impl.txt new file mode 100644 index 000000000..6fd3f868f --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0008_unsafe_impl.txt | |||
@@ -0,0 +1,15 @@ | |||
1 | FILE@[0; 19) | ||
2 | IMPL_ITEM@[0; 18) | ||
3 | UNSAFE_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | IMPL_KW@[7; 11) | ||
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 | L_CURLY@[16; 17) | ||
14 | R_CURLY@[17; 18) | ||
15 | WHITESPACE@[18; 19) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0009_unsafe_auto_trait.rs b/crates/libsyntax2/tests/data/parser/inline/0009_unsafe_auto_trait.rs new file mode 100644 index 000000000..03d29f324 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0009_unsafe_auto_trait.rs | |||
@@ -0,0 +1 @@ | |||
unsafe auto trait T {} | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0009_unsafe_auto_trait.txt b/crates/libsyntax2/tests/data/parser/inline/0009_unsafe_auto_trait.txt new file mode 100644 index 000000000..825a56f17 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0009_unsafe_auto_trait.txt | |||
@@ -0,0 +1,14 @@ | |||
1 | FILE@[0; 23) | ||
2 | TRAIT_ITEM@[0; 22) | ||
3 | UNSAFE_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | AUTO_KW@[7; 11) | ||
6 | WHITESPACE@[11; 12) | ||
7 | TRAIT_KW@[12; 17) | ||
8 | WHITESPACE@[17; 18) | ||
9 | NAME@[18; 19) | ||
10 | IDENT@[18; 19) "T" | ||
11 | WHITESPACE@[19; 20) | ||
12 | L_CURLY@[20; 21) | ||
13 | R_CURLY@[21; 22) | ||
14 | WHITESPACE@[22; 23) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0010_unsafe_default_impl.rs b/crates/libsyntax2/tests/data/parser/inline/0010_unsafe_default_impl.rs new file mode 100644 index 000000000..9cd6c57bd --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0010_unsafe_default_impl.rs | |||
@@ -0,0 +1 @@ | |||
unsafe default impl Foo {} | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0010_unsafe_default_impl.txt b/crates/libsyntax2/tests/data/parser/inline/0010_unsafe_default_impl.txt new file mode 100644 index 000000000..ab12d5fc0 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0010_unsafe_default_impl.txt | |||
@@ -0,0 +1,17 @@ | |||
1 | FILE@[0; 27) | ||
2 | IMPL_ITEM@[0; 26) | ||
3 | UNSAFE_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | DEFAULT_KW@[7; 14) | ||
6 | WHITESPACE@[14; 15) | ||
7 | IMPL_KW@[15; 19) | ||
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 | L_CURLY@[24; 25) | ||
16 | R_CURLY@[25; 26) | ||
17 | WHITESPACE@[26; 27) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0011_unsafe_fn.rs b/crates/libsyntax2/tests/data/parser/inline/0011_unsafe_fn.rs new file mode 100644 index 000000000..33cfc4cd7 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0011_unsafe_fn.rs | |||
@@ -0,0 +1 @@ | |||
unsafe fn foo() {} | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0011_unsafe_fn.txt b/crates/libsyntax2/tests/data/parser/inline/0011_unsafe_fn.txt new file mode 100644 index 000000000..9e5dcafa6 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0011_unsafe_fn.txt | |||
@@ -0,0 +1,16 @@ | |||
1 | FILE@[0; 19) | ||
2 | FUNCTION@[0; 18) | ||
3 | UNSAFE_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | FN_KW@[7; 9) | ||
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_EXPR@[16; 18) | ||
14 | L_CURLY@[16; 17) | ||
15 | R_CURLY@[17; 18) | ||
16 | WHITESPACE@[18; 19) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0012_unsafe_extern_fn.rs b/crates/libsyntax2/tests/data/parser/inline/0012_unsafe_extern_fn.rs new file mode 100644 index 000000000..1295c2cd2 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0012_unsafe_extern_fn.rs | |||
@@ -0,0 +1 @@ | |||
unsafe extern "C" fn foo() {} | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0012_unsafe_extern_fn.txt b/crates/libsyntax2/tests/data/parser/inline/0012_unsafe_extern_fn.txt new file mode 100644 index 000000000..7ed4d42c1 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0012_unsafe_extern_fn.txt | |||
@@ -0,0 +1,21 @@ | |||
1 | FILE@[0; 30) | ||
2 | FUNCTION@[0; 29) | ||
3 | UNSAFE_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | ABI@[7; 17) | ||
6 | EXTERN_KW@[7; 13) | ||
7 | WHITESPACE@[13; 14) | ||
8 | STRING@[14; 17) | ||
9 | WHITESPACE@[17; 18) | ||
10 | FN_KW@[18; 20) | ||
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_EXPR@[27; 29) | ||
19 | L_CURLY@[27; 28) | ||
20 | R_CURLY@[28; 29) | ||
21 | WHITESPACE@[29; 30) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0013_unsafe_block_in_mod.rs b/crates/libsyntax2/tests/data/parser/inline/0013_unsafe_block_in_mod.rs new file mode 100644 index 000000000..26141e904 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0013_unsafe_block_in_mod.rs | |||
@@ -0,0 +1 @@ | |||
fn foo(){} unsafe { } fn bar(){} | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0013_unsafe_block_in_mod.txt b/crates/libsyntax2/tests/data/parser/inline/0013_unsafe_block_in_mod.txt new file mode 100644 index 000000000..d1bcffe77 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0013_unsafe_block_in_mod.txt | |||
@@ -0,0 +1,35 @@ | |||
1 | FILE@[0; 33) | ||
2 | FUNCTION@[0; 10) | ||
3 | FN_KW@[0; 2) | ||
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_EXPR@[8; 10) | ||
11 | L_CURLY@[8; 9) | ||
12 | R_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 11) | ||
14 | err: `expected an item` | ||
15 | ERROR@[11; 17) | ||
16 | UNSAFE_KW@[11; 17) | ||
17 | WHITESPACE@[17; 18) | ||
18 | err: `expected an item` | ||
19 | ERROR@[18; 21) | ||
20 | L_CURLY@[18; 19) | ||
21 | WHITESPACE@[19; 20) | ||
22 | R_CURLY@[20; 21) | ||
23 | WHITESPACE@[21; 22) | ||
24 | FUNCTION@[22; 32) | ||
25 | FN_KW@[22; 24) | ||
26 | WHITESPACE@[24; 25) | ||
27 | NAME@[25; 28) | ||
28 | IDENT@[25; 28) "bar" | ||
29 | PARAM_LIST@[28; 30) | ||
30 | L_PAREN@[28; 29) | ||
31 | R_PAREN@[29; 30) | ||
32 | BLOCK_EXPR@[30; 32) | ||
33 | L_CURLY@[30; 31) | ||
34 | R_CURLY@[31; 32) | ||
35 | WHITESPACE@[32; 33) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0014_type_item_type_params.rs b/crates/libsyntax2/tests/data/parser/inline/0014_type_item_type_params.rs new file mode 100644 index 000000000..defd110c4 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0014_type_item_type_params.rs | |||
@@ -0,0 +1 @@ | |||
type Result<T> = (); | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0014_type_item_type_params.txt b/crates/libsyntax2/tests/data/parser/inline/0014_type_item_type_params.txt new file mode 100644 index 000000000..e39e57889 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0014_type_item_type_params.txt | |||
@@ -0,0 +1,20 @@ | |||
1 | FILE@[0; 21) | ||
2 | TYPE_ITEM@[0; 20) | ||
3 | TYPE_KW@[0; 4) | ||
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) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0015_type_item.rs b/crates/libsyntax2/tests/data/parser/inline/0015_type_item.rs new file mode 100644 index 000000000..04c0344fa --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0015_type_item.rs | |||
@@ -0,0 +1 @@ | |||
type Foo = Bar; | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0015_type_item.txt b/crates/libsyntax2/tests/data/parser/inline/0015_type_item.txt new file mode 100644 index 000000000..964071aa1 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0015_type_item.txt | |||
@@ -0,0 +1,16 @@ | |||
1 | FILE@[0; 16) | ||
2 | TYPE_ITEM@[0; 15) | ||
3 | TYPE_KW@[0; 4) | ||
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) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0016_type_item_where_clause.rs b/crates/libsyntax2/tests/data/parser/inline/0016_type_item_where_clause.rs new file mode 100644 index 000000000..a602d07f0 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0016_type_item_where_clause.rs | |||
@@ -0,0 +1 @@ | |||
type Foo where Foo: Copy = (); | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0016_type_item_where_clause.txt b/crates/libsyntax2/tests/data/parser/inline/0016_type_item_where_clause.txt new file mode 100644 index 000000000..2f3c52960 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0016_type_item_where_clause.txt | |||
@@ -0,0 +1,31 @@ | |||
1 | FILE@[0; 31) | ||
2 | TYPE_ITEM@[0; 30) | ||
3 | TYPE_KW@[0; 4) | ||
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) | ||
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 | PATH@[20; 24) | ||
20 | PATH_SEGMENT@[20; 24) | ||
21 | NAME_REF@[20; 24) | ||
22 | IDENT@[20; 24) "Copy" | ||
23 | err: `expected COMMA` | ||
24 | WHITESPACE@[24; 25) | ||
25 | EQ@[25; 26) | ||
26 | WHITESPACE@[26; 27) | ||
27 | TUPLE_TYPE@[27; 29) | ||
28 | L_PAREN@[27; 28) | ||
29 | R_PAREN@[28; 29) | ||
30 | SEMI@[29; 30) | ||
31 | WHITESPACE@[30; 31) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0017_paren_type.rs b/crates/libsyntax2/tests/data/parser/inline/0017_paren_type.rs new file mode 100644 index 000000000..6e1b25101 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0017_paren_type.rs | |||
@@ -0,0 +1 @@ | |||
type T = (i32); | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0017_paren_type.txt b/crates/libsyntax2/tests/data/parser/inline/0017_paren_type.txt new file mode 100644 index 000000000..1194fb02c --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0017_paren_type.txt | |||
@@ -0,0 +1,19 @@ | |||
1 | FILE@[0; 16) | ||
2 | TYPE_ITEM@[0; 15) | ||
3 | TYPE_KW@[0; 4) | ||
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) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0018_unit_type.rs b/crates/libsyntax2/tests/data/parser/inline/0018_unit_type.rs new file mode 100644 index 000000000..c039cf7d3 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0018_unit_type.rs | |||
@@ -0,0 +1 @@ | |||
type T = (); | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0018_unit_type.txt b/crates/libsyntax2/tests/data/parser/inline/0018_unit_type.txt new file mode 100644 index 000000000..e52af7b1e --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0018_unit_type.txt | |||
@@ -0,0 +1,14 @@ | |||
1 | FILE@[0; 13) | ||
2 | TYPE_ITEM@[0; 12) | ||
3 | TYPE_KW@[0; 4) | ||
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) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0019_singleton_tuple_type.rs b/crates/libsyntax2/tests/data/parser/inline/0019_singleton_tuple_type.rs new file mode 100644 index 000000000..cb66bad24 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0019_singleton_tuple_type.rs | |||
@@ -0,0 +1 @@ | |||
type T = (i32,); | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0019_singleton_tuple_type.txt b/crates/libsyntax2/tests/data/parser/inline/0019_singleton_tuple_type.txt new file mode 100644 index 000000000..7b8e06c25 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0019_singleton_tuple_type.txt | |||
@@ -0,0 +1,20 @@ | |||
1 | FILE@[0; 17) | ||
2 | TYPE_ITEM@[0; 16) | ||
3 | TYPE_KW@[0; 4) | ||
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) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0020_never_type.rs b/crates/libsyntax2/tests/data/parser/inline/0020_never_type.rs new file mode 100644 index 000000000..de399fcf4 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0020_never_type.rs | |||
@@ -0,0 +1 @@ | |||
type Never = !; | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0020_never_type.txt b/crates/libsyntax2/tests/data/parser/inline/0020_never_type.txt new file mode 100644 index 000000000..89f8a9eea --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0020_never_type.txt | |||
@@ -0,0 +1,13 @@ | |||
1 | FILE@[0; 16) | ||
2 | TYPE_ITEM@[0; 15) | ||
3 | TYPE_KW@[0; 4) | ||
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) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0021_pointer_type_no_mutability.rs b/crates/libsyntax2/tests/data/parser/inline/0021_pointer_type_no_mutability.rs new file mode 100644 index 000000000..fae705131 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0021_pointer_type_no_mutability.rs | |||
@@ -0,0 +1 @@ | |||
type T = *(); | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0021_pointer_type_no_mutability.txt b/crates/libsyntax2/tests/data/parser/inline/0021_pointer_type_no_mutability.txt new file mode 100644 index 000000000..d86fc6388 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0021_pointer_type_no_mutability.txt | |||
@@ -0,0 +1,17 @@ | |||
1 | FILE@[0; 14) | ||
2 | TYPE_ITEM@[0; 13) | ||
3 | TYPE_KW@[0; 4) | ||
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 | err: `expected mut or const in raw pointer type (use `*mut T` or `*const T` as appropriate)` | ||
13 | TUPLE_TYPE@[10; 12) | ||
14 | L_PAREN@[10; 11) | ||
15 | R_PAREN@[11; 12) | ||
16 | SEMI@[12; 13) | ||
17 | WHITESPACE@[13; 14) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0022_pointer_type_mut.rs b/crates/libsyntax2/tests/data/parser/inline/0022_pointer_type_mut.rs new file mode 100644 index 000000000..04b2bb9ba --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0022_pointer_type_mut.rs | |||
@@ -0,0 +1,2 @@ | |||
1 | type M = *mut (); | ||
2 | type C = *mut (); | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0022_pointer_type_mut.txt b/crates/libsyntax2/tests/data/parser/inline/0022_pointer_type_mut.txt new file mode 100644 index 000000000..fbeba506e --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0022_pointer_type_mut.txt | |||
@@ -0,0 +1,35 @@ | |||
1 | FILE@[0; 36) | ||
2 | TYPE_ITEM@[0; 17) | ||
3 | TYPE_KW@[0; 4) | ||
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) | ||
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) | ||
19 | TYPE_ITEM@[18; 35) | ||
20 | TYPE_KW@[18; 22) | ||
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) | ||
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) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0023_array_type_missing_semi.rs b/crates/libsyntax2/tests/data/parser/inline/0023_array_type_missing_semi.rs new file mode 100644 index 000000000..a94851443 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0023_array_type_missing_semi.rs | |||
@@ -0,0 +1 @@ | |||
type T = [() 92]; | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0023_array_type_missing_semi.txt b/crates/libsyntax2/tests/data/parser/inline/0023_array_type_missing_semi.txt new file mode 100644 index 000000000..4d90d52c7 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0023_array_type_missing_semi.txt | |||
@@ -0,0 +1,27 @@ | |||
1 | FILE@[0; 18) | ||
2 | TYPE_ITEM@[0; 12) | ||
3 | TYPE_KW@[0; 4) | ||
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 | err: `expected `;` or `]`` | ||
16 | err: `expected SEMI` | ||
17 | WHITESPACE@[12; 13) | ||
18 | err: `expected an item` | ||
19 | ERROR@[13; 15) | ||
20 | INT_NUMBER@[13; 15) "92" | ||
21 | err: `expected an item` | ||
22 | ERROR@[15; 16) | ||
23 | R_BRACK@[15; 16) | ||
24 | err: `expected an item` | ||
25 | ERROR@[16; 17) | ||
26 | SEMI@[16; 17) | ||
27 | WHITESPACE@[17; 18) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0024_array_type.rs b/crates/libsyntax2/tests/data/parser/inline/0024_array_type.rs new file mode 100644 index 000000000..27eb22f22 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0024_array_type.rs | |||
@@ -0,0 +1 @@ | |||
type T = [(); 92]; | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0024_array_type.txt b/crates/libsyntax2/tests/data/parser/inline/0024_array_type.txt new file mode 100644 index 000000000..5a6b76904 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0024_array_type.txt | |||
@@ -0,0 +1,21 @@ | |||
1 | FILE@[0; 19) | ||
2 | TYPE_ITEM@[0; 18) | ||
3 | TYPE_KW@[0; 4) | ||
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) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0025_slice_type.rs b/crates/libsyntax2/tests/data/parser/inline/0025_slice_type.rs new file mode 100644 index 000000000..4da1af827 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0025_slice_type.rs | |||
@@ -0,0 +1 @@ | |||
type T = [()]; | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0025_slice_type.txt b/crates/libsyntax2/tests/data/parser/inline/0025_slice_type.txt new file mode 100644 index 000000000..52508cda4 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0025_slice_type.txt | |||
@@ -0,0 +1,17 @@ | |||
1 | FILE@[0; 15) | ||
2 | TYPE_ITEM@[0; 14) | ||
3 | TYPE_KW@[0; 4) | ||
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) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0026_reference_type;.rs b/crates/libsyntax2/tests/data/parser/inline/0026_reference_type;.rs new file mode 100644 index 000000000..3ac0badab --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0026_reference_type;.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | type A = &(); | ||
2 | type B = &'static (); | ||
3 | type C = &mut (); | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0026_reference_type;.txt b/crates/libsyntax2/tests/data/parser/inline/0026_reference_type;.txt new file mode 100644 index 000000000..b6bd6a48c --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0026_reference_type;.txt | |||
@@ -0,0 +1,50 @@ | |||
1 | FILE@[0; 54) | ||
2 | TYPE_ITEM@[0; 13) | ||
3 | TYPE_KW@[0; 4) | ||
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) | ||
17 | TYPE_ITEM@[14; 35) | ||
18 | TYPE_KW@[14; 18) | ||
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) | ||
34 | TYPE_ITEM@[36; 53) | ||
35 | TYPE_KW@[36; 40) | ||
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) | ||
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) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0027_placeholder_type.rs b/crates/libsyntax2/tests/data/parser/inline/0027_placeholder_type.rs new file mode 100644 index 000000000..7952dbd57 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0027_placeholder_type.rs | |||
@@ -0,0 +1 @@ | |||
type Placeholder = _; | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0027_placeholder_type.txt b/crates/libsyntax2/tests/data/parser/inline/0027_placeholder_type.txt new file mode 100644 index 000000000..5e6e6c397 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0027_placeholder_type.txt | |||
@@ -0,0 +1,13 @@ | |||
1 | FILE@[0; 22) | ||
2 | TYPE_ITEM@[0; 21) | ||
3 | TYPE_KW@[0; 4) | ||
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) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0028_fn_pointer_type.rs b/crates/libsyntax2/tests/data/parser/inline/0028_fn_pointer_type.rs new file mode 100644 index 000000000..c9bf3bdb4 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0028_fn_pointer_type.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | type A = fn(); | ||
2 | type B = unsafe fn(); | ||
3 | type C = unsafe extern "C" fn(); | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0028_fn_pointer_type.txt b/crates/libsyntax2/tests/data/parser/inline/0028_fn_pointer_type.txt new file mode 100644 index 000000000..31818365a --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0028_fn_pointer_type.txt | |||
@@ -0,0 +1,55 @@ | |||
1 | FILE@[0; 70) | ||
2 | TYPE_ITEM@[0; 14) | ||
3 | TYPE_KW@[0; 4) | ||
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) | ||
12 | PARAM_LIST@[11; 13) | ||
13 | L_PAREN@[11; 12) | ||
14 | R_PAREN@[12; 13) | ||
15 | SEMI@[13; 14) | ||
16 | WHITESPACE@[14; 15) | ||
17 | TYPE_ITEM@[15; 36) | ||
18 | TYPE_KW@[15; 19) | ||
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) | ||
27 | WHITESPACE@[30; 31) | ||
28 | FN_KW@[31; 33) | ||
29 | PARAM_LIST@[33; 35) | ||
30 | L_PAREN@[33; 34) | ||
31 | R_PAREN@[34; 35) | ||
32 | SEMI@[35; 36) | ||
33 | WHITESPACE@[36; 37) | ||
34 | TYPE_ITEM@[37; 69) | ||
35 | TYPE_KW@[37; 41) | ||
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) | ||
44 | WHITESPACE@[52; 53) | ||
45 | ABI@[53; 63) | ||
46 | EXTERN_KW@[53; 59) | ||
47 | WHITESPACE@[59; 60) | ||
48 | STRING@[60; 63) | ||
49 | WHITESPACE@[63; 64) | ||
50 | FN_KW@[64; 66) | ||
51 | PARAM_LIST@[66; 68) | ||
52 | L_PAREN@[66; 67) | ||
53 | R_PAREN@[67; 68) | ||
54 | SEMI@[68; 69) | ||
55 | WHITESPACE@[69; 70) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0029_fn_pointer_type_missing_fn.rs b/crates/libsyntax2/tests/data/parser/inline/0029_fn_pointer_type_missing_fn.rs new file mode 100644 index 000000000..f014914ff --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0029_fn_pointer_type_missing_fn.rs | |||
@@ -0,0 +1 @@ | |||
type F = unsafe (); | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0029_fn_pointer_type_missing_fn.txt b/crates/libsyntax2/tests/data/parser/inline/0029_fn_pointer_type_missing_fn.txt new file mode 100644 index 000000000..ddec1b866 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0029_fn_pointer_type_missing_fn.txt | |||
@@ -0,0 +1,23 @@ | |||
1 | FILE@[0; 20) | ||
2 | TYPE_ITEM@[0; 15) | ||
3 | TYPE_KW@[0; 4) | ||
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) | ||
11 | err: `expected `fn`` | ||
12 | err: `expected SEMI` | ||
13 | WHITESPACE@[15; 16) | ||
14 | err: `expected an item` | ||
15 | ERROR@[16; 17) | ||
16 | L_PAREN@[16; 17) | ||
17 | err: `expected an item` | ||
18 | ERROR@[17; 18) | ||
19 | R_PAREN@[17; 18) | ||
20 | err: `expected an item` | ||
21 | ERROR@[18; 19) | ||
22 | SEMI@[18; 19) | ||
23 | WHITESPACE@[19; 20) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0030_fn_pointer_type_with_ret.rs b/crates/libsyntax2/tests/data/parser/inline/0030_fn_pointer_type_with_ret.rs new file mode 100644 index 000000000..e3ba5e87f --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0030_fn_pointer_type_with_ret.rs | |||
@@ -0,0 +1 @@ | |||
type F = fn() -> (); | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0030_fn_pointer_type_with_ret.txt b/crates/libsyntax2/tests/data/parser/inline/0030_fn_pointer_type_with_ret.txt new file mode 100644 index 000000000..447b1ed3f --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0030_fn_pointer_type_with_ret.txt | |||
@@ -0,0 +1,22 @@ | |||
1 | FILE@[0; 21) | ||
2 | TYPE_ITEM@[0; 20) | ||
3 | TYPE_KW@[0; 4) | ||
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) | ||
12 | PARAM_LIST@[11; 13) | ||
13 | L_PAREN@[11; 12) | ||
14 | R_PAREN@[12; 13) | ||
15 | WHITESPACE@[13; 14) | ||
16 | THIN_ARROW@[14; 16) | ||
17 | WHITESPACE@[16; 17) | ||
18 | TUPLE_TYPE@[17; 19) | ||
19 | L_PAREN@[17; 18) | ||
20 | R_PAREN@[18; 19) | ||
21 | SEMI@[19; 20) | ||
22 | WHITESPACE@[20; 21) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0031_for_type.rs b/crates/libsyntax2/tests/data/parser/inline/0031_for_type.rs new file mode 100644 index 000000000..4d6a18c6b --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0031_for_type.rs | |||
@@ -0,0 +1 @@ | |||
type A = for<'a> fn() -> (); | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0031_for_type.txt b/crates/libsyntax2/tests/data/parser/inline/0031_for_type.txt new file mode 100644 index 000000000..65753a702 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0031_for_type.txt | |||
@@ -0,0 +1,30 @@ | |||
1 | FILE@[0; 29) | ||
2 | TYPE_ITEM@[0; 28) | ||
3 | TYPE_KW@[0; 4) | ||
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) | ||
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) | ||
20 | PARAM_LIST@[19; 21) | ||
21 | L_PAREN@[19; 20) | ||
22 | R_PAREN@[20; 21) | ||
23 | WHITESPACE@[21; 22) | ||
24 | THIN_ARROW@[22; 24) | ||
25 | WHITESPACE@[24; 25) | ||
26 | TUPLE_TYPE@[25; 27) | ||
27 | L_PAREN@[25; 26) | ||
28 | R_PAREN@[26; 27) | ||
29 | SEMI@[27; 28) | ||
30 | WHITESPACE@[28; 29) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0032_path_type.rs b/crates/libsyntax2/tests/data/parser/inline/0032_path_type.rs new file mode 100644 index 000000000..bf94f32e1 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0032_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/libsyntax2/tests/data/parser/inline/0032_path_type.txt b/crates/libsyntax2/tests/data/parser/inline/0032_path_type.txt new file mode 100644 index 000000000..d9085118a --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0032_path_type.txt | |||
@@ -0,0 +1,70 @@ | |||
1 | FILE@[0; 71) | ||
2 | TYPE_ITEM@[0; 13) | ||
3 | TYPE_KW@[0; 4) | ||
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) | ||
17 | TYPE_ITEM@[14; 29) | ||
18 | TYPE_KW@[14; 18) | ||
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) | ||
33 | TYPE_ITEM@[30; 49) | ||
34 | TYPE_KW@[30; 34) | ||
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) | ||
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) | ||
52 | TYPE_ITEM@[50; 70) | ||
53 | TYPE_KW@[50; 54) | ||
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) | ||
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) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0034_bind_pat.rs b/crates/libsyntax2/tests/data/parser/inline/0034_bind_pat.rs new file mode 100644 index 000000000..820a9e72c --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0034_bind_pat.rs | |||
@@ -0,0 +1,8 @@ | |||
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 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0034_bind_pat.txt b/crates/libsyntax2/tests/data/parser/inline/0034_bind_pat.txt new file mode 100644 index 000000000..e8e4e4c2b --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0034_bind_pat.txt | |||
@@ -0,0 +1,127 @@ | |||
1 | FILE@[0; 146) | ||
2 | FUNCTION@[0; 145) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 7) | ||
6 | IDENT@[3; 7) "main" | ||
7 | PARAM_LIST@[7; 9) | ||
8 | L_PAREN@[7; 8) | ||
9 | R_PAREN@[8; 9) | ||
10 | WHITESPACE@[9; 10) | ||
11 | BLOCK_EXPR@[10; 145) | ||
12 | L_CURLY@[10; 11) | ||
13 | WHITESPACE@[11; 16) | ||
14 | LET_STMT@[16; 27) | ||
15 | LET_KW@[16; 19) | ||
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) | ||
28 | LET_STMT@[32; 47) | ||
29 | LET_KW@[32; 35) | ||
30 | WHITESPACE@[35; 36) | ||
31 | BIND_PAT@[36; 41) | ||
32 | MUT_KW@[36; 39) | ||
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) | ||
44 | LET_STMT@[52; 67) | ||
45 | LET_KW@[52; 55) | ||
46 | WHITESPACE@[55; 56) | ||
47 | BIND_PAT@[56; 61) | ||
48 | REF_KW@[56; 59) | ||
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) | ||
60 | LET_STMT@[72; 91) | ||
61 | LET_KW@[72; 75) | ||
62 | WHITESPACE@[75; 76) | ||
63 | BIND_PAT@[76; 85) | ||
64 | REF_KW@[76; 79) | ||
65 | WHITESPACE@[79; 80) | ||
66 | MUT_KW@[80; 83) | ||
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) | ||
78 | LET_STMT@[96; 111) | ||
79 | LET_KW@[96; 99) | ||
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) | ||
97 | LET_STMT@[116; 143) | ||
98 | LET_KW@[116; 119) | ||
99 | WHITESPACE@[119; 120) | ||
100 | BIND_PAT@[120; 137) | ||
101 | REF_KW@[120; 123) | ||
102 | WHITESPACE@[123; 124) | ||
103 | MUT_KW@[124; 127) | ||
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; 144) | ||
126 | R_CURLY@[144; 145) | ||
127 | WHITESPACE@[145; 146) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0035_ref_pat.rs b/crates/libsyntax2/tests/data/parser/inline/0035_ref_pat.rs new file mode 100644 index 000000000..de41f5cae --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0035_ref_pat.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn main() { | ||
2 | let &a = (); | ||
3 | let &mut b = (); | ||
4 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0035_ref_pat.txt b/crates/libsyntax2/tests/data/parser/inline/0035_ref_pat.txt new file mode 100644 index 000000000..6fbffd8b7 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0035_ref_pat.txt | |||
@@ -0,0 +1,49 @@ | |||
1 | FILE@[0; 52) | ||
2 | FUNCTION@[0; 51) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 7) | ||
6 | IDENT@[3; 7) "main" | ||
7 | PARAM_LIST@[7; 9) | ||
8 | L_PAREN@[7; 8) | ||
9 | R_PAREN@[8; 9) | ||
10 | WHITESPACE@[9; 10) | ||
11 | BLOCK_EXPR@[10; 51) | ||
12 | L_CURLY@[10; 11) | ||
13 | WHITESPACE@[11; 16) | ||
14 | LET_STMT@[16; 28) | ||
15 | LET_KW@[16; 19) | ||
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) | ||
30 | LET_STMT@[33; 49) | ||
31 | LET_KW@[33; 36) | ||
32 | WHITESPACE@[36; 37) | ||
33 | REF_PAT@[37; 43) | ||
34 | AMP@[37; 38) | ||
35 | MUT_KW@[38; 41) | ||
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) | ||
48 | R_CURLY@[50; 51) | ||
49 | WHITESPACE@[51; 52) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0036_placeholder_pat.rs b/crates/libsyntax2/tests/data/parser/inline/0036_placeholder_pat.rs new file mode 100644 index 000000000..4d719c433 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0036_placeholder_pat.rs | |||
@@ -0,0 +1 @@ | |||
fn main() { let _ = (); } | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0036_placeholder_pat.txt b/crates/libsyntax2/tests/data/parser/inline/0036_placeholder_pat.txt new file mode 100644 index 000000000..8c63cdfae --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0036_placeholder_pat.txt | |||
@@ -0,0 +1,28 @@ | |||
1 | FILE@[0; 26) | ||
2 | FUNCTION@[0; 25) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 7) | ||
6 | IDENT@[3; 7) "main" | ||
7 | PARAM_LIST@[7; 9) | ||
8 | L_PAREN@[7; 8) | ||
9 | R_PAREN@[8; 9) | ||
10 | WHITESPACE@[9; 10) | ||
11 | BLOCK_EXPR@[10; 25) | ||
12 | L_CURLY@[10; 11) | ||
13 | WHITESPACE@[11; 12) | ||
14 | LET_STMT@[12; 23) | ||
15 | LET_KW@[12; 15) | ||
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) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0037_crate_visibility.rs b/crates/libsyntax2/tests/data/parser/inline/0037_crate_visibility.rs new file mode 100644 index 000000000..faeefde94 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0037_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/libsyntax2/tests/data/parser/inline/0037_crate_visibility.txt b/crates/libsyntax2/tests/data/parser/inline/0037_crate_visibility.txt new file mode 100644 index 000000000..113ac59e2 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0037_crate_visibility.txt | |||
@@ -0,0 +1,53 @@ | |||
1 | FILE@[0; 81) | ||
2 | STRUCT_ITEM@[0; 20) | ||
3 | VISIBILITY@[0; 10) | ||
4 | PUB_KW@[0; 3) | ||
5 | L_PAREN@[3; 4) | ||
6 | CRATE_KW@[4; 9) | ||
7 | R_PAREN@[9; 10) | ||
8 | WHITESPACE@[10; 11) | ||
9 | STRUCT_KW@[11; 17) | ||
10 | WHITESPACE@[17; 18) | ||
11 | NAME@[18; 19) | ||
12 | IDENT@[18; 19) "S" | ||
13 | SEMI@[19; 20) | ||
14 | WHITESPACE@[20; 21) | ||
15 | STRUCT_ITEM@[21; 40) | ||
16 | VISIBILITY@[21; 30) | ||
17 | PUB_KW@[21; 24) | ||
18 | L_PAREN@[24; 25) | ||
19 | SELF_KW@[25; 29) | ||
20 | R_PAREN@[29; 30) | ||
21 | WHITESPACE@[30; 31) | ||
22 | STRUCT_KW@[31; 37) | ||
23 | WHITESPACE@[37; 38) | ||
24 | NAME@[38; 39) | ||
25 | IDENT@[38; 39) "S" | ||
26 | SEMI@[39; 40) | ||
27 | WHITESPACE@[40; 41) | ||
28 | STRUCT_ITEM@[41; 60) | ||
29 | VISIBILITY@[41; 50) | ||
30 | PUB_KW@[41; 44) | ||
31 | L_PAREN@[44; 45) | ||
32 | SELF_KW@[45; 49) | ||
33 | R_PAREN@[49; 50) | ||
34 | WHITESPACE@[50; 51) | ||
35 | STRUCT_KW@[51; 57) | ||
36 | WHITESPACE@[57; 58) | ||
37 | NAME@[58; 59) | ||
38 | IDENT@[58; 59) "S" | ||
39 | SEMI@[59; 60) | ||
40 | WHITESPACE@[60; 61) | ||
41 | STRUCT_ITEM@[61; 80) | ||
42 | VISIBILITY@[61; 70) | ||
43 | PUB_KW@[61; 64) | ||
44 | L_PAREN@[64; 65) | ||
45 | SELF_KW@[65; 69) | ||
46 | R_PAREN@[69; 70) | ||
47 | WHITESPACE@[70; 71) | ||
48 | STRUCT_KW@[71; 77) | ||
49 | WHITESPACE@[77; 78) | ||
50 | NAME@[78; 79) | ||
51 | IDENT@[78; 79) "S" | ||
52 | SEMI@[79; 80) | ||
53 | WHITESPACE@[80; 81) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0038_function_ret_type.rs b/crates/libsyntax2/tests/data/parser/inline/0038_function_ret_type.rs new file mode 100644 index 000000000..d22d8cada --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0038_function_ret_type.rs | |||
@@ -0,0 +1,2 @@ | |||
1 | fn foo() {} | ||
2 | fn bar() -> () {} | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0038_function_ret_type.txt b/crates/libsyntax2/tests/data/parser/inline/0038_function_ret_type.txt new file mode 100644 index 000000000..58583eefe --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0038_function_ret_type.txt | |||
@@ -0,0 +1,33 @@ | |||
1 | FILE@[0; 30) | ||
2 | FUNCTION@[0; 11) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 11) | ||
12 | L_CURLY@[9; 10) | ||
13 | R_CURLY@[10; 11) | ||
14 | WHITESPACE@[11; 12) | ||
15 | FUNCTION@[12; 29) | ||
16 | FN_KW@[12; 14) | ||
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 | THIN_ARROW@[21; 23) | ||
25 | WHITESPACE@[23; 24) | ||
26 | TUPLE_TYPE@[24; 26) | ||
27 | L_PAREN@[24; 25) | ||
28 | R_PAREN@[25; 26) | ||
29 | WHITESPACE@[26; 27) | ||
30 | BLOCK_EXPR@[27; 29) | ||
31 | L_CURLY@[27; 28) | ||
32 | R_CURLY@[28; 29) | ||
33 | WHITESPACE@[29; 30) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0039_path_expr.rs b/crates/libsyntax2/tests/data/parser/inline/0039_path_expr.rs new file mode 100644 index 000000000..333ebabef --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0039_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/libsyntax2/tests/data/parser/inline/0039_path_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0039_path_expr.txt new file mode 100644 index 000000000..8b505774f --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0039_path_expr.txt | |||
@@ -0,0 +1,94 @@ | |||
1 | FILE@[0; 91) | ||
2 | FUNCTION@[0; 90) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 90) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | LET_STMT@[15; 25) | ||
15 | LET_KW@[15; 18) | ||
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) | ||
29 | LET_STMT@[30; 43) | ||
30 | LET_KW@[30; 33) | ||
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) | ||
49 | LET_STMT@[48; 65) | ||
50 | LET_KW@[48; 51) | ||
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) | ||
75 | LET_STMT@[70; 88) | ||
76 | LET_KW@[70; 73) | ||
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 | L_PAREN@[85; 86) | ||
90 | R_PAREN@[86; 87) | ||
91 | SEMI@[87; 88) | ||
92 | WHITESPACE@[88; 89) | ||
93 | R_CURLY@[89; 90) | ||
94 | WHITESPACE@[90; 91) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0040_expr_literals.rs b/crates/libsyntax2/tests/data/parser/inline/0040_expr_literals.rs new file mode 100644 index 000000000..2e11a5a6e --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0040_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/libsyntax2/tests/data/parser/inline/0040_expr_literals.txt b/crates/libsyntax2/tests/data/parser/inline/0040_expr_literals.txt new file mode 100644 index 000000000..192b62211 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0040_expr_literals.txt | |||
@@ -0,0 +1,135 @@ | |||
1 | FILE@[0; 189) | ||
2 | FUNCTION@[0; 188) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 188) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | LET_STMT@[15; 28) | ||
15 | LET_KW@[15; 18) | ||
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) | ||
24 | SEMI@[27; 28) | ||
25 | WHITESPACE@[28; 33) | ||
26 | LET_STMT@[33; 47) | ||
27 | LET_KW@[33; 36) | ||
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) | ||
36 | SEMI@[46; 47) | ||
37 | WHITESPACE@[47; 52) | ||
38 | LET_STMT@[52; 62) | ||
39 | LET_KW@[52; 55) | ||
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) | ||
50 | LET_STMT@[67; 79) | ||
51 | LET_KW@[67; 70) | ||
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) | ||
62 | LET_STMT@[84; 97) | ||
63 | LET_KW@[84; 87) | ||
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) | ||
72 | SEMI@[96; 97) | ||
73 | WHITESPACE@[97; 102) | ||
74 | LET_STMT@[102; 114) | ||
75 | LET_KW@[102; 105) | ||
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) | ||
84 | SEMI@[113; 114) | ||
85 | WHITESPACE@[114; 119) | ||
86 | LET_STMT@[119; 131) | ||
87 | LET_KW@[119; 122) | ||
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) | ||
96 | SEMI@[130; 131) | ||
97 | WHITESPACE@[131; 136) | ||
98 | LET_STMT@[136; 149) | ||
99 | LET_KW@[136; 139) | ||
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) | ||
108 | SEMI@[148; 149) | ||
109 | WHITESPACE@[149; 154) | ||
110 | LET_STMT@[154; 167) | ||
111 | LET_KW@[154; 157) | ||
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) | ||
120 | SEMI@[166; 167) | ||
121 | WHITESPACE@[167; 172) | ||
122 | LET_STMT@[172; 186) | ||
123 | LET_KW@[172; 175) | ||
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) | ||
132 | SEMI@[185; 186) | ||
133 | WHITESPACE@[186; 187) | ||
134 | R_CURLY@[187; 188) | ||
135 | WHITESPACE@[188; 189) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0041_type_param_bounds.rs b/crates/libsyntax2/tests/data/parser/inline/0041_type_param_bounds.rs new file mode 100644 index 000000000..919bde0ee --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0041_type_param_bounds.rs | |||
@@ -0,0 +1 @@ | |||
struct S<T: 'a + ?Sized + (Copy)>; | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0041_type_param_bounds.txt b/crates/libsyntax2/tests/data/parser/inline/0041_type_param_bounds.txt new file mode 100644 index 000000000..4996d6ace --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0041_type_param_bounds.txt | |||
@@ -0,0 +1,34 @@ | |||
1 | FILE@[0; 35) | ||
2 | STRUCT_ITEM@[0; 34) | ||
3 | STRUCT_KW@[0; 6) | ||
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 | LIFETIME@[12; 14) "'a" | ||
15 | WHITESPACE@[14; 15) | ||
16 | PLUS@[15; 16) | ||
17 | WHITESPACE@[16; 17) | ||
18 | QUESTION@[17; 18) | ||
19 | PATH@[18; 23) | ||
20 | PATH_SEGMENT@[18; 23) | ||
21 | NAME_REF@[18; 23) | ||
22 | IDENT@[18; 23) "Sized" | ||
23 | WHITESPACE@[23; 24) | ||
24 | PLUS@[24; 25) | ||
25 | WHITESPACE@[25; 26) | ||
26 | L_PAREN@[26; 27) | ||
27 | PATH@[27; 31) | ||
28 | PATH_SEGMENT@[27; 31) | ||
29 | NAME_REF@[27; 31) | ||
30 | IDENT@[27; 31) "Copy" | ||
31 | R_PAREN@[31; 32) | ||
32 | R_ANGLE@[32; 33) | ||
33 | SEMI@[33; 34) | ||
34 | WHITESPACE@[34; 35) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0042_type_param_default.rs b/crates/libsyntax2/tests/data/parser/inline/0042_type_param_default.rs new file mode 100644 index 000000000..540eacb02 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0042_type_param_default.rs | |||
@@ -0,0 +1 @@ | |||
struct S<T = i32>; | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0042_type_param_default.txt b/crates/libsyntax2/tests/data/parser/inline/0042_type_param_default.txt new file mode 100644 index 000000000..ec875e9a2 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0042_type_param_default.txt | |||
@@ -0,0 +1,22 @@ | |||
1 | FILE@[0; 19) | ||
2 | STRUCT_ITEM@[0; 18) | ||
3 | STRUCT_KW@[0; 6) | ||
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) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0043_call_expr.rs b/crates/libsyntax2/tests/data/parser/inline/0043_call_expr.rs new file mode 100644 index 000000000..0c9a20718 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0043_call_expr.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn foo() { | ||
2 | let _ = f(); | ||
3 | let _ = f()(1)(1, 2,); | ||
4 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0043_call_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0043_call_expr.txt new file mode 100644 index 000000000..f4789d2d9 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0043_call_expr.txt | |||
@@ -0,0 +1,70 @@ | |||
1 | FILE@[0; 57) | ||
2 | FUNCTION@[0; 56) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 56) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | LET_STMT@[15; 27) | ||
15 | LET_KW@[15; 18) | ||
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) | ||
33 | LET_STMT@[32; 54) | ||
34 | LET_KW@[32; 35) | ||
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; 55) | ||
69 | R_CURLY@[55; 56) | ||
70 | WHITESPACE@[56; 57) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0044_ref_expr.rs b/crates/libsyntax2/tests/data/parser/inline/0044_ref_expr.rs new file mode 100644 index 000000000..2dac6be95 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0044_ref_expr.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn foo() { | ||
2 | let _ = &1; | ||
3 | let _ = &mut &f(); | ||
4 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0044_ref_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0044_ref_expr.txt new file mode 100644 index 000000000..05f6c015a --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0044_ref_expr.txt | |||
@@ -0,0 +1,54 @@ | |||
1 | FILE@[0; 52) | ||
2 | FUNCTION@[0; 51) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 51) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | LET_STMT@[15; 26) | ||
15 | LET_KW@[15; 18) | ||
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) | ||
28 | LET_STMT@[31; 49) | ||
29 | LET_KW@[31; 34) | ||
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) | ||
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) | ||
53 | R_CURLY@[50; 51) | ||
54 | WHITESPACE@[51; 52) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0045_block.rs b/crates/libsyntax2/tests/data/parser/inline/0045_block.rs new file mode 100644 index 000000000..81f44c533 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0045_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/libsyntax2/tests/data/parser/inline/0045_block.txt b/crates/libsyntax2/tests/data/parser/inline/0045_block.txt new file mode 100644 index 000000000..8519101c3 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0045_block.txt | |||
@@ -0,0 +1,86 @@ | |||
1 | FILE@[0; 65) | ||
2 | FUNCTION@[0; 9) | ||
3 | FN_KW@[0; 2) | ||
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_EXPR@[7; 9) | ||
12 | L_CURLY@[7; 8) | ||
13 | R_CURLY@[8; 9) | ||
14 | WHITESPACE@[9; 10) | ||
15 | FUNCTION@[10; 31) | ||
16 | FN_KW@[10; 12) | ||
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_EXPR@[17; 31) | ||
25 | L_CURLY@[17; 18) | ||
26 | WHITESPACE@[18; 19) | ||
27 | LET_STMT@[19; 29) | ||
28 | LET_KW@[19; 22) | ||
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) | ||
41 | FUNCTION@[32; 48) | ||
42 | FN_KW@[32; 34) | ||
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_EXPR@[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) | ||
65 | FUNCTION@[49; 64) | ||
66 | FN_KW@[49; 51) | ||
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_EXPR@[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) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0046_default_impl.rs b/crates/libsyntax2/tests/data/parser/inline/0046_default_impl.rs new file mode 100644 index 000000000..ef6aa84a2 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0046_default_impl.rs | |||
@@ -0,0 +1 @@ | |||
default impl Foo {} | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0046_default_impl.txt b/crates/libsyntax2/tests/data/parser/inline/0046_default_impl.txt new file mode 100644 index 000000000..d5a27baf7 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0046_default_impl.txt | |||
@@ -0,0 +1,15 @@ | |||
1 | FILE@[0; 20) | ||
2 | IMPL_ITEM@[0; 19) | ||
3 | DEFAULT_KW@[0; 7) | ||
4 | WHITESPACE@[7; 8) | ||
5 | IMPL_KW@[8; 12) | ||
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 | L_CURLY@[17; 18) | ||
14 | R_CURLY@[18; 19) | ||
15 | WHITESPACE@[19; 20) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0047_impl_item.rs b/crates/libsyntax2/tests/data/parser/inline/0047_impl_item.rs new file mode 100644 index 000000000..d6337f6b3 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0047_impl_item.rs | |||
@@ -0,0 +1 @@ | |||
impl Foo {} | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0047_impl_item.txt b/crates/libsyntax2/tests/data/parser/inline/0047_impl_item.txt new file mode 100644 index 000000000..76b29f95d --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0047_impl_item.txt | |||
@@ -0,0 +1,13 @@ | |||
1 | FILE@[0; 12) | ||
2 | IMPL_ITEM@[0; 11) | ||
3 | IMPL_KW@[0; 4) | ||
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 | L_CURLY@[9; 10) | ||
12 | R_CURLY@[10; 11) | ||
13 | WHITESPACE@[11; 12) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0048_impl_item_neg.rs b/crates/libsyntax2/tests/data/parser/inline/0048_impl_item_neg.rs new file mode 100644 index 000000000..b7527c870 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0048_impl_item_neg.rs | |||
@@ -0,0 +1 @@ | |||
impl !Send for X {} | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0048_impl_item_neg.txt b/crates/libsyntax2/tests/data/parser/inline/0048_impl_item_neg.txt new file mode 100644 index 000000000..2d01419c0 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0048_impl_item_neg.txt | |||
@@ -0,0 +1,22 @@ | |||
1 | FILE@[0; 20) | ||
2 | IMPL_ITEM@[0; 19) | ||
3 | IMPL_KW@[0; 4) | ||
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) | ||
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 | L_CURLY@[17; 18) | ||
21 | R_CURLY@[18; 19) | ||
22 | WHITESPACE@[19; 20) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0050_let_stmt;.rs b/crates/libsyntax2/tests/data/parser/inline/0050_let_stmt;.rs new file mode 100644 index 000000000..0a9af907f --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0050_let_stmt;.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | fn foo() { | ||
2 | let a; | ||
3 | let b: i32; | ||
4 | let c = 92; | ||
5 | let d: i32 = 92; | ||
6 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0050_let_stmt;.txt b/crates/libsyntax2/tests/data/parser/inline/0050_let_stmt;.txt new file mode 100644 index 000000000..44e357092 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0050_let_stmt;.txt | |||
@@ -0,0 +1,71 @@ | |||
1 | FILE@[0; 77) | ||
2 | FUNCTION@[0; 76) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 76) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | LET_STMT@[15; 21) | ||
15 | LET_KW@[15; 18) | ||
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) | ||
22 | LET_STMT@[26; 37) | ||
23 | LET_KW@[26; 29) | ||
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) | ||
37 | LET_STMT@[42; 53) | ||
38 | LET_KW@[42; 45) | ||
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) | ||
50 | LET_STMT@[58; 74) | ||
51 | LET_KW@[58; 61) | ||
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; 75) | ||
70 | R_CURLY@[75; 76) | ||
71 | WHITESPACE@[76; 77) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0051_method_call_expr.rs b/crates/libsyntax2/tests/data/parser/inline/0051_method_call_expr.rs new file mode 100644 index 000000000..1a3aa35ae --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0051_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/libsyntax2/tests/data/parser/inline/0051_method_call_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0051_method_call_expr.txt new file mode 100644 index 000000000..aafb2d5f1 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0051_method_call_expr.txt | |||
@@ -0,0 +1,62 @@ | |||
1 | FILE@[0; 49) | ||
2 | FUNCTION@[0; 48) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 48) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
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) | ||
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) | ||
61 | R_CURLY@[47; 48) | ||
62 | WHITESPACE@[48; 49) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0052_field_expr.rs b/crates/libsyntax2/tests/data/parser/inline/0052_field_expr.rs new file mode 100644 index 000000000..3e69538e5 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0052_field_expr.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn foo() { | ||
2 | x.foo; | ||
3 | x.0.bar; | ||
4 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0052_field_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0052_field_expr.txt new file mode 100644 index 000000000..213884f90 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0052_field_expr.txt | |||
@@ -0,0 +1,42 @@ | |||
1 | FILE@[0; 37) | ||
2 | FUNCTION@[0; 36) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 36) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
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) | ||
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; 35) | ||
41 | R_CURLY@[35; 36) | ||
42 | WHITESPACE@[36; 37) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0053_block_items.rs b/crates/libsyntax2/tests/data/parser/inline/0053_block_items.rs new file mode 100644 index 000000000..d9868718c --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0053_block_items.rs | |||
@@ -0,0 +1 @@ | |||
fn a() { fn b() {} } | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0053_block_items.txt b/crates/libsyntax2/tests/data/parser/inline/0053_block_items.txt new file mode 100644 index 000000000..c5498532b --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0053_block_items.txt | |||
@@ -0,0 +1,28 @@ | |||
1 | FILE@[0; 21) | ||
2 | FUNCTION@[0; 20) | ||
3 | FN_KW@[0; 2) | ||
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_EXPR@[7; 20) | ||
12 | L_CURLY@[7; 8) | ||
13 | WHITESPACE@[8; 9) | ||
14 | FUNCTION@[9; 18) | ||
15 | FN_KW@[9; 11) | ||
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_EXPR@[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) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0054_impl_item_items.rs b/crates/libsyntax2/tests/data/parser/inline/0054_impl_item_items.rs new file mode 100644 index 000000000..f10851487 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0054_impl_item_items.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/libsyntax2/tests/data/parser/inline/0054_impl_item_items.txt b/crates/libsyntax2/tests/data/parser/inline/0054_impl_item_items.txt new file mode 100644 index 000000000..739ecbbcd --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0054_impl_item_items.txt | |||
@@ -0,0 +1,77 @@ | |||
1 | FILE@[0; 89) | ||
2 | IMPL_ITEM@[0; 88) | ||
3 | IMPL_KW@[0; 4) | ||
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 | L_CURLY@[7; 8) | ||
12 | WHITESPACE@[8; 13) | ||
13 | TYPE_ITEM@[13; 26) | ||
14 | TYPE_KW@[13; 17) | ||
15 | WHITESPACE@[17; 18) | ||
16 | NAME@[18; 19) | ||
17 | IDENT@[18; 19) "A" | ||
18 | WHITESPACE@[19; 20) | ||
19 | EQ@[20; 21) | ||
20 | WHITESPACE@[21; 22) | ||
21 | PATH_TYPE@[22; 25) | ||
22 | PATH@[22; 25) | ||
23 | PATH_SEGMENT@[22; 25) | ||
24 | NAME_REF@[22; 25) | ||
25 | IDENT@[22; 25) "i32" | ||
26 | SEMI@[25; 26) | ||
27 | WHITESPACE@[26; 31) | ||
28 | CONST_ITEM@[31; 49) | ||
29 | CONST_KW@[31; 36) | ||
30 | WHITESPACE@[36; 37) | ||
31 | NAME@[37; 38) | ||
32 | IDENT@[37; 38) "B" | ||
33 | COLON@[38; 39) | ||
34 | WHITESPACE@[39; 40) | ||
35 | PATH_TYPE@[40; 43) | ||
36 | PATH@[40; 43) | ||
37 | PATH_SEGMENT@[40; 43) | ||
38 | NAME_REF@[40; 43) | ||
39 | IDENT@[40; 43) "i32" | ||
40 | WHITESPACE@[43; 44) | ||
41 | EQ@[44; 45) | ||
42 | WHITESPACE@[45; 46) | ||
43 | LITERAL@[46; 48) | ||
44 | INT_NUMBER@[46; 48) "92" | ||
45 | SEMI@[48; 49) | ||
46 | WHITESPACE@[49; 54) | ||
47 | FUNCTION@[54; 65) | ||
48 | FN_KW@[54; 56) | ||
49 | WHITESPACE@[56; 57) | ||
50 | NAME@[57; 60) | ||
51 | IDENT@[57; 60) "foo" | ||
52 | PARAM_LIST@[60; 62) | ||
53 | L_PAREN@[60; 61) | ||
54 | R_PAREN@[61; 62) | ||
55 | WHITESPACE@[62; 63) | ||
56 | BLOCK_EXPR@[63; 65) | ||
57 | L_CURLY@[63; 64) | ||
58 | R_CURLY@[64; 65) | ||
59 | WHITESPACE@[65; 70) | ||
60 | FUNCTION@[70; 86) | ||
61 | FN_KW@[70; 72) | ||
62 | WHITESPACE@[72; 73) | ||
63 | NAME@[73; 76) | ||
64 | IDENT@[73; 76) "bar" | ||
65 | PARAM_LIST@[76; 83) | ||
66 | L_PAREN@[76; 77) | ||
67 | SELF_PARAM@[77; 82) | ||
68 | AMP@[77; 78) | ||
69 | SELF_KW@[78; 82) | ||
70 | R_PAREN@[82; 83) | ||
71 | WHITESPACE@[83; 84) | ||
72 | BLOCK_EXPR@[84; 86) | ||
73 | L_CURLY@[84; 85) | ||
74 | R_CURLY@[85; 86) | ||
75 | WHITESPACE@[86; 87) | ||
76 | R_CURLY@[87; 88) | ||
77 | WHITESPACE@[88; 89) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0055_self_param.rs b/crates/libsyntax2/tests/data/parser/inline/0055_self_param.rs new file mode 100644 index 000000000..7bb1ca50c --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0055_self_param.rs | |||
@@ -0,0 +1,6 @@ | |||
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 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0055_self_param.txt b/crates/libsyntax2/tests/data/parser/inline/0055_self_param.txt new file mode 100644 index 000000000..1275fb8b1 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0055_self_param.txt | |||
@@ -0,0 +1,98 @@ | |||
1 | FILE@[0; 106) | ||
2 | IMPL_ITEM@[0; 105) | ||
3 | IMPL_KW@[0; 4) | ||
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 | L_CURLY@[7; 8) | ||
12 | WHITESPACE@[8; 13) | ||
13 | FUNCTION@[13; 26) | ||
14 | FN_KW@[13; 15) | ||
15 | WHITESPACE@[15; 16) | ||
16 | NAME@[16; 17) | ||
17 | IDENT@[16; 17) "a" | ||
18 | PARAM_LIST@[17; 23) | ||
19 | L_PAREN@[17; 18) | ||
20 | SELF_PARAM@[18; 22) | ||
21 | SELF_KW@[18; 22) | ||
22 | R_PAREN@[22; 23) | ||
23 | WHITESPACE@[23; 24) | ||
24 | BLOCK_EXPR@[24; 26) | ||
25 | L_CURLY@[24; 25) | ||
26 | R_CURLY@[25; 26) | ||
27 | WHITESPACE@[26; 31) | ||
28 | FUNCTION@[31; 46) | ||
29 | FN_KW@[31; 33) | ||
30 | WHITESPACE@[33; 34) | ||
31 | NAME@[34; 35) | ||
32 | IDENT@[34; 35) "b" | ||
33 | PARAM_LIST@[35; 43) | ||
34 | L_PAREN@[35; 36) | ||
35 | SELF_PARAM@[36; 41) | ||
36 | AMP@[36; 37) | ||
37 | SELF_KW@[37; 41) | ||
38 | COMMA@[41; 42) | ||
39 | R_PAREN@[42; 43) | ||
40 | WHITESPACE@[43; 44) | ||
41 | BLOCK_EXPR@[44; 46) | ||
42 | L_CURLY@[44; 45) | ||
43 | R_CURLY@[45; 46) | ||
44 | WHITESPACE@[46; 51) | ||
45 | FUNCTION@[51; 69) | ||
46 | FN_KW@[51; 53) | ||
47 | WHITESPACE@[53; 54) | ||
48 | NAME@[54; 55) | ||
49 | IDENT@[54; 55) "c" | ||
50 | PARAM_LIST@[55; 66) | ||
51 | L_PAREN@[55; 56) | ||
52 | SELF_PARAM@[56; 64) | ||
53 | AMP@[56; 57) | ||
54 | LIFETIME@[57; 59) "'a" | ||
55 | WHITESPACE@[59; 60) | ||
56 | SELF_KW@[60; 64) | ||
57 | COMMA@[64; 65) | ||
58 | R_PAREN@[65; 66) | ||
59 | WHITESPACE@[66; 67) | ||
60 | BLOCK_EXPR@[67; 69) | ||
61 | L_CURLY@[67; 68) | ||
62 | R_CURLY@[68; 69) | ||
63 | WHITESPACE@[69; 74) | ||
64 | FUNCTION@[74; 103) | ||
65 | FN_KW@[74; 76) | ||
66 | WHITESPACE@[76; 77) | ||
67 | NAME@[77; 78) | ||
68 | IDENT@[77; 78) "d" | ||
69 | PARAM_LIST@[78; 100) | ||
70 | L_PAREN@[78; 79) | ||
71 | SELF_PARAM@[79; 91) | ||
72 | AMP@[79; 80) | ||
73 | LIFETIME@[80; 82) "'a" | ||
74 | WHITESPACE@[82; 83) | ||
75 | MUT_KW@[83; 86) | ||
76 | WHITESPACE@[86; 87) | ||
77 | SELF_KW@[87; 91) | ||
78 | COMMA@[91; 92) | ||
79 | WHITESPACE@[92; 93) | ||
80 | PARAM@[93; 99) | ||
81 | BIND_PAT@[93; 94) | ||
82 | NAME@[93; 94) | ||
83 | IDENT@[93; 94) "x" | ||
84 | COLON@[94; 95) | ||
85 | WHITESPACE@[95; 96) | ||
86 | PATH_TYPE@[96; 99) | ||
87 | PATH@[96; 99) | ||
88 | PATH_SEGMENT@[96; 99) | ||
89 | NAME_REF@[96; 99) | ||
90 | IDENT@[96; 99) "i32" | ||
91 | R_PAREN@[99; 100) | ||
92 | WHITESPACE@[100; 101) | ||
93 | BLOCK_EXPR@[101; 103) | ||
94 | L_CURLY@[101; 102) | ||
95 | R_CURLY@[102; 103) | ||
96 | WHITESPACE@[103; 104) | ||
97 | R_CURLY@[104; 105) | ||
98 | WHITESPACE@[105; 106) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0056_trait_item.rs b/crates/libsyntax2/tests/data/parser/inline/0056_trait_item.rs new file mode 100644 index 000000000..4385afca9 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0056_trait_item.rs | |||
@@ -0,0 +1 @@ | |||
trait T<U>: Hash + Clone where U: Copy {} | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0056_trait_item.txt b/crates/libsyntax2/tests/data/parser/inline/0056_trait_item.txt new file mode 100644 index 000000000..ba4e0ebc8 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0056_trait_item.txt | |||
@@ -0,0 +1,45 @@ | |||
1 | FILE@[0; 42) | ||
2 | TRAIT_ITEM@[0; 41) | ||
3 | TRAIT_KW@[0; 5) | ||
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 | PATH@[12; 16) | ||
16 | PATH_SEGMENT@[12; 16) | ||
17 | NAME_REF@[12; 16) | ||
18 | IDENT@[12; 16) "Hash" | ||
19 | WHITESPACE@[16; 17) | ||
20 | PLUS@[17; 18) | ||
21 | WHITESPACE@[18; 19) | ||
22 | PATH@[19; 24) | ||
23 | PATH_SEGMENT@[19; 24) | ||
24 | NAME_REF@[19; 24) | ||
25 | IDENT@[19; 24) "Clone" | ||
26 | WHITESPACE@[24; 25) | ||
27 | WHERE_CLAUSE@[25; 38) | ||
28 | WHERE_KW@[25; 30) | ||
29 | WHITESPACE@[30; 31) | ||
30 | WHERE_PRED@[31; 38) | ||
31 | PATH_TYPE@[31; 32) | ||
32 | PATH@[31; 32) | ||
33 | PATH_SEGMENT@[31; 32) | ||
34 | NAME_REF@[31; 32) | ||
35 | IDENT@[31; 32) "U" | ||
36 | COLON@[32; 33) | ||
37 | WHITESPACE@[33; 34) | ||
38 | PATH@[34; 38) | ||
39 | PATH_SEGMENT@[34; 38) | ||
40 | NAME_REF@[34; 38) | ||
41 | IDENT@[34; 38) "Copy" | ||
42 | WHITESPACE@[38; 39) | ||
43 | L_CURLY@[39; 40) | ||
44 | R_CURLY@[40; 41) | ||
45 | WHITESPACE@[41; 42) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0057_auto_trait.rs b/crates/libsyntax2/tests/data/parser/inline/0057_auto_trait.rs new file mode 100644 index 000000000..72adf6035 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0057_auto_trait.rs | |||
@@ -0,0 +1 @@ | |||
auto trait T {} | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0057_auto_trait.txt b/crates/libsyntax2/tests/data/parser/inline/0057_auto_trait.txt new file mode 100644 index 000000000..6bb4ffdba --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0057_auto_trait.txt | |||
@@ -0,0 +1,12 @@ | |||
1 | FILE@[0; 16) | ||
2 | TRAIT_ITEM@[0; 15) | ||
3 | AUTO_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | TRAIT_KW@[5; 10) | ||
6 | WHITESPACE@[10; 11) | ||
7 | NAME@[11; 12) | ||
8 | IDENT@[11; 12) "T" | ||
9 | WHITESPACE@[12; 13) | ||
10 | L_CURLY@[13; 14) | ||
11 | R_CURLY@[14; 15) | ||
12 | WHITESPACE@[15; 16) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0058_type_arg.rs b/crates/libsyntax2/tests/data/parser/inline/0058_type_arg.rs new file mode 100644 index 000000000..f0c8cc3a8 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0058_type_arg.rs | |||
@@ -0,0 +1 @@ | |||
type A = B<'static, i32, Item=u64> | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0058_type_arg.txt b/crates/libsyntax2/tests/data/parser/inline/0058_type_arg.txt new file mode 100644 index 000000000..f69ce4738 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0058_type_arg.txt | |||
@@ -0,0 +1,40 @@ | |||
1 | FILE@[0; 35) | ||
2 | TYPE_ITEM@[0; 34) | ||
3 | TYPE_KW@[0; 4) | ||
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 | err: `expected SEMI` | ||
40 | WHITESPACE@[34; 35) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0059_function_where_clause.rs b/crates/libsyntax2/tests/data/parser/inline/0059_function_where_clause.rs new file mode 100644 index 000000000..f0920b2a8 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0059_function_where_clause.rs | |||
@@ -0,0 +1 @@ | |||
fn foo<T>() where T: Copy {} | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0059_function_where_clause.txt b/crates/libsyntax2/tests/data/parser/inline/0059_function_where_clause.txt new file mode 100644 index 000000000..065b0fd21 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0059_function_where_clause.txt | |||
@@ -0,0 +1,36 @@ | |||
1 | FILE@[0; 29) | ||
2 | FUNCTION@[0; 28) | ||
3 | FN_KW@[0; 2) | ||
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) | ||
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 | PATH@[21; 25) | ||
29 | PATH_SEGMENT@[21; 25) | ||
30 | NAME_REF@[21; 25) | ||
31 | IDENT@[21; 25) "Copy" | ||
32 | WHITESPACE@[25; 26) | ||
33 | BLOCK_EXPR@[26; 28) | ||
34 | L_CURLY@[26; 27) | ||
35 | R_CURLY@[27; 28) | ||
36 | WHITESPACE@[28; 29) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0060_function_type_params.rs b/crates/libsyntax2/tests/data/parser/inline/0060_function_type_params.rs new file mode 100644 index 000000000..9df40ed39 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0060_function_type_params.rs | |||
@@ -0,0 +1 @@ | |||
fn foo<T: Clone + Copy>(){} | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0060_function_type_params.txt b/crates/libsyntax2/tests/data/parser/inline/0060_function_type_params.txt new file mode 100644 index 000000000..8809ebc04 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0060_function_type_params.txt | |||
@@ -0,0 +1,32 @@ | |||
1 | FILE@[0; 28) | ||
2 | FUNCTION@[0; 27) | ||
3 | FN_KW@[0; 2) | ||
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 | PATH@[10; 15) | ||
15 | PATH_SEGMENT@[10; 15) | ||
16 | NAME_REF@[10; 15) | ||
17 | IDENT@[10; 15) "Clone" | ||
18 | WHITESPACE@[15; 16) | ||
19 | PLUS@[16; 17) | ||
20 | WHITESPACE@[17; 18) | ||
21 | PATH@[18; 22) | ||
22 | PATH_SEGMENT@[18; 22) | ||
23 | NAME_REF@[18; 22) | ||
24 | IDENT@[18; 22) "Copy" | ||
25 | R_ANGLE@[22; 23) | ||
26 | PARAM_LIST@[23; 25) | ||
27 | L_PAREN@[23; 24) | ||
28 | R_PAREN@[24; 25) | ||
29 | BLOCK_EXPR@[25; 27) | ||
30 | L_CURLY@[25; 26) | ||
31 | R_CURLY@[26; 27) | ||
32 | WHITESPACE@[27; 28) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0061_struct_lit.rs b/crates/libsyntax2/tests/data/parser/inline/0061_struct_lit.rs new file mode 100644 index 000000000..eb711f68a --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/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/libsyntax2/tests/data/parser/inline/0061_struct_lit.txt b/crates/libsyntax2/tests/data/parser/inline/0061_struct_lit.txt new file mode 100644 index 000000000..1d048c5ba --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0061_struct_lit.txt | |||
@@ -0,0 +1,94 @@ | |||
1 | FILE@[0; 86) | ||
2 | FUNCTION@[0; 85) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 85) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
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 | L_CURLY@[17; 18) | ||
22 | R_CURLY@[18; 19) | ||
23 | SEMI@[19; 20) | ||
24 | WHITESPACE@[20; 25) | ||
25 | EXPR_STMT@[25; 41) | ||
26 | STRUCT_LIT@[25; 40) | ||
27 | PATH@[25; 26) | ||
28 | PATH_SEGMENT@[25; 26) | ||
29 | NAME_REF@[25; 26) | ||
30 | IDENT@[25; 26) "S" | ||
31 | WHITESPACE@[26; 27) | ||
32 | L_CURLY@[27; 28) | ||
33 | WHITESPACE@[28; 29) | ||
34 | STRUCT_LIT_FIELD@[29; 30) | ||
35 | NAME_REF@[29; 30) | ||
36 | IDENT@[29; 30) "x" | ||
37 | COMMA@[30; 31) | ||
38 | WHITESPACE@[31; 32) | ||
39 | STRUCT_LIT_FIELD@[32; 37) | ||
40 | NAME_REF@[32; 33) | ||
41 | IDENT@[32; 33) "y" | ||
42 | COLON@[33; 34) | ||
43 | WHITESPACE@[34; 35) | ||
44 | LITERAL@[35; 37) | ||
45 | INT_NUMBER@[35; 37) "32" | ||
46 | COMMA@[37; 38) | ||
47 | WHITESPACE@[38; 39) | ||
48 | R_CURLY@[39; 40) | ||
49 | SEMI@[40; 41) | ||
50 | WHITESPACE@[41; 46) | ||
51 | EXPR_STMT@[46; 83) | ||
52 | STRUCT_LIT@[46; 82) | ||
53 | PATH@[46; 47) | ||
54 | PATH_SEGMENT@[46; 47) | ||
55 | NAME_REF@[46; 47) | ||
56 | IDENT@[46; 47) "S" | ||
57 | WHITESPACE@[47; 48) | ||
58 | L_CURLY@[48; 49) | ||
59 | WHITESPACE@[49; 50) | ||
60 | STRUCT_LIT_FIELD@[50; 51) | ||
61 | NAME_REF@[50; 51) | ||
62 | IDENT@[50; 51) "x" | ||
63 | COMMA@[51; 52) | ||
64 | WHITESPACE@[52; 53) | ||
65 | STRUCT_LIT_FIELD@[53; 58) | ||
66 | NAME_REF@[53; 54) | ||
67 | IDENT@[53; 54) "y" | ||
68 | COLON@[54; 55) | ||
69 | WHITESPACE@[55; 56) | ||
70 | LITERAL@[56; 58) | ||
71 | INT_NUMBER@[56; 58) "32" | ||
72 | COMMA@[58; 59) | ||
73 | WHITESPACE@[59; 60) | ||
74 | DOTDOT@[60; 62) | ||
75 | CALL_EXPR@[62; 80) | ||
76 | PATH_EXPR@[62; 78) | ||
77 | PATH@[62; 78) | ||
78 | PATH@[62; 69) | ||
79 | PATH_SEGMENT@[62; 69) | ||
80 | NAME_REF@[62; 69) | ||
81 | IDENT@[62; 69) "Default" | ||
82 | COLONCOLON@[69; 71) | ||
83 | PATH_SEGMENT@[71; 78) | ||
84 | NAME_REF@[71; 78) | ||
85 | IDENT@[71; 78) "default" | ||
86 | ARG_LIST@[78; 80) | ||
87 | L_PAREN@[78; 79) | ||
88 | R_PAREN@[79; 80) | ||
89 | WHITESPACE@[80; 81) | ||
90 | R_CURLY@[81; 82) | ||
91 | SEMI@[82; 83) | ||
92 | WHITESPACE@[83; 84) | ||
93 | R_CURLY@[84; 85) | ||
94 | WHITESPACE@[85; 86) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0063_impl_trait_type.rs b/crates/libsyntax2/tests/data/parser/inline/0063_impl_trait_type.rs new file mode 100644 index 000000000..54c5a7c46 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0063_impl_trait_type.rs | |||
@@ -0,0 +1 @@ | |||
type A = impl Iterator<Item=Foo<'a>> + 'a; | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0063_impl_trait_type.txt b/crates/libsyntax2/tests/data/parser/inline/0063_impl_trait_type.txt new file mode 100644 index 000000000..bbebf1086 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0063_impl_trait_type.txt | |||
@@ -0,0 +1,39 @@ | |||
1 | FILE@[0; 43) | ||
2 | TYPE_ITEM@[0; 42) | ||
3 | TYPE_KW@[0; 4) | ||
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) | ||
12 | WHITESPACE@[13; 14) | ||
13 | PATH@[14; 36) | ||
14 | PATH_SEGMENT@[14; 36) | ||
15 | NAME_REF@[14; 22) | ||
16 | IDENT@[14; 22) "Iterator" | ||
17 | TYPE_ARG_LIST@[22; 36) | ||
18 | L_ANGLE@[22; 23) | ||
19 | ASSOC_TYPE_ARG@[23; 35) | ||
20 | NAME_REF@[23; 27) | ||
21 | IDENT@[23; 27) "Item" | ||
22 | EQ@[27; 28) | ||
23 | PATH_TYPE@[28; 35) | ||
24 | PATH@[28; 35) | ||
25 | PATH_SEGMENT@[28; 35) | ||
26 | NAME_REF@[28; 31) | ||
27 | IDENT@[28; 31) "Foo" | ||
28 | TYPE_ARG_LIST@[31; 35) | ||
29 | L_ANGLE@[31; 32) | ||
30 | LIFETIME_ARG@[32; 34) | ||
31 | LIFETIME@[32; 34) "'a" | ||
32 | R_ANGLE@[34; 35) | ||
33 | R_ANGLE@[35; 36) | ||
34 | WHITESPACE@[36; 37) | ||
35 | PLUS@[37; 38) | ||
36 | WHITESPACE@[38; 39) | ||
37 | LIFETIME@[39; 41) "'a" | ||
38 | SEMI@[41; 42) | ||
39 | WHITESPACE@[42; 43) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0063_lambda_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0063_lambda_expr.txt new file mode 100644 index 000000000..122a99e52 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0063_lambda_expr.txt | |||
@@ -0,0 +1,91 @@ | |||
1 | FILE@[0; 74) | ||
2 | FUNCTION@[0; 74) | ||
3 | FN_KW@[0; 2) | ||
4 | NAME@[2; 6) | ||
5 | WHITESPACE@[2; 3) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 9) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 74) | ||
12 | L_CURLY@[9; 10) | ||
13 | EXPR_STMT@[10; 26) | ||
14 | LAMBDA_EXPR@[10; 20) | ||
15 | PARAM_LIST@[10; 18) | ||
16 | WHITESPACE@[10; 15) | ||
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) | ||
25 | EXPR_STMT@[26; 48) | ||
26 | LAMBDA_EXPR@[26; 42) | ||
27 | PARAM_LIST@[26; 29) | ||
28 | PIPE@[26; 27) | ||
29 | PIPE@[27; 28) | ||
30 | WHITESPACE@[28; 29) | ||
31 | THIN_ARROW@[29; 31) | ||
32 | PATH_TYPE@[31; 36) | ||
33 | PATH@[31; 36) | ||
34 | PATH_SEGMENT@[31; 36) | ||
35 | NAME_REF@[31; 36) | ||
36 | WHITESPACE@[31; 32) | ||
37 | IDENT@[32; 35) "i32" | ||
38 | WHITESPACE@[35; 36) | ||
39 | BLOCK_EXPR@[36; 42) | ||
40 | L_CURLY@[36; 37) | ||
41 | LITERAL@[37; 41) | ||
42 | WHITESPACE@[37; 38) | ||
43 | INT_NUMBER@[38; 40) "92" | ||
44 | WHITESPACE@[40; 41) | ||
45 | R_CURLY@[41; 42) | ||
46 | SEMI@[42; 43) | ||
47 | WHITESPACE@[43; 48) | ||
48 | EXPR_STMT@[48; 59) | ||
49 | LAMBDA_EXPR@[48; 53) | ||
50 | PARAM_LIST@[48; 52) | ||
51 | PIPE@[48; 49) | ||
52 | PARAM@[49; 50) | ||
53 | BIND_PAT@[49; 50) | ||
54 | NAME@[49; 50) | ||
55 | IDENT@[49; 50) "x" | ||
56 | PIPE@[50; 51) | ||
57 | WHITESPACE@[51; 52) | ||
58 | PATH_EXPR@[52; 53) | ||
59 | PATH@[52; 53) | ||
60 | PATH_SEGMENT@[52; 53) | ||
61 | NAME_REF@[52; 53) | ||
62 | IDENT@[52; 53) "x" | ||
63 | SEMI@[53; 54) | ||
64 | WHITESPACE@[54; 59) | ||
65 | EXPR_STMT@[59; 72) | ||
66 | LAMBDA_EXPR@[59; 70) | ||
67 | PARAM_LIST@[59; 69) | ||
68 | PIPE@[59; 60) | ||
69 | PARAM@[60; 66) | ||
70 | BIND_PAT@[60; 61) | ||
71 | NAME@[60; 61) | ||
72 | IDENT@[60; 61) "x" | ||
73 | COLON@[61; 62) | ||
74 | PATH_TYPE@[62; 66) | ||
75 | PATH@[62; 66) | ||
76 | PATH_SEGMENT@[62; 66) | ||
77 | NAME_REF@[62; 66) | ||
78 | WHITESPACE@[62; 63) | ||
79 | IDENT@[63; 66) "i32" | ||
80 | COMMA@[66; 67) | ||
81 | PIPE@[67; 68) | ||
82 | WHITESPACE@[68; 69) | ||
83 | PATH_EXPR@[69; 70) | ||
84 | PATH@[69; 70) | ||
85 | PATH_SEGMENT@[69; 70) | ||
86 | NAME_REF@[69; 70) | ||
87 | IDENT@[69; 70) "x" | ||
88 | SEMI@[70; 71) | ||
89 | WHITESPACE@[71; 72) | ||
90 | R_CURLY@[72; 73) | ||
91 | WHITESPACE@[73; 74) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0064_param_list.rs b/crates/libsyntax2/tests/data/parser/inline/0064_param_list.rs new file mode 100644 index 000000000..9d55bedbb --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0064_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/libsyntax2/tests/data/parser/inline/0064_param_list.txt b/crates/libsyntax2/tests/data/parser/inline/0064_param_list.txt new file mode 100644 index 000000000..14db495b9 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0064_param_list.txt | |||
@@ -0,0 +1,99 @@ | |||
1 | FILE@[0; 67) | ||
2 | FUNCTION@[0; 9) | ||
3 | FN_KW@[0; 2) | ||
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_EXPR@[7; 9) | ||
12 | L_CURLY@[7; 8) | ||
13 | R_CURLY@[8; 9) | ||
14 | WHITESPACE@[9; 10) | ||
15 | FUNCTION@[10; 25) | ||
16 | FN_KW@[10; 12) | ||
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_EXPR@[23; 25) | ||
36 | L_CURLY@[23; 24) | ||
37 | R_CURLY@[24; 25) | ||
38 | WHITESPACE@[25; 26) | ||
39 | FUNCTION@[26; 43) | ||
40 | FN_KW@[26; 28) | ||
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_EXPR@[41; 43) | ||
62 | L_CURLY@[41; 42) | ||
63 | R_CURLY@[42; 43) | ||
64 | WHITESPACE@[43; 44) | ||
65 | FUNCTION@[44; 66) | ||
66 | FN_KW@[44; 46) | ||
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_EXPR@[64; 66) | ||
97 | L_CURLY@[64; 65) | ||
98 | R_CURLY@[65; 66) | ||
99 | WHITESPACE@[66; 67) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0065_if_expr.rs b/crates/libsyntax2/tests/data/parser/inline/0065_if_expr.rs new file mode 100644 index 000000000..4b0d9af89 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0065_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/libsyntax2/tests/data/parser/inline/0065_if_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0065_if_expr.txt new file mode 100644 index 000000000..6ed53264a --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0065_if_expr.txt | |||
@@ -0,0 +1,90 @@ | |||
1 | FILE@[0; 107) | ||
2 | FUNCTION@[0; 106) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 106) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 26) | ||
15 | IF_EXPR@[15; 25) | ||
16 | IF_KW@[15; 17) | ||
17 | WHITESPACE@[17; 18) | ||
18 | LITERAL@[18; 22) | ||
19 | TRUE_KW@[18; 22) | ||
20 | WHITESPACE@[22; 23) | ||
21 | BLOCK_EXPR@[23; 25) | ||
22 | L_CURLY@[23; 24) | ||
23 | R_CURLY@[24; 25) | ||
24 | SEMI@[25; 26) | ||
25 | WHITESPACE@[26; 31) | ||
26 | EXPR_STMT@[31; 50) | ||
27 | IF_EXPR@[31; 49) | ||
28 | IF_KW@[31; 33) | ||
29 | WHITESPACE@[33; 34) | ||
30 | LITERAL@[34; 38) | ||
31 | TRUE_KW@[34; 38) | ||
32 | WHITESPACE@[38; 39) | ||
33 | BLOCK_EXPR@[39; 41) | ||
34 | L_CURLY@[39; 40) | ||
35 | R_CURLY@[40; 41) | ||
36 | WHITESPACE@[41; 42) | ||
37 | ELSE_KW@[42; 46) | ||
38 | WHITESPACE@[46; 47) | ||
39 | BLOCK_EXPR@[47; 49) | ||
40 | L_CURLY@[47; 48) | ||
41 | R_CURLY@[48; 49) | ||
42 | SEMI@[49; 50) | ||
43 | WHITESPACE@[50; 55) | ||
44 | EXPR_STMT@[55; 91) | ||
45 | IF_EXPR@[55; 90) | ||
46 | IF_KW@[55; 57) | ||
47 | WHITESPACE@[57; 58) | ||
48 | LITERAL@[58; 62) | ||
49 | TRUE_KW@[58; 62) | ||
50 | WHITESPACE@[62; 63) | ||
51 | BLOCK_EXPR@[63; 65) | ||
52 | L_CURLY@[63; 64) | ||
53 | R_CURLY@[64; 65) | ||
54 | WHITESPACE@[65; 66) | ||
55 | ELSE_KW@[66; 70) | ||
56 | WHITESPACE@[70; 71) | ||
57 | IF_EXPR@[71; 90) | ||
58 | IF_KW@[71; 73) | ||
59 | WHITESPACE@[73; 74) | ||
60 | LITERAL@[74; 79) | ||
61 | FALSE_KW@[74; 79) | ||
62 | WHITESPACE@[79; 80) | ||
63 | BLOCK_EXPR@[80; 82) | ||
64 | L_CURLY@[80; 81) | ||
65 | R_CURLY@[81; 82) | ||
66 | WHITESPACE@[82; 83) | ||
67 | ELSE_KW@[83; 87) | ||
68 | WHITESPACE@[87; 88) | ||
69 | BLOCK_EXPR@[88; 90) | ||
70 | L_CURLY@[88; 89) | ||
71 | R_CURLY@[89; 90) | ||
72 | SEMI@[90; 91) | ||
73 | WHITESPACE@[91; 96) | ||
74 | EXPR_STMT@[96; 104) | ||
75 | IF_EXPR@[96; 103) | ||
76 | IF_KW@[96; 98) | ||
77 | WHITESPACE@[98; 99) | ||
78 | PATH_EXPR@[99; 100) | ||
79 | PATH@[99; 100) | ||
80 | PATH_SEGMENT@[99; 100) | ||
81 | NAME_REF@[99; 100) | ||
82 | IDENT@[99; 100) "S" | ||
83 | WHITESPACE@[100; 101) | ||
84 | BLOCK_EXPR@[101; 103) | ||
85 | L_CURLY@[101; 102) | ||
86 | R_CURLY@[102; 103) | ||
87 | SEMI@[103; 104) | ||
88 | WHITESPACE@[104; 105) | ||
89 | R_CURLY@[105; 106) | ||
90 | WHITESPACE@[106; 107) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0066_lambda_expr.rs b/crates/libsyntax2/tests/data/parser/inline/0066_lambda_expr.rs new file mode 100644 index 000000000..c20d29751 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0066_lambda_expr.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | fn foo() { | ||
2 | || (); | ||
3 | || -> i32 { 92 }; | ||
4 | |x| x; | ||
5 | move |x: i32,| x; | ||
6 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0066_lambda_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0066_lambda_expr.txt new file mode 100644 index 000000000..6d9aeb331 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0066_lambda_expr.txt | |||
@@ -0,0 +1,93 @@ | |||
1 | FILE@[0; 79) | ||
2 | FUNCTION@[0; 78) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 78) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
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) | ||
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 | THIN_ARROW@[29; 31) | ||
32 | WHITESPACE@[31; 32) | ||
33 | PATH_TYPE@[32; 35) | ||
34 | PATH@[32; 35) | ||
35 | PATH_SEGMENT@[32; 35) | ||
36 | NAME_REF@[32; 35) | ||
37 | IDENT@[32; 35) "i32" | ||
38 | WHITESPACE@[35; 36) | ||
39 | BLOCK_EXPR@[36; 42) | ||
40 | L_CURLY@[36; 37) | ||
41 | WHITESPACE@[37; 38) | ||
42 | LITERAL@[38; 40) | ||
43 | INT_NUMBER@[38; 40) "92" | ||
44 | WHITESPACE@[40; 41) | ||
45 | R_CURLY@[41; 42) | ||
46 | SEMI@[42; 43) | ||
47 | WHITESPACE@[43; 48) | ||
48 | EXPR_STMT@[48; 54) | ||
49 | LAMBDA_EXPR@[48; 53) | ||
50 | PARAM_LIST@[48; 51) | ||
51 | PIPE@[48; 49) | ||
52 | PARAM@[49; 50) | ||
53 | BIND_PAT@[49; 50) | ||
54 | NAME@[49; 50) | ||
55 | IDENT@[49; 50) "x" | ||
56 | PIPE@[50; 51) | ||
57 | WHITESPACE@[51; 52) | ||
58 | PATH_EXPR@[52; 53) | ||
59 | PATH@[52; 53) | ||
60 | PATH_SEGMENT@[52; 53) | ||
61 | NAME_REF@[52; 53) | ||
62 | IDENT@[52; 53) "x" | ||
63 | SEMI@[53; 54) | ||
64 | WHITESPACE@[54; 59) | ||
65 | EXPR_STMT@[59; 76) | ||
66 | LAMBDA_EXPR@[59; 75) | ||
67 | MOVE_KW@[59; 63) | ||
68 | WHITESPACE@[63; 64) | ||
69 | PARAM_LIST@[64; 73) | ||
70 | PIPE@[64; 65) | ||
71 | PARAM@[65; 71) | ||
72 | BIND_PAT@[65; 66) | ||
73 | NAME@[65; 66) | ||
74 | IDENT@[65; 66) "x" | ||
75 | COLON@[66; 67) | ||
76 | WHITESPACE@[67; 68) | ||
77 | PATH_TYPE@[68; 71) | ||
78 | PATH@[68; 71) | ||
79 | PATH_SEGMENT@[68; 71) | ||
80 | NAME_REF@[68; 71) | ||
81 | IDENT@[68; 71) "i32" | ||
82 | COMMA@[71; 72) | ||
83 | PIPE@[72; 73) | ||
84 | WHITESPACE@[73; 74) | ||
85 | PATH_EXPR@[74; 75) | ||
86 | PATH@[74; 75) | ||
87 | PATH_SEGMENT@[74; 75) | ||
88 | NAME_REF@[74; 75) | ||
89 | IDENT@[74; 75) "x" | ||
90 | SEMI@[75; 76) | ||
91 | WHITESPACE@[76; 77) | ||
92 | R_CURLY@[77; 78) | ||
93 | WHITESPACE@[78; 79) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0067_block_expr.rs b/crates/libsyntax2/tests/data/parser/inline/0067_block_expr.rs new file mode 100644 index 000000000..ec3780a04 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0067_block_expr.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn foo() { | ||
2 | {}; | ||
3 | unsafe {}; | ||
4 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0067_block_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0067_block_expr.txt new file mode 100644 index 000000000..981f39e6e --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0067_block_expr.txt | |||
@@ -0,0 +1,29 @@ | |||
1 | FILE@[0; 36) | ||
2 | FUNCTION@[0; 35) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 35) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 18) | ||
15 | BLOCK_EXPR@[15; 17) | ||
16 | L_CURLY@[15; 16) | ||
17 | R_CURLY@[16; 17) | ||
18 | SEMI@[17; 18) | ||
19 | WHITESPACE@[18; 23) | ||
20 | EXPR_STMT@[23; 33) | ||
21 | BLOCK_EXPR@[23; 32) | ||
22 | UNSAFE_KW@[23; 29) | ||
23 | WHITESPACE@[29; 30) | ||
24 | L_CURLY@[30; 31) | ||
25 | R_CURLY@[31; 32) | ||
26 | SEMI@[32; 33) | ||
27 | WHITESPACE@[33; 34) | ||
28 | R_CURLY@[34; 35) | ||
29 | WHITESPACE@[35; 36) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0068_pub_expr.rs b/crates/libsyntax2/tests/data/parser/inline/0068_pub_expr.rs new file mode 100644 index 000000000..d9d99d2d3 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0068_pub_expr.rs | |||
@@ -0,0 +1 @@ | |||
fn foo() { pub 92; } //FIXME | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0068_pub_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0068_pub_expr.txt new file mode 100644 index 000000000..92e58938b --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0068_pub_expr.txt | |||
@@ -0,0 +1,25 @@ | |||
1 | FILE@[0; 29) | ||
2 | FUNCTION@[0; 20) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 20) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 11) | ||
14 | EXPR_STMT@[11; 18) | ||
15 | VISIBILITY@[11; 14) | ||
16 | PUB_KW@[11; 14) | ||
17 | WHITESPACE@[14; 15) | ||
18 | LITERAL@[15; 17) | ||
19 | INT_NUMBER@[15; 17) "92" | ||
20 | SEMI@[17; 18) | ||
21 | WHITESPACE@[18; 19) | ||
22 | R_CURLY@[19; 20) | ||
23 | WHITESPACE@[20; 21) | ||
24 | COMMENT@[21; 28) | ||
25 | WHITESPACE@[28; 29) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0068_return_expr.rs b/crates/libsyntax2/tests/data/parser/inline/0068_return_expr.rs new file mode 100644 index 000000000..5733666b6 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0068_return_expr.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn foo() { | ||
2 | return; | ||
3 | return 92; | ||
4 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0068_return_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0068_return_expr.txt new file mode 100644 index 000000000..4e4ec85b6 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0068_return_expr.txt | |||
@@ -0,0 +1,28 @@ | |||
1 | FILE@[0; 40) | ||
2 | FUNCTION@[0; 39) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 39) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 22) | ||
15 | RETURN_EXPR@[15; 21) | ||
16 | RETURN_KW@[15; 21) | ||
17 | SEMI@[21; 22) | ||
18 | WHITESPACE@[22; 27) | ||
19 | EXPR_STMT@[27; 37) | ||
20 | RETURN_EXPR@[27; 36) | ||
21 | RETURN_KW@[27; 33) | ||
22 | WHITESPACE@[33; 34) | ||
23 | LITERAL@[34; 36) | ||
24 | INT_NUMBER@[34; 36) "92" | ||
25 | SEMI@[36; 37) | ||
26 | WHITESPACE@[37; 38) | ||
27 | R_CURLY@[38; 39) | ||
28 | WHITESPACE@[39; 40) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0069_match_arm.rs b/crates/libsyntax2/tests/data/parser/inline/0069_match_arm.rs new file mode 100644 index 000000000..2c0e88414 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0069_match_arm.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | fn foo() { | ||
2 | match () { | ||
3 | _ => (), | ||
4 | X | Y if Z => (), | ||
5 | }; | ||
6 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0069_match_arm.txt b/crates/libsyntax2/tests/data/parser/inline/0069_match_arm.txt new file mode 100644 index 000000000..3377e8342 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0069_match_arm.txt | |||
@@ -0,0 +1,65 @@ | |||
1 | FILE@[0; 78) | ||
2 | FUNCTION@[0; 77) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 77) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 75) | ||
15 | MATCH_EXPR@[15; 74) | ||
16 | MATCH_KW@[15; 20) | ||
17 | WHITESPACE@[20; 21) | ||
18 | TUPLE_EXPR@[21; 23) | ||
19 | L_PAREN@[21; 22) | ||
20 | R_PAREN@[22; 23) | ||
21 | WHITESPACE@[23; 24) | ||
22 | L_CURLY@[24; 25) | ||
23 | WHITESPACE@[25; 34) | ||
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) | ||
35 | MATCH_ARM@[51; 67) | ||
36 | BIND_PAT@[51; 52) | ||
37 | NAME@[51; 52) | ||
38 | IDENT@[51; 52) "X" | ||
39 | WHITESPACE@[52; 53) | ||
40 | PIPE@[53; 54) | ||
41 | WHITESPACE@[54; 55) | ||
42 | BIND_PAT@[55; 56) | ||
43 | NAME@[55; 56) | ||
44 | IDENT@[55; 56) "Y" | ||
45 | WHITESPACE@[56; 57) | ||
46 | IF_KW@[57; 59) | ||
47 | WHITESPACE@[59; 60) | ||
48 | PATH_EXPR@[60; 61) | ||
49 | PATH@[60; 61) | ||
50 | PATH_SEGMENT@[60; 61) | ||
51 | NAME_REF@[60; 61) | ||
52 | IDENT@[60; 61) "Z" | ||
53 | WHITESPACE@[61; 62) | ||
54 | FAT_ARROW@[62; 64) | ||
55 | WHITESPACE@[64; 65) | ||
56 | TUPLE_EXPR@[65; 67) | ||
57 | L_PAREN@[65; 66) | ||
58 | R_PAREN@[66; 67) | ||
59 | COMMA@[67; 68) | ||
60 | WHITESPACE@[68; 73) | ||
61 | R_CURLY@[73; 74) | ||
62 | SEMI@[74; 75) | ||
63 | WHITESPACE@[75; 76) | ||
64 | R_CURLY@[76; 77) | ||
65 | WHITESPACE@[77; 78) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0070_match_expr.rs b/crates/libsyntax2/tests/data/parser/inline/0070_match_expr.rs new file mode 100644 index 000000000..c9205dfa3 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0070_match_expr.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn foo() { | ||
2 | match () { }; | ||
3 | match S {}; | ||
4 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0070_match_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0070_match_expr.txt new file mode 100644 index 000000000..f9ba54486 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0070_match_expr.txt | |||
@@ -0,0 +1,42 @@ | |||
1 | FILE@[0; 47) | ||
2 | FUNCTION@[0; 46) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 46) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 28) | ||
15 | MATCH_EXPR@[15; 27) | ||
16 | MATCH_KW@[15; 20) | ||
17 | WHITESPACE@[20; 21) | ||
18 | TUPLE_EXPR@[21; 23) | ||
19 | L_PAREN@[21; 22) | ||
20 | R_PAREN@[22; 23) | ||
21 | WHITESPACE@[23; 24) | ||
22 | L_CURLY@[24; 25) | ||
23 | WHITESPACE@[25; 26) | ||
24 | R_CURLY@[26; 27) | ||
25 | SEMI@[27; 28) | ||
26 | WHITESPACE@[28; 33) | ||
27 | EXPR_STMT@[33; 44) | ||
28 | MATCH_EXPR@[33; 43) | ||
29 | MATCH_KW@[33; 38) | ||
30 | WHITESPACE@[38; 39) | ||
31 | PATH_EXPR@[39; 40) | ||
32 | PATH@[39; 40) | ||
33 | PATH_SEGMENT@[39; 40) | ||
34 | NAME_REF@[39; 40) | ||
35 | IDENT@[39; 40) "S" | ||
36 | WHITESPACE@[40; 41) | ||
37 | L_CURLY@[41; 42) | ||
38 | R_CURLY@[42; 43) | ||
39 | SEMI@[43; 44) | ||
40 | WHITESPACE@[44; 45) | ||
41 | R_CURLY@[45; 46) | ||
42 | WHITESPACE@[46; 47) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0071_tuple_pat_fields.rs b/crates/libsyntax2/tests/data/parser/inline/0071_tuple_pat_fields.rs new file mode 100644 index 000000000..0dfe63629 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0071_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/libsyntax2/tests/data/parser/inline/0071_tuple_pat_fields.txt b/crates/libsyntax2/tests/data/parser/inline/0071_tuple_pat_fields.txt new file mode 100644 index 000000000..f54835277 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0071_tuple_pat_fields.txt | |||
@@ -0,0 +1,103 @@ | |||
1 | FILE@[0; 97) | ||
2 | FUNCTION@[0; 96) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 96) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | LET_STMT@[15; 28) | ||
15 | LET_KW@[15; 18) | ||
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) | ||
32 | LET_STMT@[33; 47) | ||
33 | LET_KW@[33; 36) | ||
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) | ||
52 | LET_STMT@[52; 67) | ||
53 | LET_KW@[52; 55) | ||
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) | ||
73 | LET_STMT@[72; 94) | ||
74 | LET_KW@[72; 75) | ||
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) | ||
102 | R_CURLY@[95; 96) | ||
103 | WHITESPACE@[96; 97) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0072_path_part.rs b/crates/libsyntax2/tests/data/parser/inline/0072_path_part.rs new file mode 100644 index 000000000..f6e32c7c1 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0072_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/libsyntax2/tests/data/parser/inline/0072_path_part.txt b/crates/libsyntax2/tests/data/parser/inline/0072_path_part.txt new file mode 100644 index 000000000..20da5de86 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0072_path_part.txt | |||
@@ -0,0 +1,94 @@ | |||
1 | FILE@[0; 103) | ||
2 | FUNCTION@[0; 102) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 102) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | LET_STMT@[15; 33) | ||
15 | LET_KW@[15; 18) | ||
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) | ||
35 | LET_STMT@[38; 53) | ||
36 | LET_KW@[38; 41) | ||
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) | ||
52 | LET_STMT@[58; 78) | ||
53 | LET_KW@[58; 61) | ||
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 | L_CURLY@[66; 67) | ||
62 | WHITESPACE@[67; 68) | ||
63 | DOTDOT@[68; 70) | ||
64 | WHITESPACE@[70; 71) | ||
65 | R_CURLY@[71; 72) | ||
66 | WHITESPACE@[72; 73) | ||
67 | EQ@[73; 74) | ||
68 | WHITESPACE@[74; 75) | ||
69 | TUPLE_EXPR@[75; 77) | ||
70 | L_PAREN@[75; 76) | ||
71 | R_PAREN@[76; 77) | ||
72 | SEMI@[77; 78) | ||
73 | WHITESPACE@[78; 83) | ||
74 | LET_STMT@[83; 100) | ||
75 | LET_KW@[83; 86) | ||
76 | WHITESPACE@[86; 87) | ||
77 | TUPLE_STRUCT_PAT@[87; 94) | ||
78 | PATH@[87; 90) | ||
79 | PATH_SEGMENT@[87; 90) | ||
80 | NAME_REF@[87; 90) | ||
81 | IDENT@[87; 90) "Bar" | ||
82 | L_PAREN@[90; 91) | ||
83 | DOTDOT@[91; 93) | ||
84 | R_PAREN@[93; 94) | ||
85 | WHITESPACE@[94; 95) | ||
86 | EQ@[95; 96) | ||
87 | WHITESPACE@[96; 97) | ||
88 | TUPLE_EXPR@[97; 99) | ||
89 | L_PAREN@[97; 98) | ||
90 | R_PAREN@[98; 99) | ||
91 | SEMI@[99; 100) | ||
92 | WHITESPACE@[100; 101) | ||
93 | R_CURLY@[101; 102) | ||
94 | WHITESPACE@[102; 103) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0073_struct_pat_fields.rs b/crates/libsyntax2/tests/data/parser/inline/0073_struct_pat_fields.rs new file mode 100644 index 000000000..da3412fa8 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0073_struct_pat_fields.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/libsyntax2/tests/data/parser/inline/0073_struct_pat_fields.txt b/crates/libsyntax2/tests/data/parser/inline/0073_struct_pat_fields.txt new file mode 100644 index 000000000..fc0d44f7a --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0073_struct_pat_fields.txt | |||
@@ -0,0 +1,122 @@ | |||
1 | FILE@[0; 119) | ||
2 | FUNCTION@[0; 118) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 118) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | LET_STMT@[15; 29) | ||
15 | LET_KW@[15; 18) | ||
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 | L_CURLY@[21; 22) | ||
24 | R_CURLY@[22; 23) | ||
25 | WHITESPACE@[23; 24) | ||
26 | EQ@[24; 25) | ||
27 | WHITESPACE@[25; 26) | ||
28 | TUPLE_EXPR@[26; 28) | ||
29 | L_PAREN@[26; 27) | ||
30 | R_PAREN@[27; 28) | ||
31 | SEMI@[28; 29) | ||
32 | WHITESPACE@[29; 34) | ||
33 | LET_STMT@[34; 62) | ||
34 | LET_KW@[34; 37) | ||
35 | WHITESPACE@[37; 38) | ||
36 | STRUCT_PAT@[38; 56) | ||
37 | PATH@[38; 39) | ||
38 | PATH_SEGMENT@[38; 39) | ||
39 | NAME_REF@[38; 39) | ||
40 | IDENT@[38; 39) "S" | ||
41 | WHITESPACE@[39; 40) | ||
42 | L_CURLY@[40; 41) | ||
43 | WHITESPACE@[41; 42) | ||
44 | BIND_PAT@[42; 43) | ||
45 | NAME@[42; 43) | ||
46 | IDENT@[42; 43) "f" | ||
47 | COMMA@[43; 44) | ||
48 | WHITESPACE@[44; 45) | ||
49 | BIND_PAT@[45; 54) | ||
50 | REF_KW@[45; 48) | ||
51 | WHITESPACE@[48; 49) | ||
52 | MUT_KW@[49; 52) | ||
53 | WHITESPACE@[52; 53) | ||
54 | NAME@[53; 54) | ||
55 | IDENT@[53; 54) "g" | ||
56 | WHITESPACE@[54; 55) | ||
57 | R_CURLY@[55; 56) | ||
58 | WHITESPACE@[56; 57) | ||
59 | EQ@[57; 58) | ||
60 | WHITESPACE@[58; 59) | ||
61 | TUPLE_EXPR@[59; 61) | ||
62 | L_PAREN@[59; 60) | ||
63 | R_PAREN@[60; 61) | ||
64 | SEMI@[61; 62) | ||
65 | WHITESPACE@[62; 67) | ||
66 | LET_STMT@[67; 90) | ||
67 | LET_KW@[67; 70) | ||
68 | WHITESPACE@[70; 71) | ||
69 | STRUCT_PAT@[71; 84) | ||
70 | PATH@[71; 72) | ||
71 | PATH_SEGMENT@[71; 72) | ||
72 | NAME_REF@[71; 72) | ||
73 | IDENT@[71; 72) "S" | ||
74 | WHITESPACE@[72; 73) | ||
75 | L_CURLY@[73; 74) | ||
76 | WHITESPACE@[74; 75) | ||
77 | IDENT@[75; 76) "h" | ||
78 | COLON@[76; 77) | ||
79 | WHITESPACE@[77; 78) | ||
80 | PLACEHOLDER_PAT@[78; 79) | ||
81 | UNDERSCORE@[78; 79) | ||
82 | COMMA@[79; 80) | ||
83 | WHITESPACE@[80; 81) | ||
84 | DOTDOT@[81; 83) | ||
85 | R_CURLY@[83; 84) | ||
86 | WHITESPACE@[84; 85) | ||
87 | EQ@[85; 86) | ||
88 | WHITESPACE@[86; 87) | ||
89 | TUPLE_EXPR@[87; 89) | ||
90 | L_PAREN@[87; 88) | ||
91 | R_PAREN@[88; 89) | ||
92 | SEMI@[89; 90) | ||
93 | WHITESPACE@[90; 95) | ||
94 | LET_STMT@[95; 116) | ||
95 | LET_KW@[95; 98) | ||
96 | WHITESPACE@[98; 99) | ||
97 | STRUCT_PAT@[99; 110) | ||
98 | PATH@[99; 100) | ||
99 | PATH_SEGMENT@[99; 100) | ||
100 | NAME_REF@[99; 100) | ||
101 | IDENT@[99; 100) "S" | ||
102 | WHITESPACE@[100; 101) | ||
103 | L_CURLY@[101; 102) | ||
104 | WHITESPACE@[102; 103) | ||
105 | IDENT@[103; 104) "h" | ||
106 | COLON@[104; 105) | ||
107 | WHITESPACE@[105; 106) | ||
108 | PLACEHOLDER_PAT@[106; 107) | ||
109 | UNDERSCORE@[106; 107) | ||
110 | COMMA@[107; 108) | ||
111 | WHITESPACE@[108; 109) | ||
112 | R_CURLY@[109; 110) | ||
113 | WHITESPACE@[110; 111) | ||
114 | EQ@[111; 112) | ||
115 | WHITESPACE@[112; 113) | ||
116 | TUPLE_EXPR@[113; 115) | ||
117 | L_PAREN@[113; 114) | ||
118 | R_PAREN@[114; 115) | ||
119 | SEMI@[115; 116) | ||
120 | WHITESPACE@[116; 117) | ||
121 | R_CURLY@[117; 118) | ||
122 | WHITESPACE@[118; 119) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0074_unary_expr.rs b/crates/libsyntax2/tests/data/parser/inline/0074_unary_expr.rs new file mode 100644 index 000000000..f1c3f7118 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0074_unary_expr.rs | |||
@@ -0,0 +1,5 @@ | |||
1 | fn foo() { | ||
2 | **&1; | ||
3 | !!true; | ||
4 | --1; | ||
5 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0074_unary_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0074_unary_expr.txt new file mode 100644 index 000000000..e0b4ff964 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0074_unary_expr.txt | |||
@@ -0,0 +1,44 @@ | |||
1 | FILE@[0; 44) | ||
2 | FUNCTION@[0; 43) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 43) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
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) | ||
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) | ||
32 | SEMI@[31; 32) | ||
33 | WHITESPACE@[32; 37) | ||
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) | ||
43 | R_CURLY@[42; 43) | ||
44 | WHITESPACE@[43; 44) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0075_try_expr.rs b/crates/libsyntax2/tests/data/parser/inline/0075_try_expr.rs new file mode 100644 index 000000000..8b74f7bc8 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0075_try_expr.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn foo() { | ||
2 | x?; | ||
3 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0075_try_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0075_try_expr.txt new file mode 100644 index 000000000..f7b86f269 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0075_try_expr.txt | |||
@@ -0,0 +1,25 @@ | |||
1 | FILE@[0; 21) | ||
2 | FUNCTION@[0; 20) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 20) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
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) | ||
24 | R_CURLY@[19; 20) | ||
25 | WHITESPACE@[20; 21) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0076_cond.rs b/crates/libsyntax2/tests/data/parser/inline/0076_cond.rs new file mode 100644 index 000000000..fdb37ee6f --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0076_cond.rs | |||
@@ -0,0 +1 @@ | |||
fn foo() { if let Some(_) = None {} } | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0076_cond.txt b/crates/libsyntax2/tests/data/parser/inline/0076_cond.txt new file mode 100644 index 000000000..0cde88a90 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0076_cond.txt | |||
@@ -0,0 +1,42 @@ | |||
1 | FILE@[0; 38) | ||
2 | FUNCTION@[0; 37) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 37) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 11) | ||
14 | IF_EXPR@[11; 35) | ||
15 | IF_KW@[11; 13) | ||
16 | WHITESPACE@[13; 14) | ||
17 | LET_KW@[14; 17) | ||
18 | WHITESPACE@[17; 18) | ||
19 | TUPLE_STRUCT_PAT@[18; 25) | ||
20 | PATH@[18; 22) | ||
21 | PATH_SEGMENT@[18; 22) | ||
22 | NAME_REF@[18; 22) | ||
23 | IDENT@[18; 22) "Some" | ||
24 | L_PAREN@[22; 23) | ||
25 | PLACEHOLDER_PAT@[23; 24) | ||
26 | UNDERSCORE@[23; 24) | ||
27 | R_PAREN@[24; 25) | ||
28 | WHITESPACE@[25; 26) | ||
29 | EQ@[26; 27) | ||
30 | WHITESPACE@[27; 28) | ||
31 | PATH_EXPR@[28; 32) | ||
32 | PATH@[28; 32) | ||
33 | PATH_SEGMENT@[28; 32) | ||
34 | NAME_REF@[28; 32) | ||
35 | IDENT@[28; 32) "None" | ||
36 | WHITESPACE@[32; 33) | ||
37 | BLOCK_EXPR@[33; 35) | ||
38 | L_CURLY@[33; 34) | ||
39 | R_CURLY@[34; 35) | ||
40 | WHITESPACE@[35; 36) | ||
41 | R_CURLY@[36; 37) | ||
42 | WHITESPACE@[37; 38) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0077_while_expr.rs b/crates/libsyntax2/tests/data/parser/inline/0077_while_expr.rs new file mode 100644 index 000000000..293046a04 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0077_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/libsyntax2/tests/data/parser/inline/0077_while_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0077_while_expr.txt new file mode 100644 index 000000000..82e63fd46 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0077_while_expr.txt | |||
@@ -0,0 +1,64 @@ | |||
1 | FILE@[0; 70) | ||
2 | FUNCTION@[0; 69) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 69) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 29) | ||
15 | WHILE_EXPR@[15; 28) | ||
16 | WHILE_KW@[15; 20) | ||
17 | WHITESPACE@[20; 21) | ||
18 | LITERAL@[21; 25) | ||
19 | TRUE_KW@[21; 25) | ||
20 | WHITESPACE@[25; 26) | ||
21 | BLOCK_EXPR@[26; 28) | ||
22 | L_CURLY@[26; 27) | ||
23 | R_CURLY@[27; 28) | ||
24 | SEMI@[28; 29) | ||
25 | WHITESPACE@[29; 34) | ||
26 | EXPR_STMT@[34; 67) | ||
27 | WHILE_EXPR@[34; 66) | ||
28 | WHILE_KW@[34; 39) | ||
29 | WHITESPACE@[39; 40) | ||
30 | LET_KW@[40; 43) | ||
31 | WHITESPACE@[43; 44) | ||
32 | TUPLE_STRUCT_PAT@[44; 51) | ||
33 | PATH@[44; 48) | ||
34 | PATH_SEGMENT@[44; 48) | ||
35 | NAME_REF@[44; 48) | ||
36 | IDENT@[44; 48) "Some" | ||
37 | L_PAREN@[48; 49) | ||
38 | BIND_PAT@[49; 50) | ||
39 | NAME@[49; 50) | ||
40 | IDENT@[49; 50) "x" | ||
41 | R_PAREN@[50; 51) | ||
42 | WHITESPACE@[51; 52) | ||
43 | EQ@[52; 53) | ||
44 | WHITESPACE@[53; 54) | ||
45 | METHOD_CALL_EXPR@[54; 63) | ||
46 | PATH_EXPR@[54; 56) | ||
47 | PATH@[54; 56) | ||
48 | PATH_SEGMENT@[54; 56) | ||
49 | NAME_REF@[54; 56) | ||
50 | IDENT@[54; 56) "it" | ||
51 | DOT@[56; 57) | ||
52 | NAME_REF@[57; 61) | ||
53 | IDENT@[57; 61) "next" | ||
54 | ARG_LIST@[61; 63) | ||
55 | L_PAREN@[61; 62) | ||
56 | R_PAREN@[62; 63) | ||
57 | WHITESPACE@[63; 64) | ||
58 | BLOCK_EXPR@[64; 66) | ||
59 | L_CURLY@[64; 65) | ||
60 | R_CURLY@[65; 66) | ||
61 | SEMI@[66; 67) | ||
62 | WHITESPACE@[67; 68) | ||
63 | R_CURLY@[68; 69) | ||
64 | WHITESPACE@[69; 70) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0078_mod_contents.rs b/crates/libsyntax2/tests/data/parser/inline/0078_mod_contents.rs new file mode 100644 index 000000000..24a15c5c5 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0078_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/libsyntax2/tests/data/parser/inline/0078_mod_contents.txt b/crates/libsyntax2/tests/data/parser/inline/0078_mod_contents.txt new file mode 100644 index 000000000..c003d24e1 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0078_mod_contents.txt | |||
@@ -0,0 +1,62 @@ | |||
1 | FILE@[0; 70) | ||
2 | FUNCTION@[0; 11) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 11) | ||
12 | L_CURLY@[9; 10) | ||
13 | R_CURLY@[10; 11) | ||
14 | WHITESPACE@[11; 12) | ||
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 | IDENT@[25; 28) "foo" | ||
23 | WHITESPACE@[28; 29) | ||
24 | L_CURLY@[29; 30) | ||
25 | R_CURLY@[30; 31) | ||
26 | WHITESPACE@[31; 32) | ||
27 | MACRO_CALL@[32; 44) | ||
28 | PATH@[32; 40) | ||
29 | PATH@[32; 35) | ||
30 | PATH_SEGMENT@[32; 35) | ||
31 | NAME_REF@[32; 35) | ||
32 | IDENT@[32; 35) "foo" | ||
33 | COLONCOLON@[35; 37) | ||
34 | PATH_SEGMENT@[37; 40) | ||
35 | NAME_REF@[37; 40) | ||
36 | IDENT@[37; 40) "bar" | ||
37 | EXCL@[40; 41) | ||
38 | L_PAREN@[41; 42) | ||
39 | R_PAREN@[42; 43) | ||
40 | SEMI@[43; 44) | ||
41 | WHITESPACE@[44; 45) | ||
42 | MACRO_CALL@[45; 59) | ||
43 | PATH@[45; 55) | ||
44 | PATH@[45; 50) | ||
45 | PATH_SEGMENT@[45; 50) | ||
46 | SUPER_KW@[45; 50) | ||
47 | COLONCOLON@[50; 52) | ||
48 | PATH_SEGMENT@[52; 55) | ||
49 | NAME_REF@[52; 55) | ||
50 | IDENT@[52; 55) "baz" | ||
51 | EXCL@[55; 56) | ||
52 | WHITESPACE@[56; 57) | ||
53 | L_CURLY@[57; 58) | ||
54 | R_CURLY@[58; 59) | ||
55 | WHITESPACE@[59; 60) | ||
56 | STRUCT_ITEM@[60; 69) | ||
57 | STRUCT_KW@[60; 66) | ||
58 | WHITESPACE@[66; 67) | ||
59 | NAME@[67; 68) | ||
60 | IDENT@[67; 68) "S" | ||
61 | SEMI@[68; 69) | ||
62 | WHITESPACE@[69; 70) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0079_cast_expr.rs b/crates/libsyntax2/tests/data/parser/inline/0079_cast_expr.rs new file mode 100644 index 000000000..3e53d56d6 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0079_cast_expr.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn foo() { | ||
2 | 82 as i32; | ||
3 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0079_cast_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0079_cast_expr.txt new file mode 100644 index 000000000..642557e15 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0079_cast_expr.txt | |||
@@ -0,0 +1,29 @@ | |||
1 | FILE@[0; 28) | ||
2 | FUNCTION@[0; 27) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 27) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
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) | ||
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; 26) | ||
28 | R_CURLY@[26; 27) | ||
29 | WHITESPACE@[27; 28) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0080_tuple_expr.rs b/crates/libsyntax2/tests/data/parser/inline/0080_tuple_expr.rs new file mode 100644 index 000000000..e4f774280 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0080_tuple_expr.rs | |||
@@ -0,0 +1,5 @@ | |||
1 | fn foo() { | ||
2 | (); | ||
3 | (1); | ||
4 | (1,); | ||
5 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0080_tuple_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0080_tuple_expr.txt new file mode 100644 index 000000000..728ba6ec7 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0080_tuple_expr.txt | |||
@@ -0,0 +1,38 @@ | |||
1 | FILE@[0; 40) | ||
2 | FUNCTION@[0; 39) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 39) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
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) | ||
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) | ||
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) | ||
37 | R_CURLY@[38; 39) | ||
38 | WHITESPACE@[39; 40) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0081_index_expr.rs b/crates/libsyntax2/tests/data/parser/inline/0081_index_expr.rs new file mode 100644 index 000000000..b9ba78a6c --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0081_index_expr.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn foo() { | ||
2 | x[1][2]; | ||
3 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0081_index_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0081_index_expr.txt new file mode 100644 index 000000000..80af4caed --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0081_index_expr.txt | |||
@@ -0,0 +1,33 @@ | |||
1 | FILE@[0; 26) | ||
2 | FUNCTION@[0; 25) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 25) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
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) | ||
32 | R_CURLY@[24; 25) | ||
33 | WHITESPACE@[25; 26) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0082_tuple_pat.rs b/crates/libsyntax2/tests/data/parser/inline/0082_tuple_pat.rs new file mode 100644 index 000000000..f785acd36 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0082_tuple_pat.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn main() { | ||
2 | let (a, b, ..) = (); | ||
3 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0082_tuple_pat.txt b/crates/libsyntax2/tests/data/parser/inline/0082_tuple_pat.txt new file mode 100644 index 000000000..d8314b5d8 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0082_tuple_pat.txt | |||
@@ -0,0 +1,40 @@ | |||
1 | FILE@[0; 39) | ||
2 | FUNCTION@[0; 38) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 7) | ||
6 | IDENT@[3; 7) "main" | ||
7 | PARAM_LIST@[7; 9) | ||
8 | L_PAREN@[7; 8) | ||
9 | R_PAREN@[8; 9) | ||
10 | WHITESPACE@[9; 10) | ||
11 | BLOCK_EXPR@[10; 38) | ||
12 | L_CURLY@[10; 11) | ||
13 | WHITESPACE@[11; 16) | ||
14 | LET_STMT@[16; 36) | ||
15 | LET_KW@[16; 19) | ||
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) | ||
39 | R_CURLY@[37; 38) | ||
40 | WHITESPACE@[38; 39) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0083_postfix_range.rs b/crates/libsyntax2/tests/data/parser/inline/0083_postfix_range.rs new file mode 100644 index 000000000..c39fe8e68 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0083_postfix_range.rs | |||
@@ -0,0 +1 @@ | |||
fn foo() { let x = 1..; } | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0083_postfix_range.txt b/crates/libsyntax2/tests/data/parser/inline/0083_postfix_range.txt new file mode 100644 index 000000000..bf9b2c695 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0083_postfix_range.txt | |||
@@ -0,0 +1,30 @@ | |||
1 | FILE@[0; 26) | ||
2 | FUNCTION@[0; 25) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 25) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 11) | ||
14 | LET_STMT@[11; 23) | ||
15 | LET_KW@[11; 14) | ||
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) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0084_loop_expr.rs b/crates/libsyntax2/tests/data/parser/inline/0084_loop_expr.rs new file mode 100644 index 000000000..9f078fa48 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0084_loop_expr.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn foo() { | ||
2 | loop {}; | ||
3 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0084_loop_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0084_loop_expr.txt new file mode 100644 index 000000000..5e0de55d4 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0084_loop_expr.txt | |||
@@ -0,0 +1,24 @@ | |||
1 | FILE@[0; 26) | ||
2 | FUNCTION@[0; 25) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 25) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 23) | ||
15 | LOOP_EXPR@[15; 22) | ||
16 | LOOP_KW@[15; 19) | ||
17 | WHITESPACE@[19; 20) | ||
18 | BLOCK_EXPR@[20; 22) | ||
19 | L_CURLY@[20; 21) | ||
20 | R_CURLY@[21; 22) | ||
21 | SEMI@[22; 23) | ||
22 | WHITESPACE@[23; 24) | ||
23 | R_CURLY@[24; 25) | ||
24 | WHITESPACE@[25; 26) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0085_for_expr.rs b/crates/libsyntax2/tests/data/parser/inline/0085_for_expr.rs new file mode 100644 index 000000000..972197d2a --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0085_for_expr.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn foo() { | ||
2 | for x in [] {}; | ||
3 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0085_for_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0085_for_expr.txt new file mode 100644 index 000000000..3a378cfcf --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0085_for_expr.txt | |||
@@ -0,0 +1,34 @@ | |||
1 | FILE@[0; 33) | ||
2 | FUNCTION@[0; 32) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 32) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 30) | ||
15 | FOR_EXPR@[15; 29) | ||
16 | FOR_KW@[15; 18) | ||
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) | ||
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_EXPR@[27; 29) | ||
29 | L_CURLY@[27; 28) | ||
30 | R_CURLY@[28; 29) | ||
31 | SEMI@[29; 30) | ||
32 | WHITESPACE@[30; 31) | ||
33 | R_CURLY@[31; 32) | ||
34 | WHITESPACE@[32; 33) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0085_match_arms_commas.rs b/crates/libsyntax2/tests/data/parser/inline/0085_match_arms_commas.rs new file mode 100644 index 000000000..1f25d577a --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0085_match_arms_commas.rs | |||
@@ -0,0 +1,7 @@ | |||
1 | fn foo() { | ||
2 | match () { | ||
3 | _ => (), | ||
4 | _ => {} | ||
5 | _ => () | ||
6 | } | ||
7 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0085_match_arms_commas.txt b/crates/libsyntax2/tests/data/parser/inline/0085_match_arms_commas.txt new file mode 100644 index 000000000..5465a3797 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0085_match_arms_commas.txt | |||
@@ -0,0 +1,57 @@ | |||
1 | FILE@[0; 83) | ||
2 | FUNCTION@[0; 82) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 82) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | MATCH_EXPR@[15; 80) | ||
15 | MATCH_KW@[15; 20) | ||
16 | WHITESPACE@[20; 21) | ||
17 | TUPLE_EXPR@[21; 23) | ||
18 | L_PAREN@[21; 22) | ||
19 | R_PAREN@[22; 23) | ||
20 | WHITESPACE@[23; 24) | ||
21 | L_CURLY@[24; 25) | ||
22 | WHITESPACE@[25; 34) | ||
23 | MATCH_ARM@[34; 41) | ||
24 | PLACEHOLDER_PAT@[34; 35) | ||
25 | UNDERSCORE@[34; 35) | ||
26 | WHITESPACE@[35; 36) | ||
27 | FAT_ARROW@[36; 38) | ||
28 | WHITESPACE@[38; 39) | ||
29 | TUPLE_EXPR@[39; 41) | ||
30 | L_PAREN@[39; 40) | ||
31 | R_PAREN@[40; 41) | ||
32 | COMMA@[41; 42) | ||
33 | WHITESPACE@[42; 51) | ||
34 | MATCH_ARM@[51; 58) | ||
35 | PLACEHOLDER_PAT@[51; 52) | ||
36 | UNDERSCORE@[51; 52) | ||
37 | WHITESPACE@[52; 53) | ||
38 | FAT_ARROW@[53; 55) | ||
39 | WHITESPACE@[55; 56) | ||
40 | BLOCK_EXPR@[56; 58) | ||
41 | L_CURLY@[56; 57) | ||
42 | R_CURLY@[57; 58) | ||
43 | WHITESPACE@[58; 67) | ||
44 | MATCH_ARM@[67; 74) | ||
45 | PLACEHOLDER_PAT@[67; 68) | ||
46 | UNDERSCORE@[67; 68) | ||
47 | WHITESPACE@[68; 69) | ||
48 | FAT_ARROW@[69; 71) | ||
49 | WHITESPACE@[71; 72) | ||
50 | TUPLE_EXPR@[72; 74) | ||
51 | L_PAREN@[72; 73) | ||
52 | R_PAREN@[73; 74) | ||
53 | WHITESPACE@[74; 79) | ||
54 | R_CURLY@[79; 80) | ||
55 | WHITESPACE@[80; 81) | ||
56 | R_CURLY@[81; 82) | ||
57 | WHITESPACE@[82; 83) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0086_array_expr.rs b/crates/libsyntax2/tests/data/parser/inline/0086_array_expr.rs new file mode 100644 index 000000000..4dc1999d1 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0086_array_expr.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | fn foo() { | ||
2 | []; | ||
3 | [1]; | ||
4 | [1, 2,]; | ||
5 | [1; 2]; | ||
6 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0086_array_expr.txt b/crates/libsyntax2/tests/data/parser/inline/0086_array_expr.txt new file mode 100644 index 000000000..9a5f56edf --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0086_array_expr.txt | |||
@@ -0,0 +1,54 @@ | |||
1 | FILE@[0; 55) | ||
2 | FUNCTION@[0; 54) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 54) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
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) | ||
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) | ||
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) | ||
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) | ||
53 | R_CURLY@[53; 54) | ||
54 | WHITESPACE@[54; 55) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0086_no_semi_after_block.rs b/crates/libsyntax2/tests/data/parser/inline/0086_no_semi_after_block.rs new file mode 100644 index 000000000..d769da43d --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0086_no_semi_after_block.rs | |||
@@ -0,0 +1,9 @@ | |||
1 | fn foo() { | ||
2 | if true {} | ||
3 | loop {} | ||
4 | match () {} | ||
5 | while true {} | ||
6 | for _ in () {} | ||
7 | {} | ||
8 | {} | ||
9 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0086_no_semi_after_block.txt b/crates/libsyntax2/tests/data/parser/inline/0086_no_semi_after_block.txt new file mode 100644 index 000000000..d19a270ac --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0086_no_semi_after_block.txt | |||
@@ -0,0 +1,82 @@ | |||
1 | FILE@[0; 107) | ||
2 | FUNCTION@[0; 106) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 106) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | EXPR_STMT@[15; 25) | ||
15 | IF_EXPR@[15; 25) | ||
16 | IF_KW@[15; 17) | ||
17 | WHITESPACE@[17; 18) | ||
18 | LITERAL@[18; 22) | ||
19 | TRUE_KW@[18; 22) | ||
20 | WHITESPACE@[22; 23) | ||
21 | BLOCK_EXPR@[23; 25) | ||
22 | L_CURLY@[23; 24) | ||
23 | R_CURLY@[24; 25) | ||
24 | WHITESPACE@[25; 30) | ||
25 | EXPR_STMT@[30; 37) | ||
26 | LOOP_EXPR@[30; 37) | ||
27 | LOOP_KW@[30; 34) | ||
28 | WHITESPACE@[34; 35) | ||
29 | BLOCK_EXPR@[35; 37) | ||
30 | L_CURLY@[35; 36) | ||
31 | R_CURLY@[36; 37) | ||
32 | WHITESPACE@[37; 42) | ||
33 | EXPR_STMT@[42; 53) | ||
34 | MATCH_EXPR@[42; 53) | ||
35 | MATCH_KW@[42; 47) | ||
36 | WHITESPACE@[47; 48) | ||
37 | TUPLE_EXPR@[48; 50) | ||
38 | L_PAREN@[48; 49) | ||
39 | R_PAREN@[49; 50) | ||
40 | WHITESPACE@[50; 51) | ||
41 | L_CURLY@[51; 52) | ||
42 | R_CURLY@[52; 53) | ||
43 | WHITESPACE@[53; 58) | ||
44 | EXPR_STMT@[58; 71) | ||
45 | WHILE_EXPR@[58; 71) | ||
46 | WHILE_KW@[58; 63) | ||
47 | WHITESPACE@[63; 64) | ||
48 | LITERAL@[64; 68) | ||
49 | TRUE_KW@[64; 68) | ||
50 | WHITESPACE@[68; 69) | ||
51 | BLOCK_EXPR@[69; 71) | ||
52 | L_CURLY@[69; 70) | ||
53 | R_CURLY@[70; 71) | ||
54 | WHITESPACE@[71; 76) | ||
55 | EXPR_STMT@[76; 90) | ||
56 | FOR_EXPR@[76; 90) | ||
57 | FOR_KW@[76; 79) | ||
58 | WHITESPACE@[79; 80) | ||
59 | PLACEHOLDER_PAT@[80; 81) | ||
60 | UNDERSCORE@[80; 81) | ||
61 | WHITESPACE@[81; 82) | ||
62 | IN_KW@[82; 84) | ||
63 | WHITESPACE@[84; 85) | ||
64 | TUPLE_EXPR@[85; 87) | ||
65 | L_PAREN@[85; 86) | ||
66 | R_PAREN@[86; 87) | ||
67 | WHITESPACE@[87; 88) | ||
68 | BLOCK_EXPR@[88; 90) | ||
69 | L_CURLY@[88; 89) | ||
70 | R_CURLY@[89; 90) | ||
71 | WHITESPACE@[90; 95) | ||
72 | EXPR_STMT@[95; 97) | ||
73 | BLOCK_EXPR@[95; 97) | ||
74 | L_CURLY@[95; 96) | ||
75 | R_CURLY@[96; 97) | ||
76 | WHITESPACE@[97; 102) | ||
77 | BLOCK_EXPR@[102; 104) | ||
78 | L_CURLY@[102; 103) | ||
79 | R_CURLY@[103; 104) | ||
80 | WHITESPACE@[104; 105) | ||
81 | R_CURLY@[105; 106) | ||
82 | WHITESPACE@[106; 107) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0087_stmt_postfix_expr_ambiguity.rs b/crates/libsyntax2/tests/data/parser/inline/0087_stmt_postfix_expr_ambiguity.rs new file mode 100644 index 000000000..2edd578f9 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0087_stmt_postfix_expr_ambiguity.rs | |||
@@ -0,0 +1,7 @@ | |||
1 | fn foo() { | ||
2 | match () { | ||
3 | _ => {} | ||
4 | () => {} | ||
5 | [] => {} | ||
6 | } | ||
7 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0087_stmt_postfix_expr_ambiguity.txt b/crates/libsyntax2/tests/data/parser/inline/0087_stmt_postfix_expr_ambiguity.txt new file mode 100644 index 000000000..e83b6d183 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0087_stmt_postfix_expr_ambiguity.txt | |||
@@ -0,0 +1,58 @@ | |||
1 | FILE@[0; 84) | ||
2 | FUNCTION@[0; 83) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 83) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | MATCH_EXPR@[15; 81) | ||
15 | MATCH_KW@[15; 20) | ||
16 | WHITESPACE@[20; 21) | ||
17 | TUPLE_EXPR@[21; 23) | ||
18 | L_PAREN@[21; 22) | ||
19 | R_PAREN@[22; 23) | ||
20 | WHITESPACE@[23; 24) | ||
21 | L_CURLY@[24; 25) | ||
22 | WHITESPACE@[25; 34) | ||
23 | MATCH_ARM@[34; 41) | ||
24 | PLACEHOLDER_PAT@[34; 35) | ||
25 | UNDERSCORE@[34; 35) | ||
26 | WHITESPACE@[35; 36) | ||
27 | FAT_ARROW@[36; 38) | ||
28 | WHITESPACE@[38; 39) | ||
29 | BLOCK_EXPR@[39; 41) | ||
30 | L_CURLY@[39; 40) | ||
31 | R_CURLY@[40; 41) | ||
32 | WHITESPACE@[41; 50) | ||
33 | MATCH_ARM@[50; 58) | ||
34 | TUPLE_PAT@[50; 52) | ||
35 | L_PAREN@[50; 51) | ||
36 | R_PAREN@[51; 52) | ||
37 | WHITESPACE@[52; 53) | ||
38 | FAT_ARROW@[53; 55) | ||
39 | WHITESPACE@[55; 56) | ||
40 | BLOCK_EXPR@[56; 58) | ||
41 | L_CURLY@[56; 57) | ||
42 | R_CURLY@[57; 58) | ||
43 | WHITESPACE@[58; 67) | ||
44 | MATCH_ARM@[67; 75) | ||
45 | SLICE_PAT@[67; 69) | ||
46 | L_BRACK@[67; 68) | ||
47 | R_BRACK@[68; 69) | ||
48 | WHITESPACE@[69; 70) | ||
49 | FAT_ARROW@[70; 72) | ||
50 | WHITESPACE@[72; 73) | ||
51 | BLOCK_EXPR@[73; 75) | ||
52 | L_CURLY@[73; 74) | ||
53 | R_CURLY@[74; 75) | ||
54 | WHITESPACE@[75; 80) | ||
55 | R_CURLY@[80; 81) | ||
56 | WHITESPACE@[81; 82) | ||
57 | R_CURLY@[82; 83) | ||
58 | WHITESPACE@[83; 84) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0088_stmt_bin_expr_ambiguity.rs b/crates/libsyntax2/tests/data/parser/inline/0088_stmt_bin_expr_ambiguity.rs new file mode 100644 index 000000000..37b843742 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0088_stmt_bin_expr_ambiguity.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn foo() { | ||
2 | let _ = {1} & 2; | ||
3 | {1} &2; | ||
4 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0088_stmt_bin_expr_ambiguity.txt b/crates/libsyntax2/tests/data/parser/inline/0088_stmt_bin_expr_ambiguity.txt new file mode 100644 index 000000000..df4c20b0e --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0088_stmt_bin_expr_ambiguity.txt | |||
@@ -0,0 +1,50 @@ | |||
1 | FILE@[0; 46) | ||
2 | FUNCTION@[0; 45) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 45) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | LET_STMT@[15; 31) | ||
15 | LET_KW@[15; 18) | ||
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 | L_CURLY@[23; 24) | ||
25 | LITERAL@[24; 25) | ||
26 | INT_NUMBER@[24; 25) "1" | ||
27 | R_CURLY@[25; 26) | ||
28 | WHITESPACE@[26; 27) | ||
29 | AMP@[27; 28) | ||
30 | WHITESPACE@[28; 29) | ||
31 | LITERAL@[29; 30) | ||
32 | INT_NUMBER@[29; 30) "2" | ||
33 | SEMI@[30; 31) | ||
34 | WHITESPACE@[31; 36) | ||
35 | EXPR_STMT@[36; 39) | ||
36 | BLOCK_EXPR@[36; 39) | ||
37 | L_CURLY@[36; 37) | ||
38 | LITERAL@[37; 38) | ||
39 | INT_NUMBER@[37; 38) "1" | ||
40 | R_CURLY@[38; 39) | ||
41 | WHITESPACE@[39; 40) | ||
42 | EXPR_STMT@[40; 43) | ||
43 | REF_EXPR@[40; 42) | ||
44 | AMP@[40; 41) | ||
45 | LITERAL@[41; 42) | ||
46 | INT_NUMBER@[41; 42) "2" | ||
47 | SEMI@[42; 43) | ||
48 | WHITESPACE@[43; 44) | ||
49 | R_CURLY@[44; 45) | ||
50 | WHITESPACE@[45; 46) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0089_slice_pat.rs b/crates/libsyntax2/tests/data/parser/inline/0089_slice_pat.rs new file mode 100644 index 000000000..7955973b9 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0089_slice_pat.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn main() { | ||
2 | let [a, b, ..] = []; | ||
3 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0089_slice_pat.txt b/crates/libsyntax2/tests/data/parser/inline/0089_slice_pat.txt new file mode 100644 index 000000000..8379df33b --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0089_slice_pat.txt | |||
@@ -0,0 +1,40 @@ | |||
1 | FILE@[0; 39) | ||
2 | FUNCTION@[0; 38) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 7) | ||
6 | IDENT@[3; 7) "main" | ||
7 | PARAM_LIST@[7; 9) | ||
8 | L_PAREN@[7; 8) | ||
9 | R_PAREN@[8; 9) | ||
10 | WHITESPACE@[9; 10) | ||
11 | BLOCK_EXPR@[10; 38) | ||
12 | L_CURLY@[10; 11) | ||
13 | WHITESPACE@[11; 16) | ||
14 | LET_STMT@[16; 36) | ||
15 | LET_KW@[16; 19) | ||
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) | ||
39 | R_CURLY@[37; 38) | ||
40 | WHITESPACE@[38; 39) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0090_trait_item_items.rs b/crates/libsyntax2/tests/data/parser/inline/0090_trait_item_items.rs new file mode 100644 index 000000000..a5ec3239f --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0090_trait_item_items.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/libsyntax2/tests/data/parser/inline/0090_trait_item_items.txt b/crates/libsyntax2/tests/data/parser/inline/0090_trait_item_items.txt new file mode 100644 index 000000000..c04c48588 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0090_trait_item_items.txt | |||
@@ -0,0 +1,67 @@ | |||
1 | FILE@[0; 83) | ||
2 | IMPL_ITEM@[0; 82) | ||
3 | IMPL_KW@[0; 4) | ||
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 | L_CURLY@[7; 8) | ||
12 | WHITESPACE@[8; 13) | ||
13 | TYPE_ITEM@[13; 27) | ||
14 | TYPE_KW@[13; 17) | ||
15 | WHITESPACE@[17; 18) | ||
16 | NAME@[18; 19) | ||
17 | IDENT@[18; 19) "A" | ||
18 | COLON@[19; 20) | ||
19 | WHITESPACE@[20; 21) | ||
20 | PATH@[21; 26) | ||
21 | PATH_SEGMENT@[21; 26) | ||
22 | NAME_REF@[21; 26) | ||
23 | IDENT@[21; 26) "Clone" | ||
24 | SEMI@[26; 27) | ||
25 | WHITESPACE@[27; 32) | ||
26 | CONST_ITEM@[32; 45) | ||
27 | CONST_KW@[32; 37) | ||
28 | WHITESPACE@[37; 38) | ||
29 | NAME@[38; 39) | ||
30 | IDENT@[38; 39) "B" | ||
31 | COLON@[39; 40) | ||
32 | WHITESPACE@[40; 41) | ||
33 | PATH_TYPE@[41; 44) | ||
34 | PATH@[41; 44) | ||
35 | PATH_SEGMENT@[41; 44) | ||
36 | NAME_REF@[41; 44) | ||
37 | IDENT@[41; 44) "i32" | ||
38 | SEMI@[44; 45) | ||
39 | WHITESPACE@[45; 50) | ||
40 | FUNCTION@[50; 61) | ||
41 | FN_KW@[50; 52) | ||
42 | WHITESPACE@[52; 53) | ||
43 | NAME@[53; 56) | ||
44 | IDENT@[53; 56) "foo" | ||
45 | PARAM_LIST@[56; 58) | ||
46 | L_PAREN@[56; 57) | ||
47 | R_PAREN@[57; 58) | ||
48 | WHITESPACE@[58; 59) | ||
49 | BLOCK_EXPR@[59; 61) | ||
50 | L_CURLY@[59; 60) | ||
51 | R_CURLY@[60; 61) | ||
52 | WHITESPACE@[61; 66) | ||
53 | FUNCTION@[66; 80) | ||
54 | FN_KW@[66; 68) | ||
55 | WHITESPACE@[68; 69) | ||
56 | NAME@[69; 72) | ||
57 | IDENT@[69; 72) "bar" | ||
58 | PARAM_LIST@[72; 79) | ||
59 | L_PAREN@[72; 73) | ||
60 | SELF_PARAM@[73; 78) | ||
61 | AMP@[73; 74) | ||
62 | SELF_KW@[74; 78) | ||
63 | R_PAREN@[78; 79) | ||
64 | SEMI@[79; 80) | ||
65 | WHITESPACE@[80; 81) | ||
66 | R_CURLY@[81; 82) | ||
67 | WHITESPACE@[82; 83) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0091_fn_decl.rs b/crates/libsyntax2/tests/data/parser/inline/0091_fn_decl.rs new file mode 100644 index 000000000..c9f74f7f5 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0091_fn_decl.rs | |||
@@ -0,0 +1 @@ | |||
trait T { fn foo(); } | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0091_fn_decl.txt b/crates/libsyntax2/tests/data/parser/inline/0091_fn_decl.txt new file mode 100644 index 000000000..5a76af652 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0091_fn_decl.txt | |||
@@ -0,0 +1,21 @@ | |||
1 | FILE@[0; 22) | ||
2 | TRAIT_ITEM@[0; 21) | ||
3 | TRAIT_KW@[0; 5) | ||
4 | WHITESPACE@[5; 6) | ||
5 | NAME@[6; 7) | ||
6 | IDENT@[6; 7) "T" | ||
7 | WHITESPACE@[7; 8) | ||
8 | L_CURLY@[8; 9) | ||
9 | WHITESPACE@[9; 10) | ||
10 | FUNCTION@[10; 19) | ||
11 | FN_KW@[10; 12) | ||
12 | WHITESPACE@[12; 13) | ||
13 | NAME@[13; 16) | ||
14 | IDENT@[13; 16) "foo" | ||
15 | PARAM_LIST@[16; 18) | ||
16 | L_PAREN@[16; 17) | ||
17 | R_PAREN@[17; 18) | ||
18 | SEMI@[18; 19) | ||
19 | WHITESPACE@[19; 20) | ||
20 | R_CURLY@[20; 21) | ||
21 | WHITESPACE@[21; 22) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0092_literal_pattern.rs b/crates/libsyntax2/tests/data/parser/inline/0092_literal_pattern.rs new file mode 100644 index 000000000..16f674d9d --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0092_literal_pattern.rs | |||
@@ -0,0 +1,7 @@ | |||
1 | fn main() { | ||
2 | match () { | ||
3 | 92 => (), | ||
4 | 'c' => (), | ||
5 | "hello" => (), | ||
6 | } | ||
7 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0092_literal_pattern.txt b/crates/libsyntax2/tests/data/parser/inline/0092_literal_pattern.txt new file mode 100644 index 000000000..a2f985408 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0092_literal_pattern.txt | |||
@@ -0,0 +1,59 @@ | |||
1 | FILE@[0; 95) | ||
2 | FUNCTION@[0; 94) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 7) | ||
6 | IDENT@[3; 7) "main" | ||
7 | PARAM_LIST@[7; 9) | ||
8 | L_PAREN@[7; 8) | ||
9 | R_PAREN@[8; 9) | ||
10 | WHITESPACE@[9; 10) | ||
11 | BLOCK_EXPR@[10; 94) | ||
12 | L_CURLY@[10; 11) | ||
13 | WHITESPACE@[11; 16) | ||
14 | MATCH_EXPR@[16; 92) | ||
15 | MATCH_KW@[16; 21) | ||
16 | WHITESPACE@[21; 22) | ||
17 | TUPLE_EXPR@[22; 24) | ||
18 | L_PAREN@[22; 23) | ||
19 | R_PAREN@[23; 24) | ||
20 | WHITESPACE@[24; 25) | ||
21 | L_CURLY@[25; 26) | ||
22 | WHITESPACE@[26; 35) | ||
23 | MATCH_ARM@[35; 43) | ||
24 | LITERAL@[35; 37) | ||
25 | INT_NUMBER@[35; 37) "92" | ||
26 | WHITESPACE@[37; 38) | ||
27 | FAT_ARROW@[38; 40) | ||
28 | WHITESPACE@[40; 41) | ||
29 | TUPLE_EXPR@[41; 43) | ||
30 | L_PAREN@[41; 42) | ||
31 | R_PAREN@[42; 43) | ||
32 | COMMA@[43; 44) | ||
33 | WHITESPACE@[44; 53) | ||
34 | MATCH_ARM@[53; 62) | ||
35 | LITERAL@[53; 56) | ||
36 | CHAR@[53; 56) | ||
37 | WHITESPACE@[56; 57) | ||
38 | FAT_ARROW@[57; 59) | ||
39 | WHITESPACE@[59; 60) | ||
40 | TUPLE_EXPR@[60; 62) | ||
41 | L_PAREN@[60; 61) | ||
42 | R_PAREN@[61; 62) | ||
43 | COMMA@[62; 63) | ||
44 | WHITESPACE@[63; 72) | ||
45 | MATCH_ARM@[72; 85) | ||
46 | LITERAL@[72; 79) | ||
47 | STRING@[72; 79) | ||
48 | WHITESPACE@[79; 80) | ||
49 | FAT_ARROW@[80; 82) | ||
50 | WHITESPACE@[82; 83) | ||
51 | TUPLE_EXPR@[83; 85) | ||
52 | L_PAREN@[83; 84) | ||
53 | R_PAREN@[84; 85) | ||
54 | COMMA@[85; 86) | ||
55 | WHITESPACE@[86; 91) | ||
56 | R_CURLY@[91; 92) | ||
57 | WHITESPACE@[92; 93) | ||
58 | R_CURLY@[93; 94) | ||
59 | WHITESPACE@[94; 95) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0093_path_fn_trait_args.rs b/crates/libsyntax2/tests/data/parser/inline/0093_path_fn_trait_args.rs new file mode 100644 index 000000000..aef45e561 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0093_path_fn_trait_args.rs | |||
@@ -0,0 +1 @@ | |||
type F = Box<Fn(x: i32) -> ()>; | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0093_path_fn_trait_args.txt b/crates/libsyntax2/tests/data/parser/inline/0093_path_fn_trait_args.txt new file mode 100644 index 000000000..800a4ac14 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0093_path_fn_trait_args.txt | |||
@@ -0,0 +1,45 @@ | |||
1 | FILE@[0; 32) | ||
2 | TYPE_ITEM@[0; 31) | ||
3 | TYPE_KW@[0; 4) | ||
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 | THIN_ARROW@[24; 26) | ||
39 | WHITESPACE@[26; 27) | ||
40 | TUPLE_TYPE@[27; 29) | ||
41 | L_PAREN@[27; 28) | ||
42 | R_PAREN@[28; 29) | ||
43 | R_ANGLE@[29; 30) | ||
44 | SEMI@[30; 31) | ||
45 | WHITESPACE@[31; 32) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0094_range_pat.rs b/crates/libsyntax2/tests/data/parser/inline/0094_range_pat.rs new file mode 100644 index 000000000..657467e75 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0094_range_pat.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn main() { | ||
2 | match 92 { 0 ... 100 => () } | ||
3 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0094_range_pat.txt b/crates/libsyntax2/tests/data/parser/inline/0094_range_pat.txt new file mode 100644 index 000000000..cb858044a --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0094_range_pat.txt | |||
@@ -0,0 +1,41 @@ | |||
1 | FILE@[0; 47) | ||
2 | FUNCTION@[0; 46) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 7) | ||
6 | IDENT@[3; 7) "main" | ||
7 | PARAM_LIST@[7; 9) | ||
8 | L_PAREN@[7; 8) | ||
9 | R_PAREN@[8; 9) | ||
10 | WHITESPACE@[9; 10) | ||
11 | BLOCK_EXPR@[10; 46) | ||
12 | L_CURLY@[10; 11) | ||
13 | WHITESPACE@[11; 16) | ||
14 | MATCH_EXPR@[16; 44) | ||
15 | MATCH_KW@[16; 21) | ||
16 | WHITESPACE@[21; 22) | ||
17 | LITERAL@[22; 24) | ||
18 | INT_NUMBER@[22; 24) "92" | ||
19 | WHITESPACE@[24; 25) | ||
20 | L_CURLY@[25; 26) | ||
21 | WHITESPACE@[26; 27) | ||
22 | MATCH_ARM@[27; 42) | ||
23 | RANGE_PAT@[27; 36) | ||
24 | LITERAL@[27; 28) | ||
25 | INT_NUMBER@[27; 28) "0" | ||
26 | WHITESPACE@[28; 29) | ||
27 | DOTDOTDOT@[29; 32) | ||
28 | WHITESPACE@[32; 33) | ||
29 | LITERAL@[33; 36) | ||
30 | INT_NUMBER@[33; 36) "100" | ||
31 | WHITESPACE@[36; 37) | ||
32 | FAT_ARROW@[37; 39) | ||
33 | WHITESPACE@[39; 40) | ||
34 | TUPLE_EXPR@[40; 42) | ||
35 | L_PAREN@[40; 41) | ||
36 | R_PAREN@[41; 42) | ||
37 | WHITESPACE@[42; 43) | ||
38 | R_CURLY@[43; 44) | ||
39 | WHITESPACE@[44; 45) | ||
40 | R_CURLY@[45; 46) | ||
41 | WHITESPACE@[46; 47) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0095_path_type_with_bounds.rs b/crates/libsyntax2/tests/data/parser/inline/0095_path_type_with_bounds.rs new file mode 100644 index 000000000..215210e27 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0095_path_type_with_bounds.rs | |||
@@ -0,0 +1 @@ | |||
fn foo() -> Box<T + 'f> {} | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0095_path_type_with_bounds.txt b/crates/libsyntax2/tests/data/parser/inline/0095_path_type_with_bounds.txt new file mode 100644 index 000000000..57c38e7ee --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0095_path_type_with_bounds.txt | |||
@@ -0,0 +1,35 @@ | |||
1 | FILE@[0; 27) | ||
2 | FUNCTION@[0; 26) | ||
3 | FN_KW@[0; 2) | ||
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 | THIN_ARROW@[9; 11) | ||
12 | WHITESPACE@[11; 12) | ||
13 | PATH_TYPE@[12; 23) | ||
14 | PATH@[12; 23) | ||
15 | PATH_SEGMENT@[12; 23) | ||
16 | NAME_REF@[12; 15) | ||
17 | IDENT@[12; 15) "Box" | ||
18 | TYPE_ARG_LIST@[15; 23) | ||
19 | L_ANGLE@[15; 16) | ||
20 | TYPE_ARG@[16; 22) | ||
21 | PATH_TYPE@[16; 22) | ||
22 | PATH@[16; 17) | ||
23 | PATH_SEGMENT@[16; 17) | ||
24 | NAME_REF@[16; 17) | ||
25 | IDENT@[16; 17) "T" | ||
26 | WHITESPACE@[17; 18) | ||
27 | PLUS@[18; 19) | ||
28 | WHITESPACE@[19; 20) | ||
29 | LIFETIME@[20; 22) "'f" | ||
30 | R_ANGLE@[22; 23) | ||
31 | WHITESPACE@[23; 24) | ||
32 | BLOCK_EXPR@[24; 26) | ||
33 | L_CURLY@[24; 25) | ||
34 | R_CURLY@[25; 26) | ||
35 | WHITESPACE@[26; 27) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0096_value_parameters_no_patterns.rs b/crates/libsyntax2/tests/data/parser/inline/0096_value_parameters_no_patterns.rs new file mode 100644 index 000000000..d8c23c76a --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0096_value_parameters_no_patterns.rs | |||
@@ -0,0 +1 @@ | |||
type F = Box<Fn(a: i32, &b: &i32, &mut c: &i32, ())>; | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0096_value_parameters_no_patterns.txt b/crates/libsyntax2/tests/data/parser/inline/0096_value_parameters_no_patterns.txt new file mode 100644 index 000000000..c3f9bf685 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0096_value_parameters_no_patterns.txt | |||
@@ -0,0 +1,81 @@ | |||
1 | FILE@[0; 54) | ||
2 | TYPE_ITEM@[0; 53) | ||
3 | TYPE_KW@[0; 4) | ||
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) | ||
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) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0097_param_list_opt_patterns.rs b/crates/libsyntax2/tests/data/parser/inline/0097_param_list_opt_patterns.rs new file mode 100644 index 000000000..9b93442c0 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0097_param_list_opt_patterns.rs | |||
@@ -0,0 +1 @@ | |||
fn foo<F: FnMut(&mut Foo<'a>)>(){} | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0097_param_list_opt_patterns.txt b/crates/libsyntax2/tests/data/parser/inline/0097_param_list_opt_patterns.txt new file mode 100644 index 000000000..4cb3bdac5 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0097_param_list_opt_patterns.txt | |||
@@ -0,0 +1,43 @@ | |||
1 | FILE@[0; 35) | ||
2 | FUNCTION@[0; 34) | ||
3 | FN_KW@[0; 2) | ||
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 | PATH@[10; 29) | ||
15 | PATH_SEGMENT@[10; 29) | ||
16 | NAME_REF@[10; 15) | ||
17 | IDENT@[10; 15) "FnMut" | ||
18 | PARAM_LIST@[15; 29) | ||
19 | L_PAREN@[15; 16) | ||
20 | PARAM@[16; 28) | ||
21 | REFERENCE_TYPE@[16; 28) | ||
22 | AMP@[16; 17) | ||
23 | MUT_KW@[17; 20) | ||
24 | WHITESPACE@[20; 21) | ||
25 | PATH_TYPE@[21; 28) | ||
26 | PATH@[21; 28) | ||
27 | PATH_SEGMENT@[21; 28) | ||
28 | NAME_REF@[21; 24) | ||
29 | IDENT@[21; 24) "Foo" | ||
30 | TYPE_ARG_LIST@[24; 28) | ||
31 | L_ANGLE@[24; 25) | ||
32 | LIFETIME_ARG@[25; 27) | ||
33 | LIFETIME@[25; 27) "'a" | ||
34 | R_ANGLE@[27; 28) | ||
35 | R_PAREN@[28; 29) | ||
36 | R_ANGLE@[29; 30) | ||
37 | PARAM_LIST@[30; 32) | ||
38 | L_PAREN@[30; 31) | ||
39 | R_PAREN@[31; 32) | ||
40 | BLOCK_EXPR@[32; 34) | ||
41 | L_CURLY@[32; 33) | ||
42 | R_CURLY@[33; 34) | ||
43 | WHITESPACE@[34; 35) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0098_where_clause.rs b/crates/libsyntax2/tests/data/parser/inline/0098_where_clause.rs new file mode 100644 index 000000000..592a005f9 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0098_where_clause.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | fn foo() | ||
2 | where | ||
3 | 'a: 'b + 'c, | ||
4 | T: Clone + Copy + 'static, | ||
5 | Iterator::Item: 'a, | ||
6 | {} | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0098_where_clause.txt b/crates/libsyntax2/tests/data/parser/inline/0098_where_clause.txt new file mode 100644 index 000000000..150f125a7 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0098_where_clause.txt | |||
@@ -0,0 +1,69 @@ | |||
1 | FILE@[0; 87) | ||
2 | FUNCTION@[0; 86) | ||
3 | FN_KW@[0; 2) | ||
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 | WHERE_CLAUSE@[9; 83) | ||
12 | WHERE_KW@[9; 14) | ||
13 | WHITESPACE@[14; 18) | ||
14 | WHERE_PRED@[18; 29) | ||
15 | LIFETIME@[18; 20) "'a" | ||
16 | COLON@[20; 21) | ||
17 | WHITESPACE@[21; 22) | ||
18 | LIFETIME@[22; 24) "'b" | ||
19 | WHITESPACE@[24; 25) | ||
20 | PLUS@[25; 26) | ||
21 | WHITESPACE@[26; 27) | ||
22 | LIFETIME@[27; 29) "'c" | ||
23 | COMMA@[29; 30) | ||
24 | WHITESPACE@[30; 34) | ||
25 | WHERE_PRED@[34; 59) | ||
26 | PATH_TYPE@[34; 35) | ||
27 | PATH@[34; 35) | ||
28 | PATH_SEGMENT@[34; 35) | ||
29 | NAME_REF@[34; 35) | ||
30 | IDENT@[34; 35) "T" | ||
31 | COLON@[35; 36) | ||
32 | WHITESPACE@[36; 37) | ||
33 | PATH@[37; 42) | ||
34 | PATH_SEGMENT@[37; 42) | ||
35 | NAME_REF@[37; 42) | ||
36 | IDENT@[37; 42) "Clone" | ||
37 | WHITESPACE@[42; 43) | ||
38 | PLUS@[43; 44) | ||
39 | WHITESPACE@[44; 45) | ||
40 | PATH@[45; 49) | ||
41 | PATH_SEGMENT@[45; 49) | ||
42 | NAME_REF@[45; 49) | ||
43 | IDENT@[45; 49) "Copy" | ||
44 | WHITESPACE@[49; 50) | ||
45 | PLUS@[50; 51) | ||
46 | WHITESPACE@[51; 52) | ||
47 | LIFETIME@[52; 59) "'static" | ||
48 | COMMA@[59; 60) | ||
49 | WHITESPACE@[60; 64) | ||
50 | WHERE_PRED@[64; 82) | ||
51 | PATH_TYPE@[64; 78) | ||
52 | PATH@[64; 78) | ||
53 | PATH@[64; 72) | ||
54 | PATH_SEGMENT@[64; 72) | ||
55 | NAME_REF@[64; 72) | ||
56 | IDENT@[64; 72) "Iterator" | ||
57 | COLONCOLON@[72; 74) | ||
58 | PATH_SEGMENT@[74; 78) | ||
59 | NAME_REF@[74; 78) | ||
60 | IDENT@[74; 78) "Item" | ||
61 | COLON@[78; 79) | ||
62 | WHITESPACE@[79; 80) | ||
63 | LIFETIME@[80; 82) "'a" | ||
64 | COMMA@[82; 83) | ||
65 | WHITESPACE@[83; 84) | ||
66 | BLOCK_EXPR@[84; 86) | ||
67 | L_CURLY@[84; 85) | ||
68 | R_CURLY@[85; 86) | ||
69 | WHITESPACE@[86; 87) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0099_crate_keyword_vis.rs b/crates/libsyntax2/tests/data/parser/inline/0099_crate_keyword_vis.rs new file mode 100644 index 000000000..660d927cf --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0099_crate_keyword_vis.rs | |||
@@ -0,0 +1 @@ | |||
crate fn main() { } | |||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0099_crate_keyword_vis.txt b/crates/libsyntax2/tests/data/parser/inline/0099_crate_keyword_vis.txt new file mode 100644 index 000000000..a830d99d9 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0099_crate_keyword_vis.txt | |||
@@ -0,0 +1,18 @@ | |||
1 | FILE@[0; 20) | ||
2 | FUNCTION@[0; 19) | ||
3 | VISIBILITY@[0; 5) | ||
4 | CRATE_KW@[0; 5) | ||
5 | WHITESPACE@[5; 6) | ||
6 | FN_KW@[6; 8) | ||
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_EXPR@[16; 19) | ||
15 | L_CURLY@[16; 17) | ||
16 | WHITESPACE@[17; 18) | ||
17 | R_CURLY@[18; 19) | ||
18 | WHITESPACE@[19; 20) | ||