[svn:parrot] r46820 - in trunk: lib/Parrot tools/build

petdance at svn.parrot.org petdance at svn.parrot.org
Thu May 20 17:22:04 UTC 2010


Author: petdance
Date: Thu May 20 17:22:03 2010
New Revision: 46820
URL: https://trac.parrot.org/parrot/changeset/46820

Log:
Don't complain about lexer-generated functions

Modified:
   trunk/lib/Parrot/Headerizer.pm
   trunk/tools/build/headerizer.pl

Modified: trunk/lib/Parrot/Headerizer.pm
==============================================================================
--- trunk/lib/Parrot/Headerizer.pm	Thu May 20 17:10:21 2010	(r46819)
+++ trunk/lib/Parrot/Headerizer.pm	Thu May 20 17:22:03 2010	(r46820)
@@ -247,8 +247,10 @@
     }
     if ( $return_type =~ /\*/ ) {
         if ( !$macros{PARROT_CAN_RETURN_NULL} && !$macros{PARROT_CANNOT_RETURN_NULL} ) {
-            $self->squawk( $file, $name,
-                'Returns a pointer, but no PARROT_CAN(NOT)_RETURN_NULL macro found.' );
+            if ( $name !~ /^yy/ ) { # Don't complain about lexer-created functions
+                $self->squawk( $file, $name,
+                    'Returns a pointer, but no PARROT_CAN(NOT)_RETURN_NULL macro found.' );
+            }
         }
         elsif ( $macros{PARROT_CAN_RETURN_NULL} && $macros{PARROT_CANNOT_RETURN_NULL} ) {
             $self->squawk( $file, $name,

Modified: trunk/tools/build/headerizer.pl
==============================================================================
--- trunk/tools/build/headerizer.pl	Thu May 20 17:10:21 2010	(r46819)
+++ trunk/tools/build/headerizer.pl	Thu May 20 17:22:03 2010	(r46820)
@@ -89,8 +89,9 @@
 
         my $heading = $headerizer->generate_documentation_signature($decl);
 
-        $text =~ s/=item C<[^>]*\b$name\b[^>]*>\n+/$heading\n\n/sm or
-            warn "$cfile_name: $name has no POD\n";
+        $text =~ s/=item C<[^>]*\b$name\b[^>]*>\n+/$heading\n\n/sm or do {
+            warn "$cfile_name: $name has no POD\n" unless $name =~ /^yy/; # lexer funcs don't have to have POD
+        }
     }
     open( my $fhout, '>', $cfile_name ) or die "Can't create $cfile_name: $!";
     print {$fhout} $text;
@@ -126,7 +127,9 @@
             push( @attrs, "__attribute__nonnull__($n)" );
         }
         if ( ( $arg =~ m{\*} ) && ( $arg !~ /\b(SHIM|((ARGIN|ARGOUT|ARGMOD)(_NULLOK)?)|ARGFREE(_NOTNULL)?)\b/ ) ) {
-            $headerizer->squawk( $file, $name, qq{"$arg" isn't protected with an ARGIN, ARGOUT or ARGMOD (or a _NULLOK variant), or ARGFREE} );
+            if ( $name !~ /^yy/ ) { # Don't complain about the lexer auto-generated funcs
+                $headerizer->squawk( $file, $name, qq{"$arg" isn't protected with an ARGIN, ARGOUT or ARGMOD (or a _NULLOK variant), or ARGFREE} );
+            }
         }
         if ( ($arg =~ /\bconst\b/) && ($arg =~ /\*/) && ($arg !~ /\*\*/) && ($arg =~ /\b(ARG(MOD|OUT))\b/) ) {
             $headerizer->squawk( $file, $name, qq{"$arg" is const, but that $1 conflicts with const} );


More information about the parrot-commits mailing list