|
| 1 | +from typing import Optional, List, Iterator |
| 2 | + |
| 3 | + |
| 4 | +class Language: |
| 5 | + def __init__(self, path: str, name: str): ... |
| 6 | + |
| 7 | + def field_id_for_name(self, name: str) -> int: ... |
| 8 | + def query(self, source) -> Query: ... |
| 9 | + |
| 10 | + |
| 11 | +class Parser: |
| 12 | + def set_language(self, lang: Language) -> None: ... |
| 13 | + def parse(self, src: bytes) -> Tree: ... |
| 14 | + |
| 15 | + |
| 16 | +class Node: |
| 17 | + type: str |
| 18 | + is_named: bool |
| 19 | + is_missing: bool |
| 20 | + has_changes: bool |
| 21 | + has_error: bool |
| 22 | + start_byte: int |
| 23 | + end_byte: int |
| 24 | + start_point: Point |
| 25 | + end_point: Point |
| 26 | + children: List[Node] |
| 27 | + child_count: int |
| 28 | + named_child_count: int |
| 29 | + next_sibling: Optional[Node] |
| 30 | + prev_sibling: Optional[Node] |
| 31 | + next_named_sibling: Optional[Node] |
| 32 | + prev_named_sibling: Optional[Node] |
| 33 | + parent: Optional[Node] |
| 34 | + |
| 35 | + def walk(self) -> TreeCursor: ... |
| 36 | + def sexp(self) -> str: ... |
| 37 | + def child_by_field_id(self, id: int) -> Optional[Node]: ... |
| 38 | + def child_by_field_name(self, name: str) -> Optional[Node]: ... |
| 39 | + def children_by_field_id(self, id: int) -> Iterator[Node]: ... |
| 40 | + def children_by_field_name(self, name: str) -> Iterator[Node]: ... |
| 41 | + |
| 42 | + |
| 43 | +class Tree: |
| 44 | + root_node: Node |
| 45 | + walk(self): TreeCursor |
| 46 | + |
| 47 | + |
| 48 | +class TreeCursor: |
| 49 | + node: Node |
| 50 | + |
| 51 | + def current_field_name(self) -> str: ... |
| 52 | + def goto_parent(self) -> bool: ... |
| 53 | + def goto_first_child(self) -> bool: ... |
| 54 | + def goto_next_sibling(self) -> bool: ... |
| 55 | + |
| 56 | + |
| 57 | +class Query: |
| 58 | + def captures(self, node: Node) -> List[Tuple[Node, str]] |
0 commit comments