summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2019-10-08 16:50:53 (GMT)
committeralbert-github <albert.tests@gmail.com>2019-10-08 16:50:53 (GMT)
commit148162e48b8337fafffc61e5a1b5cdf86077d6ac (patch)
treea6ed333300fe40dba2cef82f39ac880c11f9e453 /src
parentd2b8ae16cb99621827f5dd860222c27e629f5a7f (diff)
downloadDoxygen-148162e48b8337fafffc61e5a1b5cdf86077d6ac.zip
Doxygen-148162e48b8337fafffc61e5a1b5cdf86077d6ac.tar.gz
Doxygen-148162e48b8337fafffc61e5a1b5cdf86077d6ac.tar.bz2
issue 7302: Parsing of template args in single-quotes is incorrect.
In case we encounter an unescaped single or double quote during specialization we search for the closing quote. We are cionnsidering potential escape sequences in the strings as well.
Diffstat (limited to 'src')
-rw-r--r--src/scanner.l15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/scanner.l b/src/scanner.l
index fe20543..242a106 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -751,6 +751,8 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
%x GCopyCurly
%x SkipUnionSwitch
%x Specialization
+%x SpecializationSingleQuote
+%x SpecializationDoubleQuote
%x FuncPtrInit
%x FuncFunc
%x FuncFuncEnd
@@ -6145,6 +6147,19 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
<Specialization>"typename"{BN}+ { lineCount(); }
<Specialization>"(" { *specName += *yytext; roundCount++; }
<Specialization>")" { *specName += *yytext; roundCount--; }
+
+<Specialization>"\\\\" { *specName += *yytext;}
+<Specialization>"\\'" { *specName += *yytext;}
+<Specialization>"\\\"" { *specName += *yytext;}
+<Specialization>"'" { *specName += *yytext;BEGIN(SpecializationSingleQuote);}
+<Specialization>"\"" { *specName += *yytext;BEGIN(SpecializationDoubleQuote);}
+<SpecializationSingleQuote,SpecializationDoubleQuote>"\\\\" { *specName += *yytext;}
+<SpecializationSingleQuote>"\\'" { *specName += *yytext;}
+<SpecializationSingleQuote>"'" { *specName += *yytext; BEGIN(Specialization);}
+<SpecializationDoubleQuote>"\\\"" { *specName += *yytext;}
+<SpecializationDoubleQuote>"\"" { *specName += *yytext; BEGIN(Specialization);}
+<SpecializationSingleQuote,SpecializationDoubleQuote>. { *specName += *yytext;}
+
<Specialization>. {
*specName += *yytext;
}