summaryrefslogtreecommitdiffstats
path: root/src/diag.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2022-11-29 16:07:17 -0500
committerTavian Barnes <tavianator@tavianator.com>2022-11-29 16:07:17 -0500
commit6961c9a4c2fe8612db222bfd1693e38f7a43a2cd (patch)
treec6e9eec1d0bdeaa6906e33c810f4228da8ca7c50 /src/diag.c
parentba3ea2a9148da4c7ab0718e5ec077620ee29e88d (diff)
downloadbfs-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.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/diag.c b/src/diag.c
index 80d988f..c5e139e 100644
--- a/src/diag.c
+++ b/src/diag.c
@@ -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;
}
}