Make some refactors for name mangling and encapsulation.

This commit is contained in:
2020-09-15 18:51:28 -07:00
parent 6080094c41
commit 55486d511f
18 changed files with 895 additions and 303 deletions

View File

@@ -57,9 +57,8 @@ void ast_lid::translate(global_scope& scope) {
void ast_lid::compile(const env_ptr& env, std::vector<instruction_ptr>& into) const {
into.push_back(instruction_ptr(
(this->env->is_global(id)) ?
(instruction*) new instruction_pushglobal(id) :
(instruction*) new instruction_push(
env->get_offset(this->env->get_mangled_name(id)))));
(instruction*) new instruction_pushglobal(this->env->get_mangled_name(id)) :
(instruction*) new instruction_push(env->get_offset(id))));
}
void ast_uid::print(int indent, std::ostream& to) const {