Adds references to the collection variables

This commit is contained in:
Felipe Zimmerle
2017-02-02 18:32:00 -03:00
committed by Felipe Zimmerle
parent e95efa05cc
commit d851699529
9 changed files with 39 additions and 15 deletions

View File

@@ -51,12 +51,17 @@ void AnchoredSetVariable::unset() {
void AnchoredSetVariable::set(const std::string &key,
const std::string &value, size_t offset) {
std::unique_ptr<VariableOrigin> origin(new VariableOrigin());
std::string *v = new std::string(value);
std::string *k = new std::string(m_name + ":" + key);
collection::Variable *var = new collection::Variable(k, v);
origin->m_offset = offset;
origin->m_length = value.size();
var->m_dynamic_value = true;
var->m_dynamic = false;
var->m_orign.push_back(std::move(origin));
emplace(key, var);
}