From 310bfe57bd1ea3cd5e22d434ae9d709265af5463 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 28 May 2019 17:09:45 +0300 Subject: update test data --- .../parser/err/0000_struct_field_missing_comma.txt | 2 +- .../data/parser/err/0001_item_recovery_in_file.txt | 4 +- .../data/parser/err/0002_duplicate_shebang.txt | 2 +- .../tests/data/parser/err/0003_C++_semicolon.txt | 4 +- .../data/parser/err/0004_use_path_bad_segment.txt | 2 +- .../data/parser/err/0005_attribute_recover.txt | 6 +- .../data/parser/err/0006_named_field_recovery.txt | 16 +-- .../data/parser/err/0007_stray_curly_in_file.txt | 6 +- .../data/parser/err/0008_item_block_recovery.txt | 6 +- .../err/0009_broken_struct_type_parameter.txt | 22 ++-- .../data/parser/err/0010_unsafe_lambda_block.txt | 2 +- .../tests/data/parser/err/0011_extern_struct.txt | 2 +- .../tests/data/parser/err/0013_invalid_type.txt | 36 +++--- .../tests/data/parser/err/0014_where_no_bounds.txt | 2 +- .../tests/data/parser/err/0015_curly_in_params.txt | 12 +- .../tests/data/parser/err/0016_missing_semi.txt | 2 +- .../data/parser/err/0017_incomplete_binexpr.txt | 2 +- .../tests/data/parser/err/0018_incomplete_fn.txt | 10 +- .../tests/data/parser/err/0019_let_recover.txt | 20 +-- .../tests/data/parser/err/0020_fn_recover.txt | 6 +- .../data/parser/err/0021_incomplete_param.txt | 4 +- .../tests/data/parser/err/0022_bad_exprs.txt | 78 ++++++------ .../data/parser/err/0023_mismatched_paren.txt | 4 +- .../data/parser/err/0024_many_type_parens.txt | 62 +++++----- .../ra_syntax/tests/data/parser/err/0025_nope.txt | 22 ++-- .../tests/data/parser/err/0026_imp_recovery.txt | 4 +- .../data/parser/err/0027_incomplere_where_for.txt | 4 +- .../tests/data/parser/err/0028_macro_2.0.txt | 134 ++++++++++----------- .../data/parser/err/0029_field_completion.txt | 2 +- .../tests/data/parser/err/0030_string_suffixes.txt | 2 +- .../data/parser/err/0031_block_inner_attrs.txt | 8 +- .../parser/err/0032_match_arms_inner_attrs.txt | 22 ++-- .../parser/err/0033_match_arms_outer_attrs.txt | 6 +- 33 files changed, 258 insertions(+), 258 deletions(-) (limited to 'crates/ra_syntax/tests/data/parser/err') diff --git a/crates/ra_syntax/tests/data/parser/err/0000_struct_field_missing_comma.txt b/crates/ra_syntax/tests/data/parser/err/0000_struct_field_missing_comma.txt index 21ef31ba8..0662052c5 100644 --- a/crates/ra_syntax/tests/data/parser/err/0000_struct_field_missing_comma.txt +++ b/crates/ra_syntax/tests/data/parser/err/0000_struct_field_missing_comma.txt @@ -18,7 +18,6 @@ SOURCE_FILE@[0; 34) PATH_SEGMENT@[18; 21) NAME_REF@[18; 21) IDENT@[18; 21) "u32" - err: `expected COMMA` WHITESPACE@[21; 26) "\n " NAMED_FIELD_DEF@[26; 32) NAME@[26; 27) @@ -32,3 +31,4 @@ SOURCE_FILE@[0; 34) IDENT@[29; 32) "u32" WHITESPACE@[32; 33) "\n" R_CURLY@[33; 34) "}" +err: `expected COMMA` diff --git a/crates/ra_syntax/tests/data/parser/err/0001_item_recovery_in_file.txt b/crates/ra_syntax/tests/data/parser/err/0001_item_recovery_in_file.txt index d7762c089..45044fe0a 100644 --- a/crates/ra_syntax/tests/data/parser/err/0001_item_recovery_in_file.txt +++ b/crates/ra_syntax/tests/data/parser/err/0001_item_recovery_in_file.txt @@ -1,9 +1,7 @@ SOURCE_FILE@[0; 21) ERROR@[0; 2) IF_KW@[0; 2) "if" - err: `expected an item` WHITESPACE@[2; 3) " " - err: `expected an item` ERROR@[3; 8) MATCH_KW@[3; 8) "match" WHITESPACE@[8; 10) "\n\n" @@ -16,3 +14,5 @@ SOURCE_FILE@[0; 21) NAMED_FIELD_DEF_LIST@[19; 21) L_CURLY@[19; 20) "{" R_CURLY@[20; 21) "}" +err: `expected an item` +err: `expected an item` diff --git a/crates/ra_syntax/tests/data/parser/err/0002_duplicate_shebang.txt b/crates/ra_syntax/tests/data/parser/err/0002_duplicate_shebang.txt index 76642f43b..1506acdfd 100644 --- a/crates/ra_syntax/tests/data/parser/err/0002_duplicate_shebang.txt +++ b/crates/ra_syntax/tests/data/parser/err/0002_duplicate_shebang.txt @@ -1,7 +1,7 @@ SOURCE_FILE@[0; 42) SHEBANG@[0; 20) "#!/use/bin/env rusti" WHITESPACE@[20; 21) "\n" - err: `expected an item` ERROR@[21; 41) SHEBANG@[21; 41) "#!/use/bin/env rusti" WHITESPACE@[41; 42) "\n" +err: `expected an item` diff --git a/crates/ra_syntax/tests/data/parser/err/0003_C++_semicolon.txt b/crates/ra_syntax/tests/data/parser/err/0003_C++_semicolon.txt index b52aaa368..586baf1bb 100644 --- a/crates/ra_syntax/tests/data/parser/err/0003_C++_semicolon.txt +++ b/crates/ra_syntax/tests/data/parser/err/0003_C++_semicolon.txt @@ -33,7 +33,7 @@ SOURCE_FILE@[0; 40) COMMA@[36; 37) "," WHITESPACE@[37; 38) "\n" R_CURLY@[38; 39) "}" - err: `expected item, found `;` -consider removing this semicolon` ERROR@[39; 40) SEMI@[39; 40) ";" +err: `expected item, found `;` +consider removing this semicolon` diff --git a/crates/ra_syntax/tests/data/parser/err/0004_use_path_bad_segment.txt b/crates/ra_syntax/tests/data/parser/err/0004_use_path_bad_segment.txt index fb44f21ea..a70223912 100644 --- a/crates/ra_syntax/tests/data/parser/err/0004_use_path_bad_segment.txt +++ b/crates/ra_syntax/tests/data/parser/err/0004_use_path_bad_segment.txt @@ -9,8 +9,8 @@ SOURCE_FILE@[0; 12) NAME_REF@[4; 7) IDENT@[4; 7) "foo" COLONCOLON@[7; 9) "::" - err: `expected identifier` PATH_SEGMENT@[9; 11) ERROR@[9; 11) INT_NUMBER@[9; 11) "92" SEMI@[11; 12) ";" +err: `expected identifier` diff --git a/crates/ra_syntax/tests/data/parser/err/0005_attribute_recover.txt b/crates/ra_syntax/tests/data/parser/err/0005_attribute_recover.txt index 1e27522bf..9a6da88fe 100644 --- a/crates/ra_syntax/tests/data/parser/err/0005_attribute_recover.txt +++ b/crates/ra_syntax/tests/data/parser/err/0005_attribute_recover.txt @@ -49,7 +49,7 @@ SOURCE_FILE@[0; 54) L_CURLY@[50; 51) "{" WHITESPACE@[51; 52) "\n" R_CURLY@[52; 53) "}" - err: `expected R_PAREN` - err: `expected R_BRACK` - err: `expected an item` WHITESPACE@[53; 54) "\n" +err: `expected R_PAREN` +err: `expected R_BRACK` +err: `expected an item` diff --git a/crates/ra_syntax/tests/data/parser/err/0006_named_field_recovery.txt b/crates/ra_syntax/tests/data/parser/err/0006_named_field_recovery.txt index d47b98ed4..5effbb60f 100644 --- a/crates/ra_syntax/tests/data/parser/err/0006_named_field_recovery.txt +++ b/crates/ra_syntax/tests/data/parser/err/0006_named_field_recovery.txt @@ -23,25 +23,17 @@ SOURCE_FILE@[0; 74) VISIBILITY@[27; 30) PUB_KW@[27; 30) "pub" WHITESPACE@[30; 31) " " - err: `expected field declaration` ERROR@[31; 33) INT_NUMBER@[31; 33) "92" - err: `expected COMMA` WHITESPACE@[33; 38) "\n " - err: `expected field declaration` ERROR@[38; 39) PLUS@[38; 39) "+" - err: `expected COMMA` WHITESPACE@[39; 40) " " - err: `expected field declaration` ERROR@[40; 41) MINUS@[40; 41) "-" - err: `expected COMMA` WHITESPACE@[41; 42) " " - err: `expected field declaration` ERROR@[42; 43) STAR@[42; 43) "*" - err: `expected COMMA` WHITESPACE@[43; 48) "\n " NAMED_FIELD_DEF@[48; 58) VISIBILITY@[48; 51) @@ -72,3 +64,11 @@ SOURCE_FILE@[0; 74) WHITESPACE@[71; 72) "\n" R_CURLY@[72; 73) "}" WHITESPACE@[73; 74) "\n" +err: `expected field declaration` +err: `expected COMMA` +err: `expected field declaration` +err: `expected COMMA` +err: `expected field declaration` +err: `expected COMMA` +err: `expected field declaration` +err: `expected COMMA` diff --git a/crates/ra_syntax/tests/data/parser/err/0007_stray_curly_in_file.txt b/crates/ra_syntax/tests/data/parser/err/0007_stray_curly_in_file.txt index 94066ed05..ff59f5d71 100644 --- a/crates/ra_syntax/tests/data/parser/err/0007_stray_curly_in_file.txt +++ b/crates/ra_syntax/tests/data/parser/err/0007_stray_curly_in_file.txt @@ -1,7 +1,6 @@ SOURCE_FILE@[0; 31) ERROR@[0; 1) R_CURLY@[0; 1) "}" - err: `unmatched `}`` WHITESPACE@[1; 3) "\n\n" STRUCT_DEF@[3; 12) STRUCT_KW@[3; 9) "struct" @@ -10,7 +9,6 @@ SOURCE_FILE@[0; 31) IDENT@[10; 11) "S" SEMI@[11; 12) ";" WHITESPACE@[12; 14) "\n\n" - err: `unmatched `}`` ERROR@[14; 15) R_CURLY@[14; 15) "}" WHITESPACE@[15; 17) "\n\n" @@ -26,7 +24,9 @@ SOURCE_FILE@[0; 31) L_CURLY@[25; 26) "{" R_CURLY@[26; 27) "}" WHITESPACE@[27; 29) "\n\n" - err: `unmatched `}`` ERROR@[29; 30) R_CURLY@[29; 30) "}" WHITESPACE@[30; 31) "\n" +err: `unmatched `}`` +err: `unmatched `}`` +err: `unmatched `}`` diff --git a/crates/ra_syntax/tests/data/parser/err/0008_item_block_recovery.txt b/crates/ra_syntax/tests/data/parser/err/0008_item_block_recovery.txt index 6f5a27856..75f6b3b9c 100644 --- a/crates/ra_syntax/tests/data/parser/err/0008_item_block_recovery.txt +++ b/crates/ra_syntax/tests/data/parser/err/0008_item_block_recovery.txt @@ -18,13 +18,10 @@ SOURCE_FILE@[0; 95) PATH_SEGMENT@[14; 17) NAME_REF@[14; 17) IDENT@[14; 17) "bar" - err: `expected EXCL` TOKEN_TREE@[17; 19) L_PAREN@[17; 18) "(" R_PAREN@[18; 19) ")" - err: `expected SEMI` WHITESPACE@[19; 20) " " - err: `expected an item` ERROR@[20; 80) L_CURLY@[20; 21) "{" WHITESPACE@[21; 26) "\n " @@ -75,3 +72,6 @@ SOURCE_FILE@[0; 95) WHITESPACE@[92; 93) "\n" R_CURLY@[93; 94) "}" WHITESPACE@[94; 95) "\n" +err: `expected EXCL` +err: `expected SEMI` +err: `expected an item` diff --git a/crates/ra_syntax/tests/data/parser/err/0009_broken_struct_type_parameter.txt b/crates/ra_syntax/tests/data/parser/err/0009_broken_struct_type_parameter.txt index 80568b5bd..8aa8c3ef4 100644 --- a/crates/ra_syntax/tests/data/parser/err/0009_broken_struct_type_parameter.txt +++ b/crates/ra_syntax/tests/data/parser/err/0009_broken_struct_type_parameter.txt @@ -6,25 +6,17 @@ SOURCE_FILE@[0; 43) IDENT@[7; 8) "S" TYPE_PARAM_LIST@[8; 11) L_ANGLE@[8; 9) "<" - err: `expected type parameter` ERROR@[9; 11) INT_NUMBER@[9; 11) "90" - err: `expected COMMA` - err: `expected R_ANGLE` - err: `expected `;`, `{`, or `(`` WHITESPACE@[11; 12) " " - err: `expected an item` ERROR@[12; 13) PLUS@[12; 13) "+" WHITESPACE@[13; 14) " " - err: `expected an item` ERROR@[14; 15) INT_NUMBER@[14; 15) "2" - err: `expected an item` ERROR@[15; 16) R_ANGLE@[15; 16) ">" WHITESPACE@[16; 17) " " - err: `expected an item` ERROR@[17; 31) L_CURLY@[17; 18) "{" WHITESPACE@[18; 23) "\n " @@ -34,12 +26,9 @@ SOURCE_FILE@[0; 43) PATH_SEGMENT@[23; 24) NAME_REF@[23; 24) IDENT@[23; 24) "f" - err: `expected SEMI` - err: `expected expression` EXPR_STMT@[24; 25) ERROR@[24; 25) COLON@[24; 25) ":" - err: `expected SEMI` WHITESPACE@[25; 26) " " PATH_EXPR@[26; 29) PATH@[26; 29) @@ -56,3 +45,14 @@ SOURCE_FILE@[0; 43) IDENT@[40; 41) "T" SEMI@[41; 42) ";" WHITESPACE@[42; 43) "\n" +err: `expected type parameter` +err: `expected COMMA` +err: `expected R_ANGLE` +err: `expected `;`, `{`, or `(`` +err: `expected an item` +err: `expected an item` +err: `expected an item` +err: `expected an item` +err: `expected SEMI` +err: `expected expression` +err: `expected SEMI` diff --git a/crates/ra_syntax/tests/data/parser/err/0010_unsafe_lambda_block.txt b/crates/ra_syntax/tests/data/parser/err/0010_unsafe_lambda_block.txt index 36982085a..22a1727f0 100644 --- a/crates/ra_syntax/tests/data/parser/err/0010_unsafe_lambda_block.txt +++ b/crates/ra_syntax/tests/data/parser/err/0010_unsafe_lambda_block.txt @@ -23,7 +23,6 @@ SOURCE_FILE@[0; 42) TUPLE_TYPE@[22; 24) L_PAREN@[22; 23) "(" R_PAREN@[23; 24) ")" - err: `expected `{`` WHITESPACE@[24; 25) " " BLOCK_EXPR@[25; 38) UNSAFE_KW@[25; 31) "unsafe" @@ -40,3 +39,4 @@ SOURCE_FILE@[0; 42) WHITESPACE@[39; 40) "\n" R_CURLY@[40; 41) "}" WHITESPACE@[41; 42) "\n" +err: `expected `{`` diff --git a/crates/ra_syntax/tests/data/parser/err/0011_extern_struct.txt b/crates/ra_syntax/tests/data/parser/err/0011_extern_struct.txt index 3fb0a77ef..ee2a29d9f 100644 --- a/crates/ra_syntax/tests/data/parser/err/0011_extern_struct.txt +++ b/crates/ra_syntax/tests/data/parser/err/0011_extern_struct.txt @@ -2,7 +2,6 @@ SOURCE_FILE@[0; 19) ERROR@[0; 6) ABI@[0; 6) EXTERN_KW@[0; 6) "extern" - err: `expected fn, trait or impl` WHITESPACE@[6; 7) " " STRUCT_DEF@[7; 18) STRUCT_KW@[7; 13) "struct" @@ -11,3 +10,4 @@ SOURCE_FILE@[0; 19) IDENT@[14; 17) "Foo" SEMI@[17; 18) ";" WHITESPACE@[18; 19) "\n" +err: `expected fn, trait or impl` diff --git a/crates/ra_syntax/tests/data/parser/err/0013_invalid_type.txt b/crates/ra_syntax/tests/data/parser/err/0013_invalid_type.txt index 47b992b0a..1f5cc55c0 100644 --- a/crates/ra_syntax/tests/data/parser/err/0013_invalid_type.txt +++ b/crates/ra_syntax/tests/data/parser/err/0013_invalid_type.txt @@ -43,17 +43,9 @@ SOURCE_FILE@[0; 86) IDENT@[63; 66) "Box" TYPE_ARG_LIST@[66; 68) L_ANGLE@[66; 67) "<" - err: `expected type` TYPE_ARG@[67; 68) ERROR@[67; 68) AT@[67; 68) "@" - err: `expected COMMA` - err: `expected R_ANGLE` - err: `expected COMMA` - err: `expected R_ANGLE` - err: `expected COMMA` - err: `expected R_ANGLE` - err: `expected COMMA` WHITESPACE@[68; 69) " " POS_FIELD_DEF@[69; 72) PATH_TYPE@[69; 72) @@ -61,29 +53,37 @@ SOURCE_FILE@[0; 86) PATH_SEGMENT@[69; 72) NAME_REF@[69; 72) IDENT@[69; 72) "Any" - err: `expected COMMA` - err: `expected a type` - err: `expected R_PAREN` - err: `expected SEMI` - err: `expected an item` ERROR@[72; 72) ERROR@[72; 73) R_ANGLE@[72; 73) ">" - err: `expected an item` ERROR@[73; 74) COMMA@[73; 74) "," WHITESPACE@[74; 79) "\n " - err: `expected an item` ERROR@[79; 80) R_ANGLE@[79; 80) ">" - err: `expected an item` ERROR@[80; 81) R_ANGLE@[80; 81) ">" WHITESPACE@[81; 82) "\n" - err: `expected an item` ERROR@[82; 83) R_PAREN@[82; 83) ")" - err: `expected an item` ERROR@[83; 84) SEMI@[83; 84) ";" WHITESPACE@[84; 86) "\n\n" +err: `expected type` +err: `expected COMMA` +err: `expected R_ANGLE` +err: `expected COMMA` +err: `expected R_ANGLE` +err: `expected COMMA` +err: `expected R_ANGLE` +err: `expected COMMA` +err: `expected COMMA` +err: `expected a type` +err: `expected R_PAREN` +err: `expected SEMI` +err: `expected an item` +err: `expected an item` +err: `expected an item` +err: `expected an item` +err: `expected an item` +err: `expected an item` diff --git a/crates/ra_syntax/tests/data/parser/err/0014_where_no_bounds.txt b/crates/ra_syntax/tests/data/parser/err/0014_where_no_bounds.txt index 52ad7bef7..276a58b69 100644 --- a/crates/ra_syntax/tests/data/parser/err/0014_where_no_bounds.txt +++ b/crates/ra_syntax/tests/data/parser/err/0014_where_no_bounds.txt @@ -23,9 +23,9 @@ SOURCE_FILE@[0; 23) PATH_SEGMENT@[18; 19) NAME_REF@[18; 19) IDENT@[18; 19) "T" - err: `expected colon` WHITESPACE@[19; 20) " " BLOCK@[20; 22) L_CURLY@[20; 21) "{" R_CURLY@[21; 22) "}" WHITESPACE@[22; 23) "\n" +err: `expected colon` diff --git a/crates/ra_syntax/tests/data/parser/err/0015_curly_in_params.txt b/crates/ra_syntax/tests/data/parser/err/0015_curly_in_params.txt index 1350980f2..8f93b832d 100644 --- a/crates/ra_syntax/tests/data/parser/err/0015_curly_in_params.txt +++ b/crates/ra_syntax/tests/data/parser/err/0015_curly_in_params.txt @@ -6,19 +6,19 @@ SOURCE_FILE@[0; 14) IDENT@[3; 6) "foo" PARAM_LIST@[6; 7) L_PAREN@[6; 7) "(" - err: `expected value parameter` - err: `expected R_PAREN` - err: `expected a block` - err: `unmatched `}`` ERROR@[7; 8) R_CURLY@[7; 8) "}" - err: `expected an item` ERROR@[8; 9) R_PAREN@[8; 9) ")" WHITESPACE@[9; 10) " " - err: `expected an item` ERROR@[10; 13) L_CURLY@[10; 11) "{" WHITESPACE@[11; 12) "\n" R_CURLY@[12; 13) "}" WHITESPACE@[13; 14) "\n" +err: `expected value parameter` +err: `expected R_PAREN` +err: `expected a block` +err: `unmatched `}`` +err: `expected an item` +err: `expected an item` diff --git a/crates/ra_syntax/tests/data/parser/err/0016_missing_semi.txt b/crates/ra_syntax/tests/data/parser/err/0016_missing_semi.txt index dd60814a0..105e45a35 100644 --- a/crates/ra_syntax/tests/data/parser/err/0016_missing_semi.txt +++ b/crates/ra_syntax/tests/data/parser/err/0016_missing_semi.txt @@ -29,7 +29,6 @@ SOURCE_FILE@[0; 56) INT_NUMBER@[31; 32) "2" WHITESPACE@[32; 37) "\n " R_PAREN@[37; 38) ")" - err: `expected SEMI` WHITESPACE@[38; 43) "\n " EXPR_STMT@[43; 53) RETURN_EXPR@[43; 52) @@ -41,3 +40,4 @@ SOURCE_FILE@[0; 56) WHITESPACE@[53; 54) "\n" R_CURLY@[54; 55) "}" WHITESPACE@[55; 56) "\n" +err: `expected SEMI` diff --git a/crates/ra_syntax/tests/data/parser/err/0017_incomplete_binexpr.txt b/crates/ra_syntax/tests/data/parser/err/0017_incomplete_binexpr.txt index f115eb1dd..751740620 100644 --- a/crates/ra_syntax/tests/data/parser/err/0017_incomplete_binexpr.txt +++ b/crates/ra_syntax/tests/data/parser/err/0017_incomplete_binexpr.txt @@ -40,7 +40,7 @@ SOURCE_FILE@[0; 47) INT_NUMBER@[41; 42) "1" WHITESPACE@[42; 43) " " PLUS@[43; 44) "+" - err: `expected expression` WHITESPACE@[44; 45) "\n" R_CURLY@[45; 46) "}" WHITESPACE@[46; 47) "\n" +err: `expected expression` diff --git a/crates/ra_syntax/tests/data/parser/err/0018_incomplete_fn.txt b/crates/ra_syntax/tests/data/parser/err/0018_incomplete_fn.txt index 9996cf824..82908b8f2 100644 --- a/crates/ra_syntax/tests/data/parser/err/0018_incomplete_fn.txt +++ b/crates/ra_syntax/tests/data/parser/err/0018_incomplete_fn.txt @@ -21,9 +21,6 @@ SOURCE_FILE@[0; 183) PARAM@[33; 34) REF_PAT@[33; 34) AMP@[33; 34) "&" - err: `expected pattern` - err: `expected COLON` - err: `expected type` R_PAREN@[34; 35) ")" WHITESPACE@[35; 36) " " RET_TYPE@[36; 46) @@ -124,8 +121,11 @@ SOURCE_FILE@[0; 183) WHITESPACE@[169; 170) " " NAME@[170; 180) IDENT@[170; 180) "set_parent" - err: `expected function arguments` - err: `expected a block` WHITESPACE@[180; 181) "\n" R_CURLY@[181; 182) "}" WHITESPACE@[182; 183) "\n" +err: `expected pattern` +err: `expected COLON` +err: `expected type` +err: `expected function arguments` +err: `expected a block` diff --git a/crates/ra_syntax/tests/data/parser/err/0019_let_recover.txt b/crates/ra_syntax/tests/data/parser/err/0019_let_recover.txt index c12649d5e..4a1b84ee5 100644 --- a/crates/ra_syntax/tests/data/parser/err/0019_let_recover.txt +++ b/crates/ra_syntax/tests/data/parser/err/0019_let_recover.txt @@ -19,8 +19,6 @@ SOURCE_FILE@[0; 139) IDENT@[19; 22) "foo" WHITESPACE@[22; 23) " " EQ@[23; 24) "=" - err: `expected expression` - err: `expected SEMI` WHITESPACE@[24; 29) "\n " LET_STMT@[29; 41) LET_KW@[29; 32) "let" @@ -37,8 +35,6 @@ SOURCE_FILE@[0; 139) WHITESPACE@[41; 46) "\n " LET_STMT@[46; 49) LET_KW@[46; 49) "let" - err: `expected pattern` - err: `expected SEMI` WHITESPACE@[49; 54) "\n " LET_STMT@[54; 67) LET_KW@[54; 57) "let" @@ -55,8 +51,6 @@ SOURCE_FILE@[0; 139) WHITESPACE@[67; 72) "\n " LET_STMT@[72; 75) LET_KW@[72; 75) "let" - err: `expected pattern` - err: `expected SEMI` WHITESPACE@[75; 80) "\n " EXPR_STMT@[80; 90) IF_EXPR@[80; 90) @@ -72,8 +66,6 @@ SOURCE_FILE@[0; 139) WHITESPACE@[90; 95) "\n " LET_STMT@[95; 98) LET_KW@[95; 98) "let" - err: `expected pattern` - err: `expected SEMI` WHITESPACE@[98; 103) "\n " EXPR_STMT@[103; 116) WHILE_EXPR@[103; 116) @@ -89,8 +81,6 @@ SOURCE_FILE@[0; 139) WHITESPACE@[116; 121) "\n " LET_STMT@[121; 124) LET_KW@[121; 124) "let" - err: `expected pattern` - err: `expected SEMI` WHITESPACE@[124; 129) "\n " LOOP_EXPR@[129; 136) LOOP_KW@[129; 133) "loop" @@ -101,3 +91,13 @@ SOURCE_FILE@[0; 139) WHITESPACE@[136; 137) "\n" R_CURLY@[137; 138) "}" WHITESPACE@[138; 139) "\n" +err: `expected expression` +err: `expected SEMI` +err: `expected pattern` +err: `expected SEMI` +err: `expected pattern` +err: `expected SEMI` +err: `expected pattern` +err: `expected SEMI` +err: `expected pattern` +err: `expected SEMI` diff --git a/crates/ra_syntax/tests/data/parser/err/0020_fn_recover.txt b/crates/ra_syntax/tests/data/parser/err/0020_fn_recover.txt index b48bd5dee..d7ac73afa 100644 --- a/crates/ra_syntax/tests/data/parser/err/0020_fn_recover.txt +++ b/crates/ra_syntax/tests/data/parser/err/0020_fn_recover.txt @@ -1,9 +1,6 @@ SOURCE_FILE@[0; 16) FN_DEF@[0; 2) FN_KW@[0; 2) "fn" - err: `expected a name` - err: `expected function arguments` - err: `expected a block` WHITESPACE@[2; 4) "\n\n" FN_DEF@[4; 15) FN_KW@[4; 6) "fn" @@ -18,3 +15,6 @@ SOURCE_FILE@[0; 16) L_CURLY@[13; 14) "{" R_CURLY@[14; 15) "}" WHITESPACE@[15; 16) "\n" +err: `expected a name` +err: `expected function arguments` +err: `expected a block` diff --git a/crates/ra_syntax/tests/data/parser/err/0021_incomplete_param.txt b/crates/ra_syntax/tests/data/parser/err/0021_incomplete_param.txt index 81b52c8ce..086224eee 100644 --- a/crates/ra_syntax/tests/data/parser/err/0021_incomplete_param.txt +++ b/crates/ra_syntax/tests/data/parser/err/0021_incomplete_param.txt @@ -23,8 +23,6 @@ SOURCE_FILE@[0; 22) BIND_PAT@[15; 16) NAME@[15; 16) IDENT@[15; 16) "y" - err: `expected COLON` - err: `expected type` R_PAREN@[16; 17) ")" WHITESPACE@[17; 18) " " BLOCK@[18; 21) @@ -32,3 +30,5 @@ SOURCE_FILE@[0; 22) WHITESPACE@[19; 20) "\n" R_CURLY@[20; 21) "}" WHITESPACE@[21; 22) "\n" +err: `expected COLON` +err: `expected type` diff --git a/crates/ra_syntax/tests/data/parser/err/0022_bad_exprs.txt b/crates/ra_syntax/tests/data/parser/err/0022_bad_exprs.txt index 6dfdfc343..d7a5fa1d2 100644 --- a/crates/ra_syntax/tests/data/parser/err/0022_bad_exprs.txt +++ b/crates/ra_syntax/tests/data/parser/err/0022_bad_exprs.txt @@ -21,34 +21,23 @@ SOURCE_FILE@[0; 112) LITERAL@[13; 14) INT_NUMBER@[13; 14) "2" COMMA@[14; 15) "," - err: `expected expression` - err: `expected R_BRACK` - err: `expected SEMI` WHITESPACE@[15; 16) " " - err: `expected expression` EXPR_STMT@[16; 17) ERROR@[16; 17) AT@[16; 17) "@" - err: `expected SEMI` - err: `expected expression` EXPR_STMT@[17; 18) ERROR@[17; 18) COMMA@[17; 18) "," - err: `expected SEMI` WHITESPACE@[18; 19) " " STRUCT_DEF@[19; 26) STRUCT_KW@[19; 25) "struct" - err: `expected a name` ERROR@[25; 26) COMMA@[25; 26) "," - err: `expected `;`, `{`, or `(`` WHITESPACE@[26; 27) " " LET_STMT@[27; 31) LET_KW@[27; 30) "let" - err: `expected pattern` ERROR@[30; 31) R_BRACK@[30; 31) "]" - err: `expected SEMI` WHITESPACE@[31; 32) " " R_CURLY@[32; 33) "}" WHITESPACE@[33; 34) "\n" @@ -80,35 +69,22 @@ SOURCE_FILE@[0; 112) LITERAL@[50; 51) INT_NUMBER@[50; 51) "2" COMMA@[51; 52) "," - err: `expected expression` - err: `expected SEMI` WHITESPACE@[52; 53) " " - err: `expected expression` EXPR_STMT@[53; 54) ERROR@[53; 54) AT@[53; 54) "@" - err: `expected SEMI` - err: `expected expression` EXPR_STMT@[54; 55) ERROR@[54; 55) COMMA@[54; 55) "," - err: `expected SEMI` WHITESPACE@[55; 56) " " IMPL_BLOCK@[56; 60) IMPL_KW@[56; 60) "impl" - err: `expected type` - err: `expected `{`` - err: `expected expression` EXPR_STMT@[60; 61) ERROR@[60; 61) COMMA@[60; 61) "," - err: `expected SEMI` WHITESPACE@[61; 62) " " LET_STMT@[62; 65) LET_KW@[62; 65) "let" - err: `expected pattern` - err: `expected SEMI` - err: `expected expression` ERROR@[65; 66) R_PAREN@[65; 66) ")" WHITESPACE@[66; 67) " " @@ -145,45 +121,69 @@ SOURCE_FILE@[0; 112) LITERAL@[89; 90) INT_NUMBER@[89; 90) "2" COMMA@[90; 91) "," - err: `expected expression` - err: `expected SEMI` WHITESPACE@[91; 92) " " - err: `expected expression` EXPR_STMT@[92; 93) ERROR@[92; 93) AT@[92; 93) "@" - err: `expected SEMI` - err: `expected expression` EXPR_STMT@[93; 94) ERROR@[93; 94) COMMA@[93; 94) "," - err: `expected SEMI` WHITESPACE@[94; 95) " " - err: `expected expression` EXPR_STMT@[95; 96) ERROR@[95; 96) R_BRACK@[95; 96) "]" - err: `expected SEMI` - err: `expected expression` EXPR_STMT@[96; 97) ERROR@[96; 97) COMMA@[96; 97) "," - err: `expected SEMI` WHITESPACE@[97; 98) " " TRAIT_DEF@[98; 104) TRAIT_KW@[98; 103) "trait" - err: `expected a name` ERROR@[103; 104) COMMA@[103; 104) "," - err: `expected `{`` WHITESPACE@[104; 105) " " LET_STMT@[105; 108) LET_KW@[105; 108) "let" - err: `expected pattern` - err: `expected SEMI` - err: `expected expression` ERROR@[108; 109) R_PAREN@[108; 109) ")" WHITESPACE@[109; 110) " " R_CURLY@[110; 111) "}" WHITESPACE@[111; 112) "\n" +err: `expected expression` +err: `expected R_BRACK` +err: `expected SEMI` +err: `expected expression` +err: `expected SEMI` +err: `expected expression` +err: `expected SEMI` +err: `expected a name` +err: `expected `;`, `{`, or `(`` +err: `expected pattern` +err: `expected SEMI` +err: `expected expression` +err: `expected SEMI` +err: `expected expression` +err: `expected SEMI` +err: `expected expression` +err: `expected SEMI` +err: `expected type` +err: `expected `{`` +err: `expected expression` +err: `expected SEMI` +err: `expected pattern` +err: `expected SEMI` +err: `expected expression` +err: `expected expression` +err: `expected SEMI` +err: `expected expression` +err: `expected SEMI` +err: `expected expression` +err: `expected SEMI` +err: `expected expression` +err: `expected SEMI` +err: `expected expression` +err: `expected SEMI` +err: `expected a name` +err: `expected `{`` +err: `expected pattern` +err: `expected SEMI` +err: `expected expression` diff --git a/crates/ra_syntax/tests/data/parser/err/0023_mismatched_paren.txt b/crates/ra_syntax/tests/data/parser/err/0023_mismatched_paren.txt index 469d35082..143600e67 100644 --- a/crates/ra_syntax/tests/data/parser/err/0023_mismatched_paren.txt +++ b/crates/ra_syntax/tests/data/parser/err/0023_mismatched_paren.txt @@ -31,13 +31,13 @@ SOURCE_FILE@[0; 94) COMMA@[44; 45) "," WHITESPACE@[45; 46) " " FLOAT_NUMBER@[46; 49) "2.0" - err: `unmatched `}`` WHITESPACE@[49; 54) "\n " R_CURLY@[54; 55) "}" WHITESPACE@[55; 56) " " COMMENT@[56; 91) "//~ ERROR incorrect c ..." WHITESPACE@[91; 92) "\n" - err: `unmatched `}`` ERROR@[92; 93) R_CURLY@[92; 93) "}" WHITESPACE@[93; 94) "\n" +err: `unmatched `}`` +err: `unmatched `}`` diff --git a/crates/ra_syntax/tests/data/parser/err/0024_many_type_parens.txt b/crates/ra_syntax/tests/data/parser/err/0024_many_type_parens.txt index 0fb73d838..4f505fa76 100644 --- a/crates/ra_syntax/tests/data/parser/err/0024_many_type_parens.txt +++ b/crates/ra_syntax/tests/data/parser/err/0024_many_type_parens.txt @@ -103,8 +103,6 @@ SOURCE_FILE@[0; 240) NAME_REF@[83; 87) IDENT@[83; 87) "Copy" R_PAREN@[87; 88) ")" - err: `expected COMMA` - err: `expected R_ANGLE` WHITESPACE@[88; 89) " " PLUS@[89; 90) "+" WHITESPACE@[90; 91) " " @@ -141,8 +139,6 @@ SOURCE_FILE@[0; 240) LIFETIME@[117; 119) "\'a" R_ANGLE@[119; 120) ">" R_PAREN@[120; 121) ")" - err: `expected SEMI` - err: `expected expression` EXPR_STMT@[121; 123) ERROR@[121; 122) R_ANGLE@[121; 122) ">" @@ -165,54 +161,35 @@ SOURCE_FILE@[0; 240) TYPE_ARG@[139; 141) PAREN_TYPE@[139; 141) L_PAREN@[139; 140) "(" - err: `expected type` ERROR@[140; 141) QUESTION@[140; 141) "?" - err: `expected R_PAREN` - err: `expected COMMA` - err: `expected R_ANGLE` - err: `expected SEMI` EXPR_STMT@[141; 146) PATH_EXPR@[141; 146) PATH@[141; 146) PATH_SEGMENT@[141; 146) NAME_REF@[141; 146) IDENT@[141; 146) "Sized" - err: `expected SEMI` - err: `expected expression` EXPR_STMT@[146; 147) ERROR@[146; 147) R_PAREN@[146; 147) ")" - err: `expected SEMI` WHITESPACE@[147; 148) " " - err: `expected expression` EXPR_STMT@[148; 149) ERROR@[148; 149) PLUS@[148; 149) "+" - err: `expected SEMI` WHITESPACE@[149; 150) " " EXPR_STMT@[150; 151) PAREN_EXPR@[150; 151) L_PAREN@[150; 151) "(" - err: `expected expression` - err: `expected R_PAREN` - err: `expected SEMI` EXPR_STMT@[151; 157) FOR_EXPR@[151; 157) FOR_KW@[151; 154) "for" - err: `expected pattern` ERROR@[154; 155) L_ANGLE@[154; 155) "<" - err: `expected IN_KW` - err: `expected expression` ERROR@[155; 157) LIFETIME@[155; 157) "\'a" - err: `expected a block` - err: `expected expression` EXPR_STMT@[157; 158) ERROR@[157; 158) R_ANGLE@[157; 158) ">" - err: `expected SEMI` WHITESPACE@[158; 159) " " EXPR_STMT@[159; 180) BIN_EXPR@[159; 180) @@ -225,11 +202,9 @@ SOURCE_FILE@[0; 240) NAME_REF@[159; 164) IDENT@[159; 164) "Trait" L_ANGLE@[164; 165) "<" - err: `expected expression` ERROR@[165; 167) LIFETIME@[165; 167) "\'a" R_ANGLE@[167; 168) ">" - err: `expected expression` ERROR@[168; 169) R_PAREN@[168; 169) ")" WHITESPACE@[169; 170) " " @@ -244,10 +219,8 @@ SOURCE_FILE@[0; 240) IDENT@[173; 177) "Copy" R_PAREN@[177; 178) ")" R_ANGLE@[178; 179) ">" - err: `expected expression` ERROR@[179; 180) SEMI@[179; 180) ";" - err: `expected SEMI` WHITESPACE@[180; 185) "\n " LET_STMT@[185; 235) LET_KW@[185; 188) "let" @@ -288,8 +261,6 @@ SOURCE_FILE@[0; 240) LIFETIME@[211; 213) "\'a" R_ANGLE@[213; 214) ">" R_PAREN@[214; 215) ")" - err: `expected COMMA` - err: `expected R_ANGLE` WHITESPACE@[215; 216) " " PLUS@[216; 217) "+" WHITESPACE@[217; 218) " " @@ -313,8 +284,6 @@ SOURCE_FILE@[0; 240) NAME_REF@[229; 234) IDENT@[229; 234) "Sized" R_PAREN@[234; 235) ")" - err: `expected SEMI` - err: `expected expression` EXPR_STMT@[235; 237) ERROR@[235; 236) R_ANGLE@[235; 236) ">" @@ -322,3 +291,34 @@ SOURCE_FILE@[0; 240) WHITESPACE@[237; 238) "\n" R_CURLY@[238; 239) "}" WHITESPACE@[239; 240) "\n" +err: `expected COMMA` +err: `expected R_ANGLE` +err: `expected SEMI` +err: `expected expression` +err: `expected type` +err: `expected R_PAREN` +err: `expected COMMA` +err: `expected R_ANGLE` +err: `expected SEMI` +err: `expected SEMI` +err: `expected expression` +err: `expected SEMI` +err: `expected expression` +err: `expected SEMI` +err: `expected expression` +err: `expected R_PAREN` +err: `expected SEMI` +err: `expected pattern` +err: `expected IN_KW` +err: `expected expression` +err: `expected a block` +err: `expected expression` +err: `expected SEMI` +err: `expected expression` +err: `expected expression` +err: `expected expression` +err: `expected SEMI` +err: `expected COMMA` +err: `expected R_ANGLE` +err: `expected SEMI` +err: `expected expression` diff --git a/crates/ra_syntax/tests/data/parser/err/0025_nope.txt b/crates/ra_syntax/tests/data/parser/err/0025_nope.txt index b8d769947..a1bd8647a 100644 --- a/crates/ra_syntax/tests/data/parser/err/0025_nope.txt +++ b/crates/ra_syntax/tests/data/parser/err/0025_nope.txt @@ -50,14 +50,10 @@ SOURCE_FILE@[0; 575) NAME@[91; 94) IDENT@[91; 94) "abc" COLON@[94; 95) ":" - err: `expected type` - err: `expected COMMA` WHITESPACE@[95; 96) " " - err: `expected field` ERROR@[96; 98) L_CURLY@[96; 97) "{" R_CURLY@[97; 98) "}" - err: `expected field declaration` ERROR@[98; 99) COMMA@[98; 99) "," WHITESPACE@[99; 100) " " @@ -159,17 +155,11 @@ SOURCE_FILE@[0; 575) PATH_SEGMENT@[368; 371) NAME_REF@[368; 371) IDENT@[368; 371) "i32" - err: `expected COMMA` WHITESPACE@[371; 372) " " - err: `expected a type` - err: `expected R_PAREN` - err: `expected COMMA` - err: `expected enum variant` ERROR@[372; 372) ERROR@[372; 374) L_CURLY@[372; 373) "{" R_CURLY@[373; 374) "}" - err: `expected enum variant` ERROR@[374; 375) R_PAREN@[374; 375) ")" WHITESPACE@[375; 376) " " @@ -192,7 +182,6 @@ SOURCE_FILE@[0; 575) WHITESPACE@[505; 506) " " EQ@[506; 507) "=" WHITESPACE@[507; 508) " " - err: `expected expression` ERROR@[508; 509) UNDERSCORE@[508; 509) "_" SEMI@[509; 510) ";" @@ -201,3 +190,14 @@ SOURCE_FILE@[0; 575) WHITESPACE@[572; 573) "\n" R_CURLY@[573; 574) "}" WHITESPACE@[574; 575) "\n" +err: `expected type` +err: `expected COMMA` +err: `expected field` +err: `expected field declaration` +err: `expected COMMA` +err: `expected a type` +err: `expected R_PAREN` +err: `expected COMMA` +err: `expected enum variant` +err: `expected enum variant` +err: `expected expression` diff --git a/crates/ra_syntax/tests/data/parser/err/0026_imp_recovery.txt b/crates/ra_syntax/tests/data/parser/err/0026_imp_recovery.txt index cfd06c9c9..f473718dc 100644 --- a/crates/ra_syntax/tests/data/parser/err/0026_imp_recovery.txt +++ b/crates/ra_syntax/tests/data/parser/err/0026_imp_recovery.txt @@ -16,8 +16,6 @@ SOURCE_FILE@[0; 38) NAME_REF@[8; 13) IDENT@[8; 13) "Clone" R_ANGLE@[13; 14) ">" - err: `expected trait or type` - err: `expected `{`` WHITESPACE@[14; 15) "\n" IMPL_BLOCK@[15; 37) IMPL_KW@[15; 19) "impl" @@ -47,3 +45,5 @@ SOURCE_FILE@[0; 38) L_CURLY@[35; 36) "{" R_CURLY@[36; 37) "}" WHITESPACE@[37; 38) "\n" +err: `expected trait or type` +err: `expected `{`` diff --git a/crates/ra_syntax/tests/data/parser/err/0027_incomplere_where_for.txt b/crates/ra_syntax/tests/data/parser/err/0027_incomplere_where_for.txt index c87c2c936..5a2b52d05 100644 --- a/crates/ra_syntax/tests/data/parser/err/0027_incomplere_where_for.txt +++ b/crates/ra_syntax/tests/data/parser/err/0027_incomplere_where_for.txt @@ -19,10 +19,10 @@ SOURCE_FILE@[0; 30) LIFETIME_PARAM@[23; 25) LIFETIME@[23; 25) "\'a" R_ANGLE@[25; 26) ">" - err: `expected a path` - err: `expected colon` WHITESPACE@[26; 27) "\n" BLOCK@[27; 29) L_CURLY@[27; 28) "{" R_CURLY@[28; 29) "}" WHITESPACE@[29; 30) "\n" +err: `expected a path` +err: `expected colon` diff --git a/crates/ra_syntax/tests/data/parser/err/0028_macro_2.0.txt b/crates/ra_syntax/tests/data/parser/err/0028_macro_2.0.txt index 97ec4a5ab..8a59a5ac3 100644 --- a/crates/ra_syntax/tests/data/parser/err/0028_macro_2.0.txt +++ b/crates/ra_syntax/tests/data/parser/err/0028_macro_2.0.txt @@ -4,7 +4,6 @@ SOURCE_FILE@[0; 349) PATH_SEGMENT@[0; 5) NAME_REF@[0; 5) IDENT@[0; 5) "macro" - err: `expected EXCL` WHITESPACE@[5; 6) " " NAME@[6; 21) IDENT@[6; 21) "parse_use_trees" @@ -28,9 +27,7 @@ SOURCE_FILE@[0; 349) R_PAREN@[38; 39) ")" STAR@[39; 40) "*" R_PAREN@[40; 41) ")" - err: `expected SEMI` WHITESPACE@[41; 42) " " - err: `expected an item` ERROR@[42; 93) L_CURLY@[42; 43) "{" WHITESPACE@[43; 48) "\n " @@ -85,7 +82,6 @@ SOURCE_FILE@[0; 349) PATH_SEGMENT@[134; 139) NAME_REF@[134; 139) IDENT@[134; 139) "macro" - err: `expected SEMI` WHITESPACE@[139; 140) " " EXPR_STMT@[140; 154) CALL_EXPR@[140; 154) @@ -98,175 +94,112 @@ SOURCE_FILE@[0; 349) L_PAREN@[150; 151) "(" ARRAY_EXPR@[151; 154) L_BRACK@[151; 152) "[" - err: `expected expression` ERROR@[152; 153) DOLLAR@[152; 153) "$" - err: `expected COMMA` PAREN_EXPR@[153; 154) L_PAREN@[153; 154) "(" - err: `expected expression` - err: `expected R_PAREN` - err: `expected COMMA` - err: `expected expression` - err: `expected R_BRACK` - err: `expected COMMA` - err: `expected SEMI` - err: `expected expression` EXPR_STMT@[154; 155) ERROR@[154; 155) DOLLAR@[154; 155) "$" - err: `expected SEMI` EXPR_STMT@[155; 160) PATH_EXPR@[155; 160) PATH@[155; 160) PATH_SEGMENT@[155; 160) NAME_REF@[155; 160) IDENT@[155; 160) "input" - err: `expected SEMI` - err: `expected expression` EXPR_STMT@[160; 161) ERROR@[160; 161) COLON@[160; 161) ":" - err: `expected SEMI` EXPR_STMT@[161; 165) PATH_EXPR@[161; 165) PATH@[161; 165) PATH_SEGMENT@[161; 165) NAME_REF@[161; 165) IDENT@[161; 165) "expr" - err: `expected SEMI` - err: `expected expression` EXPR_STMT@[165; 166) ERROR@[165; 166) R_PAREN@[165; 166) ")" - err: `expected SEMI` - err: `expected expression` EXPR_STMT@[166; 167) ERROR@[166; 167) COMMA@[166; 167) "," - err: `expected SEMI` EXPR_STMT@[167; 170) PREFIX_EXPR@[167; 170) STAR@[167; 168) "*" WHITESPACE@[168; 169) " " - err: `expected expression` ERROR@[169; 170) DOLLAR@[169; 170) "$" - err: `expected SEMI` EXPR_STMT@[170; 171) PAREN_EXPR@[170; 171) L_PAREN@[170; 171) "(" - err: `expected expression` - err: `expected R_PAREN` - err: `expected SEMI` - err: `expected expression` EXPR_STMT@[171; 172) ERROR@[171; 172) COMMA@[171; 172) "," - err: `expected SEMI` - err: `expected expression` EXPR_STMT@[172; 173) ERROR@[172; 173) R_PAREN@[172; 173) ")" - err: `expected SEMI` EXPR_STMT@[173; 175) PREFIX_EXPR@[173; 175) STAR@[173; 174) "*" - err: `expected expression` ERROR@[174; 175) R_BRACK@[174; 175) "]" - err: `expected SEMI` - err: `expected expression` EXPR_STMT@[175; 176) ERROR@[175; 176) COMMA@[175; 176) "," - err: `expected SEMI` WHITESPACE@[176; 177) " " EXPR_STMT@[177; 180) ARRAY_EXPR@[177; 180) L_BRACK@[177; 178) "[" - err: `expected expression` ERROR@[178; 179) DOLLAR@[178; 179) "$" - err: `expected COMMA` PAREN_EXPR@[179; 180) L_PAREN@[179; 180) "(" - err: `expected expression` - err: `expected R_PAREN` - err: `expected COMMA` - err: `expected expression` - err: `expected R_BRACK` - err: `expected SEMI` - err: `expected expression` EXPR_STMT@[180; 181) ERROR@[180; 181) DOLLAR@[180; 181) "$" - err: `expected SEMI` EXPR_STMT@[181; 187) PATH_EXPR@[181; 187) PATH@[181; 187) PATH_SEGMENT@[181; 187) NAME_REF@[181; 187) IDENT@[181; 187) "output" - err: `expected SEMI` - err: `expected expression` EXPR_STMT@[187; 188) ERROR@[187; 188) COLON@[187; 188) ":" - err: `expected SEMI` EXPR_STMT@[188; 192) PATH_EXPR@[188; 192) PATH@[188; 192) PATH_SEGMENT@[188; 192) NAME_REF@[188; 192) IDENT@[188; 192) "expr" - err: `expected SEMI` - err: `expected expression` EXPR_STMT@[192; 193) ERROR@[192; 193) R_PAREN@[192; 193) ")" - err: `expected SEMI` - err: `expected expression` EXPR_STMT@[193; 194) ERROR@[193; 194) COMMA@[193; 194) "," - err: `expected SEMI` EXPR_STMT@[194; 197) PREFIX_EXPR@[194; 197) STAR@[194; 195) "*" WHITESPACE@[195; 196) " " - err: `expected expression` ERROR@[196; 197) DOLLAR@[196; 197) "$" - err: `expected SEMI` EXPR_STMT@[197; 198) PAREN_EXPR@[197; 198) L_PAREN@[197; 198) "(" - err: `expected expression` - err: `expected R_PAREN` - err: `expected SEMI` - err: `expected expression` EXPR_STMT@[198; 199) ERROR@[198; 199) COMMA@[198; 199) "," - err: `expected SEMI` - err: `expected expression` EXPR_STMT@[199; 200) ERROR@[199; 200) R_PAREN@[199; 200) ")" - err: `expected SEMI` EXPR_STMT@[200; 202) PREFIX_EXPR@[200; 202) STAR@[200; 201) "*" - err: `expected expression` ERROR@[201; 202) R_BRACK@[201; 202) "]" - err: `expected SEMI` - err: `expected expression` EXPR_STMT@[202; 203) ERROR@[202; 203) R_PAREN@[202; 203) ")" - err: `expected SEMI` WHITESPACE@[203; 204) " " BLOCK_EXPR@[204; 346) BLOCK@[204; 346) @@ -323,3 +256,70 @@ SOURCE_FILE@[0; 349) WHITESPACE@[346; 347) "\n" R_CURLY@[347; 348) "}" WHITESPACE@[348; 349) "\n" +err: `expected EXCL` +err: `expected SEMI` +err: `expected an item` +err: `expected SEMI` +err: `expected expression` +err: `expected COMMA` +err: `expected expression` +err: `expected R_PAREN` +err: `expected COMMA` +err: `expected expression` +err: `expected R_BRACK` +err: `expected COMMA` +err: `expected SEMI` +err: `expected expression` +err: `expected SEMI` +err: `expected SEMI` +err: `expected expression` +err: `expected SEMI` +err: `expected SEMI` +err: `expected expression` +err: `expected SEMI` +err: `expected expression` +err: `expected SEMI` +err: `expected expression` +err: `expected SEMI` +err: `expected expression` +err: `expected R_PAREN` +err: `expected SEMI` +err: `expected expression` +err: `expected SEMI` +err: `expected expression` +err: `expected SEMI` +err: `expected expression` +err: `expected SEMI` +err: `expected expression` +err: `expected SEMI` +err: `expected expression` +err: `expected COMMA` +err: `expected expression` +err: `expected R_PAREN` +err: `expected COMMA` +err: `expected expression` +err: `expected R_BRACK` +err: `expected SEMI` +err: `expected expression` +err: `expected SEMI` +err: `expected SEMI` +err: `expected expression` +err: `expected SEMI` +err: `expected SEMI` +err: `expected expression` +err: `expected SEMI` +err: `expected expression` +err: `expected SEMI` +err: `expected expression` +err: `expected SEMI` +err: `expected expression` +err: `expected R_PAREN` +err: `expected SEMI` +err: `expected expression` +err: `expected SEMI` +err: `expected expression` +err: `expected SEMI` +err: `expected expression` +err: `expected SEMI` +err: `expected expression` +err: `expected SEMI` diff --git a/crates/ra_syntax/tests/data/parser/err/0029_field_completion.txt b/crates/ra_syntax/tests/data/parser/err/0029_field_completion.txt index 27a0884f9..fa92f0845 100644 --- a/crates/ra_syntax/tests/data/parser/err/0029_field_completion.txt +++ b/crates/ra_syntax/tests/data/parser/err/0029_field_completion.txt @@ -29,7 +29,7 @@ SOURCE_FILE@[0; 24) NAME_REF@[19; 20) IDENT@[19; 20) "a" DOT@[20; 21) "." - err: `expected field name or number` WHITESPACE@[21; 22) "\n" R_CURLY@[22; 23) "}" WHITESPACE@[23; 24) "\n" +err: `expected field name or number` diff --git a/crates/ra_syntax/tests/data/parser/err/0030_string_suffixes.txt b/crates/ra_syntax/tests/data/parser/err/0030_string_suffixes.txt index e0e38d37d..fb6d3c9c7 100644 --- a/crates/ra_syntax/tests/data/parser/err/0030_string_suffixes.txt +++ b/crates/ra_syntax/tests/data/parser/err/0030_string_suffixes.txt @@ -21,7 +21,6 @@ SOURCE_FILE@[0; 112) WHITESPACE@[23; 24) " " LITERAL@[24; 27) CHAR@[24; 27) "\'c\'" - err: `expected SEMI` EXPR_STMT@[27; 31) PATH_EXPR@[27; 30) PATH@[27; 30) @@ -68,3 +67,4 @@ SOURCE_FILE@[0; 112) WHITESPACE@[109; 110) "\n" R_CURLY@[110; 111) "}" WHITESPACE@[111; 112) "\n" +err: `expected SEMI` diff --git a/crates/ra_syntax/tests/data/parser/err/0031_block_inner_attrs.txt b/crates/ra_syntax/tests/data/parser/err/0031_block_inner_attrs.txt index 80a973d4d..b4ec999b1 100644 --- a/crates/ra_syntax/tests/data/parser/err/0031_block_inner_attrs.txt +++ b/crates/ra_syntax/tests/data/parser/err/0031_block_inner_attrs.txt @@ -24,7 +24,6 @@ SOURCE_FILE@[0; 350) BLOCK@[29; 128) L_CURLY@[29; 30) "{" WHITESPACE@[30; 39) "\n " - err: `A block in this position cannot accept inner attributes` ATTR@[39; 83) POUND@[39; 40) "#" EXCL@[40; 41) "!" @@ -53,7 +52,6 @@ SOURCE_FILE@[0; 350) BLOCK@[142; 257) L_CURLY@[142; 143) "{" WHITESPACE@[143; 152) "\n " - err: `A block in this position cannot accept inner attributes` ATTR@[152; 171) POUND@[152; 153) "#" EXCL@[153; 154) "!" @@ -66,7 +64,6 @@ SOURCE_FILE@[0; 350) R_PAREN@[169; 170) ")" R_BRACK@[170; 171) "]" WHITESPACE@[171; 180) "\n " - err: `A block in this position cannot accept inner attributes` ATTR@[180; 212) POUND@[180; 181) "#" EXCL@[181; 182) "!" @@ -93,7 +90,6 @@ SOURCE_FILE@[0; 350) BLOCK@[273; 347) L_CURLY@[273; 274) "{" WHITESPACE@[274; 283) "\n " - err: `A block in this position cannot accept inner attributes` ATTR@[283; 302) POUND@[283; 284) "#" EXCL@[284; 285) "!" @@ -112,3 +108,7 @@ SOURCE_FILE@[0; 350) WHITESPACE@[347; 348) "\n" R_CURLY@[348; 349) "}" WHITESPACE@[349; 350) "\n" +err: `A block in this position cannot accept inner attributes` +err: `A block in this position cannot accept inner attributes` +err: `A block in this position cannot accept inner attributes` +err: `A block in this position cannot accept inner attributes` diff --git a/crates/ra_syntax/tests/data/parser/err/0032_match_arms_inner_attrs.txt b/crates/ra_syntax/tests/data/parser/err/0032_match_arms_inner_attrs.txt index 92e3a1ee8..a3c53f353 100644 --- a/crates/ra_syntax/tests/data/parser/err/0032_match_arms_inner_attrs.txt +++ b/crates/ra_syntax/tests/data/parser/err/0032_match_arms_inner_attrs.txt @@ -36,11 +36,8 @@ SOURCE_FILE@[0; 293) MATCH_ARM@[51; 78) ATTR@[51; 52) POUND@[51; 52) "#" - err: `expected `[`` - err: `expected pattern` ERROR@[52; 53) EXCL@[52; 53) "!" - err: `expected FAT_ARROW` ARRAY_EXPR@[53; 78) L_BRACK@[53; 54) "[" CALL_EXPR@[54; 77) @@ -55,7 +52,6 @@ SOURCE_FILE@[0; 293) STRING@[58; 76) "\"Not allowed here\"" R_PAREN@[76; 77) ")" R_BRACK@[77; 78) "]" - err: `expected COMMA` WHITESPACE@[78; 87) "\n " MATCH_ARM@[87; 94) PLACEHOLDER_PAT@[87; 88) @@ -106,11 +102,8 @@ SOURCE_FILE@[0; 293) MATCH_ARM@[160; 179) ATTR@[160; 161) POUND@[160; 161) "#" - err: `expected `[`` - err: `expected pattern` ERROR@[161; 162) EXCL@[161; 162) "!" - err: `expected FAT_ARROW` ARRAY_EXPR@[162; 179) L_BRACK@[162; 163) "[" CALL_EXPR@[163; 178) @@ -152,11 +145,8 @@ SOURCE_FILE@[0; 293) WHITESPACE@[222; 231) "\n " ATTR@[231; 232) POUND@[231; 232) "#" - err: `expected `[`` - err: `expected pattern` ERROR@[232; 233) EXCL@[232; 233) "!" - err: `expected FAT_ARROW` ARRAY_EXPR@[233; 250) L_BRACK@[233; 234) "[" CALL_EXPR@[234; 249) @@ -171,7 +161,6 @@ SOURCE_FILE@[0; 293) STRING@[238; 248) "\"Nor here\"" R_PAREN@[248; 249) ")" R_BRACK@[249; 250) "]" - err: `expected COMMA` WHITESPACE@[250; 259) "\n " MATCH_ARM@[259; 266) PLACEHOLDER_PAT@[259; 260) @@ -199,3 +188,14 @@ SOURCE_FILE@[0; 293) WHITESPACE@[290; 291) "\n" R_CURLY@[291; 292) "}" WHITESPACE@[292; 293) "\n" +err: `expected `[`` +err: `expected pattern` +err: `expected FAT_ARROW` +err: `expected COMMA` +err: `expected `[`` +err: `expected pattern` +err: `expected FAT_ARROW` +err: `expected `[`` +err: `expected pattern` +err: `expected FAT_ARROW` +err: `expected COMMA` diff --git a/crates/ra_syntax/tests/data/parser/err/0033_match_arms_outer_attrs.txt b/crates/ra_syntax/tests/data/parser/err/0033_match_arms_outer_attrs.txt index ac9cb63f7..7bcf5ec81 100644 --- a/crates/ra_syntax/tests/data/parser/err/0033_match_arms_outer_attrs.txt +++ b/crates/ra_syntax/tests/data/parser/err/0033_match_arms_outer_attrs.txt @@ -54,11 +54,11 @@ SOURCE_FILE@[0; 89) IDENT@[74; 78) "test" R_PAREN@[78; 79) ")" R_BRACK@[79; 80) "]" - err: `expected pattern` - err: `expected FAT_ARROW` - err: `expected expression` WHITESPACE@[80; 85) "\n " R_CURLY@[85; 86) "}" WHITESPACE@[86; 87) "\n" R_CURLY@[87; 88) "}" WHITESPACE@[88; 89) "\n" +err: `expected pattern` +err: `expected FAT_ARROW` +err: `expected expression` -- cgit v1.2.3