type-inference.js
// We start the AST traversal with a call to visitRoot
We start the AST traversal with a call to visitRoot
We start the AST traversal with a call to visitRoot
function visitRoot(node) {
        switch (node.type) {
            case 'Program':
                node.body.forEach(visitStmt);
                break;
            case 'ProgramCollection':
                node.programs.forEach(visitRoot);
                break;
        }
    }
function visitRoot ( node ) { switch ( node . type ) { case 'Program' : node . body . forEach ( visitStmt ) ; break ; case 'ProgramCollection' : node . programs . forEach ( visitRoot ) ; break ; } }
We start the AST traversal with a call to visitRoot
We start the AST traversal with a call to visitRoot