add missing ranges

This commit is contained in:
Sebastian McKenzie 2015-07-27 02:44:49 +01:00
parent 06ccbca763
commit 582cf6cc8a

View File

@ -4,6 +4,7 @@ var t = require("babel-core").types;
exports.toToken = function (token) { exports.toToken = function (token) {
var type = token.type; var type = token.type;
token.range = [token.start, token.end];
if (type === tt.name) { if (type === tt.name) {
token.type = "Identifier"; token.type = "Identifier";
@ -63,6 +64,7 @@ exports.toToken = function (token) {
exports.toAST = function (ast) { exports.toAST = function (ast) {
ast.sourceType = "module"; ast.sourceType = "module";
ast.range = [ast.start, ast.end];
traverse(ast, astTransformVisitor); traverse(ast, astTransformVisitor);
}; };