Chromium Code Reviews| 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 |