Merge pull request #10 from cgewecke/switch-to-solidity-parser

Switch from solparse to solidity-parser
uport
area 8 years ago committed by GitHub
commit 0ede891e54
  1. 11
      instrumentSolidity.js
  2. 2
      package.json

@ -1,11 +1,11 @@
// var SolidityParser = require("solidity-parser");
var solparse = require("solparse");
var SolidityParser = require("solidity-parser");
//var solparse = require("solparse");
var path = require("path");
module.exports = function(contract, fileName, instrumentingActive){
// var result = SolidityParser.parseFile("./" + pathToFile);
var result = solparse.parse(contract);
var result = SolidityParser.parse(contract);
//var result = solparse.parse(contract);
var instrumented = "";
const __INDENTATION__ = " ";
var parse = {};
@ -325,9 +325,12 @@ module.exports = function(contract, fileName, instrumentingActive){
}
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["LibraryStatement"] = function(expression, instrument){
//Inject our coverage event;

@ -15,7 +15,7 @@
"ethereumjs-testrpc": "^2.2.7",
"istanbul": "^0.4.5",
"shelljs": "^0.7.4",
"solparse": "^1.0.15"
"solidity-parser": "git+https://github.com/ConsenSys/solidity-parser.git#master"
},
"devDependencies": {
"mocha": "^3.1.0"

Loading…
Cancel
Save