repo.or.cz
/
artemus.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
If there is a cache directory, save there all compiled code.
[artemus.git]
/
art5
blob
bed7034884c36a1136879d1b1895ce3d75419d7a
1
#!/usr/bin/perl
2
3
use
Art5
;
4
5
my
$dump
=
0
;
6
my
$v
,
$s
;
7
my
@path
= ();
8
9
# raw argument parsing
10
while
(
$v
=
shift
(
@ARGV
)) {
11
if
(
$v
eq
'-d'
) {
12
$dump
=
1
;
13
}
14
elsif
(
$v
eq
'-I'
) {
15
push
(
@path
,
shift
(
@ARGV
));
16
}
17
else
{
18
# script name
19
}
20
}
21
22
if
(!
defined
(
$s
)) {
23
$s
=
join
(
''
, <>);
24
}
25
26
my
$a
=
Art5
->
new
(
path
=>
\
@path
,
cache
=>
'/tmp/art5/'
);
27
28
my
$c
=
$a
->
compile
(
$s
);
29
30
if
(
$dump
) {
31
use
Data
::
Dumper
;
32
33
print
Dumper
(
$c
),
"
\n
"
;
34
}
35
else
{
36
print
$a
->
exec
(
$c
);
37
}
38
39
exit
0
;