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

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

Issue 13704011: Map enums to strings. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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 | « tools/dom/scripts/generator.py ('k') | tools/dom/scripts/idlrenderer.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/scripts/idlnode.py
diff --git a/tools/dom/scripts/idlnode.py b/tools/dom/scripts/idlnode.py
index 006006df24e2399eaa82465fcc0d966827305d58..dc57042a6a1a53f0ad66c69f747616e82177b657 100755
--- a/tools/dom/scripts/idlnode.py
+++ b/tools/dom/scripts/idlnode.py
@@ -259,6 +259,7 @@ class IDLFile(IDLNode):
self.implementsStatements = self._convert_all(ast, 'ImplStmt',
IDLImplementsStatement)
self.typeDefs = self._convert_all(ast, 'TypeDef', IDLTypeDef)
+ self.enums = self._convert_all(ast, 'Enum', IDLEnum)
for module in modules:
self.interfaces.extend(module.interfaces)
self.implementsStatements.extend(module.implementsStatements)
@@ -274,6 +275,7 @@ class IDLModule(IDLNode):
self._convert_annotations(ast)
self.interfaces = self._convert_all(ast, 'Interface', IDLInterface)
self.typeDefs = self._convert_all(ast, 'TypeDef', IDLTypeDef)
+ self.enums = self._convert_all(ast, 'Enum', IDLNode)
self.implementsStatements = self._convert_all(ast, 'ImplStmt',
IDLImplementsStatement)
@@ -378,6 +380,14 @@ class IDLType(IDLNode):
return label
+class IDLEnum(IDLNode):
+ """IDLNode for 'enum [id] { [string]+ }'"""
+ def __init__(self, ast):
+ IDLNode.__init__(self, ast)
+ self._convert_annotations(ast)
+ # TODO(antonm): save enum values.
+
+
class IDLTypeDef(IDLNode):
"""IDLNode for 'typedef [type] [id]' declarations."""
def __init__(self, ast):
« no previous file with comments | « tools/dom/scripts/generator.py ('k') | tools/dom/scripts/idlrenderer.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698