diff options
author | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2004-12-28 15:52:58 (GMT) |
---|---|---|
committer | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2004-12-28 15:52:58 (GMT) |
commit | 81adebde00a3fe5954b403f8c0d1a1a6ed833fa8 (patch) | |
tree | 659ad23b069fb18276bbc9610ed0f2c48169722b /src/commentcnv.l | |
parent | 0e5fe1510853a0a05add1a9a25b3958893591328 (diff) | |
download | Doxygen-81adebde00a3fe5954b403f8c0d1a1a6ed833fa8.zip Doxygen-81adebde00a3fe5954b403f8c0d1a1a6ed833fa8.tar.gz Doxygen-81adebde00a3fe5954b403f8c0d1a1a6ed833fa8.tar.bz2 |
Release-1.3.9.1-20041228
Diffstat (limited to 'src/commentcnv.l')
-rw-r--r-- | src/commentcnv.l | 38 |
1 files changed, 33 insertions, 5 deletions
diff --git a/src/commentcnv.l b/src/commentcnv.l index dc152a1..d129ff3 100644 --- a/src/commentcnv.l +++ b/src/commentcnv.l @@ -245,6 +245,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^' \\\n]{1,4}"'")) %x Verbatim %x ReadLine %x CondLine +%x SkipLang %% @@ -290,18 +291,18 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^' \\\n]{1,4}"'")) copyToOutput(yytext,yyleng); BEGIN(CComment); } -<Scan>"\\verbatim" { /* start of a verbatim block */ +<Scan>[\\@]"verbatim" { /* start of a verbatim block */ copyToOutput(yytext,yyleng); BEGIN(Verbatim); } <Scan>. { /* any other character */ copyToOutput(yytext,yyleng); } -<Verbatim>"\\endverbatim" { /* end of verbatim block */ +<Verbatim>[\\@]"endverbatim" { /* end of verbatim block */ copyToOutput(yytext,yyleng); BEGIN(Scan); } -<Verbatim>[^\\\n]* { /* any character not a backslash or new line */ +<Verbatim>[^@\\\n]* { /* any character not a backslash or new line */ copyToOutput(yytext,yyleng); } <Verbatim>\n { /* new line in verbatim block */ @@ -310,6 +311,25 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^' \\\n]{1,4}"'")) <Verbatim>. { /* any other character */ copyToOutput(yytext,yyleng); } +<SkipLang>[\\@]"~"[a-zA-Z]* { /* end of verbatim block */ + QCString langId = &yytext[2]; + if (langId.isEmpty() || + stricmp(Config_getEnum("OUTPUT_LANGUAGE"),langId)==0) + { // enable language specific section + BEGIN(CComment); + } + } +<SkipLang>[^*@\\\n]* { /* any character not a *, @, backslash or new line */ + } +<SkipLang>\n { /* new line in verbatim block */ + copyToOutput(yytext,yyleng); + } +<SkipLang>"*/" { /* end of comment block */ + copyToOutput(yytext,yyleng); + BEGIN(Scan); + } +<SkipLang>. { /* any other character */ + } <SkipString>\\. { /* escaped character in string */ copyToOutput(yytext,yyleng); } @@ -323,7 +343,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^' \\\n]{1,4}"'")) <SkipString>\n { /* new line inside string (illegal for some compilers) */ copyToOutput(yytext,yyleng); } -<CComment>[^\\@*\n]* { /* anything that is not a '*' */ +<CComment>[^\\@*\n]* { /* anything that is not a '*' or command */ copyToOutput(yytext,yyleng); } <CComment>"*"+[^*/\\@\n]* { /* stars without slashes */ @@ -388,9 +408,17 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^' \\\n]{1,4}"'")) copyToOutput(yytext,yyleng); BEGIN(g_readLineCtx); } -<CComment,ReadLine>("\\\\"|"@@")[a-z_A-Z][a-z_A-Z0-9]*[ \t]* { // escaped command +<CComment,ReadLine>("\\\\"|"@@")[~a-z_A-Z][a-z_A-Z0-9]*[ \t]* { // escaped command copyToOutput(yytext,yyleng); } +<CComment>[@\\]"~"[a-zA-Z]* { // language switch + QCString langId = &yytext[2]; + if (!langId.isEmpty() && + stricmp(Config_getEnum("OUTPUT_LANGUAGE"),langId)!=0) + { + BEGIN(SkipLang); + } + } <CComment,ReadLine>[\\@]"cond"[ \t]+ { // conditional section g_condCtx = YY_START; BEGIN(CondLine); |