r1299 - trunk/varnish-cache/lib/libvcl

phk at projects.linpro.no phk at projects.linpro.no
Sun Apr 1 11:17:52 CEST 2007


Author: phk
Date: 2007-04-01 11:17:52 +0200 (Sun, 01 Apr 2007)
New Revision: 1299

Modified:
   trunk/varnish-cache/lib/libvcl/vcc_action.c
   trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c
   trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl
   trunk/varnish-cache/lib/libvcl/vcc_token_defs.h
Log:
Eliminate the "proof of concept" tokens that were never implemented
at runtime.


Modified: trunk/varnish-cache/lib/libvcl/vcc_action.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_action.c	2007-04-01 09:07:44 UTC (rev 1298)
+++ trunk/varnish-cache/lib/libvcl/vcc_action.c	2007-04-01 09:17:52 UTC (rev 1299)
@@ -56,19 +56,6 @@
 
 /*--------------------------------------------------------------------*/
 
-#define L(tl, foo)	do {	\
-	tl->indent += INDENT;	\
-	foo;			\
-	tl->indent -= INDENT;	\
-} while (0)
-
-#define C(tl, sep)	do {					\
-	Fb(tl, 1, "VRT_count(sp, %u)%s\n", ++tl->cnt, sep);	\
-	tl->t->cnt = tl->cnt; 					\
-} while (0)
-
-/*--------------------------------------------------------------------*/
-
 #define VCL_RET_MAC(l,u,b,i) 				\
 static void						\
 parse_##l(struct tokenlist *tl)				\
@@ -237,7 +224,6 @@
 	{ NULL,		NULL }
 };
 
-
 void
 vcc_ParseAction(struct tokenlist *tl)
 {
@@ -253,30 +239,6 @@
 			}
 		}
 	}
-	vcc_NextToken(tl);
-	switch (at->tok) {
-	case T_NO_NEW_CACHE:
-		Fb(tl, 1, "VCL_no_new_cache(sp);\n");
-		return;
-	case T_NO_CACHE:
-		Fb(tl, 1, "VCL_no_cache(sp);\n");
-		return;
-	case T_SWITCH_CONFIG:
-		ExpectErr(tl, ID);
-		Fb(tl, 1, "VCL_switch_config(\"%.*s\");\n", PF(tl->t));
-		vcc_NextToken(tl);
-		return;
-	case T_REWRITE:
-		ExpectErr(tl, CSTR);
-		Fb(tl, 1, "VCL_rewrite(%.*s", PF(tl->t));
-		vcc_NextToken(tl);
-		ExpectErr(tl, CSTR);
-		Fb(tl, 0, ", %.*s);\n", PF(tl->t));
-		vcc_NextToken(tl);
-		return;
-	default:
-		vsb_printf(tl->sb, "Expected action, 'if' or '}'\n");
-		vcc_ErrWhere(tl, at);
-		return;
-	}
+	vsb_printf(tl->sb, "Expected action, 'if' or '}'\n");
+	vcc_ErrWhere(tl, at);
 }

Modified: trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c	2007-04-01 09:07:44 UTC (rev 1298)
+++ trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c	2007-04-01 09:17:52 UTC (rev 1299)
@@ -191,13 +191,6 @@
 			return (T_ELSE);
 		}
 		return (0);
-	case 'f':
-		if (p[0] == 'f' && p[1] == 'u' && p[2] == 'n' && 
-		    p[3] == 'c' && !isvar(p[4])) {
-			*q = p + 4;
-			return (T_FUNC);
-		}
-		return (0);
 	case 'i':
 		if (p[0] == 'i' && p[1] == 'n' && p[2] == 'c' && 
 		    p[3] == 'l' && p[4] == 'u' && p[5] == 'd' && 
@@ -210,46 +203,7 @@
 			return (T_IF);
 		}
 		return (0);
-	case 'n':
-		if (p[0] == 'n' && p[1] == 'o' && p[2] == '_' && 
-		    p[3] == 'n' && p[4] == 'e' && p[5] == 'w' && 
-		    p[6] == '_' && p[7] == 'c' && p[8] == 'a' && 
-		    p[9] == 'c' && p[10] == 'h' && p[11] == 'e'
-		     && !isvar(p[12])) {
-			*q = p + 12;
-			return (T_NO_NEW_CACHE);
-		}
-		if (p[0] == 'n' && p[1] == 'o' && p[2] == '_' && 
-		    p[3] == 'c' && p[4] == 'a' && p[5] == 'c' && 
-		    p[6] == 'h' && p[7] == 'e' && !isvar(p[8])) {
-			*q = p + 8;
-			return (T_NO_CACHE);
-		}
-		return (0);
-	case 'p':
-		if (p[0] == 'p' && p[1] == 'r' && p[2] == 'o' && 
-		    p[3] == 'c' && !isvar(p[4])) {
-			*q = p + 4;
-			return (T_PROC);
-		}
-		return (0);
-	case 'r':
-		if (p[0] == 'r' && p[1] == 'e' && p[2] == 'w' && 
-		    p[3] == 'r' && p[4] == 'i' && p[5] == 't' && 
-		    p[6] == 'e' && !isvar(p[7])) {
-			*q = p + 7;
-			return (T_REWRITE);
-		}
-		return (0);
 	case 's':
