Skip to content

Commit

Permalink
[sipify] enhanced SIP_OUT handling
Browse files Browse the repository at this point in the history
return an error if method with SIP_OUT arguments has no \return directive AND is not void
create list of outputs for better visualization
  • Loading branch information
3nids committed Dec 19, 2018
1 parent a753f8b commit bd32078
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions scripts/sipify.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1235,12 +1235,17 @@ sub detect_non_method_member{
next;
}
}
write_output("CM2", "$doc_prepend$comment_line\n");
if ( $comment_line =~ m/:return:/ && $#out_params >= 0 ){
$waiting_for_return_to_end = 1;
$comment_line =~ s/:return:/:return: -/;
write_output("CM2", "$doc_prepend$comment_line\n");
foreach my $out_param (@out_params) {
write_output("CM7", "$doc_prepend $out_param\n");
write_output("CM7", "$doc_prepend - $out_param\n");
}
@out_params = ();
}
else {
write_output("CM2", "$doc_prepend$comment_line\n");
}
if ( $waiting_for_return_to_end == 1 ) {
if ($comment_line =~ m/^(:.*|\.\..*|\s*)$/) {
Expand All @@ -1256,7 +1261,8 @@ sub detect_non_method_member{
# $RETURN_TYPE = '';
# }
}
write_output("CM4", "$doc_prepend%End\n");
exit_with_error("A method with output parameters must contain a return directive (method returns ${RETURN_TYPE})") if $#out_params >= 0 and $RETURN_TYPE ne '';
write_output("CM4", "$doc_prepend%End\n");
}
# if ( $RETURN_TYPE ne '' ){
# write_output("CM3", "\n:rtype: $RETURN_TYPE\n");
Expand Down

0 comments on commit bd32078

Please sign in to comment.