@@ -119,22 +119,24 @@ sub write_header_footer {
119
119
120
120
sub processDoxygenLine {
121
121
my $line = $_ [0];
122
+ # remove prepending spaces
123
+ $line =~ s / ^\s +// g ;
122
124
# remove \a formatting
123
125
$line =~ s /\\ a (.+?)\b / ``$1 ``/ g ;
124
126
# replace :: with . (changes c++ style namespace/class directives to Python style)
125
127
$line =~ s / ::/ ./ g ;
126
128
# replace nullptr with None (nullptr means nothing to Python devs)
127
129
$line =~ s /\b nullptr\b / None/ g ;
128
130
# replace \returns with :return:
129
- $line =~ s /\\ return(s)?/ \n :return:/ ;
131
+ $line =~ s /\s * \\ return(s)?/ \n :return:/ ;
130
132
131
133
if ( $line =~ m /\\ param / ){
132
134
if ( $COMMENT_PARAM_LIST == 0 )
133
135
{
134
136
$line = " \n $line " ;
135
137
}
136
138
$COMMENT_PARAM_LIST = 1;
137
- $line =~ s /\\ param (\w +)\b / :param $1 :/ g ;
139
+ $line =~ s /\s * \\ param (\w +)\b / :param $1 :/ g ;
138
140
}
139
141
140
142
@@ -951,19 +953,19 @@ sub detect_comment_block{
951
953
foreach my $comment_line (@comment_lines ) {
952
954
if ( $RETURN_TYPE ne ' ' && $comment_line =~ m / ^\s *\.\. \w / ){
953
955
# return type must be added before any other paragraph-level markup
954
- write_output(" CM5" , " :rtype: $RETURN_TYPE \n\n " );
956
+ write_output(" CM5" , " :rtype: $RETURN_TYPE \n\n " );
955
957
$RETURN_TYPE = ' ' ;
956
958
}
957
959
write_output(" CM2" , " $comment_line \n " );
958
960
if ( $RETURN_TYPE ne ' ' && $comment_line =~ m / :return:/ ){
959
961
# return type must be added before any other paragraph-level markup
960
- write_output(" CM5" , " :rtype: $RETURN_TYPE \n\n " );
962
+ write_output(" CM5" , " :rtype: $RETURN_TYPE \n\n " );
961
963
$RETURN_TYPE = ' ' ;
962
964
}
963
965
}
964
966
}
965
967
if ( $RETURN_TYPE ne ' ' ){
966
- write_output(" CM3" , " \n :rtype: $RETURN_TYPE \n " );
968
+ write_output(" CM3" , " \n :rtype: $RETURN_TYPE \n " );
967
969
}
968
970
write_output(" CM4" , " %End \n " );
969
971
}
0 commit comments