1# -*- coding: utf-8 -*- 2 3from typing import Tuple, List, Iterator, Optional 4from abc import ABC, abstractmethod 5from .lexer import Token 6from .lark import PostLex 7 8 9class Indenter(PostLex, ABC): 10 paren_level: Optional[int] 11 indent_level: Optional[List[int]] 12 13 def __init__(self) -> None: 14 ... 15 16 def handle_NL(self, token: Token) -> Iterator[Token]: 17 ... 18 19 @property 20 @abstractmethod 21 def NL_type(self) -> str: 22 ... 23 24 @property 25 @abstractmethod 26 def OPEN_PAREN_types(self) -> List[str]: 27 ... 28 29 @property 30 @abstractmethod 31 def CLOSE_PAREN_types(self) -> List[str]: 32 ... 33 34 @property 35 @abstractmethod 36 def INDENT_type(self) -> str: 37 ... 38 39 @property 40 @abstractmethod 41 def DEDENT_type(self) -> str: 42 ... 43 44 @property 45 @abstractmethod 46 def tab_len(self) -> int: 47 ... 48