summaryrefslogtreecommitdiffhomepage
path: root/lib.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-10-05 12:32:42 +0200
committerJo-Philipp Wich <jo@mein.io>2020-10-05 13:03:08 +0200
commitb1391241a116d794a091c97bbb63b485f6514fb7 (patch)
tree8a95edba3ea58aacbb0db0a76f8131b387660544 /lib.c
parent03b9ad307bd4313adc974982fc008f4c58337c11 (diff)
ast: add helpers to set error token bits
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib.c b/lib.c
index 603deb8..c46745e 100644
--- a/lib.c
+++ b/lib.c
@@ -177,11 +177,11 @@ ut_format_error(struct ut_state *state, const char *expr)
sprintf_append(&msg, &msglen, "Syntax error: Unexpected token\n");
for (i = 0, max_i = 0; i < sizeof(state->error.info.tokens) * 8; i++)
- if ((state->error.info.tokens[i / 64] & ((unsigned)1 << (i % 64))) && tokennames[i])
+ if (ut_is_error_token(state, i) && tokennames[i])
max_i = i;
for (i = 0; i < sizeof(state->error.info.tokens) * 8; i++) {
- if ((state->error.info.tokens[i / 64] & ((unsigned)1 << (i % 64))) && tokennames[i]) {
+ if (ut_is_error_token(state, i) && tokennames[i]) {
if (first) {
sprintf_append(&msg, &msglen, "Expecting %s", tokennames[i]);
first = false;