header tag upgraded to keyword resolution method.
This commit is contained in:
parent
858d073d63
commit
7cab6916c7
10
__header.cpp
10
__header.cpp
@ -16,7 +16,8 @@ namespace jet {
|
||||
if(variableDefined("expr") && variableDefined("value") && !hasContainer)
|
||||
throw coreutils::Exception("header tag cannot have both expr and value.");
|
||||
if(!variableDefined("expr") && !variableDefined("value") && !hasContainer)
|
||||
throw coreutils::Exception("header tag must have a value, expr or a container.");
|
||||
throw coreutils::Exception("header tag must have a value, expr or a container.");
|
||||
resolveKeyword("name");
|
||||
if(variableDefined("expr")) {
|
||||
if(variableDefined("eval"))
|
||||
throw coreutils::Exception("Cannot use eval with expr.");
|
||||
@ -28,8 +29,9 @@ namespace jet {
|
||||
} else {
|
||||
global.headers[variables["name"]] = container;
|
||||
}
|
||||
} else
|
||||
global.headers[variables["name"]] = variables["value"];
|
||||
|
||||
} else {
|
||||
resolveKeyword("value");
|
||||
global.headers[variables["name"]] = variables["value"];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user