added test for multidimensional for loop
This commit is contained in:
@@ -762,6 +762,9 @@ class Script: public QObject {
|
||||
_variables[name] = value;
|
||||
_rvariables[value] = name;
|
||||
}
|
||||
QStringList variables() {
|
||||
return _variables.keys();
|
||||
}
|
||||
QString variable(QString name) {
|
||||
QMap<QString, QString>::iterator it(_variables.find(name));
|
||||
if (it==_variables.end()) throw VariableNotFound(name);
|
||||
@@ -1675,11 +1678,11 @@ class Set: public Command {
|
||||
Logger log(this, script);
|
||||
if (_next) {
|
||||
_next->execute(script, frame);
|
||||
script->set(script->replacevars(_name),
|
||||
script->set(_name,
|
||||
script->replacevars(_next->result()));
|
||||
log(_name+"='"+_next->result().replace("\\", "\\\\").replace("'", "\\'")+"'");
|
||||
} else {
|
||||
script->set(script->replacevars(_name),
|
||||
script->set(_name,
|
||||
script->replacevars(_value));
|
||||
log(_name+"='"+_value.replace("\\", "\\\\").replace("'", "\\'")+"'");
|
||||
}
|
||||
@@ -2414,6 +2417,8 @@ inline bool Command::runScript(Command* parentCommand,
|
||||
disconnect(&scriptCopy, SIGNAL(logging(QString)),
|
||||
parent, SLOT(parentlog(QString)));
|
||||
parentCommand->_result = scriptCopy.result();
|
||||
Q_FOREACH(QString key, scriptCopy.variables())
|
||||
if (!vars.contains(key)) parent->set(key, scriptCopy.variable(key));
|
||||
if (parentCommand->_result.size())
|
||||
parent->log("result: "+parentCommand->_result);
|
||||
return res;
|
||||
|
Reference in New Issue
Block a user