Skip to content

Commit 36d4247

Browse files
committed
issue #9942 warning: Member try (variable) of namespace lib_validation is not documented.
Made an exception for some Python keywords in the detection of variable names.
1 parent 2ac024c commit 36d4247

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/pyscanner.l

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,7 @@ STARTDOCSYMS "##"
310310
yyextra->packageCommentAllowed = FALSE;
311311
BEGIN(VariableDec);
312312
}
313-
^{B}{IDENTIFIER}/{B}"="[^=] |
314-
^{B}{IDENTIFIER}/{B}":" { // variable
313+
^{B}{IDENTIFIER}/{B}"="[^=] { //variabele
315314
if (yyextra->search_count) REJECT;
316315
yyextra->indent=computeIndent(yytext);
317316
yyextra->current->section = Entry::VARIABLE_SEC;
@@ -322,6 +321,19 @@ STARTDOCSYMS "##"
322321
yyextra->packageCommentAllowed = FALSE;
323322
BEGIN(VariableDec);
324323
}
324+
^{B}{IDENTIFIER}/{B}":" { // variable
325+
if (yyextra->search_count) REJECT;
326+
QCString id = QCString(yytext).stripWhiteSpace();
327+
if (id =="try" || id == "else" || id == "except" || id == "finally") REJECT;
328+
yyextra->indent=computeIndent(yytext);
329+
yyextra->current->section = Entry::VARIABLE_SEC;
330+
yyextra->current->name = id;
331+
yyextra->current->fileName = yyextra->fileName;
332+
yyextra->current->startLine = yyextra->yyLineNr;
333+
yyextra->current->bodyLine = yyextra->yyLineNr;
334+
yyextra->packageCommentAllowed = FALSE;
335+
BEGIN(VariableDec);
336+
}
325337
{B}{IDENTIFIER}/({B},{B}{IDENTIFIER})*{B}")"*{B}"="[^=] { // list of variables, we cannot place the default value
326338
// so we will skip it later on in a general rule
327339
// Also note ")" this is to catch also (a,b). the "("

0 commit comments

Comments
 (0)