Commit 117e98a4 authored by Alessandro Ghedini's avatar Alessandro Ghedini

Imported Upstream version 0.1~2012.04.1

parent f18368da
......@@ -8,6 +8,8 @@ Makefile
*.patch
*.pdb
*.res
*.exp
*.lib
lib/Test.pir
lib/Pod/To/Text.pir
CORE.setting.pbc
......
......@@ -31,6 +31,7 @@ MAIN: {
GetOptions(\%options, 'help!', 'prefix=s',
'with-nqp=s', 'gen-nqp:s',
'with-parrot=s', 'gen-parrot:s', 'parrot-option=s@',
'parrot-make-option=s@',
'make-install!', 'makefile-timing!',
);
......@@ -162,6 +163,9 @@ General Options:
Download and build a copy of Parrot
--parrot-option='--option'
Options to pass to Parrot's Configure.pl
--parrot-make-option='--option'
Options to pass to Parrot's make, for example:
--parrot-make-option='--jobs=4'
--makefile-timing Enable timing of individual makefile commands
Configure.pl also reads options from 'config.default' in the current directory.
......
# Roadmap for "nom" Branch
Last Updated 14 jan 2011
## Punch list for nom distribution
This is the "punch list" of items that need addressing before
switching nom to be the new 'master' branch, and before releasing
a nom-based distribution. Each item below contains an importance
(1 == must have, 2 == ought to have, 3 == nice to have) for
branch and distribution, an estimate of the difficulty
(\* == easy, \*\*\*\* = hard), and any identified
responsible parties.
* Enums to level of master (2, 1, ???, ???)
## Other NOMMAP notes
Note that this isn't strictly in order, though things nearer to the top
are likely to get focus sooner.
Current fails that people are likely to encounter (no particular order):
* Order enumeration
Things that aren't blockers but might be worth knowing about:
* attribute `:=` doesn't work in CORE.setting (works outside of setting, though)
(initial digging suggets it's a BOOTSTRAPATTR issue, thus why we only see it
in the setting)
* no rw-accessors for natively typed attributes (yet? spec isn't clear)
## when statements
when needs to properly find use correct outer scope
## Fix up binding some more
Get `::=` correcter, and a bit more stuff on `:=` also.
## Enumerations
* Enums as roles
* Non-numeric enums
* Anonymous enums
## Fix array/hash initialization
`my @a;` needs to initialize @a to be the Array type object (not an Array instance).
Same for my %h and hashes.
## Phasers
* END in pre-compiled mainline case
## Switch Real to be a role
It's a class; work in real-trouble branch.
New in 2012.04.1
+ autvivification for arrays and hashes
+ more robust module precompilation
+ improved infrastructure for calling C code
+ $.foo style calls now contextualize correctly
+ &infix:<cmp> now return members of the Order enum in all cases
+ --doc=format now loads Pod::To::format and uses it for rendering
+ 'lib/' is no longer in the default include path
+ improved Parameter.perl
+ add .changed, .modified and .accessed methods to IO
+ improved --help output
+ install precompiled test module for speedup
+ fixed printing of backtraces when regexes are in the call chain
+ case insensitive regex matches now also work for interpolated variables
New in 2012.04
+ 'defined' is now a listop instead of a prefix op
+ fixed :16('0d...')
+ implemented simple interpolation in names in type declarations (class ::(const) { })
+ $=POD renamed to $=pod
+ fixed slicing of non-lists with infinite ranges
+ fixed accidental over-serialization, cutting ~300KB off each pre-compiled module
+ scalar positionals no longer treated as slices
+ implemented Routine.package
+ join will now always reify at least 4 elements of a list if possible
+ warnings now have line numbers
+ brought back Str.indent
+ ban declaring pseudo-packages, with a helpful error
+ a name followed by :: now returns .WHO, so Foo::<&bar> style lookups work
+ Exception.Bool now returns true
+ avoided re-parsing of longname, which speeds up the parse a bit overall
+ implemented MY, CALLER, OUTER, UNIT, CORE, SETTING and DYNAMIC pseudo-packages
+ implemented ::<$x> and ::{'$x'} style lookups
+ some small optimizations to various Str built-ins and MapIter
+ improved --doc output
+ added $*PERL
+ implemented IO::ArgFiles.slurp
New in 2012.03
+ updated to dyncall 0.7
+ infix:<eqv> now autothreads over junctions
+ more typed exceptions
+ pre-compiled modules/settings are now serialized, not re-built on load
+ startup time is now about 25% of what it once was
+ significant memory and time reduction (~40%) when pre-compiling modules/settings
+ BEGIN and CHECK now work in r-value context
+ constant declarator now works with non-literals on the RHS
+ implemented Set, Bag, KeySet and KeyBag types
+ implemented :exhaustive and :nth match adverbs
+ implemented ENTER, LEAVE, KEEP and UNDO phasers
+ implemented FIRST, NEXT and LAST phasers in for loops
+ implemented START phaser, including use of it in r-value context
+ implemented also syntax for adding traits inside a block/package
+ implemented macro declarations and quasi quotes (sans placeholders)
+ implemented anonymous enums
+ 'our multi' now dies (used to ignore the 'our')
+ implemented PRE and POST phasers
+ ~25% performance improvement to array indexing
New in 2012.02
+ catch duplicate accessor generation required of "has $.x; has @.x;"
+ many more typed exceptions thrown
+ undeclared attributes mentioned in signatures now caught at compile time
+ empty Buf is now False in boolean context
+ implemented <prior>
+ implemented /<Foo::Bar::baz>/ syntax
+ /<x>/ can call a predeclared lexical regex x
+ conjugate is now called conj
+ enumeration values .gist to just the key, not the full name
+ <!> in regexes fixed
+ implemented Match.make(...) method
+ better error reporting for improper use of nextsame and friends
+ initializers now parsed as part of a variable declarator
+ trailing whitespace now removed from Pod declarator blocks
+ List.tree made more useful
+ implemented rename and copy functions
+ ().pick and ().roll now return Nil
+ default MAIN usage message includes .WHY of the candidates
+ X::Base eliminated in favor of Exception
+ various range iteration fixes; Num ranges now produce Num lists
+ LHS of the xx operator is now thunked
+ can now declare state/constant/our in regexes (before, only :my worked)
+ improved backtraces
+ catch constructs that require an invocant but don't have one
+ catch uses of virtual method calls in submethods and attribute initializers
+ improved parsing and performance of reduction meta operators
+ Rat arithmetic now properly defaults to Num if the denominator is too big
+ FatRat implemented
+ implemented long forms of regex adverbs (e.g. "ignorecase" maps to "i")
+ 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
+ take flattening bug fixed
......
Rakudo Roadmap
--------------
Last updated: 2011-12-13
Last updated: 2012-04-20
This document serves as a guide to the major goals for Rakudo
development, as things stood in December 2011. They have been
......@@ -31,12 +31,11 @@ Compiler Performance/Portability Improvements (jnthn)
1 *** get NQP bootstrapped with QRegex engine
1 ** LTM and other updates to Rakudo grammar to work on QRegex
2 ***** design, implement and switch to QAST
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
2 *** quasiquote splicing
2 ** hygienic macros and the COMPILING:: pseudopackage
2 **** "delayed" declarations of routines and types within quasiquotes
......@@ -50,18 +49,15 @@ Operators
Regexes
1 ** LTM for alternations
1 ? backtracking over subrules
2 ? array variable interpolation
3 ? <*foo>
3 ? <~~>, <prior>
3 ? <|w>, <|b>, ...
3 ? <(, )>
3 ? explicit backtracking control (::, :::)
3 ? <cut>
3 * :ignorecase alias for :i, :ratchet alias for :r etc.
2 ** array variable interpolation
3 ** <*foo>
3 * <~~>
3 ** <|w>, <|b>, ...
3 * <(, )>
3 ** explicit backtracking control (::, :::)
3 ** <cut>
Built-ins/Data Structures
1 ** object hashes (jnthn)
2 *** throwing typed exceptions (moritz)
2 *** packed arrays (jnthn)
2 ***** NFG strings, .codes, .graphs, etc.
......@@ -76,14 +72,12 @@ Built-ins/Data Structures
3 *** Cat and stream matching
Phasers
2 *** ENTER and LEAVE
2 ** LAST/NEXT/FIRST/REDO
2 ? PRE/POST
3 ? KEEP/UNDO
2 ** LAST/NEXT/FIRST in loops other than for loops
Language Features
1 *** basic Perl 5 interop (use, eval, etc.)
2 ** pseudo-packages MY, CONTEXT, OUTER, etc. (jnthn)
1 ** non-Numeric enums
2 ** enumerations as roles
2 *** heredocs
2 ** module versioning
2 ** import/export tags
......@@ -91,8 +85,7 @@ Language Features
2 *** new syntax/semantics for coercion (jnthn)
2 ** MAIN and USAGE (japhb)
2 ** Failure changes (japhb)
2 ? module versioning
3 ? constant declarators with non-literals
2 *** module versioning
3 *** domain specific languages -- slang and grammar tweaks
3 **** more advanced Perl 5 interop (lexical embedding, etc.)
3 *** temp variables
......
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.
Announce: Rakudo Perl 6 compiler development release #50 ("Argentina")
On behalf of the Rakudo development team, I'm happy to announce the
March 2012 release of Rakudo Perl #50 "Argentina". 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 March 2012 release is
code named after Argentina, because that's where one of our core
contributors went to relax this month after adding some significant
Perl 6 features to Rakudo.
Some of the specific changes and improvements occurring with this
release include:
* greatly reduced startup time
* significantly reduced memory usage during compilation of modules
and of Rakudo itself.
* implemented ENTER, LEAVE, KEEP, UNDO and START phasers
* basic macros
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.
Note that Rakudo now dies on 'our multi' declarations, which have
poorly defined semantics. Please either declare an 'our proto'
that re-dispatches to individual multis, or use exporting instead of
package variables.
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:
Jonathan Worthington, Moritz Lenz, Carl Masak, Tadeusz Sośnierz,
Siddhant Saraf, not_gerd, Filip Sergot, TimToady, Michael Schroeder,
Patrick R. Michaud, sisar, lumi, Felix Herrmann, flussence, felher
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 (#51) is scheduled for April 19, 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.
On behalf of the development team, I admonish you to try the new release,
to live life to its fullest, to cherish each day, and to have fun.
[*] 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.
Announce: Rakudo Perl 6 compiler development release #51 ("Brazos Valley")
On behalf of the Rakudo development team, I'm happy to announce the
April 2012 release of Rakudo Perl #51 "Brazos Valley". 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 April 2012 release is
code named after Brazos Valley, because they sponsored a Perl 6
Hackathon. Thanks!
Some of the specific changes and improvements occurring with this
release include:
* Support for pseudo packages like MY, OUR, DYNAMIC
* Support for indexing into packages like hashes, e.g. Foo::{'$x'}
* Warnings now include line numbers
* Assorted minor optimizations to compilation, Str methods and iteration
* Now passing over 21,400 spec tests.
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 will be rectified in coming releases.
Two incompatible changes in this release are notable:
* $?POD has been renamed to $?pod
* 'defined' used to be a prefix operator, it is now an ordinary
subroutine. Code like 'defined $a ?? $b !! $c' should be rewritten
to use 'defined($a)' or '$a.defined' instead.
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, Patrick R. Michaud, Carl Mäsak,
Timo Paulssen, Tadeusz Sośnierz, Felix Herrmann, spider-mario, benabik,
timotimo, TimToady and Will "Coke" Coleda.
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 (#52) is scheduled for May 17, 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.
On behalf of the development team, I encourage you to try the new release.
have fun, and let us know about your experience.
[*] 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.
Announce: Rakudo Perl 6 compiler development release 2012.04.1
On behalf of the Rakudo development team, I'm happy to announce an
out-of-schedule release of the Rakudo Perl 6 compiler. 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>.
This release is a point release in addition to the regular, monthly
releases. It contains some of the results of the Perl 6 Patterns
hackathon in Oslo. It is intended to be used as the basis for the
next Rakudo Star release. The Rakudo developers would like to thank
the organizers from Oslo.pm.
Some of the specific changes and improvements occurring with this
release include:
* Support for autovivification.
* More robust module precompilation
* $.foo, @.foo and %.foo style calls now properly contextualize
The 'lib' directory is not in the default search path for modules anymore.
Module authors and users can adjust the PERL6LIB environment variable
accordingly.
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, Patrick R. Michaud, Carl Mäsak,
Will "Coke" Coleda, Tadeusz Sośnierz, Marcus Ramberg, Timo Paulssen,
Felix Herrmann, Geir Amdal, spider-mario, benabik, timotimo, TimToady
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 (#52) is scheduled for May 17, 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.
On behalf of the development team, I encourage you to try the new release.
have fun, and let us know about your experience.
[*] 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.
......@@ -47,22 +47,29 @@ part of monthly Parrot releases.
2011-10-20 Rakudo #45 "Houston" (duff)
2011-11-17 Rakudo #46 "London" (tadzik)
2011-12-22 Rakudo #47 "Columbus" (moritz)
2012-01-22 Rakudo #48 "Toronto" (moritz)
2012-01-23 Rakudo #48 "Toronto" (moritz)
2012-02-23 Rakudo #49 "SPb" (masak)
2012-03-22 Rakudo #50 "Argentina" (masak)
2012-04-19 Rakudo #51 "Brazos Valley" (Coke)
2012-04-25 2012.04.1 (moritz)
=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-05-17 Rakudo #52 tadzik
2012-06-21 Rakudo #53 duff
2012-07-19 Rakudo #54 masak
2012-08-23 Rakudo #55
2012-09-20 Rakudo #56
2012-10-18 Rakudo #57
2012-11-22 Rakudo #58
2012-12-20 Rakudo #59
=head2 Suggested .pm group names for future releases
MadMongers (YAPC::NA 2012)
Brazos Valley (YAPC::NA 2007, p6 hackathon)
Frankfurt (YAPC::EU 2012)
More names can be gotten from L<http://www.pm.org> if you
can't think of one with any particular significance to Perl
......@@ -141,6 +148,8 @@ commit the new version:
But probably there won't be any new leap seconds, in which case the file
will be unchanged.
B<Note>: this program requires the perl module L<Time::y2038> be installed.
=item 5.
As the actual release date nears, review the git log history
......@@ -209,6 +218,8 @@ judgment or ask others if uncertain what to do here.
=item *
B<Note>: these steps overlap with the steps in NQP's release guide.
Go to the NQP repository, tag it and push the tags
$ git tag -a -m"tag release YYYY.MM" YYYY.MM # e.g., 2010.02
......@@ -257,8 +268,8 @@ So please make a backup if you have any important data in there.
=item 12.
Unpack the tar file into another area, and test that it
builds and runs properly using the same process in step 7.
If there are any problems, fix them and go back to step 7.
builds and runs properly using the same process in step 8.
If there are any problems, fix them and go back to step 8.
=item 13.
......@@ -293,7 +304,7 @@ You're done! Celebrate with the appropriate amount of fun.
=head1 COPYRIGHT
Copyright (C) 2009-2011, The Perl Foundation.
Copyright (C) 2009-2012, The Perl Foundation.
=cut
......
......@@ -13,6 +13,7 @@ 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
-h, --help display this help text
-n run program once for each line of input
......@@ -23,10 +24,13 @@ compiled code.
-o, --output=[name] specify name of output file
-v, --version display version information
--stagestats display time spent in the compilation stages
--ll-backtrace display a low level backtrace on errors
--ll-exception display a low level backtrace on errors
--profile print profile information to standard error
Note that only boolean single-letter options may be bundled
Output from C<--profile> can be visualized by C<kcachegrind>.
Supported stages for --target are:
parse past post pir evalpmc
......
module Pod::To::Text;
class Pod::To::Text;
method render($pod) {
pod2text($pod)
}
sub pod2text($pod) is export {
my @declarators;
......@@ -70,10 +74,12 @@ sub declarator2text($pod) {
next unless $pod.WHEREFORE.WHY;
my $what = do given $pod.WHEREFORE {
when Method {
'method ' ~ $_.name
my @params=$_.signature.params[1..*];
@params.pop if @params[*-1].name eq '%_';
'method ' ~ $_.name ~ signature2text(@params)
}
when Sub {
'sub ' ~ $_.name
'sub ' ~ $_.name ~ signature2text($_.signature.params)
}
when nqp::p6bool(nqp::istype($_.HOW, Metamodel::ClassHOW)) {
'class ' ~ $_.perl
......@@ -88,7 +94,13 @@ sub declarator2text($pod) {
''
}
}
return "$what: {$pod.WHEREFORE.WHY.content}"
return "$what\n{$pod.WHEREFORE.WHY.content}"
}
sub signature2text($params) {
$params.elems ??
"(\n\t" ~ $params.map({ $_.perl }).join(", \n\t") ~ "\n)"
!! "()";
}
sub formatting2text($pod) {
......
This diff is collapsed.
class Perl6::BacktracePrinter;
# Drives the overall backtrace production process.
method backtrace_for($exception) {
my @backtrace := $exception.backtrace();
if self.is_runtime(@backtrace) {
# Runtime error. Start with the error message.
my $trace := pir::getattribute__pps($exception, 'message');
# If top frame is 'die' or warn, drop it from the top. Same for the
# attribute accessors.
if @backtrace[0]<annotations><invizible_frame> {
@backtrace.shift;
}
# If it's just a warning, then we want to just append a line and
# file to the error and be done.
if self.is_warning($exception) {
my $i := 0;
my $array_bound := +@backtrace - 1;
while $i < $array_bound
&& @backtrace[$i]<annotations><file> eq 'CORE.setting' {
$i++;
}
$trace := $trace ~ self.backtrace_line(@backtrace[$i]<sub>, @backtrace[$i]<annotations>);
return $trace;
}
# Otherwise, it's an error; go through frames to find annotations to print.
$trace := $trace ~ "\n";
my $cur_annotations;
for @backtrace {
# If we're seeking an annotation set, take the current one.
unless $cur_annotations {
$cur_annotations := $_<annotations>;
}