summaryrefslogtreecommitdiffstats
path: root/src/code.l
diff options
context:
space:
mode:
Diffstat (limited to 'src/code.l')
-rw-r--r--src/code.l10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/code.l b/src/code.l
index 2b48c47..3acf41a 100644
--- a/src/code.l
+++ b/src/code.l
@@ -249,6 +249,7 @@ static QCString escapeComment(yyscan_t yyscanner,const char *s);
static bool skipLanguageSpecificKeyword(yyscan_t yyscanner,const char *kw);
static yy_size_t yyread(yyscan_t yyscanner,char *buf,yy_size_t max_size);
static void addVariable(yyscan_t yyscanner,QCString type,QCString name);
+static bool startsWithKeyword(const QCString &str,const QCString &kw);
//-------------------------------------------------------------------
@@ -1135,12 +1136,14 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
yyextra->name+=yytext;
}
<Body>{SCOPENAME}/{BN}*[:;,)\]] { // "int var;" or "var, var2" or "debug(f) macro" , or int var : 5;
+ if (startsWithKeyword(yytext,"typedef")) REJECT;
addType(yyscanner);
// changed this to generateFunctionLink, see bug 624514
generateFunctionLink(yyscanner,*yyextra->code,yytext);
yyextra->name+=yytext;
}
<Body>{SCOPENAME}/{B}* { // p->func()
+ if (startsWithKeyword(yytext,"typedef")) REJECT;
addType(yyscanner);
generateClassOrGlobalLink(yyscanner,*yyextra->code,yytext);
yyextra->name+=yytext;
@@ -2168,6 +2171,13 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
/*@ ----------------------------------------------------------------------------
*/
+static bool startsWithKeyword(const QCString &str,const QCString &kw)
+{
+ if (str.length()<kw.length()) return false; // string too short to match
+ return str==kw || // exact match
+ (str.startsWith(kw) && !isId(str.at(kw.length()))); // match that is not a substring
+}
+
static void addVariable(yyscan_t yyscanner,QCString type,QCString name)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;