Skip to content
Permalink
Browse files
Fix sipify annotations and inline definition combination
  • Loading branch information
nyalldawson committed Apr 2, 2017
1 parent d3daf60 commit f1162f7884a011cfa98783cfbedc570dd1c0efd7
Showing with 5 additions and 1 deletion.
  1. +1 −1 scripts/sipify.pl
  2. +2 −0 tests/scripts/sipifyheader.expected.sip
  3. +2 −0 tests/scripts/sipifyheader.h
@@ -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;
@@ -85,6 +85,8 @@ A multiline method signature
Factory annotation
%End

SomeObject *createAnother() /Factory/;

void LongDocStringMethod();
%Docstring
My long doc string
@@ -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!

0 comments on commit f1162f7

Please sign in to comment.