r5005 - trunk/varnish-cache/lib/libvcl
phk at varnish-cache.org
phk at varnish-cache.org
Sun Jul 4 23:44:28 CEST 2010
Author: phk
Date: 2010-07-04 23:44:28 +0200 (Sun, 04 Jul 2010)
New Revision: 5005
Modified:
trunk/varnish-cache/lib/libvcl/generate.py
trunk/varnish-cache/lib/libvcl/vcc_action.c
trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c
trunk/varnish-cache/lib/libvcl/vcc_parse.c
trunk/varnish-cache/lib/libvcl/vcc_string.c
trunk/varnish-cache/lib/libvcl/vcc_token.c
trunk/varnish-cache/lib/libvcl/vcc_token_defs.h
Log:
Collapse the "VAR" token into ID.
Modified: trunk/varnish-cache/lib/libvcl/generate.py
===================================================================
--- trunk/varnish-cache/lib/libvcl/generate.py 2010-07-04 20:07:37 UTC (rev 5004)
+++ trunk/varnish-cache/lib/libvcl/generate.py 2010-07-04 21:44:28 UTC (rev 5005)
@@ -67,7 +67,6 @@
# These have handwritten recognizers
"ID": None,
- "VAR": None,
"CNUM": None,
"CSTR": None,
"EOI": None,
Modified: trunk/varnish-cache/lib/libvcl/vcc_action.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_action.c 2010-07-04 20:07:37 UTC (rev 5004)
+++ trunk/varnish-cache/lib/libvcl/vcc_action.c 2010-07-04 21:44:28 UTC (rev 5005)
@@ -68,7 +68,7 @@
struct var *vp;
vcc_NextToken(tl);
- if (tl->t->tok == VAR) {
+ if (tl->t->tok == ID) {
vp = vcc_FindVar(tl, tl->t, vcc_vars, 0, "read");
ERRCHK(tl);
assert(vp != NULL);
@@ -85,7 +85,7 @@
if (tl->t->tok == CSTR) {
Fb(tl, 0, ", %.*s", PF(tl->t));
vcc_NextToken(tl);
- } else if (tl->t->tok == VAR) {
+ } else if (tl->t->tok == ID) {
Fb(tl, 0, ", ");
if (!vcc_StringVal(tl)) {
ERRCHK(tl);
@@ -118,7 +118,7 @@
struct token *at, *vt;
vcc_NextToken(tl);
- ExpectErr(tl, VAR);
+ ExpectErr(tl, ID);
vt = tl->t;
vp = vcc_FindVar(tl, tl->t, vcc_vars, 1, "set");
ERRCHK(tl);
@@ -240,7 +240,7 @@
struct var *vp;
vcc_NextToken(tl);
- ExpectErr(tl, VAR);
+ ExpectErr(tl, ID);
vp = vcc_FindVar(tl, tl->t, vcc_vars, 1, "unset");
ERRCHK(tl);
assert(vp != NULL);
@@ -277,11 +277,11 @@
ExpectErr(tl, '(');
vcc_NextToken(tl);
- if (tl->t->tok == VAR) {
+ if (tl->t->tok == ID) {
Fb(tl, 1, "VRT_ban(sp,\n");
tl->indent += INDENT;
while (1) {
- ExpectErr(tl, VAR);
+ ExpectErr(tl, ID);
/* Check valididity of purge variable */
for (pv = purge_var; pv->name != NULL; pv++) {
Modified: trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2010-07-04 20:07:37 UTC (rev 5004)
+++ trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2010-07-04 21:44:28 UTC (rev 5005)
@@ -152,7 +152,6 @@
[T_NOMATCH] = "!~",
[T_SHL] = "<<",
[T_SHR] = ">>",
- [VAR] = "VAR",
};
void
@@ -246,8 +245,8 @@
"OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR "
"TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n"
" * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE "
- "POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * $Id: vrt.h 4984 2010-06-"
- "22 13:01:22Z phk $\n *\n * Runtime support for compiled VCL "
+ "POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * $Id: vrt.h 5001 2010-07-"
+ "04 14:40:33Z phk $\n *\n * Runtime support for compiled VCL "
"programs.\n *\n * XXX: When this file is changed, lib/libvcl/gen"
"erate.py *MUST* be rerun.\n */\n\nstruct sess;\nstruct vsb;\n"
"struct cli;\nstruct director;\nstruct VCL_conf;\n"
@@ -296,6 +295,7 @@
"const char *);\nvoid VRT_SetHdr(const struct sess *, enum "
"gethdr_e where, const char *,\n const char *, ...);\n"
"void VRT_handling(struct sess *sp, unsigned hand);\n"
+ "\nvoid VRT_hashdata(struct sess *sp, const char *str, ...);\n"
"\n/* Simple stuff */\nint VRT_strcmp(const char *s1, const "
"char *s2);\nvoid VRT_memmove(void *dst, const void *src, unsigne"
"d len);\n\nvoid VRT_ESI(struct sess *sp);\nvoid VRT_Rollback(str"
@@ -315,7 +315,7 @@
/* ../../include/vrt_obj.h */
- vsb_cat(sb, "\n/*\n * $Id: vrt_obj.h 5000 2010-07-04 14:15:28Z "
+ vsb_cat(sb, "\n/*\n * $Id: vrt_obj.h 5001 2010-07-04 14:40:33Z "
"phk $\n *\n * NB: This file is machine generated, DO NOT "
"EDIT!\n *\n * Edit and run generate.py instead\n */\n"
"struct sockaddr * VRT_r_client_ip(const struct sess *);\n"
@@ -328,9 +328,8 @@
"onst struct sess *);\nvoid VRT_l_req_url(const struct sess "
"*, const char *, ...);\nconst char * VRT_r_req_proto(const "
"struct sess *);\nvoid VRT_l_req_proto(const struct sess *, "
- "const char *, ...);\nvoid VRT_l_req_hash(struct sess *, const "
- "char *);\nstruct director * VRT_r_req_backend(struct sess "
- "*);\nvoid VRT_l_req_backend(struct sess *, struct director "
+ "const char *, ...);\nstruct director * VRT_r_req_backend(struct "
+ "sess *);\nvoid VRT_l_req_backend(struct sess *, struct director "
"*);\nint VRT_r_req_restarts(const struct sess *);\n"
"double VRT_r_req_grace(struct sess *);\nvoid VRT_l_req_grace(str"
"uct sess *, double);\nconst char * VRT_r_req_xid(struct sess "
Modified: trunk/varnish-cache/lib/libvcl/vcc_parse.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_parse.c 2010-07-04 20:07:37 UTC (rev 5004)
+++ trunk/varnish-cache/lib/libvcl/vcc_parse.c 2010-07-04 21:44:28 UTC (rev 5005)
@@ -339,7 +339,7 @@
vcc_NextToken(tl);
vcc_Cond_0(tl);
SkipToken(tl, ')');
- } else if (tl->t->tok == VAR) {
+ } else if (tl->t->tok == ID) {
vp = vcc_FindVar(tl, tl->t, vcc_vars, 0, "read");
ERRCHK(tl);
assert(vp != NULL);
Modified: trunk/varnish-cache/lib/libvcl/vcc_string.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_string.c 2010-07-04 20:07:37 UTC (rev 5004)
+++ trunk/varnish-cache/lib/libvcl/vcc_string.c 2010-07-04 21:44:28 UTC (rev 5005)
@@ -158,7 +158,7 @@
vcc_NextToken(tl);
return 1;
}
- if (tl->t->tok == VAR) {
+ if (tl->t->tok == ID) {
vp = vcc_FindVar(tl, tl->t, vcc_vars, 0, "read");
if (tl->err)
return (0);
Modified: trunk/varnish-cache/lib/libvcl/vcc_token.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_token.c 2010-07-04 20:07:37 UTC (rev 5004)
+++ trunk/varnish-cache/lib/libvcl/vcc_token.c 2010-07-04 21:44:28 UTC (rev 5005)
@@ -462,16 +462,9 @@
/* Match Identifiers */
if (isident1(*p)) {
for (q = p; q < sp->e; q++)
- if (!isident(*q))
+ if (!isvar(*q))
break;
- if (isvar(*q)) {
- for (; q < sp->e; q++)
- if (!isvar(*q))
- break;
- vcc_AddToken(tl, VAR, p, q);
- } else {
- vcc_AddToken(tl, ID, p, q);
- }
+ vcc_AddToken(tl, ID, p, q);
p = q;
continue;
}
Modified: trunk/varnish-cache/lib/libvcl/vcc_token_defs.h
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_token_defs.h 2010-07-04 20:07:37 UTC (rev 5004)
+++ trunk/varnish-cache/lib/libvcl/vcc_token_defs.h 2010-07-04 21:44:28 UTC (rev 5005)
@@ -31,4 +31,3 @@
#define T_NOMATCH 150
#define T_SHL 151
#define T_SHR 152
-#define VAR 153
More information about the varnish-commit
mailing list