module. Emulates the behavior of putting
"from <module> import *" at the top of the file.
--incref-local-binop Force local an extra incref on local variables before
- performing any binary operations.
+ performing any binary operations.
+ -D, --no-docstrings Remove docstrings.
"""
#The following experimental options are supported only on MacOSX:
# -C, --compile Compile generated .c file to .o file
Options.incref_local_binop = 1
elif option == "--cleanup":
Options.generate_cleanup_code = int(pop_arg())
+ elif option in ("-D", "--no-docstrings"):
+ Options.docstrings = False
else:
bad_usage()
else:
Naming.pyfunc_prefix + prefix + name
entry.pymethdef_cname = \
Naming.pymethdef_prefix + prefix + name
- if not entry.is_special:
+ if not Options.docstrings:
+ self.entry.doc = None
+ elif not entry.is_special:
if Options.embed_pos_in_docstring:
entry.doc = 'File: %s (starting at line %s)'%relative_position(self.pos)
if not self.doc is None:
code.putln("%s; /*proto*/" % header)
if proto_only:
return
- if self.entry.doc:
+ if self.entry.doc and Options.docstrings:
code.putln(
'static char %s[] = "%s";' % (
self.entry.doc_cname,
self.body = body
import ExprNodes
self.dict = ExprNodes.DictNode(pos, key_value_pairs = [])
- if self.doc:
+ if self.doc and Options.docstrings:
if Options.embed_pos_in_docstring:
doc = 'File: %s (starting at line %s)'%relative_position(self.pos)
doc = doc + '\\n' + self.doc
api = self.api)
scope = self.entry.type.scope
- if self.doc:
+ if self.doc and Options.docstrings:
if Options.embed_pos_in_docstring:
scope.doc = 'File: %s (starting at line %s)'%relative_position(self.pos)
scope.doc = scope.doc + '\\n' + self.doc
def analyse_declarations(self, env):
entry = env.declare_property(self.name, self.doc, self.pos)
if entry:
- if self.doc:
+ if self.doc and Options.docstrings:
doc_entry = env.get_string_const(self.doc)
entry.doc_cname = doc_entry.cname
self.body.analyse_declarations(entry.scope)