Commit 2b5ed2bf by Andrew Dahl

Fixed variable used as function error

parent 3045417b
Showing with 2 additions and 0 deletions
......@@ -176,6 +176,8 @@ primary_exp: LPAREN additive_exp RPAREN {
Symbol* temp = symbol_table->at(level)->Find($1);
if(temp == NULL) {
yyerror(symbol_table, instructions, "Function not declared yet!");
} else if (temp->getType() != Symbol::FUNCTION) {
yyerror(symbol_table, instructions, "Variable used as Function!");
} else {
Symbol* func = new Symbol(temp);
func->setFunctionValue($3);
......
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