diff options
author | Igor Aleksanov <[email protected]> | 2020-08-12 12:08:55 +0100 |
---|---|---|
committer | Igor Aleksanov <[email protected]> | 2020-08-12 12:08:55 +0100 |
commit | fcd4b0176f1544b389c9b028c547a1dfc92f9a56 (patch) | |
tree | bcca1afb725766cdf1eeb75aed3618c3e517345d /xtask | |
parent | d180b8bbe8c9e31953069bae387b5214fbb51d64 (diff) |
Revert style preference-related fixes
Diffstat (limited to 'xtask')
-rw-r--r-- | xtask/src/codegen/gen_syntax.rs | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/xtask/src/codegen/gen_syntax.rs b/xtask/src/codegen/gen_syntax.rs index af9d63b06..cafad8070 100644 --- a/xtask/src/codegen/gen_syntax.rs +++ b/xtask/src/codegen/gen_syntax.rs | |||
@@ -91,16 +91,18 @@ fn generate_nodes(kinds: KindsSrc<'_>, grammar: &AstSrc) -> Result<String> { | |||
91 | support::children(&self.syntax) | 91 | support::children(&self.syntax) |
92 | } | 92 | } |
93 | } | 93 | } |
94 | } else if let Some(token_kind) = field.token_kind() { | ||
95 | quote! { | ||
96 | pub fn #method_name(&self) -> Option<#ty> { | ||
97 | support::token(&self.syntax, #token_kind) | ||
98 | } | ||
99 | } | ||
100 | } else { | 94 | } else { |
101 | quote! { | 95 | if let Some(token_kind) = field.token_kind() { |
102 | pub fn #method_name(&self) -> Option<#ty> { | 96 | quote! { |
103 | support::child(&self.syntax) | 97 | pub fn #method_name(&self) -> Option<#ty> { |
98 | support::token(&self.syntax, #token_kind) | ||
99 | } | ||
100 | } | ||
101 | } else { | ||
102 | quote! { | ||
103 | pub fn #method_name(&self) -> Option<#ty> { | ||
104 | support::child(&self.syntax) | ||
105 | } | ||
104 | } | 106 | } |
105 | } | 107 | } |
106 | } | 108 | } |