Updated calls to get_line_from_offset to get_line_and_character_from_offset, as it was renamed.

pull/877/head
David Pokora 3 years ago
parent 58ae66abc3
commit 5b7a458e63
No known key found for this signature in database
GPG Key ID: 3CED48D1BB21BDD7
  1. 4
      slither/core/source_mapping/source_mapping.py
  2. 4
      slither/utils/source_mapping.py

@ -94,10 +94,10 @@ def _compute_line(
Not done in an efficient way
"""
start_line, starting_column = compilation_unit.core.crytic_compile.get_line_from_offset(
start_line, starting_column = compilation_unit.core.crytic_compile.get_line_and_character_from_offset(
filename, start
)
end_line, ending_column = compilation_unit.core.crytic_compile.get_line_from_offset(
end_line, ending_column = compilation_unit.core.crytic_compile.get_line_and_character_from_offset(
filename, start + length
)
return list(range(start_line, end_line + 1)), starting_column, ending_column

@ -27,11 +27,11 @@ def get_definition(target: SourceMapping, crytic_compile: CryticCompile) -> Sour
start_offset = txt.find(pattern) + 1 # remove the space
starting_line, starting_column = crytic_compile.get_line_from_offset(
starting_line, starting_column = crytic_compile.get_line_and_character_from_offset(
target.source_mapping.filename, target.source_mapping.start + start_offset
)
ending_line, ending_column = crytic_compile.get_line_from_offset(
ending_line, ending_column = crytic_compile.get_line_and_character_from_offset(
target.source_mapping.filename, target.source_mapping.start + start_offset + len(pattern)
)

Loading…
Cancel
Save