Don't handle cases like -1U as Python constants
This commit is contained in:
parent
80ffb169c1
commit
2425c8d6d8
1 changed files with 6 additions and 2 deletions
|
|
@ -2047,14 +2047,18 @@ public:
|
||||||
if (errno == ERANGE || end == s)
|
if (errno == ERANGE || end == s)
|
||||||
return NIL;
|
return NIL;
|
||||||
if (*end != '\0') {
|
if (*end != '\0') {
|
||||||
// If there is a suffix after the number, we can safely ignore any
|
// If there is a suffix after the number, we can safely ignore "l"
|
||||||
// combination of "l" and "u", but not anything else.
|
// and (provided the number is unsigned) "u", and also combinations of
|
||||||
|
// these, but not anything else.
|
||||||
for (char *p = end; *p != '\0'; ++p) {
|
for (char *p = end; *p != '\0'; ++p) {
|
||||||
switch (*p) {
|
switch (*p) {
|
||||||
case 'l':
|
case 'l':
|
||||||
case 'L':
|
case 'L':
|
||||||
|
break;
|
||||||
case 'u':
|
case 'u':
|
||||||
case 'U':
|
case 'U':
|
||||||
|
if (value < 0)
|
||||||
|
return NIL;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return NIL;
|
return NIL;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue