From c1cb5953820f26d4d0a614650bc8c50cbc5a3ce6 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Tue, 15 Dec 2020 15:37:37 +0100 Subject: Move to upstream `macro_rules!` model --- .../parser/err/0002_duplicate_shebang.rast | 14 +++++-- .../parser/inline/ok/0062_mod_contents.rast | 7 +--- .../parser/inline/ok/0096_no_semi_after_block.rast | 48 ++++++++++------------ .../parser/inline/ok/0160_try_macro_rules.rast | 7 +--- .../ok/0053_outer_attribute_on_macro_rules.rast | 7 +--- 5 files changed, 38 insertions(+), 45 deletions(-) (limited to 'crates/syntax/test_data/parser') diff --git a/crates/syntax/test_data/parser/err/0002_duplicate_shebang.rast b/crates/syntax/test_data/parser/err/0002_duplicate_shebang.rast index 4cfd1bce4..9ad5b12b8 100644 --- a/crates/syntax/test_data/parser/err/0002_duplicate_shebang.rast +++ b/crates/syntax/test_data/parser/err/0002_duplicate_shebang.rast @@ -17,14 +17,17 @@ SOURCE_FILE@0..42 IDENT@28..31 "bin" ERROR@31..32 SLASH@31..32 "/" - MACRO_CALL@32..41 + MACRO_CALL@32..35 PATH@32..35 PATH_SEGMENT@32..35 NAME_REF@32..35 IDENT@32..35 "env" - WHITESPACE@35..36 " " - NAME@36..41 - IDENT@36..41 "rusti" + WHITESPACE@35..36 " " + MACRO_CALL@36..41 + PATH@36..41 + PATH_SEGMENT@36..41 + NAME_REF@36..41 + IDENT@36..41 "rusti" WHITESPACE@41..42 "\n" error 23..23: expected `[` error 23..23: expected an item @@ -35,5 +38,8 @@ error 31..31: expected `{`, `[`, `(` error 31..31: expected SEMICOLON error 31..31: expected an item error 35..35: expected BANG +error 35..35: expected `{`, `[`, `(` +error 35..35: expected SEMICOLON +error 41..41: expected BANG error 41..41: expected `{`, `[`, `(` error 41..41: expected SEMICOLON diff --git a/crates/syntax/test_data/parser/inline/ok/0062_mod_contents.rast b/crates/syntax/test_data/parser/inline/ok/0062_mod_contents.rast index de8217064..e4fb32de1 100644 --- a/crates/syntax/test_data/parser/inline/ok/0062_mod_contents.rast +++ b/crates/syntax/test_data/parser/inline/ok/0062_mod_contents.rast @@ -12,11 +12,8 @@ SOURCE_FILE@0..70 L_CURLY@9..10 "{" R_CURLY@10..11 "}" WHITESPACE@11..12 "\n" - MACRO_CALL@12..31 - PATH@12..23 - PATH_SEGMENT@12..23 - NAME_REF@12..23 - IDENT@12..23 "macro_rules" + MACRO_RULES@12..31 + MACRO_RULES_KW@12..23 "macro_rules" BANG@23..24 "!" WHITESPACE@24..25 " " NAME@25..28 diff --git a/crates/syntax/test_data/parser/inline/ok/0096_no_semi_after_block.rast b/crates/syntax/test_data/parser/inline/ok/0096_no_semi_after_block.rast index e757249f0..e84b9164f 100644 --- a/crates/syntax/test_data/parser/inline/ok/0096_no_semi_after_block.rast +++ b/crates/syntax/test_data/parser/inline/ok/0096_no_semi_after_block.rast @@ -82,32 +82,28 @@ SOURCE_FILE@0..167 L_CURLY@102..103 "{" R_CURLY@103..104 "}" WHITESPACE@104..109 "\n " - EXPR_STMT@109..152 - MACRO_CALL@109..152 - PATH@109..120 - PATH_SEGMENT@109..120 - NAME_REF@109..120 - IDENT@109..120 "macro_rules" - BANG@120..121 "!" - WHITESPACE@121..122 " " - NAME@122..126 - IDENT@122..126 "test" - WHITESPACE@126..127 " " - TOKEN_TREE@127..152 - L_CURLY@127..128 "{" - WHITESPACE@128..138 "\n " - TOKEN_TREE@138..140 - L_PAREN@138..139 "(" - R_PAREN@139..140 ")" - WHITESPACE@140..141 " " - EQ@141..142 "=" - R_ANGLE@142..143 ">" - WHITESPACE@143..144 " " - TOKEN_TREE@144..146 - L_CURLY@144..145 "{" - R_CURLY@145..146 "}" - WHITESPACE@146..151 "\n " - R_CURLY@151..152 "}" + MACRO_RULES@109..152 + MACRO_RULES_KW@109..120 "macro_rules" + BANG@120..121 "!" + WHITESPACE@121..122 " " + NAME@122..126 + IDENT@122..126 "test" + WHITESPACE@126..127 " " + TOKEN_TREE@127..152 + L_CURLY@127..128 "{" + WHITESPACE@128..138 "\n " + TOKEN_TREE@138..140 + L_PAREN@138..139 "(" + R_PAREN@139..140 ")" + WHITESPACE@140..141 " " + EQ@141..142 "=" + R_ANGLE@142..143 ">" + WHITESPACE@143..144 " " + TOKEN_TREE@144..146 + L_CURLY@144..145 "{" + R_CURLY@145..146 "}" + WHITESPACE@146..151 "\n " + R_CURLY@151..152 "}" WHITESPACE@152..157 "\n " MACRO_CALL@157..164 PATH@157..161 diff --git a/crates/syntax/test_data/parser/inline/ok/0160_try_macro_rules.rast b/crates/syntax/test_data/parser/inline/ok/0160_try_macro_rules.rast index 05b89d1c3..d1c22947b 100644 --- a/crates/syntax/test_data/parser/inline/ok/0160_try_macro_rules.rast +++ b/crates/syntax/test_data/parser/inline/ok/0160_try_macro_rules.rast @@ -1,9 +1,6 @@ SOURCE_FILE@0..30 - MACRO_CALL@0..29 - PATH@0..11 - PATH_SEGMENT@0..11 - NAME_REF@0..11 - IDENT@0..11 "macro_rules" + MACRO_RULES@0..29 + MACRO_RULES_KW@0..11 "macro_rules" BANG@11..12 "!" WHITESPACE@12..13 " " NAME@13..16 diff --git a/crates/syntax/test_data/parser/ok/0053_outer_attribute_on_macro_rules.rast b/crates/syntax/test_data/parser/ok/0053_outer_attribute_on_macro_rules.rast index be60f7a8e..87d8ebcba 100644 --- a/crates/syntax/test_data/parser/ok/0053_outer_attribute_on_macro_rules.rast +++ b/crates/syntax/test_data/parser/ok/0053_outer_attribute_on_macro_rules.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..65 - MACRO_CALL@0..64 + MACRO_RULES@0..64 COMMENT@0..13 "/// Some docs" WHITESPACE@13..14 "\n" ATTR@14..29 @@ -11,10 +11,7 @@ SOURCE_FILE@0..65 IDENT@16..28 "macro_export" R_BRACK@28..29 "]" WHITESPACE@29..30 "\n" - PATH@30..41 - PATH_SEGMENT@30..41 - NAME_REF@30..41 - IDENT@30..41 "macro_rules" + MACRO_RULES_KW@30..41 "macro_rules" BANG@41..42 "!" WHITESPACE@42..43 " " NAME@43..46 -- cgit v1.2.3