[svn:parrot] r37853 - trunk/lib/Parrot

coke at svn.parrot.org coke at svn.parrot.org
Wed Apr 1 19:50:47 UTC 2009


Author: coke
Date: Wed Apr  1 19:50:46 2009
New Revision: 37853
URL: https://trac.parrot.org/parrot/changeset/37853

Log:
[docs] Fix headerizer to properly strip out function modifiers.

Modified:
   trunk/lib/Parrot/Headerizer.pm

Modified: trunk/lib/Parrot/Headerizer.pm
==============================================================================
--- trunk/lib/Parrot/Headerizer.pm	Wed Apr  1 19:44:35 2009	(r37852)
+++ trunk/lib/Parrot/Headerizer.pm	Wed Apr  1 19:50:46 2009	(r37853)
@@ -232,10 +232,13 @@
     my $self = shift;
     my $function_decl = shift;
 
-    $function_decl =~ s/\s+/ /g;
+    # strip out any PARROT_* function modifiers
+    foreach my $key (%valid_macros) {
+        $function_decl =~ s/^$key$//m;
+    }
 
-    # strip out any PARROT_* prefixes
-    $function_decl =~ s/^\s*PARROT_[A-Z_]*\b\s+//gm;
+    $function_decl =~ s/^\s+//g;
+    $function_decl =~ s/\s+/ /g;
 
     # strip out any ARG* modifiers
     $function_decl =~ s/ARG(?:IN|IN_NULLOK|OUT|OUT_NULLOK|MOD|MOD_NULLOK|FREE)\((.*?)\)/$1/g;


More information about the parrot-commits mailing list