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/inline | |
parent | 7264c3294b3c460da459774058c9b9fa77edac12 (diff) |
refine item parsing
Diffstat (limited to 'tests/data/parser/inline')
7 files changed, 37 insertions, 24 deletions
diff --git a/tests/data/parser/inline/0006_extern_struct.rs b/tests/data/parser/inline/0006_extern_struct.rs deleted file mode 100644 index c1bd0a2d1..000000000 --- a/tests/data/parser/inline/0006_extern_struct.rs +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | extern struct Foo; | ||
diff --git a/tests/data/parser/inline/0006_extern_struct.txt b/tests/data/parser/inline/0006_extern_struct.txt deleted file mode 100644 index f310e1225..000000000 --- a/tests/data/parser/inline/0006_extern_struct.txt +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | FILE@[0; 19) | ||
2 | ABI@[0; 7) | ||
3 | EXTERN_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | err: `expected `fn` or `{`` | ||
6 | STRUCT_ITEM@[7; 19) | ||
7 | STRUCT_KW@[7; 13) | ||
8 | NAME@[13; 17) | ||
9 | WHITESPACE@[13; 14) | ||
10 | IDENT@[14; 17) "Foo" | ||
11 | SEMI@[17; 18) | ||
12 | WHITESPACE@[18; 19) | ||
diff --git a/tests/data/parser/inline/0013_unsafe_block_in_mod.txt b/tests/data/parser/inline/0013_unsafe_block_in_mod.txt index e5581d615..142838692 100644 --- a/tests/data/parser/inline/0013_unsafe_block_in_mod.txt +++ b/tests/data/parser/inline/0013_unsafe_block_in_mod.txt | |||
@@ -11,10 +11,12 @@ FILE@[0; 33) | |||
11 | L_CURLY@[8; 9) | 11 | L_CURLY@[8; 9) |
12 | R_CURLY@[9; 10) | 12 | R_CURLY@[9; 10) |
13 | WHITESPACE@[10; 11) | 13 | WHITESPACE@[10; 11) |
14 | UNSAFE_KW@[11; 17) | 14 | err: `expected an item` |
15 | err: `expected `trait`, `impl` or `fn`` | 15 | ERROR@[11; 18) |
16 | ERROR@[17; 22) | 16 | UNSAFE_KW@[11; 17) |
17 | WHITESPACE@[17; 18) | 17 | WHITESPACE@[17; 18) |
18 | err: `expected an item` | ||
19 | ERROR@[18; 22) | ||
18 | L_CURLY@[18; 19) | 20 | L_CURLY@[18; 19) |
19 | WHITESPACE@[19; 20) | 21 | WHITESPACE@[19; 20) |
20 | R_CURLY@[20; 21) | 22 | R_CURLY@[20; 21) |
diff --git a/tests/data/parser/inline/0023_array_type_missing_semi.txt b/tests/data/parser/inline/0023_array_type_missing_semi.txt index f3e9ffe4a..aa600eab4 100644 --- a/tests/data/parser/inline/0023_array_type_missing_semi.txt +++ b/tests/data/parser/inline/0023_array_type_missing_semi.txt | |||
@@ -15,14 +15,13 @@ FILE@[0; 18) | |||
15 | WHITESPACE@[12; 13) | 15 | WHITESPACE@[12; 13) |
16 | err: `expected `;` or `]`` | 16 | err: `expected `;` or `]`` |
17 | err: `expected SEMI` | 17 | err: `expected SEMI` |
18 | err: `expected item` | 18 | err: `expected an item` |
19 | ERROR@[13; 15) | 19 | ERROR@[13; 15) |
20 | INT_NUMBER@[13; 15) "92" | 20 | INT_NUMBER@[13; 15) "92" |
21 | err: `expected item` | 21 | err: `expected an item` |
22 | ERROR@[15; 16) | 22 | ERROR@[15; 16) |
23 | R_BRACK@[15; 16) | 23 | R_BRACK@[15; 16) |
24 | err: `expected item, found `;` | 24 | err: `expected an item` |
25 | consider removing this semicolon` | ||
26 | ERROR@[16; 18) | 25 | ERROR@[16; 18) |
27 | SEMI@[16; 17) | 26 | SEMI@[16; 17) |
28 | WHITESPACE@[17; 18) | 27 | WHITESPACE@[17; 18) |
diff --git a/tests/data/parser/inline/0029_fn_pointer_type_missing_fn.txt b/tests/data/parser/inline/0029_fn_pointer_type_missing_fn.txt index c99714ed4..82632b7bf 100644 --- a/tests/data/parser/inline/0029_fn_pointer_type_missing_fn.txt +++ b/tests/data/parser/inline/0029_fn_pointer_type_missing_fn.txt | |||
@@ -11,14 +11,13 @@ FILE@[0; 20) | |||
11 | err: `expected `fn`` | 11 | err: `expected `fn`` |
12 | err: `expected SEMI` | 12 | err: `expected SEMI` |
13 | WHITESPACE@[15; 16) | 13 | WHITESPACE@[15; 16) |
14 | err: `expected item` | 14 | err: `expected an item` |
15 | ERROR@[16; 17) | 15 | ERROR@[16; 17) |
16 | L_PAREN@[16; 17) | 16 | L_PAREN@[16; 17) |
17 | err: `expected item` | 17 | err: `expected an item` |
18 | ERROR@[17; 18) | 18 | ERROR@[17; 18) |
19 | R_PAREN@[17; 18) | 19 | R_PAREN@[17; 18) |
20 | err: `expected item, found `;` | 20 | err: `expected an item` |
21 | consider removing this semicolon` | ||
22 | ERROR@[18; 20) | 21 | ERROR@[18; 20) |
23 | SEMI@[18; 19) | 22 | SEMI@[18; 19) |
24 | WHITESPACE@[19; 20) | 23 | WHITESPACE@[19; 20) |
diff --git a/tests/data/parser/inline/0068_pub_expr.rs b/tests/data/parser/inline/0068_pub_expr.rs new file mode 100644 index 000000000..d9d99d2d3 --- /dev/null +++ b/tests/data/parser/inline/0068_pub_expr.rs | |||
@@ -0,0 +1 @@ | |||
fn foo() { pub 92; } //FIXME | |||
diff --git a/tests/data/parser/inline/0068_pub_expr.txt b/tests/data/parser/inline/0068_pub_expr.txt new file mode 100644 index 000000000..09cf9b262 --- /dev/null +++ b/tests/data/parser/inline/0068_pub_expr.txt | |||
@@ -0,0 +1,25 @@ | |||
1 | FILE@[0; 29) | ||
2 | FN_ITEM@[0; 29) | ||
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; 29) | ||
12 | L_CURLY@[9; 10) | ||
13 | EXPR_STMT@[10; 19) | ||
14 | VISIBILITY@[10; 15) | ||
15 | WHITESPACE@[10; 11) | ||
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) | ||