From 4be9ed675ed2550e8cb10031fd4c4cfb01d2a2ed Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Sun, 20 Dec 2020 20:30:18 +0100 Subject: Properly attach attributes to Param instead of parent ParamList --- .../parser/inline/ok/0138_self_param_outer_attr.rast | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'crates/syntax/test_data/parser/inline') diff --git a/crates/syntax/test_data/parser/inline/ok/0138_self_param_outer_attr.rast b/crates/syntax/test_data/parser/inline/ok/0138_self_param_outer_attr.rast index 6403ff8d5..d3219f0b2 100644 --- a/crates/syntax/test_data/parser/inline/ok/0138_self_param_outer_attr.rast +++ b/crates/syntax/test_data/parser/inline/ok/0138_self_param_outer_attr.rast @@ -6,16 +6,16 @@ SOURCE_FILE@0..26 IDENT@3..4 "f" PARAM_LIST@4..22 L_PAREN@4..5 "(" - ATTR@5..16 - POUND@5..6 "#" - L_BRACK@6..7 "[" - PATH@7..15 - PATH_SEGMENT@7..15 - NAME_REF@7..15 - IDENT@7..15 "must_use" - R_BRACK@15..16 "]" - WHITESPACE@16..17 " " - SELF_PARAM@17..21 + SELF_PARAM@5..21 + ATTR@5..16 + POUND@5..6 "#" + L_BRACK@6..7 "[" + PATH@7..15 + PATH_SEGMENT@7..15 + NAME_REF@7..15 + IDENT@7..15 "must_use" + R_BRACK@15..16 "]" + WHITESPACE@16..17 " " SELF_KW@17..21 "self" R_PAREN@21..22 ")" WHITESPACE@22..23 " " -- cgit v1.2.3 From 64caa027b884b3458997318a01e99812e6bb6fca Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Sun, 20 Dec 2020 21:01:36 +0100 Subject: Parse attributes in tuple expressions --- .../parser/inline/ok/0154_tuple_attrs.rast | 50 ++++++++++++++++++++++ .../test_data/parser/inline/ok/0154_tuple_attrs.rs | 1 + 2 files changed, 51 insertions(+) create mode 100644 crates/syntax/test_data/parser/inline/ok/0154_tuple_attrs.rast create mode 100644 crates/syntax/test_data/parser/inline/ok/0154_tuple_attrs.rs (limited to 'crates/syntax/test_data/parser/inline') diff --git a/crates/syntax/test_data/parser/inline/ok/0154_tuple_attrs.rast b/crates/syntax/test_data/parser/inline/ok/0154_tuple_attrs.rast new file mode 100644 index 000000000..d34b21abe --- /dev/null +++ b/crates/syntax/test_data/parser/inline/ok/0154_tuple_attrs.rast @@ -0,0 +1,50 @@ +SOURCE_FILE@0..43 + CONST@0..42 + CONST_KW@0..5 "const" + WHITESPACE@5..6 " " + NAME@6..7 + IDENT@6..7 "A" + COLON@7..8 ":" + WHITESPACE@8..9 " " + TUPLE_TYPE@9..19 + L_PAREN@9..10 "(" + PATH_TYPE@10..13 + PATH@10..13 + PATH_SEGMENT@10..13 + NAME_REF@10..13 + IDENT@10..13 "i64" + COMMA@13..14 "," + WHITESPACE@14..15 " " + PATH_TYPE@15..18 + PATH@15..18 + PATH_SEGMENT@15..18 + NAME_REF@15..18 + IDENT@15..18 "i64" + R_PAREN@18..19 ")" + WHITESPACE@19..20 " " + EQ@20..21 "=" + WHITESPACE@21..22 " " + TUPLE_EXPR@22..41 + L_PAREN@22..23 "(" + LITERAL@23..24 + INT_NUMBER@23..24 "1" + COMMA@24..25 "," + WHITESPACE@25..26 " " + LITERAL@26..40 + ATTR@26..38 + POUND@26..27 "#" + L_BRACK@27..28 "[" + PATH@28..31 + PATH_SEGMENT@28..31 + NAME_REF@28..31 + IDENT@28..31 "cfg" + TOKEN_TREE@31..37 + L_PAREN@31..32 "(" + IDENT@32..36 "test" + R_PAREN@36..37 ")" + R_BRACK@37..38 "]" + WHITESPACE@38..39 " " + INT_NUMBER@39..40 "2" + R_PAREN@40..41 ")" + SEMICOLON@41..42 ";" + WHITESPACE@42..43 "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0154_tuple_attrs.rs b/crates/syntax/test_data/parser/inline/ok/0154_tuple_attrs.rs new file mode 100644 index 000000000..f84b7ab31 --- /dev/null +++ b/crates/syntax/test_data/parser/inline/ok/0154_tuple_attrs.rs @@ -0,0 +1 @@ +const A: (i64, i64) = (1, #[cfg(test)] 2); -- cgit v1.2.3