aboutsummaryrefslogtreecommitdiff
path: root/xtask
diff options
context:
space:
mode:
Diffstat (limited to 'xtask')
-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