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

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

Issue 2855263002: Mojo bindings: support generating identifers using different style rules for different target langu…
Patch Set: . Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/tools/bindings/generators/js_templates/enum_definition.tmpl
diff --git a/mojo/public/tools/bindings/generators/js_templates/enum_definition.tmpl b/mojo/public/tools/bindings/generators/js_templates/enum_definition.tmpl
index 019b1b638363e9f8bebec89a5f876536fcbc02bd..55df2f4295cb4633bea7808ceffd5d01769fac53 100644
--- a/mojo/public/tools/bindings/generators/js_templates/enum_definition.tmpl
+++ b/mojo/public/tools/bindings/generators/js_templates/enum_definition.tmpl
@@ -3,11 +3,12 @@
{%- set prev_enum = 0 %}
{%- for field in enum.fields %}
{%- if field.value %}
- {{enum_name}}.{{field.name}} = {{field.value|expression_to_text}};
+ {{enum_name}}.{{field.stylized_name}} = {{field.value|expression_to_text}};
{%- elif loop.first %}
- {{enum_name}}.{{field.name}} = 0;
+ {{enum_name}}.{{field.stylized_name}} = 0;
{%- else %}
- {{enum_name}}.{{field.name}} = {{enum_name}}.{{enum.fields[loop.index0 - 1].name}} + 1;
+ {{enum_name}}.{{field.stylized_name}} =
+ {{enum_name}}.{{enum.fields[loop.index0 - 1].stylized_name}} + 1;
{%- endif %}
{%- endfor %}
« no previous file with comments | « no previous file | mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698