Permalink
Browse files

New binary art5.

  • Loading branch information...
1 parent 39e5a63 commit a3926939f02253cd7bbefa8c4b6128ed7a00b0cd @angelortega committed Sep 21, 2009
Showing with 35 additions and 0 deletions.
  1. +35 −0 art5
View
35 art5
@@ -0,0 +1,35 @@
+#!/usr/bin/perl
+
+use Artemus5;
+
+my $dump = 0;
+my $v, $s;
+
+# raw argument parsing
+while ($v = shift(@ARGV)) {
+ if ($v eq '-d') {
+ $dump = 1;
+ }
+ else {
+ # script name
+ }
+}
+
+if (!defined($s)) {
+ $s = join(<>);
+}
+
+my $a = Artemus5->new();
+
+my $c = $a->compile($s);
+
+if ($dump) {
+ use Data::Dumper;
+
+ print Dump($dump), "\n";
+}
+else {
+ print $a->exec($c);
+}
+
+exit 0;

0 comments on commit a392693

Please sign in to comment.