Fixed a bug with argout values being incorrectly

returned when the first argout/returned element
was an array.

Made std::pair and container returned elements be
frozen (like tuples in python).

Added the std_containers.i test from python and
created a ruby runme file for it.




git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9746 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Gonzalo Garramuno 2007-05-01 22:40:55 +00:00
commit 1b349d4749
6 changed files with 360 additions and 4 deletions

View file

@ -942,7 +942,7 @@ public:
Replaceall(tm, "$input", Getattr(p, "emit:input"));
Printv(outarg, tm, "\n", NIL);
need_result = 1;
need_result += 1;
p = Getattr(p, "tmap:argout:next");
} else {
p = nextSibling(p);
@ -1239,6 +1239,19 @@ public:
need_result = 1;
// Printf(f->code, "DATA_PTR(self) = result;\n");
}
else
{
if ( need_result > 1 ) {
if ( SwigType_type(t) == T_VOID )
Printf(f->code, "vresult = rb_ary_new();\n");
else
{
Printf(f->code, "if (vresult == Qnil) vresult = rb_ary_new();\n");
Printf(f->code, "else vresult = SWIG_Ruby_AppendOutput( "
"rb_ary_new(), vresult);\n");
}
}
}
/* Dump argument output code; */
Printv(f->code, outarg, NIL);