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

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

Issue 1635613002: [mojo-bindings] Support reuse of native enum classes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix more missing public_deps 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
« no previous file with comments | « mojo/public/tools/bindings/pylib/mojom/parse/parser.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/tools/bindings/pylib/mojom/parse/translate.py
diff --git a/mojo/public/tools/bindings/pylib/mojom/parse/translate.py b/mojo/public/tools/bindings/pylib/mojom/parse/translate.py
index e457f994b0acd7d7913a7b5422dd08b9d21af37b..86fea67a5ad495e52758c2d5e2b2f9376a1198fb 100644
--- a/mojo/public/tools/bindings/pylib/mojom/parse/translate.py
+++ b/mojo/public/tools/bindings/pylib/mojom/parse/translate.py
@@ -98,8 +98,9 @@ def _EnumToDict(enum):
return data
assert isinstance(enum, ast.Enum)
- data = {'name': enum.name,
- 'fields': map(EnumValueToDict, enum.enum_value_list)}
+ data = {'name': enum.name, 'native_only': enum.enum_value_list is None }
+ if not data['native_only']:
+ data['fields'] = map(EnumValueToDict, enum.enum_value_list)
_AddOptional(data, 'attributes', _AttributeListToDict(enum.attribute_list))
return data
« no previous file with comments | « mojo/public/tools/bindings/pylib/mojom/parse/parser.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698