diff --git a/crates/parser/src/grammar/items.rs b/crates/parser/src/grammar/items.rs index 5050cad5e8..7934761705 100644 --- a/crates/parser/src/grammar/items.rs +++ b/crates/parser/src/grammar/items.rs @@ -60,7 +60,6 @@ pub(super) fn item_or_macro(p: &mut Parser<'_>, stop_on_r_curly: bool) { // test macro_rules_as_macro_name // macro_rules! {} - // macro_rules! {}; // macro_rules! (); // macro_rules! []; // fn main() { @@ -68,6 +67,7 @@ pub(super) fn item_or_macro(p: &mut Parser<'_>, stop_on_r_curly: bool) { // } // test_err macro_rules_as_macro_name + // macro_rules! {}; // macro_rules! () // macro_rules! [] if paths::is_use_path_start(p) diff --git a/crates/parser/test_data/parser/inline/err/0026_macro_rules_as_macro_name.rast b/crates/parser/test_data/parser/inline/err/0026_macro_rules_as_macro_name.rast index d5ab611629..79d428a41c 100644 --- a/crates/parser/test_data/parser/inline/err/0026_macro_rules_as_macro_name.rast +++ b/crates/parser/test_data/parser/inline/err/0026_macro_rules_as_macro_name.rast @@ -1,4 +1,17 @@ SOURCE_FILE + MACRO_CALL + PATH + PATH_SEGMENT + NAME_REF + IDENT "macro_rules" + BANG "!" + WHITESPACE " " + TOKEN_TREE + L_CURLY "{" + R_CURLY "}" + ERROR + SEMICOLON ";" + WHITESPACE "\n" MACRO_CALL PATH PATH_SEGMENT @@ -21,5 +34,6 @@ SOURCE_FILE L_BRACK "[" R_BRACK "]" WHITESPACE "\n" -error 15: expected SEMICOLON -error 31: expected SEMICOLON +error 15: expected an item +error 32: expected SEMICOLON +error 48: expected SEMICOLON diff --git a/crates/parser/test_data/parser/inline/err/0026_macro_rules_as_macro_name.rs b/crates/parser/test_data/parser/inline/err/0026_macro_rules_as_macro_name.rs index be633aa699..e8d402443d 100644 --- a/crates/parser/test_data/parser/inline/err/0026_macro_rules_as_macro_name.rs +++ b/crates/parser/test_data/parser/inline/err/0026_macro_rules_as_macro_name.rs @@ -1,2 +1,3 @@ +macro_rules! {}; macro_rules! () macro_rules! [] diff --git a/crates/parser/test_data/parser/inline/ok/0208_macro_rules_as_macro_name.rast b/crates/parser/test_data/parser/inline/ok/0208_macro_rules_as_macro_name.rast index c3e0f8a5e0..b997250ab4 100644 --- a/crates/parser/test_data/parser/inline/ok/0208_macro_rules_as_macro_name.rast +++ b/crates/parser/test_data/parser/inline/ok/0208_macro_rules_as_macro_name.rast @@ -10,18 +10,6 @@ SOURCE_FILE L_CURLY "{" R_CURLY "}" WHITESPACE "\n" - MACRO_CALL - PATH - PATH_SEGMENT - NAME_REF - IDENT "macro_rules" - BANG "!" - WHITESPACE " " - TOKEN_TREE - L_CURLY "{" - R_CURLY "}" - SEMICOLON ";" - WHITESPACE "\n" MACRO_CALL PATH PATH_SEGMENT diff --git a/crates/parser/test_data/parser/inline/ok/0208_macro_rules_as_macro_name.rs b/crates/parser/test_data/parser/inline/ok/0208_macro_rules_as_macro_name.rs index 2ab949b636..4c2ea378cb 100644 --- a/crates/parser/test_data/parser/inline/ok/0208_macro_rules_as_macro_name.rs +++ b/crates/parser/test_data/parser/inline/ok/0208_macro_rules_as_macro_name.rs @@ -1,5 +1,4 @@ macro_rules! {} -macro_rules! {}; macro_rules! (); macro_rules! []; fn main() {