diff options
Diffstat (limited to 'xtask/src/codegen')
-rw-r--r-- | xtask/src/codegen/gen_syntax.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/xtask/src/codegen/gen_syntax.rs b/xtask/src/codegen/gen_syntax.rs index c4fb29bbf..26f541da1 100644 --- a/xtask/src/codegen/gen_syntax.rs +++ b/xtask/src/codegen/gen_syntax.rs | |||
@@ -515,7 +515,7 @@ impl Field<'_> { | |||
515 | fn token_kind(&self) -> Option<proc_macro2::TokenStream> { | 515 | fn token_kind(&self) -> Option<proc_macro2::TokenStream> { |
516 | let res = match self { | 516 | let res = match self { |
517 | Field::Token(token) => { | 517 | Field::Token(token) => { |
518 | let token = format_ident!("{}", token); | 518 | let token: proc_macro2::TokenStream = token.parse().unwrap(); |
519 | quote! { T![#token] } | 519 | quote! { T![#token] } |
520 | } | 520 | } |
521 | _ => return None, | 521 | _ => return None, |
@@ -524,7 +524,13 @@ impl Field<'_> { | |||
524 | } | 524 | } |
525 | fn method_name(&self) -> proc_macro2::Ident { | 525 | fn method_name(&self) -> proc_macro2::Ident { |
526 | match self { | 526 | match self { |
527 | Field::Token(name) => format_ident!("{}_token", name), | 527 | Field::Token(name) => { |
528 | let name = match *name { | ||
529 | ";" => "semicolon", | ||
530 | _ => name, | ||
531 | }; | ||
532 | format_ident!("{}_token", name) | ||
533 | } | ||
528 | Field::Node { name, src } => match src { | 534 | Field::Node { name, src } => match src { |
529 | FieldSrc::Shorthand => format_ident!("{}", to_lower_snake_case(name)), | 535 | FieldSrc::Shorthand => format_ident!("{}", to_lower_snake_case(name)), |
530 | _ => format_ident!("{}", name), | 536 | _ => format_ident!("{}", name), |