Skip to content

Conversation

@eddyb
Copy link
Contributor

@eddyb eddyb commented Jul 27, 2019

While exploring a better API for #10 I realized the path trick, as useful as it is otherwise, was holding me back, because it makes recursing on a rule/parse forest, while keeping track of fields, expensive.
You can already see an improvement in the Folder API, for example.

I'll update #10 to use this next, possibly a good idea to wait for that before merging.

Copy link
Contributor

@CAD97 CAD97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This definitely feels better to me.

let field_rule = |rule, i| RuleWithFields {
rule,
fields: self.filter_fields(Some(i)).collect(),
fields: aggregate_fields
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This closure could be named child and aggregate_fields could be named children.

@eddyb
Copy link
Contributor Author

eddyb commented Aug 27, 2019

I was able to update gll to this, totally worth it! See rust-lang/gll#133.

@eddyb eddyb merged commit 7c360f2 into master Aug 27, 2019
@eddyb eddyb deleted the tree-fields branch August 27, 2019 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants