Merge pull request #171 from sc-forks/struct-parse-bug

Fix parsing bug preventing fn definition in structs
pull/173/head
c-g-e-w-e-k-e- 7 years ago committed by GitHub
commit 9f44f6234e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      package-lock.json
  2. 2
      package.json
  3. 7
      test/sources/statements/fn-struct.sol
  4. 7
      test/statements.js

6
package-lock.json generated

@ -5633,9 +5633,9 @@
}
},
"solidity-parser-sc": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/solidity-parser-sc/-/solidity-parser-sc-0.4.1.tgz",
"integrity": "sha512-51kDgZXLCfgOtmxrPPK1Jhgi257emdf8g9xBA7BA5TgFTM8tSEgRzvJGlGTPbI03txLETuSvNpPhy46c+srOyQ==",
"version": "0.4.2",
"resolved": "https://registry.npmjs.org/solidity-parser-sc/-/solidity-parser-sc-0.4.2.tgz",
"integrity": "sha512-KCzHkuCxIlxia4tZxeuWm8MVN5YgcdWNsD/UdO6+bWkZyqBpwJRaHUagvb6IJAT6cNU68M4qWWK2pT9ZiEPiPg==",
"requires": {
"mocha": "2.5.3",
"pegjs": "0.10.0",

@ -28,7 +28,7 @@
"req-cwd": "^1.0.1",
"shelljs": "^0.7.4",
"sol-explore": "^1.6.2",
"solidity-parser-sc": "0.4.1",
"solidity-parser-sc": "0.4.2",
"web3": "^0.18.4"
},
"devDependencies": {

@ -0,0 +1,7 @@
pragma experimental "v0.5.0";
contract Test {
struct Fn {
function(bytes32) internal constant returns(bool) startConditions;
}
}

@ -17,6 +17,13 @@ describe('generic statements', () => {
const filePath = path.resolve('./test.sol');
const pathPrefix = './';
it('should compile function defined in a struct', () => {
const contract = util.getCode('statements/fn-struct.sol');
const info = getInstrumentedVersion(contract, filePath);
const output = solc.compile(info.contract, 1);
util.report(output.errors);
})
it('should compile after instrumenting a single statement (first line of function)', () => {
const contract = util.getCode('statements/single.sol');
const info = getInstrumentedVersion(contract, filePath);

Loading…
Cancel
Save