diff --git a/src/codegen.inc.php b/src/codegen.inc.php index ebd715c..5a02b0a 100644 --- a/src/codegen.inc.php +++ b/src/codegen.inc.php @@ -31,6 +31,7 @@ function supported_tokens() 'diffable', 'table_pkey', 'bhl_bind', + 'cs_embed', 'cs_implements', 'cs_attributes', 'cs_accessor_interface', diff --git a/tpl/macro.twig b/tpl/macro.twig index 6bfeecc..ed72a3f 100644 --- a/tpl/macro.twig +++ b/tpl/macro.twig @@ -31,6 +31,8 @@ {{_self.attributes(o)}} public {{_self.struct_type(o)}} {{o.name}} {{_self.base_struct_class(o)}} { + {{token(o, 'cs_embed', '')}} + {{_self.decl_struct_fields(o)}} public {{o.parent ? 'new'}} const uint STATIC_CLASS_ID = {{o.classid}}; @@ -204,9 +206,11 @@ ResetFieldMask(); : {{o.parent ? o.parent.name : 'BaseMetaStruct'}} {{- has_token(o, 'cloneable') and not o.parent ? ', IMetaCloneable' -}} {%- endif -%} -{%- for ifs in token(o, "cs_implements", "")|split(',') -%} +{%- if has_token(o, "cs_implements") -%} +{%- for ifs in token(o, "cs_implements")|split(',') -%} , {{ifs}} {%- endfor -%} +{%- endif -%} {%- for ai in get_accessor_interfaces(o) -%} , {{ai.interfacename}}