|
|
|
@ -95,11 +95,11 @@ var parseExpressions = function(expr){ |
|
|
|
return expressions; |
|
|
|
}; |
|
|
|
|
|
|
|
module.exports.parseDataFile = function(filename, options){ |
|
|
|
return module.exports.parseData(fs.readFileSync(filename, 'utf-8'), options); |
|
|
|
module.exports.parseFile = function(filename, options){ |
|
|
|
return module.exports.parseContents(fs.readFileSync(filename, 'utf-8'), options); |
|
|
|
}; |
|
|
|
|
|
|
|
module.exports.parseData = function(contents, options){ |
|
|
|
module.exports.parseContents = function(contents, options){ |
|
|
|
options = options || {}; |
|
|
|
var tolerant = (options.tolerant === undefined)? true: options.tolerant; |
|
|
|
var parsed = esprima.parse(contents, {comment: true, loc: true, tolerant: tolerant}); |
|
|
|
@ -119,3 +119,5 @@ module.exports.parseData = function(contents, options){ |
|
|
|
|
|
|
|
return results; |
|
|
|
}; |
|
|
|
|
|
|
|
module.exports.parse = module.exports.parseFile; |