Skip to content

Commit ac8eb50

Browse files
committed
Yeast: Allow 'r#type' to escape the 'type' keyword in macro
1 parent 1ecdc36 commit ac8eb50

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

shared/yeast-macros/src/parse.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ fn parse_direct_node_inner(tokens: &mut Tokens, ctx: &Ident) -> Result<TokenStre
411411
// Named fields — compute each value into a temp, then reference it
412412
while peek_is_field(tokens) {
413413
let field_name = expect_ident(tokens, "expected field name")?;
414-
let field_str = field_name.to_string();
414+
let field_str = field_name.to_string().strip_prefix("r#").unwrap_or(&field_name.to_string()).to_string();
415415
expect_punct(tokens, ':', "expected `:` after field name")?;
416416
let temp = Ident::new(
417417
&format!("__field_{field_str}_{field_counter}"),

0 commit comments

Comments
 (0)