Browse Source

Merge pull request #790 from unbrice/types

type stubs: A consistent type for `Token.value`
tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.11.2
Erez Shinan 3 years ago
committed by GitHub
parent
commit
0f2f3d71b5
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      lark-stubs/lexer.pyi

+ 3
- 3
lark-stubs/lexer.pyi View File

@@ -81,7 +81,7 @@ class TerminalDef:
class Token(str): class Token(str):
type: str type: str
pos_in_stream: int pos_in_stream: int
value: str
value: Any
line: int line: int
column: int column: int
end_line: int end_line: int
@@ -91,11 +91,11 @@ class Token(str):
def __init__(self, type_: str, value: Any, pos_in_stream: int = None, line: int = None, column: int = None, end_line: int = None, end_column: int = None, end_pos: int = None): def __init__(self, type_: str, value: Any, pos_in_stream: int = None, line: int = None, column: int = None, end_line: int = None, end_column: int = None, end_pos: int = None):
... ...


def update(self, type_: Optional[str] = None, value: Optional[str] = None) -> Token:
def update(self, type_: Optional[str] = None, value: Optional[Any] = None) -> Token:
... ...


@classmethod @classmethod
def new_borrow_pos(cls: Type[_T], type_: str, value: str, borrow_t: Token) -> _T:
def new_borrow_pos(cls: Type[_T], type_: str, value: Any, borrow_t: Token) -> _T:
... ...






Loading…
Cancel
Save