Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'nom' into bs
  • Loading branch information
jnthn committed Feb 29, 2012
2 parents 7c6ebd7 + 4726db3 commit c077570
Show file tree
Hide file tree
Showing 20 changed files with 540 additions and 348 deletions.
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
2012.01
2012.02
6 changes: 6 additions & 0 deletions docs/ChangeLog
@@ -1,3 +1,8 @@
New in 2012.03
+ updated to dyncall 0.7
+ infix:<eqv> now autothreads over junctions
+ more typed exceptions

New in 2012.02
+ catch duplicate accessor generation required of "has $.x; has @.x;"
+ many more typed exceptions thrown
Expand Down Expand Up @@ -31,6 +36,7 @@ New in 2012.02
+ fixed "but True" and "but False"
+ object hashes, with the my %h{SomeObjectType} syntax
+ implemented Int($x) style coercions
+ implemented Capture.perl

New in 2012.01
+ -c command line option re-implemented
Expand Down
1 change: 1 addition & 0 deletions docs/ROADMAP
Expand Up @@ -34,6 +34,7 @@ Compiler Performance/Portability Improvements (jnthn)
2 **** full-blown bounded serialization
2 ** finish up any remaining s/pir::/nqp::/
2 ? re-organize Rakudo, build process, etc. for multi-backend
3 ** Optimizing multis for `[+] 1..10` and `[<=] 1..10` etc.

Macros (masak)
2 *** macro declarations and invocation; Rudimentary quasiquotes
Expand Down
71 changes: 71 additions & 0 deletions docs/announce/2012.02
@@ -0,0 +1,71 @@
Announce: Rakudo Perl 6 compiler development release #49 ("SPb")

