Skip to content

Commit

Permalink
Allow ARGxxx() annotations on vtable methods
Browse files Browse the repository at this point in the history
  • Loading branch information
petdance committed Apr 24, 2011
1 parent 8906192 commit 2c6ed8c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/Parrot/Vtable.pm
Expand Up @@ -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*$' );
Expand Down Expand Up @@ -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";
Expand Down

0 comments on commit 2c6ed8c

Please sign in to comment.