diff options
| author | Aleksey Kladov <aleksey.kladov@gmail.com> | 2020-04-09 18:25:36 +0200 |
|---|---|---|
| committer | Aleksey Kladov <aleksey.kladov@gmail.com> | 2020-04-09 18:25:36 +0200 |
| commit | e6d22187a67e762bb950de244a6ca15f3a0b0731 (patch) | |
| tree | c1bf1fa132003b333b6ccd55d60127d93518f0eb /xtask/src/codegen | |
| parent | a95116fbfa11cad4e03b8b31f8d4498f3ddd5d9e (diff) | |
| download | rust-e6d22187a67e762bb950de244a6ca15f3a0b0731.tar.gz rust-e6d22187a67e762bb950de244a6ca15f3a0b0731.zip | |
Add _token suffix to token accessors
I think this makes is more clear which things are : AstNode and which are : AstToken
Diffstat (limited to 'xtask/src/codegen')
| -rw-r--r-- | xtask/src/codegen/gen_syntax.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/xtask/src/codegen/gen_syntax.rs b/xtask/src/codegen/gen_syntax.rs index 6657c9fc5f0..b5594e3a982 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> { FieldSrc::Optional(_) | FieldSrc::Shorthand => { let is_token = token_kinds.contains(&ty.to_string()); if is_token { + let method_name = format_ident!("{}_token", method_name); quote! { pub fn #method_name(&self) -> Option<#ty> { support::token(&self.syntax) |
