Made the set tag work to local variables. Moved tests to their own directory.

This commit is contained in:
Brad Arant committed 2024-10-30 16:45:05 -07:00
1 parent ad48c530a0
commit ae4ff5a3dc
10 files changed
+37 -18

No files matched your search

+4
View File
@@ -0,0 +1,4 @@
#!./jet-2.0
<jet>
This is output
</jet>
+9
View File
@@ -0,0 +1,9 @@
#!./jet-2.0
<jet cgi="true" name1="localname" filterblanklines="true" trimlines="true">
<mysql host="localhost" database="barant" user="barant" password="uversa" sessionid="1">
<sql sessionid="1">select * from testdata</sql>
<whilerow name="index" count="10" sessionid="1">
$[1.id] $[1.text] $[1.value]
</whilerow>
</mysql>
</jet>
+6
View File
@@ -0,0 +1,6 @@
#!./jet-2.0
<jet cgi="true" name1="localname" filterblanklines="true" trimlines="true">
<for name="ix" start="1" end="5" step="1">
-->#[ix]<--
</for>
</jet>
+2
View File
@@ -0,0 +1,2 @@
This is from an include tag.
<set name="include" value="yes" />
+63
View File
@@ -0,0 +1,63 @@
#!./jet-2.0
<jet cgi="true" name1="localname" filterblanklines="true" trimlines="true">
<header name="Content-Type" value="text/html" />
<comment>This is a comment and should not show up in the output.</comment>
<html>
---
<set name="modified1" value="ABCD" />
$[modified1]
<set name="tohex" value="TOHEX" />
$[modified1]
---
$[nonexistant]
$[%HOME]
<set name="ix" value="1" />
<set name="theexpr" expr="SUBSTRING('abcdefg', 5 - 4, 20 - 17)" />
<set name="addition" expr="5+3" />
<set name="subtraction" expr="5-3" />
<set name="multiplication" expr="5*3" />
<set name="division" expr="5/3" />
<set name="divisor" value="8" />
<set name="nested" expr="(2*(4+4)/$[divisor])*32" />
$[nested]
<set name="numbers">0123456789</set>
<set name="lefty" expr="LEFT('$[numbers]',5)" />
lefty=[$[lefty]]
substring('abcdefg', 1, 3)=[$[theexpr]]
5+3=($[addition])
5-3($[subtraction])
5*3($[multiplication])
5/3($[division])
<set name="varname$[ix]" value="vardata" scope="global" />
<set name="noeval" eval="no">this is the value store in #[name].</set>
<set name="thename" eval="yes">this is the value store in #[name].</set>
<set name="newname" scope="global">another container value</set>
<include file="./testinclude.jet" />
include: $[include]
>>>$[noeval]<<<
>>>$[thename]<<<
<set name="iz" value="data" />
<set name="ix1" value="1" />
<set name="test$[ix$[ix1]]$[iz]" value="0123456789" />
$[test$[ix$[ix1]]$[iz]]
<if value1="X" value2="Y" type="ne">
789
<if expr="3>1">
123
<else>
456
</if>
</if>
<for name="ix" start="1" end="5" step="1">
-->#[ix]<--
</for>
<call status="rc" pgm="/usr/bin/ls" arg1="-al" name="ls" />
$[rc]
$[ls]
<read file="compile" name="file" />
$[filex]
<whiledir path="." filename="file" fullpath="fullpath" filenamenoextension="noext" sort="true">
$[file] $[fullpath] $[noext]
</whiledir>
</html>
</jet>
+8
View File
@@ -0,0 +1,8 @@
#!./jet-2.0
<jet cgi="true" name1="localname" filterblanklines="true" trimlines="true">
<set name="testvar" value="do you see this" scope="local" />
#[testvar]
<for name="ix" start="1" end="5" step="1">
-->#[ix]<--
</for>
</jet>
+13
View File
@@ -0,0 +1,13 @@
#!./jet-2.0
<jet filterblanklines="true" trimlines="true">
<tag name="test">
<set name="ix" expr="$[ix]+1" />
<container />
$[ix]
</tag>
<set name="ix" value="1" />
<test>
<set name="ix" expr="$[ix]+1" />
</test>
<test />
</jet>
+16
View File
@@ -0,0 +1,16 @@
#!../jet-2.0
<jet filterblanklines="true" trimlines="true">
<set name="ix" value="1" />
<set name="letterx" value="x" />
<set name="var1" value="this is a test" />
<set name="1var1" value="This is another test" />
<set name="var1var" value="Yet another test" />
<set name="var11" value="it seems to work." />
$[$[ix]var$[ix]]
$[var$[ix]]
$[var$[ix]var]
$[var$[i$[letterx]]var]
$[letterx;TOHEX]
$[var$[i$[letterx]]$[ix]]
$[var$[i$[letterx]]$[i$[letterx]]]
</jet>