Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion rust/ast-generator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
_ => {}
Expand Down Expand Up @@ -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 {
Expand Down