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

Unified Diff: mojo/public/tools/bindings/pylib/mojom/generate/data.py

Issue 437643002: Support nullable types in mojom. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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
Index: mojo/public/tools/bindings/pylib/mojom/generate/data.py
diff --git a/mojo/public/tools/bindings/pylib/mojom/generate/data.py b/mojo/public/tools/bindings/pylib/mojom/generate/data.py
index d7edaabf98ef0fbe9ce2c4de1a5e7365ed0bcdbf..3ada1511c7290456163350799174fdbee8555bc4 100644
--- a/mojo/public/tools/bindings/pylib/mojom/generate/data.py
+++ b/mojo/public/tools/bindings/pylib/mojom/generate/data.py
@@ -99,7 +99,10 @@ def KindFromData(kinds, data, scope):
kind = LookupKind(kinds, data, scope)
if kind:
return kind
- if data.startswith('a:'):
+ if data.startswith('?'):
+ kind = mojom.Nullable()
+ kind.SetKind(KindFromData(kinds, data[1:], scope))
+ elif data.startswith('a:'):
kind = mojom.Array()
kind.kind = KindFromData(kinds, data[2:], scope)
elif data.startswith('r:'):

Powered by Google App Engine
This is Rietveld 408576698