From 4f7a85a9f8e913db58f358044bc53167faba4307 Mon Sep 17 00:00:00 2001 From: Donald Pipowitch Date: Fri, 13 Oct 2017 07:37:37 +0200 Subject: [PATCH] change interface for visitor in description --- the-super-tiny-compiler.js | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/the-super-tiny-compiler.js b/the-super-tiny-compiler.js index c57f1ac..411fa54 100755 --- a/the-super-tiny-compiler.js +++ b/the-super-tiny-compiler.js @@ -709,16 +709,31 @@ function parser(tokens) { * encounter a node with a matching type. * * traverse(ast, { - * Program(node, parent) { - * // ... + * Program: { + * enter(node, parent) { + * // ... + * }, + * exit(node, parent) { + * // ... + * }, * }, * - * CallExpression(node, parent) { - * // ... + * CallExpression: { + * enter(node, parent) { + * // ... + * }, + * exit(node, parent) { + * // ... + * }, * }, * - * NumberLiteral(node, parent) { - * // ... + * NumberLiteral: { + * enter(node, parent) { + * // ... + * }, + * exit(node, parent) { + * // ... + * }, * }, * }); */