aboutsummaryrefslogtreecommitdiffstats
path: root/symbol.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@home.transmeta.com>2003-03-20 10:54:14 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 20:59:31 -0700
commit0474cdb18bbe72035ca493487776dbb5a8b325b5 (patch)
tree7fe9d5badef603bb00f56a97ce2d031b16824284 /symbol.c
parent15f971e49f7bf7b8b9576a15bf2b3982f4a59ac8 (diff)
downloadsparse-0474cdb18bbe72035ca493487776dbb5a8b325b5.tar.gz
Add symbol scoping for proper parsing.
Diffstat (limited to 'symbol.c')
-rw-r--r--symbol.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/symbol.c b/symbol.c
index a2e26b53..88d773b5 100644
--- a/symbol.c
+++ b/symbol.c
@@ -7,6 +7,7 @@
#include "token.h"
#include "parse.h"
#include "symbol.h"
+#include "scope.h"
struct symbol *lookup_symbol(struct ident *ident, enum namespace ns)
{
@@ -146,6 +147,8 @@ void bind_symbol(struct symbol *sym, struct ident *ident, enum namespace ns)
sym->namespace = ns;
sym->next_id = ident->symbols;
ident->symbols = sym;
+ sym->id_list = &ident->symbols;
+ bind_scope(sym);
}
struct symbol *create_symbol(int stream, const char *name, int type)