summaryrefslogtreecommitdiffstats
path: root/src/commentcnv.l
diff options
context:
space:
mode:
authordimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2010-11-18 21:50:39 (GMT)
committerdimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2010-11-18 21:50:39 (GMT)
commit0014470c309dccbc2ac72c527391039900b8cf3d (patch)
treea6d2454b4e6d53003fa829bb7134fe373461ed97 /src/commentcnv.l
parent01f41c40b8505c8f197ef1e5bf7e3a3bc777dc0e (diff)
downloadDoxygen-0014470c309dccbc2ac72c527391039900b8cf3d.zip
Doxygen-0014470c309dccbc2ac72c527391039900b8cf3d.tar.gz
Doxygen-0014470c309dccbc2ac72c527391039900b8cf3d.tar.bz2
Release-1.7.2-20101118
Diffstat (limited to 'src/commentcnv.l')
-rw-r--r--src/commentcnv.l63
1 files changed, 36 insertions, 27 deletions
diff --git a/src/commentcnv.l b/src/commentcnv.l
index 660dae6..d3a7a92 100644
--- a/src/commentcnv.l
+++ b/src/commentcnv.l
@@ -25,6 +25,7 @@
#include <qstack.h>
#include <qregexp.h>
#include <qtextstream.h>
+#include <qglobal.h>
#include "bufstr.h"
#include "debug.h"
@@ -33,6 +34,7 @@
#include "doxygen.h"
#include "util.h"
+#include <assert.h>
#define ADDCHAR(c) g_outBuf->addChar(c)
#define ADDARRAY(a,s) g_outBuf->addArray(a,s)
@@ -134,7 +136,7 @@ static inline void copyToOutput(const char *s,int len)
}
}
}
- else
+ else if (len>0)
{
ADDARRAY(s,len);
static int tabSize=Config_getInt("TAB_SIZE");
@@ -318,17 +320,23 @@ void replaceComment(int offset);
copyToOutput(yytext,yyleng);
}
<Scan>("//!"|"///").*/\n[ \t]*"//"[\/!][^\/] { /* start C++ style special comment block */
- if (g_mlBrief) REJECT; // bail out if we do not need to convert
- int i=3;
- if (yytext[2]=='/')
+ if (g_mlBrief)
{
- while (i<(int)yyleng && yytext[i]=='/') i++;
+ REJECT; // bail out if we do not need to convert
+ }
+ else
+ {
+ int i=3;
+ if (yytext[2]=='/')
+ {
+ while (i<(int)yyleng && yytext[i]=='/') i++;
+ }
+ g_blockHeadCol=g_col;
+ copyToOutput("/**",3);
+ replaceAliases(yytext+i);
+ g_inSpecialComment=TRUE;
+ BEGIN(SComment);
}
- g_blockHeadCol=g_col;
- copyToOutput("/**",3);
- replaceAliases(yytext+i);
- g_inSpecialComment=TRUE;
- BEGIN(SComment);
}
<Scan>"//##Documentation".*/\n { /* Start of Rational Rose ANSI C++ comment block */
if (g_mlBrief) REJECT;
@@ -602,7 +610,7 @@ void replaceComment(int offset);
}
<SComment>\n[ \t]*"//!" |
<SComment>\n[ \t]*"//!<"/.*\n |
-<SComment>\n[ \t]*"//!"[^<\n]/.*\n {
+<SComment>\n[ \t]*"//!"[^<\n]/.*\n {
replaceComment(1);
g_readLineCtx=YY_START;
BEGIN(ReadLine);
@@ -752,24 +760,25 @@ void replaceComment(int offset);
%%
-void replaceComment(int offset)
+void replaceComment(int offset)
{
- if (g_mlBrief)
- {
- copyToOutput(yytext,yyleng);
- }
- else
- {
+ if (g_mlBrief)
+ {
+ copyToOutput(yytext,yyleng);
+ }
+ else
+ {
//printf("replaceComment(%s)\n",yytext);
- int i=computeIndent(&yytext[offset]);
- if (i==g_blockHeadCol)
- {
- replaceCommentMarker(yytext,yyleng);
- }
- else
- {
- copyToOutput(" */",3);
- int i;for (i=yyleng-1;i>=0;i--) unput(yytext[i]);
+ int i=computeIndent(&yytext[offset]);
+ if (i==g_blockHeadCol)
+ {
+ replaceCommentMarker(yytext,yyleng);
+ }
+ else
+ {
+ copyToOutput(" */",3);
+ int i;for (i=yyleng-1;i>=0;i--) unput(yytext[i]);
+ g_inSpecialComment=FALSE;
BEGIN(Scan);
}
}