Index: ppapi/generators/idl_ast.py |
=================================================================== |
--- ppapi/generators/idl_ast.py (revision 97169) |
+++ ppapi/generators/idl_ast.py (working copy) |
@@ -78,7 +78,6 @@ |
if node.IsA('File'): |
node.SetProperty('FILE', node) |
- |
# If this node has a TYPEREF, resolve it to a version list |
typeref = node.property_node.GetPropertyLocal('TYPEREF') |
if typeref: |
@@ -90,7 +89,15 @@ |
return filenode |
+class IDLReleaseResolver(IDLVisitor): |
+ def VisitFilter(self, node, data): |
+ return node.IsA('AST','File', 'Label') |
+ def Depart(self, node, data, childdata): |
+ if node.IsA('Label'): |
+ return set([child.name for child in GetListOf('LabelItem')]) |
+ return childdata |
+ |
class IDLVersionMapDefault(IDLVersionMap): |
def GetRelease(self, version): |
return 'M13' |
@@ -116,15 +123,6 @@ |
builtin = filenode |
break |
-# if not builtin: |
-# builtin = IDLFile('pp_stdint.idl', []) |
-# extranodes = [builtin] |
- |
-# for name in BuiltIn: |
-# nameattr = IDLAttribute('NAME', name) |
-# typenode = IDLNode('Type', 'BuiltIn', 1, 0, [nameattr]) |
-# builtin.AddChild(typenode) |
- |
IDLNode.__init__(self, 'AST', 'BuiltIn', 1, 0, extranodes + children) |
self.SetProperty('LABEL', IDLVersionMapDefault()) |
self.Resolve() |
@@ -135,6 +133,13 @@ |
IDLNamespaceLabelResolver().Visit(self, self.namespace) |
IDLFileTypeResolver().Visit(self, None) |
+ # Build an ordered list of all releases |
+ self.releases = set() |
+ for filenode in self.GetListOf('File'): |
+ vmap = filenode.GetProperty('LABEL') |
+ self.releases |= set(vmap.releases) |
+ self.releases = sorted(self.releases) |
+ |
def SetTypeInfo(self, name, properties): |
node = self.namespace[name] |
for prop in properties: |