Permalink
Browse files

Bug 361814 - python: tuple assignment not recognized as variable init…

…ialization

added possibility for the separate variables from a tuple assignment:
    a,b,c =
and
    (a,b,c) =
  • Loading branch information...
albert-github committed Dec 26, 2015
1 parent 165498d commit 015955e0badb6082a1e553392acaeb6890734c31
Showing with 14 additions and 0 deletions.
  1. +14 −0 src/pyscanner.l
View
@@ -594,6 +594,20 @@ STARTDOCSYMS "##"
g_packageCommentAllowed = FALSE;
BEGIN(VariableDec);
}
{B}{IDENTIFIER}/({B},{B}{IDENTIFIER})*{B}")"*{B}"="[^=] { // list of variables, we cannot place the default value
// so we will skip it later on in a general rule
// Also note ")" this is to catch also (a,b). the "("
// is caught in the rule: [(], the ")" will be handled in [)]
if (g_search_count > 1) REJECT;
g_indent=computeIndent(yytext);
current->section = Entry::VARIABLE_SEC;
current->name = QCString(yytext).stripWhiteSpace();
current->fileName = yyFileName;
current->startLine = yyLineNr;
current->bodyLine = yyLineNr;
g_packageCommentAllowed = FALSE;
newVariable();
}
"'" { // start of a single quoted string
g_stringContext=YY_START;
g_copyString=0;

0 comments on commit 015955e

Please sign in to comment.