diff --git a/lib/kaskara/spoon/analyser.py b/lib/kaskara/spoon/analyser.py index c79310a..250220a 100644 --- a/lib/kaskara/spoon/analyser.py +++ b/lib/kaskara/spoon/analyser.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- __all__ = ('SpoonAnalyser',) -from typing import Any, Iterator, Mapping, Sequence +from typing import Any, Iterator, List, Mapping, Sequence import contextlib import json import os @@ -116,7 +116,7 @@ def _load_functions_from_dict(self, def _load_loops_from_dict(self, dict_: Sequence[Mapping[str, Any]] - ) -> ProgramFunctions: + ) -> ProgramLoops: """Loads the loops database from a given dictionary.""" logger.debug('parsing loop database') loop_bodies: List[FileLocationRange] = [] diff --git a/lib/kaskara/util.py b/lib/kaskara/util.py index 3aab62f..fa31849 100644 --- a/lib/kaskara/util.py +++ b/lib/kaskara/util.py @@ -11,24 +11,25 @@ def abs_to_rel_filename(prefix: str, filename: str) -> str: return filename[len(prefix):] -def abs_to_rel_floc(prefix: str, l: FileLocation) -> FileLocation: - return FileLocation(abs_to_rel_filename(prefix, l.filename), - l.location) +def abs_to_rel_floc(prefix: str, location: FileLocation) -> FileLocation: + return FileLocation(abs_to_rel_filename(prefix, location.filename), + location.location) -def rel_to_abs_floc(prefix: str, l: FileLocation) -> FileLocation: - return FileLocation(os.path.join(prefix, l.filename), l.location) +def rel_to_abs_floc(prefix: str, location: FileLocation) -> FileLocation: + return FileLocation(os.path.join(prefix, location.filename), + location.location) def abs_to_rel_flocrange(prefix: str, - l: FileLocationRange + location: FileLocationRange ) -> FileLocationRange: - return FileLocationRange(abs_to_rel_filename(prefix, l.filename), - l.location_range) + return FileLocationRange(abs_to_rel_filename(prefix, location.filename), + location.location_range) def rel_to_abs_flocrange(prefix: str, - l: FileLocationRange + location: FileLocationRange ) -> FileLocationRange: - return FileLocationRange(os.path.join(prefix, l.filename), - l.location_range) + return FileLocationRange(os.path.join(prefix, location.filename), + location.location_range)