diff options
Diffstat (limited to 'src/pyscanner.l')
-rw-r--r-- | src/pyscanner.l | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/pyscanner.l b/src/pyscanner.l index 963b4e8..efdc943 100644 --- a/src/pyscanner.l +++ b/src/pyscanner.l @@ -72,10 +72,10 @@ static QFile inputFile; static Protection protection; -static Entry* current_root = 0 ; -static std::unique_ptr<Entry> current; -static Entry* previous = 0 ; -static Entry* bodyEntry = 0 ; +static std::shared_ptr<Entry> current_root; +static std::shared_ptr<Entry> current; +static std::shared_ptr<Entry> previous; +static std::shared_ptr<Entry> bodyEntry; static int yyLineNr = 1 ; static QCString yyFileName; static MethodTypes mtype; @@ -151,7 +151,7 @@ static void initEntry() static void newEntry() { - previous = current.get(); + previous = current; current_root->moveToSubEntryAndRefresh(current); initEntry(); } @@ -292,7 +292,7 @@ static void handleCommentBlock(const QCString &doc,bool brief) QCString processedDoc = preprocessCommentBlock(doc,yyFileName,lineNr); while (parseCommentBlock( g_thisParser, - (docBlockInBody && previous) ? previous : current.get(), + (docBlockInBody && previous) ? previous.get() : current.get(), processedDoc, // text yyFileName, // file lineNr, @@ -913,7 +913,7 @@ STARTDOCSYMS "##" } {B}":"{B} { // function without arguments g_specialBlock = TRUE; // expecting a docstring - bodyEntry = current.get(); + bodyEntry = current; BEGIN(FunctionBody); } @@ -1300,7 +1300,7 @@ STARTDOCSYMS "##" current->program+=yytext; //current->startLine = yyLineNr; g_curIndent=computeIndent(yytext); - bodyEntry = current.get(); + bodyEntry = current; DBG_CTX((stderr,"setting indent %d\n",g_curIndent)); //printf("current->program=[%s]\n",current->program.data()); //g_hideClassDocs = TRUE; @@ -1706,12 +1706,12 @@ STARTDOCSYMS "##" //---------------------------------------------------------------------------- -static void parseCompounds(Entry *rt) +static void parseCompounds(std::shared_ptr<Entry> rt) { //printf("parseCompounds(%s)\n",rt->name.data()); for (int i=0; i<rt->children().size(); ++i) { - Entry *ce = rt->children()[i].get(); + std::shared_ptr<Entry> ce = rt->children()[i]; if (!ce->program.isEmpty()) { //printf("-- %s ---------\n%s\n---------------\n", @@ -1727,14 +1727,14 @@ static void parseCompounds(Entry *rt) } else if (ce->parent()) { - current_root = ce->parent(); + current_root = rt; //printf("Searching for member variables in %s parent=%s\n", // ce->name.data(),ce->parent->name.data()); BEGIN( SearchMemVars ); } yyFileName = ce->fileName; yyLineNr = ce->bodyLine ; - current = std::make_unique<Entry>(); + current = std::make_shared<Entry>(); initEntry(); QCString name = ce->name; @@ -1754,7 +1754,7 @@ static void parseCompounds(Entry *rt) //---------------------------------------------------------------------------- -static void parseMain(const char *fileName,const char *fileBuf,const std::unique_ptr<Entry> &rt) +static void parseMain(const char *fileName,const char *fileBuf,const std::shared_ptr<Entry> &rt) { initParser(); @@ -1765,7 +1765,7 @@ static void parseMain(const char *fileName,const char *fileBuf,const std::unique mtype = Method; gstat = FALSE; virt = Normal; - current_root = rt.get(); + current_root = rt; g_specialBlock = FALSE; @@ -1789,7 +1789,7 @@ static void parseMain(const char *fileName,const char *fileBuf,const std::unique g_moduleScope+=baseName; } - current = std::make_unique<Entry>(); + current = std::make_shared<Entry>(); initEntry(); current->name = g_moduleScope; current->section = Entry::NAMESPACE_SEC; @@ -1798,7 +1798,7 @@ static void parseMain(const char *fileName,const char *fileBuf,const std::unique current->startLine = yyLineNr; current->bodyLine = yyLineNr; - current_root = current.get(); + current_root = current; rt->moveToSubEntryAndRefresh(current); @@ -1888,7 +1888,7 @@ void pyscanFreeScanner() void PythonOutlineParser::parseInput(const char *fileName, const char *fileBuf, - const std::unique_ptr<Entry> &root, + const std::shared_ptr<Entry> &root, bool /*sameTranslationUnit*/, QStrList & /*filesInSameTranslationUnit*/) { |