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

Unified Diff: client/dom/scripts/idlnode.py

Issue 9466036: Fix parsing of DOMString[] in IDL (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 10 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 | « client/dom/scripts/fremontcutbuilder.py ('k') | client/dom/scripts/idlparser.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/dom/scripts/idlnode.py
diff --git a/client/dom/scripts/idlnode.py b/client/dom/scripts/idlnode.py
index 626a7233e4389ab4e94d7f2248348a46e58d2f46..805decc7034e31843bc18b96b5dff69fc17e58af 100755
--- a/client/dom/scripts/idlnode.py
+++ b/client/dom/scripts/idlnode.py
@@ -320,28 +320,29 @@ class IDLType(IDLNode):
for childAst in ast:
(label, childAst) = childAst
if label.endswith('Type'):
- self.id = self.__label_to_type(label, ast)
+ self.id = self._label_to_type(label, ast)
break
elif isinstance(ast, tuple):
(label, value) = ast
if label == 'ScopedName':
self.id = value
else:
- self.id = self.__label_to_type(label, ast)
+ self.id = self._label_to_type(label, ast)
elif isinstance(ast, str):
self.id = ast
if not self.id:
raise SyntaxError('Could not parse type %s' % (ast))
- def __label_to_type(self, label, ast):
- if label.endswith('Type'):
+ def _label_to_type(self, label, ast):
+ if label == 'AnyArrayType':
+ return 'any[]'
+ if label == 'DOMStringArrayType':
+ return 'DOMString[]'
+ if label == 'LongLongType':
+ label = 'long long'
+ elif label.endswith('Type'):
# Omit 'Type' suffix and lowercase the rest.
label = '%s%s' % (label[0].lower(), label[1:-4])
- if label == 'longLong':
- # Special case for LongLongType:
- label = 'long long'
- if label == 'anyArray':
- label = 'any[]'
# Add unsigned qualifier.
if self._has(ast, 'Unsigned'):
« no previous file with comments | « client/dom/scripts/fremontcutbuilder.py ('k') | client/dom/scripts/idlparser.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698