Skip to content
Snippets Groups Projects
Verified Commit 7f96d4a1 authored by Houtan Bastani's avatar Houtan Bastani
Browse files

macro processor: remove unnecessary check in Function evaluation

Not necessary because of parser rules for function definition
parent 8cdbdee3
No related branches found
No related tags found
No related merge requests found
...@@ -759,8 +759,6 @@ Function::eval() ...@@ -759,8 +759,6 @@ Function::eval()
for (size_t i = 0; i < func->args.size(); i++) for (size_t i = 0; i < func->args.size(); i++)
{ {
VariablePtr mvp = dynamic_pointer_cast<Variable>(func->args.at(i)); VariablePtr mvp = dynamic_pointer_cast<Variable>(func->args.at(i));
if (!mvp)
throw StackTrace("Argument " + std::to_string(i) + " of function " + name + " must be a variable");
env.define(mvp, args.at(i)->eval()); env.define(mvp, args.at(i)->eval());
} }
auto retval = body->eval(); auto retval = body->eval();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment