return result
def inject_pxd_code(module_node):
- from Nodes import CCommentNode
from textwrap import dedent
stats = module_node.body.stats
for name, (statlistnode, scope) in self.pxds.iteritems():
- #stats.append(CCommentNode('Code from cimported "%s"' % name, header=True))
stats.append(statlistnode)
return module_node
self.module.generate_disposal_code(code)
-class CForeignScopeNode(StatNode):
- """
- Used for wrapping FuncDefNodes from pxds so that they generate their
- code in the right scope.
- """
- pass
-
-class CCommentNode(StatNode):
- # not working!
- def __init__(self, comment, header=False):
- self.pos
- assert '/' not in comment # todo: better escaping
- if header:
- from textwrap import dedent
- comment = dedent("""
- /*
- * %s
- */
- """) % comment
- else:
- comment = "/* %s */" % comment
- self.comment = comment
-
- def generate_execution_code(self, code):
- code.putln(self.header)
-
-
#------------------------------------------------------------------------------------
#
# Runtime support code