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

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

Issue 2250183003: Make the fuchsia mojo/public repo the source of truth. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 4 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
(Empty)
1 {%- macro enum_def(enum_name, enum) -%}
2 {{enum_name}} = {};
3 {%- set prev_enum = 0 %}
4 {%- for field in enum.fields %}
5 {%- if field.value %}
6 {{enum_name}}.{{field.name}} = {{field.value|expression_to_text}};
7 {%- elif loop.first %}
8 {{enum_name}}.{{field.name}} = 0;
9 {%- else %}
10 {{enum_name}}.{{field.name}} = {{enum_name}}.{{enum.fields[loop.index0 - 1].na me}} + 1;
11 {%- endif %}
12 {%- endfor %}
13 {%- endmacro %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698