Symbol table now properly handles scopes for function declarations.

Previously, they all went into one big pile that was never cleaned up;
this was the wrong thing to do in a world where one might have a 
function declaration inside another functions, say.
This commit is contained in:
Matt Pharr
2011-12-04 17:37:13 -08:00
parent 32904dfa11
commit f95504fb5e
7 changed files with 166 additions and 129 deletions

View File

@@ -246,8 +246,9 @@ primary_expression
if (s)
$$ = new SymbolExpr(s, @1);
else {
std::vector<Symbol *> *funs = m->symbolTable->LookupFunction(name);
if (funs)
std::vector<Symbol *> funs;
m->symbolTable->LookupFunction(name, &funs);
if (funs.size() > 0)
$$ = new FunctionSymbolExpr(name, funs, @1);
}
if ($$ == NULL) {