From c39891e75da896aa7c468c4c94598b842c7a9abe Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Wed, 11 Feb 2015 10:58:31 -0500 Subject: [PATCH] wrapcomments.py: do not break @page --- contrib/utilities/wrapcomments.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/contrib/utilities/wrapcomments.py b/contrib/utilities/wrapcomments.py index 9dc12dc78a..ac2c2414a7 100755 --- a/contrib/utilities/wrapcomments.py +++ b/contrib/utilities/wrapcomments.py @@ -110,6 +110,16 @@ def format_block(lines, infostr=""): if it in thisline and thisline!=it: print ("%s warning %s not in separate line"%(infostr, it), file=sys.stderr) out.append(start + thisline) + elif "@page" in lines[idx]: + # do not break @page + 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) + out.append(start + thisline.strip()) + elif "@ref" in lines[idx]: # @ref link "some long description" # is special, and we mustn't break it @@ -388,6 +398,14 @@ lineO = [" /**", \ " */"] assert(format_block(lineI)==lineO) +# do not break @page: +longtext = "bla bla"*20 +lineI = [" /**", \ + " * @page " + longtext, \ + " * hello", \ + " */"] +assert(format_block(lineI)==lineI) + -- 2.39.5