On behalf of the Rakudo development team, I'm happy to announce the
February 2012 release of Rakudo Perl #49 "SPb". Rakudo is an
implementation of Perl 6 on the Parrot Virtual Machine (see
<http://www.parrot.org>). The tarball for this release
is available from <http://github.com/rakudo/rakudo/downloads>.

Please note: This announcement is not for the Rakudo Star
distribution[*] -- it's announcing a new release of the compiler only.
For the latest Rakudo Star release, see
<http://github.com/rakudo/star/downloads>.

The Rakudo Perl compiler follows a monthly release cycle, with each
release named after a Perl Mongers group. The February 2012 release is
code named after the Saint Petersburg Perl Mongers, because Saint
Petersburg as a city has provided unmatched inspiration and clarity to
at least two Rakudo programmers.

Some of the specific changes and improvements occurring with this
release include:

* Regex syntax: <prior> and <Foo::Bar::baz>
* &rename and &copy functions
* LHS of infix:<xx> now thunks as per spec
* Improved backtraces
* Rat arithmetic falling back to Num when needed; FatRat
* Object hashes
* Int($x)-style coercions

We are still regressed on a few features compared to the 2011.07 release of
Rakudo, the most notable of which is autovivification.
These regressions should be rectified in coming releases.

For a more detailed list of changes, see "docs/ChangeLog".

The development team thanks all of our contributors and sponsors for
making Rakudo Perl possible, as well as those people who worked on
Parrot, the Perl 6 test suite and the specification.

The following people contributed to this release:

Moritz Lenz, Jonathan Worthington, Carl Masak, Tadeusz Sośnierz, kboga,
Will "Coke" Coleda, TimToady, lumi, not_gerd, PerlJam, not_gerd.

If you would like to contribute, see <http://rakudo.org/how-to-help>,
ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6
on freenode.

The next release of Rakudo (#50) is scheduled for March 22, 2012. A
list of the other planned release dates and code names for 2012 is
available in the "docs/release_guide.pod" file. In general, Rakudo
development releases are scheduled to occur soon after each Parrot
monthly release. Parrot releases the third Tuesday of each month.

May a great deal of fun befall you!


[*] What's the difference between the Rakudo compiler and the Rakudo
Star distribution?

The Rakudo compiler is a compiler for the Perl 6 language.
Nothing else.

The Rakudo Star distribution is the Rakudo compiler plus a selection
of useful Perl 6 modules, the most recent incarnation of the "Using
Perl 6" book, and other software that can be used with the Rakudo
compiler to enhance its utility. Rakudo Star is meant for early
adopters who wish to explore what's possible with Rakudo Perl 6 and
provide feedback on what works, what doesn't, and what else they
would like to see included in the distribution.
10 changes: 5 additions & 5 deletions docs/release_guide.pod
Expand Up @@ -48,16 +48,16 @@ part of monthly Parrot releases.
2011-11-17 Rakudo #46 "London" (tadzik)
2011-12-22 Rakudo #47 "Columbus" (moritz)
2012-01-23 Rakudo #48 "Toronto" (moritz)
2012-02-23 Rakudo #49 "SPb" (masak)

=head2 Planned 2012 releases

Dates are based on Parrot's expected release schedule.

2012-02-23 #49
2012-03-22 #50
2012-04-19 #51
2012-05-17 #52
2012-06-21 #53
2012-03-22 Rakudo #50
2012-04-19 Rakudo #51 (Coke)
2012-05-17 Rakudo #52
2012-06-21 Rakudo #53

=head2 Suggested .pm group names for future releases

Expand Down
64 changes: 34 additions & 30 deletions src/Perl6/Actions.pm
Expand Up @@ -99,7 +99,7 @@ class Perl6::Actions is HLL::Actions {
# attribute/lexpad), bind constraint (what could we bind to this
# slot later), and if specified a constraint on the inner value
# and a default value.
sub container_type_info($sigil, @value_type, $shape?) {
sub container_type_info($/, $sigil, @value_type, $shape?) {
my %info;
if $sigil eq '@' {
%info<container_base> := $*W.find_symbol(['Array']);
Expand All @@ -116,7 +116,7 @@ class Perl6::Actions is HLL::Actions {
%info<value_type> := $*W.find_symbol(['Mu']);
}
if $shape {
pir::die("Shaped arrays are not yet supported");
$*W.throw($/, 'X::Comp::NYI', feature => 'Shaped arrays');
}
}
elsif $sigil eq '%' {
Expand Down Expand Up @@ -817,7 +817,7 @@ class Perl6::Actions is HLL::Actions {

method statement_control:sym<require>($/) {
if $<module_name> && $<EXPR> {
$*W.throw($/, ['X', 'NYI'],
$*W.throw($/, ['X', 'Comp', 'NYI'],
feature => 'require with argument list');
}
my $name_past := $<module_name>
Expand Down Expand Up @@ -1212,7 +1212,7 @@ class Perl6::Actions is HLL::Actions {
}

method package_declarator:sym<also>($/) {
$*W.throw($/, ['X', 'NYI'], feature => 'also');
$*W.throw($/, ['X', 'Comp', 'NYI'], feature => 'also');
}

method package_def($/) {
Expand Down Expand Up @@ -1374,7 +1374,7 @@ class Perl6::Actions is HLL::Actions {
}
}
else {
my %cont_info := container_type_info($_<sigil> || '$', []);
my %cont_info := container_type_info($/, $_<sigil> || '$', []);
$list.push($*W.build_container_past(
%cont_info,
$*W.create_container_descriptor(%cont_info<value_type>, 1, 'anon')));
Expand All @@ -1391,7 +1391,7 @@ class Perl6::Actions is HLL::Actions {
$/.CURSOR.panic("Cannot use .= initializer with a list of declarations");
}
else {
$/.CURSOR.panic("Binding to signatures in $*SCOPE declarations not yet implemented");
$*W.throw($/, 'X::Comp::NYI', feature => "Binding to signatures in $*SCOPE declarations");
}
}

Expand Down Expand Up @@ -1430,15 +1430,17 @@ class Perl6::Actions is HLL::Actions {
# Ensure current package can take attributes.
unless pir::can($*PACKAGE.HOW, 'add_attribute') {
if $*PKGDECL {
$/.CURSOR.panic("A $*PKGDECL cannot have attributes");
$*W.throw($/, ['X', 'Attribute', 'Package'],
package-type => $*PKGDECL
);
} else {
$/.CURSOR.panic("You can't declare an attribute here; maybe you'd like a class or a role?");
$*W.throw($/, ['X', 'Attribute', 'NoPackage']);
}
}

# Create container descriptor and decide on any default value..
my $attrname := ~$sigil ~ '!' ~ $desigilname;
my %cont_info := container_type_info($sigil, $*OFTYPE ?? [$*OFTYPE.ast] !! [], $shape);
my %cont_info := container_type_info($/, $sigil, $*OFTYPE ?? [$*OFTYPE.ast] !! [], $shape);
my $descriptor := $*W.create_container_descriptor(%cont_info<value_type>, 1, $attrname);

# Create meta-attribute and add it.
Expand Down Expand Up @@ -1487,7 +1489,7 @@ class Perl6::Actions is HLL::Actions {

# Create a container descriptor. Default to rw and set a
# type if we have one; a trait may twiddle with that later.
my %cont_info := container_type_info($sigil, $*OFTYPE ?? [$*OFTYPE.ast] !! [], $shape);
my %cont_info := container_type_info($/, $sigil, $*OFTYPE ?? [$*OFTYPE.ast] !! [], $shape);
my $descriptor := $*W.create_container_descriptor(%cont_info<value_type>, 1, $name);

# Install the container.
Expand Down Expand Up @@ -1541,7 +1543,7 @@ class Perl6::Actions is HLL::Actions {
$BLOCK.symbol($name, :scope('lexical'));
}
else {
$*W.throw($/, ['X', 'NYI'],
$*W.throw($/, 'X::Comp::NYI',
feature => "$*SCOPE scoped variables");
}

Expand Down Expand Up @@ -1698,12 +1700,12 @@ class Perl6::Actions is HLL::Actions {
));
}
else {
$/.CURSOR.panic("Cannot use '$*SCOPE' scope with a sub");
$*W.throw($/, 'X::Sub::Scope', scope => $*SCOPE);
}
}
}
elsif $*MULTINESS {
$/.CURSOR.panic('Cannot put ' ~ $*MULTINESS ~ ' on anonymous routine');
$*W.throw($/, 'X::Anon::Multi', multiness => $*MULTINESS);
}

# Apply traits.
Expand Down Expand Up @@ -1867,7 +1869,10 @@ class Perl6::Actions is HLL::Actions {
:private($<specials> && ~$<specials> eq '!'));
}
elsif $*MULTINESS {
$/.CURSOR.panic('Cannot put ' ~ $*MULTINESS ~ ' on anonymous method');
$*W.throw($/, 'X::Anon::Multi',
multiness => $*MULTINESS,
routine-type => 'method',
);
}

my $closure := block_closure(reference_to_code_object($code, $past));
Expand Down Expand Up @@ -2113,7 +2118,7 @@ class Perl6::Actions is HLL::Actions {
}
$*W.pkg_compose($type_obj);
if $<variable> {
$*W.throw($/, ['X', 'NYI'],
$*W.throw($/, 'X::Comp::NYI',
feature => "Variable case of enums",
);
}
Expand Down Expand Up @@ -2248,7 +2253,7 @@ class Perl6::Actions is HLL::Actions {
elsif $<variable> {
# Don't handle twigil'd case yet.
if $<variable><twigil> {
$*W.throw($/, ['X', 'NYI'],
$*W.throw($/, 'X::Comp::NYI',
feature => "Twigil-Variable constants"
);
}
Expand Down Expand Up @@ -2316,7 +2321,7 @@ class Perl6::Actions is HLL::Actions {
my $sep := @*seps[$param_idx];
if ~$sep eq ':' {
if $param_idx != 0 {
$/.CURSOR.panic("Can only use : in a signature after the first parameter");
$*W.throw($/, 'X::Syntax::Signature::InvocantMarker')
}
%info<is_invocant> := 1;
}
Expand Down Expand Up @@ -3337,7 +3342,7 @@ class Perl6::Actions is HLL::Actions {
for @($/) { @stages.unshift($_.ast); }
}
else {
$*W.throw($/, ['X', 'NYI'],
$*W.throw($/, 'X::Comp::NYI',
feature => $/<infix> ~ " feed operator"
);
}
Expand Down Expand Up @@ -3695,7 +3700,7 @@ class Perl6::Actions is HLL::Actions {
my $past := PAST::Op.new( :name('postcircumfix:<{ }>'), :pasttype('callmethod'), :node($/) );
if $<semilist><statement> {
if +$<semilist><statement> > 1 {
$/.CURSOR.panic("Sorry, multi-dimensional indexes are not yet supported");
$*W.throw($/, 'X::Comp::NYI', feature => 'multi-dimensional indexes');
}
$past.push($<semilist>.ast);
}
Expand Down Expand Up @@ -3774,9 +3779,9 @@ class Perl6::Actions is HLL::Actions {
if $<escale> {
my $e := pir::isa($<escale>, 'ResizablePMCArray') ?? $<escale>[0] !! $<escale>;
# pir::say('dec_number exponent: ' ~ ~$e.ast);
make radcalc(10, $<coeff>, 10, nqp::unbox_i($e.ast), :num);
make radcalc($/, 10, $<coeff>, 10, nqp::unbox_i($e.ast), :num);
} else {
make radcalc(10, $<coeff>);
make radcalc($/, 10, $<coeff>);
}
}

Expand All @@ -3796,11 +3801,7 @@ class Perl6::Actions is HLL::Actions {
$exp := +($<exp>[0].Str) if $<exp>;

my $error;
try {
make radcalc($radix, $intfrac, $base, $exp);
CATCH { $error := $_ }
}
$/.CURSOR.panic($error) if pir::defined($error);
make radcalc($/, $radix, $intfrac, $base, $exp);
}
}

Expand Down Expand Up @@ -3959,7 +3960,7 @@ class Perl6::Actions is HLL::Actions {

method quote:sym<rx>($/) {
my $block := PAST::Block.new(PAST::Stmts.new, PAST::Stmts.new, :node($/));
self.handle_and_check_adverbs($/, %SHARED_ALLOWED_ADVERBS, 'm', $block);
self.handle_and_check_adverbs($/, %SHARED_ALLOWED_ADVERBS, 'rx', $block);
my $coderef := regex_coderef($/, $<p6regex>.ast, 'anon', '', [], $block, :use_outer_match(1));
make block_closure($coderef);
}
Expand Down Expand Up @@ -3992,7 +3993,10 @@ class Perl6::Actions is HLL::Actions {
for $<rx_adverbs>.ast {
$multiple := 1 if %MATCH_ADVERBS_MULTIPLE{$_.named};
unless %SHARED_ALLOWED_ADVERBS{$_.named} || %adverbs{$_.named} {
$/.CURSOR.panic("Adverb '" ~ $_.named ~ "' not allowed on " ~ $what);
$*W.throw($/, 'X::Syntax::Regex::Adverb',
adverb => $_.named,
construct => $what,
);
}
if $past {
$past.push($_);
Expand Down Expand Up @@ -4661,9 +4665,9 @@ class Perl6::Actions is HLL::Actions {
# radix, $base, $exponent: parrot numbers (Integer or Float)
# $number: parrot string
# return value: PAST for Int, Rat or Num
sub radcalc($radix, $number, $base?, $exponent?, :$num) {
sub radcalc($/, $radix, $number, $base?, $exponent?, :$num) {
my int $sign := 1;
pir::die("Radix '$radix' out of range (2..36)")
$*W.throw($/, 'X::Syntax::Number::RadixOutOfRange', :$radix)
if $radix < 2 || $radix > 36;
pir::die("You gave us a base for the magnitude, but you forgot the exponent.")
if pir::defined($base) && !pir::defined($exponent);
Expand Down

0 comments on commit c077570

Please sign in to comment.