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

Unified Diff: mojo/public/tools/bindings/generators/dart_templates/struct_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 side-by-side diff with in-line comments
Download patch
Index: mojo/public/tools/bindings/generators/dart_templates/struct_definition.tmpl
diff --git a/mojo/public/tools/bindings/generators/dart_templates/struct_definition.tmpl b/mojo/public/tools/bindings/generators/dart_templates/struct_definition.tmpl
index 3f3e7e1c7b167e1f5acaa5932f4a5ef9f5847125..e583bd10f39a934dae0ed0eaa8aa778eb8a7d29b 100644
--- a/mojo/public/tools/bindings/generators/dart_templates/struct_definition.tmpl
+++ b/mojo/public/tools/bindings/generators/dart_templates/struct_definition.tmpl
@@ -1,10 +1,11 @@
{#--- Begin #}
{%- import "encoding_macros.tmpl" as encoding_macros %}
-{%- macro struct_def(struct) %}
+{% import "mojom_type_macros.tmpl" as mojom_type_macros %}
+{%- macro struct_def(struct, typepkg, package) %}
{#--- Enums #}
{%- from "enum_definition.tmpl" import enum_def %}
{%- for enum in struct.enums %}
-{{enum_def(enum)}}
+{{enum_def(enum, typepkg, package)}}
{%- endfor %}
class {{struct|name}} extends bindings.Struct {
@@ -103,4 +104,6 @@ class {{struct|name}} extends bindings.Struct {
{%- endif %}
}
}
+
zra 2016/01/27 18:15:12 Extra newline?
alexfandrianto 2016/01/28 03:45:13 Done.
+{{ mojom_type_macros.writeMojomTypeDef(struct, typepkg, package) }}
{%- endmacro %}

Powered by Google App Engine
This is Rietveld 408576698