diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2022-11-29 16:07:17 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2022-11-29 16:07:17 -0500 |
commit | 6961c9a4c2fe8612db222bfd1693e38f7a43a2cd (patch) | |
tree | c6e9eec1d0bdeaa6906e33c810f4228da8ca7c50 /src/diag.c | |
parent | ba3ea2a9148da4c7ab0718e5ec077620ee29e88d (diff) | |
download | bfs-6961c9a4c2fe8612db222bfd1693e38f7a43a2cd.tar.xz |
expr: Remove the synthetic flag
Only diagnostics cares about this, and we can just check if the pointers
are equal.
Diffstat (limited to 'src/diag.c')
-rw-r--r-- | src/diag.c | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -114,12 +114,14 @@ static bool highlight_expr_recursive(const struct bfs_ctx *ctx, const struct bfs bool ret = false; - if (!expr->synthetic) { - size_t i = expr->argv - ctx->argv; - for (size_t j = 0; j < expr->argc; ++j) { - assert(i + j < ctx->argc); - args[i + j] = true; - ret = true; + for (size_t i = 0; i < ctx->argc; ++i) { + if (&ctx->argv[i] == expr->argv) { + for (size_t j = 0; j < expr->argc; ++j) { + assert(i + j < ctx->argc); + args[i + j] = true; + ret = true; + } + break; } } |