diff options
author | Aleksey Kladov <[email protected]> | 2018-08-04 11:17:24 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-08-04 11:17:24 +0100 |
commit | e919db3731968ae7a6877530d2cb645b0495d5fd (patch) | |
tree | 02c8f9a9accf0db8f89bdf9c8a8293a81f557568 /tests/data/parser/ok | |
parent | 7264c3294b3c460da459774058c9b9fa77edac12 (diff) |
refine item parsing
Diffstat (limited to 'tests/data/parser/ok')
-rw-r--r-- | tests/data/parser/ok/0025_extern_fn_in_block.rs | 3 | ||||
-rw-r--r-- | tests/data/parser/ok/0025_extern_fn_in_block.txt | 31 | ||||
-rw-r--r-- | tests/data/parser/ok/0026_const_fn_in_block.rs | 3 | ||||
-rw-r--r-- | tests/data/parser/ok/0026_const_fn_in_block.txt | 30 | ||||
-rw-r--r-- | tests/data/parser/ok/0027_unsafe_fn_in_block.rs | 4 | ||||
-rw-r--r-- | tests/data/parser/ok/0027_unsafe_fn_in_block.txt | 40 |
6 files changed, 111 insertions, 0 deletions
diff --git a/tests/data/parser/ok/0025_extern_fn_in_block.rs b/tests/data/parser/ok/0025_extern_fn_in_block.rs new file mode 100644 index 000000000..289809809 --- /dev/null +++ b/tests/data/parser/ok/0025_extern_fn_in_block.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn main() { | ||
2 | extern fn f() {} | ||
3 | } | ||
diff --git a/tests/data/parser/ok/0025_extern_fn_in_block.txt b/tests/data/parser/ok/0025_extern_fn_in_block.txt new file mode 100644 index 000000000..0623740aa --- /dev/null +++ b/tests/data/parser/ok/0025_extern_fn_in_block.txt | |||
@@ -0,0 +1,31 @@ | |||
1 | FILE@[0; 35) | ||
2 | FN_ITEM@[0; 35) | ||
3 | FN_KW@[0; 2) | ||
4 | NAME@[2; 7) | ||
5 | WHITESPACE@[2; 3) | ||
6 | IDENT@[3; 7) "main" | ||
7 | PARAM_LIST@[7; 10) | ||
8 | L_PAREN@[7; 8) | ||
9 | R_PAREN@[8; 9) | ||
10 | WHITESPACE@[9; 10) | ||
11 | BLOCK_EXPR@[10; 35) | ||
12 | L_CURLY@[10; 11) | ||
13 | FN_ITEM@[11; 33) | ||
14 | ABI@[11; 23) | ||
15 | WHITESPACE@[11; 16) | ||
16 | EXTERN_KW@[16; 22) | ||
17 | WHITESPACE@[22; 23) | ||
18 | FN_KW@[23; 25) | ||
19 | NAME@[25; 27) | ||
20 | WHITESPACE@[25; 26) | ||
21 | IDENT@[26; 27) "f" | ||
22 | PARAM_LIST@[27; 30) | ||
23 | L_PAREN@[27; 28) | ||
24 | R_PAREN@[28; 29) | ||
25 | WHITESPACE@[29; 30) | ||
26 | BLOCK_EXPR@[30; 33) | ||
27 | L_CURLY@[30; 31) | ||
28 | R_CURLY@[31; 32) | ||
29 | WHITESPACE@[32; 33) | ||
30 | R_CURLY@[33; 34) | ||
31 | WHITESPACE@[34; 35) | ||
diff --git a/tests/data/parser/ok/0026_const_fn_in_block.rs b/tests/data/parser/ok/0026_const_fn_in_block.rs new file mode 100644 index 000000000..7641a3d28 --- /dev/null +++ b/tests/data/parser/ok/0026_const_fn_in_block.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn main() { | ||
2 | const fn f() {} | ||
3 | } | ||
diff --git a/tests/data/parser/ok/0026_const_fn_in_block.txt b/tests/data/parser/ok/0026_const_fn_in_block.txt new file mode 100644 index 000000000..329c65846 --- /dev/null +++ b/tests/data/parser/ok/0026_const_fn_in_block.txt | |||
@@ -0,0 +1,30 @@ | |||
1 | FILE@[0; 34) | ||
2 | FN_ITEM@[0; 34) | ||
3 | FN_KW@[0; 2) | ||
4 | NAME@[2; 7) | ||
5 | WHITESPACE@[2; 3) | ||
6 | IDENT@[3; 7) "main" | ||
7 | PARAM_LIST@[7; 10) | ||
8 | L_PAREN@[7; 8) | ||
9 | R_PAREN@[8; 9) | ||
10 | WHITESPACE@[9; 10) | ||
11 | BLOCK_EXPR@[10; 34) | ||
12 | L_CURLY@[10; 11) | ||
13 | FN_ITEM@[11; 32) | ||
14 | WHITESPACE@[11; 16) | ||
15 | CONST_KW@[16; 21) | ||
16 | WHITESPACE@[21; 22) | ||
17 | FN_KW@[22; 24) | ||
18 | NAME@[24; 26) | ||
19 | WHITESPACE@[24; 25) | ||
20 | IDENT@[25; 26) "f" | ||
21 | PARAM_LIST@[26; 29) | ||
22 | L_PAREN@[26; 27) | ||
23 | R_PAREN@[27; 28) | ||
24 | WHITESPACE@[28; 29) | ||
25 | BLOCK_EXPR@[29; 32) | ||
26 | L_CURLY@[29; 30) | ||
27 | R_CURLY@[30; 31) | ||
28 | WHITESPACE@[31; 32) | ||
29 | R_CURLY@[32; 33) | ||
30 | WHITESPACE@[33; 34) | ||
diff --git a/tests/data/parser/ok/0027_unsafe_fn_in_block.rs b/tests/data/parser/ok/0027_unsafe_fn_in_block.rs new file mode 100644 index 000000000..f3c5ff938 --- /dev/null +++ b/tests/data/parser/ok/0027_unsafe_fn_in_block.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn main() { | ||
2 | unsafe fn f() {} | ||
3 | unsafe { 92 } | ||
4 | } | ||
diff --git a/tests/data/parser/ok/0027_unsafe_fn_in_block.txt b/tests/data/parser/ok/0027_unsafe_fn_in_block.txt new file mode 100644 index 000000000..9982d0308 --- /dev/null +++ b/tests/data/parser/ok/0027_unsafe_fn_in_block.txt | |||
@@ -0,0 +1,40 @@ | |||
1 | FILE@[0; 53) | ||
2 | FN_ITEM@[0; 53) | ||
3 | FN_KW@[0; 2) | ||
4 | NAME@[2; 7) | ||
5 | WHITESPACE@[2; 3) | ||
6 | IDENT@[3; 7) "main" | ||
7 | PARAM_LIST@[7; 10) | ||
8 | L_PAREN@[7; 8) | ||
9 | R_PAREN@[8; 9) | ||
10 | WHITESPACE@[9; 10) | ||
11 | BLOCK_EXPR@[10; 53) | ||
12 | L_CURLY@[10; 11) | ||
13 | FN_ITEM@[11; 37) | ||
14 | WHITESPACE@[11; 16) | ||
15 | UNSAFE_KW@[16; 22) | ||
16 | WHITESPACE@[22; 23) | ||
17 | FN_KW@[23; 25) | ||
18 | NAME@[25; 27) | ||
19 | WHITESPACE@[25; 26) | ||
20 | IDENT@[26; 27) "f" | ||
21 | PARAM_LIST@[27; 30) | ||
22 | L_PAREN@[27; 28) | ||
23 | R_PAREN@[28; 29) | ||
24 | WHITESPACE@[29; 30) | ||
25 | BLOCK_EXPR@[30; 37) | ||
26 | L_CURLY@[30; 31) | ||
27 | R_CURLY@[31; 32) | ||
28 | WHITESPACE@[32; 37) | ||
29 | BLOCK_EXPR@[37; 51) | ||
30 | UNSAFE_KW@[37; 43) | ||
31 | WHITESPACE@[43; 44) | ||
32 | L_CURLY@[44; 45) | ||
33 | LITERAL@[45; 49) | ||
34 | WHITESPACE@[45; 46) | ||
35 | INT_NUMBER@[46; 48) "92" | ||
36 | WHITESPACE@[48; 49) | ||
37 | R_CURLY@[49; 50) | ||
38 | WHITESPACE@[50; 51) | ||
39 | R_CURLY@[51; 52) | ||
40 | WHITESPACE@[52; 53) | ||