Skip to content

Commit

Permalink
add type annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
MkuuWaUjinga committed Jul 23, 2023
1 parent a1c2dd8 commit 3535c55
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gpt_migrate/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
import typer
from yaspin import yaspin
from pathlib import Path
from tree_sitter import Language, Parser
from tree_sitter import Language, Parser, Node
from collections.abc import Iterator

from config import EXTENSION_TO_TREE_SITTER_GRAMMAR_REPO, EXTENSION_TO_LANGUAGE

def decompose_file(file_path: str):
def decompose_file(file_path: str) -> Iterator[Node]:
# Do a first-level parse tree decomposition of the file at file_path
with yaspin(text="Decomposing file", spinner="dots") as spinner:
repo_url = EXTENSION_TO_TREE_SITTER_GRAMMAR_REPO.get(file_path.split('.')[-1])
Expand Down

0 comments on commit 3535c55

Please sign in to comment.