Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[svn:parrot] r36138 - trunk/lib/Parrot/Pmc2c

0 views
Skip to first unread message

co...@cvs.perl.org

unread,
Jan 29, 2009, 2:30:51 AM1/29/09
to svn-comm...@perl.org
Author: cotto
Date: Wed Jan 28 23:30:50 2009
New Revision: 36138

Modified:
trunk/lib/Parrot/Pmc2c/PCCMETHOD.pm

Log:
[pmc2c] make PCC method args more user-friendly


Modified: trunk/lib/Parrot/Pmc2c/PCCMETHOD.pm
==============================================================================
--- trunk/lib/Parrot/Pmc2c/PCCMETHOD.pm (original)
+++ trunk/lib/Parrot/Pmc2c/PCCMETHOD.pm Wed Jan 28 23:30:50 2009
@@ -277,10 +277,17 @@
my $linear_args = [];

for my $x ( split /,/, $parameters ) {
+
+ #change 'PMC * foo' to 'PMC *foo'
+ $x =~ s/\*\s+/\*/ if ($x =~ /\s\*+\s/);
+
+ #change 'PMC* foo' to 'PMC *foo'
+ $x =~ s/(\*+)\s+/ $1/ if ($x =~ /^\w+\*/);
+
my ( $type, $name, $rest ) = split /\s+/, trim($x), 3;

die "invalid PCC arg '$x': did you forget to specify a type?\n"
- unless defined $name;
+ unless defined $name;

if ($name =~ /\**([a-zA-Z_]\w*)/) {
$name = $1;

0 new messages