Skip to content
Permalink
Browse files

remove extra spaces

  • Loading branch information
3nids committed Dec 15, 2017
1 parent 199055e commit 2009d4c916097cf585b04c1721a12206c4e3994c
Showing with 7 additions and 5 deletions.
  1. +7 −5 scripts/sipify.pl
@@ -119,22 +119,24 @@ sub write_header_footer {

sub processDoxygenLine {
my $line = $_[0];
# remove prepending spaces
$line =~ s/^\s+//g;
# remove \a formatting
$line =~ s/\\a (.+?)\b/``$1``/g;
# replace :: with . (changes c++ style namespace/class directives to Python style)
$line =~ s/::/./g;
# replace nullptr with None (nullptr means nothing to Python devs)
$line =~ s/\bnullptr\b/None/g;
# replace \returns with :return:
$line =~ s/\\return(s)?/\n :return:/;
$line =~ s/\s*\\return(s)?/\n:return:/;

if ( $line =~ m/\\param / ){
if ( $COMMENT_PARAM_LIST == 0 )
{
$line = "\n$line";
}
$COMMENT_PARAM_LIST = 1;
$line =~ s/\\param (\w+)\b/ :param $1:/g;
$line =~ s/\s*\\param (\w+)\b/:param $1:/g;
}


@@ -951,19 +953,19 @@ sub detect_comment_block{
foreach my $comment_line (@comment_lines) {
if ( $RETURN_TYPE ne '' && $comment_line =~ m/^\s*\.\. \w/ ){
# return type must be added before any other paragraph-level markup
write_output("CM5", " :rtype: $RETURN_TYPE\n\n");
write_output("CM5", ":rtype: $RETURN_TYPE\n\n");
$RETURN_TYPE = '';
}
write_output("CM2", "$comment_line\n");
if ( $RETURN_TYPE ne '' && $comment_line =~ m/:return:/ ){
# return type must be added before any other paragraph-level markup
write_output("CM5", " :rtype: $RETURN_TYPE\n\n");
write_output("CM5", ":rtype: $RETURN_TYPE\n\n");
$RETURN_TYPE = '';
}
}
}
if ( $RETURN_TYPE ne '' ){
write_output("CM3", "\n :rtype: $RETURN_TYPE\n");
write_output("CM3", "\n:rtype: $RETURN_TYPE\n");
}
write_output("CM4", "%End\n");
}

0 comments on commit 2009d4c

Please sign in to comment.
You can’t perform that action at this time.