diff options
Diffstat (limited to 'src/code.l')
-rw-r--r-- | src/code.l | 20 |
1 files changed, 11 insertions, 9 deletions
@@ -1806,6 +1806,14 @@ static bool skipLanguageSpecificKeyword(const QCString &kw) return g_insideCpp && (kw == "remove" || kw == "set" || kw == "get"); } +static bool isCastKeyword(const QCString &s) +{ + int i=s.find('<'); + if (i==-1) return FALSE; + QCString kw = s.left(i).stripWhiteSpace(); + return kw=="const_cast" || kw=="static_cast" || kw=="dynamic_cast" || kw=="reinterpret_cast"; +} + /* ----------------------------------------------------------------- */ #undef YY_INPUT @@ -2619,9 +2627,7 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" g_name+=yytext+7; } <Body,TemplCast>{SCOPENAME}{B}*"<"[^\n\/\-\.\{\"\>\(]*">"("::"{ID})*/{B}* { // A<T> *pt; - int i=QCString(yytext).find('<'); - QCString kw = QCString(yytext).left(i).stripWhiteSpace(); - if (kw.right(5)=="_cast" && YY_START==Body) + if (isCastKeyword(yytext) && YY_START==Body) { REJECT; } @@ -2651,9 +2657,7 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" } <Body>{SCOPETNAME}{B}*"<"[^\n\/\-\.\{\"\>]*">"/{BN}*"(" | <Body>{SCOPETNAME}/{BN}*"(" { // a() or c::a() or t<A,B>::a() or A\B\foo() - int i=QCString(yytext).find('<'); - QCString kw = QCString(yytext).left(i).stripWhiteSpace(); - if (kw.right(5)=="_cast" && YY_START==Body) + if (isCastKeyword(yytext)) { REJECT; } @@ -3068,9 +3072,7 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" endFontClass(); } <MemberCall2,FuncCall>{ID}(({B}*"<"[^\n\[\](){}<>]*">")?({B}*"::"{B}*{ID})?)* { - int i=QCString(yytext).find('<'); - QCString kw = QCString(yytext).left(i).stripWhiteSpace(); - if (kw.right(5)=="_cast") + if (isCastKeyword(yytext)) { REJECT; } |