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

Side by Side Diff: mojo/public/tools/bindings/pylib/mojom/parse/translate.py

Issue 844433003: Revert "Generate some of the C++ bindings for mojom tagged unions." (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 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 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 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 """Translates parse tree to Mojom IR.""" 5 """Translates parse tree to Mojom IR."""
6 6
7 7
8 from . import ast 8 from . import ast
9 9
10 10
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 145
146 assert isinstance(tree, ast.Mojom) 146 assert isinstance(tree, ast.Mojom)
147 self.mojom['name'] = name 147 self.mojom['name'] = name
148 self.mojom['namespace'] = tree.module.name[1] if tree.module else '' 148 self.mojom['namespace'] = tree.module.name[1] if tree.module else ''
149 self.mojom['imports'] = \ 149 self.mojom['imports'] = \
150 [{'filename': imp.import_filename} for imp in tree.import_list] 150 [{'filename': imp.import_filename} for imp in tree.import_list]
151 self.mojom['attributes'] = \ 151 self.mojom['attributes'] = \
152 _AttributeListToDict(tree.module.attribute_list) if tree.module else {} 152 _AttributeListToDict(tree.module.attribute_list) if tree.module else {}
153 self.mojom['structs'] = \ 153 self.mojom['structs'] = \
154 _MapTreeForType(StructToDict, tree.definition_list, ast.Struct) 154 _MapTreeForType(StructToDict, tree.definition_list, ast.Struct)
155 self.mojom['unions'] = \ 155 self.mojom['union'] = \
156 _MapTreeForType(UnionToDict, tree.definition_list, ast.Union) 156 _MapTreeForType(UnionToDict, tree.definition_list, ast.Union)
157 self.mojom['interfaces'] = \ 157 self.mojom['interfaces'] = \
158 _MapTreeForType(InterfaceToDict, tree.definition_list, ast.Interface) 158 _MapTreeForType(InterfaceToDict, tree.definition_list, ast.Interface)
159 self.mojom['enums'] = \ 159 self.mojom['enums'] = \
160 _MapTreeForType(_EnumToDict, tree.definition_list, ast.Enum) 160 _MapTreeForType(_EnumToDict, tree.definition_list, ast.Enum)
161 self.mojom['constants'] = \ 161 self.mojom['constants'] = \
162 _MapTreeForType(_ConstToDict, tree.definition_list, ast.Const) 162 _MapTreeForType(_ConstToDict, tree.definition_list, ast.Const)
163 return self.mojom 163 return self.mojom
164 164
165 165
166 def Translate(tree, name): 166 def Translate(tree, name):
167 return _MojomBuilder().Build(tree, name) 167 return _MojomBuilder().Build(tree, name)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698