mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-31 05:00:35 +00:00
make print_expr's output readable by mere mortals
This commit is contained in:
parent
d2c266775c
commit
a47a4d8038
1 changed files with 10 additions and 10 deletions
|
@ -181,6 +181,14 @@ get_op_string (int op)
|
||||||
return "(";
|
return "(";
|
||||||
case '.':
|
case '.':
|
||||||
return ".";
|
return ".";
|
||||||
|
case 'i':
|
||||||
|
return "<if>";
|
||||||
|
case 'n':
|
||||||
|
return "<ifnot>";
|
||||||
|
case 'g':
|
||||||
|
return "<goto>";
|
||||||
|
case 'r':
|
||||||
|
return "<return>";
|
||||||
default:
|
default:
|
||||||
return "unknown";
|
return "unknown";
|
||||||
}
|
}
|
||||||
|
@ -305,20 +313,12 @@ print_expr (expr_t *e)
|
||||||
printf (")");
|
printf (")");
|
||||||
} else {
|
} else {
|
||||||
print_expr (e->e.expr.e2);
|
print_expr (e->e.expr.e2);
|
||||||
if (isprint (e->e.expr.op)) {
|
printf (" %s", get_op_string (e->e.expr.op));
|
||||||
printf (" %c", e->e.expr.op);
|
|
||||||
} else {
|
|
||||||
printf (" %d", e->e.expr.op);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ex_uexpr:
|
case ex_uexpr:
|
||||||
print_expr (e->e.expr.e1);
|
print_expr (e->e.expr.e1);
|
||||||
if (isprint (e->e.expr.op)) {
|
printf (" u%s", get_op_string (e->e.expr.op));
|
||||||
printf (" u%c", e->e.expr.op);
|
|
||||||
} else {
|
|
||||||
printf (" u%d", e->e.expr.op);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case ex_def:
|
case ex_def:
|
||||||
printf ("%s", e->e.def->name);
|
printf ("%s", e->e.def->name);
|
||||||
|
|
Loading…
Reference in a new issue