2 ===================================================================
3 RCS file: /cvsroot/doxygen/src/commentcnv.l,v
4 retrieving revision 1.32
5 diff -u -3 -p -r1.32 commentcnv.l
6 --- commentcnv.l 16 Jul 2006 20:10:06 -0000 1.32
7 +++ commentcnv.l 29 Sep 2006 21:45:49 -0000
8 @@ -225,7 +225,7 @@ static QCString handleCondCmdInAliases(c
10 static void replaceAliases(const char *s,int len)
12 - static QRegExp cmd("[@\\\\][a-z_A-Z][a-z_A-Z0-9]*");
13 + static QRegExp cmd("[@\\\\][a-z_A-Z][a-z_A-Z0-9(),]*");
16 while ((i=cmd.match(in,p,&l))!=-1)
17 @@ -507,16 +507,107 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."
18 if (*yytext=='\n') g_lineNr++;
21 -<CComment,ReadLine>[\\@][a-z_A-Z][a-z_A-Z0-9]* { // expand alias
22 - QCString *pValue=Doxygen::aliasDict[yytext+1];
25 - QCString val = handleCondCmdInAliases(*pValue);
26 - copyToOutput(val.data(),val.length());
27 +<CComment,ReadLine>[\\@][a-z_A-Z][a-z_A-Z0-9(),\\]* { // expand alias
29 + QCString com(yytext+1);
31 + ind = com.find('(');
32 + if(ind < 0) // command with no args?
34 + QCString *pValue=Doxygen::aliasDict[yytext+1];
37 + QCString val = handleCondCmdInAliases(*pValue);
38 + copyToOutput(val.data(),val.length());
42 + copyToOutput(yytext,yyleng);
48 - copyToOutput(yytext,yyleng);
49 + QCString rawcom(com.data(), ind);
51 + QCString *pValue=Doxygen::aliasDict[rawcom];
55 + // This should probably be put into the scanner,
56 + // but this is simpler for now.
57 + const unsigned int MAXARGS = 20;
58 + QCString args[MAXARGS];
62 + for(unsigned int i = ind + 1; i < com.length(); ++i)
70 + if((c == ',' || c == ')') && !esc)
72 + args[nargs++] = argval;
74 + if(nargs == MAXARGS)
76 + warn(g_fileName,g_lineNr,"Too many arguments in alias");
88 + // Replace args in alias
90 + int ind = -1, lastind = 0;
92 + while((ind = pValue->find('^', lastind)) > 0)
94 + QCString copy(pValue->data() + lastind, ind - lastind);
96 + fullalias.append(copy);
98 + int nextind = pValue->find('^', ind + 1);
101 + QCString index(&(*pValue)[ind+1], nextind - ind - 1);
103 + unsigned short argi = index.toUShort(&ok) - 1;
111 + warn(g_fileName,g_lineNr,"Not enough arguments in alias call!");
112 + fullalias.append("*Illegal Argument*");
116 + fullalias.append(args[argi]);
118 + lastind = nextind + 1;
120 + fullalias.append(pValue->data() + lastind);
122 + QCString val = handleCondCmdInAliases(fullalias);
123 + copyToOutput(val.data(),val.length());
127 + // Not alias, but args? This is wrong...
128 + copyToOutput(yytext,yyleng);