Refactoring on the variable read/store methods

Now it is ready to received two (or more) variables with same key.
This commit is contained in:
Felipe Zimmerle
2015-07-14 00:25:59 -03:00
parent f13a1bd880
commit 80f13437e3
6 changed files with 59 additions and 37 deletions

View File

@@ -20,6 +20,7 @@
#include <iostream>
#include <string>
#include <cstring>
#include <list>
#include "operators/operator.h"
#include "actions/action.h"
@@ -120,8 +121,12 @@ bool Rule::evaluate(Assay *assay) {
} else {
bool ret = false;
try {
ret = this->op->evaluate(assay,
assay->m_variables_strings.at(variable.name));
std::list<std::string> e = assay->resolve_variable(
variable.name);
for (std::string value : e) {
ret = this->op->evaluate(assay,
value);
}
} catch (...) {
}