diff options
author | Lukas Wirth <lukastw97@gmail.com> | 2020-12-24 08:26:03 +0000 |
---|---|---|
committer | Lukas Wirth <lukastw97@gmail.com> | 2020-12-24 08:36:47 +0000 |
commit | 3e0bb895418b2042ee9cd14b2444a36c87a3f449 (patch) | |
tree | 84b04d31e233ace40409e8f8664929563deaf3e1 /crates/syntax/test_data/parser/inline | |
parent | fd1fcf2c2e90ab04103a6aa9d033ec64dcc8d555 (diff) |
Fix macro_rules not accepting brackets or parentheses
Diffstat (limited to 'crates/syntax/test_data/parser/inline')
-rw-r--r-- | crates/syntax/test_data/parser/inline/ok/0158_macro_rules_non_brace.rast | 57 | ||||
-rw-r--r-- | crates/syntax/test_data/parser/inline/ok/0158_macro_rules_non_brace.rs | 2 |
2 files changed, 59 insertions, 0 deletions
diff --git a/crates/syntax/test_data/parser/inline/ok/0158_macro_rules_non_brace.rast b/crates/syntax/test_data/parser/inline/ok/0158_macro_rules_non_brace.rast new file mode 100644 index 000000000..4a1f712aa --- /dev/null +++ b/crates/syntax/test_data/parser/inline/ok/0158_macro_rules_non_brace.rast | |||
@@ -0,0 +1,57 @@ | |||
1 | SOURCE_FILE@0..74 | ||
2 | MACRO_RULES@0..36 | ||
3 | MACRO_RULES_KW@0..11 "macro_rules" | ||
4 | BANG@11..12 "!" | ||
5 | WHITESPACE@12..13 " " | ||
6 | NAME@13..14 | ||
7 | IDENT@13..14 "m" | ||
8 | WHITESPACE@14..15 " " | ||
9 | TOKEN_TREE@15..35 | ||
10 | L_PAREN@15..16 "(" | ||
11 | WHITESPACE@16..17 " " | ||
12 | TOKEN_TREE@17..27 | ||
13 | L_PAREN@17..18 "(" | ||
14 | DOLLAR@18..19 "$" | ||
15 | IDENT@19..20 "i" | ||
16 | COLON@20..21 ":" | ||
17 | IDENT@21..26 "ident" | ||
18 | R_PAREN@26..27 ")" | ||
19 | WHITESPACE@27..28 " " | ||
20 | EQ@28..29 "=" | ||
21 | R_ANGLE@29..30 ">" | ||
22 | WHITESPACE@30..31 " " | ||
23 | TOKEN_TREE@31..33 | ||
24 | L_CURLY@31..32 "{" | ||
25 | R_CURLY@32..33 "}" | ||
26 | WHITESPACE@33..34 " " | ||
27 | R_PAREN@34..35 ")" | ||
28 | SEMICOLON@35..36 ";" | ||
29 | WHITESPACE@36..37 "\n" | ||
30 | MACRO_RULES@37..73 | ||
31 | MACRO_RULES_KW@37..48 "macro_rules" | ||
32 | BANG@48..49 "!" | ||
33 | WHITESPACE@49..50 " " | ||
34 | NAME@50..51 | ||
35 | IDENT@50..51 "m" | ||
36 | WHITESPACE@51..52 " " | ||
37 | TOKEN_TREE@52..72 | ||
38 | L_BRACK@52..53 "[" | ||
39 | WHITESPACE@53..54 " " | ||
40 | TOKEN_TREE@54..64 | ||
41 | L_PAREN@54..55 "(" | ||
42 | DOLLAR@55..56 "$" | ||
43 | IDENT@56..57 "i" | ||
44 | COLON@57..58 ":" | ||
45 | IDENT@58..63 "ident" | ||
46 | R_PAREN@63..64 ")" | ||
47 | WHITESPACE@64..65 " " | ||
48 | EQ@65..66 "=" | ||
49 | R_ANGLE@66..67 ">" | ||
50 | WHITESPACE@67..68 " " | ||
51 | TOKEN_TREE@68..70 | ||
52 | L_CURLY@68..69 "{" | ||
53 | R_CURLY@69..70 "}" | ||
54 | WHITESPACE@70..71 " " | ||
55 | R_BRACK@71..72 "]" | ||
56 | SEMICOLON@72..73 ";" | ||
57 | WHITESPACE@73..74 "\n" | ||
diff --git a/crates/syntax/test_data/parser/inline/ok/0158_macro_rules_non_brace.rs b/crates/syntax/test_data/parser/inline/ok/0158_macro_rules_non_brace.rs new file mode 100644 index 000000000..6033a28cd --- /dev/null +++ b/crates/syntax/test_data/parser/inline/ok/0158_macro_rules_non_brace.rs | |||
@@ -0,0 +1,2 @@ | |||
1 | macro_rules! m ( ($i:ident) => {} ); | ||
2 | macro_rules! m [ ($i:ident) => {} ]; | ||