Commit c64d04de authored by Guido van Rossum's avatar Guido van Rossum

Implemented 2-character operators.

parent 2df7bcca
...@@ -212,8 +212,7 @@ translabel(g, lb) ...@@ -212,8 +212,7 @@ translabel(g, lb)
if (p) if (p)
*p = '\0'; *p = '\0';
} }
else { else if (lb->lb_str[2] == lb->lb_str[0]) {
if (lb->lb_str[2] == lb->lb_str[0]) {
int type = (int) tok_1char(lb->lb_str[1]); int type = (int) tok_1char(lb->lb_str[1]);
if (type != OP) { if (type != OP) {
lb->lb_type = type; lb->lb_type = type;
...@@ -223,10 +222,20 @@ translabel(g, lb) ...@@ -223,10 +222,20 @@ translabel(g, lb)
printf("Unknown OP label %s\n", printf("Unknown OP label %s\n",
lb->lb_str); lb->lb_str);
} }
else if (lb->lb_str[2] && lb->lb_str[3] == lb->lb_str[0]) {
int type = (int) tok_2char(lb->lb_str[1],
lb->lb_str[2]);
if (type != OP) {
lb->lb_type = type;
lb->lb_str = NULL;
}
else else
printf("Can't translate STRING label %s\n", printf("Unknown OP label %s\n",
lb->lb_str); lb->lb_str);
} }
else
printf("Can't translate STRING label %s\n",
lb->lb_str);
} }
else else
printf("Can't translate label '%s'\n", labelrepr(lb)); printf("Can't translate label '%s'\n", labelrepr(lb));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment