Skip to content

Commit

Permalink
Don't complain about lexer-generated functions
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.parrot.org/parrot/trunk@46820 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information
petdance committed May 20, 2010
1 parent 23a94d6 commit b196145
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 4 additions & 2 deletions lib/Parrot/Headerizer.pm
Expand Up @@ -247,8 +247,10 @@ sub function_components_from_declaration {
}
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,
Expand Down
9 changes: 6 additions & 3 deletions tools/build/headerizer.pl
Expand Up @@ -89,8 +89,9 @@ sub extract_function_declarations_and_update_source {

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;
Expand Down Expand Up @@ -126,7 +127,9 @@ sub attrs_from_args {
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} );
Expand Down

0 comments on commit b196145

Please sign in to comment.