Skip to content
Permalink
Browse files

[sipify] enhanced SIP_OUT handling

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 bd32078635cd4ccc7e2891c98452928932bf5782
Showing with 9 additions and 3 deletions.
  1. +9 −3 scripts/sipify.pl
@@ -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*)$/) {
@@ -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");

0 comments on commit bd32078

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