Changes parameters_src and returns_src to SourceMapping objects instead of raw source text.

pull/237/head
rajeevgopalakrishna 6 years ago
parent cf20da7bd5
commit 1cbdd0f33a
  1. 7
      slither/solc_parsing/declarations/function.py

@ -27,6 +27,7 @@ from slither.utils.utils import unroll
from slither.visitors.expression.export_values import ExportValues from slither.visitors.expression.export_values import ExportValues
from slither.visitors.expression.has_conditional import HasConditional from slither.visitors.expression.has_conditional import HasConditional
from slither.solc_parsing.exceptions import ParsingError from slither.solc_parsing.exceptions import ParsingError
from slither.core.source_mapping.source_mapping import SourceMapping
logger = logging.getLogger("FunctionSolc") logger = logging.getLogger("FunctionSolc")
@ -835,7 +836,8 @@ class FunctionSolc(Function):
def _parse_params(self, params): def _parse_params(self, params):
assert params[self.get_key()] == 'ParameterList' assert params[self.get_key()] == 'ParameterList'
self.parameters_src = params['src'] self.parameters_src = SourceMapping()
self.parameters_src.set_offset(params['src'], self.contract.slither)
if self.is_compact_ast: if self.is_compact_ast:
params = params['parameters'] params = params['parameters']
@ -862,7 +864,8 @@ class FunctionSolc(Function):
assert returns[self.get_key()] == 'ParameterList' assert returns[self.get_key()] == 'ParameterList'
self.returns_src = returns['src'] self.returns_src = SourceMapping()
self.returns_src.set_offset(returns['src'], self.contract.slither)
if self.is_compact_ast: if self.is_compact_ast:
returns = returns['parameters'] returns = returns['parameters']

Loading…
Cancel
Save