summaryrefslogtreecommitdiffstats
path: root/src/pyscanner.l
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2020-09-18 19:04:14 (GMT)
committerGitHub <noreply@github.com>2020-09-18 19:04:14 (GMT)
commit254d1106e52f89fc69620dded9a670358818e8e6 (patch)
tree892b5cf85698dabd398107714eb7084157dbc62b /src/pyscanner.l
parent58895b1763fbc2d09a180204c831cf204adb5e1c (diff)
downloadDoxygen-254d1106e52f89fc69620dded9a670358818e8e6.zip
Doxygen-254d1106e52f89fc69620dded9a670358818e8e6.tar.gz
Doxygen-254d1106e52f89fc69620dded9a670358818e8e6.tar.bz2
Line count mismatch for Python (#8041)
When having an example like: ``` ## General \PYgen0 docu # # # # # General detail \PYgen1 text # and more STYLE_TEMPLATE = r''' \makeatletter ''' ## General \PYgen2 docu # # # # # # General detail \PYgen3 text # and more STYLE_TEMPLATE1 = r''' \makeatletter ''' ``` with ``` EXTRACT_ALL = YES QUIET = YES ``` we get the warnings (removed doubles and sorted): ``` bb.py:1: warning: Found unknown command '\PYgen0' bb.py:10: warning: Found unknown command '\PYgen1' bb.py:12: warning: Found unknown command '\PYgen2' bb.py:23: warning: Found unknown command '\PYgen3' ``` we see here (especially with `PYgen3` a wrong line number. After fixing the line count in `pyscanner.l` there was for the second block an offset of 1. This was caused by `commentscan.l` introduced with #7960 after correcting this this offset was also gone. Revisiting the original example of #7960 showed that here here was also an offset of 1 (probably due to a misinterpretation of where the `<tr>` warning should be mentioned), here it is now also correct.. (The original mismatch was shown of Fossies for the Pygments package)
Diffstat (limited to 'src/pyscanner.l')
-rw-r--r--src/pyscanner.l5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/pyscanner.l b/src/pyscanner.l
index b370515..a136b52 100644
--- a/src/pyscanner.l
+++ b/src/pyscanner.l
@@ -1323,7 +1323,6 @@ STARTDOCSYMS "##"
\n/{B}"#" { // continuation of the comment on the next line
yyextra->docBlock+='\n';
yyextra->docBrief = FALSE;
- startCommentBlock(yyscanner,FALSE);
incLineNr(yyscanner);
}
[^#\n]+ { // any other stuff
@@ -1627,7 +1626,7 @@ static void handleCommentBlock(yyscan_t yyscanner,const QCString &doc,bool brief
}
int position = 0;
- bool needsEntry;
+ bool needsEntry = false;
int lineNr = brief ? yyextra->current->briefLine : yyextra->current->docLine;
Markdown markdown(yyextra->yyFileName,lineNr);
QCString processedDoc = Config_getBool(MARKDOWN_SUPPORT) ? markdown.process(doc,lineNr) : doc;
@@ -1712,7 +1711,7 @@ static void initSpecialBlock(yyscan_t yyscanner)
yyextra->docBrief = TRUE;
yyextra->docBlock.resize(0);
yyextra->commentIndent = yyextra->curIndent;
- startCommentBlock(yyscanner,TRUE);
+ startCommentBlock(yyscanner,FALSE);
}
static void searchFoundDef(yyscan_t yyscanner)