diff options
author | albert-github <albert.tests@gmail.com> | 2019-12-06 11:46:49 (GMT) |
---|---|---|
committer | albert-github <albert.tests@gmail.com> | 2019-12-06 11:46:49 (GMT) |
commit | 72eed17195c6650d503c191fb8e3ed54d3426df4 (patch) | |
tree | 8886352a870b3fe70cc49109bfb8f42667d81be0 /src/commentcnv.l | |
parent | 4a4fcdf7931efba208a57b658185de689f2ef7fb (diff) | |
download | Doxygen-72eed17195c6650d503c191fb8e3ed54d3426df4.zip Doxygen-72eed17195c6650d503c191fb8e3ed54d3426df4.tar.gz Doxygen-72eed17195c6650d503c191fb8e3ed54d3426df4.tar.bz2 |
Email address seen as code starter
Some email addresses give problems in the comment converter as they contain e.g. `@code`, so we try to detect Email addresses (analogous to doctokenizer.l) to prevent these false positives.
The given warning would ne like:
```
aa.h:13: warning: Reached end of file while still inside a (nested) comment. Nesting level 1 (probable line reference: 1)
```
Diffstat (limited to 'src/commentcnv.l')
-rw-r--r-- | src/commentcnv.l | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/commentcnv.l b/src/commentcnv.l index 13a21c3..66aada1 100644 --- a/src/commentcnv.l +++ b/src/commentcnv.l @@ -119,6 +119,8 @@ static void replaceComment(yyscan_t yyscanner,int offset); %} +MAILADR ("mailto:")?[a-z_A-Z0-9.+-]+"@"[a-z_A-Z0-9-]+("."[a-z_A-Z0-9\-]+)+[a-z_A-Z0-9\-]+ + %option noyywrap %x Scan @@ -335,6 +337,10 @@ static void replaceComment(yyscan_t yyscanner,int offset); yyextra->commentStack.push(new CommentCtx(yyextra->lineNr)); } } +<CComment,ReadLine>{MAILADR} | +<CComment,ReadLine>"<"{MAILADR}">" { // Mail address, to prevent seeing e.g x@code-factory.org as start of a code block + copyToOutput(yyscanner,yytext,(int)yyleng); + } <CComment>"{@code"/[ \t\n] { copyToOutput(yyscanner,"@code",5); yyextra->lastCommentContext = YY_START; @@ -519,7 +525,7 @@ static void replaceComment(yyscan_t yyscanner,int offset); copyToOutput(yyscanner,yytext,(int)yyleng); } -<CComment>[^\\!@*\n{\"\/]* { /* anything that is not a '*' or command */ +<CComment>[^ <\\!@*\n{\"\/]* { /* anything that is not a '*' or command */ copyToOutput(yyscanner,yytext,(int)yyleng); } <CComment>"*"+[^*/\\@\n{\"]* { /* stars without slashes */ |