File tree Expand file tree Collapse file tree 3 files changed +20
-2
lines changed Expand file tree Collapse file tree 3 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -569,9 +569,11 @@ sub remove_constructor_or_body {
569
569
$line =~ s / SIP_PYNAME\(\s *(\w +)\s *\) / \/ PyName=$1 \/ / ;
570
570
571
571
# combine multiple annotations
572
- dbg_info(" combine multiple annotations -- works only for 2" );
573
572
# https://regex101.com/r/uvCt4M/1
574
- $line =~ s /\/ (\w +(=\w +)?)\/\s *\/ (\w +(=\w +)?)\/\s *;(\s *(\/\/ .*)?)$/ \/ $1 ,$3 \/ $5 ;/ ;
573
+ do {no warnings ' uninitialized' ;
574
+ $line =~ s /\/ (\w +(=\w +)?)\/\s *\/ (\w +(=\w +)?)\/\s *;(\s *(\/\/ .*)?)$/ \/ $1 ,$3 \/ $5 ;/ ;
575
+ ($3 == undef ) or dbg_info(" combine multiple annotations -- works only for 2" );
576
+ };
575
577
576
578
# unprinted annotations
577
579
$line =~ s / (\w +)(\< (?>[^<>]|(?2))*\> )?\s +SIP_PYARGTYPE\(\s *\' ?([^()']+)(\(\s *(?:[^()]++|(?2))*\s *\) )?\' ?\s *\) / $3 / g ;
@@ -657,14 +659,17 @@ sub remove_constructor_or_body {
657
659
next ;
658
660
}
659
661
elsif ( $line =~ m /\/\/ / || $line =~ m /\s *typedef / || $line =~ m /\s *struct / || $line =~ m / operator\[\]\( / ){
662
+ dbg_info(' skipping comment' );
660
663
$comment = ' ' ;
664
+ $return_type = ' ' ;
661
665
}
662
666
elsif ( $comment !~ m / ^\s *$ / || $return_type ne ' ' ){
663
667
if ( $is_override == 1 && $comment =~ m / ^\s *$ / ){
664
668
# overridden method with no new docs - so don't create a Docstring and use
665
669
# parent class Docstring
666
670
}
667
671
else {
672
+ dbg_info(' writing comment' );
668
673
push @output , dbg(" CM1" )." %Docstring \n " ;
669
674
if ( $comment !~ m / ^\s *$ / ){
670
675
push @output , dbg(" CM2" )." $comment \n " ;
Original file line number Diff line number Diff line change @@ -305,6 +305,11 @@ remove argument
305
305
void position( bool keep, bool keep );
306
306
void position( bool keep );
307
307
308
+ Whatever &operator[]( int i ) /Factory/;
309
+ %MethodCode
310
+ ....
311
+ %End
312
+
308
313
void ZshouldBeShown();
309
314
310
315
void methodCodeWithMultiLineDef();
Original file line number Diff line number Diff line change @@ -329,6 +329,14 @@ class CORE_EXPORT QgsSipifyHeader : public QtClass<QVariant>, private Ui::QgsBas
329
329
void position ( bool keep, bool middle_remove SIP_PYARGREMOVE, bool keep );
330
330
void position ( bool keep, bool last_remove SIP_PYARGREMOVE );
331
331
332
+ // ! Some comment
333
+ Whatever &operator []( int i ) SIP_FACTORY;
334
+ #ifdef SIP_RUN
335
+ %MethodCode
336
+ ....
337
+ %End
338
+ #endif
339
+
332
340
#if 0
333
341
#if Whatever
334
342
void X();
You can’t perform that action at this time.
0 commit comments