html-template-pro 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.autotest +9 -0
- data/ARTISTIC +131 -0
- data/History.txt +4 -0
- data/LGPL +504 -0
- data/Manifest.txt +221 -0
- data/README.rdoc +52 -0
- data/Rakefile +18 -0
- data/benchmark.rb +136 -0
- data/config/website.yml +2 -0
- data/ext/html/template/internal/Pro.xs +679 -0
- data/ext/html/template/internal/builtin_findfile.inc +361 -0
- data/ext/html/template/internal/calc.h +26 -0
- data/ext/html/template/internal/calc.inc +120 -0
- data/ext/html/template/internal/callback_stubs.inc +63 -0
- data/ext/html/template/internal/expr.c +2267 -0
- data/ext/html/template/internal/expr.y +476 -0
- data/ext/html/template/internal/expr_iface.c +94 -0
- data/ext/html/template/internal/exprpstr.h +36 -0
- data/ext/html/template/internal/exprpstr.inc +144 -0
- data/ext/html/template/internal/exprtool.h +99 -0
- data/ext/html/template/internal/exprtool.inc +289 -0
- data/ext/html/template/internal/exprtype.h +62 -0
- data/ext/html/template/internal/exprval.h +30 -0
- data/ext/html/template/internal/extconf.rb +6 -0
- data/ext/html/template/internal/internal.c +449 -0
- data/ext/html/template/internal/loadfile.h +11 -0
- data/ext/html/template/internal/loadfile.inc +171 -0
- data/ext/html/template/internal/pabidecl.h +54 -0
- data/ext/html/template/internal/pabstract.h +426 -0
- data/ext/html/template/internal/parse_expr.h +15 -0
- data/ext/html/template/internal/pbuffer.c +76 -0
- data/ext/html/template/internal/pbuffer.h +31 -0
- data/ext/html/template/internal/pmiscdef.h +54 -0
- data/ext/html/template/internal/pparam.h +101 -0
- data/ext/html/template/internal/ppport.h +1098 -0
- data/ext/html/template/internal/procore.c +1189 -0
- data/ext/html/template/internal/procore.h +18 -0
- data/ext/html/template/internal/proparam.c +443 -0
- data/ext/html/template/internal/proparam.h +571 -0
- data/ext/html/template/internal/proscope.h +32 -0
- data/ext/html/template/internal/proscope.inc +107 -0
- data/ext/html/template/internal/prostate.h +49 -0
- data/ext/html/template/internal/prostate.inc +24 -0
- data/ext/html/template/internal/provalue.h +14 -0
- data/ext/html/template/internal/pstring.h +60 -0
- data/ext/html/template/internal/pstrutils.h +25 -0
- data/ext/html/template/internal/pstrutils.inc +150 -0
- data/ext/html/template/internal/tagstack.h +30 -0
- data/ext/html/template/internal/tagstack.inc +65 -0
- data/ext/html/template/internal/tmpllog.c +62 -0
- data/ext/html/template/internal/tmpllog.h +27 -0
- data/ext/html/template/internal/tmplpro.h +218 -0
- data/ext/html/template/internal/tmplpro_version.c +35 -0
- data/lib/html/template/pro.rb +225 -0
- data/script/console +10 -0
- data/script/destroy +14 -0
- data/script/generate +14 -0
- data/script/txt2html +71 -0
- data/tasks/extconf.rake +13 -0
- data/tasks/extconf/tmplpro.rake +43 -0
- data/templates-Pro/a.incl +1 -0
- data/templates-Pro/empty.incl +0 -0
- data/templates-Pro/include/1/a.incl +1 -0
- data/templates-Pro/include/2.out +3 -0
- data/templates-Pro/include/2.tmpl +1 -0
- data/templates-Pro/include/2/a.incl +1 -0
- data/templates-Pro/include/3.tmpl +1 -0
- data/templates-Pro/include/4.tmpl +1 -0
- data/templates-Pro/include/a.incl +1 -0
- data/templates-Pro/test_broken.tmpl +25 -0
- data/templates-Pro/test_broken1.out +1 -0
- data/templates-Pro/test_broken1.tmpl +1 -0
- data/templates-Pro/test_esc1.out +4 -0
- data/templates-Pro/test_esc1.tmpl +4 -0
- data/templates-Pro/test_esc2.out +5 -0
- data/templates-Pro/test_esc2.tmpl +6 -0
- data/templates-Pro/test_esc3.out +4 -0
- data/templates-Pro/test_esc3.tmpl +4 -0
- data/templates-Pro/test_esc4.out +3 -0
- data/templates-Pro/test_esc4.tmpl +4 -0
- data/templates-Pro/test_expr1.out +26 -0
- data/templates-Pro/test_expr1.tmpl +26 -0
- data/templates-Pro/test_expr2.out +34 -0
- data/templates-Pro/test_expr2.tmpl +34 -0
- data/templates-Pro/test_expr3.out +6 -0
- data/templates-Pro/test_expr3.tmpl +6 -0
- data/templates-Pro/test_expr4.out +4 -0
- data/templates-Pro/test_expr4.tmpl +4 -0
- data/templates-Pro/test_expr5.out +18 -0
- data/templates-Pro/test_expr5.tmpl +18 -0
- data/templates-Pro/test_expr6.out +18 -0
- data/templates-Pro/test_expr6.tmpl +18 -0
- data/templates-Pro/test_expr7.out +44 -0
- data/templates-Pro/test_expr7.tmpl +20 -0
- data/templates-Pro/test_expr8.out +15 -0
- data/templates-Pro/test_expr8.tmpl +15 -0
- data/templates-Pro/test_if1.out +25 -0
- data/templates-Pro/test_if1.tmpl +28 -0
- data/templates-Pro/test_if2.out +17 -0
- data/templates-Pro/test_if2.tmpl +25 -0
- data/templates-Pro/test_if3.out +12 -0
- data/templates-Pro/test_if3.tmpl +14 -0
- data/templates-Pro/test_if4.out +15 -0
- data/templates-Pro/test_if4.tmpl +31 -0
- data/templates-Pro/test_if5.out +16 -0
- data/templates-Pro/test_if5.tmpl +16 -0
- data/templates-Pro/test_if6.out +15 -0
- data/templates-Pro/test_if6.tmpl +31 -0
- data/templates-Pro/test_if7.out +14 -0
- data/templates-Pro/test_if7.tmpl +18 -0
- data/templates-Pro/test_include1.out +23 -0
- data/templates-Pro/test_include1.tmpl +7 -0
- data/templates-Pro/test_include2.out +120 -0
- data/templates-Pro/test_include2.tmpl +10 -0
- data/templates-Pro/test_include3.out +8 -0
- data/templates-Pro/test_include3.tmpl +8 -0
- data/templates-Pro/test_include4.out +7 -0
- data/templates-Pro/test_include4.tmpl +6 -0
- data/templates-Pro/test_include5.out +7 -0
- data/templates-Pro/test_include5.tmpl +6 -0
- data/templates-Pro/test_loop1.erb +17 -0
- data/templates-Pro/test_loop1.out +12 -0
- data/templates-Pro/test_loop1.tmpl +16 -0
- data/templates-Pro/test_loop2.erb +19 -0
- data/templates-Pro/test_loop2.out +40 -0
- data/templates-Pro/test_loop2.tmpl +19 -0
- data/templates-Pro/test_loop3.out +38 -0
- data/templates-Pro/test_loop3.tmpl +40 -0
- data/templates-Pro/test_loop4.out +44 -0
- data/templates-Pro/test_loop4.tmpl +20 -0
- data/templates-Pro/test_loop5.out +9 -0
- data/templates-Pro/test_loop5.tmpl +11 -0
- data/templates-Pro/test_loop6.out +33 -0
- data/templates-Pro/test_loop6.tmpl +15 -0
- data/templates-Pro/test_malloc.tmpl +1 -0
- data/templates-Pro/test_userfunc1.out +14 -0
- data/templates-Pro/test_userfunc1.tmpl +14 -0
- data/templates-Pro/test_userfunc2.out +35 -0
- data/templates-Pro/test_userfunc2.tmpl +5 -0
- data/templates-Pro/test_userfunc3.out +5 -0
- data/templates-Pro/test_userfunc3.tmpl +5 -0
- data/templates-Pro/test_userfunc4.out +10 -0
- data/templates-Pro/test_userfunc4.tmpl +10 -0
- data/templates-Pro/test_userfunc5.out +4 -0
- data/templates-Pro/test_userfunc5.tmpl +4 -0
- data/templates-Pro/test_userfunc6.out +4 -0
- data/templates-Pro/test_userfunc6.tmpl +4 -0
- data/templates-Pro/test_var1.erb +23 -0
- data/templates-Pro/test_var1.out +20 -0
- data/templates-Pro/test_var1.tmpl +23 -0
- data/templates-Pro/test_var2.erb +7 -0
- data/templates-Pro/test_var2.out +6 -0
- data/templates-Pro/test_var2.tmpl +7 -0
- data/templates-Pro/test_var3.out +14 -0
- data/templates-Pro/test_var3.tmpl +16 -0
- data/templates/case_loop.tmpl +3 -0
- data/templates/context.tmpl +3 -0
- data/templates/counter.tmpl +2 -0
- data/templates/default.tmpl +1 -0
- data/templates/default_escape.tmpl +4 -0
- data/templates/double_loop.tmpl +7 -0
- data/templates/escape.tmpl +5 -0
- data/templates/global-loops.tmpl +9 -0
- data/templates/globals.tmpl +11 -0
- data/templates/if.tmpl +7 -0
- data/templates/ifelse.tmpl +6 -0
- data/templates/include.tmpl +14 -0
- data/templates/include_path/a.tmpl +2 -0
- data/templates/include_path/b.tmpl +1 -0
- data/templates/include_path/inner.tmpl +1 -0
- data/templates/include_path/one.tmpl +2 -0
- data/templates/include_path2/inner.tmpl +1 -0
- data/templates/included.tmpl +4 -0
- data/templates/included2.tmpl +3 -0
- data/templates/js.tmpl +1 -0
- data/templates/long_loops.tmpl +307 -0
- data/templates/loop-context.tmpl +2 -0
- data/templates/loop-if.tmpl +9 -0
- data/templates/medium.tmpl +217 -0
- data/templates/multiline_tags.tmpl +7 -0
- data/templates/newline_test1.tmpl +1 -0
- data/templates/newline_test2.tmpl +1 -0
- data/templates/other-loop.tmpl +7 -0
- data/templates/outer.tmpl +3 -0
- data/templates/query-test.tmpl +21 -0
- data/templates/query-test2.tmpl +12 -0
- data/templates/recursive.tmpl +2 -0
- data/templates/searchpath/included.tmpl +4 -0
- data/templates/searchpath/three.tmpl +1 -0
- data/templates/searchpath/two.tmpl +2 -0
- data/templates/simple-loop-nonames.tmpl +13 -0
- data/templates/simple-loop.tmpl +12 -0
- data/templates/simple.tmpl +9 -0
- data/templates/unless.tmpl +5 -0
- data/templates/urlescape.tmpl +3 -0
- data/templates/vanguard1.tmpl +2 -0
- data/templates/vanguard2.tmpl +3 -0
- data/test/templates/complex.tmpl +24 -0
- data/test/templates/foo.tmpl +6 -0
- data/test/templates/func.tmpl +2 -0
- data/test/templates/loop.tmpl +14 -0
- data/test/templates/negative.tmpl +1 -0
- data/test/templates/numerics.tmpl +6 -0
- data/test/templates/register.tmpl +2 -0
- data/test/test_basic.rb +23 -0
- data/test/test_coderefs.rb +16 -0
- data/test/test_complex.rb +106 -0
- data/test/test_helper.rb +3 -0
- data/test/test_html_template.rb +583 -0
- data/test/test_html_template_internal_extn.rb +10 -0
- data/test/test_html_template_pro.rb +177 -0
- data/test/test_path_like_variable_scope.rb +59 -0
- data/test/test_random.rb +21 -0
- data/test/test_realloc.rb +16 -0
- data/test/test_register.rb +25 -0
- data/test/test_tmplpro.rb +9 -0
- data/test/tests.rb +9 -0
- data/website/index.txt +57 -0
- data/website/javascripts/rounded_corners_lite.inc.js +285 -0
- data/website/stylesheets/screen.css +159 -0
- data/website/template.html.erb +50 -0
- metadata +303 -0
@@ -0,0 +1,18 @@
|
|
1
|
+
<HTML><BODY>
|
2
|
+
<H1> test on string compare </H1>
|
3
|
+
true:<TMPL_VAR EXPR="'abc' eq 'abc'">
|
4
|
+
false:<TMPL_VAR EXPR="'ab' eq 'abc'">
|
5
|
+
false:<TMPL_VAR EXPR="'def' eq 'abc'">
|
6
|
+
|
7
|
+
false:<TMPL_VAR EXPR="ONE eq TWO">
|
8
|
+
false:<TMPL_VAR EXPR="(ONE eq TWO)">
|
9
|
+
|
10
|
+
false:<TMPL_VAR EXPR="1 eq 2">
|
11
|
+
false:<TMPL_VAR EXPR="'1' eq 2">
|
12
|
+
false:<TMPL_VAR EXPR="2 eq '1'">
|
13
|
+
|
14
|
+
testing unescape string
|
15
|
+
false:<TMPL_VAR EXPR="'\'1' eq '\'2'">
|
16
|
+
true:<TMPL_VAR EXPR="'\'1' ne '\'2'">
|
17
|
+
|
18
|
+
</body></html>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<HTML><BODY>
|
2
|
+
<H1> test_expr14 (built-in functions) </H1>
|
3
|
+
int(5.1)=5
|
4
|
+
abs(-2)=2
|
5
|
+
abs(-2.0)=2
|
6
|
+
defined(0)=1
|
7
|
+
length(1)=1
|
8
|
+
length('abc')=3
|
9
|
+
length('ab\'c')=4
|
10
|
+
|
11
|
+
hex(123)=291
|
12
|
+
oct(123)=83
|
13
|
+
|
14
|
+
allowed by current rules - but should not crash
|
15
|
+
int()=0
|
16
|
+
oct()=0
|
17
|
+
hex()=0
|
18
|
+
</body></html>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<HTML><BODY>
|
2
|
+
<H1> test_expr14 (built-in functions) </H1>
|
3
|
+
int(5.1)=<tmpl_var EXPR="int(5.1)">
|
4
|
+
abs(-2)=<tmpl_var EXPR="abs(-2)">
|
5
|
+
abs(-2.0)=<tmpl_var EXPR="abs(-2.0)">
|
6
|
+
defined(0)=<tmpl_var EXPR="defined(0)">
|
7
|
+
length(1)=<tmpl_var EXPR="length(1)">
|
8
|
+
length('abc')=<tmpl_var EXPR="length('abc')">
|
9
|
+
length('ab\'c')=<tmpl_var EXPR="length('ab\'c')">
|
10
|
+
|
11
|
+
hex(123)=<tmpl_var EXPR="hex(123)">
|
12
|
+
oct(123)=<tmpl_var EXPR="oct(123)">
|
13
|
+
|
14
|
+
allowed by current rules - but should not crash
|
15
|
+
int()=<tmpl_var EXPR="int()">
|
16
|
+
oct()=<tmpl_var EXPR="oct()">
|
17
|
+
hex()=<tmpl_var EXPR="hex()">
|
18
|
+
</body></html>
|
@@ -0,0 +1,44 @@
|
|
1
|
+
<HTML>
|
2
|
+
<body>
|
3
|
+
<H1> test_expr7 </H1>
|
4
|
+
|
5
|
+
We test inner loop variables
|
6
|
+
|
7
|
+
<table>
|
8
|
+
|
9
|
+
<tr>
|
10
|
+
<td>first:1</td>
|
11
|
+
<td>last: 0</td>
|
12
|
+
<td>odd:1</td>
|
13
|
+
<td>inner:0</td>
|
14
|
+
<td>count:1</td>
|
15
|
+
</tr>
|
16
|
+
|
17
|
+
<tr>
|
18
|
+
<td>first:0</td>
|
19
|
+
<td>last: 0</td>
|
20
|
+
<td>odd:0</td>
|
21
|
+
<td>inner:1</td>
|
22
|
+
<td>count:2</td>
|
23
|
+
</tr>
|
24
|
+
|
25
|
+
<tr>
|
26
|
+
<td>first:0</td>
|
27
|
+
<td>last: 0</td>
|
28
|
+
<td>odd:1</td>
|
29
|
+
<td>inner:1</td>
|
30
|
+
<td>count:3</td>
|
31
|
+
</tr>
|
32
|
+
|
33
|
+
<tr>
|
34
|
+
<td>first:0</td>
|
35
|
+
<td>last: 1</td>
|
36
|
+
<td>odd:0</td>
|
37
|
+
<td>inner:0</td>
|
38
|
+
<td>count:4</td>
|
39
|
+
</tr>
|
40
|
+
|
41
|
+
</table>
|
42
|
+
|
43
|
+
</body>
|
44
|
+
</HTML>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<HTML>
|
2
|
+
<body>
|
3
|
+
<H1> test_expr7 </H1>
|
4
|
+
|
5
|
+
We test inner loop variables
|
6
|
+
|
7
|
+
<table>
|
8
|
+
<TMPL_LOOP NAME=HASHREF1>
|
9
|
+
<tr>
|
10
|
+
<td>first:<tmpl_var EXPR="__first__"></td>
|
11
|
+
<td>last: <tmpl_var EXPR="__last__"></td>
|
12
|
+
<td>odd:<tmpl_var EXPR="__odd__"></td>
|
13
|
+
<td>inner:<tmpl_var EXPR="__inner__"></td>
|
14
|
+
<td>count:<tmpl_var EXPR="__counter__"></td>
|
15
|
+
</tr>
|
16
|
+
</tmpl_loop>
|
17
|
+
</table>
|
18
|
+
|
19
|
+
</body>
|
20
|
+
</HTML>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<HTML>
|
2
|
+
<body>
|
3
|
+
<H1> test_expr8 </H1>
|
4
|
+
|
5
|
+
We test addition
|
6
|
+
|
7
|
+
<b><tmpl_var EXPR="(20+50)"></b>
|
8
|
+
<b><tmpl_var EXPR="20+50"></b>
|
9
|
+
<b><tmpl_var EXPR="1000000+200000000000"></b>
|
10
|
+
<b><tmpl_var EXPR="(TWENTY+FOURTY)"></b>
|
11
|
+
<b><tmpl_var EXPR="TWENTY+FOURTY"></b>
|
12
|
+
<b><tmpl_var EXPR="(TWENTY+FOURTY)>0"></b>
|
13
|
+
|
14
|
+
</body>
|
15
|
+
</HTML>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<H1> test_if1 </H1>
|
2
|
+
|
3
|
+
|
4
|
+
VAR2 defined (TRUE)
|
5
|
+
(if test 2)
|
6
|
+
|
7
|
+
VAR1 defined (if test 3 level 1)
|
8
|
+
VAR2 defined (if test 3 level 2)
|
9
|
+
VAR2 defined (if test 3 level 3)
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
------------------ <hr>
|
14
|
+
defined (TRUE)
|
15
|
+
(if test 1)
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
VAR1 defined (if test 3 level 1)
|
20
|
+
VAR2 defined (if test 3 level 2)
|
21
|
+
VAR2 defined (if test 3 level 3)
|
22
|
+
defined (if test 3 level 4)
|
23
|
+
|
24
|
+
|
25
|
+
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<H1> test_if1 </H1>
|
2
|
+
<tmpl_iF VAR4> <tmpl_var naMe="VAR4"> defined (FALSE)
|
3
|
+
(if test 1) </tmpl_if>
|
4
|
+
|
5
|
+
<tMpl_iF VAR2> <tmpl_var naMe="VAR2"> defined (TRUE)
|
6
|
+
(if test 2) </tmpl_if>
|
7
|
+
|
8
|
+
<tmpl_iF VAR1> <tmpl_var naMe="VAR1"> defined (if test 3 level 1)
|
9
|
+
<tMpl_iF VAR2> <tmpl_var naMe="VAR2"> defined (if test 3 level 2)
|
10
|
+
<tMpl_iF VAR2> <tmpl_var naMe="VAR2"> defined (if test 3 level 3)
|
11
|
+
<tMpl_iF VAR4> <tmpl_var naMe="VAR4"> defined (if test 3 level 4 FALSE)
|
12
|
+
</tmpl_if>
|
13
|
+
</tmpl_if> </tmpl_if> </tmpl_if>
|
14
|
+
|
15
|
+
------------------ <hr>
|
16
|
+
<tmpl_unLess VAR4> <tmpl_var naMe="VAR4"> defined (TRUE)
|
17
|
+
(if test 1) </tmpl_unless>
|
18
|
+
|
19
|
+
<tmpl_unLess VAR2> <tmpl_var naMe="VAR2"> defined (FALSE)
|
20
|
+
(if test 2) </tmpl_unless>
|
21
|
+
|
22
|
+
<tmpl_if VAR1> <tmpl_var naMe="VAR1"> defined (if test 3 level 1)
|
23
|
+
<tmpl_if VAR2> <tmpl_var naMe="VAR2"> defined (if test 3 level 2)
|
24
|
+
<tmpl_if VAR2> <tmpl_var naMe="VAR2"> defined (if test 3 level 3)
|
25
|
+
<tmpl_unless VAR4> <tmpl_var naMe="VAR4"> defined (if test 3 level 4)
|
26
|
+
</tmpl_unless>
|
27
|
+
</tmpl_if> </tmpl_if> </tmpl_if>
|
28
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<HTML><BODY>
|
2
|
+
<H1> test_if2 </H1>
|
3
|
+
undefined (TRUE)
|
4
|
+
(if test 1)
|
5
|
+
|
6
|
+
VAR2 defined (TRUE)
|
7
|
+
(if test 2)
|
8
|
+
|
9
|
+
defined (if test 3 level 1) VISIBLE
|
10
|
+
VAR2 VISIBLE (if test 3 level 2)
|
11
|
+
VAR2 defined VISIBLE (if test 3 level 3)
|
12
|
+
--- visible ---
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
<H1> END test_if2 </H1>
|
17
|
+
</body></html>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<HTML><BODY>
|
2
|
+
<H1> test_if2 </H1>
|
3
|
+
<tmpl_iF VAR4> <tmpl_var naMe="VAR4"> defined (FALSE)
|
4
|
+
<tmpl_else> <tmpl_var naMe="VAR4"> undefined (TRUE)
|
5
|
+
</tmpl_if> (if test 1)
|
6
|
+
|
7
|
+
<tMpl_iF VAR2> <tmpl_var naMe="VAR2"> defined (TRUE)
|
8
|
+
<tmpl_else> <tmpl_var naMe="VAR2"> undefined (FALSE)
|
9
|
+
</tmpl_if> (if test 2)
|
10
|
+
|
11
|
+
<tmpl_unless VAR1> <tmpl_var naMe="VAR1"> defined (if test 3 level 1) HIDDEN
|
12
|
+
<tMpl_iF VAR2> <tmpl_var naMe="VAR2"> defined TRUE HIDDEN
|
13
|
+
(if test 2) </tmpl_if>
|
14
|
+
<tmpl_else> defined (if test 3 level 1) VISIBLE
|
15
|
+
<tmpl_if NAME="VAR2"> <tmpl_var naMe="VAR2"> VISIBLE (if test 3 level 2)
|
16
|
+
<tmpl_if VAR2> <tmpl_var naMe="VAR2"> defined VISIBLE (if test 3 level 3)
|
17
|
+
<tmpl_if VAR4> <tmpl_var naMe="VAR4"> defined (if test 3 level 4 FALSE) HIDDEN
|
18
|
+
</tmpl_if> --- visible ---
|
19
|
+
<tmpl_else> <tmpl_var naMe="VAR2"> (if test 3 level 3) HIDDEN
|
20
|
+
</tmpl_if>
|
21
|
+
<tmpl_else> <tmpl_var naMe="VAR2"> (if test 3 level 2) HIDDEN
|
22
|
+
</tmpl_if> </tmpl_unless>
|
23
|
+
|
24
|
+
<H1> END test_if2 </H1>
|
25
|
+
</body></html>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<HTML><BODY>
|
2
|
+
<H1> test_if4 </H1>
|
3
|
+
we test that tmpl_else should be invisible in invisible context
|
4
|
+
<tmpl_iF VAR4> <tmpl_var naMe="VAR4"> failed 1-0
|
5
|
+
<Tmpl_If VAR2> <tmpl_var naMe="VAR2"> failed 1-1
|
6
|
+
<tmpl_else> <tmpl_var naMe="VAR2"> failed 1-2
|
7
|
+
</tmpl_if>
|
8
|
+
</tmpl_if>
|
9
|
+
|
10
|
+
<tmpl_unless VAR1> failed 2-0
|
11
|
+
<Tmpl_If VAR2> <tmpl_var naMe="VAR2"> failed 2-1
|
12
|
+
<tmpl_else> <tmpl_var naMe="VAR2"> failed 2-2
|
13
|
+
</tmpl_if>
|
14
|
+
</tmpl_unless>
|
15
|
+
|
16
|
+
<tmpl_iF VAR2>
|
17
|
+
<tmpl_else> failed 3-0
|
18
|
+
<Tmpl_If VAR2> <tmpl_var naMe="VAR2"> failed 3-1
|
19
|
+
<tmpl_else> <tmpl_var naMe="VAR2"> failed 3-2
|
20
|
+
</tmpl_if>
|
21
|
+
</tmpl_if>
|
22
|
+
|
23
|
+
<tmpl_unless VAR4>
|
24
|
+
<tmpl_else> failed 4-0
|
25
|
+
<Tmpl_If VAR2> <tmpl_var naMe="VAR2"> failed 4-1
|
26
|
+
<tmpl_else> <tmpl_var naMe="VAR2"> failed 4-2
|
27
|
+
</tmpl_if>
|
28
|
+
</tmpl_unless>
|
29
|
+
|
30
|
+
<H1> END test_if4 </H1>
|
31
|
+
</body></html>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
5
|
+
<head>
|
6
|
+
<title>HTML::Template::Pro test template</title>
|
7
|
+
</head>
|
8
|
+
|
9
|
+
<body>
|
10
|
+
TMPL_IF in "<>":<br>
|
11
|
+
Variable 1 set!<br>
|
12
|
+
|
13
|
+
TMPL_IF in "<!-- -->":<br>
|
14
|
+
Variable 1 set!<br>
|
15
|
+
</body>
|
16
|
+
</html>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
5
|
+
<head>
|
6
|
+
<title>HTML::Template::Pro test template</title>
|
7
|
+
</head>
|
8
|
+
|
9
|
+
<body>
|
10
|
+
TMPL_IF in "<>":<br>
|
11
|
+
<TMPL_IF var1>Variable 1 set!<TMPL_ELSE>Variable 1 not set!</TMPL_IF><br>
|
12
|
+
|
13
|
+
TMPL_IF in "<!-- -->":<br>
|
14
|
+
<!-- TMPL_IF var1 -->Variable 1 set!<!-- TMPL_ELSE -->Variable 1 not set!<!-- /TMPL_IF --><br>
|
15
|
+
</body>
|
16
|
+
</html>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<HTML><BODY>
|
2
|
+
<H1> test_if6 -- if enambled COMPAT_ALLOW_NAME_IN_CLOSING_TAG </H1>
|
3
|
+
we test that tmpl_else should be invisible in invisible context
|
4
|
+
<tmpl_iF VAR4> <tmpl_var naMe="VAR4"> failed 1-0
|
5
|
+
<Tmpl_If VAR2> <tmpl_var naMe="VAR2"> failed 1-1
|
6
|
+
<tmpl_else> <tmpl_var naMe="VAR2"> failed 1-2
|
7
|
+
</tmpl_if NAME="VAAA">
|
8
|
+
</tmpl_if VAR3>
|
9
|
+
|
10
|
+
<tmpl_unless VAR1> failed 2-0
|
11
|
+
<Tmpl_If VAR2> <tmpl_var naMe="VAR2"> failed 2-1
|
12
|
+
<tmpl_else> <tmpl_var naMe="VAR2"> failed 2-2
|
13
|
+
</tmpl_if>
|
14
|
+
</tmpl_unless>
|
15
|
+
|
16
|
+
<tmpl_iF VAR2>
|
17
|
+
<tmpl_else> failed 3-0
|
18
|
+
<Tmpl_If VAR2> <tmpl_var naMe="VAR2"> failed 3-1
|
19
|
+
<tmpl_else> <tmpl_var naMe="VAR2"> failed 3-2
|
20
|
+
</tmpl_if>
|
21
|
+
</tmpl_if>
|
22
|
+
|
23
|
+
<tmpl_unless VAR4>
|
24
|
+
<tmpl_else> failed 4-0
|
25
|
+
<Tmpl_If VAR2> <tmpl_var naMe="VAR2"> failed 4-1
|
26
|
+
<tmpl_else> <tmpl_var naMe="VAR2"> failed 4-2
|
27
|
+
</tmpl_if>
|
28
|
+
</tmpl_unless>
|
29
|
+
|
30
|
+
<H1> END test_if6 </H1>
|
31
|
+
</body></html>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<HTML><BODY>
|
2
|
+
<H1> test_if7</H1>
|
3
|
+
we test elsif here.
|
4
|
+
test 1
|
5
|
+
<tmpl_iF VAR4> <tmpl_var naMe="VAR4"> var4 defined (FALSE)
|
6
|
+
<tMpl_elsiF VAR2> <tmpl_var naMe="VAR2"> var2 defined (TRUE)
|
7
|
+
<tmpl_else> else (FALSE)
|
8
|
+
</tmpl_if>end if test 1.
|
9
|
+
|
10
|
+
test 2
|
11
|
+
<tmpl_unless VAR4> <tmpl_var naMe="VAR4"> var4 undefined (TRUE)
|
12
|
+
<tMpl_elsiF VAR2> <tmpl_var naMe="VAR2"> var2 defined (should be skipped)
|
13
|
+
<tmpl_else> else (FALSE)
|
14
|
+
</tmpl_if>end if test 2.
|
15
|
+
|
16
|
+
|
17
|
+
<H1> END test_if7 </H1>
|
18
|
+
</body></html>
|