summaryrefslogtreecommitdiffstats
path: root/src/pre.l
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2004-01-05 19:00:26 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2004-01-05 19:00:26 (GMT)
commitee63f0e064142addc300e0411b141d2697b73500 (patch)
tree278be3215f40b4fffddab1ec6dc2b8d47da895ac /src/pre.l
parent4369f8dfd78c7d6666a604026017cfe6e4c9fbc4 (diff)
downloadDoxygen-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.l45
1 files changed, 44 insertions, 1 deletions
diff --git a/src/pre.l b/src/pre.l
index 4704a93..0eb3296 100644
--- a/src/pre.l
+++ b/src/pre.l
@@ -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());