Skip to content

Commit 9b0854e

Browse files
authored
Merge pull request #19335 from github/aibaars/macro-stmts
Rust: make MacroStmts expressions
2 parents aa80b83 + 6bf50d8 commit 9b0854e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+14903
-370
lines changed

rust/ast-generator/src/main.rs

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ fn class_name(type_name: &str) -> String {
2323
"Literal" => "LiteralExpr".to_owned(),
2424
"ArrayExpr" => "ArrayExprInternal".to_owned(),
2525
"AsmOptions" => "AsmOptionsList".to_owned(),
26+
"MacroStmts" => "MacroBlockExpr".to_owned(),
2627
_ if type_name.starts_with("Record") => type_name.replacen("Record", "Struct", 1),
2728
_ if type_name.ends_with("Type") => format!("{}Repr", type_name),
2829
_ => type_name.to_owned(),
@@ -36,6 +37,7 @@ fn property_name(type_name: &str, field_name: &str) -> String {
3637
("MatchExpr", "expr") => "scrutinee",
3738
("Variant", "expr") => "discriminant",
3839
("FieldExpr", "expr") => "container",
40+
("MacroBlockExpr", "expr") => "tail_expr",
3941
(_, "name_ref") => "identifier",
4042
(_, "then_branch") => "then",
4143
(_, "else_branch") => "else_",

0 commit comments

Comments
 (0)