Skip to content
Permalink
Browse files

Generalize more special cases in the set action

At this point we should probably consider renaming the arithmetic table
to something also more general.
  • Loading branch information...
Dridi committed Nov 5, 2019
1 parent ee29af9 commit ade0ddc99b54446f672ea80a06751b1acb73e1f6
Showing with 4 additions and 5 deletions.
  1. +4 −5 lib/libvcc/vcc_action.c
@@ -80,7 +80,10 @@ static const struct arith {
{ DURATION, T_DIV, REAL, "\v / " },
{ DURATION, '=', DURATION },
{ DURATION, 0, DURATION },
{ STRING, T_INCR, STRING, "\v,\n" },
{ STRING, T_INCR, STRING_LIST, "\v,\n" },
{ STRING, '=', STRING_LIST },
{ HEADER, '=', STRING_LIST },
{ BODY, '=', STRING_LIST },
{ VOID, '=', VOID }
};

@@ -139,10 +142,6 @@ vcc_act_set(struct vcc *tl, struct token *t, struct symbol *sym)
if (ap->type == VOID)
SkipToken(tl, ap->oper);

if (type == HEADER || type == STRING || type == BODY) {
type = STRING_LIST;
}

Fb(tl, 1, "%s\n", sym->lname);
tl->indent += INDENT;
vcc_arith_expr(tl, sym, ap);

0 comments on commit ade0ddc

Please sign in to comment.
You can’t perform that action at this time.