Fixed arrayref.i test.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4396 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Dave Beazley 2003-02-25 22:37:41 +00:00
commit ef2ce5af37
2 changed files with 26 additions and 4 deletions

View file

@ -3543,7 +3543,6 @@ notso_direct_declarator : idcolon {
$$.parms = 0;
$$.have_parms = 0;
}
| NOT idcolon {
$$.id = Char(NewStringf("~%s",$2));
$$.type = 0;
@ -3559,6 +3558,14 @@ notso_direct_declarator : idcolon {
$$.have_parms = 0;
}
/*
| LPAREN AND idcolon RPAREN {
$$.id = Char($3);
$$.type = 0;
$$.parms = 0;
$$.have_parms = 0;
}
*/
/* Technically, this should be LPAREN declarator RPAREN, but we get reduce/reduce conflicts */
| LPAREN pointer notso_direct_declarator RPAREN {
$$ = $3;
@ -3653,6 +3660,13 @@ direct_declarator : idcolon {
}
$$.type = $2;
}
| LPAREN AND direct_declarator RPAREN {
$$ = $3;
if (!$$.type) {
$$.type = NewString("");
}
SwigType_add_reference($$.type);
}
| LPAREN idcolon DSTAR direct_declarator RPAREN {
SwigType *t;
$$ = $4;

View file

@ -1176,6 +1176,10 @@ SwigType_str(SwigType *s, const String_or_char *id)
}
else if (SwigType_isreference(element)) {
Insert(result,0,"&");
if ((nextelement) && ((SwigType_isfunction(nextelement) || (SwigType_isarray(nextelement))))) {
Insert(result,0,"(");
Append(result,")");
}
} else if (SwigType_isarray(element)) {
DOH *size;
Append(result,"[");
@ -1380,11 +1384,15 @@ String *SwigType_rcaststr(SwigType *s, const String_or_char *name) {
}
firstarray = 0;
} else if (SwigType_isreference(element)) {
Insert(result,0,"&");
isreference = 1;
Insert(result,0,"&");
if ((nextelement) && ((SwigType_isfunction(nextelement) || (SwigType_isarray(nextelement))))) {
Insert(result,0,"(");
Append(result,")");
}
isreference = 1;
} else if (SwigType_isarray(element)) {
DOH *size;
if (firstarray) {
if (firstarray && !isreference) {
Append(result,"(*)");
firstarray = 0;
} else {