Make it easy to tell apart enums
authorBoris Zbarsky <bzbarsky@mit.edu>
Sat, 11 Feb 2012 16:21:21 -0500
changeset 86753 36b356cfa9429acc28f33c0871bb2ad86c54beb4
parent 86752 c109aaca3efd5933ed09fea14e2a4c50e792b0a3
child 86754 147cdb4f2a852a96fbaa1fcae4cf3d38ceaeda1e
push id106
push userbzbarsky@mozilla.com
push dateSun, 12 Feb 2012 04:09:14 +0000
milestone13.0a1
Make it easy to tell apart enums
dom/bindings/parser/WebIDL.py
--- a/dom/bindings/parser/WebIDL.py
+++ b/dom/bindings/parser/WebIDL.py
@@ -149,16 +149,19 @@ class IDLObject(object):
         self.location = location
 
     def filename(self):
         return self.location._file
 
     def isInterface(self):
         return False
 
+    def isEnum(self):
+        return False
+
     def addExtendedAttributes(self, attrs):
         assert False # Override me!
 
 class IDLScope(IDLObject):
     def __init__(self, location, parentScope, identifier):
         IDLObject.__init__(self, location)
 
         self.parentScope = parentScope
@@ -465,16 +468,19 @@ class IDLEnum(IDLObjectWithIdentifier):
         self._values = values
 
     def values(self):
         return self._values
 
     def finish(self, scope):
         pass
 
+    def isEnum(self):
+        return True
+
     def addExtendedAttributes(self, attrs):
         assert len(attrs) == 0
 
 class IDLType(IDLObject):
     Tags = enum(
         # The integer types
         'int8',
         'uint8',