Chevrotain / chevrotain

Parser Building Toolkit for JavaScript
https://chevrotain.io
Apache License 2.0
2.44k stars 200 forks source link

Docs enhancement on visitor with defaults #1916

Closed ierehon1905 closed 1 year ago

ierehon1905 commented 1 year ago

Hi, thank you for such a cool lib. While implementing a visitor with defaults I have not fully understood the implicit logic that it does.

If the overload of visitor rule is present / the method for rule is defined, does the chevrotain still automatically calls the node's children visitor methods? Or if the method is present it becomes the method's obligation to call the visit methods for children (seems like this is the case)?

Maybe this could be added in the docs to reduce the ambiguity.

https://github.com/Chevrotain/chevrotain/blob/953c35c769f00d83039ac98e5d0ad9cb35b38153/packages/website/docs/guide/concrete_syntax_tree.md?plain=1#L458