aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/test_data/parser/inline/ok/0148_pub_macro_def.txt
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-12-21 10:47:47 +0000
committerGitHub <[email protected]>2019-12-21 10:47:47 +0000
commit90ef070db3dce0a7acb9cd11d0b0d72de13c9d79 (patch)
treec6fcc8c77fe4948b356e397fb5fe1f8e8ac39037 /crates/ra_syntax/test_data/parser/inline/ok/0148_pub_macro_def.txt
parent3ebf15c9b29b1fed6319d04f540ad48cd4bd6995 (diff)
parent4195c0e5f9a3db7646d4df28aa8c77a863c35759 (diff)
Merge #2628
2628: Add macro 2.0 support in parser r=matklad a=edwin0cheng This PR added a new syntax kind : `MACRO_DEF` and a keyword `MACRO_KW` there are two syntax for declarative macro 2.0 : 1. Normal : `macro m { ($i:ident) => {} }` , which handle similar to legacy one. 2. Call like: `macro m($i:ident) {}`, it produces a single token tree which have two child token trees : `($i:ident)` and `{}` Co-authored-by: Edwin Cheng <[email protected]>
Diffstat (limited to 'crates/ra_syntax/test_data/parser/inline/ok/0148_pub_macro_def.txt')
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0148_pub_macro_def.txt20
1 files changed, 20 insertions, 0 deletions
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0148_pub_macro_def.txt b/crates/ra_syntax/test_data/parser/inline/ok/0148_pub_macro_def.txt
new file mode 100644
index 000000000..985f61f89
--- /dev/null
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0148_pub_macro_def.txt
@@ -0,0 +1,20 @@
1SOURCE_FILE@[0; 24)
2 MACRO_DEF@[0; 23)
3 VISIBILITY@[0; 3)
4 PUB_KW@[0; 3) "pub"
5 WHITESPACE@[3; 4) " "
6 MACRO_KW@[4; 9) "macro"
7 WHITESPACE@[9; 10) " "
8 IDENT@[10; 11) "m"
9 TOKEN_TREE@[11; 23)
10 TOKEN_TREE@[11; 20)
11 L_PAREN@[11; 12) "("
12 DOLLAR@[12; 13) "$"
13 COLON@[13; 14) ":"
14 IDENT@[14; 19) "ident"
15 R_PAREN@[19; 20) ")"
16 WHITESPACE@[20; 21) " "
17 TOKEN_TREE@[21; 23)
18 L_CURLY@[21; 22) "{"
19 R_CURLY@[22; 23) "}"
20 WHITESPACE@[23; 24) "\n"