From 5c5bde47fb759440d007c90fd83021de538120b8 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 10 Apr 2020 17:06:57 +0200 Subject: Rename some tokens --- .../parser/inline/err/0001_array_type_missing_semi.rast | 4 ++-- .../test_data/parser/inline/err/0002_misplaced_label_err.rast | 2 +- .../parser/inline/err/0003_pointer_type_no_mutability.rast | 2 +- .../parser/inline/err/0005_fn_pointer_type_missing_fn.rast | 4 ++-- .../parser/inline/err/0007_async_without_semicolon.rast | 2 +- .../ra_syntax/test_data/parser/inline/err/0008_pub_expr.rast | 2 +- .../parser/inline/err/0009_attr_on_expr_not_allowed.rast | 4 ++-- .../test_data/parser/inline/err/0010_bad_tuple_index_expr.rast | 6 +++--- .../test_data/parser/inline/err/0013_static_underscore.rast | 2 +- .../test_data/parser/inline/err/0014_default_fn_type.rast | 10 +++++----- 10 files changed, 19 insertions(+), 19 deletions(-) (limited to 'crates/ra_syntax/test_data/parser/inline/err') 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) ERROR@[15; 16) R_BRACK@[15; 16) "]" ERROR@[16; 17) - SEMI@[16; 17) ";" + SEMICOLON@[16; 17) ";" WHITESPACE@[17; 18) "\n" error [12; 12): expected `;` or `]` -error [12; 12): expected SEMI +error [12; 12): expected SEMICOLON error [13; 13): expected an item error [15; 15): expected an item 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) R_CURLY@[28; 29) "}" WHITESPACE@[29; 30) "\n" error [22; 22): expected a loop -error [22; 22): expected SEMI +error [22; 22): expected SEMICOLON error [27; 27): expected type 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) TUPLE_TYPE@[10; 12) L_PAREN@[10; 11) "(" R_PAREN@[11; 12) ")" - SEMI@[12; 13) ";" + SEMICOLON@[12; 13) ";" WHITESPACE@[13; 14) "\n" 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) ERROR@[17; 18) R_PAREN@[17; 18) ")" ERROR@[18; 19) - SEMI@[18; 19) ";" + SEMICOLON@[18; 19) ";" WHITESPACE@[19; 20) "\n" error [15; 15): expected `fn` -error [15; 15): expected SEMI +error [15; 15): expected SEMICOLON error [16; 16): expected an item error [17; 17): expected an item 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) WHITESPACE@[27; 28) " " R_CURLY@[28; 29) "}" WHITESPACE@[29; 30) "\n" -error [27; 27): expected SEMI +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) EXPR_STMT@[15; 18) LITERAL@[15; 17) INT_NUMBER@[15; 17) "92" - SEMI@[17; 18) ";" + SEMICOLON@[17; 18) ";" WHITESPACE@[18; 19) " " R_CURLY@[19; 20) "}" 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) WHITESPACE@[22; 23) " " LITERAL@[23; 24) INT_NUMBER@[23; 24) "2" - SEMI@[24; 25) ";" + SEMICOLON@[24; 25) ";" WHITESPACE@[25; 29) "\n " EXPR_STMT@[29; 45) ATTR@[29; 33) @@ -53,7 +53,7 @@ SOURCE_FILE@[0; 48) BLOCK@[42; 44) L_CURLY@[42; 43) "{" R_CURLY@[43; 44) "}" - SEMI@[44; 45) ";" + SEMICOLON@[44; 45) ";" WHITESPACE@[45; 46) "\n" R_CURLY@[46; 47) "}" 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) IDENT@[15; 16) "x" DOT@[16; 17) "." FLOAT_NUMBER@[17; 19) "0." - SEMI@[19; 20) ";" + SEMICOLON@[19; 20) ";" WHITESPACE@[20; 25) "\n " EXPR_STMT@[25; 32) FIELD_EXPR@[25; 31) @@ -33,7 +33,7 @@ SOURCE_FILE@[0; 47) DOT@[26; 27) "." NAME_REF@[27; 31) INT_NUMBER@[27; 31) "1i32" - SEMI@[31; 32) ";" + SEMICOLON@[31; 32) ";" WHITESPACE@[32; 37) "\n " EXPR_STMT@[37; 44) FIELD_EXPR@[37; 43) @@ -45,7 +45,7 @@ SOURCE_FILE@[0; 47) DOT@[38; 39) "." NAME_REF@[39; 43) INT_NUMBER@[39; 43) "0x01" - SEMI@[43; 44) ";" + SEMICOLON@[43; 44) ";" WHITESPACE@[44; 45) "\n" R_CURLY@[45; 46) "}" 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) WHITESPACE@[15; 16) " " LITERAL@[16; 17) INT_NUMBER@[16; 17) "5" - SEMI@[17; 18) ";" + SEMICOLON@[17; 18) ";" WHITESPACE@[18; 19) "\n" 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) PATH_SEGMENT@[31; 34) NAME_REF@[31; 34) IDENT@[31; 34) "Bar" - SEMI@[34; 35) ";" + SEMICOLON@[34; 35) ";" WHITESPACE@[35; 40) "\n " MACRO_CALL@[40; 47) PATH@[40; 47) @@ -51,9 +51,9 @@ SOURCE_FILE@[0; 62) WHITESPACE@[59; 60) "\n" R_CURLY@[60; 61) "}" WHITESPACE@[61; 62) "\n" -error [21; 21): expected EXCL +error [21; 21): expected BANG error [21; 21): expected `{`, `[`, `(` -error [21; 21): expected SEMI -error [47; 47): expected EXCL +error [21; 21): expected SEMICOLON +error [47; 47): expected BANG error [47; 47): expected `{`, `[`, `(` -error [47; 47): expected SEMI +error [47; 47): expected SEMICOLON -- cgit v1.2.3 From 7a39bc3ba29351feabcd4a16e12568a9e12818ca Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 11 Apr 2020 16:42:24 +0200 Subject: Make records grammar more orthogonal We used name [: expr] grammar before, now it is [name :] expr which makes things simpler --- ...14_record_literal_before_ellipsis_recovery.rast | 49 ++++++++++++++++++++++ ...0014_record_literal_before_ellipsis_recovery.rs | 3 ++ 2 files changed, 52 insertions(+) create mode 100644 crates/ra_syntax/test_data/parser/inline/err/0014_record_literal_before_ellipsis_recovery.rast create mode 100644 crates/ra_syntax/test_data/parser/inline/err/0014_record_literal_before_ellipsis_recovery.rs (limited to 'crates/ra_syntax/test_data/parser/inline/err') 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 @@ +SOURCE_FILE@[0; 45) + FN_DEF@[0; 44) + FN_KW@[0; 2) "fn" + WHITESPACE@[2; 3) " " + NAME@[3; 7) + IDENT@[3; 7) "main" + PARAM_LIST@[7; 9) + L_PAREN@[7; 8) "(" + R_PAREN@[8; 9) ")" + WHITESPACE@[9; 10) " " + BLOCK_EXPR@[10; 44) + BLOCK@[10; 44) + L_CURLY@[10; 11) "{" + WHITESPACE@[11; 16) "\n " + RECORD_LIT@[16; 42) + PATH@[16; 17) + PATH_SEGMENT@[16; 17) + NAME_REF@[16; 17) + IDENT@[16; 17) "S" + WHITESPACE@[17; 18) " " + RECORD_FIELD_LIST@[18; 42) + L_CURLY@[18; 19) "{" + WHITESPACE@[19; 20) " " + RECORD_FIELD@[20; 40) + NAME_REF@[20; 25) + IDENT@[20; 25) "field" + WHITESPACE@[25; 26) " " + RANGE_EXPR@[26; 40) + DOT2@[26; 28) ".." + CALL_EXPR@[28; 40) + PATH_EXPR@[28; 38) + PATH@[28; 38) + PATH@[28; 29) + PATH_SEGMENT@[28; 29) + NAME_REF@[28; 29) + IDENT@[28; 29) "S" + COLON2@[29; 31) "::" + PATH_SEGMENT@[31; 38) + NAME_REF@[31; 38) + IDENT@[31; 38) "default" + ARG_LIST@[38; 40) + L_PAREN@[38; 39) "(" + R_PAREN@[39; 40) ")" + WHITESPACE@[40; 41) " " + R_CURLY@[41; 42) "}" + WHITESPACE@[42; 43) "\n" + R_CURLY@[43; 44) "}" + WHITESPACE@[44; 45) "\n" +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 @@ +fn main() { + S { field ..S::default() } +} -- cgit v1.2.3