From 9fdf984958901a6bf16772c2c88b3163f044b390 Mon Sep 17 00:00:00 2001 From: Veetaha Date: Thu, 6 Feb 2020 02:33:18 +0200 Subject: ra_syntax: reshape SyntaxError for the sake of removing redundancy --- .../parser/inline/err/0001_array_type_missing_semi.txt | 10 +++++----- .../test_data/parser/inline/err/0002_misplaced_label_err.txt | 8 ++++---- .../parser/inline/err/0003_pointer_type_no_mutability.txt | 2 +- .../ra_syntax/test_data/parser/inline/err/0004_impl_type.txt | 8 ++++---- .../parser/inline/err/0005_fn_pointer_type_missing_fn.txt | 10 +++++----- .../test_data/parser/inline/err/0006_unsafe_block_in_mod.txt | 4 ++-- .../parser/inline/err/0007_async_without_semicolon.txt | 2 +- .../ra_syntax/test_data/parser/inline/err/0008_pub_expr.txt | 2 +- .../parser/inline/err/0009_attr_on_expr_not_allowed.txt | 4 ++-- .../test_data/parser/inline/err/0013_static_underscore.txt | 2 +- .../test_data/parser/inline/err/0014_default_fn_type.txt | 12 ++++++------ 11 files changed, 32 insertions(+), 32 deletions(-) (limited to 'crates/ra_syntax/test_data/parser/inline') diff --git a/crates/ra_syntax/test_data/parser/inline/err/0001_array_type_missing_semi.txt b/crates/ra_syntax/test_data/parser/inline/err/0001_array_type_missing_semi.txt index 3f0f1b480..b3baee30d 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0001_array_type_missing_semi.txt +++ b/crates/ra_syntax/test_data/parser/inline/err/0001_array_type_missing_semi.txt @@ -20,8 +20,8 @@ SOURCE_FILE@[0; 18) ERROR@[16; 17) SEMI@[16; 17) ";" WHITESPACE@[17; 18) "\n" -error 12: expected `;` or `]` -error 12: expected SEMI -error 13: expected an item -error 15: expected an item -error 16: expected an item +error [12; 13): expected `;` or `]` +error [12; 13): expected SEMI +error [13; 14): expected an item +error [15; 16): expected an item +error [16; 17): expected an item diff --git a/crates/ra_syntax/test_data/parser/inline/err/0002_misplaced_label_err.txt b/crates/ra_syntax/test_data/parser/inline/err/0002_misplaced_label_err.txt index 2950d77ef..50f37416e 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0002_misplaced_label_err.txt +++ b/crates/ra_syntax/test_data/parser/inline/err/0002_misplaced_label_err.txt @@ -23,7 +23,7 @@ SOURCE_FILE@[0; 30) WHITESPACE@[27; 28) "\n" R_CURLY@[28; 29) "}" WHITESPACE@[29; 30) "\n" -error 22: expected a loop -error 22: expected SEMI -error 27: expected type -error 27: expected `{` +error [22; 23): expected a loop +error [22; 23): expected SEMI +error [27; 28): expected type +error [27; 28): expected `{` diff --git a/crates/ra_syntax/test_data/parser/inline/err/0003_pointer_type_no_mutability.txt b/crates/ra_syntax/test_data/parser/inline/err/0003_pointer_type_no_mutability.txt index b97e339bb..c770166eb 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0003_pointer_type_no_mutability.txt +++ b/crates/ra_syntax/test_data/parser/inline/err/0003_pointer_type_no_mutability.txt @@ -14,4 +14,4 @@ SOURCE_FILE@[0; 14) R_PAREN@[11; 12) ")" SEMI@[12; 13) ";" WHITESPACE@[13; 14) "\n" -error 10: expected mut or const in raw pointer type (use `*mut T` or `*const T` as appropriate) +error [10; 11): 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/0004_impl_type.txt b/crates/ra_syntax/test_data/parser/inline/err/0004_impl_type.txt index 43321b1ed..c1eac055a 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0004_impl_type.txt +++ b/crates/ra_syntax/test_data/parser/inline/err/0004_impl_type.txt @@ -73,7 +73,7 @@ SOURCE_FILE@[0; 87) L_CURLY@[84; 85) "{" R_CURLY@[85; 86) "}" WHITESPACE@[86; 87) "\n" -error 38: expected trait or type -error 38: expected `{` -error 70: expected trait or type -error 70: expected `{` +error [38; 39): expected trait or type +error [38; 39): expected `{` +error [70; 71): expected trait or type +error [70; 71): expected `{` diff --git a/crates/ra_syntax/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.txt b/crates/ra_syntax/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.txt index 451f29d39..961648a1d 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.txt +++ b/crates/ra_syntax/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.txt @@ -16,8 +16,8 @@ SOURCE_FILE@[0; 20) ERROR@[18; 19) SEMI@[18; 19) ";" WHITESPACE@[19; 20) "\n" -error 15: expected `fn` -error 15: expected SEMI -error 16: expected an item -error 17: expected an item -error 18: expected an item +error [15; 16): expected `fn` +error [15; 16): expected SEMI +error [16; 17): expected an item +error [17; 18): expected an item +error [18; 19): expected an item diff --git a/crates/ra_syntax/test_data/parser/inline/err/0006_unsafe_block_in_mod.txt b/crates/ra_syntax/test_data/parser/inline/err/0006_unsafe_block_in_mod.txt index f3fbc4828..3e5a36db8 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0006_unsafe_block_in_mod.txt +++ b/crates/ra_syntax/test_data/parser/inline/err/0006_unsafe_block_in_mod.txt @@ -33,5 +33,5 @@ SOURCE_FILE@[0; 33) L_CURLY@[30; 31) "{" R_CURLY@[31; 32) "}" WHITESPACE@[32; 33) "\n" -error 11: expected an item -error 18: expected an item +error [11; 12): expected an item +error [18; 19): expected an item diff --git a/crates/ra_syntax/test_data/parser/inline/err/0007_async_without_semicolon.txt b/crates/ra_syntax/test_data/parser/inline/err/0007_async_without_semicolon.txt index 5cfe766d7..8b7fd43ae 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0007_async_without_semicolon.txt +++ b/crates/ra_syntax/test_data/parser/inline/err/0007_async_without_semicolon.txt @@ -29,4 +29,4 @@ SOURCE_FILE@[0; 30) WHITESPACE@[27; 28) " " R_CURLY@[28; 29) "}" WHITESPACE@[29; 30) "\n" -error 27: expected SEMI +error [27; 28): expected SEMI diff --git a/crates/ra_syntax/test_data/parser/inline/err/0008_pub_expr.txt b/crates/ra_syntax/test_data/parser/inline/err/0008_pub_expr.txt index 0594f148f..63362e74b 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0008_pub_expr.txt +++ b/crates/ra_syntax/test_data/parser/inline/err/0008_pub_expr.txt @@ -23,4 +23,4 @@ SOURCE_FILE@[0; 21) WHITESPACE@[18; 19) " " R_CURLY@[19; 20) "}" WHITESPACE@[20; 21) "\n" -error 14: expected an item +error [14; 15): expected an item diff --git a/crates/ra_syntax/test_data/parser/inline/err/0009_attr_on_expr_not_allowed.txt b/crates/ra_syntax/test_data/parser/inline/err/0009_attr_on_expr_not_allowed.txt index 2ca5b8f32..736a2f40e 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0009_attr_on_expr_not_allowed.txt +++ b/crates/ra_syntax/test_data/parser/inline/err/0009_attr_on_expr_not_allowed.txt @@ -57,5 +57,5 @@ SOURCE_FILE@[0; 48) WHITESPACE@[45; 46) "\n" R_CURLY@[46; 47) "}" WHITESPACE@[47; 48) "\n" -error 24: attributes are not allowed on BIN_EXPR -error 44: attributes are not allowed on IF_EXPR +error [24; 25): attributes are not allowed on BIN_EXPR +error [44; 45): attributes are not allowed on IF_EXPR diff --git a/crates/ra_syntax/test_data/parser/inline/err/0013_static_underscore.txt b/crates/ra_syntax/test_data/parser/inline/err/0013_static_underscore.txt index 28f75a341..58fafff13 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0013_static_underscore.txt +++ b/crates/ra_syntax/test_data/parser/inline/err/0013_static_underscore.txt @@ -18,4 +18,4 @@ SOURCE_FILE@[0; 19) INT_NUMBER@[16; 17) "5" SEMI@[17; 18) ";" WHITESPACE@[18; 19) "\n" -error 7: expected a name +error [7; 8): expected a name diff --git a/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.txt b/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.txt index a1a0bd7c4..ff53f8f4c 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.txt +++ b/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.txt @@ -51,9 +51,9 @@ SOURCE_FILE@[0; 62) WHITESPACE@[59; 60) "\n" R_CURLY@[60; 61) "}" WHITESPACE@[61; 62) "\n" -error 21: expected EXCL -error 21: expected `{`, `[`, `(` -error 21: expected SEMI -error 47: expected EXCL -error 47: expected `{`, `[`, `(` -error 47: expected SEMI +error [21; 22): expected EXCL +error [21; 22): expected `{`, `[`, `(` +error [21; 22): expected SEMI +error [47; 48): expected EXCL +error [47; 48): expected `{`, `[`, `(` +error [47; 48): expected SEMI -- cgit v1.2.3 From fc5e7b8807f6d438028389b030dfae00965a8cd5 Mon Sep 17 00:00:00 2001 From: Veetaha Date: Mon, 17 Feb 2020 23:14:31 +0200 Subject: ra_syntax: migrate test data to 0-length text-range of SyntaxError when constructed from TextUnit --- .../parser/inline/err/0001_array_type_missing_semi.txt | 10 +++++----- .../test_data/parser/inline/err/0002_misplaced_label_err.txt | 8 ++++---- .../parser/inline/err/0003_pointer_type_no_mutability.txt | 2 +- .../ra_syntax/test_data/parser/inline/err/0004_impl_type.txt | 8 ++++---- .../parser/inline/err/0005_fn_pointer_type_missing_fn.txt | 10 +++++----- .../test_data/parser/inline/err/0006_unsafe_block_in_mod.txt | 4 ++-- .../parser/inline/err/0007_async_without_semicolon.txt | 2 +- .../ra_syntax/test_data/parser/inline/err/0008_pub_expr.txt | 2 +- .../parser/inline/err/0009_attr_on_expr_not_allowed.txt | 4 ++-- .../test_data/parser/inline/err/0010_wrong_order_fns.txt | 4 ++-- .../test_data/parser/inline/err/0013_static_underscore.txt | 2 +- .../test_data/parser/inline/err/0014_default_fn_type.txt | 12 ++++++------ 12 files changed, 34 insertions(+), 34 deletions(-) (limited to 'crates/ra_syntax/test_data/parser/inline') diff --git a/crates/ra_syntax/test_data/parser/inline/err/0001_array_type_missing_semi.txt b/crates/ra_syntax/test_data/parser/inline/err/0001_array_type_missing_semi.txt index b3baee30d..530533b71 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0001_array_type_missing_semi.txt +++ b/crates/ra_syntax/test_data/parser/inline/err/0001_array_type_missing_semi.txt @@ -20,8 +20,8 @@ SOURCE_FILE@[0; 18) ERROR@[16; 17) SEMI@[16; 17) ";" WHITESPACE@[17; 18) "\n" -error [12; 13): expected `;` or `]` -error [12; 13): expected SEMI -error [13; 14): expected an item -error [15; 16): expected an item -error [16; 17): expected an item +error [12; 12): expected `;` or `]` +error [12; 12): expected SEMI +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.txt b/crates/ra_syntax/test_data/parser/inline/err/0002_misplaced_label_err.txt index 50f37416e..0187d872d 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0002_misplaced_label_err.txt +++ b/crates/ra_syntax/test_data/parser/inline/err/0002_misplaced_label_err.txt @@ -23,7 +23,7 @@ SOURCE_FILE@[0; 30) WHITESPACE@[27; 28) "\n" R_CURLY@[28; 29) "}" WHITESPACE@[29; 30) "\n" -error [22; 23): expected a loop -error [22; 23): expected SEMI -error [27; 28): expected type -error [27; 28): expected `{` +error [22; 22): expected a loop +error [22; 22): expected SEMI +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.txt b/crates/ra_syntax/test_data/parser/inline/err/0003_pointer_type_no_mutability.txt index c770166eb..2ab29eecc 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0003_pointer_type_no_mutability.txt +++ b/crates/ra_syntax/test_data/parser/inline/err/0003_pointer_type_no_mutability.txt @@ -14,4 +14,4 @@ SOURCE_FILE@[0; 14) R_PAREN@[11; 12) ")" SEMI@[12; 13) ";" WHITESPACE@[13; 14) "\n" -error [10; 11): expected mut or const in raw pointer type (use `*mut T` or `*const T` as appropriate) +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/0004_impl_type.txt b/crates/ra_syntax/test_data/parser/inline/err/0004_impl_type.txt index c1eac055a..d5aea05c2 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0004_impl_type.txt +++ b/crates/ra_syntax/test_data/parser/inline/err/0004_impl_type.txt @@ -73,7 +73,7 @@ SOURCE_FILE@[0; 87) L_CURLY@[84; 85) "{" R_CURLY@[85; 86) "}" WHITESPACE@[86; 87) "\n" -error [38; 39): expected trait or type -error [38; 39): expected `{` -error [70; 71): expected trait or type -error [70; 71): expected `{` +error [38; 38): expected trait or type +error [38; 38): expected `{` +error [70; 70): expected trait or type +error [70; 70): expected `{` diff --git a/crates/ra_syntax/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.txt b/crates/ra_syntax/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.txt index 961648a1d..9e9186ad4 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.txt +++ b/crates/ra_syntax/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.txt @@ -16,8 +16,8 @@ SOURCE_FILE@[0; 20) ERROR@[18; 19) SEMI@[18; 19) ";" WHITESPACE@[19; 20) "\n" -error [15; 16): expected `fn` -error [15; 16): expected SEMI -error [16; 17): expected an item -error [17; 18): expected an item -error [18; 19): expected an item +error [15; 15): expected `fn` +error [15; 15): expected SEMI +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/0006_unsafe_block_in_mod.txt b/crates/ra_syntax/test_data/parser/inline/err/0006_unsafe_block_in_mod.txt index 3e5a36db8..690acdca3 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0006_unsafe_block_in_mod.txt +++ b/crates/ra_syntax/test_data/parser/inline/err/0006_unsafe_block_in_mod.txt @@ -33,5 +33,5 @@ SOURCE_FILE@[0; 33) L_CURLY@[30; 31) "{" R_CURLY@[31; 32) "}" WHITESPACE@[32; 33) "\n" -error [11; 12): expected an item -error [18; 19): expected an item +error [11; 11): expected an item +error [18; 18): expected an item diff --git a/crates/ra_syntax/test_data/parser/inline/err/0007_async_without_semicolon.txt b/crates/ra_syntax/test_data/parser/inline/err/0007_async_without_semicolon.txt index 8b7fd43ae..a4002a998 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0007_async_without_semicolon.txt +++ b/crates/ra_syntax/test_data/parser/inline/err/0007_async_without_semicolon.txt @@ -29,4 +29,4 @@ SOURCE_FILE@[0; 30) WHITESPACE@[27; 28) " " R_CURLY@[28; 29) "}" WHITESPACE@[29; 30) "\n" -error [27; 28): expected SEMI +error [27; 27): expected SEMI diff --git a/crates/ra_syntax/test_data/parser/inline/err/0008_pub_expr.txt b/crates/ra_syntax/test_data/parser/inline/err/0008_pub_expr.txt index 63362e74b..6f45a4fa6 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0008_pub_expr.txt +++ b/crates/ra_syntax/test_data/parser/inline/err/0008_pub_expr.txt @@ -23,4 +23,4 @@ SOURCE_FILE@[0; 21) WHITESPACE@[18; 19) " " R_CURLY@[19; 20) "}" WHITESPACE@[20; 21) "\n" -error [14; 15): expected an item +error [14; 14): expected an item diff --git a/crates/ra_syntax/test_data/parser/inline/err/0009_attr_on_expr_not_allowed.txt b/crates/ra_syntax/test_data/parser/inline/err/0009_attr_on_expr_not_allowed.txt index 736a2f40e..e6d3a5c95 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0009_attr_on_expr_not_allowed.txt +++ b/crates/ra_syntax/test_data/parser/inline/err/0009_attr_on_expr_not_allowed.txt @@ -57,5 +57,5 @@ SOURCE_FILE@[0; 48) WHITESPACE@[45; 46) "\n" R_CURLY@[46; 47) "}" WHITESPACE@[47; 48) "\n" -error [24; 25): attributes are not allowed on BIN_EXPR -error [44; 45): attributes are not allowed on IF_EXPR +error [24; 24): attributes are not allowed on BIN_EXPR +error [44; 44): attributes are not allowed on IF_EXPR diff --git a/crates/ra_syntax/test_data/parser/inline/err/0010_wrong_order_fns.txt b/crates/ra_syntax/test_data/parser/inline/err/0010_wrong_order_fns.txt index 289193b9e..f6ac0feaf 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0010_wrong_order_fns.txt +++ b/crates/ra_syntax/test_data/parser/inline/err/0010_wrong_order_fns.txt @@ -37,5 +37,5 @@ SOURCE_FILE@[0; 50) L_CURLY@[47; 48) "{" R_CURLY@[48; 49) "}" WHITESPACE@[49; 50) "\n" -error 6: expected existential, fn, trait or impl -error 31: expected existential, fn, trait or impl +error [6; 6): expected existential, fn, trait or impl +error [31; 31): expected existential, fn, trait or impl diff --git a/crates/ra_syntax/test_data/parser/inline/err/0013_static_underscore.txt b/crates/ra_syntax/test_data/parser/inline/err/0013_static_underscore.txt index 58fafff13..5b3dc5af2 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0013_static_underscore.txt +++ b/crates/ra_syntax/test_data/parser/inline/err/0013_static_underscore.txt @@ -18,4 +18,4 @@ SOURCE_FILE@[0; 19) INT_NUMBER@[16; 17) "5" SEMI@[17; 18) ";" WHITESPACE@[18; 19) "\n" -error [7; 8): expected a name +error [7; 7): expected a name diff --git a/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.txt b/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.txt index ff53f8f4c..25d80be1d 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.txt +++ b/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.txt @@ -51,9 +51,9 @@ SOURCE_FILE@[0; 62) WHITESPACE@[59; 60) "\n" R_CURLY@[60; 61) "}" WHITESPACE@[61; 62) "\n" -error [21; 22): expected EXCL -error [21; 22): expected `{`, `[`, `(` -error [21; 22): expected SEMI -error [47; 48): expected EXCL -error [47; 48): expected `{`, `[`, `(` -error [47; 48): expected SEMI +error [21; 21): expected EXCL +error [21; 21): expected `{`, `[`, `(` +error [21; 21): expected SEMI +error [47; 47): expected EXCL +error [47; 47): expected `{`, `[`, `(` +error [47; 47): expected SEMI -- cgit v1.2.3