aboutsummaryrefslogtreecommitdiff
path: root/xtask/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-04-10 09:18:43 +0100
committerAleksey Kladov <[email protected]>2020-04-10 15:10:28 +0100
commit1c5d8591952cbb017fd6679a1ef29a86e1499025 (patch)
tree9ea2266e46cbba887d39e46374d3e06c9a2e44b2 /xtask/src
parentc8b4c36f8161d34c8145a49965efee4514275989 (diff)
Start replacing tokens
Diffstat (limited to 'xtask/src')
-rw-r--r--xtask/src/ast_src.rs2
-rw-r--r--xtask/src/codegen/gen_syntax.rs4
2 files changed, 5 insertions, 1 deletions
diff --git a/xtask/src/ast_src.rs b/xtask/src/ast_src.rs
index 1a6ee935f..8c83450e6 100644
--- a/xtask/src/ast_src.rs
+++ b/xtask/src/ast_src.rs
@@ -322,7 +322,7 @@ pub(crate) const AST_SRC: AstSrc = AstSrc {
322 T![;] 322 T![;]
323 } 323 }
324 324
325 struct RetType { ThinArrow, TypeRef } 325 struct RetType { T![->], TypeRef }
326 326
327 struct StructDef: VisibilityOwner, NameOwner, TypeParamsOwner, AttrsOwner, DocCommentsOwner { 327 struct StructDef: VisibilityOwner, NameOwner, TypeParamsOwner, AttrsOwner, DocCommentsOwner {
328 T![struct], 328 T![struct],
diff --git a/xtask/src/codegen/gen_syntax.rs b/xtask/src/codegen/gen_syntax.rs
index 26f541da1..b7698ee6e 100644
--- a/xtask/src/codegen/gen_syntax.rs
+++ b/xtask/src/codegen/gen_syntax.rs
@@ -345,6 +345,7 @@ fn generate_nodes(kinds: KindsSrc<'_>, grammar: AstSrc<'_>) -> Result<String> {
345 #(#displays)* 345 #(#displays)*
346 }; 346 };
347 347
348 let ast = ast.to_string().replace("T ! [ ", "T![").replace(" ] )", "])");
348 let pretty = crate::reformat(ast)?; 349 let pretty = crate::reformat(ast)?;
349 Ok(pretty) 350 Ok(pretty)
350} 351}
@@ -527,6 +528,9 @@ impl Field<'_> {
527 Field::Token(name) => { 528 Field::Token(name) => {
528 let name = match *name { 529 let name = match *name {
529 ";" => "semicolon", 530 ";" => "semicolon",
531 "->" => "thin_arrow",
532 "'{'" => "l_curly",
533 "'}'" => "r_curly",
530 _ => name, 534 _ => name,
531 }; 535 };
532 format_ident!("{}_token", name) 536 format_ident!("{}_token", name)