-
Notifications
You must be signed in to change notification settings - Fork 177
Optimize ruby visitor #3826
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize ruby visitor #3826
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,7 @@ module Prism | |
| def child_nodes: () -> Array[Prism::node?] | ||
| def comment_targets: () -> Array[Prism::node | Location] | ||
| def compact_child_nodes: () -> Array[Prism::node] | ||
| def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unsure if this is correct. I'm also missing sorbet signatures which I don't know how to write for this
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks right to me, and it would have failed to typecheck otherwise. |
||
| def self.fields: () -> Array[Prism::Reflection::Field] | ||
| def type: () -> Symbol | ||
| def self.type: () -> Symbol | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can just be implemented as
each_child_node.to_abut performance is not so greatThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, you're right to keep this the same.