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

Unified Diff: tools/idl_parser/idl_parser.py

Issue 1295083004: Support FrozenArray in idl_parser.py (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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: tools/idl_parser/idl_parser.py
diff --git a/tools/idl_parser/idl_parser.py b/tools/idl_parser/idl_parser.py
index f8e509f7602f9135b55f1b1d4e17ed1f8853ea65..3dc2b53a5e8ce3f768122afa56900ec73a077df8 100755
--- a/tools/idl_parser/idl_parser.py
+++ b/tools/idl_parser/idl_parser.py
@@ -886,7 +886,8 @@ class IDLParser(object):
"""NonAnyType : PrimitiveType TypeSuffix
| PromiseType Null
| identifier TypeSuffix
- | SEQUENCE '<' Type '>' Null"""
+ | SEQUENCE '<' Type '>' Null
+ | FROZENARRAY '<' Type '>' Null"""
if len(p) == 3:
if type(p[1]) == str:
typeref = self.BuildNamed('Typeref', p, 1)
@@ -895,7 +896,8 @@ class IDLParser(object):
p[0] = ListFromConcat(typeref, p[2])
if len(p) == 6:
- p[0] = self.BuildProduction('Sequence', p, 1, ListFromConcat(p[3], p[5]))
+ cls = 'Sequence' if p[1] == 'sequence' else 'FrozenArray'
+ p[0] = self.BuildProduction(cls, p, 1, ListFromConcat(p[3], p[5]))
# [79] NOT IMPLEMENTED (BufferRelatedType)

Powered by Google App Engine
This is Rietveld 408576698