Skip to content

Commit eda1730

Browse files
committedMay 4, 2017
[sipify] use single regex for all double annotation cases
followup ac54a3f
1 parent f7f32e6 commit eda1730

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed
 

‎scripts/sipify.pl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -574,14 +574,10 @@ sub remove_constructor_or_body {
574574
$line =~ s/SIP_PYNAME\(\s*(\w+)\s*\)/\/PyName=$1\//;
575575

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

587583
# unprinted annotations

‎tests/scripts/sipifyheader.expected.sip

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,6 @@ complex default value and type (i.e. containing commas) should be given as a str
208208

209209
void removeProxyFactory( QNetworkProxyFactory *factory /TransferBack/ );
210210

211-
void multiAnnotationArg( SomeClass **object /Out,TransferBack/, int &another /Out/ );
212-
213211
bool removeFunctionBody( const QList<int, QString> &list, QgsVectorLayer *vl, Some::Thing _part = -1 /*default =-1*/ );
214212
%Docstring
215213
:rtype: bool
@@ -303,6 +301,7 @@ Mulitline body
303301
}
304302

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

307306
void simple( );
308307
%Docstring

‎tests/scripts/sipifyheader.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,6 @@ class CORE_EXPORT QgsSipifyHeader : public QtClass<QVariant>, private Ui::QgsBas
240240

241241
void removeProxyFactory( QNetworkProxyFactory *factory SIP_TRANSFERBACK );
242242

243-
void multiAnnotationArg( SomeClass **object SIP_OUT SIP_TRANSFERBACK, int &another SIP_OUT );
244-
245243
bool removeFunctionBody( const QList<int, QString> &list, QgsVectorLayer *vl, Some::Thing _part = -1 /*default =-1*/ ) { doSomething; return true; } // some comments
246244

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

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

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

0 commit comments

Comments
 (0)
Please sign in to comment.