diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2020-07-30 11:24:59 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2020-07-30 11:24:59 (GMT) |
commit | c50b92c39435b558c5cb53be47dba41503f26fad (patch) | |
tree | 04e1bc36d84165ace0755cd32939744a08ad519e | |
parent | 4ae47ae6f238d465eefa1b5a85c0cf3f7857bc57 (diff) | |
parent | 4f28f621b67d96c3f9eb78f01009867377695558 (diff) | |
download | Doxygen-c50b92c39435b558c5cb53be47dba41503f26fad.zip Doxygen-c50b92c39435b558c5cb53be47dba41503f26fad.tar.gz Doxygen-c50b92c39435b558c5cb53be47dba41503f26fad.tar.bz2 |
Merge branch 'feature/bug_direction' of https://github.com/albert-github/doxygen into albert-github-feature/bug_direction
-rw-r--r-- | src/doctokenizer.l | 2 | ||||
-rw-r--r-- | src/util.cpp | 23 |
2 files changed, 20 insertions, 5 deletions
diff --git a/src/doctokenizer.l b/src/doctokenizer.l index f232c3a..ac5b6d2 100644 --- a/src/doctokenizer.l +++ b/src/doctokenizer.l @@ -392,7 +392,7 @@ SPCMD2 {CMD}[\\@<>&$#%~".+=|-] SPCMD3 {CMD}_form#[0-9]+ SPCMD4 {CMD}"::" SPCMD5 {CMD}":" -INOUT "inout"|"in"|"out"|("in"{BLANK}*","{BLANK}*"out")|("out"{BLANK}*","{BLANK}*"in") +INOUT "in"|"out"|("in"{BLANK}*","?{BLANK}*"out")|("out"{BLANK}*","?{BLANK}*"in") PARAMIO {CMD}param{BLANK}*"["{BLANK}*{INOUT}{BLANK}*"]" VARARGS "..." TEMPCHAR [a-z_A-Z0-9.,: \t\*\&\(\)\[\]] diff --git a/src/util.cpp b/src/util.cpp index 13ae200..c810db5 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -8141,10 +8141,25 @@ QCString extractDirection(QCString &docs) int l=0; if (re.match(docs,0,&l)==0) { - int inPos = docs.find("in", 1,FALSE); - int outPos = docs.find("out",1,FALSE); - bool input = inPos!=-1 && inPos<l; - bool output = outPos!=-1 && outPos<l; + QRegExp re_in("\\[ *in *\\]"); // [in] + QRegExp re_out("\\[ *out *\\]"); // [out] + QRegExp re_inout("\\[ *in *[,]? *out *\\]"); // [in,out] + QRegExp re_outin("\\[ *out *[,]? *in *\\]"); // [out,in] + int l_in = 0; + int l_out = 0; + int l_inout = 0; + int l_outin = 0; + int inPos = re_in.match(docs,0,&l_in); + int outPos = re_out.match(docs,0,&l_out); + int inoutPos = re_inout.match(docs,0,&l_inout); + int outinPos = re_outin.match(docs,0,&l_outin); + // we only take the first occurrence into account + bool input = (inPos!=-1 && l==l_in) || + (inoutPos!=-1 && l==l_inout) || + (outinPos!=-1 && l==l_outin); + bool output = (outPos!=-1 && l==l_out) || + (inoutPos!=-1 && l==l_inout) || + (outinPos!=-1 && l==l_outin); if (input || output) // in,out attributes { docs = docs.mid(l); // strip attributes |