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

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

Issue 611633002: mojom: Add associative arrays to the mojom language. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix gn build. Created 6 years, 2 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/parser.py
diff --git a/mojo/public/tools/bindings/pylib/mojom/parse/parser.py b/mojo/public/tools/bindings/pylib/mojom/parse/parser.py
index 35ac35901e7aa0dd07a0a578646f0f1c9673df52..6afa93a3accf1d2fe478ffe91a7f92637657e9de 100644
--- a/mojo/public/tools/bindings/pylib/mojom/parse/parser.py
+++ b/mojo/public/tools/bindings/pylib/mojom/parse/parser.py
@@ -237,6 +237,7 @@ class Parser(object):
"""nonnullable_typename : basictypename
| array
| fixed_array
+ | associative_array
| interfacerequest"""
p[0] = p[1]
@@ -275,6 +276,10 @@ class Parser(object):
snippet=self._GetSnippet(p.lineno(3)))
p[0] = p[1] + "[" + p[3] + "]"
+ def p_associative_array(self, p):
+ """associative_array : typename LBRACKET identifier RBRACKET"""
+ p[0] = p[1] + "{" + p[3] + "}"
+
def p_interfacerequest(self, p):
"""interfacerequest : identifier AMP"""
p[0] = p[1] + "&"

Powered by Google App Engine
This is Rietveld 408576698