diff options
author | Aleksey Kladov <[email protected]> | 2020-04-10 09:18:43 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-04-10 15:10:28 +0100 |
commit | 1c5d8591952cbb017fd6679a1ef29a86e1499025 (patch) | |
tree | 9ea2266e46cbba887d39e46374d3e06c9a2e44b2 /xtask/src/codegen | |
parent | c8b4c36f8161d34c8145a49965efee4514275989 (diff) |
Start replacing tokens
Diffstat (limited to 'xtask/src/codegen')
-rw-r--r-- | xtask/src/codegen/gen_syntax.rs | 4 |
1 files changed, 4 insertions, 0 deletions
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) |