Fix CI mypyc 1.16 failure (#4671)

This commit is contained in:
GiGaGon 2025-05-29 14:10:29 -07:00 committed by GitHub
parent 71e380aedf
commit e7bf7b4619
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -89,18 +89,12 @@ def backtrack(self) -> Iterator[None]:
self.parser.is_backtracking = is_backtracking
def add_token(self, tok_type: int, tok_val: str, raw: bool = False) -> None:
func: Callable[..., Any]
if raw:
func = self.parser._addtoken
else:
func = self.parser.addtoken
for ilabel in self.ilabels:
with self.switch_to(ilabel):
args = [tok_type, tok_val, self.context]
if raw:
args.insert(0, ilabel)
func(*args)
self.parser._addtoken(ilabel, tok_type, tok_val, self.context)
else:
self.parser.addtoken(tok_type, tok_val, self.context)
def determine_route(
self, value: Optional[str] = None, force: bool = False