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

Side by Side Diff: tools/dom/scripts/htmldartgenerator.py

Issue 1720743005: Generation of sdk/lib files from 45 roll (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Merged with TOT 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 unified diff | Download patch
« no previous file with comments | « tools/dom/scripts/generator.py ('k') | tools/dom/scripts/htmlrenamer.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
3 # for details. All rights reserved. Use of this source code is governed by a 3 # for details. All rights reserved. Use of this source code is governed by a
4 # BSD-style license that can be found in the LICENSE file. 4 # BSD-style license that can be found in the LICENSE file.
5 5
6 """This module provides shared functionality for the system to generate 6 """This module provides shared functionality for the system to generate
7 dart:html APIs from the IDL database.""" 7 dart:html APIs from the IDL database."""
8 8
9 import emitter 9 import emitter
10 from generator import AnalyzeOperation, ConstantOutputOrder, \ 10 from generator import AnalyzeOperation, ConstantOutputOrder, \
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 # defined in the current interface as well as a parent. In that case we 125 # defined in the current interface as well as a parent. In that case we
126 # avoid making a duplicate definition and pray that the signatures match. 126 # avoid making a duplicate definition and pray that the signatures match.
127 if not self._renamer.ShouldSuppressInterface(interface): 127 if not self._renamer.ShouldSuppressInterface(interface):
128 secondary_constants = sorted(self._HoistableConstants(interface), 128 secondary_constants = sorted(self._HoistableConstants(interface),
129 ConstantOutputOrder) 129 ConstantOutputOrder)
130 for const in secondary_constants: 130 for const in secondary_constants:
131 self.AddConstant(const) 131 self.AddConstant(const)
132 132
133 secondary_parents = self._database.TransitiveSecondaryParents(interface, 133 secondary_parents = self._database.TransitiveSecondaryParents(interface,
134 not self._dart_use_blink) 134 not self._dart_use_blink)
135 remove_duplicate_parents = list(set(secondary_parents))
136 if len(secondary_parents) != len(remove_duplicate_parents):
137 secondary_parents = remove_duplicate_parents
138 parent_list = ", ".join([" %s" % (parent.id) for parent in secondary_pare nts])
139 _logger.warn('Interface %s has duplicate parent interfaces %s - ' \
140 'ignoring duplicates. Please file a bug with the dart:html te am.' % (interface.id, parent_list))
141
135 for parent_interface in sorted(secondary_parents): 142 for parent_interface in sorted(secondary_parents):
136 if isinstance(parent_interface, str): 143 if isinstance(parent_interface, str):
137 continue 144 continue
138 145
139 for attr in sorted(parent_interface.attributes, ConstantOutputOrder): 146 for attr in sorted(parent_interface.attributes, ConstantOutputOrder):
140 if not FindMatchingAttribute(interface, attr): 147 if not FindMatchingAttribute(interface, attr):
141 if attr.type.id != 'EventHandler': 148 if attr.type.id != 'EventHandler':
142 self.SecondaryContext(parent_interface) 149 self.SecondaryContext(parent_interface)
143 self.AddAttribute(attr) 150 self.AddAttribute(attr)
144 151
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after
880 def _InputType(self, type_name, info): 887 def _InputType(self, type_name, info):
881 conversion = self._InputConversion(type_name, info.declared_name) 888 conversion = self._InputConversion(type_name, info.declared_name)
882 if conversion: 889 if conversion:
883 return conversion.input_type 890 return conversion.input_type
884 else: 891 else:
885 # If typedef it's a union return dynamic. 892 # If typedef it's a union return dynamic.
886 if self._database.HasTypeDef(type_name): 893 if self._database.HasTypeDef(type_name):
887 return 'dynamic' 894 return 'dynamic'
888 else: 895 else:
889 return self._NarrowInputType(type_name) if type_name else 'dynamic' 896 return self._NarrowInputType(type_name) if type_name else 'dynamic'
OLDNEW
« no previous file with comments | « tools/dom/scripts/generator.py ('k') | tools/dom/scripts/htmlrenamer.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698