Fixed for tag.
This commit is contained in:
1 parent
d10ed783fa
commit
dd5768ea66
20 files changed
+199
-78
No files matched your search
@@ -5,15 +5,29 @@
|
||||
namespace jet {
|
||||
|
||||
__for::__for(coreutils::ZString &in, coreutils::MString &out, Global &global) : Tag(in, out, global) {
|
||||
if(!variableDefined(coreutils::ZString("begin")))
|
||||
throw coreutils::Exception("begin keyword must be specified.");
|
||||
if(!variableDefined(coreutils::ZString("end")))
|
||||
throw coreutils::Exception("end keyword must be specified.");
|
||||
|
||||
for(;;) {
|
||||
parseContainer(container);
|
||||
double counter = 0.0f;
|
||||
double end = 0.0f;
|
||||
double step = 0.0f;
|
||||
bool nameDefined = variableDefined("name");
|
||||
if(variableDefined(coreutils::ZString("start"))) {
|
||||
counter = variables["start"].asDouble();
|
||||
}
|
||||
|
||||
if(variableDefined(coreutils::ZString("end"))) {
|
||||
end = variables["end"].asDouble();
|
||||
}
|
||||
if(variableDefined(coreutils::ZString("step"))) {
|
||||
step = variables["step"].asDouble();
|
||||
}
|
||||
for(double ix = counter; ix <= end; ix += step) {
|
||||
if(nameDefined)
|
||||
variables[variables["name"]] = ix;
|
||||
processContainer(container);
|
||||
container.reset();
|
||||
}
|
||||
|
||||
// for (auto i = variables.begin(); i != variables.end(); i++)
|
||||
// std::cout << i->first << "=[" << i->second << "]" << std::endl;}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user