From f73a6419d43b21d07b7ee5d3804bdd586ee8036f Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 12 Aug 2020 14:26:36 +0200 Subject: Allow default everywhere closes #5681 --- .../test_data/parser/err/0043_default_const.rast | 40 ---------------------- .../test_data/parser/err/0043_default_const.rs | 3 -- 2 files changed, 43 deletions(-) delete mode 100644 crates/ra_syntax/test_data/parser/err/0043_default_const.rast delete mode 100644 crates/ra_syntax/test_data/parser/err/0043_default_const.rs (limited to 'crates/ra_syntax/test_data/parser/err') diff --git a/crates/ra_syntax/test_data/parser/err/0043_default_const.rast b/crates/ra_syntax/test_data/parser/err/0043_default_const.rast deleted file mode 100644 index 51ad2a846..000000000 --- a/crates/ra_syntax/test_data/parser/err/0043_default_const.rast +++ /dev/null @@ -1,40 +0,0 @@ -SOURCE_FILE@0..39 - TRAIT@0..38 - TRAIT_KW@0..5 "trait" - WHITESPACE@5..6 " " - NAME@6..7 - IDENT@6..7 "T" - WHITESPACE@7..8 " " - ASSOC_ITEM_LIST@8..38 - L_CURLY@8..9 "{" - WHITESPACE@9..12 "\n " - MACRO_CALL@12..19 - PATH@12..19 - PATH_SEGMENT@12..19 - NAME_REF@12..19 - IDENT@12..19 "default" - WHITESPACE@19..20 " " - CONST@20..36 - CONST_KW@20..25 "const" - WHITESPACE@25..26 " " - NAME@26..27 - IDENT@26..27 "f" - COLON@27..28 ":" - WHITESPACE@28..29 " " - PATH_TYPE@29..31 - PATH@29..31 - PATH_SEGMENT@29..31 - NAME_REF@29..31 - IDENT@29..31 "u8" - WHITESPACE@31..32 " " - EQ@32..33 "=" - WHITESPACE@33..34 " " - LITERAL@34..35 - INT_NUMBER@34..35 "0" - SEMICOLON@35..36 ";" - WHITESPACE@36..37 "\n" - R_CURLY@37..38 "}" - WHITESPACE@38..39 "\n" -error 19..19: expected BANG -error 19..19: expected `{`, `[`, `(` -error 19..19: expected SEMICOLON diff --git a/crates/ra_syntax/test_data/parser/err/0043_default_const.rs b/crates/ra_syntax/test_data/parser/err/0043_default_const.rs deleted file mode 100644 index 80f15474a..000000000 --- a/crates/ra_syntax/test_data/parser/err/0043_default_const.rs +++ /dev/null @@ -1,3 +0,0 @@ -trait T { - default const f: u8 = 0; -} -- cgit v1.2.3 From f8bfd77e84e5b51dc28ff219e99fdfd6fd9f92c2 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 12 Aug 2020 14:52:37 +0200 Subject: Cleanup parser modifiers tests --- .../test_data/parser/err/0043_weird_blocks.rast | 71 ++++++++++++++++++++++ .../test_data/parser/err/0043_weird_blocks.rs | 6 ++ .../test_data/parser/err/0045_item_modifiers.rast | 45 ++++++++++++++ .../test_data/parser/err/0045_item_modifiers.rs | 2 + .../test_data/parser/err/0163_weird_blocks.rast | 71 ---------------------- .../test_data/parser/err/0163_weird_blocks.rs | 6 -- 6 files changed, 124 insertions(+), 77 deletions(-) create mode 100644 crates/ra_syntax/test_data/parser/err/0043_weird_blocks.rast create mode 100644 crates/ra_syntax/test_data/parser/err/0043_weird_blocks.rs create mode 100644 crates/ra_syntax/test_data/parser/err/0045_item_modifiers.rast create mode 100644 crates/ra_syntax/test_data/parser/err/0045_item_modifiers.rs delete mode 100644 crates/ra_syntax/test_data/parser/err/0163_weird_blocks.rast delete mode 100644 crates/ra_syntax/test_data/parser/err/0163_weird_blocks.rs (limited to 'crates/ra_syntax/test_data/parser/err') diff --git a/crates/ra_syntax/test_data/parser/err/0043_weird_blocks.rast b/crates/ra_syntax/test_data/parser/err/0043_weird_blocks.rast new file mode 100644 index 000000000..df29017e7 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/err/0043_weird_blocks.rast @@ -0,0 +1,71 @@ +SOURCE_FILE@0..83 + FN@0..82 + 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..82 + L_CURLY@10..11 "{" + WHITESPACE@11..16 "\n " + EXPR_STMT@16..29 + BLOCK_EXPR@16..29 + L_CURLY@16..17 "{" + WHITESPACE@17..18 " " + ERROR@18..24 + UNSAFE_KW@18..24 "unsafe" + WHITESPACE@24..25 " " + LITERAL@25..27 + INT_NUMBER@25..27 "92" + WHITESPACE@27..28 " " + R_CURLY@28..29 "}" + WHITESPACE@29..34 "\n " + EXPR_STMT@34..46 + BLOCK_EXPR@34..46 + L_CURLY@34..35 "{" + WHITESPACE@35..36 " " + ERROR@36..41 + ASYNC_KW@36..41 "async" + WHITESPACE@41..42 " " + LITERAL@42..44 + INT_NUMBER@42..44 "92" + WHITESPACE@44..45 " " + R_CURLY@45..46 "}" + WHITESPACE@46..51 "\n " + EXPR_STMT@51..61 + BLOCK_EXPR@51..61 + L_CURLY@51..52 "{" + WHITESPACE@52..53 " " + EXPR_STMT@53..56 + EFFECT_EXPR@53..56 + TRY_KW@53..56 "try" + WHITESPACE@56..57 " " + LITERAL@57..59 + INT_NUMBER@57..59 "92" + WHITESPACE@59..60 " " + R_CURLY@60..61 "}" + WHITESPACE@61..66 "\n " + BLOCK_EXPR@66..80 + L_CURLY@66..67 "{" + WHITESPACE@67..68 " " + EXPR_STMT@68..75 + ERROR@68..75 + LABEL@68..75 + LIFETIME@68..74 "\'label" + COLON@74..75 ":" + WHITESPACE@75..76 " " + LITERAL@76..78 + INT_NUMBER@76..78 "92" + WHITESPACE@78..79 " " + R_CURLY@79..80 "}" + WHITESPACE@80..81 "\n" + R_CURLY@81..82 "}" + WHITESPACE@82..83 "\n" +error 24..24: expected existential, fn, trait or impl +error 41..41: expected existential, fn, trait or impl +error 56..56: expected a block +error 75..75: expected a loop +error 75..75: expected SEMICOLON diff --git a/crates/ra_syntax/test_data/parser/err/0043_weird_blocks.rs b/crates/ra_syntax/test_data/parser/err/0043_weird_blocks.rs new file mode 100644 index 000000000..8fa324c1a --- /dev/null +++ b/crates/ra_syntax/test_data/parser/err/0043_weird_blocks.rs @@ -0,0 +1,6 @@ +fn main() { + { unsafe 92 } + { async 92 } + { try 92 } + { 'label: 92 } +} diff --git a/crates/ra_syntax/test_data/parser/err/0045_item_modifiers.rast b/crates/ra_syntax/test_data/parser/err/0045_item_modifiers.rast new file mode 100644 index 000000000..a6e6552a9 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/err/0045_item_modifiers.rast @@ -0,0 +1,45 @@ +SOURCE_FILE@0..50 + ERROR@0..6 + UNSAFE_KW@0..6 "unsafe" + WHITESPACE@6..7 " " + FN@7..24 + ASYNC_KW@7..12 "async" + WHITESPACE@12..13 " " + FN_KW@13..15 "fn" + WHITESPACE@15..16 " " + NAME@16..19 + IDENT@16..19 "foo" + PARAM_LIST@19..21 + L_PAREN@19..20 "(" + R_PAREN@20..21 ")" + WHITESPACE@21..22 " " + BLOCK_EXPR@22..24 + L_CURLY@22..23 "{" + R_CURLY@23..24 "}" + WHITESPACE@24..25 "\n" + CONST@25..46 + UNSAFE_KW@25..31 "unsafe" + WHITESPACE@31..32 " " + CONST_KW@32..37 "const" + WHITESPACE@37..38 " " + ERROR@38..40 + FN_KW@38..40 "fn" + WHITESPACE@40..41 " " + PATH_TYPE@41..46 + PATH@41..46 + PATH_SEGMENT@41..46 + NAME_REF@41..44 + IDENT@41..44 "bar" + PARAM_LIST@44..46 + L_PAREN@44..45 "(" + R_PAREN@45..46 ")" + WHITESPACE@46..47 " " + ERROR@47..49 + L_CURLY@47..48 "{" + R_CURLY@48..49 "}" + WHITESPACE@49..50 "\n" +error 6..6: expected existential, fn, trait or impl +error 38..38: expected a name +error 40..40: expected COLON +error 46..46: expected SEMICOLON +error 47..47: expected an item diff --git a/crates/ra_syntax/test_data/parser/err/0045_item_modifiers.rs b/crates/ra_syntax/test_data/parser/err/0045_item_modifiers.rs new file mode 100644 index 000000000..731e58013 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/err/0045_item_modifiers.rs @@ -0,0 +1,2 @@ +unsafe async fn foo() {} +unsafe const fn bar() {} diff --git a/crates/ra_syntax/test_data/parser/err/0163_weird_blocks.rast b/crates/ra_syntax/test_data/parser/err/0163_weird_blocks.rast deleted file mode 100644 index df29017e7..000000000 --- a/crates/ra_syntax/test_data/parser/err/0163_weird_blocks.rast +++ /dev/null @@ -1,71 +0,0 @@ -SOURCE_FILE@0..83 - FN@0..82 - 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..82 - L_CURLY@10..11 "{" - WHITESPACE@11..16 "\n " - EXPR_STMT@16..29 - BLOCK_EXPR@16..29 - L_CURLY@16..17 "{" - WHITESPACE@17..18 " " - ERROR@18..24 - UNSAFE_KW@18..24 "unsafe" - WHITESPACE@24..25 " " - LITERAL@25..27 - INT_NUMBER@25..27 "92" - WHITESPACE@27..28 " " - R_CURLY@28..29 "}" - WHITESPACE@29..34 "\n " - EXPR_STMT@34..46 - BLOCK_EXPR@34..46 - L_CURLY@34..35 "{" - WHITESPACE@35..36 " " - ERROR@36..41 - ASYNC_KW@36..41 "async" - WHITESPACE@41..42 " " - LITERAL@42..44 - INT_NUMBER@42..44 "92" - WHITESPACE@44..45 " " - R_CURLY@45..46 "}" - WHITESPACE@46..51 "\n " - EXPR_STMT@51..61 - BLOCK_EXPR@51..61 - L_CURLY@51..52 "{" - WHITESPACE@52..53 " " - EXPR_STMT@53..56 - EFFECT_EXPR@53..56 - TRY_KW@53..56 "try" - WHITESPACE@56..57 " " - LITERAL@57..59 - INT_NUMBER@57..59 "92" - WHITESPACE@59..60 " " - R_CURLY@60..61 "}" - WHITESPACE@61..66 "\n " - BLOCK_EXPR@66..80 - L_CURLY@66..67 "{" - WHITESPACE@67..68 " " - EXPR_STMT@68..75 - ERROR@68..75 - LABEL@68..75 - LIFETIME@68..74 "\'label" - COLON@74..75 ":" - WHITESPACE@75..76 " " - LITERAL@76..78 - INT_NUMBER@76..78 "92" - WHITESPACE@78..79 " " - R_CURLY@79..80 "}" - WHITESPACE@80..81 "\n" - R_CURLY@81..82 "}" - WHITESPACE@82..83 "\n" -error 24..24: expected existential, fn, trait or impl -error 41..41: expected existential, fn, trait or impl -error 56..56: expected a block -error 75..75: expected a loop -error 75..75: expected SEMICOLON diff --git a/crates/ra_syntax/test_data/parser/err/0163_weird_blocks.rs b/crates/ra_syntax/test_data/parser/err/0163_weird_blocks.rs deleted file mode 100644 index 8fa324c1a..000000000 --- a/crates/ra_syntax/test_data/parser/err/0163_weird_blocks.rs +++ /dev/null @@ -1,6 +0,0 @@ -fn main() { - { unsafe 92 } - { async 92 } - { try 92 } - { 'label: 92 } -} -- cgit v1.2.3