Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

The grammar lacks support for named parameters in mapping types #9

Open
vquelque opened this issue May 19, 2023 · 0 comments
Open

The grammar lacks support for named parameters in mapping types #9

vquelque opened this issue May 19, 2023 · 0 comments

Comments

@vquelque
Copy link

Solidity v0.8.18 enables named parameters in mapping types. The current grammar does not support that. This results in errors when trying to parse source units that contain mappings with named parameters.

For example, this minimal contract will throw an error when parsed:

pragma solidity >=0.8.18;

contract TestParse {
    mapping(address account => uint256 balance) public balances;
}

The grammar would need to be fixed to allow for identifiers in mapping types
It could probably be fixed by adding optional identifiers to the mapping parsing expression:

mapping
  : 'mapping' '(' elementaryTypeName identifier? '=>' typeName identifier? ')' ;
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant