Make mypy happy

master
Salvo 'LtWorf' Tomaselli 2020-08-12 15:26:56 +07:00
parent be932abcaa
commit f7f51b3413
No known key found for this signature in database
GPG Key ID: B3A7CF0C801886CF
1 changed files with 4 additions and 4 deletions

@ -309,7 +309,7 @@ def parse_tokens(expression: List[Union[list, str]]) -> Node:
if len(expression[i + 1:]) == 0: if len(expression[i + 1:]) == 0:
raise ParserException( raise ParserException(
f'Expected right operand for {expression[i]!r}') f'Expected right operand for {expression[i]!r}')
return Binary(expression[i], parse_tokens(expression[:i]), parse_tokens(expression[i + 1:])) return Binary(expression[i], parse_tokens(expression[:i]), parse_tokens(expression[i + 1:])) # type: ignore
'''Searches for unary operators, parsing from right to left''' '''Searches for unary operators, parsing from right to left'''
for i in range(len(expression) - 1, -1, -1): for i in range(len(expression) - 1, -1, -1):
if expression[i] in u_operators: # Unary operator if expression[i] in u_operators: # Unary operator
@ -318,9 +318,9 @@ def parse_tokens(expression: List[Union[list, str]]) -> Node:
f'Expected more tokens in {expression[i]!r}') f'Expected more tokens in {expression[i]!r}')
return Unary( return Unary(
expression[i], expression[i], # type: ignore
prop=expression[1 + i].strip(), prop=expression[1 + i].strip(), # type: ignore
child=parse_tokens(expression[2 + i]) child=parse_tokens(expression[2 + i]) # type: ignore
) )
raise ParserException(f'Parse error on {expression!r}') raise ParserException(f'Parse error on {expression!r}')