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

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

Issue 1752983003: Moved ChromiumSubscribeUniform to web_gl (Closed) Base URL: git@github.com:dart-lang/sdk.git@integration
Patch Set: Merged from integration to master Created 4 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 | « tools/dom/scripts/htmlrenamer.py ('k') | tools/dom/scripts/systemhtml.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 2d8198878e9e7155386a34c1640875228951dd53..bd47e72e2f7e2c7fe08845de3be4486edb8cc80e 100755
--- a/tools/dom/scripts/idlnode.py
+++ b/tools/dom/scripts/idlnode.py
@@ -12,6 +12,18 @@ import dependency
new_asts = {}
+# Report of union types mapped to any.
+_unions_to_any = []
+
+def report_unions_to_any():
+ global _unions_to_any
+
+ warnings = []
+ for union_id in sorted(_unions_to_any):
+ warnings.append('Union type %s is mapped to \'any\'' % union_id)
+
+ return warnings
+
# Ugly but Chrome IDLs can reference typedefs in any IDL w/o an include. So we
# need to remember any typedef seen then alias any reference to a typedef.
typeDefsFixup = []
@@ -364,6 +376,8 @@ class IDLFile(IDLNode):
filename_basename = os.path.basename(filename)
+ # Report of union types mapped to any.
+
self.interfaces = self._convert_all(ast, 'Interface', IDLInterface)
self.dictionaries = self._convert_all(ast, 'Dictionary', IDLDictionary)
@@ -556,6 +570,8 @@ class IDLType(IDLNode):
StringType, VoidType, IntegerType, etc."""
def __init__(self, ast):
+ global _unions_to_any
+
IDLNode.__init__(self, ast)
if ast:
@@ -595,7 +611,9 @@ class IDLType(IDLNode):
if isinstance(ast, IdlType) or isinstance(ast, IdlArrayOrSequenceType) or \
isinstance(ast, IdlNullableType):
if isinstance(ast, IdlNullableType) and ast.inner_type.is_union_type:
- print 'WARNING type %s is union mapped to \'any\'' % self.id
+ # Report of union types mapped to any.
+ if not(self.id in _unions_to_any):
+ _unions_to_any.append(self.id)
# TODO(terry): For union types use any otherwise type is unionType is
# not found and is removed during merging.
self.id = 'any'
@@ -616,19 +634,20 @@ class IDLType(IDLNode):
else:
# IdlUnionType
if ast.is_union_type:
- print 'WARNING type %s is union mapped to \'any\'' % self.id
- # TODO(terry): For union types use any otherwise type is unionType is
- # not found and is removed during merging.
+ if not(self.id in _unions_to_any):
+ _unions_to_any.append(self.id)
+ # TODO(terry): For union types use any otherwise type is unionType is
+ # not found and is removed during merging.
self.id = 'any'
- # TODO(terry): Any union type e.g. 'type1 or type2 or type2',
- # 'typedef (Type1 or Type2) UnionType'
- # Is a problem we need to extend IDLType and IDLTypeDef to handle more
- # than one type.
- #
- # Also for typedef's e.g.,
- # typedef (Type1 or Type2) UnionType
- # should consider synthesizing a new interface (e.g., UnionType) that's
- # both Type1 and Type2.
+ # TODO(terry): Any union type e.g. 'type1 or type2 or type2',
+ # 'typedef (Type1 or Type2) UnionType'
+ # Is a problem we need to extend IDLType and IDLTypeDef to handle more
+ # than one type.
+ #
+ # Also for typedef's e.g.,
+ # typedef (Type1 or Type2) UnionType
+ # should consider synthesizing a new interface (e.g., UnionType) that's
+ # both Type1 and Type2.
if not self.id:
print '>>>> __module__ %s' % ast.__module__
raise SyntaxError('Could not parse type %s' % (ast))
« no previous file with comments | « tools/dom/scripts/htmlrenamer.py ('k') | tools/dom/scripts/systemhtml.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698