From 9951ad78c80e144c166a7d476cad7ffdf84332a9 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Wed, 13 Aug 2014 14:55:49 -0700 Subject: Debug debugging --- src/sexpr/variant.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/sexpr/variant.py (limited to 'src/sexpr/variant.py') diff --git a/src/sexpr/variant.py b/src/sexpr/variant.py new file mode 100644 index 0000000..3be402a --- /dev/null +++ b/src/sexpr/variant.py @@ -0,0 +1,22 @@ +class Variant(object): + __slots__ = ('_value') + name = 'tmwa::sexpr::Variant' + enabled = True + + def __init__(self, value): + self._value = value + + def to_string(self): + return None + + def children(self): + value = self._value + data = value['data'] + state = value['state'] + ty = value.type.template_argument(state) + yield '(%s)' % ty, data.address.cast(ty.pointer()).dereference() + + tests = [ + ('tmwa::sexpr::Variant(42)', '{(int) = 42}'), + ('tmwa::sexpr::Variant("Hello, World!")', '{(const char *) = "Hello, World!"}'), + ] -- cgit v1.2.3-60-g2f50