about summary refs log tree commit diff
path: root/xtask/src/codegen
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-07-30 16:52:59 +0000
committerGitHub <noreply@github.com>2020-07-30 16:52:59 +0000
commitbc8610e2b58fe101ddc34d0ce389cfa829060c62 (patch)
treefac9cf9a1ac4e4e28570261f2e755aa4f92f904d /xtask/src/codegen
parentaf8132e610d1e649e67ab797e372d1efcf106c48 (diff)
parent3dce34aaf83c67836c94a526cb90eba8f36e3985 (diff)
downloadrust-bc8610e2b58fe101ddc34d0ce389cfa829060c62.tar.gz
rust-bc8610e2b58fe101ddc34d0ce389cfa829060c62.zip
Merge #5608
5608: Introduce GenericParam r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
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 cdd3adf4577..4025f7f96cd 100644
--- a/xtask/src/codegen/rust.ungram
+++ b/xtask/src/codegen/rust.ungram
@@ -154,6 +154,25 @@ ExternItemList =
 ExternItem =
   Fn | Static | MacroCall
 
+GenericParamList =
+  '<' (GenericParam (',' GenericParam)* ','?)? '>'
+
+GenericParam =
+  LifetimeParam
+| TypeParam
+| ConstParam
+
+TypeParam =
+  Attr* Name (':' TypeBoundList?)?
+  ('=' default_type:TypeRef)?
+
+ConstParam =
+  Attr* 'const' Name ':' ascribed_type:TypeRef
+  ('=' default_val:Expr)?
+
+LifetimeParam =
+  Attr* 'lifetime'
+
 ParenType =
   '(' TypeRef ')'
 
@@ -400,24 +419,6 @@ MacroStmts =
 Attr =
   '#' '!'? '[' Path ('=' input:AttrInput)? ']'
 
-GenericParamList =
-  '<'
-    TypeParam*
-    LifetimeParam*
-    ConstParam*
-  '>'
-
-TypeParam =
-  Attr* Name (':' TypeBoundList?)?
-  ('=' default_type:TypeRef)?
-
-ConstParam =
-  Attr* 'const' Name ':' ascribed_type:TypeRef
-  ('=' default_val:Expr)?
-
-LifetimeParam =
-  Attr* 'lifetime'
-
 TypeBound =
   'lifetime' | 'const'? TypeRef