Commit f8bc0ea3 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Add an empty lookup table for type based methods, while I find out

how vcc_expr actually works...
parent 340abd04
...@@ -805,15 +805,38 @@ vcc_expr5(struct vcc *tl, struct expr **e, vcc_type_t fmt) ...@@ -805,15 +805,38 @@ vcc_expr5(struct vcc *tl, struct expr **e, vcc_type_t fmt)
* Expr5 * Expr5
*/ */
static const struct vcc_methods {
vcc_type_t type_from;
vcc_type_t type_to;
const char *method;
const char *impl;
} vcc_methods[] = {
//{ BACKEND, BOOL, "healthy", "VRT_Healthy(ctx, \v1, 0)" },
{ NULL, NULL, NULL, NULL}, // XXX: For Flexelint
{ NULL, NULL, NULL, NULL},
};
static void static void
vcc_expr4(struct vcc *tl, struct expr **e, vcc_type_t fmt) vcc_expr4(struct vcc *tl, struct expr **e, vcc_type_t fmt)
{ {
const struct vcc_methods *vm;
*e = NULL; *e = NULL;
vcc_expr5(tl, e, fmt); vcc_expr5(tl, e, fmt);
ERRCHK(tl);
AN(*e);
while (tl->t->tok == '.') { while (tl->t->tok == '.') {
vcc_NextToken(tl); vcc_NextToken(tl);
ExpectErr(tl, ID); ExpectErr(tl, ID);
for(vm = vcc_methods; vm->type_from != NULL; vm++) {
if (vm->type_from == (*e)->fmt &&
vcc_IdIs(tl->t, vm->method))
break;
}
if (vm->type_from == NULL) {
VSB_printf(tl->sb, "Unknown property "); VSB_printf(tl->sb, "Unknown property ");
vcc_ErrToken(tl, tl->t); vcc_ErrToken(tl, tl->t);
VSB_printf(tl->sb, VSB_printf(tl->sb,
...@@ -821,6 +844,9 @@ vcc_expr4(struct vcc *tl, struct expr **e, vcc_type_t fmt) ...@@ -821,6 +844,9 @@ vcc_expr4(struct vcc *tl, struct expr **e, vcc_type_t fmt)
vcc_ErrWhere(tl, tl->t); vcc_ErrWhere(tl, tl->t);
return; return;
} }
vcc_NextToken(tl);
*e = vcc_expr_edit(tl, vm->type_to, vm->impl, *e, NULL);
}
} }
/*-------------------------------------------------------------------- /*--------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment