Coverage for call_graph/parsers/base.py: 80%

1"""Base class for call graph parsers."""

2

3 from __future__ import annotations

4

5 from abc import ABC, abstractmethod

6 from typing import TYPE_CHECKING

7

8 if TYPE_CHECKING:

9 from tree_sitter import Node

10

11

12 class CallGraphParser(ABC):

13 @abstractmethod

14 def extract_function_definitions(self, root, source, filepath):

15 pass

16

17 @abstractmethod

18 def extract_calls(self, root, source, filepath, all_functions):

19 pass