Skip to content

Commit b78ef98

Browse files
committed
Merge branch 'master' of github.com:doxygen/doxygen
2 parents ba02563 + 2e5e9e5 commit b78ef98

File tree

3 files changed

+61
-13
lines changed

3 files changed

+61
-13
lines changed

src/layout.cpp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,24 @@ static bool elemIsVisible(const XMLHandlers::Attributes &attrib,bool defVal=TRUE
9191
}
9292
else if (opt && opt->type==ConfigValues::Info::String)
9393
{
94-
return ConfigValues::instance().*(opt->value.s) != "NO";
94+
visible = ConfigValues::instance().*(opt->value.s);
9595
}
9696
else if (!opt)
9797
{
98-
err("found unsupported value %s for visible attribute in layout file\n",
99-
qPrint(visible));
98+
err("found unsupported value '%s' for visible attribute in layout file, reverting to '%s'\n",
99+
qPrint(visible),(defVal?"yes":"no"));
100+
return defVal;
100101
}
101102
}
102-
return visible!="no" && visible!="0";
103+
QCString visibleLow = visible.lower();
104+
if (visibleLow=="no" || visibleLow=="false" || visibleLow=="0") return FALSE;
105+
else if (visibleLow=="yes" || visibleLow=="true" || visibleLow=="1") return TRUE;
106+
else
107+
{
108+
err("found unsupported value '%s' for visible attribute in layout file, reverting to '%s'\n",
109+
qPrint(visible),(defVal?"yes":"no"));
110+
return defVal;
111+
}
103112
}
104113

105114
static bool parentIsVisible(LayoutNavEntry *parent)

src/pre.l

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ struct preYY_state
292292
QCString blockName;
293293
int condCtx = 0;
294294
bool skip = false;
295+
bool insideIDL = false;
295296
bool insideCS = false; // C# has simpler preprocessor
296297
bool insideFtn = false;
297298
bool isSource = false;
@@ -415,6 +416,7 @@ WSopt [ \t\r]*
415416
%x CondLineC
416417
%x CondLineCpp
417418
%x SkipCond
419+
%x IDLquote
418420

419421
%%
420422

@@ -435,6 +437,32 @@ WSopt [ \t\r]*
435437
outputArray(yyscanner,yytext,yyleng);
436438
BEGIN(LexCopyLine);
437439
}
440+
<Start>^{Bopt}"cpp_quote"{Bopt}"("{Bopt}\" {
441+
if (yyextra->insideIDL)
442+
{
443+
BEGIN(IDLquote);
444+
}
445+
else
446+
{
447+
REJECT;
448+
}
449+
}
450+
<IDLquote>"\\\\" {
451+
outputArray(yyscanner,"\\",1);
452+
}
453+
<IDLquote>"\\\"" {
454+
outputArray(yyscanner,"\"",1);
455+
}
456+
<IDLquote>"\""{Bopt}")" {
457+
BEGIN(Start);
458+
}
459+
<IDLquote>\n {
460+
outputChar(yyscanner,'\n');
461+
yyextra->yyLineNr++;
462+
}
463+
<IDLquote>. {
464+
outputArray(yyscanner,yytext,yyleng);
465+
}
438466
<Start>^{Bopt}/[^#] {
439467
outputArray(yyscanner,yytext,yyleng);
440468
BEGIN(CopyLine);
@@ -1764,7 +1792,7 @@ WSopt [ \t\r]*
17641792
}
17651793
<*>{CCS}/{CCE} |
17661794
<*>{CCS}[*!]? {
1767-
if (YY_START==SkipVerbatim || YY_START==SkipCond)
1795+
if (YY_START==SkipVerbatim || YY_START==SkipCond || YY_START==IDLquote)
17681796
{
17691797
REJECT;
17701798
}
@@ -1786,7 +1814,7 @@ WSopt [ \t\r]*
17861814
}
17871815
}
17881816
<*>{CPPC}[/!]? {
1789-
if (YY_START==SkipVerbatim || YY_START==SkipCond || getLanguageFromFileName(yyextra->fileName)==SrcLangExt_Fortran)
1817+
if (YY_START==SkipVerbatim || YY_START==SkipCond || getLanguageFromFileName(yyextra->fileName)==SrcLangExt_Fortran || YY_START==IDLquote)
17901818
{
17911819
REJECT;
17921820
}
@@ -1844,6 +1872,7 @@ static void setFileName(yyscan_t yyscanner,const QCString &name)
18441872
//printf("setFileName(%s) state->fileName=%s state->yyFileDef=%p\n",
18451873
// name,qPrint(state->fileName),state->yyFileDef);
18461874
if (state->yyFileDef && state->yyFileDef->isReference()) state->yyFileDef=0;
1875+
state->insideIDL = getLanguageFromFileName(state->fileName)==SrcLangExt_IDL;
18471876
state->insideCS = getLanguageFromFileName(state->fileName)==SrcLangExt_CSharp;
18481877
state->insideFtn = getLanguageFromFileName(state->fileName)==SrcLangExt_Fortran;
18491878
state->isSource = guessSection(state->fileName);

src/scanner.l

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3489,6 +3489,8 @@ NONLopt [^\n]*
34893489
{
34903490
yyextra->mtype = Method;
34913491
yyextra->virt = Normal;
3492+
yyextra->current->bodyLine = -1;
3493+
yyextra->current->bodyColumn = 1;
34923494
yyextra->current->groups.clear();
34933495
initEntry(yyscanner);
34943496
}
@@ -5038,6 +5040,16 @@ NONLopt [^\n]*
50385040
BEGIN(FuncQual);
50395041
}
50405042
<OldStyleArgs>. { yyextra->current->args += *yytext; }
5043+
<FuncQual,FuncRound,FuncFunc>\" {
5044+
if (yyextra->insideIDL && yyextra->insideCppQuote)
5045+
{
5046+
BEGIN(EndCppQuote);
5047+
}
5048+
else
5049+
{
5050+
yyextra->current->args += *yytext;
5051+
}
5052+
}
50415053
<FuncQual,FuncRound,FuncFunc>. { yyextra->current->args += *yytext; }
50425054
<FuncQual>{BN}*"try:" |
50435055
<FuncQual>{BN}*"try"{BN}+ { /* try-function-block */
@@ -6963,6 +6975,11 @@ NONLopt [^\n]*
69636975
{
69646976
BEGIN(EndCppQuote);
69656977
}
6978+
else if (yyextra->insidePHP)
6979+
{
6980+
yyextra->lastStringContext=YY_START;
6981+
BEGIN(SkipString);
6982+
}
69666983
}
69676984
<*>^{B}*"#" {
69686985
if (!yyextra->insidePHP)
@@ -6989,13 +7006,6 @@ NONLopt [^\n]*
69897006
BEGIN(SkipPHPString);
69907007
}
69917008
}
6992-
<*>\" {
6993-
if (yyextra->insidePHP)
6994-
{
6995-
yyextra->lastStringContext=YY_START;
6996-
BEGIN(SkipString);
6997-
}
6998-
}
69997009
<*>\? {
70007010
if (yyextra->insideCS && (YY_START != SkipRound) && (YY_START != CSAccessorDecl))
70017011
{

0 commit comments

Comments
 (0)