@@ -24,7 +24,7 @@ use syn::{
2424 token, Error , Ident , Result , Token ,
2525} ;
2626
27- mod keyword {
27+ pub mod keyword {
2828 syn:: custom_keyword!( Block ) ;
2929 syn:: custom_keyword!( NodeBlock ) ;
3030 syn:: custom_keyword!( UncheckedExtrinsic ) ;
@@ -36,6 +36,7 @@ mod keyword {
3636 syn:: custom_keyword!( Origin ) ;
3737 syn:: custom_keyword!( Inherent ) ;
3838 syn:: custom_keyword!( ValidateUnsigned ) ;
39+ syn:: custom_keyword!( auto) ;
3940}
4041
4142#[ derive( Debug ) ]
@@ -231,6 +232,7 @@ pub enum ModulePartKeyword {
231232 Origin ( keyword:: Origin ) ,
232233 Inherent ( keyword:: Inherent ) ,
233234 ValidateUnsigned ( keyword:: ValidateUnsigned ) ,
235+ Auto ( keyword:: auto ) ,
234236}
235237
236238impl Parse for ModulePartKeyword {
@@ -253,6 +255,8 @@ impl Parse for ModulePartKeyword {
253255 Ok ( Self :: Inherent ( input. parse ( ) ?) )
254256 } else if lookahead. peek ( keyword:: ValidateUnsigned ) {
255257 Ok ( Self :: ValidateUnsigned ( input. parse ( ) ?) )
258+ } else if lookahead. peek ( keyword:: auto) {
259+ Ok ( Self :: Auto ( input. parse ( ) ?) )
256260 } else {
257261 Err ( lookahead. error ( ) )
258262 }
@@ -261,7 +265,7 @@ impl Parse for ModulePartKeyword {
261265
262266impl ModulePartKeyword {
263267 /// Returns the name of `Self`.
264- fn name ( & self ) -> & ' static str {
268+ pub fn name ( & self ) -> & ' static str {
265269 match self {
266270 Self :: Module ( _) => "Module" ,
267271 Self :: Call ( _) => "Call" ,
@@ -271,6 +275,7 @@ impl ModulePartKeyword {
271275 Self :: Origin ( _) => "Origin" ,
272276 Self :: Inherent ( _) => "Inherent" ,
273277 Self :: ValidateUnsigned ( _) => "ValidateUnsigned" ,
278+ Self :: Auto ( _) => "auto" ,
274279 }
275280 }
276281
@@ -313,6 +318,7 @@ impl Spanned for ModulePartKeyword {
313318 Self :: Origin ( inner) => inner. span ( ) ,
314319 Self :: Inherent ( inner) => inner. span ( ) ,
315320 Self :: ValidateUnsigned ( inner) => inner. span ( ) ,
321+ Self :: Auto ( inner) => inner. span ( ) ,
316322 }
317323 }
318324}
0 commit comments