Navigation Menu

Skip to content

Commit

Permalink
[sipify] fix do not print comment after SIP directive
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed May 1, 2017
1 parent 1f8c311 commit 634c7aa
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/sipify.pl
Expand Up @@ -659,7 +659,11 @@ sub remove_constructor_or_body {
$is_override = 0;
next;
}
elsif ( $line =~ m/\/\// || $line =~ m/\s*typedef / || $line =~ m/\s*struct / || $line =~ m/operator\[\]\(/ ){
elsif ( $line =~ m/\/\// ||
$line =~ m/\s*typedef / ||
$line =~ m/\s*struct / ||
$line =~ m/operator\[\]\(/ ||
$line =~ m/^\s*% \w+(.*)?$/ ){
dbg_info('skipping comment');
$comment = '';
$return_type = '';
Expand Down
8 changes: 8 additions & 0 deletions tests/scripts/sipifyheader.expected.sip
Expand Up @@ -9,6 +9,14 @@



% ModuleHeaderCode
#include <qgsnetworkspeedstrategy.h>
#include <qgsnetworkdistancestrategy.h>
%End







Expand Down
10 changes: 10 additions & 0 deletions tests/scripts/sipifyheader.h
Expand Up @@ -16,9 +16,17 @@ email : denis.rouzaud@gmail.com
#ifndef SIPIFYHEADER_H
#define SIPIFYHEADER_H


#include "qgis_core.h"
#include <QtClass>

#ifdef SIP_RUN
% ModuleHeaderCode
#include <qgsnetworkspeedstrategy.h>
#include <qgsnetworkdistancestrategy.h>
% End
#endif

#include "sipifyheader.h"

// one shall include qgis.h to use SIP annotations
Expand All @@ -27,6 +35,8 @@ email : denis.rouzaud@gmail.com
class QgsForwardDeclaration;




/***************************************************************************
* This is some random block comment that will not be displayed.
* Block comments shall will placed upon class, method, enum without
Expand Down

0 comments on commit 634c7aa

Please sign in to comment.