federicobond / solidity-parser-antlr

A Solidity parser for JS built on top of a robust ANTLR4 grammar
MIT License
155 stars 55 forks source link

Issues with assembly function declarations #53

Closed area closed 5 years ago

area commented 5 years ago

There seems to be an issue with Assembly Function Declarations. All of the following are valid according to remix, but this parser seems to only successfully parse the first one:

pragma solidity ^0.5.0;

contract JoinSplit {
    function() external payable {
        assembly {
            function validateJoinSplit(y) -> x {

            }
        }
    }
}
pragma solidity ^0.5.0;

contract JoinSplit {
    function() external payable {
        assembly {
            function validateJoinSplit(y) {

            }
        }
    }
}
pragma solidity ^0.5.0;

contract JoinSplit {
    function() external payable {
        assembly {
            function validateJoinSplit() -> x {

            }
        }
    }
}
federicobond commented 5 years ago

Thanks for reporting this! It should be fixed in latest master. I will cut a release in the next few days.