File tree 2 files changed +8
-1
lines changed
2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -2002,7 +2002,7 @@ def term(self):
2002
2002
# Convert to decimal and then to integer with correct sign
2003
2003
# Preprocessor always uses 64-bit arithmetic!
2004
2004
int_value = int (value , base )
2005
- if suffix and "u" in suffix :
2005
+ if suffix and "u" in suffix . lower () :
2006
2006
return np .uint64 (int_value )
2007
2007
else :
2008
2008
return np .int64 (int_value )
Original file line number Diff line number Diff line change 5
5
import unittest
6
6
from pathlib import Path
7
7
8
+ import numpy as np
9
+
8
10
from codebasin import CodeBase , finder , preprocessor
9
11
10
12
@@ -60,6 +62,11 @@ def test_strings(self):
60
62
)
61
63
self .assertEqual (tokens [0 ].token , expected .token )
62
64
65
+ def test_long_constants (self ):
66
+ tokens = preprocessor .Lexer ("0xFFFFFFFFFFFFFFFFULL" ).tokenize ()
67
+ term = preprocessor .ExpressionEvaluator (tokens ).term ()
68
+ self .assertEqual (term , np .uint64 (int ("0xFFFFFFFFFFFFFFFF" , 16 )))
69
+
63
70
64
71
if __name__ == "__main__" :
65
72
unittest .main ()
You can’t perform that action at this time.
0 commit comments