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;