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

solidity_names() recognizes interface #737

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions ethereum/_solidity.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,13 @@ def solidity_names(code): # pylint: disable=too-many-branches
if result:
names.append(('contract', result.groups()[0]))

if char == 'i' and code[pos: pos + 9] == 'interface':
result = re.match('^interface[^_$a-zA-Z]+([_$a-zA-Z][_$a-zA-Z0-9]*)', code[pos:])

if result:
names.append(('contract', result.groups()[0]))


if char == 'l' and code[pos: pos + 7] == 'library':
result = re.match('^library[^_$a-zA-Z]+([_$a-zA-Z][_$a-zA-Z0-9]*)', code[pos:])

Expand Down