diff options
author | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2009-07-20 20:05:52 (GMT) |
---|---|---|
committer | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2009-07-20 20:05:52 (GMT) |
commit | 6e28050ef5483e624122b0bacb998c40664f78ee (patch) | |
tree | b8b0cb3ac894bdb88087d78e328a8a0d88943b97 /src/scanner.l | |
parent | 7c0a46b50fad0925e47b78326f8c2e92e3829fb4 (diff) | |
download | Doxygen-6e28050ef5483e624122b0bacb998c40664f78ee.zip Doxygen-6e28050ef5483e624122b0bacb998c40664f78ee.tar.gz Doxygen-6e28050ef5483e624122b0bacb998c40664f78ee.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(); } |