ConsenSysMesh / solidity-parser

Solidity Parser in Javascript
137 stars 53 forks source link

Unable to parse 'return' in inline assembly #81

Closed area closed 7 years ago

area commented 7 years ago

The following contract is unable to be parsed, because of the use of return in the inline assembly, but will compile successfully with solc and work as intended.

pragma solidity ^0.4.4;

contract Example {
  uint a = 10;

  function get() constant returns(uint) {
    assembly {
        mstore(0x40, sload(0))
        return(0x40,32)
    }
  }
}

This also doesn't seem to be able to be parsed correctly by solidity-parser-antlr, for what it's worth.

cgewecke commented 7 years ago

Submitting a PR to fix this shortly.