* Transform the top level "||" tokens into newlines and prepend each * line with a minus. This makes expressions much easier to read. * Suitable for reverse dependency expressions. */
| 1278 | * Suitable for reverse dependency expressions. |
| 1279 | */ |
| 1280 | static void expr_print_revdep(struct expr *e, |
| 1281 | void (*fn)(void *, struct symbol *, const char *), |
| 1282 | void *data, tristate pr_type, const char **title) |
| 1283 | { |
| 1284 | if (e->type == E_OR) { |
| 1285 | expr_print_revdep(e->left.expr, fn, data, pr_type, title); |
| 1286 | expr_print_revdep(e->right.expr, fn, data, pr_type, title); |
| 1287 | } else if (expr_calc_value(e) == pr_type) { |
| 1288 | if (*title) { |
| 1289 | fn(data, NULL, *title); |
| 1290 | *title = NULL; |
| 1291 | } |
| 1292 | |
| 1293 | fn(data, NULL, " - "); |
| 1294 | expr_print(e, fn, data, E_NONE); |
| 1295 | fn(data, NULL, "\n"); |
| 1296 | } |
| 1297 | } |
| 1298 | |
| 1299 | void expr_gstr_print_revdep(struct expr *e, struct gstr *gs, |
| 1300 | tristate pr_type, const char *title) |
no test coverage detected