[master] ade0ddc99 Generalize more special cases in the set action

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Mon Dec 2 12:14:07 UTC 2019


commit ade0ddc99b54446f672ea80a06751b1acb73e1f6
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Tue Nov 5 18:52:10 2019 +0100

    Generalize more special cases in the set action
    
    At this point we should probably consider renaming the arithmetic table
    to something also more general.

diff --git a/lib/libvcc/vcc_action.c b/lib/libvcc/vcc_action.c
index 9d7f621cc..c099eaa33 100644
--- a/lib/libvcc/vcc_action.c
+++ b/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);


More information about the varnish-commit mailing list