ConsenSysMesh / solidity-parser

Solidity Parser in Javascript
137 stars 53 forks source link

Allow trailing comma in name-value lists #73

Closed cgewecke closed 7 years ago

cgewecke commented 7 years ago

Fix for additional issue in #71 / #72 . . . solc allows a trailing comma in name-value lists (as long as there's at least one list item.)

federicobond commented 7 years ago

LGTM, but what about changing the current rule to this instead of creating a new one?

"(" __ "{" __ args:(NameValueList (__ ",")? )? __ "}" __ ")"
federicobond commented 7 years ago

No performance difference between both. I am merging the single-rule version so as to not stall the people on the other side.

cgewecke commented 7 years ago

Nice. That's great.

federicobond commented 7 years ago

Turns out this is not intended behavior and the compiler should be updated to complain on trailing commas. See discussion here: https://github.com/ethereum/solidity/pull/2378

cgewecke commented 7 years ago

Ahhh! Interesting!