aboutsummaryrefslogtreecommitdiff
path: root/xtask/src/codegen
diff options
context:
space:
mode:
authorkjeremy <[email protected]>2020-09-03 22:30:44 +0100
committerkjeremy <[email protected]>2020-09-03 22:40:12 +0100
commit11758d518a088a5c8b6727e9362af2d09a177cc0 (patch)
treef53fe9db319d8f26baad982172ae330242a34a37 /xtask/src/codegen
parent74e7422b69d35c55ff6fde77258047f0292d36e0 (diff)
Up proc-macro2 to 1.20
This changes the way Display is implemented
Diffstat (limited to 'xtask/src/codegen')
-rw-r--r--xtask/src/codegen/gen_syntax.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/xtask/src/codegen/gen_syntax.rs b/xtask/src/codegen/gen_syntax.rs
index 200e8aa50..733493fef 100644
--- a/xtask/src/codegen/gen_syntax.rs
+++ b/xtask/src/codegen/gen_syntax.rs
@@ -247,14 +247,14 @@ fn generate_nodes(kinds: KindsSrc<'_>, grammar: &AstSrc) -> Result<String> {
247 #(#display_impls)* 247 #(#display_impls)*
248 }; 248 };
249 249
250 let ast = ast.to_string().replace("T ! [ ", "T![").replace(" ] )", "])"); 250 let ast = ast.to_string().replace("T ! [", "T![");
251 251
252 let mut res = String::with_capacity(ast.len() * 2); 252 let mut res = String::with_capacity(ast.len() * 2);
253 253
254 let mut docs = 254 let mut docs =
255 grammar.nodes.iter().map(|it| &it.doc).chain(grammar.enums.iter().map(|it| &it.doc)); 255 grammar.nodes.iter().map(|it| &it.doc).chain(grammar.enums.iter().map(|it| &it.doc));
256 256
257 for chunk in ast.split("# [ pretty_doc_comment_placeholder_workaround ]") { 257 for chunk in ast.split("# [pretty_doc_comment_placeholder_workaround] ") {
258 res.push_str(chunk); 258 res.push_str(chunk);
259 if let Some(doc) = docs.next() { 259 if let Some(doc) = docs.next() {
260 write_doc_comment(&doc, &mut res); 260 write_doc_comment(&doc, &mut res);