Skip to content

Commit 5271ee8

Browse files
committed
Fix parsing of floats without '.'
For example "1e+10"
1 parent 0ad1e68 commit 5271ee8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tracematch.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -598,11 +598,12 @@ def _parse_value(self):
598598
return self.handleString(value)
599599
elif self.match(NUMBER):
600600
token = self.consume()
601-
if '.' in token.text:
601+
try:
602+
value = int(token.text)
603+
except ValueError:
602604
value = float(token.text)
603605
return self.handleFloat(value)
604606
else:
605-
value = int(token.text)
606607
return self.handleInt(value)
607608
elif self.match(HEXNUM):
608609
token = self.consume()

0 commit comments

Comments
 (0)