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

Side by Side Diff: mojo/public/tools/bindings/generators/go_templates/mojom_util_macros.tmpl

Issue 1345263002: Generate Mojom Types in Go (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 3 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 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 {%- macro typeName(t, typepkg, pkg) -%}
6 {%- if t|is_enum -%}
7 {{enumName(t, typepkg, pkg)}}
8 {%- elif t|is_struct -%}
9 {{structName(t, typepkg, pkg)}}
10 {%- elif t|is_union -%}
11 {{unionName(t, typepkg, pkg)}}
12 {%- elif t|is_interface -%}
13 {{interfaceName(t, typepkg, pkg)}}
14 {%- else -%}
15 BAD TYPE NAME GIVEN
16 {%- endif -%}
17 {%- endmacro -%}
18
19 {%- macro enumName(t, typepkg, pkg) -%}
20 MojomEnum{{t|identifier(pkg)}}__
21 {%- endmacro -%}
22
23 {%- macro structName(t, typepkg, pkg) -%}
24 MojomStruct{{t|identifier(pkg)}}__
25 {%- endmacro -%}
26
27 {%- macro unionName(t, typepkg, pkg) -%}
28 MojomUnion{{t|identifier(pkg)}}__
29 {%- endmacro -%}
30
31 {%- macro interfaceName(t, typepkg, pkg) -%}
32 MojomInterface{{t|identifier(pkg)}}__
33 {%- endmacro -%}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698