diff options
Diffstat (limited to 'giscanner/transformer.py')
-rw-r--r-- | giscanner/transformer.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/giscanner/transformer.py b/giscanner/transformer.py index 58c2fbc..eb76f83 100644 --- a/giscanner/transformer.py +++ b/giscanner/transformer.py @@ -465,12 +465,18 @@ class Transformer(object): if not symbol.source_filename.endswith('.h'): return None name = self.remove_prefix(symbol.ident) - if symbol.const_string is None: + if symbol.const_string is not None: + type_name = 'utf8' + value = symbol.const_string + elif symbol.const_int is not None: type_name = 'int' value = symbol.const_int + elif symbol.const_double is not None: + type_name = 'double' + value = symbol.const_double else: - type_name = 'utf8' - value = symbol.const_string + raise AssertionError() + const = Constant(name, type_name, value) return const |