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

Unified Diff: lib/html/scripts/idlnode.py

Issue 10916286: Support proper parsing of sequence<T>. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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
« no previous file with comments | « lib/html/scripts/generator.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/html/scripts/idlnode.py
diff --git a/lib/html/scripts/idlnode.py b/lib/html/scripts/idlnode.py
index d47f58f50e6c4b78d3a9721a66e1d2e9a92c78d6..238ec8beac1156af2bfc885bc559d535e127938f 100755
--- a/lib/html/scripts/idlnode.py
+++ b/lib/html/scripts/idlnode.py
@@ -317,11 +317,18 @@ class IDLType(IDLNode):
self.id = self._find_first(ast, 'ScopedName')
if not self.id:
# FIXME: use regexp search instead
- for childAst in ast:
- (label, childAst) = childAst
- if label.endswith('Type'):
- self.id = self._label_to_type(label, ast)
- break
+ def findType(ast):
+ for label, childAst in ast:
+ if label.endswith('Type'):
+ type = self._label_to_type(label, ast)
+ if type != 'sequence':
+ return type
+ type_ast = self._find_first(childAst, 'Type')
+ if not type_ast:
+ return type
+ return 'sequence<%s>' % findType(type_ast)
+ raise Exception('No type declaration found in %s' % ast)
+ self.id = findType(ast)
array_modifiers = self._find_first(ast, 'ArrayModifiers')
if array_modifiers:
self.id += array_modifiers
« no previous file with comments | « lib/html/scripts/generator.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698