summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2020-05-04 11:30:16 (GMT)
committeralbert-github <albert.tests@gmail.com>2020-05-04 11:30:16 (GMT)
commit0488cb553e8a1e42b774a7fab4915f494a848225 (patch)
treef64849ec548782ba2211060b635971fb4974988f /src
parent82cb93c033c83b5a184cd450d86b0f712e0870b3 (diff)
downloadDoxygen-0488cb553e8a1e42b774a7fab4915f494a848225.zip
Doxygen-0488cb553e8a1e42b774a7fab4915f494a848225.tar.gz
Doxygen-0488cb553e8a1e42b774a7fab4915f494a848225.tar.bz2
issue #7747 Three-way comparison operator
Implementation of the C++2x three-way / spaceship operator.
Diffstat (limited to 'src')
-rw-r--r--src/code.l2
-rw-r--r--src/doctokenizer.l2
-rw-r--r--src/doxygen.cpp6
-rw-r--r--src/scanner.l2
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})