xo-interpreter2: + DGlobalEnv::_upsert_value()
This commit is contained in:
parent
878e12badc
commit
5675e12d97
2 changed files with 26 additions and 0 deletions
|
|
@ -88,6 +88,23 @@ namespace xo {
|
|||
(*values_)[ix.j_slot()] = x;
|
||||
}
|
||||
|
||||
DVariable *
|
||||
DGlobalEnv::_upsert_value(obj<AAllocator> mm,
|
||||
const DUniqueString * sym,
|
||||
TypeDescr td,
|
||||
obj<AGCObject> value)
|
||||
{
|
||||
DVariable * var
|
||||
= DVariable::make(mm, sym, TypeRef::resolved(td));
|
||||
|
||||
assert(var);
|
||||
|
||||
symtab_->upsert_variable(mm, var);
|
||||
this->assign_value(mm, var->path(), value);
|
||||
|
||||
return var;
|
||||
}
|
||||
|
||||
// ----- AGCObject facet -----
|
||||
|
||||
std::size_t
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue