diff options
author | albert-github <albert.tests@gmail.com> | 2019-05-03 17:54:27 (GMT) |
---|---|---|
committer | albert-github <albert.tests@gmail.com> | 2019-05-03 17:54:27 (GMT) |
commit | 2eeeb637f1f856599c4d69395c146000b4524163 (patch) | |
tree | b917a0b6017ad9e2e951edaa5a3ab299877887d0 | |
parent | ac76b9a7a70b3c828c76442f5977937fcb87811a (diff) | |
download | Doxygen-2eeeb637f1f856599c4d69395c146000b4524163.zip Doxygen-2eeeb637f1f856599c4d69395c146000b4524163.tar.gz Doxygen-2eeeb637f1f856599c4d69395c146000b4524163.tar.bz2 |
Incorrect Reached end of file while still inside a (nested) comment for TCL / Python
In case we have in the comment (or in the code) of a TCL file of Python file a construct like:
```
proc get_suite {dir {sort 1}} {
set files [glob -nocomplain $dir/*.bin]
set files [glob -nocomplain $dir/*.ps]
}
```
we get the warning:
```
warning: Reached end of file while still inside a (nested) comment. Nesting level 2 (probable line reference: 3, 2)
```
although the '/*' construct has no special comment meaning in TCL / Python (comment signs '#' / '#' or '"""). So if a c-comment construct is found it is ignored for TCL and Python.
-rw-r--r-- | src/commentcnv.l | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/commentcnv.l b/src/commentcnv.l index 6b08d74..0ea5ff7 100644 --- a/src/commentcnv.l +++ b/src/commentcnv.l @@ -399,6 +399,10 @@ void replaceComment(int offset); copyToOutput(yytext,(int)yyleng); } <Scan>"/*"[*!]? { /* start of a C comment */ + if ((g_lang==SrcLangExt_Python) || (g_lang==SrcLangExt_Tcl)) + { + REJECT; + } g_specialComment=(int)yyleng==3; g_nestingCount=0; g_commentStack.clear(); /* to be on the save side */ @@ -660,12 +664,16 @@ void replaceComment(int offset); } } <CComment>"/"+"*" { /* nested C comment */ + if ((g_lang==SrcLangExt_Python) || (g_lang==SrcLangExt_Tcl)) + { + REJECT; + } g_nestingCount++; g_commentStack.push(new CommentCtx(g_lineNr)); copyToOutput(yytext,(int)yyleng); } <CComment>"*"+"/" { /* end of C comment */ - if (g_lang==SrcLangExt_Python) + if ((g_lang==SrcLangExt_Python) || (g_lang==SrcLangExt_Tcl)) { REJECT; } |