Skip to content

Commit

Permalink
[#30] Implement extended members
Browse files Browse the repository at this point in the history
  • Loading branch information
Mi-La committed Dec 12, 2024
1 parent 19822bb commit 7df2621
Show file tree
Hide file tree
Showing 29 changed files with 2,275 additions and 194 deletions.
31 changes: 14 additions & 17 deletions extension/freemarker/CompoundField.inc.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
${field.name}<#t>
</#macro>

<#macro field_view_local_name field>
${field.name}_<#t>
</#macro>

<#macro field_view_type_name field>
<#if field.array??>
<@array_type_name field/><#t>
Expand All @@ -40,10 +44,6 @@
</#if>
</#macro>

<#macro field_view_getter_name field>
get${field.name?cap_first}<#t>
</#macro>

<#macro field_view_parameters field>
<#if field.array??>
<#if array_needs_owner(field)>
Expand Down Expand Up @@ -146,6 +146,16 @@
</#if>
</#macro>

<#function num_extended_fields fieldList>
<#local numExtended=0/>
<#list fieldList as field>
<#if field.isExtended>
<#local numExtended=numExtended+1/>
</#if>
</#list>
<#return numExtended>
</#function>

<#macro choice_tag_name field>
CHOICE_${field.name}<#t>
</#macro>
Expand Down Expand Up @@ -317,16 +327,3 @@ void View<${fullName}>::<@array_traits_name field/>::read(<@packing_context_type
</#if>
<#return false>
</#function>

<#function field_needs_allocator field>
<#return field.typeInfo.needsAllocator || field.optional?? || field.array??>
</#function>

<#function fields_need_allocator fieldList>
<#list fieldList as field>
<#if field_needs_allocator(field)>
<#return true>
</#if>
</#list>
<#return false>
</#function>
Loading

0 comments on commit 7df2621

Please sign in to comment.