From eb72534ade8b9598806fc7e7b08374bd43bb44f3 Mon Sep 17 00:00:00 2001 From: albert-github Date: Mon, 5 Mar 2018 13:46:34 +0100 Subject: Bug 788940 - Bad handling of Python class members when a class declaration line contains a comment Made comments possible after a class declaration. --- src/pyscanner.l | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/pyscanner.l b/src/pyscanner.l index 9c21d41..37fd71d 100644 --- a/src/pyscanner.l +++ b/src/pyscanner.l @@ -1168,13 +1168,17 @@ STARTDOCSYMS "##" current->program+=yytext; BEGIN(TripleComment); } - {TRISINGLEQUOTE} { // start of a comment block initTriSingleQuoteBlock(); current->program+=yytext; BEGIN(TripleComment); } - + {STARTDOCSYMS}[#]* { // start of a special comment + initSpecialBlock(); + BEGIN(SpecialComment); + } + {POUNDCOMMENT} { // ignore comment with just one # + } ^{BB} { current->program+=yytext; //current->startLine = yyLineNr; @@ -1187,7 +1191,6 @@ STARTDOCSYMS "##" } ""/({NONEMPTY}|{EXPCHAR}) { - // Just pushback an empty class, and // resume parsing the body. newEntry(); -- cgit v0.12