fglock / Perlito

"Perlito" Perl programming language compiler
http://fglock.github.io/Perlito/
Other
414 stars 47 forks source link

Some Perl6 programs won't compile #61

Open jarble opened 4 years ago

jarble commented 4 years ago

I tried to run this program with the Perl6 compiler, but it won't compile:


# this example is from Rosetta Code:
# https://rosettacode.org/wiki/99_Bottles_of_Beer#Perl_6

my $b = 99;

repeat while --$b {
    say "{b $b} on the wall";
    say "{b $b}";
    say "Take one down, pass it around";
    say "{b $b-1} on the wall";
    say "";
}

sub b($b) {
    "$b bottle{'s' if $b != 1} of beer";
}

This is the error from the compiler log:

Compiling.
Emitting javascript.
Finished compilation unit at pos 320 of 320
Error:
{}
Compilation aborted.

Why does this program not compile?