Improve filter_name + fix bug in inheritances

pull/17/head
Josselin 6 years ago
parent 51b7378759
commit 2699248e47
  1. 12
      slither/solcParsing/expressions/expressionParsing.py

@ -165,9 +165,9 @@ def filter_name(value):
value = value.replace('enum ', '') value = value.replace('enum ', '')
value = value.replace(' ref', '') value = value.replace(' ref', '')
value = value.replace(' pointer', '') value = value.replace(' pointer', '')
value = value.replace(' pure ', ' ') value = value.replace(' pure', '')
value = value.replace(' view ', ' ') value = value.replace(' view', '')
value = value.replace(' constant ', ' ') value = value.replace(' constant', '')
value = value.replace('function (', 'function(') value = value.replace('function (', 'function(')
value = value.replace('returns (', 'returns(') value = value.replace('returns (', 'returns(')
@ -315,7 +315,11 @@ def parse_expression(expression, caller_context):
member_expression = parse_expression(children[0], caller_context) member_expression = parse_expression(children[0], caller_context)
if str(member_expression) == 'super': if str(member_expression) == 'super':
super_name = parse_super_name(expression) super_name = parse_super_name(expression)
inheritances = caller_context.contract.inheritances if isinstance(caller_context, Contract):
inheritances = caller_context.inheritances
else:
assert isinstance(caller_context, Function)
inheritances = caller_context.contract.inheritances
var = None var = None
for father in inheritances: for father in inheritances:
try: try:

Loading…
Cancel
Save