aboutsummaryrefslogtreecommitdiff
path: root/xtask/src/codegen
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-07-30 17:52:59 +0100
committerGitHub <[email protected]>2020-07-30 17:52:59 +0100
commitbc8610e2b58fe101ddc34d0ce389cfa829060c62 (patch)
treefac9cf9a1ac4e4e28570261f2e755aa4f92f904d /xtask/src/codegen
parentaf8132e610d1e649e67ab797e372d1efcf106c48 (diff)
parent3dce34aaf83c67836c94a526cb90eba8f36e3985 (diff)
Merge #5608
5608: Introduce GenericParam r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'xtask/src/codegen')
-rw-r--r--xtask/src/codegen/rust.ungram37
1 files changed, 19 insertions, 18 deletions
diff --git a/xtask/src/codegen/rust.ungram b/xtask/src/codegen/rust.ungram
index cdd3adf45..4025f7f96 100644
--- a/xtask/src/codegen/rust.ungram
+++ b/xtask/src/codegen/rust.ungram
@@ -154,6 +154,25 @@ ExternItemList =
154ExternItem = 154ExternItem =
155 Fn | Static | MacroCall 155 Fn | Static | MacroCall
156 156
157GenericParamList =
158 '<' (GenericParam (',' GenericParam)* ','?)? '>'
159
160GenericParam =
161 LifetimeParam
162| TypeParam
163| ConstParam
164
165TypeParam =
166 Attr* Name (':' TypeBoundList?)?
167 ('=' default_type:TypeRef)?
168
169ConstParam =
170 Attr* 'const' Name ':' ascribed_type:TypeRef
171 ('=' default_val:Expr)?
172
173LifetimeParam =
174 Attr* 'lifetime'
175
157ParenType = 176ParenType =
158 '(' TypeRef ')' 177 '(' TypeRef ')'
159 178
@@ -400,24 +419,6 @@ MacroStmts =
400Attr = 419Attr =
401 '#' '!'? '[' Path ('=' input:AttrInput)? ']' 420 '#' '!'? '[' Path ('=' input:AttrInput)? ']'
402 421
403GenericParamList =
404 '<'
405 TypeParam*
406 LifetimeParam*
407 ConstParam*
408 '>'
409
410TypeParam =
411 Attr* Name (':' TypeBoundList?)?
412 ('=' default_type:TypeRef)?
413
414ConstParam =
415 Attr* 'const' Name ':' ascribed_type:TypeRef
416 ('=' default_val:Expr)?
417
418LifetimeParam =
419 Attr* 'lifetime'
420
421TypeBound = 422TypeBound =
422 'lifetime' | 'const'? TypeRef 423 'lifetime' | 'const'? TypeRef
423 424