Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Allow ARGxxx() annotations on vtable methods

  • Loading branch information...
commit 2c6ed8ce004422a5fc09bec52ff6438efd2ddc36 1 parent 8906192
@petdance petdance authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/Parrot/Vtable.pm
View
4 lib/Parrot/Vtable.pm
@@ -44,7 +44,8 @@ sub make_re {
my $ident_re = make_re('[A-Za-z_][A-Za-z0-9_]*');
my $type_re = make_re( '(?:(?:struct\s+)|(?:union\s+))?' . $ident_re . '\**' );
my $const_re = make_re( '(?:const\s+)?' );
-my $param_re = make_re( $const_re . $type_re . '\s+' . $ident_re );
+my $c_param_re = make_re( $const_re . $type_re . '\s+' . $ident_re );
+my $param_re = make_re( '(?:(?:' . $c_param_re . ')|(?:ARG[_A-Z]+\(\s*' . $c_param_re . '\)))' );
my $arglist_re = make_re( '(?:' . $param_re . '(?:\s*,\s*' . $param_re . ')*)?' );
my $method_re =
make_re( '^\s*(' . $type_re . ')\s+(' . $ident_re . ')\s*\((' . $arglist_re . ')\)\s*$' );
@@ -227,6 +228,7 @@ EOM
for my $entry ( @{$vtable} ) {
next if ( $entry->[4] =~ /MMD_/ );
my @args = split /,\s*/, $entry->[2];
+ s/^ARG[_A-Z]+\((.+)\)/$1/ for @args; # Strip annotations, if any
unshift @args, "i interp", "p pmc";
my $args = join ', ', map { ( split / /, $args[$_] )[-1] } ( 0 .. $#args );
$macros .= <<"EOM";
Please sign in to comment.
Something went wrong with that request. Please try again.