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

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

Issue 1539673003: Generate Mojom Types in Dart (Take 2) (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Move and Standardize Mojom Type Functions Created 4 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 {#--- Begin #} 1 {#--- Begin #}
2 2
3 {%- import "encoding_macros.tmpl" as encoding_macros %} 3 {%- import "encoding_macros.tmpl" as encoding_macros %}
4 {% import "mojom_type_macros.tmpl" as mojom_type_macros %}
4 5
5 {%- macro enum_def(union) %} 6 {%- macro enum_def(union) %}
6 enum {{union|name}}Tag { 7 enum {{union|name}}Tag {
7 {%- for field in union.fields %} 8 {%- for field in union.fields %}
8 {{field|name}}, 9 {{field|name}},
9 {%- endfor %} 10 {%- endfor %}
10 unknown 11 unknown
11 } 12 }
12 {%- endmacro %} 13 {%- endmacro %}
13 14
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 default: 102 default:
102 result += "unknown"; 103 result += "unknown";
103 } 104 }
104 result += ": $_data)"; 105 result += ": $_data)";
105 return result; 106 return result;
106 } 107 }
107 } 108 }
108 {%- endmacro %} 109 {%- endmacro %}
109 110
110 111
111 {%- macro union_def(union) %} 112 {%- macro union_def(union, typepkg, package) %}
112 {{enum_def(union)}} 113 {{enum_def(union)}}
113 {{wrapper_def(union)}} 114 {{wrapper_def(union)}}
115
zra 2016/01/27 18:15:12 I wonder if extra newlines like this one might be
alexfandrianto 2016/01/28 03:45:13 Done.
116 {{ mojom_type_macros.writeMojomTypeDef(union, typepkg, package) }}
114 {%- endmacro %} 117 {%- endmacro %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698