serious scoping work unfinished.

This commit is contained in:
Brad Arant 2024-11-26 15:25:30 -08:00
parent bd8aa1c089
commit 07e43d3f5a
6 changed files with 12 additions and 4 deletions

View File

@ -145,7 +145,7 @@ namespace jet {
__ifrow _ifrow(in, out, global, this);
continue;
} else if(ifTagName(in, "include")) {
__include _include(in, out, global, this);
__include _include(in, out, global, parent);
continue;
} else if(ifTagName(in, "jet")) {
__jet _jet(in, out, global, this);
@ -157,7 +157,7 @@ namespace jet {
__write _write(in, out, global, this);
continue;
} else if(ifTagName(in, "set")) {
__set _set(in, out, global, this);
__set _set(in, out, global, parent);
continue;
} else if(ifTagName(in, "call")) {
__call _call(in, out, global, this);

View File

@ -5,6 +5,7 @@
namespace jet {
__include::__include(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) {
resolveContainerParent = true;
if(!variableDefined("file"))
throw coreutils::Exception("file keyword must be specified.");
if(hasContainer)

View File

@ -8,7 +8,6 @@ namespace jet {
__set::__set(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) {
output = false;
resolveContainerParent = true;
if(!variableDefined("name"))
throw coreutils::Exception("set tag must have name defined.");
if(!variableDefined("expr") && variableDefined("value") && hasContainer)

View File

@ -1,2 +1,6 @@
<set name="localvar" scope="local">This is a container set with '#[name1]'</set>
This is from an include tag.
localname='#[name1]'
<set name="include" value="yes" />
<set name="testinclude" value="x#[localvar]x" />
test='$[testinclude]'

View File

@ -39,6 +39,7 @@
<set name="newname" scope="global">another container value</set>
<include file="./testinclude.jet" />
include: $[include]
localvar='#[localvar]'
>>>$[noeval]<<<
>>>$[thename]<<<
<set name="iz" value="data" />

View File

@ -1,5 +1,8 @@
#!../jet-2.0
<jet cgi="true" name1="localname" filterblanklines="true" trimlines="true">
<set name="name2" value="localname2" scope="local" />
<set name="x" value="#[name1]" />
$[x] $[x]
localname=#[name1]
localname2=#[name2]
localname through x=$[x]
</jet>