summaryrefslogtreecommitdiffstats
path: root/src/pycode.l
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2018-07-12 12:19:00 (GMT)
committeralbert-github <albert.tests@gmail.com>2018-07-12 12:19:00 (GMT)
commit858d65a9cd7b9b7cf71da01098f47d583b3322f5 (patch)
tree965217503677442e224e80549bee3d0aea3a7857 /src/pycode.l
parent5b735d5118581e3bca686f79de341b8b2e76691f (diff)
parent56c60e84e6dd6d7e4e7774be24d1402782fd3230 (diff)
downloadDoxygen-858d65a9cd7b9b7cf71da01098f47d583b3322f5.zip
Doxygen-858d65a9cd7b9b7cf71da01098f47d583b3322f5.tar.gz
Doxygen-858d65a9cd7b9b7cf71da01098f47d583b3322f5.tar.bz2
Merge branch 'feature/bug_tableofcontents_latex' of https://github.com/albert-github/doxygen into feature/bug_tableofcontents_latex
Diffstat (limited to 'src/pycode.l')
-rw-r--r--src/pycode.l30
1 files changed, 26 insertions, 4 deletions
diff --git a/src/pycode.l b/src/pycode.l
index fe1eef5..1b176d6 100644
--- a/src/pycode.l
+++ b/src/pycode.l
@@ -884,7 +884,7 @@ SHORTSTRINGITEM ({SHORTSTRINGCHAR}|{ESCAPESEQ})
SHORTSTRINGCHAR [^\\\n"]
STRINGLITERAL {STRINGPREFIX}?( {SHORTSTRING} | {LONGSTRING})
STRINGPREFIX ("r"|"u"|"ur"|"R"|"U"|"UR"|"Ur"|"uR")
-KEYWORD ("lambda"|"import"|"class"|"assert"|"as"|"from"|"global"|"def"|"True"|"False")
+KEYWORD ("lambda"|"import"|"class"|"assert"|"with"|"as"|"from"|"global"|"def"|"True"|"False")
FLOWKW ("or"|"and"|"is"|"not"|"print"|"for"|"in"|"if"|"try"|"except"|"yield"|"raise"|"break"|"continue"|"pass"|"if"|"return"|"while"|"elif"|"else"|"finally")
QUOTES ("\""[^"]*"\"")
SINGLEQUOTES ("'"[^']*"'")
@@ -1382,21 +1382,43 @@ TARGET ({IDENTIFIER}|"("{TARGET_LIST}")"|"["{TARGET_LIST}"]"|{ATTRIBUT
}
*/
-<*>{STRINGPREFIX}?{TRISINGLEQUOTE} |
+<*>{STRINGPREFIX}?{TRISINGLEQUOTE} {
+ if (YY_START==SingleQuoteString) REJECT;
+ startFontClass("stringliteral");
+ g_stringContext=YY_START;
+ g_doubleQuote=yytext[yyleng-1]=='"';
+ codify(yytext);
+ BEGIN(TripleString);
+ }
<*>{STRINGPREFIX}?{TRIDOUBLEQUOTE} {
- startFontClass("stringliteral");
+ if (YY_START==DoubleQuoteString) REJECT;
+ startFontClass("stringliteral");
g_stringContext=YY_START;
g_doubleQuote=yytext[yyleng-1]=='"';
- codify(yytext);
+ codify(yytext);
BEGIN(TripleString);
}
<*>{STRINGPREFIX}?"'" { // single quoted string
+ if (YY_START==SingleQuoteString ||
+ YY_START==DoubleQuoteString ||
+ YY_START==TripleString
+ )
+ {
+ REJECT;
+ }
startFontClass("stringliteral");
g_stringContext=YY_START;
codify(yytext);
BEGIN(SingleQuoteString);
}
<*>{STRINGPREFIX}?"\"" { // double quoted string
+ if (YY_START==SingleQuoteString ||
+ YY_START==DoubleQuoteString ||
+ YY_START==TripleString
+ )
+ {
+ REJECT;
+ }
startFontClass("stringliteral");
g_stringContext=YY_START;
codify(yytext);