summaryrefslogtreecommitdiff
path: root/src/map/magic-stmt.py
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2014-08-13 14:55:49 -0700
committerBen Longbons <b.r.longbons@gmail.com>2014-08-27 11:29:45 -0700
commit9951ad78c80e144c166a7d476cad7ffdf84332a9 (patch)
tree9f5498a9a3c23b62dc928288e72081e99f958f46 /src/map/magic-stmt.py
parent749fec734c4583153fb2dbc80f1d21db2c2ab457 (diff)
downloadtmwa-9951ad78c80e144c166a7d476cad7ffdf84332a9.tar.gz
tmwa-9951ad78c80e144c166a7d476cad7ffdf84332a9.tar.bz2
tmwa-9951ad78c80e144c166a7d476cad7ffdf84332a9.tar.xz
tmwa-9951ad78c80e144c166a7d476cad7ffdf84332a9.zip
Debug debugging
Diffstat (limited to 'src/map/magic-stmt.py')
-rw-r--r--src/map/magic-stmt.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/map/magic-stmt.py b/src/map/magic-stmt.py
new file mode 100644
index 0000000..6e34bb0
--- /dev/null
+++ b/src/map/magic-stmt.py
@@ -0,0 +1,31 @@
+class op_t(object):
+ __slots__ = ('_value')
+
+ name = 'tmwa::magic::op_t'
+ depth = 1
+ enabled = True
+
+ def __init__(self, value):
+ if not value:
+ value = None
+ self._value = value
+
+ def to_string(self):
+ value = self._value
+ if value is None:
+ return '(op_t *) nullptr'
+ return '(op_t *)'
+
+ def children(self):
+ value = self._value
+ if value is None:
+ return
+ value = value.dereference()
+ yield '->name', value['name']
+ yield '->signature', value['signature']
+ yield '->op', value['op']
+
+ tests = [
+ ('static_cast<tmwa::magic::op_t *>(nullptr)', '(op_t *) nullptr'),
+ ('new tmwa::magic::op_t{"name"_s, "sig"_s, nullptr}', '(op_t *) = {->name = "name", ->signature = "sig", ->op = 0x0}'),
+ ]