Skip to content

Commit

Permalink
[t/parse.t -> t/compiler.t] describes better the file
Browse files Browse the repository at this point in the history
Compiling consists of parsing, checking, and codegen, each one currently
inextricable from the others. Better to talk about the whole process than
one of the stages.
  • Loading branch information
Carl Masak committed Apr 15, 2010
1 parent 37a832d commit ede41c3
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions t/parse.t → t/compiler.t
Expand Up @@ -6,7 +6,7 @@ plan *;
use Yapsi;
my Yapsi::Compiler $c .= new;

my @programs-that-parse =
my @programs-that-compile =
'',
';',
'42',
Expand All @@ -25,16 +25,16 @@ my @programs-that-parse =
'++my $a = 42',
;

for @programs-that-parse -> $program {
my $can-parse = False;
for @programs-that-compile -> $program {
my $can-compile = False;
try {
$c.compile($program);
$can-parse = True;
$can-compile = True;
}
ok $can-parse, "will parse '$program'";
ok $can-compile, "will compile '$program'";
}

my @programs-that-don't-parse = # '
my @programs-that-don't-compile = # '
'$a',
'my',
'$a; my $a',
Expand All @@ -47,13 +47,13 @@ my @programs-that-don't-parse = # '
'++42',
;

for @programs-that-don't-parse -> $program { # '
my $can-parse = False;
for @programs-that-don't-compile -> $program { # '
my $can-compile = False;
try {
$c.compile($program);
$can-parse = True;
$can-compile = True;
}
ok !$can-parse, "will not parse '$program'";
ok !$can-compile, "will not compile '$program'";
}

done_testing;

0 comments on commit ede41c3

Please sign in to comment.