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

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

Issue 611633002: mojom: Add associative arrays to the mojom language. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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/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 77e92c5b8b2065c59ebb7453aa18b7b298cce3f9..f2538b6deffaf71403f700a224c584823c609e23 100644
--- a/mojo/public/tools/bindings/pylib/mojom/parse/translate.py
+++ b/mojo/public/tools/bindings/pylib/mojom/parse/translate.py
@@ -56,6 +56,10 @@ def _MapKind(kind):
if typename.find('[') != -1:
raise Exception('Fixed sized arrays of arrays not supported')
return 'a' + kind[lbracket+1:-1] + ':' + _MapKind(typename)
+ if kind.endswith('}'):
+ lbracket = kind.rfind('{')
+ value = kind[0:lbracket]
+ return 'm[' + _MapKind(kind[lbracket+1:-1]) + '][' + _MapKind(value) + ']'
if kind.endswith('&'):
return 'r:' + _MapKind(kind[0:-1])
if kind in map_to_kind:

Powered by Google App Engine
This is Rietveld 408576698