Commit f6306e4e authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Set symbol kind at creation, so all symbols have one.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@5202 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent ac5864cc
......@@ -555,7 +555,7 @@ vcc_CompileSource(const struct vcc *tl0, struct vsb *sb, struct source *sp)
tl->sb = sb;
for (v = tl->vars; v->name != NULL; v++) {
sym = VCC_AddSymbol(tl, v->name);
sym = VCC_AddSymbol(tl, v->name, SYM_VAR);
sym->var = v;
sym->fmt = v->fmt;
sym->r_methods = v->r_methods;
......
......@@ -258,7 +258,7 @@ int vcc_StringVal(struct vcc *tl);
void vcc_ExpectedStringval(struct vcc *tl);
/* vcc_symbol */
struct symbol *VCC_AddSymbol(struct vcc *tl, const char *name);
struct symbol *VCC_AddSymbol(struct vcc *tl, const char *name, enum symkind);
const struct symbol *VCC_FindSymbol(const struct vcc *tl,
const struct token *t);
......
......@@ -45,7 +45,7 @@ SVNID("$Id$")
struct symbol *
VCC_AddSymbol(struct vcc *tl, const char *name)
VCC_AddSymbol(struct vcc *tl, const char *name, enum symkind kind)
{
struct symbol *sym;
......@@ -61,6 +61,7 @@ VCC_AddSymbol(struct vcc *tl, const char *name)
AN(name);
sym->nlen = strlen(name);
VTAILQ_INSERT_TAIL(&tl->symbols, sym, list);
sym->kind = kind;
return (sym);
}
......
......@@ -80,8 +80,7 @@ vcc_ParseImport(struct vcc *tl)
}
bprintf(fn, "%.*s", PF(mod));
sym = VCC_AddSymbol(tl, fn);
sym->kind = SYM_VMOD;
sym = VCC_AddSymbol(tl, fn, SYM_VMOD);
sym->def_b = t1;
sym->def_e = tl->t;
......@@ -152,7 +151,7 @@ vcc_ParseImport(struct vcc *tl)
Fi(tl, 0, "\t%s(&vmod_priv_%.*s, &VCL_conf);\n", p, PF(mod));
Ff(tl, 0, "\t%s(&vmod_priv_%.*s, 0);\n", p, PF(mod));
} else {
sym = VCC_AddSymbol(tl, p);
sym = VCC_AddSymbol(tl, p, SYM_FUNC);
p += strlen(p) + 1;
sym->cfunc = p;
p += strlen(p) + 1;
......
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