diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2009-07-20 20:05:52 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2009-07-20 20:05:52 (GMT) |
commit | 142b4807d2ae7479691bd0800d28364b9857b82f (patch) | |
tree | b8b0cb3ac894bdb88087d78e328a8a0d88943b97 /src/scanner.l | |
parent | b70a5b4f9325ec703db37394feeaa9ebc11228b4 (diff) | |
download | Doxygen-142b4807d2ae7479691bd0800d28364b9857b82f.zip Doxygen-142b4807d2ae7479691bd0800d28364b9857b82f.tar.gz Doxygen-142b4807d2ae7479691bd0800d28364b9857b82f.tar.bz2 |
Release-1.5.9-20090720
Diffstat (limited to 'src/scanner.l')
-rw-r--r-- | src/scanner.l | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/src/scanner.l b/src/scanner.l index 7862507..c6db28c 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -1713,6 +1713,7 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) } <FindMemberName>{SCOPENAME}{BN}*/"<" { sharpCount=0; + roundCount=0; lineCount(); current->name+=((QCString)yytext).stripWhiteSpace(); //current->memberSpec.resize(0); @@ -1722,7 +1723,7 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) else BEGIN( EndTemplate ); } -<EndTemplate>"<<" { +<ClassTemplSpec,EndTemplate>"<<" { current->name+=yytext; // *currentTemplateSpec+=yytext; } @@ -1731,8 +1732,8 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) // *currentTemplateSpec+='<'; sharpCount++; } -<EndTemplate>">>" { - if (insideJava || insideCS || insideCli) +<ClassTemplSpec,EndTemplate>">>" { + if (insideJava || insideCS || insideCli || roundCount==0) { unput('>'); unput(' '); @@ -1781,6 +1782,12 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) BEGIN(FindMemberName); } } +<ClassTemplSpec,EndTemplate>"(" { current->name+=*yytext; + roundCount++; + } +<ClassTemplSpec,EndTemplate>")" { current->name+=*yytext; + if (roundCount>0) roundCount--; + } <EndTemplate>. { current->name+=*yytext; // *currentTemplateSpec+=*yytext; @@ -4132,7 +4139,7 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) current->doc.resize(0); } #endif - if (current->sli) // copy special list items + if (current->sli && previous) // copy special list items { QListIterator<ListItemInfo> li(*current->sli); ListItemInfo *lii; @@ -4315,6 +4322,7 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) } else // C++ template specialization { + roundCount=0; BEGIN( ClassTemplSpec ); } } @@ -4770,9 +4778,22 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) { REJECT; } - else // for C++ >> is a bitshift operator and > > would end a nested template + else // for C++ >> is a bitshift + // operator and > > would end + // a nested template. + // We require the bitshift to be enclosed in braces. + // See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1757.html { - *specName += yytext; + if (roundCount>0) + { + *specName += yytext; + } + else + { + unput('>'); + unput(' '); + unput('>'); + } } } <Specialization>"typename"{BN}+ { lineCount(); } |