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

Unified Diff: mojo/public/bindings/pylib/generate/mojom_generator.py

Issue 164873002: Fix bug with using enums as default values in mojom. We were previously (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 10 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/bindings/pylib/generate/mojom_data.py ('k') | mojo/public/bindings/pylib/parse/mojo_parser.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/bindings/pylib/generate/mojom_generator.py
diff --git a/mojo/public/bindings/pylib/generate/mojom_generator.py b/mojo/public/bindings/pylib/generate/mojom_generator.py
index 24901aceda57883029d07ad760232b581c33dc1a..1148764d635c181e0de0425a675ebef2cc6f0f6e 100644
--- a/mojo/public/bindings/pylib/generate/mojom_generator.py
+++ b/mojo/public/bindings/pylib/generate/mojom_generator.py
@@ -53,6 +53,14 @@ def VerifyTokenType(token, expected):
raise Exception("Expected token type '%s'. Got '%s'." %
(expected, token[0]))
+def ExpressionMapper(expression, mapper):
+ if isinstance(expression, tuple) and expression[0] == 'EXPRESSION':
+ result = []
+ for each in expression[1]:
+ result.extend(ExpressionMapper(each, mapper))
+ return result
+ return [mapper(expression)]
+
class Generator(object):
# Pass |output_dir| to emit files to disk. Omit |output_dir| to echo all
# files to stdout.
« no previous file with comments | « mojo/public/bindings/pylib/generate/mojom_data.py ('k') | mojo/public/bindings/pylib/parse/mojo_parser.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698