| Index: mojo/public/tools/bindings/generators/dart_templates/enum_definition.tmpl
|
| diff --git a/mojo/public/tools/bindings/generators/dart_templates/enum_definition.tmpl b/mojo/public/tools/bindings/generators/dart_templates/enum_definition.tmpl
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..ad5f3408d78d3ae284a1dd7cbe65fd35f06afc41
|
| --- /dev/null
|
| +++ b/mojo/public/tools/bindings/generators/dart_templates/enum_definition.tmpl
|
| @@ -0,0 +1,12 @@
|
| +{%- macro enum_def(prefix, enum) -%}
|
| +{%- set prev_enum = 0 %}
|
| +{%- for field in enum.fields %}
|
| +{%- if field.value %}
|
| +{{prefix}}const int {{enum.name}}_{{field.name}} = {{field.value|expression_to_text}};
|
| +{%- elif loop.first %}
|
| +{{prefix}}const int {{enum.name}}_{{field.name}} = 0;
|
| +{%- else %}
|
| +{{prefix}}const int {{enum.name}}_{{field.name}} = {{enum.fields[loop.index0 - 1].name}} + 1;
|
| +{%- endif %}
|
| +{%- endfor %}
|
| +{%- endmacro %}
|
|
|