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);
|
||||
|
||||
ast = {
|
||||
type: "File",
|
||||
program: ast,
|
||||
ast = t.file(ast, comments, tokens);
|
||||
|
||||
comments: comments,
|
||||
tokens: tokens,
|
||||
};
|
||||
traverse(ast, function (node, parent) {
|
||||
node._parent = parent;
|
||||
});
|
||||
|
||||
if (callback) {
|
||||
return callback(ast);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user