diff options
Diffstat (limited to 'crates/ra_syntax/test_data/parser/inline/err')
12 files changed, 71 insertions, 19 deletions
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0001_array_type_missing_semi.rast b/crates/ra_syntax/test_data/parser/inline/err/0001_array_type_missing_semi.rast index 530533b71..9d807c84f 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0001_array_type_missing_semi.rast +++ b/crates/ra_syntax/test_data/parser/inline/err/0001_array_type_missing_semi.rast | |||
@@ -18,10 +18,10 @@ SOURCE_FILE@[0; 18) | |||
18 | ERROR@[15; 16) | 18 | ERROR@[15; 16) |
19 | R_BRACK@[15; 16) "]" | 19 | R_BRACK@[15; 16) "]" |
20 | ERROR@[16; 17) | 20 | ERROR@[16; 17) |
21 | SEMI@[16; 17) ";" | 21 | SEMICOLON@[16; 17) ";" |
22 | WHITESPACE@[17; 18) "\n" | 22 | WHITESPACE@[17; 18) "\n" |
23 | error [12; 12): expected `;` or `]` | 23 | error [12; 12): expected `;` or `]` |
24 | error [12; 12): expected SEMI | 24 | error [12; 12): expected SEMICOLON |
25 | error [13; 13): expected an item | 25 | error [13; 13): expected an item |
26 | error [15; 15): expected an item | 26 | error [15; 15): expected an item |
27 | error [16; 16): expected an item | 27 | error [16; 16): expected an item |
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0002_misplaced_label_err.rast b/crates/ra_syntax/test_data/parser/inline/err/0002_misplaced_label_err.rast index 01a853d63..a85855f8c 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0002_misplaced_label_err.rast +++ b/crates/ra_syntax/test_data/parser/inline/err/0002_misplaced_label_err.rast | |||
@@ -24,6 +24,6 @@ SOURCE_FILE@[0; 30) | |||
24 | R_CURLY@[28; 29) "}" | 24 | R_CURLY@[28; 29) "}" |
25 | WHITESPACE@[29; 30) "\n" | 25 | WHITESPACE@[29; 30) "\n" |
26 | error [22; 22): expected a loop | 26 | error [22; 22): expected a loop |
27 | error [22; 22): expected SEMI | 27 | error [22; 22): expected SEMICOLON |
28 | error [27; 27): expected type | 28 | error [27; 27): expected type |
29 | error [27; 27): expected `{` | 29 | error [27; 27): expected `{` |
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0003_pointer_type_no_mutability.rast b/crates/ra_syntax/test_data/parser/inline/err/0003_pointer_type_no_mutability.rast index 2ab29eecc..e9efad674 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0003_pointer_type_no_mutability.rast +++ b/crates/ra_syntax/test_data/parser/inline/err/0003_pointer_type_no_mutability.rast | |||
@@ -12,6 +12,6 @@ SOURCE_FILE@[0; 14) | |||
12 | TUPLE_TYPE@[10; 12) | 12 | TUPLE_TYPE@[10; 12) |
13 | L_PAREN@[10; 11) "(" | 13 | L_PAREN@[10; 11) "(" |
14 | R_PAREN@[11; 12) ")" | 14 | R_PAREN@[11; 12) ")" |
15 | SEMI@[12; 13) ";" | 15 | SEMICOLON@[12; 13) ";" |
16 | WHITESPACE@[13; 14) "\n" | 16 | WHITESPACE@[13; 14) "\n" |
17 | error [10; 10): expected mut or const in raw pointer type (use `*mut T` or `*const T` as appropriate) | 17 | error [10; 10): expected mut or const in raw pointer type (use `*mut T` or `*const T` as appropriate) |
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.rast b/crates/ra_syntax/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.rast index 9e9186ad4..b8a494085 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.rast +++ b/crates/ra_syntax/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.rast | |||
@@ -14,10 +14,10 @@ SOURCE_FILE@[0; 20) | |||
14 | ERROR@[17; 18) | 14 | ERROR@[17; 18) |
15 | R_PAREN@[17; 18) ")" | 15 | R_PAREN@[17; 18) ")" |
16 | ERROR@[18; 19) | 16 | ERROR@[18; 19) |
17 | SEMI@[18; 19) ";" | 17 | SEMICOLON@[18; 19) ";" |
18 | WHITESPACE@[19; 20) "\n" | 18 | WHITESPACE@[19; 20) "\n" |
19 | error [15; 15): expected `fn` | 19 | error [15; 15): expected `fn` |
20 | error [15; 15): expected SEMI | 20 | error [15; 15): expected SEMICOLON |
21 | error [16; 16): expected an item | 21 | error [16; 16): expected an item |
22 | error [17; 17): expected an item | 22 | error [17; 17): expected an item |
23 | error [18; 18): expected an item | 23 | error [18; 18): expected an item |
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0007_async_without_semicolon.rast b/crates/ra_syntax/test_data/parser/inline/err/0007_async_without_semicolon.rast index a4002a998..c3f7eb477 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0007_async_without_semicolon.rast +++ b/crates/ra_syntax/test_data/parser/inline/err/0007_async_without_semicolon.rast | |||
@@ -29,4 +29,4 @@ SOURCE_FILE@[0; 30) | |||
29 | WHITESPACE@[27; 28) " " | 29 | WHITESPACE@[27; 28) " " |
30 | R_CURLY@[28; 29) "}" | 30 | R_CURLY@[28; 29) "}" |
31 | WHITESPACE@[29; 30) "\n" | 31 | WHITESPACE@[29; 30) "\n" |
32 | error [27; 27): expected SEMI | 32 | error [27; 27): expected SEMICOLON |
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0008_pub_expr.rast b/crates/ra_syntax/test_data/parser/inline/err/0008_pub_expr.rast index 6f45a4fa6..a345f8488 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0008_pub_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/err/0008_pub_expr.rast | |||
@@ -19,7 +19,7 @@ SOURCE_FILE@[0; 21) | |||
19 | EXPR_STMT@[15; 18) | 19 | EXPR_STMT@[15; 18) |
20 | LITERAL@[15; 17) | 20 | LITERAL@[15; 17) |
21 | INT_NUMBER@[15; 17) "92" | 21 | INT_NUMBER@[15; 17) "92" |
22 | SEMI@[17; 18) ";" | 22 | SEMICOLON@[17; 18) ";" |
23 | WHITESPACE@[18; 19) " " | 23 | WHITESPACE@[18; 19) " " |
24 | R_CURLY@[19; 20) "}" | 24 | R_CURLY@[19; 20) "}" |
25 | WHITESPACE@[20; 21) "\n" | 25 | WHITESPACE@[20; 21) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0009_attr_on_expr_not_allowed.rast b/crates/ra_syntax/test_data/parser/inline/err/0009_attr_on_expr_not_allowed.rast index e6d3a5c95..c3a70147a 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0009_attr_on_expr_not_allowed.rast +++ b/crates/ra_syntax/test_data/parser/inline/err/0009_attr_on_expr_not_allowed.rast | |||
@@ -30,7 +30,7 @@ SOURCE_FILE@[0; 48) | |||
30 | WHITESPACE@[22; 23) " " | 30 | WHITESPACE@[22; 23) " " |
31 | LITERAL@[23; 24) | 31 | LITERAL@[23; 24) |
32 | INT_NUMBER@[23; 24) "2" | 32 | INT_NUMBER@[23; 24) "2" |
33 | SEMI@[24; 25) ";" | 33 | SEMICOLON@[24; 25) ";" |
34 | WHITESPACE@[25; 29) "\n " | 34 | WHITESPACE@[25; 29) "\n " |
35 | EXPR_STMT@[29; 45) | 35 | EXPR_STMT@[29; 45) |
36 | ATTR@[29; 33) | 36 | ATTR@[29; 33) |
@@ -53,7 +53,7 @@ SOURCE_FILE@[0; 48) | |||
53 | BLOCK@[42; 44) | 53 | BLOCK@[42; 44) |
54 | L_CURLY@[42; 43) "{" | 54 | L_CURLY@[42; 43) "{" |
55 | R_CURLY@[43; 44) "}" | 55 | R_CURLY@[43; 44) "}" |
56 | SEMI@[44; 45) ";" | 56 | SEMICOLON@[44; 45) ";" |
57 | WHITESPACE@[45; 46) "\n" | 57 | WHITESPACE@[45; 46) "\n" |
58 | R_CURLY@[46; 47) "}" | 58 | R_CURLY@[46; 47) "}" |
59 | WHITESPACE@[47; 48) "\n" | 59 | WHITESPACE@[47; 48) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0010_bad_tuple_index_expr.rast b/crates/ra_syntax/test_data/parser/inline/err/0010_bad_tuple_index_expr.rast index 8ad2a588f..61d737abe 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0010_bad_tuple_index_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/err/0010_bad_tuple_index_expr.rast | |||
@@ -21,7 +21,7 @@ SOURCE_FILE@[0; 47) | |||
21 | IDENT@[15; 16) "x" | 21 | IDENT@[15; 16) "x" |
22 | DOT@[16; 17) "." | 22 | DOT@[16; 17) "." |
23 | FLOAT_NUMBER@[17; 19) "0." | 23 | FLOAT_NUMBER@[17; 19) "0." |
24 | SEMI@[19; 20) ";" | 24 | SEMICOLON@[19; 20) ";" |
25 | WHITESPACE@[20; 25) "\n " | 25 | WHITESPACE@[20; 25) "\n " |
26 | EXPR_STMT@[25; 32) | 26 | EXPR_STMT@[25; 32) |
27 | FIELD_EXPR@[25; 31) | 27 | FIELD_EXPR@[25; 31) |
@@ -33,7 +33,7 @@ SOURCE_FILE@[0; 47) | |||
33 | DOT@[26; 27) "." | 33 | DOT@[26; 27) "." |
34 | NAME_REF@[27; 31) | 34 | NAME_REF@[27; 31) |
35 | INT_NUMBER@[27; 31) "1i32" | 35 | INT_NUMBER@[27; 31) "1i32" |
36 | SEMI@[31; 32) ";" | 36 | SEMICOLON@[31; 32) ";" |
37 | WHITESPACE@[32; 37) "\n " | 37 | WHITESPACE@[32; 37) "\n " |
38 | EXPR_STMT@[37; 44) | 38 | EXPR_STMT@[37; 44) |
39 | FIELD_EXPR@[37; 43) | 39 | FIELD_EXPR@[37; 43) |
@@ -45,7 +45,7 @@ SOURCE_FILE@[0; 47) | |||
45 | DOT@[38; 39) "." | 45 | DOT@[38; 39) "." |
46 | NAME_REF@[39; 43) | 46 | NAME_REF@[39; 43) |
47 | INT_NUMBER@[39; 43) "0x01" | 47 | INT_NUMBER@[39; 43) "0x01" |
48 | SEMI@[43; 44) ";" | 48 | SEMICOLON@[43; 44) ";" |
49 | WHITESPACE@[44; 45) "\n" | 49 | WHITESPACE@[44; 45) "\n" |
50 | R_CURLY@[45; 46) "}" | 50 | R_CURLY@[45; 46) "}" |
51 | WHITESPACE@[46; 47) "\n" | 51 | WHITESPACE@[46; 47) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0013_static_underscore.rast b/crates/ra_syntax/test_data/parser/inline/err/0013_static_underscore.rast index 5b3dc5af2..62fca0a39 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0013_static_underscore.rast +++ b/crates/ra_syntax/test_data/parser/inline/err/0013_static_underscore.rast | |||
@@ -16,6 +16,6 @@ SOURCE_FILE@[0; 19) | |||
16 | WHITESPACE@[15; 16) " " | 16 | WHITESPACE@[15; 16) " " |
17 | LITERAL@[16; 17) | 17 | LITERAL@[16; 17) |
18 | INT_NUMBER@[16; 17) "5" | 18 | INT_NUMBER@[16; 17) "5" |
19 | SEMI@[17; 18) ";" | 19 | SEMICOLON@[17; 18) ";" |
20 | WHITESPACE@[18; 19) "\n" | 20 | WHITESPACE@[18; 19) "\n" |
21 | error [7; 7): expected a name | 21 | error [7; 7): expected a name |
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.rast b/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.rast index 25d80be1d..aa960d3ef 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.rast +++ b/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.rast | |||
@@ -27,7 +27,7 @@ SOURCE_FILE@[0; 62) | |||
27 | PATH_SEGMENT@[31; 34) | 27 | PATH_SEGMENT@[31; 34) |
28 | NAME_REF@[31; 34) | 28 | NAME_REF@[31; 34) |
29 | IDENT@[31; 34) "Bar" | 29 | IDENT@[31; 34) "Bar" |
30 | SEMI@[34; 35) ";" | 30 | SEMICOLON@[34; 35) ";" |
31 | WHITESPACE@[35; 40) "\n " | 31 | WHITESPACE@[35; 40) "\n " |
32 | MACRO_CALL@[40; 47) | 32 | MACRO_CALL@[40; 47) |
33 | PATH@[40; 47) | 33 | PATH@[40; 47) |
@@ -51,9 +51,9 @@ SOURCE_FILE@[0; 62) | |||
51 | WHITESPACE@[59; 60) "\n" | 51 | WHITESPACE@[59; 60) "\n" |
52 | R_CURLY@[60; 61) "}" | 52 | R_CURLY@[60; 61) "}" |
53 | WHITESPACE@[61; 62) "\n" | 53 | WHITESPACE@[61; 62) "\n" |
54 | error [21; 21): expected EXCL | 54 | error [21; 21): expected BANG |
55 | error [21; 21): expected `{`, `[`, `(` | 55 | error [21; 21): expected `{`, `[`, `(` |
56 | error [21; 21): expected SEMI | 56 | error [21; 21): expected SEMICOLON |
57 | error [47; 47): expected EXCL | 57 | error [47; 47): expected BANG |
58 | error [47; 47): expected `{`, `[`, `(` | 58 | error [47; 47): expected `{`, `[`, `(` |
59 | error [47; 47): expected SEMI | 59 | error [47; 47): expected SEMICOLON |
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0014_record_literal_before_ellipsis_recovery.rast b/crates/ra_syntax/test_data/parser/inline/err/0014_record_literal_before_ellipsis_recovery.rast new file mode 100644 index 000000000..75043c9c0 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/err/0014_record_literal_before_ellipsis_recovery.rast | |||
@@ -0,0 +1,49 @@ | |||
1 | SOURCE_FILE@[0; 45) | ||
2 | FN_DEF@[0; 44) | ||
3 | FN_KW@[0; 2) "fn" | ||
4 | WHITESPACE@[2; 3) " " | ||
5 | NAME@[3; 7) | ||
6 | IDENT@[3; 7) "main" | ||
7 | PARAM_LIST@[7; 9) | ||
8 | L_PAREN@[7; 8) "(" | ||
9 | R_PAREN@[8; 9) ")" | ||
10 | WHITESPACE@[9; 10) " " | ||
11 | BLOCK_EXPR@[10; 44) | ||
12 | BLOCK@[10; 44) | ||
13 | L_CURLY@[10; 11) "{" | ||
14 | WHITESPACE@[11; 16) "\n " | ||
15 | RECORD_LIT@[16; 42) | ||
16 | PATH@[16; 17) | ||
17 | PATH_SEGMENT@[16; 17) | ||
18 | NAME_REF@[16; 17) | ||
19 | IDENT@[16; 17) "S" | ||
20 | WHITESPACE@[17; 18) " " | ||
21 | RECORD_FIELD_LIST@[18; 42) | ||
22 | L_CURLY@[18; 19) "{" | ||
23 | WHITESPACE@[19; 20) " " | ||
24 | RECORD_FIELD@[20; 40) | ||
25 | NAME_REF@[20; 25) | ||
26 | IDENT@[20; 25) "field" | ||
27 | WHITESPACE@[25; 26) " " | ||
28 | RANGE_EXPR@[26; 40) | ||
29 | DOT2@[26; 28) ".." | ||
30 | CALL_EXPR@[28; 40) | ||
31 | PATH_EXPR@[28; 38) | ||
32 | PATH@[28; 38) | ||
33 | PATH@[28; 29) | ||
34 | PATH_SEGMENT@[28; 29) | ||
35 | NAME_REF@[28; 29) | ||
36 | IDENT@[28; 29) "S" | ||
37 | COLON2@[29; 31) "::" | ||
38 | PATH_SEGMENT@[31; 38) | ||
39 | NAME_REF@[31; 38) | ||
40 | IDENT@[31; 38) "default" | ||
41 | ARG_LIST@[38; 40) | ||
42 | L_PAREN@[38; 39) "(" | ||
43 | R_PAREN@[39; 40) ")" | ||
44 | WHITESPACE@[40; 41) " " | ||
45 | R_CURLY@[41; 42) "}" | ||
46 | WHITESPACE@[42; 43) "\n" | ||
47 | R_CURLY@[43; 44) "}" | ||
48 | WHITESPACE@[44; 45) "\n" | ||
49 | error [25; 25): expected COLON | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0014_record_literal_before_ellipsis_recovery.rs b/crates/ra_syntax/test_data/parser/inline/err/0014_record_literal_before_ellipsis_recovery.rs new file mode 100644 index 000000000..a4e5b2f69 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/err/0014_record_literal_before_ellipsis_recovery.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn main() { | ||
2 | S { field ..S::default() } | ||
3 | } | ||