Skip to content

Commit a3de007

Browse files
committed
Renamed \doxysetting to \doxyconfig
Some other minor optimisations
1 parent 174434e commit a3de007

File tree

7 files changed

+46
-51
lines changed

7 files changed

+46
-51
lines changed

doc/commands.doc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ documentation:
7878
\refitem cmddontinclude \\dontinclude
7979
\refitem cmddot \\dot
8080
\refitem cmddotfile \\dotfile
81-
\refitem cmddoxysetting \\doxysetting
81+
\refitem cmddoxyconfig \\doxyconfig
8282
\refitem cmde \\e
8383
\refitem cmdelse \\else
8484
\refitem cmdelseif \\elseif
@@ -3354,19 +3354,19 @@ class Receiver
33543354
\ref cmdimage "\\image" command.
33553355

33563356
<hr>
3357-
\section cmddoxysetting \\doxysetting <setting>
3357+
\section cmddoxyconfig \\doxyconfig <config_option>
33583358

3359-
\addindex \\doxysetting
3360-
Dispays the value of the setting of `<setting>` as used in the doxygen
3361-
configuration file for this doxygen run.
3359+
\addindex \\doxyconfig
3360+
Displays the value of the configuration option `<config_option>` as used in doxygen's
3361+
configuration file that is in use when this command is processed.
33623362

33633363
\par Example:
33643364
When creating this manual the following:
33653365
\verbatim
3366-
... Project name = \doxysetting PROJECT_NAME ...
3366+
... Project name = \doxyconfig PROJECT_NAME ...
33673367
\endverbatim
33683368
gives:<br>
3369-
... Project name = \doxysetting PROJECT_NAME ...
3369+
... Project name = \doxyconfig PROJECT_NAME ...
33703370

33713371
<hr>
33723372
\section cmde \\e <word>

src/cmdmapper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ CommandMap cmdMap[] =
4444
{ "showdate", CMD_SHOWDATE },
4545
{ "dontinclude", CMD_DONTINCLUDE },
4646
{ "dotfile", CMD_DOTFILE },
47-
{ "doxysetting", CMD_DOXYSETTING },
47+
{ "doxyconfig", CMD_DOXYCONFIG },
4848
{ "e", CMD_EMPHASIS },
4949
{ "em", CMD_EMPHASIS },
5050
{ "endicode", CMD_ENDICODE },

src/cmdmapper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ enum CommandType
152152
CMD_IVERBATIM = 123,
153153
CMD_ENDIVERBATIM = 124,
154154
CMD_IANCHOR = 125,
155-
CMD_DOXYSETTING = 126,
155+
CMD_DOXYCONFIG = 126,
156156
};
157157

158158
enum HtmlTagType

src/docnode.cpp

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3207,94 +3207,97 @@ void DocPara::handleEmoji()
32073207
parser()->tokenizer.setStatePara();
32083208
}
32093209

