[java] Rename visitor methods to reduce overloading#2706
Merged
Conversation
This way you don't need to upcast a node to eg JavaNode in order to call the next method to delegate: ```java visit((JavaNode) node, data) -> visitJavaNode(node, data) ``` This prevents writing `visit(node, data)` and not being sure what overload is called.
This is just not so useful, most visitors use side effects on the parameter, or, return the parameter, which is only possible if `P = R`, and so only known in the specific subclass.
Idk why they were there, but the grammar does not produce them anywhere. Compilation was failing because they expected a visit method on the visitor, which is not generated
10 tasks
Generated by 🚫 Danger |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe the PR
Follow the conventions of #2661 for the Java and JSP modules. This is important as this changes the wrapper script, so all javacc modules depend on this PR for #880. It's also important that it lands in the 7.0.x branch so that java-grammar can be updated early, before we touch rules
Since this updates the wrapper, parts of other Javacc modules needed to be updated too.
I'll also rename acceptVisitor but not in a PR because the diff is uninteresting.
TODO on master
ScalaParserVisitorAdapter::zeroand::combine-> those are removed fromAstVisitorBasefor reasons explained in 1171afb--> #2720
Ready?
./mvnw clean verifypasses (checked automatically by travis)