Update parser-antlr to ^0.4.7 (type keyword fix)

pull/350/head
cgewecke 5 years ago
parent 21db7095f2
commit 004142f937
  1. 2
      package.json
  2. 32
      test/sources/statements/type-keyword.sol
  3. 7
      test/statements.js
  4. 1341
      yarn.lock

@ -27,7 +27,7 @@
"req-cwd": "^1.0.1",
"shelljs": "^0.8.3",
"sol-explore": "^1.6.2",
"solidity-parser-antlr": "0.4.5",
"solidity-parser-antlr": "^0.4.7",
"tree-kill": "^1.2.0",
"web3": "1.0.0-beta.50",
"web3-eth-abi": "1.0.0-beta.50"

@ -0,0 +1,32 @@
pragma solidity >0.4.99 <0.6.0;
contract Account {
address public owner;
constructor(address payable _owner) public {
owner = _owner;
}
function setOwner(address _owner) public {
require(msg.sender == owner);
owner = _owner;
}
function destroy(address payable recipient) public {
require(msg.sender == owner);
selfdestruct(recipient);
}
function() payable external {}
}
contract Factory {
bytes32 private contractCodeHash;
constructor() public {
contractCodeHash = keccak256(
type(Account).creationCode
);
}
}

@ -24,6 +24,13 @@ describe('generic statements', () => {
util.report(output.errors);
})
it('should compile when using the type keyword', () => {
const contract = util.getCode('statements/type-keyword.sol');
const info = getInstrumentedVersion(contract, filePath);
const output = JSON.parse(solc.compile(util.codeToCompilerInput(info.contract)));
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);

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save