Commit 8f799d75 by Andrew Dahl

Ref #15 Quick clean-up

parent a570dd26
Showing with 2 additions and 2 deletions
......@@ -157,8 +157,8 @@ stat: OUTPUT additive_exp NEWLINE {
}
}
| ID EQUALS assignment_exp NEWLINE {
if(symbol_table->at(level)->Find($1) != NULL) {
Symbol* temp = symbol_table->at(level)->Insert(new Symbol($1, Symbol::VARIABLE, $3->getReturnType()));
Symbol* temp;
if((temp = symbol_table->at(level)->Find($1)) != NULL) {
if(temp->getType() == Symbol::FUNCTION) {
yyerror(symbol_table, instructions, "Function used like variable!");
YYABORT;
......
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 sign in to comment