Actually use the environment for binop functions.

This commit is contained in:
2020-09-10 16:03:56 -07:00
parent 2a81fdd9fb
commit f00a6a7783
2 changed files with 4 additions and 1 deletions

View File

@@ -135,7 +135,8 @@ void ast_binop::compile(const env_ptr& env, std::vector<instruction_ptr>& into)
right->compile(env, into);
left->compile(env_ptr(new env_offset(1, env)), into);
into.push_back(instruction_ptr(new instruction_pushglobal(op_action(op))));
auto mangled_name = this->env->get_mangled_name(op_name(op));
into.push_back(instruction_ptr(new instruction_pushglobal(mangled_name)));
into.push_back(instruction_ptr(new instruction_mkapp()));
into.push_back(instruction_ptr(new instruction_mkapp()));
}