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

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: Moved test classes to their own shared file. 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 551c04909aaed7c067bf0323e010f1ad3adbbae2..7d668f153a954983a7e10f057fead29973e0a805 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(5)))
p[0] = p[3] + "[" + p[5] + "]"
+ def p_associative_array(self, p):
+ """associative_array : MAP LANGLE identifier COMMA typename RANGLE"""
+ p[0] = p[5] + "{" + p[3] + "}"
+
def p_interfacerequest(self, p):
"""interfacerequest : identifier AMP"""
p[0] = p[1] + "&"
« no previous file with comments | « mojo/public/tools/bindings/pylib/mojom/parse/lexer.py ('k') | mojo/public/tools/bindings/pylib/mojom/parse/translate.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698