aboutsummaryrefslogtreecommitdiff
path: root/xtask/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-04-10 15:00:24 +0100
committerAleksey Kladov <[email protected]>2020-04-10 15:10:28 +0100
commitd4332760d81c5575dd04b39275c4979b59bb9fc4 (patch)
treeb87fa6b8bf9ef53473ef0f54e46137382d1e8899 /xtask/src
parente0f02d233fa3e26e4f10bffacbaef11b6bcb0ada (diff)
Better readability
Diffstat (limited to 'xtask/src')
-rw-r--r--xtask/src/codegen/gen_syntax.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/xtask/src/codegen/gen_syntax.rs b/xtask/src/codegen/gen_syntax.rs
index 7dc7f396c..ff290bb33 100644
--- a/xtask/src/codegen/gen_syntax.rs
+++ b/xtask/src/codegen/gen_syntax.rs
@@ -57,7 +57,8 @@ fn generate_tokens(grammar: AstSrc<'_>) -> Result<String> {
57 let pretty = crate::reformat(quote! { 57 let pretty = crate::reformat(quote! {
58 use crate::{SyntaxKind::{self, *}, SyntaxToken, ast::AstToken}; 58 use crate::{SyntaxKind::{self, *}, SyntaxToken, ast::AstToken};
59 #(#tokens)* 59 #(#tokens)*
60 })?; 60 })?
61 .replace("#[derive", "\n#[derive");
61 Ok(pretty) 62 Ok(pretty)
62} 63}
63 64
@@ -215,7 +216,7 @@ fn generate_nodes(kinds: KindsSrc<'_>, grammar: AstSrc<'_>) -> Result<String> {
215 }; 216 };
216 217
217 let ast = ast.to_string().replace("T ! [ ", "T![").replace(" ] )", "])"); 218 let ast = ast.to_string().replace("T ! [ ", "T![").replace(" ] )", "])");
218 let pretty = crate::reformat(ast)?; 219 let pretty = crate::reformat(ast)?.replace("#[derive", "\n#[derive");
219 Ok(pretty) 220 Ok(pretty)
220} 221}
221 222