From 037f465e934ce122c8412b55548a153ad517aba0 Mon Sep 17 00:00:00 2001 From: Matthew White Date: Mon, 24 Jul 2017 06:04:25 +0200 Subject: Fix/New: add variadic function args '...' support to @ref * src/doctokenizer.l: add VARARGS, aka variadic function args '...' * src/util.cpp (linkToText): call substitute() with skip_seq set to 3 to keep each '...' sequence of chars unchanged For instance, the command '@ref fun(int,...)' now is able to parse each '...' sequence of chars correctly to reference fun(int,...). Before this patch, the '...' part was skipped. Also, linkToText() is fixed to not substitute '...' with '::::::' in the text representation of the link. --- src/doctokenizer.l | 3 ++- src/util.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/doctokenizer.l b/src/doctokenizer.l index 7545cba..90a8c55 100644 --- a/src/doctokenizer.l +++ b/src/doctokenizer.l @@ -360,8 +360,9 @@ SPCMD3 {CMD}form#[0-9]+ SPCMD4 {CMD}"::" INOUT "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\*\&\(\)\[\]] -FUNCCHAR [a-z_A-Z0-9,:\<\> \t\^\*\&\[\]] +FUNCCHAR [a-z_A-Z0-9,:\<\> \t\^\*\&\[\]]|{VARARGS} FUNCPART {FUNCCHAR}*("("{FUNCCHAR}*")"{FUNCCHAR}*)? SCOPESEP "::"|"#"|"." TEMPLPART "<"{TEMPCHAR}*">" diff --git a/src/util.cpp b/src/util.cpp index 8fcd8e3..02cb27b 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -4767,7 +4767,7 @@ QCString linkToText(SrcLangExt lang,const char *link,bool isFileName) // replace # by :: result=substitute(result,"#","::"); // replace . by :: - if (!isFileName && result.find('<')==-1) result=substitute(result,".","::"); + if (!isFileName && result.find('<')==-1) result=substitute(result,".","::",3); // strip leading :: prefix if present if (result.at(0)==':' && result.at(1)==':') { -- cgit v0.12