Skip to content
Permalink
Browse files
[sipify] use single regex for all double annotation cases
followup ac54a3f
  • Loading branch information
3nids committed May 4, 2017
1 parent f7f32e6 commit eda17309d7eadc82f2220e426cb39161e2c2334c
Showing with 4 additions and 10 deletions.
  1. +2 −6 scripts/sipify.pl
  2. +1 −2 tests/scripts/sipifyheader.expected.sip
  3. +1 −2 tests/scripts/sipifyheader.h
@@ -574,14 +574,10 @@ sub remove_constructor_or_body {
$line =~ s/SIP_PYNAME\(\s*(\w+)\s*\)/\/PyName=$1\//;

# combine multiple annotations
# https://regex101.com/r/uvCt4M/1
do {no warnings 'uninitialized';
$line =~ s/\/(\w+(=\w+)?)\/\s*\/(\w+(=\w+)?)\/\s*;(\s*(\/\/.*)?)$/\/$1,$3\/$5;/;
(! $3) or dbg_info("combine multiple annotations -- works only for 2");
};
# combine multiple argument annotations
# https://regex101.com/r/uvCt4M/3
do {no warnings 'uninitialized';
$line =~ s/\/(\w+(=\w+)?)\/\s*\/(\w+(=\w+)?)\//\/$1,$3\//;
(! $3) or dbg_info("combine multiple annotations -- works only for 2");
};

# unprinted annotations
@@ -208,8 +208,6 @@ complex default value and type (i.e. containing commas) should be given as a str

void removeProxyFactory( QNetworkProxyFactory *factory /TransferBack/ );

void multiAnnotationArg( SomeClass **object /Out,TransferBack/, int &another /Out/ );

bool removeFunctionBody( const QList<int, QString> &list, QgsVectorLayer *vl, Some::Thing _part = -1 /*default =-1*/ );
%Docstring
:rtype: bool
@@ -303,6 +301,7 @@ Mulitline body
}

void combinedAnnotations() /Factory,PyName=otherName/;
void multiAnnotationArg( SomeClass **object /Out,TransferBack/, int &another /Out/ );

void simple( );
%Docstring
@@ -240,8 +240,6 @@ class CORE_EXPORT QgsSipifyHeader : public QtClass<QVariant>, private Ui::QgsBas

void removeProxyFactory( QNetworkProxyFactory *factory SIP_TRANSFERBACK );

void multiAnnotationArg( SomeClass **object SIP_OUT SIP_TRANSFERBACK, int &another SIP_OUT );

bool removeFunctionBody( const QList<int, QString> &list, QgsVectorLayer *vl, Some::Thing _part = -1 /*default =-1*/ ) { doSomething; return true; } // some comments

static inline QgsMapLayer *skippedMethodWithBody() SIP_SKIP
@@ -331,6 +329,7 @@ class CORE_EXPORT QgsSipifyHeader : public QtClass<QVariant>, private Ui::QgsBas
}

void combinedAnnotations() SIP_FACTORY SIP_PYNAME( otherName );
void multiAnnotationArg( SomeClass **object SIP_OUT SIP_TRANSFERBACK, int &another SIP_OUT );

//! remove argument
void simple( bool test SIP_PYARGREMOVE );

0 comments on commit eda1730

Please sign in to comment.