Commit 89ceca13 authored by Dominique Dumont's avatar Dominique Dumont

New upstream version 2016.12

parent 6fda6515
......@@ -79,6 +79,11 @@ D: Pugs, a Perl6->Parrot implementation.
N: bacek
E: bacek@illusion.dev.optusnet.com.au
N: Bahtiar `kalkin-` Gadimov
U: kalkin
E: bahtiar@gadimov.de
W: https://bahtiar.gadimov.de/
N: Bart Wiegmans
U: bdw
U: brrt
......@@ -348,6 +353,10 @@ S: Brooklyn, NY, USA
N: Jan Ingvoldstad
E: jani+perl6-2010@ifi.uio.no
N: Jan-Olof Hendig
U: dogbert17
E: jan-olof.hendig@bredband.net
N: japhb
E: gjb@sonic.net
......@@ -505,6 +514,10 @@ S: South Lake Tahoe, CA, USA
N: Mark Grimes
E: mgrimes@cpan.org
N: Mark Rushing
E: seatek@gmail.com
U: adaptiveoptics
N: Mark Shoulson
E: mark@kli.org
......@@ -662,6 +675,11 @@ E: ruz@bestpractical.com
N: Salve J. Nilsen
E: sjn+gnurf@kaizendo.org
N: Samantha McVey
E: samantham@posteo.net
W: cry.nu
U: samcv
N: sergot
E: filip@sergot.pl
......
......@@ -35,7 +35,7 @@ MAIN: {
GetOptions(\%options, 'help!', 'prefix=s',
'sysroot=s', 'sdkroot=s',
'backends=s', 'no-clean!',
'gen-nqp:s',
'with-nqp=s', 'gen-nqp:s',
'gen-moar:s', 'moar-option=s@',
'git-protocol=s',
'make-install!', 'makefile-timing!',
......@@ -67,6 +67,11 @@ MAIN: {
}
my @backends;
my %backends;
if (my $nqp_bin = $options{'with-nqp'}) {
die "Could not find $nqp_bin" unless -e $nqp_bin;
$options{backends} = qx{$nqp_bin -e 'print(nqp::getcomp("nqp").backend.name)'}
or die "Could not get backend information from $nqp_bin";
}
if (defined $options{backends}) {
$options{backends} = join ",", @known_backends
if uc($options{backends}) eq 'ALL';
......@@ -104,7 +109,7 @@ MAIN: {
$backends{moar} = 1;
$default_backend ||= 'moar';
}
unless (%backends) {
unless (%backends or exists $options{'with-nqp'}) {
die "No suitable nqp executables found! Please specify some --backends, or a --prefix that contains nqp-{p,j,m} executables\n\n"
. "Example to build for all backends (which will take a while):\n"
. "\tperl Configure.pl --backends=moar,jvm --gen-moar\n\n"
......@@ -277,8 +282,8 @@ MAIN: {
unless ($win) {
$config{'m_cleanups'} = " \$(M_GDB_RUNNER) \\\n \$(M_VALGRIND_RUNNER)";
$config{'m_all'} = '$(M_GDB_RUNNER) $(M_VALGRIND_RUNNER)';
$config{'m_install'} = "\t" . '$(M_RUN_PERL6) tools/build/create-moar-runner.pl "$(MOAR)" perl6.moarvm $(DESTDIR)$(PREFIX)/bin/perl6-gdb-m "$(PERL6_LANG_DIR)/runtime" "gdb" "$(M_LIBPATH)" "$(PERL6_LANG_DIR)/lib" "$(PERL6_LANG_DIR)/runtime"' . "\n"
. "\t" . '$(M_RUN_PERL6) tools/build/create-moar-runner.pl "$(MOAR)" perl6.moarvm $(DESTDIR)$(PREFIX)/bin/perl6-valgrind-m "$(PERL6_LANG_DIR)/runtime" "valgrind" "$(M_LIBPATH)" "$(PERL6_LANG_DIR)/lib" "$(PERL6_LANG_DIR)/runtime"';
$config{'m_install'} = "\t" . '$(M_RUN_PERL6) tools/build/create-moar-runner.pl "$(MOAR)" perl6.moarvm $(DESTDIR)$(PREFIX)/bin/perl6-gdb-m "$(PERL6_LANG_DIR)/runtime" "gdb" "" "$(M_LIBPATH)" "$(PERL6_LANG_DIR)/lib" "$(PERL6_LANG_DIR)/runtime"' . "\n"
. "\t" . '$(M_RUN_PERL6) tools/build/create-moar-runner.pl "$(MOAR)" perl6.moarvm $(DESTDIR)$(PREFIX)/bin/perl6-valgrind-m "$(PERL6_LANG_DIR)/runtime" "valgrind" "" "$(M_LIBPATH)" "$(PERL6_LANG_DIR)/lib" "$(PERL6_LANG_DIR)/runtime"';
}
unless (@errors) {
......@@ -377,6 +382,8 @@ General Options:
Download, build, and install a copy of NQP before writing the Makefile
--gen-moar[=branch]
Download, build, and install a copy of MoarVM to use before writing the Makefile
--with-nqp='/path/to/nqp'
Provide path to already installed nqp
--make-install Install Rakudo after configuration is done
--moar-option='--option=value'
Options to pass to MoarVM's Configure.pl
......
......@@ -100,6 +100,7 @@ docs/announce/2016.08.md
docs/announce/2016.09.md
docs/announce/2016.10.md
docs/announce/2016.11.md
docs/announce/2016.12.md
docs/architecture.html
docs/architecture.svg
docs/ChangeLog
......@@ -471,6 +472,7 @@ t/04-nativecall/19-function-pointers.t
t/04-nativecall/20-concurrent.c
t/04-nativecall/20-concurrent.t
t/04-nativecall/CompileTestLib.pm
t/05-messages/01-errors.t
t/fudgeandrun
t/harness5
t/harness6
......@@ -491,7 +493,9 @@ tools/build/Makefile-JVM.in
tools/build/Makefile-Moar.in
tools/build/makeMAGIC_INC_DEC.pl6
tools/build/makeNATIVE_ARRAY.pl6
tools/build/makeNATIVE_SHAPED_ARRAY.pl6
tools/build/makeSLICE.pl6
tools/build/makeUNIPROP.pl6
tools/build/moar_core_sources
tools/build/nqp-jvm-rr.pl
tools/build/NQP_REVISION
......
New in 2016.12
+ Fixes
+ Fixed inability to autocurry superscript exponents properly [c35d562]
+ Fixed Match.prematch and Match.postmatch for zero-width matches [c04b8b5]
+ Fixed Match objects being erroneously treated as value types [7f26e8b]
+ Made U+2212 minus work in places it didn't [cb9df2b][01775b7][6cd2144]
+ prefix:<~> now calls .Str on Str types (helps with allomorphs) [e0a415f]
+ Fixed errors in `$*ARGFILES.lines` limit counter [bd42363]
+ Fixed bug with add history for Readline module in REPL [f544e4c]
+ sum and [+] metaop now correctly work on Junctions [8d04bec]
+ Fixed various scoping bugs with NEXT/LAST/QUIT [6bb8823]
+ Fixed issues in QUIT handlers running asynchronously [c027e6a]
+ Fixed occassional hangs in Proc::Async [e4d78c6]
+ Fixed operations still running after supply deactivation [f928a20]
+ Fixed Iterator.flat occasionally skipping inner iterables [61a18c0]
+ Fixed slurp not propagating :bin and :enc args on `$*ARGFILES` [15f51a5]
+ Fixed negative zero handling in many places
[f1263ab][e2587cd][a9654c0][085145f]
+ Synthetics in numbers in colonpairs in :42foo format now throw [4663d43]
+ Fixed hang in .subst with no arguments [0a874fb]
+ Fixed sleep() with huge values failing to sleep
[c797d3f][7c5ea31][2f72fa0]
+ Fixed attributive binding not looking outward for `self` [843a6be]
+ Fixed sprintf($format) without args issuing spurious warnings [35183f3]
+ Fixed infix:<===> failing when both sides are allomorphs [4a59ab4]
+ Fixed data race in Supply.interval [47ffdea]
+ Fixed data races in supply/whenever [33f7456]
+ Fixed memory corruption in Proc::Async [74eb6b9]
+ Fixed handling of time resolutions below 1ms in Supply.interval [c38f1ad]
+ Fixed issues with `-Inf` being a single term [ae614f9]
+ Fixed Signature.gist stripping sigils from anon typeless scalars [219f527]
+ Made permutations/combinations/grep die instead
of fail()ing [ab3a59c][bc13bb5]
+ Fixed spurious warnings on .trans with regex pair complements [2e1b82c]
+ Fixed premature frees in async sockets when errors occur [b2ac4e4]
+ Fixed handling of superscript powers larger than int [0428b79]
+ Fixed Proc::Async sending empty string to taps on program exit [7532297]
+ Fixed wrong results for .first on Numerics [8cb3e1b]
+ Fixed matcher-less .first not respecting its adverbs [ababb24]
+ Fixed `sink` statement prefix failing to explode Failures [345f6a7]
+ Fixed regression in S:g/// not returning original string [5476d60]
+ Reverted .match/.comb to return empty List instead of Empty when failing
to match [5476d60]
+ Fixed Mu.clone incorrectly marking all attributes as initialized [9a161fa]
+ Fixed cloned Baggy having an undefined .WHICH [9a161fa]
+ Fixed smartmatching against UInt type object [f9d34a9]
+ Fixed some Date constructors accepting invalid dates [aa27d5c]
+ Fixed .rotor on empty list returning an internal iterator object [5558710]
+ Fixed unimatch to check canonical short/alternate unicode props [b456471]
+ Fixed uniprop to return correct values for na, uc, tc, lc properties
[2a8ec40]
+ Fixed uniprop for 'Numeric_Value' not returning a numeric value [9ff5b7e]
+ Fixed crash with Rat Ranges constructed with Range ops [1d46004]
+ Fixed crash with tapping supplies supplied by thunked block [a980eb1]
+ Fixed .perl on parametarized Hashes with no items in them [003e654]
+ Fixed .perl for itemized Slips [8eef234]
+ Fixed chained `andthen`/`orelse` operators returning internals [287af6a]
+ Fixed ThreadPoolScheduler.cue not applying delays to all cues [b286048]
+ Fixed control exception propagation when thrown from within statements
handled by `without`, `with`, `andthen`, or `noandthen [9a3c350]
+ Fixed Rand.rand generating value equal to excluded end point [334d134]
+ Fixed `last` not working inside .grep's block [7021861][f775474]
+ Fixed .head not always returning a .Seq [69d808f]
+ Various fixes and improvements in error reporting
+ Additions:
+ Bare \b, \B, and \K in regexes now throw [08589d3][ee14067]
+ Added SQL as an output option for --profile-filename [f20b8b6]
+ Implemented native str Arrays [014d4cf][6d726f8]
+ sub MAIN now allows Enums as type constraints [546dbd9]
+ Count in .pick/pickpairs/grab/grabpairs can now be a Callable [e9487d6]
+ REPL with Readline module now loads `inputrc` files [573ed59]
+ REPL with Readline module now saves history [9043f58]
+ perl6 --doc=Text now shows signature parameter pod [6ea6563]
+ Generated sub MAIN usage message now shows original program name [b597b7c]
+ Added arity-1 infix:<~> for Blobs [77e9d4b]
+ Added IO::Handle.printf [8774f24][3c4ac3c]
+ Added ability to negate all numeric literals in signatures [5baa064]
+ Added .reverse/.rotate/.sum to shaped 1-dimmed arrays [a2ede36][4f4737d]
+ Added Mu.emit [4e76827]
+ Added --with-nqp Configure option for having NQP in
a different prefix [6f6e6db]
+ Added .gist, .perl, and .Str to BOOTSTRAPATTR [3dd2916]
+ Made .sum nodal [4fd6e94]
+ Implemented uniprops [f55ff82][0328422][05db996]
+ Added 5 new sets of matching brackets for available delimiters [8965145]
+ Removals:
+ Removed X::Syntax::Number::InvalidCharacter exception [a8ff3b9]
+ Efficiency:
+ Made indirect type lookup 3x as fast [939d273]
+ Made shaped(int|num|str)array.AT-POS at least 15% faster [bfe89a5]
+ Made shaped(int|num|str)array.ASSIGN-POS at least 10% faster [ecc202e]
+ Made shaped(int|num|str)array.EXISTS-POS at least 20% faster [bbbb2b6]
+ Made 1-dimmed native arrays at least 3x faster [4a711bc]
+ Made native shaped array creation about 1.5x faster [1b840f1]
+ Made native 1-dimmed array init at least 11x faster [b6de5e8]
+ Made native 1-dimmed array copying at least 25x faster [b6de5e8]
+ Made use of native 2-dimmed arrays 2.5x–4x faster [172898e]
+ Made use of native 3-dimmed arrays 2.5x–4x faster [64343d7]
+ Made copying 1+ dimmed native arrays up to 9x faster [e0c0ae5][331c2e2]
+ Made copying intX[2;2] to intY[2;2] native array just as fast as
copying intX[2;2] to intX[2;2] [79090b2]
+ Made native shaped array initialization 4x–6x faster [d704820]
+ Made iteration of 1-dimmed native arrays 17x faster [947422b]
+ Made iteration of >1 dimmed native arrays 11x faster [3e93ddd]
+ Made .(anti)pairs for native shaped arrays 7x faster [39261e7][471cea2]
+ Made .kv for native shaped arrays 16x faster [965fa4d][c1a3a3c]
+ Made native array.reverse|rotate about 20x faster [0ee6bc0]
+ Made @a[2;2] about 40% faster [b9e2ffa]
+ Optimized Int->int coercion [b2ac4e4]
+ Made infix:<..> on Nums 13x faster [a8ba26b]
+ Made uniprop with the default lookup 5x faster and other lookups 15% faster. [474ea33]
+ Made print, say and note 25% faster to stderr and stdout [e9ce28a]
New in 2016.11
+ Fixes:
+ Various improvements to warning/error-reporting
......
This diff is collapsed.
......@@ -39,7 +39,7 @@ mistakes.
## Releases
Releases will be cut from master. The release manager will have the advantage
of knowing they are release something that has already passed a bunch of
of knowing they are releasing something that has already passed a bunch of
automated quality checks. The release process will be something like:
* Create a release branch based off master
......@@ -156,4 +156,4 @@ About Perl 6.d, expect an incremental update.
A lot of effort in 2016 will go on performance engineering and making things
more robust. Macros and slangs are the biggest post-6.c project language wise;
if they happen to be in great shape by 6.d then they can make it in, but if
not they'd be a reasonable target for 6.e.
\ No newline at end of file
not they'd be a reasonable target for 6.e.
......@@ -22,8 +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.
2016-11-19 Rakudo #105 (Zoffix)
2016-12-17 Rakudo #106
2016-12-17 Rakudo #106 (Zoffix)
2017-01-21 Rakudo #107
2017-02-18 Rakudo #108
2017-03-18 Rakudo #109
......@@ -424,6 +423,7 @@ Previous releases were bundled as part of monthly Parrot releases.
2016-08-20 2016.08.1 (Zoffix)
2016-09-17 Rakudo #103 "2016.09" (Zoffix + NeuralAnomaly)
2016-10-15 Rakudo #104 "2016.10" (Zoffix + NeuralAnomaly)
2016-11-19 Rakudo #105 "2016.11" (Zoffix + NeuralAnomaly)
=head1 COPYRIGHT
......
......@@ -113,9 +113,12 @@ sub declarator2text($pod) {
sub signature2text($params) {
$params.elems ??
"(\n\t" ~ $params.map({ $_.perl }).join(", \n\t") ~ "\n)"
"(\n\t" ~ $params.map(&param2text).join("\n\t") ~ "\n)"
!! "()";
}
sub param2text($p) {
$p.perl ~ ',' ~ ( $p.WHY ?? ' # ' ~ $p.WHY !! ' ')
}
my %formats =
C => "bold",
......
This diff is collapsed.
......@@ -65,49 +65,50 @@ class Perl6::Compiler is HLL::Compiler {
method usage($name?) {
say(($name ?? $name !! "") ~ " [switches] [--] [programfile] [arguments]
With no arguments, enters a REPL. With a \"[programfile]\" or the \"-e\"
option, compiles the given program and, by default, also executes the
compiled code.
-c check syntax only (runs BEGIN and CHECK blocks)
--doc extract documentation and print it as text
-e program one line of program, strict is enabled by default
-h, --help display this help text
-n run program once for each line of input
-p same as -n, but also print \$_ at the end of lines
-I path adds the path to the module search path
-M module loads the module prior to running the program
--target=stage specify compilation stage to emit
--optimize=level use the given level of optimization (0..3)
--encoding=mode specify string encoding mode
-o, --output=name specify name of output file
-v, --version display version information
--stagestats display time spent in the compilation stages
--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
--profile-filename=name
provide a different filename; if the name ends in
.json, instrumented profiles will be written as
JSON instead of HTML
--doc=module use Pod::To::[module] to render inline documentation
Note that only boolean single-letter options may be bundled.
To modify the include path, you can set the PERL6LIB environment variable:
PERL6LIB=\"lib\" perl6 example.pl
"); # end of usage statement
nqp::exit(0);
With no arguments, enters a REPL. With a \"[programfile]\" or the \"-e\"
option, compiles the given program and, by default, also executes the
compiled code.
-c check syntax only (runs BEGIN and CHECK blocks)
--doc extract documentation and print it as text
-e program one line of program, strict is enabled by default
-h, --help display this help text
-n run program once for each line of input
-p same as -n, but also print \$_ at the end of lines
-I path adds the path to the module search path
-M module loads the module prior to running the program
--target=stage specify compilation stage to emit
--optimize=level use the given level of optimization (0..3)
--encoding=mode specify string encoding mode
-o, --output=name specify name of output file
-v, --version display version information
--stagestats display time spent in the compilation stages
--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
--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
--doc=module use Pod::To::[module] to render inline documentation
Note that only boolean single-letter options may be bundled.
To modify the include path, you can set the PERL6LIB environment variable:
PERL6LIB=\"lib\" perl6 example.pl
"); # end of usage statement
# TODO: create and install a man page for Perl 6; then add the following
# line to the end of the usage text above:
#
# For more information, see the perl6(1) man page.\n");
nqp::exit(0);
# TODO: create and install a man page for Perl 6; then add the following
# line to the end of the usage text above:
#
# For more information, see the perl6(1) man page.\n");
}
}
......@@ -172,7 +172,7 @@ role STD {
$here.'!cursor_pos'($stop.pos);
# Get it trimmed and AST updated.
$*ACTIONS.trim_heredoc($doc, $stop, $herestub.orignode.MATCH.ast);
$*ACTIONS.trim_heredoc(self, $doc, $stop, $herestub.orignode.MATCH.ast);
}
else {
self.panic("Ending delimiter $*DELIM not found");
......@@ -282,7 +282,7 @@ role STD {
self.typed_sorry('X::Syntax::BlockGobbled', what => ($borg<name> // ''));
self.'!cursor_pos'($pos);
self.missing("block (apparently claimed by " ~ ($borg<name> ?? "'" ~ $borg<name> ~ "'" !! "expression") ~ ")");
} elsif nqp::substr(self.orig(), $pos - 1, 1) eq '}' {
} elsif $pos > 0 && nqp::substr(self.orig(), $pos - 1, 1) eq '}' {
self.missing("block (whitespace needed before curlies taken as a hash subscript?)");
} elsif $has_mystery {
self.missing("block (taken by some undeclared routine?)");
......@@ -1421,9 +1421,25 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
}
rule statement_control:sym<unless> {
$<sym>=[unless|without]<.kok> {}
<xblock($<sym> eq 'without')>
[ <!before [els[e|if]|orwith]» > || <.typed_panic: 'X::Syntax::UnlessElse'> ]
$<sym>='unless'<.kok>
<xblock(0)> # 0 means we're not parsing `without`
[ <!before [els[e|if]|orwith]» >
|| $<wrong-keyword>=[els[e|if]|orwith]» {}
<.typed_panic: 'X::Syntax::UnlessElse',
keyword => ~$<wrong-keyword>,
>
]
}
rule statement_control:sym<without> {
$<sym>='without'<.kok>
<xblock(1)> # 1 means we're not parsing `unless`
[ <!before [els[e|if]|orwith]» >
|| $<wrong-keyword>=[els[e|if]|orwith]» {}
<.typed_panic: 'X::Syntax::WithoutElse',
keyword => ~$<wrong-keyword>,
>
]
}
rule statement_control:sym<while> {
......@@ -1805,6 +1821,23 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
$/.CURSOR.typed_panic('X::Syntax::NegatedPair', key => ~$<identifier>) } ]?
{ $*key := $<identifier>.Str; $*value := 0; }
| $<num> = [\d+] <identifier> [ <?before <[ \[ \( \< \{ ]>> {} <.sorry("Extra argument not allowed; pair already has argument of " ~ $<num>.Str)> <.circumfix> ]?
<?{
# Here we go over each character in the numeral and check $ch.chr eq $ch.ord.chr
# to fail any matches that have synthetics, such as 7\x[308]
my $num := ~$<num>;
my $chars-num := nqp::chars($num);
my $pos := -1;
nqp::while(
nqp::islt_i( ($pos := nqp::add_i($pos, 1)), $chars-num )
&& nqp::eqat(
$num,
nqp::chr( nqp::ord($num, $pos) ),
$pos,
),
nqp::null,
);
nqp::iseq_i($chars-num, $pos);
}>
{ $*key := $<identifier>.Str; $*value := nqp::radix_I(10, $<num>, 0, 0, $*W.find_symbol(['Int']))[0]; }
| <identifier>
{ $*key := $<identifier>.Str; }
......@@ -2931,7 +2964,7 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
:my $*IN_DECL := '';
[
| <value>
| $<value>=['-'\d+]
| [ <[-−]> :my $*NEGATE_VALUE := 1; | '+' ] $<value>=<numish>
| <typename>
| where <.ws> <EXPR('i=')>
]
......@@ -3383,8 +3416,7 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
| <rat_number>
| <complex_number>
| 'Inf' >>
| '+Inf' >>
| '-Inf' >>
| $<uinf>=''
| <?{ nqp::existskey(nqp::backendconfig(), 'moarlib') }> <unum=:No+:Nl>
]
}
......@@ -3448,13 +3480,13 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
token escale { <[Ee]> <sign> <decint> }
token sign { '+' | '-' | '' }
token sign { '+' | '-' | '−' | '' }
token rat_number { '<' <bare_rat_number> '>' }
token bare_rat_number { <?before <[\-+0..9<>:boxd]>+? '/'> <nu=.signed-integer> '/' <de=integer> }
token bare_rat_number { <?before <[-+0..9<>:boxd]>+? '/'> <nu=.signed-integer> '/' <de=integer> }
token complex_number { '<' <bare_complex_number> '>' }
token bare_complex_number { <?before <[\-+0..9<>:.eEboxdInfNa\\]>+? 'i'> <re=.signed-number> <?[\-+]> <im=.signed-number> \\? 'i' }
token bare_complex_number { <?before <[-+0..9<>:.eEboxdInfNa\\]>+? 'i'> <re=.signed-number> <?[-+]> <im=.signed-number> \\? 'i' }
token typename {
:my %colonpairs;
......@@ -3560,13 +3592,13 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
proto token quote { <...> }
token quote:sym<apos> { :dba('single quotes') "'" ~ "'" <nibble(self.quote_lang(%*LANG<Quote>, "'", "'", ['q']))> }
token quote:sym<sapos> { :dba('smart single quotes') "‘" ~ "’" <nibble(self.quote_lang(%*LANG<Quote>, "‘", "’", ['q']))> }
token quote:sym<lapos> { :dba('low smart single quotes') "‚" ~ <[’‘]> <nibble(self.quote_lang(%*LANG<Quote>, "‚", ["’","‘"], ['q']))> }
token quote:sym<hapos> { :dba('high smart single quotes') "’" ~ <[’‘]> <nibble(self.quote_lang(%*LANG<Quote>, "’", ["’","‘"], ['q']))> }
token quote:sym<sapos> { :dba('curly single quotes') "‘" ~ "’" <nibble(self.quote_lang(%*LANG<Quote>, "‘", "’", ['q']))> }
token quote:sym<lapos> { :dba('low curly single quotes') "‚" ~ <[’‘]> <nibble(self.quote_lang(%*LANG<Quote>, "‚", ["’","‘"], ['q']))> }
token quote:sym<hapos> { :dba('high curly single quotes') "’" ~ <[’‘]> <nibble(self.quote_lang(%*LANG<Quote>, "’", ["’","‘"], ['q']))> }
token quote:sym<dblq> { :dba('double quotes') '"' ~ '"' <nibble(self.quote_lang(%*LANG<Quote>, '"', '"', ['qq']))> }
token quote:sym<sdblq> { :dba('smart double quotes') '' ~ '' <nibble(self.quote_lang(%*LANG<Quote>, '', '', ['qq']))> }
token quote:sym<ldblq> { :dba('low smart double quotes') '' ~ <[”“]> <nibble(self.quote_lang(%*LANG<Quote>, '', ['',''], ['qq']))> }
token quote:sym<hdblq> { :dba('high smart double quotes') '' ~ <[”“]> <nibble(self.quote_lang(%*LANG<Quote>, '', ['',''], ['qq']))> }
token quote:sym<sdblq> { :dba('curly double quotes') '' ~ '' <nibble(self.quote_lang(%*LANG<Quote>, '', '', ['qq']))> }
token quote:sym<ldblq> { :dba('low curly double quotes') '' ~ <[”“]> <nibble(self.quote_lang(%*LANG<Quote>, '', ['',''], ['qq']))> }
token quote:sym<hdblq> { :dba('high curly double quotes') '' ~ <[”“]> <nibble(self.quote_lang(%*LANG<Quote>, '', ['',''], ['qq']))> }
token quote:sym<crnr> { :dba('corner quotes') '' ~ '' <nibble(self.quote_lang(%*LANG<Quote>, '', ''))> }
token quote:sym<q> {
:my $qm;
......
......@@ -37,6 +37,9 @@ my class BOOTSTRAPATTR {
self.new(:name($!name), :box_target($!box_target), :type($ins))
}
method compose($obj, :$compiler_services) { }
method gist() { $!type.HOW.name($!type) ~ ' ' ~ $!name }
method perl() { 'BOOTSTRAPATTR.new' }
method Str() { $!name }
}
# Stub all types.
......@@ -86,6 +89,7 @@ my stub StrPosRef metaclass Perl6::Metamodel::NativeRefHOW { ... };
#?if moar
my stub IntMultidimRef metaclass Perl6::Metamodel::NativeRefHOW { ... };
my stub NumMultidimRef metaclass Perl6::Metamodel::NativeRefHOW { ... };
my stub StrMultidimRef metaclass Perl6::Metamodel::NativeRefHOW { ... };
#?endif
# Implement the signature binder.
......@@ -1337,6 +1341,7 @@ BEGIN {
#?if moar
setup_native_ref_type(IntMultidimRef, int, 'multidim');
setup_native_ref_type(NumMultidimRef, num, 'multidim');
setup_native_ref_type(StrMultidimRef, str, 'multidim');
#?endif
# class Proxy is Any {
......@@ -1656,6 +1661,49 @@ BEGIN {
my $do_cloned := nqp::clone($do);
nqp::bindattr($cloned, Code, '$!do', $do_cloned);
nqp::setcodeobj($do_cloned, $cloned);
#?if moar
my $phasers := nqp::getattr($dcself, Block, '$!phasers');
if nqp::isconcrete($phasers) {
my int $next := nqp::existskey($phasers, 'NEXT');
my int $last := nqp::existskey($phasers, 'LAST');
my int $quit := nqp::existskey($phasers, 'QUIT');
if $next +| $last +| $quit {
my %pclone := nqp::clone($phasers);
if $next {
my @nexts := nqp::clone($phasers<NEXT>);
my int $i := 0;
while $i < nqp::elems(@nexts) {
@nexts[$i] := @nexts[$i].clone();
$i++;
}
%pclone<NEXT> := @nexts;
}
if $last {
my @lasts := nqp::clone($phasers<LAST>);
my int $i := 0;
while $i < nqp::elems(@lasts) {
nqp::captureinnerlex(nqp::getattr(
(@lasts[$i] := @lasts[$i].clone()),
Code, '$!do'));
$i++;
}
%pclone<LAST> := @lasts;
}
if $quit {
my @quits := nqp::clone($phasers<QUIT>);
my int $i := 0;
while $i < nqp::elems(@quits) {
nqp::captureinnerlex(nqp::getattr(
(@quits[$i] := @quits[$i].clone()),
Code, '$!do'));
$i++;
}
%pclone<QUIT> := @quits;
}
nqp::bindattr($cloned, Block, '$!phasers', %pclone);
}
}
#?endif
my $compstuff := nqp::getattr($dcself, Code, '@!compstuff');
unless nqp::isnull($compstuff) {
$compstuff[2]($do, $cloned);
......@@ -1668,6 +1716,39 @@ BEGIN {
}
$cloned
}));
Block.HOW.add_method(Block, '!capture_phasers', nqp::getstaticcode(sub ($self) {
my $dcself := nqp::decont($self);
#?if moar
my $phasers := nqp::getattr($dcself, Block, '$!phasers');
if nqp::isconcrete($phasers) {
my @next := nqp::atkey($phasers, 'NEXT');
if nqp::islist(@next) {
my int $i := 0;
while $i < nqp::elems(@next) {
nqp::p6capturelexwhere(@next[$i]);
$i++;
}
}
my @last := nqp::atkey($phasers, 'LAST');
if nqp::islist(@last) {
my int $i := 0;
while $i < nqp::elems(@last) {
nqp::p6capturelexwhere(@last[$i]);
$i++;
}
}
my @quit := nqp::atkey($phasers, 'QUIT');
if nqp::islist(@quit) {
my int $i := 0;
while $i < nqp::elems(@quit) {
nqp::p6capturelexwhere(@quit[$i]);
$i++;
}
}
}
#?endif
$dcself
}));
Block.HOW.compose_repr(Block);
Block.HOW.compose_invocation(Block);
......@@ -2858,6 +2939,7 @@ BEGIN {
#?if moar
Perl6::Metamodel::NativeRefHOW.add_stash(IntMultidimRef);
Perl6::Metamodel::NativeRefHOW.add_stash(NumMultidimRef);
Perl6::Metamodel::NativeRefHOW.add_stash(StrMultidimRef);
#?endif
Perl6::Metamodel::ClassHOW.add_stash(List);
Perl6::Metamodel::ClassHOW.add_stash(Slip);
......@@ -3249,6 +3331,7 @@ nqp::sethllconfig('perl6', nqp::hash(
#?if moar
'int_multidim_ref', IntMultidimRef,
'num_multidim_ref', NumMultidimRef,
'str_multidim_ref', StrMultidimRef,
#?endif
));
......
......@@ -108,9 +108,18 @@ my class RoleToClassApplier {
if $yada {
unless has_method($target, $name, 0)
|| has_public_attribute($target, $name) {
my @needed;
for @roles {
for $_.HOW.method_table($_) -> $m {
if $m.key eq $name {
nqp::push(@needed, $_.HOW.name($_));
}
}
}
nqp::die("Method '$name' must be implemented by " ~
$target.HOW.name($target) ~
" because it is required by a role");
$target.HOW.name($target) ~
" because it is required by roles: " ~
nqp::join(", ", @needed) ~ ".");
}
}
elsif !has_method($target, $name, 1) {
......
......@@ -36,14 +36,7 @@ class Perl6::ModuleLoader does Perl6::ModuleLoaderVMConfig {
}
method search_path() {
DEBUG('Setting up default paths: . blib') if $DEBUG;
my @search_paths;
@search_paths.push('.');
@search_paths.push('blib');
for self.vm_search_paths() {
@search_paths.push($_);
}
@search_paths
self.vm_search_paths()
}
method load_module($module_name, %opts, *@GLOBALish, :$line, :$file, :%chosen) {
......@@ -54,9 +47,8 @@ class Perl6::ModuleLoader does Perl6::ModuleLoaderVMConfig {
my $*CTXSAVE := self;
my $*MAIN_CTX;
my $file := 'Perl6/BOOTSTRAP' ~ self.file-extension;
$file := nqp::stat("blib/$file", 0)
?? "blib/$file"
!! nqp::backendconfig<prefix> ~ '/share/nqp/lib/' ~ $file;
my $include := nqp::getcomp('perl6').cli-options<nqp-lib>;
$file := ($include ?? $include ~ '/' !! nqp::getcomp('perl6').config<prefix> ~ '/share/nqp/lib/') ~ $file;
nqp::loadbytecode($file);
%modules_loaded{$file} := my $module_ctx := $*MAIN_CTX;
nqp::bindhllsym('perl6', 'GLOBAL', $preserve_global);
......
......@@ -618,11 +618,6 @@ class Perl6::World is HLL::World {
method mop_up_and_check($/) {
# Emit any worries.
if @*WORRIES {
nqp::printfh(nqp::getstderr(), self.group_exception().gist());
}
# Install POD-related variables.
$*POD_PAST := self.add_constant(
'Array', 'type_new', :nocache, |$*POD_BLOCKS
......@@ -2358,6 +2353,13 @@ class Perl6::World is HLL::World {
$code_past.annotate('WANTMEPLEASE',1);
}
}
if nqp::existskey(%phasers, 'LAST') || nqp::existskey(%phasers, 'NEXT') ||
nqp::existskey(%phasers, 'QUIT') {
$code_past[0].push(QAST::Op.new(
:op('callmethod'), :name('!capture_phasers'),
QAST::Op.new( :op('getcodeobj'), QAST::Op.new( :op('curcode') ) )
));
}
}
}
}
......@@ -4173,7 +4175,8 @@ class Perl6::World is HLL::World {
# Build and throw exception object.
%opts<line> := HLL::Compiler.lineof($c.orig, $c.pos, :cache(1));
%opts<pos> := $c.pos;
# only set <pos> if it's not already set:
%opts<pos> := $c.pos unless nqp::existskey(%opts, 'pos');
%opts<modules> := p6ize_recursive(@*MODULES // []);
%opts<pre> := @locprepost[0];
%opts<post> := @locprepost[1];
......
......@@ -922,12 +922,15 @@ Did you mean to add a stub (\{...\}) or did you mean to .classify?"
method !grep-callable(Callable:D $test) {
if ($test.count == 1) {
$test.?has-phasers
?? self.map({ next unless $test($_);