import os
-from .ast import (Callback, Class, Enum, Function, Interface, Member,
+from .ast import (Callback, Class, Constant, Enum, Function, Interface, Member,
Array, Struct, Alias, Union, List, Map, Varargs)
from .glibast import (GLibBoxed, GLibEnum, GLibEnumMember,
GLibFlags, GLibObject, GLibInterface)
pass
elif isinstance(node, Alias):
self._write_alias(node)
+ elif isinstance(node, Constant):
+ self._write_constant(node)
else:
print 'WRITER: Unhandled node', node
attrs.append(('glib:nick', member.nick))
self.write_tag('member', attrs)
+ def _write_constant(self, constant):
+ attrs = [('name', constant.name),
+ ('value', str(constant.value))]
+ with self.tagcontext('constant', attrs):
+ self._write_type(constant.type)
+
def _write_class(self, node):
attrs = [('name', node.name),
('c:type', node.ctype)]