(
parser: Lark, filenames: list[pathlib.Path]
)
| 42 | |
| 43 | |
| 44 | def file_tree_iterator( |
| 45 | parser: Lark, filenames: list[pathlib.Path] |
| 46 | ) -> typing.Generator[tuple[pathlib.Path, Tree], None, None]: |
| 47 | for filename in filenames: |
| 48 | with open(filename, "rt") as input_file: |
| 49 | input_content = input_file.read() |
| 50 | tree = parser.parse(input_content) |
| 51 | yield filename, tree |
| 52 | |
| 53 | |
| 54 | def walk_tree( |