| OLD | NEW |
| 1 {#--- Begin #} | 1 {#--- Begin #} |
| 2 | 2 |
| 3 {%- import "encoding_macros.tmpl" as encoding_macros %} | 3 {%- import "encoding_macros.tmpl" as encoding_macros %} |
| 4 | 4 {%- import "mojom_type_macros.tmpl" as mojom_type_macros %} |
| 5 {%- macro enum_def(union) %} | 5 {%- macro enum_def(union) %} |
| 6 enum {{union|name}}Tag { | 6 enum {{union|name}}Tag { |
| 7 {%- for field in union.fields %} | 7 {%- for field in union.fields %} |
| 8 {{field|name}}, | 8 {{field|name}}, |
| 9 {%- endfor %} | 9 {%- endfor %} |
| 10 unknown | 10 unknown |
| 11 } | 11 } |
| 12 {%- endmacro %} | 12 {%- endmacro %} |
| 13 | 13 |
| 14 {%- macro wrapper_def(union) %} | 14 {%- macro wrapper_def(union) %} |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 default: | 101 default: |
| 102 result += "unknown"; | 102 result += "unknown"; |
| 103 } | 103 } |
| 104 result += ": $_data)"; | 104 result += ": $_data)"; |
| 105 return result; | 105 return result; |
| 106 } | 106 } |
| 107 } | 107 } |
| 108 {%- endmacro %} | 108 {%- endmacro %} |
| 109 | 109 |
| 110 | 110 |
| 111 {%- macro union_def(union) %} | 111 {%- macro union_def(union, typepkg, package) %} |
| 112 {{enum_def(union)}} | 112 {{enum_def(union)}} |
| 113 {{wrapper_def(union)}} | 113 {{wrapper_def(union)}} |
| 114 |
| 115 {% if should_gen_mojom_types -%} |
| 116 {{ mojom_type_macros.writeMojomTypeDef(union, typepkg, package) }} |
| 117 {%- endif -%} |
| 114 {%- endmacro %} | 118 {%- endmacro %} |
| OLD | NEW |