From 1b67b62b9fdfd0f94fc1ff48cbe7a7b88b4500b1 Mon Sep 17 00:00:00 2001 From: SysCola Date: Wed, 8 Feb 2023 09:48:57 +0000 Subject: [PATCH] Fix a bug when tokenize an InfixExpression ends with a decimal number --- javalang/tokenizer.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/javalang/tokenizer.py b/javalang/tokenizer.py index d725292..869cfcc 100644 --- a/javalang/tokenizer.py +++ b/javalang/tokenizer.py @@ -367,7 +367,9 @@ def read_octal_integer(self): self.read_digits('01234567') def read_integer_or_float(self, c, c_next): - if c == '0' and c_next in 'xX': + if c_next is None: + return self.read_decimal_float_or_integer() + elif c == '0' and c_next in 'xX': return self.read_hex_integer_or_float() elif c == '0' and c_next in 'bB': self.read_bin_integer()