# New Ticket Created by Christoph Otto
# Please include the string: [perl #51832]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=51832 >
pmc2c.pl generates incorrect #line directives when function contains two or
more newlines before the closing }. This patch fixes that.
The coding standard doesn't address this, so I'm assuming that this is the
right thing to fix.
Index: lib/Parrot/Pmc2c/Parser.pm
===================================================================
--- lib/Parrot/Pmc2c/Parser.pm (revision 26458)
+++ lib/Parrot/Pmc2c/Parser.pm (working copy)
@@ -199,7 +199,7 @@
$methodblock =~ s/^[ ]{4}//mg;
# trim trailing ws from last line
- $methodblock =~ s/\n\s+$/\n/g;
+ $methodblock =~ s/\n[ \t]+$/\n/g;
$decorators ||= '';
$decorators =~ s/^\s*(.*?)\s*$/$1/s;