diff options
author | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2002-05-20 14:35:05 (GMT) |
---|---|---|
committer | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2002-05-20 14:35:05 (GMT) |
commit | 5a7cb5383abbd105c22dca28171806bd2a5a9cda (patch) | |
tree | 36be5408c1204bd5806673cb3fef2b25ed031174 /src/commentcnv.l | |
parent | 697375aff0beddb756025e867289213dc46ca45f (diff) | |
download | Doxygen-5a7cb5383abbd105c22dca28171806bd2a5a9cda.zip Doxygen-5a7cb5383abbd105c22dca28171806bd2a5a9cda.tar.gz Doxygen-5a7cb5383abbd105c22dca28171806bd2a5a9cda.tar.bz2 |
Release-1.2.16
Diffstat (limited to 'src/commentcnv.l')
-rw-r--r-- | src/commentcnv.l | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/src/commentcnv.l b/src/commentcnv.l index d2da72c..de7e8a7 100644 --- a/src/commentcnv.l +++ b/src/commentcnv.l @@ -23,6 +23,8 @@ #include <stdlib.h> #include "bufstr.h" +#include "debug.h" +#include "message.h" static BufStr *g_inBuf; static BufStr *g_outBuf; @@ -97,12 +99,17 @@ static int yyread(char *buf,int max_size) <Scan>\n { /* new line */ copyToOutput(yytext,yyleng); } -<Scan>("//!"|"///").*\n/[ \t]*"//" { /* start C++ style special comment block */ - copyToOutput("/*!",3); - copyToOutput(yytext+3,yyleng-3); +<Scan>("//!"|"///").*\n/[ \t]*"//"[\/!][^\/] { /* start C++ style special comment block */ + int i=3; + if (yytext[2]=='/') + { + while (i<yyleng && yytext[i]=='/') i++; + } + copyToOutput("/**",3); + copyToOutput(yytext+i,yyleng-i); BEGIN(SComment); } -<Scan>"//".*\n { /* one line C++ comment */ +<Scan>"//"[\/!].*\n { /* one line C++ comment */ copyToOutput(yytext,yyleng); } <Scan>"/*" { /* start of a C comment */ @@ -155,10 +162,22 @@ static int yyread(char *buf,int max_size) copyToOutput(yytext,yyleng); BEGIN(Scan); } -<SComment>^[ \t]*"//".*/\n { /* second line of special comment */ +<SComment>^[ \t]*"///"[\/]*\n { + replaceCommentMarker(yytext,yyleng); + } +<SComment>^[ \t]*"///"[^\/\n].*/\n { + replaceCommentMarker(yytext,yyleng); + } +<SComment>^[ \t]*"//!".*/\n { /* second line of special comment */ replaceCommentMarker(yytext,yyleng); } -<SComment>\n[ \t]*"//".*/\n { /* other line of special comment */ +<SComment>\n[ \t]*"///"[\/]*\n { + replaceCommentMarker(yytext,yyleng); + } +<SComment>\n[ \t]*"///"[^\/\n].*/\n { + replaceCommentMarker(yytext,yyleng); + } +<SComment>\n[ \t]*"//!".*/\n { /* other line of special comment */ replaceCommentMarker(yytext,yyleng); } <SComment>\n { /* end of special comment */ @@ -176,6 +195,10 @@ void convertCppComments(BufStr *inBuf,BufStr *outBuf) g_inBufPos = 0; BEGIN(Scan); yylex(); + if (Debug::isFlagSet(Debug::CommentCnv)) + { + msg("-------------\n%s\n-------------\n",g_outBuf->data()); + } } //---------------------------------------------------------------------------- |