Navigation Menu

Skip to content

Commit

Permalink
Fix sipify annotations and inline definition combination
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Apr 2, 2017
1 parent d3daf60 commit f1162f7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/sipify.pl
Expand Up @@ -291,7 +291,7 @@ sub processDoxygenLine
}

# remove function bodies
if ( $line =~ m/^(\s*)?(const )?(virtual |static )?((\w+(<.*?>)?\s+(\*|&)?)?(\w+|operator.)\(.*?(\(.*\))*.*\)( const)?)\s*(\{.*\})?(?!;)(\s*\/\/.*)?$/ ){
if ( $line =~ m/^(\s*)?(const )?(virtual |static )?((\w+(<.*?>)?\s+(\*|&)?)?(\w+|operator.)\(.*?(\(.*\))*.*\)( (?:const|SIP_[A-Z_]*?))*)\s*(\{.*\})?(?!;)(\s*\/\/.*)?$/ ){
my $newline = "$1$2$3$4;\n";
if ($line !~ m/\{.*?\}$/){
$line = readline $header;
Expand Down
2 changes: 2 additions & 0 deletions tests/scripts/sipifyheader.expected.sip
Expand Up @@ -85,6 +85,8 @@ A multiline method signature
Factory annotation
%End

SomeObject *createAnother() /Factory/;

void LongDocStringMethod();
%Docstring
My long doc string
Expand Down
2 changes: 2 additions & 0 deletions tests/scripts/sipifyheader.h
Expand Up @@ -116,6 +116,8 @@ class CORE_EXPORT QgsSipifyHeader : public QtClass<QVariant>, private QgsBaseCla
//! Factory annotation
virtual QgsMapLayerRenderer *createMapRenderer( QgsRenderContext &rendererContext ) override SIP_FACTORY;

SomeObject *createAnother() SIP_FACTORY { return something; }

/**
* My long doc string
* is not very interesting!
Expand Down

0 comments on commit f1162f7

Please sign in to comment.