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

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
« lib/html/scripts/generator.py ('K') | « 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..1f3f288028d858b3ebf9f81d2c60ec576c0d190d 100755
--- a/lib/html/scripts/idlnode.py
+++ b/lib/html/scripts/idlnode.py
@@ -317,11 +317,19 @@ 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)
podivilov 2012/09/13 13:01:57 The new code is very hard to read. Please replace
Anton Muhin 2012/09/13 13:10:47 Sorry, do not quite follow, may you provide some m
- break
+ def findType(ast):
+ for childAst in ast:
podivilov 2012/09/13 14:01:39 nit: for (label, childAst) in ast
Anton Muhin 2012/09/13 14:47:53 There are some technical issues with it, but as yo
+ (label, childAst) = childAst
+ if label.endswith('Type'):
+ type = self._label_to_type(label, ast)
+ if type == 'sequence':
podivilov 2012/09/13 14:01:39 Please move this code out of the loop and use earl
+ type_ast = self._find_first(childAst, 'Type')
+ if type_ast:
+ type_argument = findType(type_ast)
+ if type_argument:
+ type = 'sequence<%s>' % type_argument
+ return type
+ self.id = findType(ast)
array_modifiers = self._find_first(ast, 'ArrayModifiers')
if array_modifiers:
self.id += array_modifiers
« lib/html/scripts/generator.py ('K') | « lib/html/scripts/generator.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698