From f11ca39160abd12a501e3cceae1439be3de0867b Mon Sep 17 00:00:00 2001 From: Alex Hall Date: Sun, 24 Nov 2024 15:34:04 +0200 Subject: [PATCH] restore visit_num just in case --- asttokens/mark_tokens.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/asttokens/mark_tokens.py b/asttokens/mark_tokens.py index bfcea17..f866b1c 100644 --- a/asttokens/mark_tokens.py +++ b/asttokens/mark_tokens.py @@ -398,6 +398,10 @@ def handle_num(self, first_token = self._code.prev_token(first_token) return (first_token, last_token) + def visit_num(self, node, first_token, last_token): + # type: (AstNode, util.Token, util.Token) -> Tuple[util.Token, util.Token] + return self.handle_num(node, cast(ast.Num, node).n, first_token, last_token) + def visit_const(self, node, first_token, last_token): # type: (AstNode, util.Token, util.Token) -> Tuple[util.Token, util.Token] assert isinstance(node, ast.Constant) or isinstance(node, nc.Const)