summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2019-04-07 16:30:34 (GMT)
committeralbert-github <albert.tests@gmail.com>2019-04-07 16:30:34 (GMT)
commit315733970daf1abe2ec088a61332880e24b415cc (patch)
tree8b42b0e6f8a1f9c820318385c23762976bdd085f
parent16d025c8a08b485f5d43ade0986d716bd6aa06f8 (diff)
downloadDoxygen-315733970daf1abe2ec088a61332880e24b415cc.zip
Doxygen-315733970daf1abe2ec088a61332880e24b415cc.tar.gz
Doxygen-315733970daf1abe2ec088a61332880e24b415cc.tar.bz2
Class definition with collections
Class definitions can have collections and these can have strings e.g.: class Url(namedtuple('Url', url_attrs)): and this results in: warning: Detected potential recursive class relation between class conda::_vendor::urllib3::util::url::Url and base class Url! Strings are now possible and seen as strings. See also (including example with namedtuble): https://docs.python.org/3/library/collections.html
-rw-r--r--src/pyscanner.l26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/pyscanner.l b/src/pyscanner.l
index 655b6e2..b476eec 100644
--- a/src/pyscanner.l
+++ b/src/pyscanner.l
@@ -537,6 +537,8 @@ STARTDOCSYMS "##"
%x SingleQuoteString
%x DoubleQuoteString
%x TripleString
+%x SingleQuoteStringIgnore
+%x DoubleQuoteStringIgnore
/* import */
%x FromMod
@@ -1282,8 +1284,28 @@ STARTDOCSYMS "##"
);
//Has base class-do stuff
}
+ "'" { // start of a single quoted string
+ g_stringContext=YY_START;
+ BEGIN( SingleQuoteStringIgnore );
+ }
+ "\"" { // start of a double quoted string
+ g_stringContext=YY_START;
+ BEGIN( DoubleQuoteStringIgnore );
+ }
}
+<SingleQuoteStringIgnore>{
+ "'" { // end of a single quoted string
+ BEGIN(g_stringContext);
+ }
+ . { }
+}
+<DoubleQuoteStringIgnore>{
+ "\"" { // end of a double quoted string
+ BEGIN(g_stringContext);
+ }
+ . { }
+}
<ClassCaptureIndent>{
"\n"|({BB}"\n") {
@@ -1702,6 +1724,10 @@ STARTDOCSYMS "##"
lineCount();
}
+<*>"'" {
+ fprintf(stderr,"Quote: %d\n",YY_START);
+ }
+
<*>. {
//printf("[pyscanner] '%s' [ state %d ] [line %d] no match\n",
// yytext, YY_START, yyLineNr);