aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src
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/src
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/src')
-rw-r--r--crates/ra_syntax/src/grammar.ron4
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/ra_syntax/src/grammar.ron b/crates/ra_syntax/src/grammar.ron
index a228fa9d6..3f1cd0b90 100644
--- a/crates/ra_syntax/src/grammar.ron
+++ b/crates/ra_syntax/src/grammar.ron
@@ -94,7 +94,8 @@ Grammar(
94 "return", 94 "return",
95 "try", 95 "try",
96 "box", 96 "box",
97 "await" 97 "await",
98 "macro"
98 ], 99 ],
99 contextual_keywords: [ 100 contextual_keywords: [
100 "auto", 101 "auto",
@@ -140,6 +141,7 @@ Grammar(
140 "TYPE_ALIAS_DEF", 141 "TYPE_ALIAS_DEF",
141 "MACRO_CALL", 142 "MACRO_CALL",
142 "TOKEN_TREE", 143 "TOKEN_TREE",
144 "MACRO_DEF",
143 145
144 "PAREN_TYPE", 146 "PAREN_TYPE",
145 "TUPLE_TYPE", 147 "TUPLE_TYPE",