change interface for visitor in description

This commit is contained in:
Donald Pipowitch 2017-10-13 07:37:37 +02:00 committed by James Kyle
parent 386d1efd5b
commit 4f7a85a9f8

View File

@ -709,17 +709,32 @@ function parser(tokens) {
* encounter a node with a matching type. * encounter a node with a matching type.
* *
* traverse(ast, { * traverse(ast, {
* Program(node, parent) { * Program: {
* enter(node, parent) {
* // ... * // ...
* }, * },
* * exit(node, parent) {
* CallExpression(node, parent) {
* // ... * // ...
* }, * },
* },
* *
* NumberLiteral(node, parent) { * CallExpression: {
* enter(node, parent) {
* // ... * // ...
* }, * },
* exit(node, parent) {
* // ...
* },
* },
*
* NumberLiteral: {
* enter(node, parent) {
* // ...
* },
* exit(node, parent) {
* // ...
* },
* },
* }); * });
*/ */