mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Rust: suppress TypeAnchor in the generator
This commit is contained in:
@@ -295,7 +295,7 @@ fn get_fields(node: &AstNodeSrc) -> Vec<FieldInfo> {
|
||||
let name = field.method_name();
|
||||
match (node.name.as_str(), name.as_str()) {
|
||||
("ArrayExpr", "expr") // The ArrayExpr type also has an 'exprs' field
|
||||
| ("PathSegment", "ty" | "path_type") // these are broken, handling them manually
|
||||
| ("PathSegment", "type_anchor") // we flatten TypeAnchor into PathSegment in the extractor
|
||||
| ("Param", "pat") | ("MacroCall", "token_tree") // handled manually to use `body`
|
||||
=> continue,
|
||||
_ => {}
|
||||
@@ -487,6 +487,9 @@ fn main() -> anyhow::Result<()> {
|
||||
|
||||
grammar.enums.retain(|x| x.name != "Adt");
|
||||
|
||||
// we flatten TypeAnchor into PathSegment in the extractor
|
||||
grammar.nodes.retain(|x| x.name != "TypeAnchor");
|
||||
|
||||
let mut super_types: BTreeMap<String, BTreeSet<String>> = BTreeMap::new();
|
||||
for node in &grammar.enums {
|
||||
for variant in &node.variants {
|
||||
|
||||
Reference in New Issue
Block a user