This repo contains code to mirror other repos. It also contains the code that is getting mirrored.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
777 B

  1. # -*- coding: utf-8 -*-
  2. from typing import List, Callable, Iterator, Union, Optional
  3. from .lexer import Token
  4. class Tree:
  5. data: str
  6. children: List[Union[str, Tree]]
  7. meta: Token
  8. def __init__(self, data: str, children: List[Tree], meta: Optional[Token] = None):
  9. ...
  10. def pretty(self, indent_str: str = ...) -> str:
  11. ...
  12. def find_pred(self, pred: Callable[[Tree], bool]) -> Iterator[Tree]:
  13. ...
  14. def find_data(self, data: str) -> Iterator[Tree]:
  15. ...
  16. def iter_subtrees(self) -> Iterator[Tree]:
  17. ...
  18. def iter_subtrees_topdown(self) -> Iterator[Tree]:
  19. ...
  20. def __eq__(self, other: object) -> bool:
  21. ...
  22. def __hash__(self) -> int:
  23. ...
  24. class SlottedTree(Tree):
  25. pass