Skip Menu |
 

This queue is for tickets about the Devel-REPL CPAN distribution.

Report information
The Basics
Id: 67573
Status: open
Priority: 0/
Queue: Devel-REPL

People
Owner: Nobody in particular
Requestors: djo [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.003012
Fixed in: (no value)

Attachments


Subject: [Patch] CompletionDriver::Turtles fails to complete command_\w+ subs
Download (untitled) / with headers
text/plain 424b
Hi, The regex that matches for turtle subs to complete can only match subs named like expr_command_\w+ due to a bad regex. The attached patch allows it to complete commands like command_\w+ as well. -- Best regards, David Jack Olrik <david@olrik.dk> http://david.olrik.dk GnuPG fingerprint C290 0A4A 0CCC CBA8 2B37 E18D 01D2 F6EF 2E61 9894 ["The first rule of Perl club is You do not talk about Perl club"]
Subject: Devel-REPL-1.003012.patch
diff --exclude=.base-functions --exclude=.base-prerequisites-metadata -NurB Devel-REPL-1.003012.orig/lib/Devel/REPL/Plugin/CompletionDriver/Turtles.pm Devel-REPL-1.003012/lib/Devel/REPL/Plugin/CompletionDriver/Turtles.pm --- Devel-REPL-1.003012.orig/lib/Devel/REPL/Plugin/CompletionDriver/Turtles.pm 2010-09-27 19:24:04.000000000 +0200 +++ Devel-REPL-1.003012/lib/Devel/REPL/Plugin/CompletionDriver/Turtles.pm 2011-04-19 13:09:42.000000000 +0200 @@ -23,7 +23,7 @@ ( map { "$pre$_" } grep { $_ =~ $filter } - map { /^expr?_command_(\w+)/ ? $1 : () } + map { /^(?:expr_)?command_(\w+)/ ? $1 : () } map { $_->name } $self->meta->get_all_methods ),
There definitely appears to be a problem with the regex but
I'm not sure this fix matches the documentation.  My reading
says that a better fix would be to change:

  my $expr_method = "expr_$method";

to this

  my $expr_method = "expr_$command";

That matches the perldoc Devel::REPL::Plugin::Turtles
exactly.  Looking at the code, I am puzzled at the
difference between the $expr_code which has
support for multiple lines and the $expr_cmd which
doesn't.

I haven't used Turtles myself so I'll leave it to
someone more knowledgeable to sort this out.

--Chris




On Tue Apr 19 07:17:50 2011, DJO wrote:
Show quoted text
>
> The regex that matches for turtle subs to complete can only match subs
> named like expr_command_\w+ due to a bad regex.
>
> The attached patch allows it to complete commands like
> command_\w+ as well.




This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.