diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2019-05-19 08:53:50 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2019-05-19 08:53:50 (GMT) |
commit | 5fa5b3f4522231c30d7e67056f07cb5709815dfb (patch) | |
tree | 8c1094b986250c0da94d56028b01c5316002fe3b /src | |
parent | 1db1a706a8bcc76cc7cdf33ccd79000460c413d8 (diff) | |
parent | 08c26ab79d7a262c7c2b9a40a91dc5df445f658b (diff) | |
download | Doxygen-5fa5b3f4522231c30d7e67056f07cb5709815dfb.zip Doxygen-5fa5b3f4522231c30d7e67056f07cb5709815dfb.tar.gz Doxygen-5fa5b3f4522231c30d7e67056f07cb5709815dfb.tar.bz2 |
Merge branch 'master' of github.com:doxygen/doxygen
Diffstat (limited to 'src')
-rw-r--r-- | src/commentcnv.l | 10 | ||||
-rw-r--r-- | src/pyscanner.l | 26 |
2 files changed, 35 insertions, 1 deletions
diff --git a/src/commentcnv.l b/src/commentcnv.l index 6b08d74..0ea5ff7 100644 --- a/src/commentcnv.l +++ b/src/commentcnv.l @@ -399,6 +399,10 @@ void replaceComment(int offset); copyToOutput(yytext,(int)yyleng); } <Scan>"/*"[*!]? { /* start of a C comment */ + if ((g_lang==SrcLangExt_Python) || (g_lang==SrcLangExt_Tcl)) + { + REJECT; + } g_specialComment=(int)yyleng==3; g_nestingCount=0; g_commentStack.clear(); /* to be on the save side */ @@ -660,12 +664,16 @@ void replaceComment(int offset); } } <CComment>"/"+"*" { /* nested C comment */ + if ((g_lang==SrcLangExt_Python) || (g_lang==SrcLangExt_Tcl)) + { + REJECT; + } g_nestingCount++; g_commentStack.push(new CommentCtx(g_lineNr)); copyToOutput(yytext,(int)yyleng); } <CComment>"*"+"/" { /* end of C comment */ - if (g_lang==SrcLangExt_Python) + if ((g_lang==SrcLangExt_Python) || (g_lang==SrcLangExt_Tcl)) { REJECT; } diff --git a/src/pyscanner.l b/src/pyscanner.l index 41422bd..fe94e64 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); |