summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1991-10-20 20:12:38 (GMT)
committerGuido van Rossum <guido@python.org>1991-10-20 20:12:38 (GMT)
commit01cfd447d080039e8844e8e894c4bc042de942f3 (patch)
tree7bd9787dd26e35b8e6e68b204880c25e90b8568d /Python/compile.c
parent2b9d6e200856a547f5a1f409ca439737dc132abb (diff)
downloadcpython-01cfd447d080039e8844e8e894c4bc042de942f3.zip
cpython-01cfd447d080039e8844e8e894c4bc042de942f3.tar.gz
cpython-01cfd447d080039e8844e8e894c4bc042de942f3.tar.bz2
Comment out 'abort()' call.
Changed comparison operators.
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 8366333..5939196 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -245,8 +245,10 @@ com_addbyte(c, byte)
{
int len;
if (byte < 0 || byte > 255) {
+ /*
fprintf(stderr, "XXX compiling bad byte: %d\n", byte);
abort();
+ */
err_setstr(SystemError, "com_addbyte: byte out of range");
c->c_errors++;
}
@@ -758,14 +760,18 @@ cmp_type(n)
node *n;
{
REQ(n, comp_op);
- /* comp_op: '<' | '>' | '=' | '>' '=' | '<' '=' | '<' '>'
+ /* comp_op: '<' | '>' | '=' | '>=' | '<=' | '<>' | '!=' | '=='
| 'in' | 'not' 'in' | 'is' | 'is' not' */
if (NCH(n) == 1) {
n = CHILD(n, 0);
switch (TYPE(n)) {
case LESS: return LT;
case GREATER: return GT;
+ case EQEQUAL: /* == */
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;
if (strcmp(STR(n), "is") == 0) return IS;
}
@@ -773,11 +779,6 @@ cmp_type(n)
else if (NCH(n) == 2) {
int t2 = TYPE(CHILD(n, 1));
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)
return NOT_IN;
if (strcmp(STR(CHILD(n, 0)), "is") == 0)