xo-interpreter2: recursive factorial utest. working!

This commit is contained in:
Roland Conybeare 2026-02-17 20:07:43 -05:00
commit e993ee0de7
2 changed files with 94 additions and 13 deletions

View file

@ -394,22 +394,14 @@ namespace xo {
Binding b = var->path();
if (local_env_) {
auto value = local_env_->lookup_value(b);
obj<AGCObject> value;
if (value) {
this->value_ = VsmResult(value);
this->pc_ = this->cont_;
this->cont_ = VsmInstr::c_sentinel;
return;
}
if (b.is_local() && local_env_) {
value = local_env_->lookup_value(b);
} else if (b.is_global()) {
value = global_env_->lookup_value(b);
}
// no local binding. perhaps there's a global binding
auto value = global_env_->lookup_value(b);
if (value) {
this->value_ = VsmResult(value);