summaryrefslogtreecommitdiff
path: root/giscanner/transformer.py
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2009-02-25 15:25:36 -0500
committerColin Walters <walters@verbum.org>2009-02-25 15:34:21 -0500
commit0b9dda0e725446882dca84b6a64688c8f0e5a4e3 (patch)
treefd7b7e5d75dc86ea18c1168310d80402fddf5c45 /giscanner/transformer.py
parentc58582c7a88a95616fa87b81517ab8a2a76af92f (diff)
downloadgobject-introspection-0b9dda0e725446882dca84b6a64688c8f0e5a4e3.tar.gz
Bug 555964 - Parse floating-point #defines
Previously we just supported int and string, add double to this. Technically we should probably differentiate between float and double, but it's not likely to be very useful in practice to do so.
Diffstat (limited to 'giscanner/transformer.py')
-rw-r--r--giscanner/transformer.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/giscanner/transformer.py b/giscanner/transformer.py
index 58c2fbc9..eb76f830 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