Larry Wall wrote: > On Tue, Jul 10, 2007 at 04:37:13PM -0700, Dave Whipp wrote: > : One approach would simply be to edit Perl-6.0.0-STD.pm and add some > : markup. To pick a token at random: > : > : =p6explain * > : An asterix in a version expression matches any version > : =end > : token whatever { '*' {*} } > > Indeed, the example you picked indicates how important context > will be. There are many different uses of '*', and a p6explain that > simply lists all the possible meanings will be very nearly useless.
I hope it's not (nearly) useless. My intention was the following: in most cases the meaning of an operator is very obvious (for example * as the multiplication operator), there are just some cases where the meaning is not obvious: sub foo([EMAIL PROTECTED]) now instead of grep'ping through 16 Synopsis with 24895 lines (with 248 matches in Operator.pod and 189 in Syntax.pod), I'd like to have 2 or three result pages that list all possible meanings of *. I don't want to have a full Perl 6 program explained, just the operators/symbols that I don't know about right now. > You really need to parse the surrounding text to have any idea what > the * means. And a big reason to make the grammar available (including > all the user-defined bits) is so that nobody ever has to reinvent PPI > for Perl 6. A p6 explainer that is sensitive to grammar mutations > really needs to do its work by annotating an entire compilation unit > and then making that information available to something resembling > an IDE. I realize that's a long term goal. Which leads me to the question: how should the data be assembled so that it could be used in such a way? Would it be enough to store the name of the token, along with the description? Moritz -- Moritz Lenz http://moritz.faui2k3.org/ | http://perl-6.de/
signature.asc
Description: OpenPGP digital signature