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
Enhancements to Selector Extractor #7660
Enhancements to Selector Extractor #7660
Conversation
- blocks - cascades - nested messages - symbols
- Make the parser be scope sensitive to be able to correctly cut in the correct closers )]}
- renamings - moving RubSelectorExtractor to a proper package
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.
I downloaded the image and tested it a bit: Works!
- there is still one user of findSelectorFromAST, I guess that can use the same heuristics later
- I wonder if having a dedicated version of #bestNodeFor: just for finding the selector would not allow to move some of the heuristics there.
Yes, I've cleaned up a bit, but this is not the only one to clean. There is also
I don't think so. I'd keep the AST as clean as possible. To me the best we can do form the AST point of view is to enhance further the parser to better detect syntactic errors and make #bestNodeFor: robust enough to account for those :) |
This PR enhances the selector extractor heuristics for the new faulty error nodes (that introduced some bugs). The main idea of this PR is to fix those bugs and go beyond what was supported already in Pharo8:
This PR makes several enhancements to the heuristics already working in Pharo8.
foo| bar
was returningbar
in P8 instead offoo
)foo:|bar
) give priority to the preceeding symbols as we thought it would be less surprising. Also, ambiguity can be just removed by properly formatting the code.To make this, we also had to improve the parser to properly insert error nodes where expected (e.g, messages without receivers, closing parenthesis/brackets without corresponding openers, invalid cascade sequences)