mirror of
https://github.com/python/cpython.git
synced 2025-09-22 08:23:36 +00:00
Comment out 'abort()' call.
Changed comparison operators.
This commit is contained in:
parent
2b9d6e2008
commit
01cfd447d0
1 changed files with 7 additions and 6 deletions
|
@ -245,8 +245,10 @@ com_addbyte(c, byte)
|
||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
if (byte < 0 || byte > 255) {
|
if (byte < 0 || byte > 255) {
|
||||||
|
/*
|
||||||
fprintf(stderr, "XXX compiling bad byte: %d\n", byte);
|
fprintf(stderr, "XXX compiling bad byte: %d\n", byte);
|
||||||
abort();
|
abort();
|
||||||
|
*/
|
||||||
err_setstr(SystemError, "com_addbyte: byte out of range");
|
err_setstr(SystemError, "com_addbyte: byte out of range");
|
||||||
c->c_errors++;
|
c->c_errors++;
|
||||||
}
|
}
|
||||||
|
@ -758,14 +760,18 @@ cmp_type(n)
|
||||||
node *n;
|
node *n;
|
||||||
{
|
{
|
||||||
REQ(n, comp_op);
|
REQ(n, comp_op);
|
||||||
/* comp_op: '<' | '>' | '=' | '>' '=' | '<' '=' | '<' '>'
|
/* comp_op: '<' | '>' | '=' | '>=' | '<=' | '<>' | '!=' | '=='
|
||||||
| 'in' | 'not' 'in' | 'is' | 'is' not' */
|
| 'in' | 'not' 'in' | 'is' | 'is' not' */
|
||||||
if (NCH(n) == 1) {
|
if (NCH(n) == 1) {
|
||||||
n = CHILD(n, 0);
|
n = CHILD(n, 0);
|
||||||
switch (TYPE(n)) {
|
switch (TYPE(n)) {
|
||||||
case LESS: return LT;
|
case LESS: return LT;
|
||||||
case GREATER: return GT;
|
case GREATER: return GT;
|
||||||
|
case EQEQUAL: /* == */
|
||||||
case EQUAL: return EQ;
|
case EQUAL: return EQ;
|
||||||
|
case LESSEQUAL: return LE;
|
||||||
|
case GREATEREQUAL: return GE;
|
||||||
|
case NOTEQUAL: return NE; /* <> or != */
|
||||||
case NAME: if (strcmp(STR(n), "in") == 0) return IN;
|
case NAME: if (strcmp(STR(n), "in") == 0) return IN;
|
||||||
if (strcmp(STR(n), "is") == 0) return IS;
|
if (strcmp(STR(n), "is") == 0) return IS;
|
||||||
}
|
}
|
||||||
|
@ -773,11 +779,6 @@ cmp_type(n)
|
||||||
else if (NCH(n) == 2) {
|
else if (NCH(n) == 2) {
|
||||||
int t2 = TYPE(CHILD(n, 1));
|
int t2 = TYPE(CHILD(n, 1));
|
||||||
switch (TYPE(CHILD(n, 0))) {
|
switch (TYPE(CHILD(n, 0))) {
|
||||||
case LESS: if (t2 == EQUAL) return LE;
|
|
||||||
if (t2 == GREATER) return NE;
|
|
||||||
break;
|
|
||||||
case GREATER: if (t2 == EQUAL) return GE;
|
|
||||||
break;
|
|
||||||
case NAME: if (strcmp(STR(CHILD(n, 1)), "in") == 0)
|
case NAME: if (strcmp(STR(CHILD(n, 1)), "in") == 0)
|
||||||
return NOT_IN;
|
return NOT_IN;
|
||||||
if (strcmp(STR(CHILD(n, 0)), "is") == 0)
|
if (strcmp(STR(CHILD(n, 0)), "is") == 0)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue