From 0488cb553e8a1e42b774a7fab4915f494a848225 Mon Sep 17 00:00:00 2001 From: albert-github Date: Mon, 4 May 2020 13:30:16 +0200 Subject: issue #7747 Three-way comparison operator Implementation of the C++2x three-way / spaceship operator. --- src/code.l | 2 +- src/doctokenizer.l | 2 +- src/doxygen.cpp | 6 ++++-- src/scanner.l | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/code.l b/src/code.l index 1c60fcf..ddeca01 100644 --- a/src/code.l +++ b/src/code.l @@ -396,7 +396,7 @@ CASTKW ("const_cast"|"dynamic_cast"|"reinterpret_cast"|"static_cast") CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^' \\\n]{1,4}"'")) ARITHOP "+"|"-"|"/"|"*"|"%"|"--"|"++" ASSIGNOP "="|"*="|"/="|"%="|"+="|"-="|"<<="|">>="|"&="|"^="|"|=" -LOGICOP "=="|"!="|">"|"<"|">="|"<="|"&&"|"||"|"!" +LOGICOP "=="|"!="|">"|"<"|">="|"<="|"&&"|"||"|"!"|"<=>" BITOP "&"|"|"|"^"|"<<"|">>"|"~" OPERATOR {ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP} RAWBEGIN (u|U|L|u8)?R\"[^ \t\(\)\\]{0,16}"(" diff --git a/src/doctokenizer.l b/src/doctokenizer.l index 7f3fbc9..5317de5 100644 --- a/src/doctokenizer.l +++ b/src/doctokenizer.l @@ -395,7 +395,7 @@ FUNCARG "("{FUNCPART}")"({BLANK}*("volatile"|"const"){BLANK})? FUNCARG2 "("{FUNCPART}")"({BLANK}*("volatile"|"const"))? OPNEW {BLANK}+"new"({BLANK}*"[]")? OPDEL {BLANK}+"delete"({BLANK}*"[]")? -OPNORM {OPNEW}|{OPDEL}|"+"|"-"|"*"|"/"|"%"|"^"|"&"|"|"|"~"|"!"|"="|"<"|">"|"+="|"-="|"*="|"/="|"%="|"^="|"&="|"|="|"<<"|">>"|"<<="|">>="|"=="|"!="|"<="|">="|"&&"|"||"|"++"|"--"|","|"->*"|"->"|"[]"|"()" +OPNORM {OPNEW}|{OPDEL}|"+"|"-"|"*"|"/"|"%"|"^"|"&"|"|"|"~"|"!"|"="|"<"|">"|"+="|"-="|"*="|"/="|"%="|"^="|"&="|"|="|"<<"|">>"|"<<="|">>="|"=="|"!="|"<="|">="|"&&"|"||"|"++"|"--"|","|"->*"|"->"|"[]"|"()"|"<=>" OPCAST {BLANK}+[^<(\r\n.,][^(\r\n.,]* OPMASK ({BLANK}*{OPNORM}{FUNCARG}) OPMASKOPT ({BLANK}*{OPNORM}{FUNCARG}?)|({OPCAST}{FUNCARG}) diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 0728d8f..820b8fc 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -3018,10 +3018,12 @@ static void addMethodToClass(const Entry *root,ClassDef *cd, else mtype=MemberType_Function; // strip redundant template specifier for constructors + int j = -1; if ((fd==0 || fd->getLanguage()==SrcLangExt_Cpp) && - name.left(9)!="operator " && (i=name.find('<'))!=-1 && name.find('>')!=-1) + name.left(9)!="operator " && (i=name.find('<'))!=-1 && (j=name.find('>'))!=-1) { - name=name.left(i); + // only remove incase not three way comparison operator / spaceship operator: <=> + if (!((j == i+2) && (name.at(i+1) == '='))) name=name.left(i); } QCString fileName = root->fileName; diff --git a/src/scanner.l b/src/scanner.l index e9cad5f..f066b5b 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -249,7 +249,7 @@ RAWBEGIN (u|U|L|u8)?R\"[^ \t\(\)\\]{0,16}"(" RAWEND ")"[^ \t\(\)\\]{0,16}\" ARITHOP "+"|"-"|"/"|"*"|"%"|"--"|"++" ASSIGNOP "="|"*="|"/="|"%="|"+="|"-="|"<<="|">>="|"&="|"^="|"|=" -LOGICOP "=="|"!="|">"|"<"|">="|"<="|"&&"|"||"|"!" +LOGICOP "=="|"!="|">"|"<"|">="|"<="|"&&"|"||"|"!"|"<=>" BITOP "&"|"|"|"^"|"<<"|">>"|"~" OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) -- cgit v0.12