just got variables saving from set tag.
This commit is contained in:
1 parent
3d98448ec4
commit
9accb60eb9
5 files changed
+24
-16
No files matched your search
@@ -5,14 +5,20 @@
|
||||
namespace jet {
|
||||
|
||||
__set::__set(coreutils::ZString &in, coreutils::MString &out, Global &global) : Tag(in, out, global) {
|
||||
output = false;
|
||||
if(variables["scope"] == "local")
|
||||
variables[variables["name"]] = variables["value"];
|
||||
if(variables["scope"] == "global")
|
||||
global.variables[variables["name"]] = container;
|
||||
|
||||
global.dump();
|
||||
|
||||
}
|
||||
|
||||
output = false;
|
||||
if(!variableDefined("name"))
|
||||
throw coreutils::Exception("set tag must have name defined.");
|
||||
if(variableDefined("value") && hasContainer)
|
||||
throw coreutils::Exception("set tag cannot have both value and a container.");
|
||||
if(!variableDefined("value") && !hasContainer)
|
||||
throw coreutils::Exception("set tag must have a value or a container.");
|
||||
if(!variableDefined("scope") || (variables["scope"] == "global")) {
|
||||
if(hasContainer) {
|
||||
global.variables[variables["name"]] = container.parsed();
|
||||
} else
|
||||
global.variables[variables["name"]] = variables["value"];
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user