diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2002-05-20 14:35:05 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2002-05-20 14:35:05 (GMT) |
commit | 2999d2732d1471f144721808e52c04aa17dd63b6 (patch) | |
tree | 36be5408c1204bd5806673cb3fef2b25ed031174 /src/commentcnv.l | |
parent | bcf2f33d5be8c6de4de5bb7cbe8ea8b90f19cf88 (diff) | |
download | Doxygen-2999d2732d1471f144721808e52c04aa17dd63b6.zip Doxygen-2999d2732d1471f144721808e52c04aa17dd63b6.tar.gz Doxygen-2999d2732d1471f144721808e52c04aa17dd63b6.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()); + } } //---------------------------------------------------------------------------- |