diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-04-09 17:54:14 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-04-09 17:54:14 +0100 |
commit | dde9488559514e7d039cec9407e1f8627f665cd0 (patch) | |
tree | 5ddc0361d4d3538b60cb63a645042cfdcd51f4c6 /xtask | |
parent | 4cea01fdf8dc0a647007bde3010f9fbe607f1e75 (diff) | |
parent | 2bfb65db93e48d8f9e8ecac0b2ea837c081a4db5 (diff) |
Merge #3919
3919: Refactor tokena accessors r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'xtask')
-rw-r--r-- | xtask/src/ast_src.rs | 5 | ||||
-rw-r--r-- | xtask/src/codegen/gen_syntax.rs | 1 |
2 files changed, 4 insertions, 2 deletions
diff --git a/xtask/src/ast_src.rs b/xtask/src/ast_src.rs index eba66ff4d..74a87e900 100644 --- a/xtask/src/ast_src.rs +++ b/xtask/src/ast_src.rs | |||
@@ -408,7 +408,7 @@ pub(crate) const AST_SRC: AstSrc = AstSrc { | |||
408 | struct TupleType { LParen, fields: [TypeRef], RParen } | 408 | struct TupleType { LParen, fields: [TypeRef], RParen } |
409 | struct NeverType { Excl } | 409 | struct NeverType { Excl } |
410 | struct PathType { Path } | 410 | struct PathType { Path } |
411 | struct PointerType { Star, ConstKw, TypeRef } | 411 | struct PointerType { Star, ConstKw, MutKw, TypeRef } |
412 | struct ArrayType { LBrack, TypeRef, Semi, Expr, RBrack } | 412 | struct ArrayType { LBrack, TypeRef, Semi, Expr, RBrack } |
413 | struct SliceType { LBrack, TypeRef, RBrack } | 413 | struct SliceType { LBrack, TypeRef, RBrack } |
414 | struct ReferenceType { Amp, Lifetime, MutKw, TypeRef } | 414 | struct ReferenceType { Amp, Lifetime, MutKw, TypeRef } |
@@ -485,7 +485,7 @@ pub(crate) const AST_SRC: AstSrc = AstSrc { | |||
485 | struct ParenPat { LParen, Pat, RParen } | 485 | struct ParenPat { LParen, Pat, RParen } |
486 | struct RefPat { Amp, MutKw, Pat } | 486 | struct RefPat { Amp, MutKw, Pat } |
487 | struct BoxPat { BoxKw, Pat } | 487 | struct BoxPat { BoxKw, Pat } |
488 | struct BindPat: AttrsOwner, NameOwner { RefKw, MutKw, Pat } | 488 | struct BindPat: AttrsOwner, NameOwner { RefKw, MutKw, At, Pat } |
489 | struct PlaceholderPat { Underscore } | 489 | struct PlaceholderPat { Underscore } |
490 | struct DotDotPat { Dotdot } | 490 | struct DotDotPat { Dotdot } |
491 | struct PathPat { Path } | 491 | struct PathPat { Path } |
@@ -545,6 +545,7 @@ pub(crate) const AST_SRC: AstSrc = AstSrc { | |||
545 | Pat, | 545 | Pat, |
546 | Eq, | 546 | Eq, |
547 | initializer: Expr, | 547 | initializer: Expr, |
548 | Semi, | ||
548 | } | 549 | } |
549 | struct Condition { LetKw, Pat, Eq, Expr } | 550 | struct Condition { LetKw, Pat, Eq, Expr } |
550 | struct Block: AttrsOwner, ModuleItemOwner { | 551 | struct Block: AttrsOwner, ModuleItemOwner { |
diff --git a/xtask/src/codegen/gen_syntax.rs b/xtask/src/codegen/gen_syntax.rs index 6657c9fc5..b5594e3a9 100644 --- a/xtask/src/codegen/gen_syntax.rs +++ b/xtask/src/codegen/gen_syntax.rs | |||
@@ -208,6 +208,7 @@ fn generate_nodes(kinds: KindsSrc<'_>, grammar: AstSrc<'_>) -> Result<String> { | |||
208 | FieldSrc::Optional(_) | FieldSrc::Shorthand => { | 208 | FieldSrc::Optional(_) | FieldSrc::Shorthand => { |
209 | let is_token = token_kinds.contains(&ty.to_string()); | 209 | let is_token = token_kinds.contains(&ty.to_string()); |
210 | if is_token { | 210 | if is_token { |
211 | let method_name = format_ident!("{}_token", method_name); | ||
211 | quote! { | 212 | quote! { |
212 | pub fn #method_name(&self) -> Option<#ty> { | 213 | pub fn #method_name(&self) -> Option<#ty> { |
213 | support::token(&self.syntax) | 214 | support::token(&self.syntax) |