summaryrefslogtreecommitdiffstats
path: root/src/pycode.l
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2019-04-21 13:59:23 (GMT)
committerDimitri van Heesch <doxygen@gmail.com>2019-04-21 14:01:25 (GMT)
commit6216208b0a4288a41450e4d37226f0e4c492128c (patch)
tree07cee94d592cf127058652928be18534cc2a6b15 /src/pycode.l
parentd226bc27b3c80586234b9c7d8ba2abc500e3be02 (diff)
downloadDoxygen-6216208b0a4288a41450e4d37226f0e4c492128c.zip
Doxygen-6216208b0a4288a41450e4d37226f0e4c492128c.tar.gz
Doxygen-6216208b0a4288a41450e4d37226f0e4c492128c.tar.bz2
Improved const correctness and added support for inline namespaces
Diffstat (limited to 'src/pycode.l')
-rw-r--r--src/pycode.l36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/pycode.l b/src/pycode.l
index 4fb27f1..b0ec68e 100644
--- a/src/pycode.l
+++ b/src/pycode.l
@@ -63,7 +63,7 @@ static const char * g_inputString; //!< the code fragment as text
static int g_inputPosition; //!< read offset during parsing
static const char * g_currentFontClass;
static bool g_needsTermination;
-static Definition *g_searchCtx;
+static const Definition *g_searchCtx;
static bool g_collectXRefs;
static int g_inputLines; //!< number of line in the code fragment
static int g_yyLineNr; //!< current line number
@@ -437,7 +437,7 @@ static void nextCodeLine()
* split into multiple links with the same destination, one for each line.
*/
static void writeMultiLineCodeLink(CodeOutputInterface &ol,
- Definition *d,
+ const Definition *d,
const char *text)
{
static bool sourceTooltips = Config_getBool(SOURCE_TOOLTIPS);
@@ -544,11 +544,11 @@ static bool getLinkInScope(const QCString &c, // scope
const char *text
)
{
- MemberDef *md;
- ClassDef *cd;
- FileDef *fd;
- NamespaceDef *nd;
- GroupDef *gd;
+ MemberDef *md = 0;
+ const ClassDef *cd = 0;
+ const FileDef *fd = 0;
+ const NamespaceDef *nd = 0;
+ const GroupDef *gd = 0;
//printf("Trying `%s'::`%s'\n",c.data(),m.data());
if (getDefs(c,m,"()",md,cd,fd,nd,gd,FALSE,g_sourceFileDef) &&
md->isLinkable())
@@ -556,8 +556,8 @@ static bool getLinkInScope(const QCString &c, // scope
//Definition *d=0;
//if (cd) d=cd; else if (nd) d=nd; else if (fd) d=fd; else d=gd;
- Definition *d = md->getOuterScope()==Doxygen::globalScope ?
- md->getBodyDef() : md->getOuterScope();
+ const Definition *d = md->getOuterScope()==Doxygen::globalScope ?
+ md->getBodyDef() : md->getOuterScope();
//printf("Found! d=%s\n",d?d->name().data():"<none>");
if (md->getGroupDef()) d = md->getGroupDef();
if (d && d->isLinkable())
@@ -634,7 +634,7 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,char *clName,
if (cd==0 && md==0) // also see if it is variable or enum or enum value
{
- NamespaceDef *nd = getResolvedNamespace(scope);
+ const NamespaceDef *nd = getResolvedNamespace(scope);
if (nd)
{
writeMultiLineCodeLink(ol,nd,clName);
@@ -663,8 +663,8 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,char *clName,
addToSearchIndex(className);
if (md)
{
- Definition *d = md->getOuterScope()==Doxygen::globalScope ?
- md->getBodyDef() : md->getOuterScope();
+ const Definition *d = md->getOuterScope()==Doxygen::globalScope ?
+ md->getBodyDef() : md->getOuterScope();
if (md->getGroupDef()) d = md->getGroupDef();
if (d && d->isLinkable() && md->isLinkable() &&
g_currentMemberDef && g_collectXRefs)
@@ -690,8 +690,8 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,char *clName,
g_theCallContext.setClass(stripClassName(md->typeString(),md->getOuterScope()));
writeMultiLineCodeLink(ol,md,clName);
addToSearchIndex(className);
- Definition *d = md->getOuterScope()==Doxygen::globalScope ?
- md->getBodyDef() : md->getOuterScope();
+ const Definition *d = md->getOuterScope()==Doxygen::globalScope ?
+ md->getBodyDef() : md->getOuterScope();
if (md->getGroupDef()) d = md->getGroupDef();
if (d && d->isLinkable() && md->isLinkable() &&
g_currentMemberDef && g_collectXRefs)
@@ -703,7 +703,7 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,char *clName,
}
else // check namespace as well
{
- NamespaceDef *mnd = getResolvedNamespace(scope);
+ const NamespaceDef *mnd = getResolvedNamespace(scope);
if (mnd)
{
MemberDef *md=mnd->getMemberByName(locName);
@@ -713,8 +713,8 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,char *clName,
g_theCallContext.setClass(stripClassName(md->typeString(),md->getOuterScope()));
writeMultiLineCodeLink(ol,md,clName);
addToSearchIndex(className);
- Definition *d = md->getOuterScope()==Doxygen::globalScope ?
- md->getBodyDef() : md->getOuterScope();
+ const Definition *d = md->getOuterScope()==Doxygen::globalScope ?
+ md->getBodyDef() : md->getOuterScope();
if (md->getGroupDef()) d = md->getGroupDef();
if (d && d->isLinkable() && md->isLinkable() &&
g_currentMemberDef && g_collectXRefs)
@@ -1560,7 +1560,7 @@ static void adjustScopesAndSuites(unsigned indentLength)
void parsePythonCode(CodeOutputInterface &od,const char * /*className*/,
const QCString &s,bool exBlock, const char *exName,
FileDef *fd,int startLine,int endLine,bool inlineFragment,
- MemberDef *,bool,Definition *searchCtx,bool collectXRefs)
+ const MemberDef *,bool,const Definition *searchCtx,bool collectXRefs)
{
//printf("***parseCode()\n");