-		if (p[0] == 's' && p[1] == 'w' && p[2] == 'i' && 
-		    p[3] == 't' && p[4] == 'c' && p[5] == 'h' && 
-		    p[6] == '_' && p[7] == 'c' && p[8] == 'o' && 
-		    p[9] == 'n' && p[10] == 'f' && p[11] == 'i' && 
-		    p[12] == 'g' && !isvar(p[13])) {
-			*q = p + 13;
-			return (T_SWITCH_CONFIG);
-		}
 		if (p[0] == 's' && p[1] == 'u' && p[2] == 'b'
 		     && !isvar(p[3])) {
 			*q = p + 3;
@@ -329,7 +283,6 @@
 	vcl_tnames[T_ELSEIF] = "elseif";
 	vcl_tnames[T_ELSIF] = "elsif";
 	vcl_tnames[T_EQ] = "==";
-	vcl_tnames[T_FUNC] = "func";
 	vcl_tnames[T_GEQ] = ">=";
 	vcl_tnames[T_IF] = "if";
 	vcl_tnames[T_INC] = "++";
@@ -338,14 +291,9 @@
 	vcl_tnames[T_LEQ] = "<=";
 	vcl_tnames[T_MUL] = "*=";
 	vcl_tnames[T_NEQ] = "!=";
-	vcl_tnames[T_NO_CACHE] = "no_cache";
-	vcl_tnames[T_NO_NEW_CACHE] = "no_new_cache";
-	vcl_tnames[T_PROC] = "proc";
-	vcl_tnames[T_REWRITE] = "rewrite";
 	vcl_tnames[T_SHL] = "<<";
 	vcl_tnames[T_SHR] = ">>";
 	vcl_tnames[T_SUB] = "sub";
-	vcl_tnames[T_SWITCH_CONFIG] = "switch_config";
 	vcl_tnames[VAR] = "VAR";
 }
 

Modified: trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl	2007-04-01 09:07:44 UTC (rev 1298)
+++ trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl	2007-04-01 09:17:52 UTC (rev 1299)
@@ -65,16 +65,11 @@
 
 	if else elseif elsif
 
-	func proc sub
+	sub
 
 	acl
 
 	backend
-
-	no_cache
-	no_new_cache
-	rewrite
-	switch_config
 }
 
 # Non-word tokens

Modified: trunk/varnish-cache/lib/libvcl/vcc_token_defs.h
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_token_defs.h	2007-04-01 09:07:44 UTC (rev 1298)
+++ trunk/varnish-cache/lib/libvcl/vcc_token_defs.h	2007-04-01 09:17:52 UTC (rev 1299)
@@ -12,32 +12,26 @@
 #define T_ELSE 130
 #define T_ELSEIF 131
 #define T_ELSIF 132
-#define T_FUNC 133
-#define T_PROC 134
-#define T_SUB 135
-#define T_ACL 136
-#define T_BACKEND 137
-#define T_NO_CACHE 138
-#define T_NO_NEW_CACHE 139
-#define T_REWRITE 140
-#define T_SWITCH_CONFIG 141
-#define T_INC 142
-#define T_DEC 143
-#define T_CAND 144
-#define T_COR 145
-#define T_LEQ 146
-#define T_EQ 147
-#define T_NEQ 148
-#define T_GEQ 149
-#define T_SHR 150
-#define T_SHL 151
-#define T_INCR 152
-#define T_DECR 153
-#define T_MUL 154
-#define T_DIV 155
-#define ID 156
-#define VAR 157
-#define CNUM 158
-#define CSTR 159
-#define EOI 160
-#define METHOD 161
+#define T_SUB 133
+#define T_ACL 134
+#define T_BACKEND 135
+#define T_INC 136
+#define T_DEC 137
+#define T_CAND 138
+#define T_COR 139
+#define T_LEQ 140
+#define T_EQ 141
+#define T_NEQ 142
+#define T_GEQ 143
+#define T_SHR 144
+#define T_SHL 145
+#define T_INCR 146
+#define T_DECR 147
+#define T_MUL 148
+#define T_DIV 149
+#define ID 150
+#define VAR 151
+#define CNUM 152
+#define CSTR 153
+#define EOI 154
+#define METHOD 155




More information about the varnish-commit mailing list