3210-
void DocPara::handleDoxySetting()
3210+
void DocPara::handleDoxyConfig()
32113211
{
32123212
// get the argument of the cite command.
32133213
int tok=parser()->tokenizer.lex();
32143214
if (tok!=TK_WHITESPACE)
32153215
{
3216-
warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"expected whitespace after \\%s command",
3217-
qPrint("doxysetting"));
3216+
warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"expected whitespace after \\doxyconfig command");
32183217
return;
32193218
}
3220-
parser()->tokenizer.setStateDoxySetting();
3219+
parser()->tokenizer.setStateDoxyConfig();
32213220
tok=parser()->tokenizer.lex();
32223221
if (tok==0)
32233222
{
32243223
warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected end of comment block while parsing the "
3225-
"argument of command %s\n", qPrint("doxysetting"));
3224+
"argument of command \\doxyconfig\n");
32263225
return;
32273226
}
32283227
else if (tok!=TK_WORD && tok!=TK_LNKWORD)
32293228
{
3230-
warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected token %s as the argument of %s",
3231-
DocTokenizer::tokToString(tok),qPrint("doxysetting"));
3229+
warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected token %s as the argument of \\doxyconfig",
3230+
DocTokenizer::tokToString(tok));
32323231
return;
32333232
}
32343233
ConfigOption * opt = ConfigImpl::instance()->get(parser()->context.token->name);
32353234
if (opt)
32363235
{
3236+
QCString optionValue;
32373237
switch (opt->kind())
32383238
{
32393239
case ConfigOption::O_Bool:
3240-
children().append<DocWord>(parser(),thisVariant(),*(dynamic_cast<ConfigBool*>(opt)->valueStringRef()));
3240+
optionValue = *(dynamic_cast<ConfigBool*>(opt)->valueStringRef());
32413241
break;
32423242
case ConfigOption::O_String:
3243-
children().append<DocWord>(parser(),thisVariant(),*(dynamic_cast<ConfigString*>(opt)->valueRef()));
3243+
optionValue = *(dynamic_cast<ConfigString*>(opt)->valueRef());
32443244
break;
32453245
case ConfigOption::O_Enum:
3246-
children().append<DocWord>(parser(),thisVariant(),*(dynamic_cast<ConfigEnum*>(opt)->valueRef()));
3246+
optionValue = *(dynamic_cast<ConfigEnum*>(opt)->valueRef());
32473247
break;
32483248
case ConfigOption::O_Int:
3249-
children().append<DocWord>(parser(),thisVariant(),*(dynamic_cast<ConfigInt*>(opt)->valueStringRef()));
3249+
optionValue = *(dynamic_cast<ConfigInt*>(opt)->valueStringRef());
32503250
break;
32513251
case ConfigOption::O_List:
32523252
{
32533253
StringVector *lst = dynamic_cast<ConfigList*>(opt)->valueRef();
3254+
optionValue="";
32543255
if (!lst->empty())
32553256
{
32563257
std::string lstFormat = theTranslator->trWriteList(lst->size()).str();
32573258
static const reg::Ex marker(R"(@(\d+))");
32583259
reg::Iterator it(lstFormat,marker);
32593260
reg::Iterator end;
32603261
size_t index=0;
3261-
QCString newList;
32623262
// now replace all markers with the real text
32633263
for ( ; it!=end ; ++it)
32643264
{
32653265
const auto &match = *it;
32663266
size_t newIndex = match.position();
32673267
size_t matchLen = match.length();
3268-
newList += lstFormat.substr(index,newIndex-index);
3268+
optionValue += lstFormat.substr(index,newIndex-index);
32693269
unsigned long entryIndex = std::stoul(match[1].str());
32703270
if (entryIndex<(unsigned long)lst->size())
32713271
{
3272-
newList += lst->at(entryIndex);
3272+
optionValue += lst->at(entryIndex);
32733273
}
32743274
index=newIndex+matchLen;
32753275
}
3276-
children().append<DocWord>(parser(),thisVariant(),newList);
3276+
optionValue+=lstFormat.substr(index);
32773277
}
32783278
}
32793279
break;
32803280
case ConfigOption::O_Obsolete:
3281-
warn(parser()->context.fileName,parser()->tokenizer.getLineNr(), "Obsolete setting for '\\doxysetting': '%s'",
3281+
warn(parser()->context.fileName,parser()->tokenizer.getLineNr(), "Obsolete setting for '\\doxyconfig': '%s'",
32823282
qPrint(parser()->context.token->name));
3283-
children().append<DocWord>(parser(),thisVariant(),parser()->context.token->name + " (obsolete)");
32843283
break;
32853284
case ConfigOption::O_Disabled:
32863285
warn(parser()->context.fileName,parser()->tokenizer.getLineNr(),
3287-
"Disabled setting (i.e. not supported in this doxygen executable) for '\\doxysetting': '%s'",
3286+
"Disabled setting (i.e. not supported in this doxygen executable) for '\\doxyconfig': '%s'",
32883287
qPrint(parser()->context.token->name));
3289-
children().append<DocWord>(parser(),thisVariant(),parser()->context.token->name + " (Disabled)");
32903288
break;
3291-
default:
3289+
case ConfigOption::O_Info:
3290+
// nothing to show here
32923291
break;
32933292
}
3293+
if (!optionValue.isEmpty())
3294+
{
3295+
children().append<DocWord>(parser(),thisVariant(),optionValue);
3296+
}
32943297
}
32953298
else
32963299
{
3297-
warn(parser()->context.fileName,parser()->tokenizer.getLineNr(), "Unknown setting for '\\doxysetting': '%s'",
3300+
warn(parser()->context.fileName,parser()->tokenizer.getLineNr(), "Unknown option for '\\doxyconfig': '%s'",
32983301
qPrint(parser()->context.token->name));
32993302
children().append<DocWord>(parser(),thisVariant(),parser()->context.token->name);
33003303
}
@@ -4445,8 +4448,8 @@ int DocPara::handleCommand(const QCString &cmdName, const int tok)
44454448
case CMD_EMOJI:
44464449
handleEmoji();
44474450
break;
4448-
case CMD_DOXYSETTING:
4449-
handleDoxySetting();
4451+
case CMD_DOXYCONFIG:
4452+
handleDoxyConfig();
44504453
break;
44514454
case CMD_REF: // fall through
44524455
case CMD_SUBPAGE:

src/docnode.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1059,7 +1059,7 @@ class DocPara : public DocCompoundNode
10591059
void handleInclude(const QCString &cmdName,DocInclude::Type t);
10601060
void handleLink(const QCString &cmdName,bool isJavaLink);
10611061
void handleCite();
1062-
void handleDoxySetting();
1062+
void handleDoxyConfig();
10631063
void handleEmoji();
10641064
void handleRef(const QCString &cmdName);
10651065
void handleSection(const QCString &cmdName);

src/doctokenizer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ class DocTokenizer
168168
void setStatePattern();
169169
void setStateLink();
170170
void setStateCite();
171-
void setStateDoxySetting();
171+
void setStateDoxyConfig();
172172
void setStateRef();
173173
void setStateInternalRef();
174174
void setStateText();

src/doctokenizer.l

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ PHPTYPE [\\:a-z_A-Z0-9\x80-\xFF\-]+
268268
CITESCHAR [a-z_A-Z0-9\x80-\xFF\-\?]
269269
CITEECHAR [a-z_A-Z0-9\x80-\xFF\-\+:\/\?]
270270
CITEID {CITESCHAR}{CITEECHAR}*("."{CITESCHAR}{CITEECHAR}*)*|"\""{CITESCHAR}{CITEECHAR}*("."{CITESCHAR}{CITEECHAR}*)*"\""
271-
DOXYSET [a-z_A-Z][a-z_A-Z0-9]*
271+
DOXYCFG [A-Z][A-Z_0-9]*
272272
MAILADDR ("mailto:")?[a-z_A-Z0-9\x80-\xFF.+-]+"@"[a-z_A-Z0-9\x80-\xFf-]+("."[a-z_A-Z0-9\x80-\xFf\-]+)+[a-z_A-Z0-9\x80-\xFf\-]+
273273
MAILWS [\t a-z_A-Z0-9\x80-\xFF+-]
274274
MAILADDR2 {MAILWS}+{BLANK}+("at"|"AT"|"_at_"|"_AT_"){BLANK}+{MAILWS}+("dot"|"DOT"|"_dot_"|"_DOT_"){BLANK}+{MAILWS}+
@@ -383,7 +383,7 @@ SHOWDATE ([0-9]{4}"-"[0-9]{1,2}"-"[0-9]{1,2})?({WS}*[0-9]{1,2}":"[0-9]{1,2}(":"[
383383
%x St_Pattern
384384
%x St_Link
385385
%x St_Cite
386-
%x St_DoxySetting
386+
%x St_DoxyConfig
387387
%x St_Ref
388388
%x St_Ref2
389389
%x St_IntRef
@@ -1114,27 +1114,19 @@ SHOWDATE ([0-9]{4}"-"[0-9]{1,2}"-"[0-9]{1,2})?({WS}*[0-9]{1,2}":"[0-9]{1,2}(":"[
11141114
unput(*yytext);
11151115
return 0;
11161116
}
1117-
<St_DoxySetting>{DOXYSET} { // label to cite
1118-
if (yytext[0] =='"')
1119-
{
1120-
yyextra->token->name=yytext+1;
1121-
yyextra->token->name=yyextra->token->name.left(static_cast<int>(yyleng)-2);
1122-
}
1123-
else
1124-
{
1125-
yyextra->token->name=yytext;
1126-
}
1117+
<St_DoxyConfig>{DOXYCFG} { // config option
1118+
yyextra->token->name=yytext;
11271119
return TK_WORD;
11281120
}
1129-
<St_DoxySetting>{BLANK} { // white space
1121+
<St_DoxyConfig>{BLANK} { // white space
11301122
unput(' ');
11311123
return 0;
11321124
}
1133-
<St_DoxySetting>(\n|"\\ilinebr") { // new line
1125+
<St_DoxyConfig>(\n|"\\ilinebr") { // new line
11341126
unput_string(yytext,yyleng);
11351127
return 0;
11361128
}
1137-
<St_DoxySetting>. { // any other character
1129+
<St_DoxyConfig>. { // any other character
11381130
unput(*yytext);
11391131
return 0;
11401132
}
@@ -2032,11 +2024,11 @@ void DocTokenizer::setStateCite()
20322024
BEGIN(St_Cite);
20332025
}
20342026
2035-
void DocTokenizer::setStateDoxySetting()
2027+
void DocTokenizer::setStateDoxyConfig()
20362028
{
20372029
yyscan_t yyscanner = p->yyscanner;
20382030
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
2039-
BEGIN(St_DoxySetting);
2031+
BEGIN(St_DoxyConfig);
20402032
}
20412033
20422034
void DocTokenizer::setStateRef()

0 commit comments

Comments
 (0)