summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2018-04-22 09:46:36 (GMT)
committerGitHub <noreply@github.com>2018-04-22 09:46:36 (GMT)
commit5e1c4510d9c732abae86d6e70ffd3c682b46767e (patch)
tree3f5d74a9683540e440ba1b6d97194afc6e12a109
parent88ec4b2819c70b84519e03b240e040df85341f53 (diff)
parente5e75b7f713251dd6caa472f9c5fb8d49e36ff5a (diff)
downloadDoxygen-5e1c4510d9c732abae86d6e70ffd3c682b46767e.zip
Doxygen-5e1c4510d9c732abae86d6e70ffd3c682b46767e.tar.gz
Doxygen-5e1c4510d9c732abae86d6e70ffd3c682b46767e.tar.bz2
Merge pull request #675 from albert-github/feature/bug_778012
Bug 778012 - Python List as Default Parameter not parsed correctly
-rw-r--r--src/pyscanner.l30
1 files changed, 22 insertions, 8 deletions
diff --git a/src/pyscanner.l b/src/pyscanner.l
index 9c21d41..1d964b4 100644
--- a/src/pyscanner.l
+++ b/src/pyscanner.l
@@ -109,7 +109,7 @@ static QCString g_packageName;
//static bool g_hideClassDocs;
-static QCString g_defVal;
+static QGString g_defVal;
static int g_braceCount;
static bool g_lexInit = FALSE;
@@ -993,35 +993,49 @@ STARTDOCSYMS "##"
}
<FunctionParamDefVal>{
- "(" { // internal opening brace
+ "[" |
+ "(" { // internal opening brace, assumption is that we have correct code so braces do match
g_braceCount++;
g_defVal+=*yytext;
}
"," |
+ "]" |
")" {
if (g_braceCount==0) // end of default argument
{
if (current->argList->getLast())
{
- current->argList->getLast()->defval=g_defVal.stripWhiteSpace();
+ current->argList->getLast()->defval=QCString(g_defVal.data()).stripWhiteSpace();
}
- if (*yytext == ')')
+ if (*yytext != ',')
current->args = argListToString(current->argList);
BEGIN(FunctionParams);
}
else // continue
{
- if (*yytext == ')')g_braceCount--;
+ if (*yytext != ',')g_braceCount--;
g_defVal+=*yytext;
}
}
- . {
- g_defVal+=*yytext;
- }
+ "'" {
+ g_defVal+=*yytext;
+ g_copyString=&g_defVal;
+ g_stringContext=FunctionParamDefVal;
+ BEGIN( SingleQuoteString );
+ }
+ "\"" {
+ g_defVal+=*yytext;
+ g_copyString=&g_defVal;
+ g_stringContext=FunctionParamDefVal;
+ BEGIN( DoubleQuoteString );
+ }
\n {
g_defVal+=*yytext;
incLineNr();
}
+ . {
+ g_defVal+=*yytext;
+ }
}