OLD | NEW |
1 {% from "module_macros.tmpl" import enum_values %} | 1 {% from "module_macros.tmpl" import enum_values %} |
2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 2014 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 import mojo.bindings.descriptor as _descriptor | 6 import mojo.bindings.descriptor as _descriptor |
7 import mojo.bindings.reflection as _reflection | 7 import mojo.bindings.reflection as _reflection |
8 {% if imports %} | 8 {% if imports %} |
9 | 9 |
10 {% for import in imports %} | 10 {% for import in imports %} |
(...skipping 28 matching lines...) Expand all Loading... |
39 {% if struct.enums %} | 39 {% if struct.enums %} |
40 'enums': { | 40 'enums': { |
41 {% for enum in struct.enums %} | 41 {% for enum in struct.enums %} |
42 '{{enum|name}}': {{enum_values(enum)|indent(6)}}, | 42 '{{enum|name}}': {{enum_values(enum)|indent(6)}}, |
43 {% endfor %} | 43 {% endfor %} |
44 }, | 44 }, |
45 {% endif %} | 45 {% endif %} |
46 {% if struct.fields %} | 46 {% if struct.fields %} |
47 'fields': [ | 47 'fields': [ |
48 {% for byte in struct.bytes %} | 48 {% for byte in struct.bytes %} |
49 {% for packed_field in byte.packed_fields %} | 49 {% if byte.packed_fields %} |
50 {{packed_field|field_descriptor}}, | 50 {{byte|field_group}}, |
51 {% endfor %} | 51 {% endif %} |
52 {% endfor %} | 52 {% endfor %} |
53 ], | 53 ], |
54 {% endif %} | 54 {% endif %} |
55 } | 55 } |
56 {% endfor %} | 56 {% endfor %} |
OLD | NEW |