fixed call tag completely. Should be done for now.
This commit is contained in:
parent
4f616021f3
commit
3f4ca13f3f
6
Tag.cpp
6
Tag.cpp
@ -443,6 +443,12 @@ namespace jet {
|
||||
}
|
||||
|
||||
void Tag::storeVariable(coreutils::ZString variable, coreutils::MString value, coreutils::ZString scope) {
|
||||
if((scope == "global") || (scope == ""))
|
||||
global.variables[variable] = value;
|
||||
else if(scope == "local")
|
||||
local->variables[variable] = value;
|
||||
else if(scope == "parent")
|
||||
local->parent->variables[variable] = value;
|
||||
}
|
||||
|
||||
void Tag::storeVariable(coreutils::ZString variable) {
|
||||
|
@ -31,7 +31,7 @@ namespace jet {
|
||||
close(fdo[0]);
|
||||
dup2(fdo[1], 1);
|
||||
if(keywordDefined("input")) {
|
||||
coreutils::ZString input(resolveKeyword("input"));
|
||||
coreutils::MString input(resolveKeyword("input"));
|
||||
pipe(fdi);
|
||||
if(fork() == 0) {
|
||||
close(fdi[0]);
|
||||
@ -48,7 +48,9 @@ namespace jet {
|
||||
}
|
||||
close(fdo[1]);
|
||||
if(keywordDefined("name")) {
|
||||
storeVariable(resolveKeyword("name"));
|
||||
coreutils::MString value;
|
||||
value.read(fdo[0]);
|
||||
storeVariable(resolveKeyword("name"), value, resolveKeyword("scope"));
|
||||
} else
|
||||
out.read(fdo[0]);
|
||||
waitpid(pid, &status, 0);
|
||||
|
@ -3,6 +3,6 @@
|
||||
<set name="abc" value="abcdefg" />
|
||||
<call pgm="cat" error="error" input="$[abc]xyz" name="test1" />
|
||||
test1=$[test1]
|
||||
name1=#[localname]
|
||||
name1=$[%name1]
|
||||
error=$[error]
|
||||
</jet>
|
||||
|
Loading…
x
Reference in New Issue
Block a user