From 8b1603b75f596cbe06e7cb05bcd4b220a8113dee Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Wed, 6 Apr 2016 11:47:15 +0200 Subject: [PATCH] teach wrapcomments.py about @name --- contrib/utilities/wrapcomments.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/contrib/utilities/wrapcomments.py b/contrib/utilities/wrapcomments.py index 8a0d93f67f..b3c0c30a22 100755 --- a/contrib/utilities/wrapcomments.py +++ b/contrib/utilities/wrapcomments.py @@ -102,6 +102,8 @@ def format_block(lines, infostr=""): ops_separate_line = ["
    ", "
", "", "@{", "@}", "
"] + # separate and do not break: + ops_title_line = ["@page", "@name"] #todo: # @arg @c @cond @em @endcond @f{ @internal @name @post @pre @sa @@ -131,14 +133,15 @@ def format_block(lines, infostr=""): thisline = lines[idx].strip()[2:] out.append(start + thisline) - elif "@page" in lines[idx]: - # do not break @page + elif one_in(ops_title_line, lines[idx]): + # do not break @page, etc. if curlines!=[]: out.extend(wrap_block(remove_junk(curlines), start)) curlines=[] thisline = remove_junk([lines[idx]])[0] - if not thisline.startswith("@page") and not thisline.startswith("(@page"): - print ("%s warning %s not at start of line"%(infostr, "@page"), file=sys.stderr) + + if not thisline.split(" ")[0] in ops_title_line: + print ("%s warning title not at start of line"%(infostr), file=sys.stderr) out.append(start + thisline.strip()) elif "@ref" in lines[idx]: @@ -503,6 +506,13 @@ lineI = [" /**", \ lineO = lineI assert(format_block(lineI)==lineO) +# do not break @name: +longtext = "bla bla"*20 +lineI = [" /**", \ + " * @name " + longtext, \ + " * hello", \ + " */"] +assert(format_block(lineI)==lineI) #print (lineI) -- 2.39.5