summaryrefslogtreecommitdiffstats
path: root/dimension
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-04-18 17:42:48 -0400
committerTavian Barnes <tavianator@gmail.com>2010-04-18 17:42:48 -0400
commit6437ab96674accfb5d5d85066e58d20887c926d7 (patch)
tree8a0b3e48db23f9dd4b851410e054d56319b63be3 /dimension
parentcafde402d15049e71eaa3f19e9fee58aa1b7c580 (diff)
downloaddimension-6437ab96674accfb5d5d85066e58d20887c926d7.tar.xz
Support objects in object{} blocks.
Diffstat (limited to 'dimension')
-rw-r--r--dimension/common.rules22
1 files changed, 22 insertions, 0 deletions
diff --git a/dimension/common.rules b/dimension/common.rules
index a50d800..cba3669 100644
--- a/dimension/common.rules
+++ b/dimension/common.rules
@@ -176,6 +176,28 @@ OBJECT: FINITE_SOLID_OBJECT
}
}
}
+ | "object" "{"
+ OBJECT
+ OBJECT_MODIFIERS
+ "}"
+ {
+ $$ = $3;
+
+ dmnsn_astnode modifiers;
+ dmnsn_array_get($$.children,
+ dmnsn_array_size($$.children) - 1,
+ &modifiers);
+
+ unsigned int i;
+ for (i = 0; i < dmnsn_array_size($4.children); ++i) {
+ dmnsn_astnode astnode;
+ dmnsn_array_get($4.children, i, &astnode);
+ ++*astnode.refcount;
+ dmnsn_array_push(modifiers.children, &astnode);
+ }
+
+ dmnsn_delete_astnode($4);
+ }
;
FINITE_SOLID_OBJECT: BOX