ConsenSysMesh / solidity-parser

Solidity Parser in Javascript
138 stars 54 forks source link

Parsing destructuring assignment across lines throws error #74

Closed travs closed 7 years ago

travs commented 7 years ago

Example file:

pragma solidity ^0.4.0;              
contract Destructure {      

    function gimmeNumbers() returns (uint, uint, uint, uint) {                                       
        return (23, 88, 66, 0);                
    }                  

    function destructureThem() {                     
        var (          
            num1, num2,                        
            num3, num4 
        ) = gimmeNumbers();  
    }                  
}  

Output:

Expected ",", comment, end of line, or whitespace but "n" found. Line: 10, Column: 13
cgewecke commented 7 years ago

It looks like I introduced this bug with #70. Whitespace should be consumed separately from the commas. I'll PR to change this shortly.

federicobond commented 7 years ago

Fixed by @cgewecke in #75.