summaryrefslogtreecommitdiffstats
path: root/src/pyscanner.l
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2015-12-26 14:29:39 (GMT)
committeralbert-github <albert.tests@gmail.com>2015-12-26 14:29:39 (GMT)
commit0a5dfb77a7d0dfaac2baf8f3e61014a29ba2883b (patch)
tree65f4af233361f0baee0dd08c7a4a3a660b091fd0 /src/pyscanner.l
parent165498dc9ea33bc9991c5ab5234b5e51d74569d0 (diff)
downloadDoxygen-0a5dfb77a7d0dfaac2baf8f3e61014a29ba2883b.zip
Doxygen-0a5dfb77a7d0dfaac2baf8f3e61014a29ba2883b.tar.gz
Doxygen-0a5dfb77a7d0dfaac2baf8f3e61014a29ba2883b.tar.bz2
Bug 735152 - Python: Allow undocumented "cls" parameter for class methods
Made 'cls' parameter analogous to the 'self' parameter. See also https://www.python.org/dev/peps/pep-0008 (paragraph: Function and method arguments)
Diffstat (limited to 'src/pyscanner.l')
-rw-r--r--src/pyscanner.l20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/pyscanner.l b/src/pyscanner.l
index 1ccb943..c73e7dc 100644
--- a/src/pyscanner.l
+++ b/src/pyscanner.l
@@ -745,7 +745,7 @@ STARTDOCSYMS "##"
<SearchMemVars>{
"self."{IDENTIFIER}/{B}"=" {
- DBG_CTX((stderr,"Found member variable %s in %s at %d\n",&yytext[5],current_root->name.data(),yyLineNr));
+ DBG_CTX((stderr,"Found instance method variable %s in %s at %d\n",&yytext[5],current_root->name.data(),yyLineNr));
current->name=&yytext[5];
current->section=Entry::VARIABLE_SEC;
current->fileName = yyFileName;
@@ -762,6 +762,24 @@ STARTDOCSYMS "##"
}
newEntry();
}
+ "cls."{IDENTIFIER}/{B}"=" {
+ DBG_CTX((stderr,"Found class method variable %s in %s at %d\n",&yytext[4],current_root->name.data(),yyLineNr));
+ current->name=&yytext[4];
+ current->section=Entry::VARIABLE_SEC;
+ current->fileName = yyFileName;
+ current->startLine = yyLineNr;
+ current->bodyLine = yyLineNr;
+ current->type.resize(0);
+ if (current->name.at(0)=='_') // mark as private
+ {
+ current->protection=Private;
+ }
+ else
+ {
+ current->protection=Public;
+ }
+ newEntry();
+ }
{TRIDOUBLEQUOTE} { // start of a comment block
initTriDoubleQuoteBlock();
BEGIN(TripleComment);