Commit 2cce3866 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Eliminate the "proof of concept" tokens that were never implemented

at runtime.


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@1299 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent bbcb10b6
...@@ -56,19 +56,6 @@ ...@@ -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) \ #define VCL_RET_MAC(l,u,b,i) \
static void \ static void \
parse_##l(struct tokenlist *tl) \ parse_##l(struct tokenlist *tl) \
...@@ -237,7 +224,6 @@ static struct action_table { ...@@ -237,7 +224,6 @@ static struct action_table {
{ NULL, NULL } { NULL, NULL }
}; };
void void
vcc_ParseAction(struct tokenlist *tl) vcc_ParseAction(struct tokenlist *tl)
{ {
...@@ -253,30 +239,6 @@ vcc_ParseAction(struct tokenlist *tl) ...@@ -253,30 +239,6 @@ vcc_ParseAction(struct tokenlist *tl)
} }
} }
} }
vcc_NextToken(tl); vsb_printf(tl->sb, "Expected action, 'if' or '}'\n");
switch (at->tok) { vcc_ErrWhere(tl, at);
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;
}
} }
...@@ -191,13 +191,6 @@ vcl_fixed_token(const char *p, const char **q) ...@@ -191,13 +191,6 @@ vcl_fixed_token(const char *p, const char **q)
return (T_ELSE); return (T_ELSE);
} }
return (0); 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': case 'i':
if (p[0] == 'i' && p[1] == 'n' && p[2] == 'c' && if (p[0] == 'i' && p[1] == 'n' && p[2] == 'c' &&
p[3] == 'l' && p[4] == 'u' && p[5] == 'd' && p[3] == 'l' && p[4] == 'u' && p[5] == 'd' &&
...@@ -210,46 +203,7 @@ vcl_fixed_token(const char *p, const char **q) ...@@ -210,46 +203,7 @@ vcl_fixed_token(const char *p, const char **q)
return (T_IF); return (T_IF);
} }
return (0); 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': 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' if (p[0] == 's' && p[1] == 'u' && p[2] == 'b'
&& !isvar(p[3])) { && !isvar(p[3])) {
*q = p + 3; *q = p + 3;
...@@ -329,7 +283,6 @@ vcl_init_tnames(void) ...@@ -329,7 +283,6 @@ vcl_init_tnames(void)
vcl_tnames[T_ELSEIF] = "elseif"; vcl_tnames[T_ELSEIF] = "elseif";
vcl_tnames[T_ELSIF] = "elsif"; vcl_tnames[T_ELSIF] = "elsif";
vcl_tnames[T_EQ] = "=="; vcl_tnames[T_EQ] = "==";
vcl_tnames[T_FUNC] = "func";
vcl_tnames[T_GEQ] = ">="; vcl_tnames[T_GEQ] = ">=";
vcl_tnames[T_IF] = "if"; vcl_tnames[T_IF] = "if";
vcl_tnames[T_INC] = "++"; vcl_tnames[T_INC] = "++";
...@@ -338,14 +291,9 @@ vcl_init_tnames(void) ...@@ -338,14 +291,9 @@ vcl_init_tnames(void)
vcl_tnames[T_LEQ] = "<="; vcl_tnames[T_LEQ] = "<=";
vcl_tnames[T_MUL] = "*="; vcl_tnames[T_MUL] = "*=";
vcl_tnames[T_NEQ] = "!="; 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_SHL] = "<<";
vcl_tnames[T_SHR] = ">>"; vcl_tnames[T_SHR] = ">>";
vcl_tnames[T_SUB] = "sub"; vcl_tnames[T_SUB] = "sub";
vcl_tnames[T_SWITCH_CONFIG] = "switch_config";
vcl_tnames[VAR] = "VAR"; vcl_tnames[VAR] = "VAR";
} }
......
...@@ -65,16 +65,11 @@ set keywords { ...@@ -65,16 +65,11 @@ set keywords {
if else elseif elsif if else elseif elsif
func proc sub sub
acl acl
backend backend
no_cache
no_new_cache
rewrite
switch_config
} }
# Non-word tokens # Non-word tokens
......
...@@ -12,32 +12,26 @@ ...@@ -12,32 +12,26 @@
#define T_ELSE 130 #define T_ELSE 130
#define T_ELSEIF 131 #define T_ELSEIF 131
#define T_ELSIF 132 #define T_ELSIF 132
#define T_FUNC 133 #define T_SUB 133
#define T_PROC 134 #define T_ACL 134
#define T_SUB 135 #define T_BACKEND 135
#define T_ACL 136 #define T_INC 136
#define T_BACKEND 137 #define T_DEC 137
#define T_NO_CACHE 138 #define T_CAND 138
#define T_NO_NEW_CACHE 139 #define T_COR 139
#define T_REWRITE 140 #define T_LEQ 140
#define T_SWITCH_CONFIG 141 #define T_EQ 141
#define T_INC 142 #define T_NEQ 142
#define T_DEC 143 #define T_GEQ 143
#define T_CAND 144 #define T_SHR 144
#define T_COR 145 #define T_SHL 145
#define T_LEQ 146 #define T_INCR 146
#define T_EQ 147 #define T_DECR 147
#define T_NEQ 148 #define T_MUL 148
#define T_GEQ 149 #define T_DIV 149
#define T_SHR 150 #define ID 150
#define T_SHL 151 #define VAR 151
#define T_INCR 152 #define CNUM 152
#define T_DECR 153 #define CSTR 153
#define T_MUL 154 #define EOI 154
#define T_DIV 155 #define METHOD 155
#define ID 156
#define VAR 157
#define CNUM 158
#define CSTR 159
#define EOI 160
#define METHOD 161
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