summaryrefslogtreecommitdiffstats
path: root/src/pre.l
diff options
context:
space:
mode:
authordimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2004-03-07 21:00:29 (GMT)
committerdimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2004-03-07 21:00:29 (GMT)
commitf12fe31aed103718f5d4c368473302cc6ac82a47 (patch)
treeecc570be1c038ecdb55dda6d9ffe794945151261 /src/pre.l
parent5edb3c85109d09e5fa43529bf8b584382f7501a5 (diff)
downloadDoxygen-f12fe31aed103718f5d4c368473302cc6ac82a47.zip
Doxygen-f12fe31aed103718f5d4c368473302cc6ac82a47.tar.gz
Doxygen-f12fe31aed103718f5d4c368473302cc6ac82a47.tar.bz2
Release-1.3.6-20040307
Diffstat (limited to 'src/pre.l')
-rw-r--r--src/pre.l38
1 files changed, 24 insertions, 14 deletions
diff --git a/src/pre.l b/src/pre.l
index 0eb3296..490f2f5 100644
--- a/src/pre.l
+++ b/src/pre.l
@@ -397,6 +397,18 @@ static void returnCharToStream(char c)
unput(c);
}
+static inline void addTillEndOfString(const QCString &expr,QCString *rest,
+ uint &pos,char term,QCString &arg)
+{
+ char cc;
+ while ((cc=getNextChar(expr,rest,pos))!=EOF)
+ {
+ if (cc=='\\') arg+=cc,cc=getNextChar(expr,rest,pos);
+ else if (cc==term) return;
+ arg+=cc;
+ }
+}
+
/*! replaces the function macro \a def whose argument list starts at
* \a pos in expression \a expr.
* Notice that this routine may scan beyond the \a expr string if needed.
@@ -449,28 +461,23 @@ static bool replaceFunctionMacro(const QCString &expr,QCString *rest,int pos,int
{
int level=1;
arg+=c;
- char term='\0';
+ //char term='\0';
while ((cc=getNextChar(expr,rest,j))!=EOF)
{
char c=(char)cc;
+ //printf("processing %c: term=%c (%d)\n",c,term,term);
if (c=='\'' || c=='\"') // skip ('s and )'s inside strings
{
- if (term!='\0')
- {
- if (c==term && expr.at(j-2)!='\\') term='\0';
- }
- else
- {
- term=c;
- }
+ arg+=c;
+ addTillEndOfString(expr,rest,j,c,arg);
}
- if (term=='\0' && c==')')
+ if (c==')')
{
level--;
arg+=c;
if (level==0) break;
}
- else if (term=='\0' && c=='(')
+ else if (c=='(')
{
level++;
arg+=c;
@@ -625,7 +632,7 @@ static bool replaceFunctionMacro(const QCString &expr,QCString *rest,int pos,int
{
inString=TRUE; // entering a literal string
}
- else if (inString && d.at(k)=='\"' && d.at(k-1)!='\\')
+ else if (inString && d.at(k)=='\"' && (d.at(k-1)!='\\' || d.at(k-2)=='\\'))
{
inString=FALSE; // leaving a literal string
}
@@ -665,10 +672,12 @@ static int getNextId(const QCString &expr,int p,int *l)
}
else if (c=='"') // skip string
{
- char pc=c;
+ char ppc=0,pc=c;
if (p<(int)expr.length()) c=expr.at(p);
- while (p<(int)expr.length() && (c!='"' || pc=='\\'))
+ while (p<(int)expr.length() && (c!='"' || (pc=='\\' && ppc!='\\')))
+ // continue as long as no " is found, but ignoring \", but not \\"
{
+ ppc=pc;
pc=c;
c=expr.at(p);
p++;
@@ -1189,6 +1198,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
Define *def=0;
if (skipFuncMacros &&
+ name!="Q_PROPERTY" &&
!(
(g_includeStack.isEmpty() || g_curlyCount>0) &&
g_macroExpansion &&