Adding lexical information to the output of burrito.parse #5

Open
apatil opened this Issue Nov 27, 2011 · 0 comments

Projects

None yet

1 participant

apatil commented Nov 27, 2011

Currently burrito.parse is basically just uglify.parser.parse. I'd like to suggest redefining burrito.parse as follows:

burrito.parse = function (code) {
    var ast = parse(code.toString(), false, true);

    var ast_ = traverse(ast).map(function mapper () {
        wrapNode(this, undefined);
    });

    return ast_
};

That way the AST it outputs carries all the nice lexical information that is available to functions used by burrito().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment