diff options
author | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2004-01-05 19:00:26 (GMT) |
---|---|---|
committer | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2004-01-05 19:00:26 (GMT) |
commit | 29348f280d674693e74e30ae55ca63ab3b97372e (patch) | |
tree | 278be3215f40b4fffddab1ec6dc2b8d47da895ac /src/pre.l | |
parent | 104be290eb99ab3277906a57fb4673dfa1850bc6 (diff) | |
download | Doxygen-29348f280d674693e74e30ae55ca63ab3b97372e.zip Doxygen-29348f280d674693e74e30ae55ca63ab3b97372e.tar.gz Doxygen-29348f280d674693e74e30ae55ca63ab3b97372e.tar.bz2 |
Release-1.3.5-20040105
Diffstat (limited to 'src/pre.l')
-rw-r--r-- | src/pre.l | 45 |
1 files changed, 44 insertions, 1 deletions
@@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2003 by Dimitri van Heesch. + * Copyright (C) 1997-2004 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -239,6 +239,44 @@ static FILE *findFile(const char *fileName,bool localInclude) return 0; } +static QCString extractTrailingComment(const char *s) +{ + if (s==0) return ""; + int i=strlen(s)-1; + while (i>=0) + { + char c=s[i]; + switch (c) + { + case '/': + { + i--; + if (i>=0 && s[i]=='*') // end of a comment block + { + i--; + while (i>0 && !(s[i-1]=='/' && s[i]=='*')) i--; + if (i==0) return s; else return &s[i-1]; + } + else + { + return ""; + } + } + break; + // whitespace or line-continuation + case ' ': + case '\t': + case '\r': + case '\n': + case '\\': + break; + default: + return ""; + } + i--; + } + return ""; +} static int getNextChar(const QCString &expr,QCString *rest,uint &pos); static int getCurrentChar(const QCString &expr,QCString *rest,uint pos); @@ -1819,6 +1857,11 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) } <DefineText>\n { g_defLitText+=yytext; + QCString comment=extractTrailingComment(g_defLitText); + if (!comment.isEmpty()) + { + outputArray(comment,comment.length()); + } outputChar('\n'); Define *def=0; //printf("Define name=`%s' text=`%s' litTexti=`%s'\n",g_defName.data(),g_defText.data(),g_defLitText.data()); |