summaryrefslogtreecommitdiffstats
path: root/src/vhdlcode.l
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2016-09-02 13:01:11 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2016-09-03 09:04:38 (GMT)
commit9ae1af9b8679a0f14cb568d1db3afcc6e3ba40a6 (patch)
treecd636c234fbe837dddfabbb0230aa016e01d6572 /src/vhdlcode.l
parent445347566078a1cc64705f28932e1da5bf9f531f (diff)
downloadDoxygen-9ae1af9b8679a0f14cb568d1db3afcc6e3ba40a6.zip
Doxygen-9ae1af9b8679a0f14cb568d1db3afcc6e3ba40a6.tar.gz
Doxygen-9ae1af9b8679a0f14cb568d1db3afcc6e3ba40a6.tar.bz2
Bug 770660 - Code snippet always shows line numbers from 1
This patch makes the handling of the \snippet and other commands consistent between the different languages (no line numbers anymore with python) and also introduces analogous to \includelineno the command \snippetlineno. Some non relevant changes: - *code.l Calculation of the end line was incorrect, in case of a snippet the end line was the number of lines of the snippet and not reltive to the start line. - *code.l made consistent over the different laguages, enabling exBlock and inlineFragment - testing/indexpage.xml in test 14 the \snippet command was used with python and giving line numbers, linenumbers are now gone (consistency)
Diffstat (limited to 'src/vhdlcode.l')
-rw-r--r--src/vhdlcode.l16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/vhdlcode.l b/src/vhdlcode.l
index 6d2ebcb..ebebc10 100644
--- a/src/vhdlcode.l
+++ b/src/vhdlcode.l
@@ -85,6 +85,7 @@ static int g_yyLineNr; //!< current line number
static bool g_needsTermination;
static Definition *g_searchCtx;
+static bool g_exampleBlock;
static QCString g_exampleName;
static QCString g_exampleFile;
@@ -1504,7 +1505,7 @@ void resetVhdlCodeParserState()
}
void parseVhdlCode(CodeOutputInterface &od,const char *className,const QCString &s,
- bool /*exBlock*/, const char *exName,FileDef *fd,
+ bool exBlock, const char *exName,FileDef *fd,
int startLine,int endLine,bool inlineFragment,
MemberDef *memberDef,bool,Definition *searchCtx,
bool /* collectXRefs */)
@@ -1527,23 +1528,24 @@ void parseVhdlCode(CodeOutputInterface &od,const char *className,const QCString
g_needsTermination = FALSE;
g_searchCtx = searchCtx;
- if (endLine!=-1)
- g_inputLines = endLine+1;
- else
- g_inputLines = countLines();
-
if (startLine!=-1)
g_yyLineNr = startLine;
else
g_yyLineNr = 1;
+ if (endLine!=-1)
+ g_inputLines = endLine+1;
+ else
+ g_inputLines = g_yyLineNr + countLines() - 1;
+
// g_theCallContext.clear();
g_classScope = className;
+ g_exampleBlock = exBlock;
g_exampleName = exName;
g_sourceFileDef = fd;
bool cleanupSourceDef = FALSE;
- if (fd==0)
+ if (exBlock && fd==0)
{
// create a dummy filedef for the example
g_sourceFileDef = new FileDef("",exName);