UNPKG

lively.ast

Version:

Parsing JS code into ASTs and tools to query and transform these trees.

6 lines (3 loc) 164 B
var ast = require("../dist/lively.ast.js"); console.log(ast.stringify(ast.parse("1+2"))); console.log(ast.query.topLevelDeclsAndRefs(ast.parse("this.x = foo")));