diff options
-rw-r--r-- | src/pyscanner.l | 26 |
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); |