Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
FUTURE refactor
Instead of $/ -> SIC, the compiler now does $/ -> FUTURE -> SIC. The net
gain of ~150 lines also translates to a heightened readability and less
tangled code. Bright FUTURE ahead indeed.
  • Loading branch information
Carl Masak committed Feb 5, 2011
1 parent c22255a commit e23dbc9
Show file tree
Hide file tree
Showing 2 changed files with 464 additions and 321 deletions.
16 changes: 9 additions & 7 deletions bin/yapsi
Expand Up @@ -3,7 +3,7 @@ use v6;

use Yapsi;

my @TARGETS = <run sic>;
my @TARGETS = <run future sic>;

if @*ARGS && @*ARGS[0] eq '--version' {
my $revision = qx[git describe];
Expand Down Expand Up @@ -34,18 +34,20 @@ else {
}

try {
my @sic;
my @output;
given Yapsi::Compiler.new {
@sic = .compile($program);
@output = $target eq 'future'
?? .to-future($program)
!! .compile($program);
warn $_ for .warnings;
}

if $target eq 'sic' {
.say for @sic;
if $target eq 'run' {
my Yapsi::Runtime $runtime .= new;
$runtime.run(@output);
}
else {
my Yapsi::Runtime $runtime .= new;
$runtime.run(@sic);
.say for @output;
}
}
say $! if $!;

0 comments on commit e23dbc9

Please sign in to comment.