use file node builder and save parents to ast tree

This commit is contained in:
Sebastian McKenzie 2014-11-09 16:26:52 +11:00
parent de7edcaeb0
commit 83286cccd2

View File

@ -203,13 +203,11 @@ exports.parse = function (opts, code, callback) {
estraverse.attachComments(ast, comments, tokens); estraverse.attachComments(ast, comments, tokens);
ast = { ast = t.file(ast, comments, tokens);
type: "File",
program: ast,
comments: comments, traverse(ast, function (node, parent) {
tokens: tokens, node._parent = parent;
}; });
if (callback) { if (callback) {
return callback(ast); return callback(ast);