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:
5
parse.yy
5
parse.yy
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user