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

Unified Diff: ppapi/generators/idl_ast.py

Issue 7715036: More multi-version support (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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 | « no previous file | ppapi/generators/idl_c_header.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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:
« no previous file with comments | « no previous file | ppapi/generators/idl_c_header.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698