Skip to content

rule: intern fields and store them in a tree matching the rule structure.#11

Merged
eddyb merged 3 commits into
masterfrom
tree-fields
Aug 27, 2019
Merged

rule: intern fields and store them in a tree matching the rule structure.#11
eddyb merged 3 commits into
masterfrom
tree-fields

Conversation

@eddyb

@eddyb eddyb commented Jul 27, 2019

Copy link
Copy Markdown
Contributor

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.

@CAD97 CAD97 left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread src/rule.rs
let field_rule = |rule, i| RuleWithFields {
rule,
fields: self.filter_fields(Some(i)).collect(),
fields: aggregate_fields

Copy link
Copy Markdown
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

eddyb commented Aug 27, 2019

Copy link
Copy Markdown
Contributor Author

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.

2 participants