mirror of
https://github.com/github/codeql.git
synced 2026-02-11 20:51:06 +01:00
Rust: Remove MacroBlockExpr class
This commit is contained in:
@@ -22,7 +22,6 @@ fn class_name(type_name: &str) -> String {
|
||||
"Literal" => "LiteralExpr".to_owned(),
|
||||
"ArrayExpr" => "ArrayExprInternal".to_owned(),
|
||||
"AsmOptions" => "AsmOptionsList".to_owned(),
|
||||
"MacroStmts" => "MacroBlockExpr".to_owned(),
|
||||
_ if type_name.starts_with("Record") => type_name.replacen("Record", "Struct", 1),
|
||||
_ if type_name.ends_with("Type") => format!("{type_name}Repr"),
|
||||
_ => type_name.to_owned(),
|
||||
@@ -36,7 +35,6 @@ fn property_name(type_name: &str, field_name: &str) -> String {
|
||||
("MatchExpr", "expr") => "scrutinee",
|
||||
("Variant", "expr") => "discriminant",
|
||||
("FieldExpr", "expr") => "container",
|
||||
("MacroBlockExpr", "expr") => "tail_expr",
|
||||
(_, "name_ref") => "identifier",
|
||||
(_, "then_branch") => "then",
|
||||
(_, "else_branch") => "else_",
|
||||
|
||||
@@ -1440,28 +1440,6 @@ class _:
|
||||
"""
|
||||
|
||||
|
||||
class MacroBlockExpr(Expr):
|
||||
"""
|
||||
A sequence of statements generated by a `MacroCall`. For example:
|
||||
```rust
|
||||
macro_rules! my_macro {
|
||||
() => {
|
||||
let mut x = 40;
|
||||
x += 2;
|
||||
x
|
||||
};
|
||||
}
|
||||
|
||||
my_macro!(); // this macro expands to a sequence of statements (and an expression)
|
||||
```
|
||||
"""
|
||||
|
||||
__cfg__ = True
|
||||
|
||||
statements: list[Stmt] | child
|
||||
tail_expr: optional[Expr] | child
|
||||
|
||||
|
||||
@annotate(MacroTypeRepr)
|
||||
class _:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user