Kaydet (Commit) 7d1eba97 authored tarafından Jack Jansen's avatar Jack Jansen

Added extra module argument varstuff, to declare extra module-level vars

üst 29c61211
...@@ -6,12 +6,14 @@ class Module(GeneratorGroup): ...@@ -6,12 +6,14 @@ class Module(GeneratorGroup):
def __init__(self, name, prefix = None, def __init__(self, name, prefix = None,
includestuff = None, includestuff = None,
finalstuff = None, finalstuff = None,
initstuff = None): initstuff = None,
variablestuff = None):
GeneratorGroup.__init__(self, prefix or name) GeneratorGroup.__init__(self, prefix or name)
self.name = name self.name = name
self.includestuff = includestuff self.includestuff = includestuff
self.initstuff = initstuff self.initstuff = initstuff
self.finalstuff = finalstuff self.finalstuff = finalstuff
self.variablestuff = variablestuff
def addobject(self, od): def addobject(self, od):
self.generators.append(od) self.generators.append(od)
...@@ -64,6 +66,9 @@ class Module(GeneratorGroup): ...@@ -64,6 +66,9 @@ class Module(GeneratorGroup):
Output("""Py_FatalError("can't initialize %s.Error");""", Output("""Py_FatalError("can't initialize %s.Error");""",
self.name) self.name)
DedentLevel() DedentLevel()
if self.variablestuff:
Output("%s", self.variablestuff)
Output()
def exceptionInitializer(self): def exceptionInitializer(self):
return """PyString_FromString("%s.Error")""" % self.name return """PyString_FromString("%s.Error")""" % self.name
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment