diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2010-12-24 16:12:24 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2010-12-24 16:12:24 (GMT) |
commit | 48f4fd9c2d9ba8b374e3c052f888df9bc220df92 (patch) | |
tree | 2e3f5d0757e53645fc902d0a87aa44dfd31d2d4d /src/defargs.l | |
parent | dd7602fdd31d8f3e0f88be553da084a1e3fdec45 (diff) | |
download | Doxygen-48f4fd9c2d9ba8b374e3c052f888df9bc220df92.zip Doxygen-48f4fd9c2d9ba8b374e3c052f888df9bc220df92.tar.gz Doxygen-48f4fd9c2d9ba8b374e3c052f888df9bc220df92.tar.bz2 |
Release-1.7.2-20101224
Diffstat (limited to 'src/defargs.l')
-rw-r--r-- | src/defargs.l | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/defargs.l b/src/defargs.l index 048fafd..048d6f6 100644 --- a/src/defargs.l +++ b/src/defargs.l @@ -275,11 +275,10 @@ ID [a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]* int i=l-1; while (i>=0 && (isspace((uchar)g_curArgTypeName.at(i)) || g_curArgTypeName.at(i)=='.')) i--; while (i>=0 && isId(g_curArgTypeName.at(i))) i--; - //printf("g_curArgTypeName=`%s' i=%d\n",g_curArgTypeName.data(),i); Argument *a = new Argument; a->attrib = g_curArgAttrib.copy(); //printf("a->type=%s a->name=%s i=%d l=%d\n", - // a->type.data(),a->name.data(),i,l); + // a->type.data(),a->name.data(),i,l); a->array.resize(0); if (i==l-1 && g_curArgTypeName.at(i)==')') // function argument { @@ -300,24 +299,28 @@ ID [a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]* } else if (i>=0 && g_curArgTypeName.at(i)!=':') { // type contains a name - a->type = removeRedundantWhiteSpace(g_curArgTypeName.left(i+1)); + a->type = removeRedundantWhiteSpace(g_curArgTypeName.left(i+1)).stripWhiteSpace(); a->name = g_curArgTypeName.right(l-i-1).stripWhiteSpace(); // if the type becomes a type specifier only then we make a mistake // and need to correct it to avoid seeing a nameless parameter // "struct A" as a parameter with type "struct" and name "A". int sv=0; - if (a->type.left(6)=="const ") sv=6; - else if (a->type.left(8)=="volatile ") sv=9; - if (a->type.mid(sv)=="struct" || - a->type.mid(sv)=="union" || - a->type.mid(sv)=="class" || - a->type.mid(sv)=="typename" || - a->type=="const" || a->type=="volatile") + if (a->type.left(6)=="const ") sv=6; + else if (a->type.left(9)=="volatile ") sv=9; + + if (a->type.mid(sv)=="struct" || + a->type.mid(sv)=="union" || + a->type.mid(sv)=="class" || + a->type.mid(sv)=="typename" || + a->type=="const" || + a->type=="volatile" + ) { a->type = a->type + " " + a->name; a->name.resize(0); } + //printf(" --> a->type='%s'\n",a->type.data()); } else // assume only the type was specified, try to determine name later { |