Another rewrite: everything works but compile_c().
[artemus.git] / art5
blob566496b33979719d3ba841f8b03a0cff333279ca
1 #!/usr/bin/perl
3 use Artemus5;
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>
13 my $url = [ '?',
14 [ '"', '<a href = http://host/?t=' ],
15 [ '$', 0 ],
16 [ '"', ';offset='],
17 [ 'or',
18 [ '$', 2 ],
19 [ '"', 0 ],
21 [ '"', '>'],
22 [ 'or',
23 [ '$', 1 ],
24 [ '"', 'Main index' ],
26 [ '"', '</a>' ]
29 $a->{op}->{url} = $url;
31 # navigator
32 # <span class = 'prev'><{
33 # if $2
34 # {?
35 # "<a href = "
36 # {url "INDEX" "topic" $0 "offset" {sub $2 $1}}
37 # ">&lt;&lt;</a>"
38 # }
39 #}></span>
41 # <html>\n<{url 'LOGIN' 'Login page'}>\n<{url 'INDEX'}></html>
43 my $p = [ '?',
44 [ '"', "<html>\n" ],
45 [ 'url', [ '"', 'LOGIN'], ['"', 'Login page'], ['"', 10 ]],
46 [ '"', "\n" ],
47 [ 'url', [ '"', 'INDEX'] ],
48 [ '"', "\n</html>" ]
51 print $a->exec($p), "\n";
53 exit 0;