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:
parent
ec6d63f8d6
commit
ef2ce5af37
2 changed files with 26 additions and 4 deletions
|
|
@ -3543,7 +3543,6 @@ notso_direct_declarator : idcolon {
|
||||||
$$.parms = 0;
|
$$.parms = 0;
|
||||||
$$.have_parms = 0;
|
$$.have_parms = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
| NOT idcolon {
|
| NOT idcolon {
|
||||||
$$.id = Char(NewStringf("~%s",$2));
|
$$.id = Char(NewStringf("~%s",$2));
|
||||||
$$.type = 0;
|
$$.type = 0;
|
||||||
|
|
@ -3559,6 +3558,14 @@ notso_direct_declarator : idcolon {
|
||||||
$$.have_parms = 0;
|
$$.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 */
|
/* Technically, this should be LPAREN declarator RPAREN, but we get reduce/reduce conflicts */
|
||||||
| LPAREN pointer notso_direct_declarator RPAREN {
|
| LPAREN pointer notso_direct_declarator RPAREN {
|
||||||
$$ = $3;
|
$$ = $3;
|
||||||
|
|
@ -3653,6 +3660,13 @@ direct_declarator : idcolon {
|
||||||
}
|
}
|
||||||
$$.type = $2;
|
$$.type = $2;
|
||||||
}
|
}
|
||||||
|
| LPAREN AND direct_declarator RPAREN {
|
||||||
|
$$ = $3;
|
||||||
|
if (!$$.type) {
|
||||||
|
$$.type = NewString("");
|
||||||
|
}
|
||||||
|
SwigType_add_reference($$.type);
|
||||||
|
}
|
||||||
| LPAREN idcolon DSTAR direct_declarator RPAREN {
|
| LPAREN idcolon DSTAR direct_declarator RPAREN {
|
||||||
SwigType *t;
|
SwigType *t;
|
||||||
$$ = $4;
|
$$ = $4;
|
||||||
|
|
|
||||||
|
|
@ -1176,6 +1176,10 @@ SwigType_str(SwigType *s, const String_or_char *id)
|
||||||
}
|
}
|
||||||
else if (SwigType_isreference(element)) {
|
else if (SwigType_isreference(element)) {
|
||||||
Insert(result,0,"&");
|
Insert(result,0,"&");
|
||||||
|
if ((nextelement) && ((SwigType_isfunction(nextelement) || (SwigType_isarray(nextelement))))) {
|
||||||
|
Insert(result,0,"(");
|
||||||
|
Append(result,")");
|
||||||
|
}
|
||||||
} else if (SwigType_isarray(element)) {
|
} else if (SwigType_isarray(element)) {
|
||||||
DOH *size;
|
DOH *size;
|
||||||
Append(result,"[");
|
Append(result,"[");
|
||||||
|
|
@ -1380,11 +1384,15 @@ String *SwigType_rcaststr(SwigType *s, const String_or_char *name) {
|
||||||
}
|
}
|
||||||
firstarray = 0;
|
firstarray = 0;
|
||||||
} else if (SwigType_isreference(element)) {
|
} else if (SwigType_isreference(element)) {
|
||||||
Insert(result,0,"&");
|
Insert(result,0,"&");
|
||||||
isreference = 1;
|
if ((nextelement) && ((SwigType_isfunction(nextelement) || (SwigType_isarray(nextelement))))) {
|
||||||
|
Insert(result,0,"(");
|
||||||
|
Append(result,")");
|
||||||
|
}
|
||||||
|
isreference = 1;
|
||||||
} else if (SwigType_isarray(element)) {
|
} else if (SwigType_isarray(element)) {
|
||||||
DOH *size;
|
DOH *size;
|
||||||
if (firstarray) {
|
if (firstarray && !isreference) {
|
||||||
Append(result,"(*)");
|
Append(result,"(*)");
|
||||||
firstarray = 0;
|
firstarray = 0;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue