5 my $a = Artemus5
->new();
7 #my $src = join('', <>);
9 #print $a->process($src);
11 # <a href = http://host?t=<{$0}>;offset=0><{or $1 "Main index"}></a>
14 [ '"', '<a href = http://host/?t=' ],
24 [ '"', 'Main index' ],
29 $a->{op
}->{url
} = $url;
32 # <span class = 'prev'><{
36 # {url "INDEX" "topic" $0 "offset" {sub $2 $1}}
41 # <html>\n<{url 'LOGIN' 'Login page'}>\n<{url 'INDEX'}></html>
45 [ 'url', [ '"', 'LOGIN'], ['"', 'Login page'], ['"', 10 ]],
47 [ 'url', [ '"', 'INDEX'] ],
51 print $a->exec($p), "\n";
54 $c = $a->compile("Leading <{%arch}> Trailing");
55 print $a->exec($c), "\n";
56 $c = $a->compile("Leading <{? 'Arch: ' %arch}> Trailing");
57 print $a->exec($c), "\n";
58 $c = $a->compile("Leading <{mul {add 10 20} 1000}> Trailing");
59 print $a->exec($c), "\n";
60 $c = $a->compile("Leading <{? {= 'TEST' 'here'} { TEST }}> Trailing");
61 print $a->exec($c), "\n";
62 $c = $a->compile("Leading <{if {eq 1 2} 'Equal' 'Different'}> Trailing");
63 print $a->exec($c), "\n";
64 $c = $a->compile("Leading <{if {eq 1 1} 'Equal' 'Different'}> Trailing");
65 print $a->exec($c), "\n";
66 $c = $a->compile("Leading <{if {eq 1 2} {'Equal'} {'Different'}}> Trailing");
67 print $a->exec($c), "\n";
68 $c = $a->compile("Leading <{if {eq 1 1} {'Equal'} {'Different'}}> Trailing");
69 print $a->exec($c), "\n";
70 $c = $a->compile("Leading <{url 'LOGIN' 'Login page'}> Trailing");
71 print $a->exec($c), "\n";
72 $c = $a->compile("Leading <{random 1 2 3 4 5 6}> Trailing");
73 print $a->exec($c), "\n";
74 $c = $a->compile("Leading <{env}> Trailing");
75 print $a->exec($c), "\n";
76 $c = $a->compile("Leading <{foreach env}> Trailing");
77 print $a->exec($c), "\n";
78 $c = $a->compile("Leading <{foreach env \$0}> Trailing");
79 print $a->exec($c), "\n";
80 $c = $a->compile("Leading <{foreach env \$0 ', '}> Trailing");
81 print $a->exec($c), "\n";
82 $c = $a->compile("Leading <{foreach env {? \$0 '=' {env \$0}} ', '}> Trailing");
83 print $a->exec($c), "\n";
84 $c = $a->compile("Leading <{1 2 3}> Trailing");
85 print $a->exec($c), "\n";