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

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

Issue 1433183002: Generate Mojom Types for Dart (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Simplify identifier_store for Go and Dart Created 5 years 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 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 {%- macro registerType(mapping, typepkg, pkg, type) -%} 5 {%- macro registerType(mapping, typepkg, pkg, type) -%}
6 {%- if type|identifier|identifier_check('RegisterType') -%}{# Already printed ou t #} 6 {%- if type|identifier|identifier_check -%}{# Already printed out #}
7 {%- elif type|package != '' -%} {# Don't print. That package will do it. #} 7 {%- elif type|package != '' -%} {# Don't print. That package will do it. #}
8 {%- else -%} 8 {%- else -%}
9 {{type|identifier|identifier_store('RegisterType')}} 9 {{type|identifier|identifier_store}}
10 10
11 {%- if type|mojom_type(typepkg) != "" -%}{#- simple kind case: do nothing -#} 11 {%- if type|mojom_type(typepkg) != "" -%}{#- simple kind case: do nothing -#}
12 {%- elif type|is_array -%} 12 {%- elif type|is_array -%}
13 {{registerType(mapping, typepkg, pkg, type.kind)}} 13 {{registerType(mapping, typepkg, pkg, type.kind)}}
14 {%- elif type|is_map -%} 14 {%- elif type|is_map -%}
15 {{registerType(mapping, typepkg, pkg, type.key_kind)}} 15 {{registerType(mapping, typepkg, pkg, type.key_kind)}}
16 {{registerType(mapping, typepkg, pkg, type.value_kind)}} 16 {{registerType(mapping, typepkg, pkg, type.value_kind)}}
17 {% elif type|is_enum %} 17 {% elif type|is_enum %}
18 {{mapping}}["{{type|mojom_type_identifier}}"] = &{{typepkg}}UserDefinedTypeEnu mType{ 18 {{mapping}}["{{type|mojom_type_identifier}}"] = &{{typepkg}}UserDefinedTypeEnu mType{
19 Value: {{type|mojom_type_identifier}}(), 19 Value: {{type|mojom_type_identifier}}(),
(...skipping 22 matching lines...) Expand all
42 {{registerType(mapping, typepkg, pkg, method.response_param_struct)}} 42 {{registerType(mapping, typepkg, pkg, method.response_param_struct)}}
43 {%- endif %} 43 {%- endif %}
44 {%- endfor %} 44 {%- endfor %}
45 {% elif type|is_interface_request -%} {# No need to register anything #} 45 {% elif type|is_interface_request -%} {# No need to register anything #}
46 {%- else -%} 46 {%- else -%}
47 ERROR: UNSUPPORTED TYPE 47 ERROR: UNSUPPORTED TYPE
48 {{type|identifier}} 48 {{type|identifier}}
49 {%- endif -%} 49 {%- endif -%}
50 {%- endif -%} 50 {%- endif -%}
51 {%- endmacro -%} 51 {%- endmacro -%}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698