Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(903)

Side by Side Diff: mojo/public/tools/bindings/generators/dart_templates/enum_definition.tmpl

Issue 830593003: Update mojo sdk to rev 9fbbc4f0fef1187312316c0ed992342474e139f1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cherry-pick mojo 9d3b8dd17f12d20035a14737fdc38dd926890ff8 Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 {%- macro enum_def(prefix, enum) -%} 1 {%- macro enum_def(prefix, enum) -%}
2 {%- set prev_enum = 0 %} 2 {%- set prev_enum = 0 %}
3 {%- for field in enum.fields %} 3 {%- for field in enum.fields %}
4 {%- if field.value %} 4 {%- if field.value %}
5 {{prefix}}final int {{enum.name}}_{{field.name}} = {{field.value|expression_to_t ext}}; 5 {{prefix}}final int {{enum.name}}_{{field.name}} = {{field.value|expression_to_t ext}};
6 {%- elif loop.first %} 6 {%- elif loop.first %}
7 {{prefix}}final int {{enum.name}}_{{field.name}} = 0; 7 {{prefix}}final int {{enum.name}}_{{field.name}} = 0;
8 {%- else %} 8 {%- else %}
9 {{prefix}}final int {{enum.name}}_{{field.name}} = {{enum.fields[loop.index0 - 1 ].name}} + 1; 9 {{prefix}}final int {{enum.name}}_{{field.name}} = {{enum.name}}_{{enum.fields[l oop.index0 - 1].name}} + 1;
10 {%- endif %} 10 {%- endif %}
11 {%- endfor %} 11 {%- endfor %}
12 {%- endmacro %} 12 {%- endmacro %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698