How to use the acorn-walk.fullAncestor function in acorn-walk

To help you get started, we’ve selected a few acorn-walk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github stdlib-js / stdlib / lib / node_modules / @stdlib / _tools / static-analysis / js / program-summary / lib / flatten.js View on Github external
function flatten( ast, scope, depth ) {
	var out = [];
	walk( ast, visit );
	return out;

	/**
	* Callback invoked upon visiting an AST node.
	*
	* @private
	* @param {Node} node - AST node
	* @param {*} state - state
	* @param {Array} ancestors - ancestor nodes
	*/
	function visit( node, state, ancestors ) {
		var level;
		var type;
		var d;
		var i;
		if ( node !== ast && contains( types, node.type ) ) {
github peterqliu / threebox / node_modules / acorn-node / walk.js View on Github external
function fullAncestor (node, callback, baseVisitor, state) {
  return walk.fullAncestor(node, callback, baseVisitor || base, state)
}
github publiclab / leaflet-environmental-layers / node_modules / acorn-node / walk.js View on Github external
function fullAncestor (node, callback, baseVisitor, state) {
  return walk.fullAncestor(node, callback, baseVisitor || base, state)
}
github mkmarek / unity-react-uielements / packages / babel-transform / src / jsx-visitor.js View on Github external
const findAncestor = (node) => {
        let ancestor = null;
        walk.fullAncestor(copy, (test, ancestors) => {
            if (node === test) {
                ancestor = ancestors[ancestors.length - 2];
            }
        });

        return ancestor;
    }
github cloudflare / ipfs-ext / node_modules / acorn-node / walk.js View on Github external
function fullAncestor (node, callback, baseVisitor, state) {
  return walk.fullAncestor(node, callback, baseVisitor || base, state)
}
github endorphinjs / endorphin / packages / template-parser / src / walk.ts View on Github external
export function walkFullAncestor(node: Ast.Node, callback: AstAncestorVisitorCallback, baseVisitor = base, state?: T): void {
    acornWalk.fullAncestor(node, callback, baseVisitor, state);
}