walkall
Provides a walker for the acorn JavaScript parser that traverses all AST nodes
Last updated 7 years ago by sqs .
Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install walkall 
SYNC missed versions from official npm registry.

acorn-walkall

xrefs Most used function Number of funcs Status

acorn-walkall provides a custom walker for Marijn Haverbeke's acorn JavaScript parser that traverses all AST nodes.

Documentation: acorn-walkall on Sourcegraph

Usage

var acorn = require('acorn'),
    walk = require('acorn/util/walk'),
    walkall = require('./walkall');
var ast = acorn.parse('var x = 7;');
walk.simple(ast, walkall.makeVisitors(function(node) {
  console.log('Found node type', node.type);
}), walkall.traversers);

The included bin/walkall script emits the AST node type and source location for each AST node in the specified JavaScript file.

Running tests

Run npm test.

Author

Current Tags

  • 0.0.5                                ...           latest (5 years ago)

4 Versions

  • 0.0.5                                ...           5 years ago
  • 0.0.3                                ...           7 years ago
  • 0.0.2                                ...           7 years ago
  • 0.0.1                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 14
Dependencies (1)
Dev Dependencies (2)

Copyright 2014 - 2016 © taobao.org |