From 8b19d75cfc2d933bd569def4db98862ce433e422 Mon Sep 17 00:00:00 2001 From: Georgii Plotnikov Date: Fri, 2 Feb 2024 17:42:42 +0800 Subject: [PATCH] Fix `ElementaryTypeName` state mutability parsing --- Solidity.g4 | 4 ++-- test.sol | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Solidity.g4 b/Solidity.g4 index c823d68..9ade376 100644 --- a/Solidity.g4 +++ b/Solidity.g4 @@ -151,12 +151,12 @@ variableDeclaration : typeName storageLocation? identifier ; typeName - : elementaryTypeName + : elementaryTypeName stateMutability? | userDefinedTypeName | mapping | typeName '[' expression? ']' | functionTypeName - | 'address' 'payable' ; + | 'address'; userDefinedTypeName : identifier ( '.' identifier )* ; diff --git a/test.sol b/test.sol index abbb2ba..86d3655 100644 --- a/test.sol +++ b/test.sol @@ -1071,3 +1071,5 @@ contract NamedMappingParams { // solc 0.8.19, user defined operators using { add as + } for Fixed18 global; using { add as +, sub as - } for Fixed18 global; + +function test() public returns(address payable) {}