diff options
author | pcpthm <[email protected]> | 2019-03-18 05:34:08 +0000 |
---|---|---|
committer | pcpthm <[email protected]> | 2019-03-18 05:34:08 +0000 |
commit | 76075c74103b3204ebc1bde54a330629d9e00811 (patch) | |
tree | 316ffdffb672856e7d897736e280261a11a07efd /crates/ra_syntax/tests/data/parser/inline/ok | |
parent | 3d9c2beb8e0d4e0fbaded7dac259cadf7616a3ad (diff) |
Use Marker argument for item parsers
- Fix pub_expr
- Fix incorrect parsing of crate::path
Diffstat (limited to 'crates/ra_syntax/tests/data/parser/inline/ok')
6 files changed, 79 insertions, 27 deletions
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0035_pub_expr.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0035_pub_expr.rs deleted file mode 100644 index d9d99d2d3..000000000 --- a/crates/ra_syntax/tests/data/parser/inline/ok/0035_pub_expr.rs +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | fn foo() { pub 92; } //FIXME | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0035_pub_expr.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0035_pub_expr.txt deleted file mode 100644 index de20eee7a..000000000 --- a/crates/ra_syntax/tests/data/parser/inline/ok/0035_pub_expr.txt +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | SOURCE_FILE@[0; 29) | ||
2 | FN_DEF@[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@[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/ra_syntax/tests/data/parser/inline/ok/0040_crate_keyword_vis.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0040_crate_keyword_vis.rs index 660d927cf..e2b5f2161 100644 --- a/crates/ra_syntax/tests/data/parser/inline/ok/0040_crate_keyword_vis.rs +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0040_crate_keyword_vis.rs | |||
@@ -1 +1,3 @@ | |||
1 | crate fn main() { } | 1 | crate fn main() { } |
2 | struct S { crate field: u32 } | ||
3 | struct T(crate u32); | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0040_crate_keyword_vis.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0040_crate_keyword_vis.txt index ff5add838..695734d54 100644 --- a/crates/ra_syntax/tests/data/parser/inline/ok/0040_crate_keyword_vis.txt +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0040_crate_keyword_vis.txt | |||
@@ -1,4 +1,4 @@ | |||
1 | SOURCE_FILE@[0; 20) | 1 | SOURCE_FILE@[0; 71) |
2 | FN_DEF@[0; 19) | 2 | FN_DEF@[0; 19) |
3 | VISIBILITY@[0; 5) | 3 | VISIBILITY@[0; 5) |
4 | CRATE_KW@[0; 5) | 4 | CRATE_KW@[0; 5) |
@@ -16,3 +16,47 @@ SOURCE_FILE@[0; 20) | |||
16 | WHITESPACE@[17; 18) | 16 | WHITESPACE@[17; 18) |
17 | R_CURLY@[18; 19) | 17 | R_CURLY@[18; 19) |
18 | WHITESPACE@[19; 20) | 18 | WHITESPACE@[19; 20) |
19 | STRUCT_DEF@[20; 49) | ||
20 | STRUCT_KW@[20; 26) | ||
21 | WHITESPACE@[26; 27) | ||
22 | NAME@[27; 28) | ||
23 | IDENT@[27; 28) "S" | ||
24 | WHITESPACE@[28; 29) | ||
25 | NAMED_FIELD_DEF_LIST@[29; 49) | ||
26 | L_CURLY@[29; 30) | ||
27 | WHITESPACE@[30; 31) | ||
28 | NAMED_FIELD_DEF@[31; 47) | ||
29 | VISIBILITY@[31; 36) | ||
30 | CRATE_KW@[31; 36) | ||
31 | WHITESPACE@[36; 37) | ||
32 | NAME@[37; 42) | ||
33 | IDENT@[37; 42) "field" | ||
34 | COLON@[42; 43) | ||
35 | WHITESPACE@[43; 44) | ||
36 | PATH_TYPE@[44; 47) | ||
37 | PATH@[44; 47) | ||
38 | PATH_SEGMENT@[44; 47) | ||
39 | NAME_REF@[44; 47) | ||
40 | IDENT@[44; 47) "u32" | ||
41 | WHITESPACE@[47; 48) | ||
42 | R_CURLY@[48; 49) | ||
43 | WHITESPACE@[49; 50) | ||
44 | STRUCT_DEF@[50; 70) | ||
45 | STRUCT_KW@[50; 56) | ||
46 | WHITESPACE@[56; 57) | ||
47 | NAME@[57; 58) | ||
48 | IDENT@[57; 58) "T" | ||
49 | POS_FIELD_DEF_LIST@[58; 69) | ||
50 | L_PAREN@[58; 59) | ||
51 | POS_FIELD_DEF@[59; 68) | ||
52 | VISIBILITY@[59; 64) | ||
53 | CRATE_KW@[59; 64) | ||
54 | WHITESPACE@[64; 65) | ||
55 | PATH_TYPE@[65; 68) | ||
56 | PATH@[65; 68) | ||
57 | PATH_SEGMENT@[65; 68) | ||
58 | NAME_REF@[65; 68) | ||
59 | IDENT@[65; 68) "u32" | ||
60 | R_PAREN@[68; 69) | ||
61 | SEMI@[69; 70) | ||
62 | WHITESPACE@[70; 71) | ||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0125_crate_keyword_path.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0125_crate_keyword_path.rs new file mode 100644 index 000000000..0f454d121 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0125_crate_keyword_path.rs | |||
@@ -0,0 +1 @@ | |||
fn foo() { crate::foo(); } | |||
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0125_crate_keyword_path.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0125_crate_keyword_path.txt new file mode 100644 index 000000000..7c637b079 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0125_crate_keyword_path.txt | |||
@@ -0,0 +1,31 @@ | |||
1 | SOURCE_FILE@[0; 27) | ||
2 | FN_DEF@[0; 26) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK@[9; 26) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 11) | ||
14 | EXPR_STMT@[11; 24) | ||
15 | CALL_EXPR@[11; 23) | ||
16 | PATH_EXPR@[11; 21) | ||
17 | PATH@[11; 21) | ||
18 | PATH@[11; 16) | ||
19 | PATH_SEGMENT@[11; 16) | ||
20 | CRATE_KW@[11; 16) | ||
21 | COLONCOLON@[16; 18) | ||
22 | PATH_SEGMENT@[18; 21) | ||
23 | NAME_REF@[18; 21) | ||
24 | IDENT@[18; 21) "foo" | ||
25 | ARG_LIST@[21; 23) | ||
26 | L_PAREN@[21; 22) | ||
27 | R_PAREN@[22; 23) | ||
28 | SEMI@[23; 24) | ||
29 | WHITESPACE@[24; 25) | ||
30 | R_CURLY@[25; 26) | ||
31 | WHITESPACE@[26; 27) | ||