Skip to content
Snippets Groups Projects
Commit 4f62dffc authored by Francois Henrotte's avatar Francois Henrotte
Browse files

accept commas in arguments of enclosed

parent 24f79525
No related branches found
No related tags found
No related merge requests found
......@@ -148,28 +148,24 @@ int enclosed(const std::string &in, std::vector<std::string> &arguments,
else if(in[pos] == ')')
count--;
else if(in[pos] == ',') {
if(count == 1)
if(count == 1){
arguments.push_back(removeBlanks(in.substr(cursor,pos-cursor)));
cursor=pos+1; // skips ','
}
else{
OLMsg::Error("Syntax error: mismatched parenthesis <%s>",in.c_str());
return 0;
// ignore this comma
}
cursor=pos+1; // skips ','
}
pos++;
} while( count && (pos < in.size()) );
// count is 0 when the closing brace has been found.
if(count){
if(count && pos == in.size()){
OLMsg::Error("Syntax error: <%s>",in.c_str());
return 0;
}
else if (pos!=std::string::npos)
else
arguments.push_back(removeBlanks(in.substr(cursor,pos-1-cursor)));
else{
OLMsg::Error("weirdo: <%s>",in.c_str());
return 0;
}
end=pos;
return arguments.size();
}
......@@ -1641,11 +1637,11 @@ void MetaModel::client_sentence(const std::string &name,
bool changed = onelab::server::instance()->getChanged(c->getName());
bool started = isStarted(changed);
if(OLMsg::GetVerbosity())
std::cout << c->getName() << " active="
<< c->getActive() << " changed="
<< changed << " started="
<< started << " errors=" << OLMsg::GetErrorCount() << std::endl;
// if(OLMsg::GetVerbosity())
// std::cout << c->getName() << " active="
// << c->getActive() << " changed="
// << changed << " started="
// << started << " errors=" << OLMsg::GetErrorCount() << std::endl;
if(c->getActive() || started) c->compute();
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment