Add some comments. Add extra assertions in SwigType_parmlist
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10194 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
27b7d1de5b
commit
afc303a8ec
1 changed files with 26 additions and 8 deletions
|
|
@ -231,7 +231,7 @@ String *SwigType_parm(SwigType *t) {
|
||||||
* ----------------------------------------------------------------------------- */
|
* ----------------------------------------------------------------------------- */
|
||||||
|
|
||||||
List *SwigType_split(const SwigType *t) {
|
List *SwigType_split(const SwigType *t) {
|
||||||
DOH *item;
|
String *item;
|
||||||
List *list;
|
List *list;
|
||||||
char *c;
|
char *c;
|
||||||
int len;
|
int len;
|
||||||
|
|
@ -253,19 +253,32 @@ List *SwigType_split(const SwigType *t) {
|
||||||
/* -----------------------------------------------------------------------------
|
/* -----------------------------------------------------------------------------
|
||||||
* SwigType_parmlist()
|
* SwigType_parmlist()
|
||||||
*
|
*
|
||||||
* Splits a comma separated list of type components into strings.
|
* Splits a comma separated list of parameters into its component parts
|
||||||
|
* The input is expected to contain the parameter list within () brackets
|
||||||
|
* returns 0 if no argument list in the input, ie there are no round brackets ()
|
||||||
|
* returns a List containing a single empty string if there are no parameters in the () brackets
|
||||||
|
* For example:
|
||||||
|
*
|
||||||
|
* Foo(std::string,p.f().Bar<(int,double)>)
|
||||||
|
*
|
||||||
|
* returns 2 elements in the list:
|
||||||
|
* std::string
|
||||||
|
* p.f().Bar<(int,double)>
|
||||||
* ----------------------------------------------------------------------------- */
|
* ----------------------------------------------------------------------------- */
|
||||||
|
|
||||||
List *SwigType_parmlist(const String *p) {
|
List *SwigType_parmlist(const String *p) {
|
||||||
DOH *item;
|
String *item;
|
||||||
List *list;
|
List *list;
|
||||||
char *c, *itemstart;
|
char *c;
|
||||||
|
char *itemstart;
|
||||||
|
|
||||||
|
assert(p);
|
||||||
c = Char(p);
|
c = Char(p);
|
||||||
while (*c && (*c != '(') && (*c != '.'))
|
while (*c && (*c != '(') && (*c != '.'))
|
||||||
c++;
|
c++;
|
||||||
if (!*c || (*c == '.'))
|
if (!*c)
|
||||||
return 0;
|
return 0;
|
||||||
|
assert(*c != '.'); /* p is expected to contain sub elements of a type */
|
||||||
c++;
|
c++;
|
||||||
list = NewList();
|
list = NewList();
|
||||||
itemstart = c;
|
itemstart = c;
|
||||||
|
|
@ -804,7 +817,7 @@ SwigType *SwigType_add_template(SwigType *t, ParmList *parms) {
|
||||||
*
|
*
|
||||||
* Foo<(p.int)>::bar
|
* Foo<(p.int)>::bar
|
||||||
*
|
*
|
||||||
* Results in "Foo"
|
* returns "Foo"
|
||||||
* ----------------------------------------------------------------------------- */
|
* ----------------------------------------------------------------------------- */
|
||||||
|
|
||||||
String *SwigType_templateprefix(const SwigType *t) {
|
String *SwigType_templateprefix(const SwigType *t) {
|
||||||
|
|
@ -848,7 +861,12 @@ String *SwigType_templatesuffix(const SwigType *t) {
|
||||||
/* -----------------------------------------------------------------------------
|
/* -----------------------------------------------------------------------------
|
||||||
* SwigType_templateargs()
|
* SwigType_templateargs()
|
||||||
*
|
*
|
||||||
* Returns the template part
|
* Returns the template arguments
|
||||||
|
* For example:
|
||||||
|
*
|
||||||
|
* Foo<(p.int)>::bar
|
||||||
|
*
|
||||||
|
* returns "<(p.int)>"
|
||||||
* ----------------------------------------------------------------------------- */
|
* ----------------------------------------------------------------------------- */
|
||||||
|
|
||||||
String *SwigType_templateargs(const SwigType *t) {
|
String *SwigType_templateargs(const SwigType *t) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue