aboutsummaryrefslogtreecommitdiff
path: root/xtask
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-04-09 17:25:36 +0100
committerAleksey Kladov <[email protected]>2020-04-09 17:25:36 +0100
commite6d22187a67e762bb950de244a6ca15f3a0b0731 (patch)
treec1bf1fa132003b333b6ccd55d60127d93518f0eb /xtask
parenta95116fbfa11cad4e03b8b31f8d4498f3ddd5d9e (diff)
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')
-rw-r--r--xtask/src/codegen/gen_syntax.rs1
1 files changed, 1 insertions, 0 deletions
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)