From eda17309d7eadc82f2220e426cb39161e2c2334c Mon Sep 17 00:00:00 2001 From: Denis Rouzaud Date: Thu, 4 May 2017 07:36:35 +0200 Subject: [PATCH] [sipify] use single regex for all double annotation cases followup ac54a3f83fa95e965f415ec6884d195629e87273 --- scripts/sipify.pl | 8 ++------ tests/scripts/sipifyheader.expected.sip | 3 +-- tests/scripts/sipifyheader.h | 3 +-- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/scripts/sipify.pl b/scripts/sipify.pl index c3f6764cfab..a3005f88df8 100755 --- a/scripts/sipify.pl +++ b/scripts/sipify.pl @@ -574,14 +574,10 @@ while ($line_idx < $line_count){ $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 diff --git a/tests/scripts/sipifyheader.expected.sip b/tests/scripts/sipifyheader.expected.sip index 5143ff90aca..505e096fbc9 100644 --- a/tests/scripts/sipifyheader.expected.sip +++ b/tests/scripts/sipifyheader.expected.sip @@ -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 &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 diff --git a/tests/scripts/sipifyheader.h b/tests/scripts/sipifyheader.h index bb2955163d2..ab99f52e846 100644 --- a/tests/scripts/sipifyheader.h +++ b/tests/scripts/sipifyheader.h @@ -240,8 +240,6 @@ class CORE_EXPORT QgsSipifyHeader : public QtClass, 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 &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, 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 );