Commit eb51a2c3 authored by Daniel Dehennin's avatar Daniel Dehennin

New upstream version 2017.04.3

parent 75294a6b
......@@ -62,8 +62,8 @@ very basic guidelines:
and loosely follow [perlstyle](http://perldoc.perl.org/perlstyle.html).
## Commit messages
How to write a good **and** useful commit message. Commit messages are where you
tell the what, why and how of your commit to others.
How to write [a good **and** useful commit message](https://chris.beams.io/posts/git-commit/).
Commit messages are where you tell the what, why and how of your commit to others.
The subject/title of a commit should 50 or less characters ideally. The absolute
maximum is 72. Title's usually will tell what you did. You should almost always
......
......@@ -3,6 +3,7 @@ blib/Perl6/.gitignore
Configure.pl
CONTRIBUTING.md
CREDITS
docs/2017-IO-Grant--Action-Plan.md
docs/announce/2009-02
docs/announce/2009-03
docs/announce/2009-04
......@@ -104,6 +105,10 @@ docs/announce/2016.12.md
docs/announce/2017.01.md
docs/announce/2017.02.md
docs/announce/2017.03.md
docs/announce/2017.04.1.md
docs/announce/2017.04.2.md
docs/announce/2017.04.3.md
docs/announce/2017.04.md
docs/architecture.html
docs/architecture.svg
docs/ChangeLog
......@@ -284,6 +289,7 @@ src/core/Rakudo/Internals.pm
src/core/Rakudo/Internals/VMBackedDecoder.pm
src/core/Rakudo/Iterator.pm
src/core/Rakudo/Metaops.pm
src/core/Rakudo/Sorting.pm
src/core/Range.pm
src/core/Rational.pm
src/core/Rat.pm
......@@ -431,6 +437,7 @@ t/01-sanity/20-defined.t
t/01-sanity/21-try.t
t/01-sanity/53-transpose.t
t/01-sanity/55-use-trace.t
t/01-sanity/98-test-deprecated.t
t/01-sanity/99-test-basic.t
t/02-rakudo/01-is_approx.t
t/02-rakudo/02-new-is-approx.t
......
This diff is collapsed.
This diff is collapsed.
# Announce: Rakudo Perl 6 compiler, Release 2017.04.1
On behalf of the Rakudo development team, I'm announcing an
out-of-schedule release of the Rakudo Perl 6 compiler.
Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1].
This release is a point release in addition to the regular, monthly
releases. Rakudo 2017.04 (note: no .1) inadvertently included debugging output
when `new SomeClass:` calling form was used. In this release that output is
disabled.
The tarball for this release is available from <http://rakudo.org/downloads/rakudo/>.
Please note: This announcement is not for the Rakudo Star
distribution[^2] --- it’s announcing a new release of the compiler
only. For the latest Rakudo Star release, see
<http://rakudo.org/downloads/star/>.
The changes in this release are outlined below:
New in 2017.04.1:
+ Fixes:
+ Removed unwanted debugging output [c9ebfc20]
+ Reverted 9d8e391 IO::Path.resolve fix for JVM, as it does not yet know
how to do utf8-c8 decode [88a6facc]
The following people contributed to this release:
Larry Wall, Zoffix Znet
If you would like to contribute or find out more information, visit
<http://perl6.org>, <http://rakudo.org/how-to-help>, ask on the
<perl6-compiler@perl.org> mailing list, or ask on IRC #perl6 on freenode.
Additionally, we invite you to make a donation to The Perl Foundation
to sponsor Perl 6 development: <https://donate.perlfoundation.org/>
(put "Perl 6 Core Development Fund" in the 'Purpose' text field)
The next release of Rakudo (#111), is tentatively scheduled for 2017-05-20.
A list of the other planned release dates is available in the
“docs/release_guide.pod” file.
The development team appreciates feedback! If you’re using Rakudo, do
get back to us. Questions, comments, suggestions for improvements, cool
discoveries, incredible hacks, or any other feedback -- get in touch with
us through (the above-mentioned) mailing list or IRC channel. Enjoy!
Please note that recent releases have known issues running on the JVM.
We are working to get the JVM backend working again but do not yet have
an estimated delivery date.
[^1]: See <http://moarvm.org/>
[^2]: What’s the difference between the Rakudo compiler and the Rakudo
Star distribution?
[^3]: NQP stands for 'Not Quite Perl', which is a language/environment
that Rakudo is largely written in. See https://github.com/perl6/nqp
The Rakudo compiler is a compiler for the Perl 6 language.
Not much more.
The Rakudo Star distribution is the Rakudo compiler plus a selection
of useful Perl 6 modules, a module installer, 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.
# Announce: Rakudo Perl 6 compiler, Release 2017.04.2
On behalf of the Rakudo development team, I'm announcing an
out-of-schedule release of the Rakudo Perl 6 compiler.
Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1].
This release is a point release in addition to the regular, monthly
releases. This release fixes an issue with method calls on paths in %?RESOURCES
that was introduced in 2017.04 release. The issue impacted installation of several
ecosystem modules. We're currently working on an automated extended testing system that
will prevent such issues from affecting future releases.
The tarball for this release is available from <http://rakudo.org/downloads/rakudo/>.
Please note: This announcement is not for the Rakudo Star
distribution[^2] --- it’s announcing a new release of the compiler
only. For the latest Rakudo Star release, see
<http://rakudo.org/downloads/star/>.
The changes in this release are outlined below:
New in 2017.04.2:
+ Fixes:
+ Fix "Cannot invoke this object (REPR: Null; VMNull)" [4a560aa]
+ Improve relations between %?RESOURCES and Native trait [647abfe]
+ Support all appropriate IO::Path methods on Distribution::Resources [f4f1c42]
The following people contributed to this release:
Stefan Seifert, Zoffix Znet
If you would like to contribute or find out more information, visit
<http://perl6.org>, <http://rakudo.org/how-to-help>, ask on the
<perl6-compiler@perl.org> mailing list, or ask on IRC #perl6 on freenode.
Additionally, we invite you to make a donation to The Perl Foundation
to sponsor Perl 6 development: <https://donate.perlfoundation.org/>
(put "Perl 6 Core Development Fund" in the 'Purpose' text field)
The next release of Rakudo (#111), is tentatively scheduled for 2017-05-20.
A list of the other planned release dates is available in the
“docs/release_guide.pod” file.
The development team appreciates feedback! If you’re using Rakudo, do
get back to us. Questions, comments, suggestions for improvements, cool
discoveries, incredible hacks, or any other feedback -- get in touch with
us through (the above-mentioned) mailing list or IRC channel. Enjoy!
Please note that recent releases have known issues running on the JVM.
We are working to get the JVM backend working again but do not yet have
an estimated delivery date.
[^1]: See <http://moarvm.org/>
[^2]: What’s the difference between the Rakudo compiler and the Rakudo
Star distribution?
[^3]: NQP stands for 'Not Quite Perl', which is a language/environment
that Rakudo is largely written in. See https://github.com/perl6/nqp
The Rakudo compiler is a compiler for the Perl 6 language.
Not much more.
The Rakudo Star distribution is the Rakudo compiler plus a selection
of useful Perl 6 modules, a module installer, 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.
# Announce: Rakudo Perl 6 compiler, Release 2017.04.3
On behalf of the Rakudo development team, I'm announcing an
out-of-schedule release of the Rakudo Perl 6 compiler.
Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1].
This release is a point release in addition to the regular, monthly
releases. This release fixes an issue with `)>` regex capture working
incorrectly when .MATCH is called, e.g. in grammar actions. In addition,
it fixes false positive regex matches when using case-insensitive regexes
and start of string and end of string match. Also, it fixes failure to
load history file when using REPL with Linenoise or Readline on OSX. Last
but not least, this release tests how many point releases is too many :)
As mentioned in previous release announcement, we're working on a system
to do extended testing during and before releases that will include testing
of multiple ecosystem modules. This will prevent issues that require point releases.
The tarball for this release is available from <http://rakudo.org/downloads/rakudo/>.
Please note: This announcement is not for the Rakudo Star
distribution[^2] --- it’s announcing a new release of the compiler
only. For the latest Rakudo Star release, see
<http://rakudo.org/downloads/star/>.
The changes in this release are outlined below:
New in 2017.04.3:
+ Fixes:
+ Fix REPL history file failure with Linoise on [6c66c1b88c]
+ Fix `)>` to work whenever .MATCH is called [2f143f476d][0150c7b8c5]
+ Fixed issues with false positive case-insensitive regex matches
when only start of string and end of string match [f756b4b54f][25048824c8]
The following people contributed to this release:
Samantha McVey, Timo Paulssen, Larry Wall, Zoffix Znet
If you would like to contribute or find out more information, visit
<http://perl6.org>, <http://rakudo.org/how-to-help>, ask on the
<perl6-compiler@perl.org> mailing list, or ask on IRC #perl6 on freenode.
Additionally, we invite you to make a donation to The Perl Foundation
to sponsor Perl 6 development: <https://donate.perlfoundation.org/>
(put "Perl 6 Core Development Fund" in the 'Purpose' text field)
The next release of Rakudo (#111), is tentatively scheduled for 2017-05-20.
A list of the other planned release dates is available in the
“docs/release_guide.pod” file.
The development team appreciates feedback! If you’re using Rakudo, do
get back to us. Questions, comments, suggestions for improvements, cool
discoveries, incredible hacks, or any other feedback -- get in touch with
us through (the above-mentioned) mailing list or IRC channel. Enjoy!
Please note that recent releases have known issues running on the JVM.
We are working to get the JVM backend working again but do not yet have
an estimated delivery date.
[^1]: See <http://moarvm.org/>
[^2]: What’s the difference between the Rakudo compiler and the Rakudo
Star distribution?
[^3]: NQP stands for 'Not Quite Perl', which is a language/environment
that Rakudo is largely written in. See https://github.com/perl6/nqp
The Rakudo compiler is a compiler for the Perl 6 language.
Not much more.
The Rakudo Star distribution is the Rakudo compiler plus a selection
of useful Perl 6 modules, a module installer, 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.
This diff is collapsed.
......@@ -22,9 +22,7 @@ Note that we are trying very hard to ensure there are no backward
compatibility issues post Christmas. As such, we may end up delaying
some releases to ensure any compatibility issues are resolved.
2017-03-18 Rakudo #109 (Zoffix)
2017-04-15 Rakudo #110
2017-05-20 Rakudo #111
2017-05-20 Rakudo #111 (Zoffix)
2017-06-17 Rakudo #112
2017-07-15 Rakudo #113
2017-08-19 Rakudo #114
......@@ -427,6 +425,9 @@ Previous releases were bundled as part of monthly Parrot releases.
2016-12-17 Rakudo #106 "2016.12" (Zoffix + NeuralAnomaly)
2017-01-20 Rakudo #107 "2017.01" (Zoffix + NeuralAnomaly)
2017-02-18 Rakudo #108 "2017.02" (Zoffix + NeuralAnomaly)
2017-03-18 Rakudo #109 "2017.03" (Zoffix + NeuralAnomaly)
2017-04-17 Rakudo #110 "2017.04" (Zoffix + NeuralAnomaly)
2017-04-18 2017.04.1 (Zoffix)
=head1 COPYRIGHT
......
class CompUnit::Repository::Staging is CompUnit::Repository::Installation {
has Str $.name;
submethod BUILD(Str :$!name --> Nil) { }
submethod BUILD(Str :$!name --> Nil) {
CompUnit::RepositoryRegistry.register-name($!name, self);
}
method short-id() { 'staging' }
......@@ -9,10 +11,10 @@ class CompUnit::Repository::Staging is CompUnit::Repository::Installation {
$!name
}
method path-spec(CompUnit::Repository::Staging:D:) {
self.^name ~ '#name(' ~ $!name ~ ')#' ~ $.prefix.abspath;
self.^name ~ '#name(' ~ $!name ~ ')#' ~ $.prefix.absolute;
}
method source-file(Str $name --> IO::Path) {
my $file = self.prefix.child($name);
my $file = self.prefix.add($name);
$file.e ?? $file !! self.next-repo.source-file($name)
}
}
......
......@@ -207,6 +207,12 @@ sub guess_library_name($lib) is export(:TEST) {
my $apiversion = '';
my Str $ext = '';
given $lib {
when IO::Path {
$libname = $lib.absolute;
}
when Distribution::Resource {
return $lib.platform-library-name.Str;
}
when Callable {
return $lib();
}
......@@ -284,7 +290,7 @@ my Lock $setup-lock .= new;
# This role is mixed in to any routine that is marked as being a
# native call.
my role Native[Routine $r, $libname where Str|Callable|List] {
my role Native[Routine $r, $libname where Str|Callable|List|IO::Path|Distribution::Resource] {
has int $!setup;
has native_callsite $!call is box_target;
has Mu $!rettype;
......
......@@ -4,15 +4,11 @@ method render($pod) {
pod2text($pod)
}
my &colored;
my &colored = sub ($text, $) {$text }
if %*ENV<POD_TO_TEXT_ANSI> {
&colored = try {
use MONKEY-SEE-NO-EVAL; # safe, not using EVAL for interpolation
EVAL q{ use Terminal::ANSIColor; &colored }
} // sub ($text, $color) { $text }
} else {
&colored = sub ($text, $color) { $text }
}
(try require Terminal::ANSIColor <&colored>) !=== Nil
and &OUTER::colored = &colored
};
sub pod2text($pod) is export {
given $pod {
......
......@@ -12,6 +12,7 @@ my @vars;
my $indents = "";
# variables to keep track of our tests
my $subtest_callable_type;
my int $num_of_tests_run;
my int $num_of_tests_failed;
my int $todo_upto_test_num;
......@@ -57,6 +58,26 @@ our sub todo_output is rw {
$todo_output
}
multi sub plan (Cool:D :skip-all($reason)!) {
_init_io() unless $output;
$output.say: $indents ~ "1..0 # Skipped: $reason";
exit unless $subtest_level; # just exit if we're not in a subtest
# but if we are, adjust the vars, so the output matches up with zero
# planned tests, all passsing. Also, check the subtest's Callable is
# something we can actually return from.
$subtest_callable_type === Sub|Method
or die "Must give `subtest` a (Sub) or a (Method) to be able to use "
~ "`skip-all` plan inside, but you gave a "
~ $subtest_callable_type.gist;
$done_testing_has_been_run = 1;
$num_of_tests_failed = $num_of_tests_planned = $num_of_tests_run = 0;
nqp::throwpayloadlexcaller(nqp::const::CONTROL_RETURN, True);
}
# "plan 'no_plan';" is now "plan *;"
# It is also the default if nobody calls plan at all
multi sub plan($number_of_tests) is export {
......@@ -370,6 +391,7 @@ multi sub subtest($desc, &subtests) is export { subtest(&subtests,$desc)
multi sub subtest(&subtests, $desc = '') is export {
_push_vars();
_init_vars();
$subtest_callable_type = &subtests.WHAT;
$indents ~= " ";
## TODO: remove workaround for rakudo-j RT #128123 when postfix:<++> does not die here
$subtest_level += 1;
......@@ -413,30 +435,41 @@ multi sub flunk($reason) is export {
$ok or ($die_on_fail and die-on-fail) or $ok;
}
multi sub isa-ok(Mu $var, Mu $type, $msg = ("The object is-a '" ~ $type.perl ~ "'")) is export {
multi sub isa-ok(
Mu $var, Mu $type, $desc = "The object is-a '$type.perl()'"
) is export {
$time_after = nqp::time_n;
my $ok = proclaim($var.isa($type), $msg)
my $ok = proclaim($var.isa($type), $desc)
or _diag('Actual type: ' ~ $var.^name);
$time_before = nqp::time_n;
$ok or ($die_on_fail and die-on-fail) or $ok;
}
multi sub does-ok(Mu $var, Mu $type, $msg = ("The object does role '" ~ $type.perl ~ "'")) is export {
multi sub does-ok(
Mu $var, Mu $type, $desc = "The object does role '$type.perl()'"
) is export {
$time_after = nqp::time_n;
my $ok = proclaim($var.does($type), $msg)
my $ok = proclaim($var.does($type), $desc)
or _diag([~] 'Type: ', $var.^name, " doesn't do role ", $type.perl);
$time_before = nqp::time_n;
$ok or ($die_on_fail and die-on-fail) or $ok;
}
multi sub can-ok(Mu $var, Str $meth, $msg = ( ($var.defined ?? "An object of type '" !! "The type '" ) ~ $var.WHAT.perl ~ "' can do the method '$meth'") ) is export {
multi sub can-ok(
Mu $var, Str $meth,
$desc = ($var.defined ?? "An object of type '" !! "The type '")
~ "$var.WHAT.perl()' can do the method '$meth'"
) is export {
$time_after = nqp::time_n;
my $ok = proclaim($var.^can($meth), $msg);
my $ok = proclaim($var.^can($meth), $desc);
$time_before = nqp::time_n;
$ok or ($die_on_fail and die-on-fail) or $ok;
}
multi sub like(Str $got, Regex $expected, $desc = '') is export {
multi sub like(
Str $got, Regex $expected,
$desc = "text matches '$expected.perl()'"
) is export {
$time_after = nqp::time_n;
$got.defined; # Hack to deal with Failures
my $test = $got ~~ $expected;
......@@ -449,7 +482,10 @@ multi sub like(Str $got, Regex $expected, $desc = '') is export {
$ok or ($die_on_fail and die-on-fail) or $ok;
}
multi sub unlike(Str $got, Regex $expected, $desc = '') is export {
multi sub unlike(
Str $got, Regex $expected,
$desc = "text does not match '$expected.perl()'"
) is export {
$time_after = nqp::time_n;
$got.defined; # Hack to deal with Failures
my $test = !($got ~~ $expected);
......@@ -462,12 +498,12 @@ multi sub unlike(Str $got, Regex $expected, $desc = '') is export {
$ok or ($die_on_fail and die-on-fail) or $ok;
}
multi sub use-ok(Str $code, $msg = ("The module can be use-d ok")) is export {
multi sub use-ok(Str $code, $desc = "$code module can be use-d ok") is export {
$time_after = nqp::time_n;
try {
EVAL ( "use $code" );
}
my $ok = proclaim((not defined $!), $msg) or _diag($!);
my $ok = proclaim((not defined $!), $desc) or _diag($!);
$time_before = nqp::time_n;
$ok or ($die_on_fail and die-on-fail) or $ok;
}
......@@ -678,6 +714,7 @@ sub done-testing() is export {
}
sub _init_vars {
$subtest_callable_type = Mu;
$num_of_tests_run = 0;
$num_of_tests_failed = 0;
$todo_upto_test_num = 0;
......@@ -691,6 +728,7 @@ sub _init_vars {
sub _push_vars {
@vars.push: item [
$subtest_callable_type,
$num_of_tests_run,
$num_of_tests_failed,
$todo_upto_test_num,
......@@ -705,6 +743,7 @@ sub _push_vars {
sub _pop_vars {
(
$subtest_callable_type,
$num_of_tests_run,
$num_of_tests_failed,
$todo_upto_test_num,
......
This diff is collapsed.
......@@ -101,14 +101,14 @@ compiled code.
--ll-exception display a low level backtrace on errors
--profile[=kind] write profile information to an HTML file (MoarVM)
instrumented - performance measurements (default)
heap - record heap snapshots after every
garbage collector run
heap - record heap snapshots after every garbage
collector run
--profile-filename=name
provide a different filename for profile. Extension
controls format:
.json outputs in JSON
.sql outputs in SQL
any other extension outputs in HTML
provide a different filename for profile.
Extension controls format:
.json outputs in JSON
.sql outputs in SQL
any other extension outputs in HTML
--doc=module use Pod::To::[module] to render inline documentation
......
This diff is collapsed.
......@@ -298,12 +298,13 @@ my class Binder {
# Type check failed; produce error if needed.
if nqp::defined($error) {
my %ex := nqp::gethllsym('perl6', 'P6EX');
if nqp::isnull(%ex) || !nqp::existskey(%ex, 'X::TypeCheck::Binding') {
if nqp::isnull(%ex) || !nqp::existskey(%ex, 'X::TypeCheck::Binding::Parameter') {
$error[0] := "Nominal type check failed for parameter '" ~ $varname ~
"'; expected " ~ $nom_type.HOW.name($nom_type) ~
" but got " ~ $oval.HOW.name($oval);
} else {
$error[0] := { nqp::atkey(%ex, 'X::TypeCheck::Binding')($oval, $nom_type.WHAT, $varname) };
$error[0] := { nqp::atkey(%ex, 'X::TypeCheck::Binding::Parameter')($oval,
$nom_type.WHAT, $varname, $param) };
}
}
......@@ -489,21 +490,32 @@ my class Binder {
$cons_type := nqp::p6capturelexwhere($cons_type.clone());
}
my $result;
my $bad_value;
if $got_native == 0 {
$result := $cons_type.ACCEPTS($oval);
$bad_value := $oval unless $result;
}
elsif $got_native == $SIG_ELEM_NATIVE_INT_VALUE {
$result := $cons_type.ACCEPTS($ival);
$bad_value := $ival unless $result;
}
elsif $got_native == $SIG_ELEM_NATIVE_NUM_VALUE {
$result := $cons_type.ACCEPTS($nval);
$bad_value := $nval unless $result;
}
elsif $got_native == $SIG_ELEM_NATIVE_STR_VALUE {
$result := $cons_type.ACCEPTS($sval);
$bad_value := $sval unless $result;
}
unless $result {
if nqp::defined($error) {
$error[0] := "Constraint type check failed for parameter '$varname'";
my %ex := nqp::gethllsym('perl6', 'P6EX');
if nqp::isnull(%ex) || !nqp::existskey(%ex, 'X::TypeCheck::Binding::Parameter') {
$error[0] := "Constraint type check failed for parameter '$varname'";
} else {
$error[0] := { nqp::atkey(%ex, 'X::TypeCheck::Binding::Parameter')(
$bad_value, $cons_type, $varname, $param, 1) };
}
}
return $BIND_RESULT_FAIL;
}
......@@ -1517,20 +1529,26 @@ BEGIN {
my $SIG_ELEM_IS_RW := 256;
my $SIG_ELEM_IS_OPTIONAL := 2048;
my $dcself := nqp::decont($self);
my int $flags := nqp::getattr_i($dcself, Parameter, '$!flags');
if $flags +& $SIG_ELEM_IS_OPTIONAL {
nqp::die("Cannot use 'is rw' on an optional parameter");
}
my str $varname := nqp::getattr_s($dcself, Parameter, '$!variable_name');
unless nqp::isnull_s($varname) || nqp::eqat($varname, '$', 0) {
my $error;
if nqp::eqat($varname, '%', 0) || nqp::eqat($varname, '@', 0) {
my $sig := nqp::substr($varname, 0, 1);
$error := "'$sig' sigil containers don't need 'is rw' to be writable\n";
$error := "For parameter '$varname', '$sig' sigil containers don't need 'is rw' to be writable\n";
}
$error := $error ~ "Can only use 'is rw' on a scalar ('\$' sigil) parameter";
$error := $error ~ "Can only use 'is rw' on a scalar ('\$' sigil) parameter, not '$varname'";
nqp::die($error);
}
my int $flags := nqp::getattr_i($dcself, Parameter, '$!flags');
if $flags +& $SIG_ELEM_IS_OPTIONAL {
my %ex := nqp::gethllsym('perl6', 'P6EX');
if nqp::isnull(%ex) || !nqp::existskey(%ex, 'X::Trait::Invalid') {
nqp::die("Cannot use 'is rw' on optional parameter '$varname'");
}
else {
nqp::atkey(%ex, 'X::Trait::Invalid')('is', 'rw', 'optional parameter', $varname);
}
}
my $cd := nqp::getattr($dcself, Parameter, '$!container_descriptor');
if nqp::defined($cd) { $cd.set_rw(1) }
nqp::bindattr_i($dcself, Parameter, '$!flags', $flags + $SIG_ELEM_IS_RW);
......@@ -1801,7 +1819,8 @@ BEGIN {
$dc_self
}
else {
nqp::die("Cannot add a dispatchee to a non-dispatcher code object");
nqp::die("Cannot add dispatchee '" ~ $dispatchee.name() ~
"' to non-dispatcher code object '" ~ $self.name() ~ "'");
}
}));
Routine.HOW.add_method(Routine, 'derive_dispatcher', nqp::getstaticcode(sub ($self) {
......@@ -2768,7 +2787,7 @@ BEGIN {
Regex.HOW.add_parent(Regex, Method);
Regex.HOW.add_attribute(Regex, scalar_attr('@!caps', List, Regex));
Regex.HOW.add_attribute(Regex, scalar_attr('$!nfa', Mu, Regex));
Regex.HOW.add_attribute(Regex, scalar_attr('@!alt_nfas', List, Regex));
Regex.HOW.add_attribute(Regex, scalar_attr('%!alt_nfas', Hash, Regex));
Regex.HOW.add_attribute(Regex, scalar_attr('$!source', str, Regex));
Regex.HOW.add_method(Regex, 'SET_CAPS', nqp::getstaticcode(sub ($self, $caps) {
nqp::bindattr(nqp::decont($self), Regex, '@!caps', $caps)
......@@ -2777,10 +2796,10 @@ BEGIN {
nqp::bindattr(nqp::decont($self), Regex, '$!nfa', $nfa)
}));
Regex.HOW.add_method(Regex, 'SET_ALT_NFA', nqp::getstaticcode(sub ($self, str $name, $nfa) {
my %alts := nqp::getattr(nqp::decont($self), Regex, '@!alt_nfas');
my %alts := nqp::getattr(nqp::decont($self), Regex, '%!alt_nfas');
unless %alts {
%alts := nqp::hash();
nqp::bindattr(nqp::decont($self), Regex, '@!alt_nfas', %alts);
nqp::bindattr(nqp::decont($self), Regex, '%!alt_nfas', %alts);
}
nqp::bindkey(%alts, $name, $nfa);
}));
......@@ -2792,9 +2811,17 @@ BEGIN {
}));
Regex.HOW.add_method(Regex, 'ALT_NFA', nqp::getstaticcode(sub ($self, str $name) {
nqp::atkey(
nqp::getattr(nqp::decont($self), Regex, '@!alt_nfas'),
nqp::getattr(nqp::decont($self), Regex, '%!alt_nfas'),
$name)
}));
Regex.HOW.add_method(Regex, 'ALT_NFAS', nqp::getstaticcode(sub ($self) {
my $store := nqp::decont(nqp::getattr(nqp::decont($self), Regex, '%!alt_nfas'));
if nqp::istype($store, Hash) {
nqp::hash();
} else {
$store
}
}));
Regex.HOW.compose_repr(Regex);
Regex.HOW.compose_invocation(Regex);
......@@ -3078,7 +3105,8 @@ BEGIN {
EXPORT::DEFAULT.WHO<Metamodel> := Metamodel;
EXPORT::DEFAULT.WHO<ForeignCode> := ForeignCode;
}
EXPORT::DEFAULT.WHO<NQPCursorRole> := NQPCursorRole;
EXPORT::DEFAULT.WHO<NQPMatchRole> := NQPMatchRole;
EXPORT::DEFAULT.WHO<NQPdidMATCH> := NQPdidMATCH;
# Set up various type mappings.
nqp::p6settypes(EXPORT::DEFAULT.WHO);
......
......@@ -22,7 +22,7 @@ class Perl6::Metamodel::NativeHOW
}
method new_type(:$name = '<anon>', :$repr = 'P6opaque', :$ver, :$auth) {
my $metaclass := self.new(:nativesize(0));
my $metaclass := self.new();
my $obj := nqp::settypehll(nqp::newtype($metaclass, $repr), 'perl6');
$metaclass.set_name($obj, $name);
$metaclass.set_ver($obj, $ver) if $ver;
......@@ -34,7 +34,7 @@ class Perl6::Metamodel::NativeHOW
self.compute_mro($obj);
self.publish_method_cache($obj);
self.publish_type_cache($obj);
if !$!composed && $!nativesize {
if !$!composed && ($!nativesize || $!unsigned) {
my $info := nqp::hash();
$info<integer> := nqp::hash();
$info<integer><unsigned> := 1 if $!unsigned;
......@@ -44,8 +44,10 @@ class Perl6::Metamodel::NativeHOW
$info<float><bits> := $!nativesize;
}
else {
$info<integer><bits> := nqp::unbox_i($!nativesize);
$info<float><bits> := nqp::unbox_i($!nativesize);
if $!nativesize {
$info<integer><bits> := nqp::unbox_i($!nativesize);
$info<float><bits> := nqp::unbox_i($!nativesize);
}
}
nqp::composetype($obj, $info);
}
......
This diff is collapsed.
......@@ -271,9 +271,10 @@ Did you mean to add a stub (\{...\}) or did you mean to .classify?"
}
else {
my $result;
my int $stopped;
nqp::stmts(
nqp::until(
(my int $stopped),
$stopped,
nqp::stmts(
($stopped = 1),
nqp::handle(
......@@ -300,40 +301,48 @@ Did you mean to add a stub (\{...\}) or did you mean to .classify?"
method push-all($target --> IterationEnd) {
my $pulled;
my int $stopped;
nqp::until(
nqp::eqaddr(($pulled := $!source.pull-one),IterationEnd),
nqp::until(
(my int $stopped),
nqp::stmts(
($stopped = 1),
nqp::handle(
$target.push(&!block($pulled)),
'LABELED', $!label,
'REDO', ($stopped = 0),
'LAST', return
)