xo-interpreter2: recursive factorial utest. working!
This commit is contained in:
parent
a2fc3cb34a
commit
e993ee0de7
2 changed files with 94 additions and 13 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue