Skip to content

Commit

Permalink
fix: mistake in refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
rzvxa committed Jul 7, 2024
1 parent a2b92d8 commit 15dc78c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tasks/ast_codegen/src/generators/ast_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,12 @@ fn enum_builder_name(enum_name: String, var_name: String) -> Ident {
}

fn struct_builder_name(struct_: &RStruct) -> Ident {
format_ident!("{}", fn_ident_name(struct_.ident().to_string()))
static RUST_KEYWORDS: [&str; 1] = ["super"];
let mut ident = fn_ident_name(struct_.ident().to_string());
if RUST_KEYWORDS.contains(&ident.as_str()) {
ident.push('_');
}
format_ident!("{ident}")
}

fn generate_builder_fn(ty: &TypeRef, ctx: &CodegenCtx) -> Option<TokenStream> {
Expand Down

0 comments on commit 15dc78c

Please sign in to comment.