|
|
@ -1,11 +1,11 @@ |
|
|
|
// var SolidityParser = require("solidity-parser");
|
|
|
|
var SolidityParser = require("solidity-parser"); |
|
|
|
var solparse = require("solparse"); |
|
|
|
//var solparse = require("solparse");
|
|
|
|
|
|
|
|
|
|
|
|
var path = require("path"); |
|
|
|
var path = require("path"); |
|
|
|
module.exports = function(contract, fileName, instrumentingActive){ |
|
|
|
module.exports = function(contract, fileName, instrumentingActive){ |
|
|
|
|
|
|
|
|
|
|
|
// var result = SolidityParser.parseFile("./" + pathToFile);
|
|
|
|
var result = SolidityParser.parse(contract); |
|
|
|
var result = solparse.parse(contract); |
|
|
|
//var result = solparse.parse(contract);
|
|
|
|
var instrumented = ""; |
|
|
|
var instrumented = ""; |
|
|
|
const __INDENTATION__ = " "; |
|
|
|
const __INDENTATION__ = " "; |
|
|
|
var parse = {}; |
|
|
|
var parse = {}; |
|
|
@ -325,9 +325,12 @@ module.exports = function(contract, fileName, instrumentingActive){ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for (x in expression.body){ |
|
|
|
for (x in expression.body){ |
|
|
|
|
|
|
|
// Ignore top-level variable declarations grouped together in array by solidity-parser
|
|
|
|
|
|
|
|
if (!Array.isArray(expression.body[x])){ |
|
|
|
parse[expression.body[x].type](expression.body[x], instrument); |
|
|
|
parse[expression.body[x].type](expression.body[x], instrument); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
parse["LibraryStatement"] = function(expression, instrument){ |
|
|
|
parse["LibraryStatement"] = function(expression, instrument){ |
|
|
|
//Inject our coverage event;
|
|
|
|
//Inject our coverage event;
|
|
|
|