summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2020-02-20 13:16:26 (GMT)
committeralbert-github <albert.tests@gmail.com>2020-02-20 13:16:26 (GMT)
commit00b45f73c67f5c57407e6e2a783af7f0820afa4d (patch)
tree2e38e4aeeaf474e7bafa5d4ca95b93eb95f72847
parent597d113d52a25d5185c8fb1c1d3d3d7b8f1f4a90 (diff)
downloadDoxygen-00b45f73c67f5c57407e6e2a783af7f0820afa4d.zip
Doxygen-00b45f73c67f5c57407e6e2a783af7f0820afa4d.tar.gz
Doxygen-00b45f73c67f5c57407e6e2a783af7f0820afa4d.tar.bz2
Problem in case using PREDEFINED with comma
In the pull request "Enable comma as separator in configuration lists enhancement " (#6563) it was made possible to have commas as separators for lists. In case we have: ``` PREDEFINED = A(x,y)=sin(x),cos(y) ``` and use `doxygen -x` (or usethe define): this results in: ``` PREDEFINED = A(x \ y)=sin(x) \ cos(y) ``` this can be overcome by means of: ``` PREDEFINED = "A(x,y)=sin(x),cos(y)" ``` But for a lot of existing packages this poses a problem. (Found by looking at the doxygen configuration files as used by Fossies).
-rw-r--r--src/configimpl.l29
1 files changed, 24 insertions, 5 deletions
diff --git a/src/configimpl.l b/src/configimpl.l
index eb33610..dfdeb4a 100644
--- a/src/configimpl.l
+++ b/src/configimpl.l
@@ -713,6 +713,7 @@ static void readIncludeFile(const char *incName)
%x GetString
%x GetBool
%x GetStrList
+%x GetStrList1
%x GetQuotedString
%x GetEnvVar
%x Include
@@ -725,8 +726,8 @@ static void readIncludeFile(const char *incName)
BEGIN(Start);
unput(*yytext);
}
-<Start,GetString,GetStrList,GetBool,SkipInvalid>"##".*"\n" { config->appendUserComment(yytext);yyLineNr++;}
-<Start,GetString,GetStrList,GetBool,SkipInvalid>"#" { BEGIN(SkipComment); }
+<Start,GetString,GetStrList,GetStrList1,GetBool,SkipInvalid>"##".*"\n" { config->appendUserComment(yytext);yyLineNr++;}
+<Start,GetString,GetStrList,GetStrList1,GetBool,SkipInvalid>"#" { BEGIN(SkipComment); }
<Start>[a-z_A-Z][a-z_A-Z0-9]*[ \t]*"=" { QCString cmd=yytext;
cmd=cmd.left(cmd.length()-1).stripWhiteSpace();
ConfigOption *option = config->get(cmd);
@@ -750,7 +751,14 @@ static void readIncludeFile(const char *incName)
l = ((ConfigList *)option)->valueRef();
l->clear();
elemStr="";
- BEGIN(GetStrList);
+ if (cmd == "PREDEFINED")
+ {
+ BEGIN(GetStrList1);
+ }
+ else
+ {
+ BEGIN(GetStrList);
+ }
break;
case ConfigOption::O_Enum:
s = ((ConfigEnum *)option)->valueRef();
@@ -880,7 +888,7 @@ static void readIncludeFile(const char *incName)
<Start>[a-z_A-Z0-9]+ { config_warn("ignoring unknown tag '%s' at line %d, file %s\n",yytext,yyLineNr,yyFileName.data()); }
<GetString,GetBool,SkipInvalid>\n { yyLineNr++; BEGIN(Start); }
-<GetStrList>\n {
+<GetStrList,GetStrList1>\n {
yyLineNr++;
if (!elemStr.isEmpty())
{
@@ -889,6 +897,14 @@ static void readIncludeFile(const char *incName)
}
BEGIN(Start);
}
+<GetStrList1>[ \t]+ {
+ if (!elemStr.isEmpty())
+ {
+ //printf("elemStr2='%s'\n",elemStr.data());
+ l->append(elemStr);
+ }
+ elemStr.resize(0);
+ }
<GetStrList>[ \t,]+ {
if (!elemStr.isEmpty())
{
@@ -900,7 +916,7 @@ static void readIncludeFile(const char *incName)
<GetString>[^ \"\t\r\n]+ { (*s)+=configStringRecode(yytext,encoding,"UTF-8");
checkEncoding();
}
-<GetString,GetStrList,SkipInvalid>"\"" { lastState=YY_START;
+<GetString,GetStrList,GetStrList1,SkipInvalid>"\"" { lastState=YY_START;
BEGIN(GetQuotedString);
tmpString.resize(0);
}
@@ -943,6 +959,9 @@ static void readIncludeFile(const char *incName)
bs.data(),yyLineNr,yyFileName.data());
}
}
+<GetStrList1>[^ \#\"\t\r\n]+ {
+ elemStr+=configStringRecode(yytext,encoding,"UTF-8");
+ }
<GetStrList>[^ \#\"\t\r\n,]+ {
elemStr+=configStringRecode(yytext,encoding,"UTF-8");
}