From 3474302187a076347cc11349736c964bce4ab442 Mon Sep 17 00:00:00 2001 From: stevenknight Date: Wed, 3 Mar 2010 16:23:50 +0000 Subject: [PATCH] More updates towards supporting function documentation: * Convert \f[BI].*\fP strings containing white space to quoted .B lines. * Anchor conversion of \f[BI] lines to .[BR] at end of line. * Convert \f[BI] lines preceded by text to a .R[BI] line. * Convert -- on .[BI]R? lines to \-\-. * Support global="0" and env="0" options arguments for when the function has no global form or construction environment form. git-svn-id: http://scons.tigris.org/svn/scons/trunk@4689 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- bin/scons-proc.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/bin/scons-proc.py b/bin/scons-proc.py index fdbcd653..b6c59d65 100644 --- a/bin/scons-proc.py +++ b/bin/scons-proc.py @@ -221,14 +221,17 @@ class SCons_XML_to_man(SCons_XML): r'\\fB\2\\fP', body) body = re.sub(r'<(classname|emphasis|varname)>([^<]*)', r'\\fI\2\\fP', body) + body = re.compile(r'^\\f([BI])([^\\]* [^\\]*)\\fP\s*$', re.M).sub(r'.\1 "\2"', body) body = re.compile(r'^\\f([BI])(.*)\\fP\s*$', re.M).sub(r'.\1 \2', body) - body = re.compile(r'^\\f([BI])(.*)\\fP(\S+)', re.M).sub(r'.\1R \2 \3', body) + body = re.compile(r'^\\f([BI])(.*)\\fP(\S+)$', re.M).sub(r'.\1R \2 \3', body) + body = re.compile(r'^(\S+)\\f([BI])(.*)\\fP$', re.M).sub(r'.R\2 \1 \3', body) body = string.replace(body, '<', '<') body = string.replace(body, '>', '>') body = re.sub(r'\\([^f])', r'\\\\\1', body) body = re.compile("^'\\\\\\\\", re.M).sub("'\\\\", body) + body = re.compile(r'^\.([BI]R?) --', re.M).sub(r'.\1 \-\-', body) body = re.compile(r'^\.([BI]R?) -', re.M).sub(r'.\1 \-', body) - body = re.compile(r'^\.([BI]R?) (\S+)\\\\(\S+)', re.M).sub(r'.\1 "\2\\\\\\\\\2"', body) + body = re.compile(r'^\.([BI]R?) (\S+)\\\\(\S+)$', re.M).sub(r'.\1 "\2\\\\\\\\\2"', body) body = re.compile(r'\\f([BI])-', re.M).sub(r'\\f\1\-', body) f.write(body) @@ -283,8 +286,12 @@ class Function(Proxy): x = self.arguments except AttributeError: x = '()' - y = ['%s%s' % (self.name, x), 'env.%s%s' % (self.name, x)] - return [ '.TP\n.RI %s\n' % t for t in y ] + result = [] + if self.global_signature != "0": + result.append('.TP\n.RI %s%s\n' % (self.name, x)) + if self.env_signature != "0": + result.append('.TP\n.IR env .%s%s\n' % (self.name, x)) + return result class Tool(Proxy): description = 'tool' -- 2.26.2