diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2021-10-15 10:45:59 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2021-10-15 10:45:59 +0900 |
commit | 046aece77e373b5280b56bf871fa6e974d06e85d (patch) | |
tree | 629c4681a5158d26512b815623754b33165d8d23 /src/scanner.l | |
parent | cccf3a7c7888ce7bd7a8f8d48a34c5474ad9feeb (diff) | |
download | doxygen-046aece77e373b5280b56bf871fa6e974d06e85d.tar.gz doxygen-046aece77e373b5280b56bf871fa6e974d06e85d.tar.bz2 doxygen-046aece77e373b5280b56bf871fa6e974d06e85d.zip |
Imported Upstream version 1.8.3upstream/1.8.3
Diffstat (limited to 'src/scanner.l')
-rw-r--r-- | src/scanner.l | 73 |
1 files changed, 52 insertions, 21 deletions
diff --git a/src/scanner.l b/src/scanner.l index 6c41d65..8efca45 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -1,6 +1,6 @@ /***************************************************************************** * - * $Id: scanner.l,v 1.80 2001/03/19 19:27:41 root Exp $ + * * * Copyright (C) 1997-2012 by Dimitri van Heesch. * @@ -25,7 +25,6 @@ #include <assert.h> #include <ctype.h> -#include "qtbc.h" #include <qarray.h> #include <qstack.h> #include <qregexp.h> @@ -303,6 +302,7 @@ static inline int computeIndent(const char *s,int startIndent) while ((c=*p++)) { if (c=='\t') col+=tabSize-(col%tabSize); + else if (c=='\n') col=0; else col++; } return col; @@ -2454,7 +2454,11 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" docBlockInBody = FALSE; docBlockAutoBrief = ( yytext[yyleng-2]=='*' && Config_getBool("JAVADOC_AUTOBRIEF") ) || ( yytext[yyleng-2]=='!' && Config_getBool("QT_AUTOBRIEF") ); - docBlock.resize(0); + + QCString indent; + indent.fill(' ',computeIndent(yytext+1,g_column)); + docBlock=indent; + docBlockTerm = ';'; if (YY_START==EnumBaseType && current->section==Entry::ENUM_SEC) { @@ -2479,7 +2483,11 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" docBlockInBody = FALSE; docBlockAutoBrief = ( yytext[yyleng-2]=='*' && Config_getBool("JAVADOC_AUTOBRIEF") ) || ( yytext[yyleng-2]=='!' && Config_getBool("QT_AUTOBRIEF") ); - docBlock.resize(0); + + QCString indent; + indent.fill(' ',computeIndent(yytext+1,g_column)); + docBlock=indent; + docBlockTerm = ','; if (YY_START==EnumBaseType && current->section==Entry::ENUM_SEC) { @@ -2508,7 +2516,10 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" docBlockInBody = FALSE; docBlockAutoBrief = ( yytext[yyleng-2]=='*' && Config_getBool("JAVADOC_AUTOBRIEF") ) || ( yytext[yyleng-2]=='!' && Config_getBool("QT_AUTOBRIEF") ); - docBlock.resize(0); + QCString indent; + indent.fill(' ',computeIndent(yytext,g_column)); + docBlock=indent; + docBlockTerm = 0; if (yytext[yyleng-3]=='/') { @@ -3042,13 +3053,24 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" <FindMembers>":" { - if (current->type.isEmpty()) // anonymous padding field, e.g. "int :7;" + if (current->type.isEmpty() && + current->name=="enum") // see bug 69041, C++11 style anon enum: 'enum : unsigned int {...}' { - addType(current); - current->name.sprintf("__pad%d__",padCount++); + current->section=Entry::ENUM_SEC; + current->name.resize(0); + current->args.resize(0); + BEGIN(EnumBaseType); } - BEGIN(BitFields); - current->bitfields+=":"; + else + { + if (current->type.isEmpty()) // anonymous padding field, e.g. "int :7;" + { + addType(current); + current->name.sprintf("__pad%d__",padCount++); + } + BEGIN(BitFields); + current->bitfields+=":"; + } } <BitFields>. { current->bitfields+=*yytext; @@ -3058,6 +3080,7 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" } <EnumBaseType>\n { lineCount(); + current->args+=' '; } <FindMembers>[;,] { QCString oldType = current->type; @@ -3417,7 +3440,7 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" current->program += yytext; } } -<ReadBody,ReadNSBody,ReadBodyIntf>"{" { current->program += yytext ; +<ReadBody,ReadNSBody,ReadBodyIntf>"{" { current->program += yytext ; ++curlyCount ; } <ReadBodyIntf>"}" { @@ -3554,7 +3577,7 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" } <MemberSpec>([*&]*{BN}*)*{ID}{BN}*("["[^\]\n]*"]")* { // the [] part could be improved. lineCount(); - int i=0,l=yyleng,j; + int i=0,l=(int)yyleng,j; while (i<l && (!isId(yytext[i]))) i++; msName = QCString(yytext).right(l-i).stripWhiteSpace(); j=msName.find("["); @@ -4001,7 +4024,7 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" { // for defines we interpret a comment // as documentation for the define - int i;for (i=yyleng-1;i>=0;i--) + int i;for (i=(int)yyleng-1;i>=0;i--) { unput(yytext[i]); } @@ -4052,7 +4075,7 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" { // for defines we interpret a comment // as documentation for the define - int i;for (i=yyleng-1;i>0;i--) + int i;for (i=(int)yyleng-1;i>0;i--) { unput(yytext[i]); } @@ -4291,11 +4314,20 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" current->args += " volatile "; current->argList->volatileSpecifier=TRUE; } -<FuncQual>{BN}*"noexcept"{BN}* { // volatile member function +<FuncQual>{BN}*"noexcept"{BN}* { // noexcept qualifier lineCount() ; current->args += " noexcept "; current->spec |= Entry::NoExcept; } +<FuncQual>{BN}*"noexcept"{BN}*"(" { // noexcept expression + lineCount() ; + current->args += " noexcept("; + current->spec |= Entry::NoExcept; + lastRoundContext=FuncQual; + pCopyRoundString=¤t->args; + roundCount=0; + BEGIN(CopyRound); + } <FuncQual,TrailingReturn>{BN}*"="{BN}*"0"{BN}* { // pure virtual member function lineCount() ; current->args += " = 0"; @@ -4652,11 +4684,11 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" } } } +<SkipInits>{ID}{BN}*"{" { // C++11 style initializer (see bug 688647) + lineCount(); + ++curlyCount; + } <SkipInits>"{" { // C++11 style initializer - //addToBody(yytext); - //lastCurlyContext = FindMembers; - //curlyCount=0; - //BEGIN( SkipCurly ) ; unput('{'); BEGIN( Function ); } @@ -5602,11 +5634,10 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" docBlockInBody = YY_START==SkipCurly; static bool javadocAutoBrief = Config_getBool("JAVADOC_AUTOBRIEF"); docBlockAutoBrief = javadocAutoBrief; - docBlock.resize(0); QCString indent; indent.fill(' ',computeIndent(yytext,g_column)); - docBlock+=indent; + docBlock=indent; if (docBlockAutoBrief) { |