Index: mojo/public/tools/bindings/generators/go_templates/mojom_util_macros.tmpl |
diff --git a/mojo/public/tools/bindings/generators/go_templates/mojom_util_macros.tmpl b/mojo/public/tools/bindings/generators/go_templates/mojom_util_macros.tmpl |
new file mode 100644 |
index 0000000000000000000000000000000000000000..3e87f69cf356f2d2511244b67d50978c17b9d24d |
--- /dev/null |
+++ b/mojo/public/tools/bindings/generators/go_templates/mojom_util_macros.tmpl |
@@ -0,0 +1,33 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+{%- macro typeName(t, typepkg, pkg) -%} |
+{%- if t|is_enum -%} |
+{{enumName(t, typepkg, pkg)}} |
+{%- elif t|is_struct -%} |
+{{structName(t, typepkg, pkg)}} |
+{%- elif t|is_union -%} |
+{{unionName(t, typepkg, pkg)}} |
+{%- elif t|is_interface -%} |
+{{interfaceName(t, typepkg, pkg)}} |
+{%- else -%} |
+BAD TYPE NAME GIVEN |
+{%- endif -%} |
+{%- endmacro -%} |
+ |
+{%- macro enumName(t, typepkg, pkg) -%} |
+MojomEnum{{t|identifier(pkg)}}__ |
+{%- endmacro -%} |
+ |
+{%- macro structName(t, typepkg, pkg) -%} |
+MojomStruct{{t|identifier(pkg)}}__ |
+{%- endmacro -%} |
+ |
+{%- macro unionName(t, typepkg, pkg) -%} |
+MojomUnion{{t|identifier(pkg)}}__ |
+{%- endmacro -%} |
+ |
+{%- macro interfaceName(t, typepkg, pkg) -%} |
+MojomInterface{{t|identifier(pkg)}}__ |
+{%- endmacro -%} |