Closed EduardoVaz06 closed 3 months ago
Hi @EduardoVaz06,
The default visit
implementation simply visits all children of the node, which is how the entire AST tree is traversed.
So when you call super.visit(variable, context)
, that's what you're doing.
When you simply return context
without calling the super
method, you're doing an early-exit on that traversal and skipping visiting the children of the node.
Got it! Thank you!
It is actually exactly what I thought.
Prerequisites
Inquiry
I don't have much experience with Java, so while I was creating custom rules, I couldn't understand 100% the difference between using 'return super.visit(variable, context)' and only 'return context'. If anyone could clarify it, i would be glad.