Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.

Commit 44848f5

Browse files
authored
Merge pull request #788 from LefterisJP/rebased_solidity_interface
solidity_names() recognizes interface
2 parents 40a4a55 + d1bdcc7 commit 44848f5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

ethereum/tools/_solidity.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,13 @@ def solidity_names(code): # pylint: disable=too-many-branches
165165
if result:
166166
names.append(('contract', result.groups()[0]))
167167

168+
if char == 'i' and code[pos: pos + 9] == 'interface':
169+
result = re.match('^interface[^_$a-zA-Z]+([_$a-zA-Z][_$a-zA-Z0-9]*)', code[pos:])
170+
171+
if result:
172+
names.append(('contract', result.groups()[0]))
173+
174+
168175
if char == 'l' and code[pos: pos + 7] == 'library':
169176
result = re.match('^library[^_$a-zA-Z]+([_$a-zA-Z][_$a-zA-Z0-9]*)', code[pos:])
170177

0 commit comments

Comments
 (0)