diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2004-01-05 19:00:26 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2004-01-05 19:00:26 (GMT) |
commit | ee63f0e064142addc300e0411b141d2697b73500 (patch) | |
tree | 278be3215f40b4fffddab1ec6dc2b8d47da895ac /src/pre.l | |
parent | 4369f8dfd78c7d6666a604026017cfe6e4c9fbc4 (diff) | |
download | Doxygen-ee63f0e064142addc300e0411b141d2697b73500.zip Doxygen-ee63f0e064142addc300e0411b141d2697b73500.tar.gz Doxygen-ee63f0e064142addc300e0411b141d2697b73500.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()); |