use file node builder and save parents to ast tree
This commit is contained in:
parent
de7edcaeb0
commit
83286cccd2
@ -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);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user