summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2010-03-03 16:23:50 (GMT)
committerSteven Knight <knight@baldmt.com>2010-03-03 16:23:50 (GMT)
commit2af231cac62af5ff445e217b8cf35770f64af588 (patch)
treed3e89de7f4618f9a1185d256fa73a30c6cab3ad1 /bin
parent21ebe80a2b5e916ac7d791a08ed0f5b73708d705 (diff)
downloadSCons-2af231cac62af5ff445e217b8cf35770f64af588.zip
SCons-2af231cac62af5ff445e217b8cf35770f64af588.tar.gz
SCons-2af231cac62af5ff445e217b8cf35770f64af588.tar.bz2
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 <scons_function> arguments for when the function has no global form or construction environment form.
Diffstat (limited to 'bin')
-rw-r--r--bin/scons-proc.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/bin/scons-proc.py b/bin/scons-proc.py
index fdbcd65..b6c59d6 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)>([^<]*)</\1>',
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, '&lt;', '<')
body = string.replace(body, '&gt;', '>')
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'