| OLD | NEW |
| 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 |
| 10 |
| 9 from systemfrog import * | 11 from systemfrog import * |
| 10 from systeminterface import * | 12 from systeminterface import * |
| 11 | 13 |
| 12 _html_strip_webkit_prefix_classes = [ | 14 _html_strip_webkit_prefix_classes = [ |
| 13 'Animation', | 15 'Animation', |
| 14 'AnimationEvent', | 16 'AnimationEvent', |
| 15 'AnimationList', | 17 'AnimationList', |
| 16 'BlobBuilder', | 18 'BlobBuilder', |
| 17 'CSSKeyframeRule', | 19 'CSSKeyframeRule', |
| 18 'CSSKeyframesRule', | 20 'CSSKeyframesRule', |
| (...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 768 class HtmlInterfacesSystem(HtmlSystem): | 770 class HtmlInterfacesSystem(HtmlSystem): |
| 769 | 771 |
| 770 def __init__(self, templates, database, emitters, output_dir, backend): | 772 def __init__(self, templates, database, emitters, output_dir, backend): |
| 771 super(HtmlInterfacesSystem, self).__init__( | 773 super(HtmlInterfacesSystem, self).__init__( |
| 772 templates, database, emitters, output_dir) | 774 templates, database, emitters, output_dir) |
| 773 self._backend = backend | 775 self._backend = backend |
| 774 self._dart_interface_file_paths = [] | 776 self._dart_interface_file_paths = [] |
| 775 self._factory_provider_emitters = {} | 777 self._factory_provider_emitters = {} |
| 776 | 778 |
| 777 def ProcessInterface(self, interface): | 779 def ProcessInterface(self, interface): |
| 778 """.""" | 780 HtmlDartInterfaceGenerator(self, interface).Generate() |
| 779 | |
| 780 self._backend.ProcessInterface(interface) | |
| 781 | |
| 782 if interface.id in _merged_html_interfaces: | |
| 783 return | |
| 784 | |
| 785 html_interface_name = self._shared._HTMLInterfaceName(interface.id) | |
| 786 dart_interface_file_path = self._FilePathForDartInterface( | |
| 787 html_interface_name) | |
| 788 | |
| 789 self._dart_interface_file_paths.append(dart_interface_file_path) | |
| 790 | |
| 791 dart_interface_code = self._emitters.FileEmitter(dart_interface_file_path) | |
| 792 | |
| 793 template_file = 'interface_%s.darttemplate' % html_interface_name | |
| 794 template = self._templates.TryLoad(template_file) | |
| 795 if not template: | |
| 796 template = self._templates.Load('interface.darttemplate') | |
| 797 | |
| 798 HtmlDartInterfaceGenerator( | |
| 799 self, interface, dart_interface_code, | |
| 800 template, self._shared).Generate() | |
| 801 | 781 |
| 802 def ProcessCallback(self, interface, info): | 782 def ProcessCallback(self, interface, info): |
| 803 """Generates a typedef for the callback interface.""" | 783 """Generates a typedef for the callback interface.""" |
| 804 interface_name = interface.id | 784 interface_name = interface.id |
| 805 file_path = self._FilePathForDartInterface(interface_name) | 785 file_path = self._FilePathForDartInterface(interface_name) |
| 806 self._ProcessCallback(interface, info, file_path) | 786 self._ProcessCallback(interface, info, file_path) |
| 807 self._backend.ProcessCallback(interface, info) | 787 self._backend.ProcessCallback(interface, info) |
| 808 | 788 |
| 809 def GenerateLibraries(self): | 789 def GenerateLibraries(self): |
| 810 self._backend.GenerateLibraries(self._dart_interface_file_paths) | 790 self._backend.GenerateLibraries(self._dart_interface_file_paths) |
| 811 | 791 |
| 812 def _FilePathForDartInterface(self, interface_name): | 792 def _FilePathForDartInterface(self, interface_name): |
| 813 """Returns the file path of the Dart interface definition.""" | 793 """Returns the file path of the Dart interface definition.""" |
| 814 # TODO(jmesserly): is this the right path | 794 # TODO(jmesserly): is this the right path |
| 815 return os.path.join(self._output_dir, 'html', 'interface', | 795 return os.path.join(self._output_dir, 'html', 'interface', |
| 816 '%s.dart' % interface_name) | 796 '%s.dart' % interface_name) |
| 817 | 797 |
| 818 # ------------------------------------------------------------------------------ | 798 # ------------------------------------------------------------------------------ |
| 819 | 799 |
| 820 # TODO(jmesserly): inheritance is probably not the right way to factor this long | 800 class HtmlDartInterfaceGenerator(BaseGenerator): |
| 821 # term, but it makes merging better for now. | 801 """Generates dart interface and implementation for the DOM IDL interface.""" |
| 822 class HtmlDartInterfaceGenerator(DartInterfaceGenerator): | |
| 823 """Generates Dart Interface definition for one DOM IDL interface.""" | |
| 824 | 802 |
| 825 def __init__(self, system, interface, emitter, template, shared): | 803 def __init__(self, system, interface): |
| 826 super(HtmlDartInterfaceGenerator, self).__init__(system, interface, | 804 super(HtmlDartInterfaceGenerator, self).__init__( |
| 827 emitter, template) | 805 system._database, interface) |
| 828 self._shared = shared | 806 self._system = system |
| 807 self._shared = system._shared |
| 829 self._html_interface_name = self._shared._HTMLInterfaceName( | 808 self._html_interface_name = self._shared._HTMLInterfaceName( |
| 830 self._interface.id) | 809 self._interface.id) |
| 810 self._backend = system._backend.ImplementationGenerator(self._interface) |
| 831 | 811 |
| 832 def StartInterface(self): | 812 def StartInterface(self): |
| 813 if not self._interface.id in _merged_html_interfaces: |
| 814 path = self._system._FilePathForDartInterface(self._html_interface_name) |
| 815 self._system._dart_interface_file_paths.append(path) |
| 816 self._interface_emitter = self._system._emitters.FileEmitter(path) |
| 817 else: |
| 818 self._interface_emitter = emitter.Emitter() |
| 819 |
| 820 template_file = 'interface_%s.darttemplate' % self._html_interface_name |
| 821 interface_template = (self._system._templates.TryLoad(template_file) or |
| 822 self._system._templates.Load('interface.darttemplate')
) |
| 823 |
| 833 typename = self._html_interface_name | 824 typename = self._html_interface_name |
| 834 | 825 |
| 835 extends = [] | 826 extends = [] |
| 836 suppressed_extends = [] | 827 suppressed_extends = [] |
| 837 | 828 |
| 838 for parent in self._interface.parents: | 829 for parent in self._interface.parents: |
| 839 # TODO(vsm): Remove source_filter. | 830 # TODO(vsm): Remove source_filter. |
| 840 if MatchSourceFilter(parent): | 831 if MatchSourceFilter(parent): |
| 841 # Parent is a DOM type. | 832 # Parent is a DOM type. |
| 842 extends.append(self._shared.DartType(parent.type.id)) | 833 extends.append(self._shared.DartType(parent.type.id)) |
| (...skipping 30 matching lines...) Expand all Loading... |
| 873 assert factory_provider == info.factory_provider_name | 864 assert factory_provider == info.factory_provider_name |
| 874 else: | 865 else: |
| 875 factory_provider = info.factory_provider_name | 866 factory_provider = info.factory_provider_name |
| 876 | 867 |
| 877 if factory_provider: | 868 if factory_provider: |
| 878 extends_str += ' default ' + factory_provider | 869 extends_str += ' default ' + factory_provider |
| 879 | 870 |
| 880 # TODO(vsm): Add appropriate package / namespace syntax. | 871 # TODO(vsm): Add appropriate package / namespace syntax. |
| 881 (self._type_comment_emitter, | 872 (self._type_comment_emitter, |
| 882 self._members_emitter, | 873 self._members_emitter, |
| 883 self._top_level_emitter) = self._emitter.Emit( | 874 self._top_level_emitter) = self._interface_emitter.Emit( |
| 884 self._template + '$!TOP_LEVEL', | 875 interface_template + '$!TOP_LEVEL', |
| 885 ID=typename, | 876 ID=typename, |
| 886 EXTENDS=extends_str) | 877 EXTENDS=extends_str) |
| 887 | 878 |
| 888 self._type_comment_emitter.Emit("/// @domName $DOMNAME", | 879 self._type_comment_emitter.Emit("/// @domName $DOMNAME", |
| 889 DOMNAME=self._interface.doc_js_name) | 880 DOMNAME=self._interface.doc_js_name) |
| 890 | 881 |
| 891 for constructor_info in constructors: | 882 for constructor_info in constructors: |
| 892 self._members_emitter.Emit( | 883 self._members_emitter.Emit( |
| 893 '\n' | 884 '\n' |
| 894 ' $CTOR($PARAMS);\n', | 885 ' $CTOR($PARAMS);\n', |
| 895 CTOR=self._shared.DartType(constructor_info.ConstructorFullName()), | 886 CTOR=self._shared.DartType(constructor_info.ConstructorFullName()), |
| 896 PARAMS=constructor_info.ParametersInterfaceDeclaration( | 887 PARAMS=constructor_info.ParametersInterfaceDeclaration( |
| 897 self._shared.DartType)); | 888 self._shared.DartType)); |
| 898 | 889 |
| 899 element_type = MaybeTypedArrayElementTypeInHierarchy( | 890 element_type = MaybeTypedArrayElementTypeInHierarchy( |
| 900 self._interface, self._system._database) | 891 self._interface, self._system._database) |
| 901 if element_type: | 892 if element_type: |
| 902 self._members_emitter.Emit( | 893 self._members_emitter.Emit( |
| 903 '\n' | 894 '\n' |
| 904 ' $CTOR(int length);\n' | 895 ' $CTOR(int length);\n' |
| 905 '\n' | 896 '\n' |
| 906 ' $CTOR.fromList(List<$TYPE> list);\n' | 897 ' $CTOR.fromList(List<$TYPE> list);\n' |
| 907 '\n' | 898 '\n' |
| 908 ' $CTOR.fromBuffer(ArrayBuffer buffer,' | 899 ' $CTOR.fromBuffer(ArrayBuffer buffer,' |
| 909 ' [int byteOffset, int length]);\n', | 900 ' [int byteOffset, int length]);\n', |
| 910 CTOR=self._interface.id, | 901 CTOR=self._interface.id, |
| 911 TYPE=self._shared.DartType(element_type)) | 902 TYPE=self._shared.DartType(element_type)) |
| 912 | 903 |
| 913 emit_events, events = self._shared.GetEventAttributes(self._interface) | 904 emit_events, events = self._shared.GetEventAttributes(self._interface) |
| 914 if not emit_events: | 905 if emit_events: |
| 915 return | 906 if events: |
| 916 elif events: | 907 self.AddEventAttributes(events) |
| 917 self.AddEventAttributes(events) | 908 else: |
| 918 else: | 909 self._EmitEventGetter(self._shared.GetParentEventsClass(self._interface)
) |
| 919 self._EmitEventGetter(self._shared.GetParentEventsClass(self._interface)) | |
| 920 | 910 |
| 921 for merged_interface in _merged_html_interfaces: | 911 for merged_interface in _merged_html_interfaces: |
| 922 if _merged_html_interfaces[merged_interface] == self._interface.id: | 912 if _merged_html_interfaces[merged_interface] == self._interface.id: |
| 923 self.AddMembers(self._database.GetInterface(merged_interface)) | 913 self.AddMembers(self._database.GetInterface(merged_interface)) |
| 924 | 914 |
| 915 # Generate implementation. |
| 916 if self._backend.HasImplementation(): |
| 917 path = self._backend.FilePathForDartImplementation() |
| 918 self._system._dart_interface_file_paths.append(path) |
| 919 implementation_emitter = self._system._emitters.FileEmitter(path) |
| 920 else: |
| 921 implementation_emitter = emitter.Emitter() |
| 922 self._backend.SetImplementationEmitter(implementation_emitter) |
| 923 self._backend.Generate() |
| 924 |
| 925 def AddAttribute(self, getter, setter): | 925 def AddAttribute(self, getter, setter): |
| 926 dom_name = DartDomNameOfAttribute(getter) | 926 dom_name = DartDomNameOfAttribute(getter) |
| 927 html_getter_name = self._shared.RenameInHtmlLibrary( | 927 html_getter_name = self._shared.RenameInHtmlLibrary( |
| 928 self._interface.id, dom_name, 'get:') | 928 self._interface.id, dom_name, 'get:') |
| 929 html_setter_name = self._shared.RenameInHtmlLibrary( | 929 html_setter_name = self._shared.RenameInHtmlLibrary( |
| 930 self._interface.id, dom_name, 'set:') | 930 self._interface.id, dom_name, 'set:') |
| 931 | 931 |
| 932 if not html_getter_name or self._shared.IsPrivate(html_getter_name): | 932 if not html_getter_name or self._shared.IsPrivate(html_getter_name): |
| 933 getter = None | 933 getter = None |
| 934 if not html_setter_name or self._shared.IsPrivate(html_setter_name): | 934 if not html_setter_name or self._shared.IsPrivate(html_setter_name): |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 974 ' $TYPE $NAME($PARAMS);\n', | 974 ' $TYPE $NAME($PARAMS);\n', |
| 975 TYPE=self._shared.DartType(info.type_name), | 975 TYPE=self._shared.DartType(info.type_name), |
| 976 NAME=html_name, | 976 NAME=html_name, |
| 977 PARAMS=info.ParametersInterfaceDeclaration( | 977 PARAMS=info.ParametersInterfaceDeclaration( |
| 978 self._shared.DartType)) | 978 self._shared.DartType)) |
| 979 | 979 |
| 980 def FinishInterface(self): | 980 def FinishInterface(self): |
| 981 pass | 981 pass |
| 982 | 982 |
| 983 def AddConstant(self, constant): | 983 def AddConstant(self, constant): |
| 984 self._EmitConstant(self._members_emitter, constant) | 984 type = TypeOrNothing(DartType(constant.type.id), constant.type.id) |
| 985 self._members_emitter.Emit('\n static final $TYPE$NAME = $VALUE;\n', |
| 986 NAME=constant.id, |
| 987 TYPE=type, |
| 988 VALUE=constant.value) |
| 985 | 989 |
| 986 def AddEventAttributes(self, event_attrs): | 990 def AddEventAttributes(self, event_attrs): |
| 987 event_attrs = DomToHtmlEvents(self._html_interface_name, event_attrs) | 991 event_attrs = DomToHtmlEvents(self._html_interface_name, event_attrs) |
| 988 self._shared._event_classes.add(self._interface.id) | 992 self._shared._event_classes.add(self._interface.id) |
| 989 events_interface = self._html_interface_name + 'Events' | 993 events_interface = self._html_interface_name + 'Events' |
| 990 self._EmitEventGetter(events_interface) | 994 self._EmitEventGetter(events_interface) |
| 991 | 995 |
| 992 events_members = self._emitter.Emit( | 996 events_members = self._interface_emitter.Emit( |
| 993 '\ninterface $INTERFACE extends $PARENTS {\n$!MEMBERS}\n', | 997 '\ninterface $INTERFACE extends $PARENTS {\n$!MEMBERS}\n', |
| 994 INTERFACE=events_interface, | 998 INTERFACE=events_interface, |
| 995 PARENTS=', '.join( | 999 PARENTS=', '.join( |
| 996 self._shared.GetParentsEventsClasses(self._interface))) | 1000 self._shared.GetParentsEventsClasses(self._interface))) |
| 997 | 1001 |
| 998 for event_name in event_attrs: | 1002 for event_name in event_attrs: |
| 999 if event_name in _html_event_names: | 1003 if event_name in _html_event_names: |
| 1000 events_members.Emit('\n EventListenerList get $NAME();\n', | 1004 events_members.Emit('\n EventListenerList get $NAME();\n', |
| 1001 NAME=_html_event_names[event_name]) | 1005 NAME=_html_event_names[event_name]) |
| 1002 else: | 1006 else: |
| (...skipping 10 matching lines...) Expand all Loading... |
| 1013 | 1017 |
| 1014 # ------------------------------------------------------------------------------ | 1018 # ------------------------------------------------------------------------------ |
| 1015 | 1019 |
| 1016 # TODO(jmesserly): inheritance is probably not the right way to factor this long | 1020 # TODO(jmesserly): inheritance is probably not the right way to factor this long |
| 1017 # term, but it makes merging better for now. | 1021 # term, but it makes merging better for now. |
| 1018 class HtmlFrogClassGenerator(FrogInterfaceGenerator): | 1022 class HtmlFrogClassGenerator(FrogInterfaceGenerator): |
| 1019 """Generates a Frog class for the dart:html library from a DOM IDL | 1023 """Generates a Frog class for the dart:html library from a DOM IDL |
| 1020 interface. | 1024 interface. |
| 1021 """ | 1025 """ |
| 1022 | 1026 |
| 1023 def __init__(self, system, interface, template, dart_code, | 1027 def __init__(self, system, interface): |
| 1024 shared): | |
| 1025 super(HtmlFrogClassGenerator, self).__init__( | 1028 super(HtmlFrogClassGenerator, self).__init__( |
| 1026 system, interface, template, dart_code) | 1029 system, interface, None, None) |
| 1027 self._shared = shared | 1030 self._shared = self._system._shared |
| 1028 self._html_interface_name = self._shared._HTMLInterfaceName( | 1031 self._html_interface_name = self._shared._HTMLInterfaceName( |
| 1029 self._interface.id) | 1032 self._interface.id) |
| 1030 | 1033 |
| 1034 def HasImplementation(self): |
| 1035 return not (IsPureInterface(self._interface.id) or |
| 1036 self._interface.id in _merged_html_interfaces) |
| 1037 |
| 1038 def FilePathForDartImplementation(self): |
| 1039 return os.path.join(self._system._output_dir, 'html', 'frog', |
| 1040 '%s.dart' % self._html_interface_name) |
| 1041 |
| 1042 def SetImplementationEmitter(self, implementation_emitter): |
| 1043 self._dart_code = implementation_emitter |
| 1044 |
| 1031 def _ImplClassName(self, type_name): | 1045 def _ImplClassName(self, type_name): |
| 1032 return self._shared._ImplClassName(type_name) | 1046 return self._shared._ImplClassName(type_name) |
| 1033 | 1047 |
| 1034 def _NarrowToImplementationType(self, type_name): | 1048 def _NarrowToImplementationType(self, type_name): |
| 1035 if self._ShouldNarrowToImplementationType(type_name): | 1049 if self._ShouldNarrowToImplementationType(type_name): |
| 1036 return self._ImplClassName(self._shared.DartType(type_name)) | 1050 return self._ImplClassName(self._shared.DartType(type_name)) |
| 1037 return self._shared.DartType(type_name) | 1051 return self._shared.DartType(type_name) |
| 1038 | 1052 |
| 1039 def StartInterface(self): | 1053 def StartInterface(self): |
| 1040 interface = self._interface | 1054 interface = self._interface |
| (...skipping 16 matching lines...) Expand all Loading... |
| 1057 | 1071 |
| 1058 extends = ' extends ' + base if base else '' | 1072 extends = ' extends ' + base if base else '' |
| 1059 | 1073 |
| 1060 # TODO: Include all implemented interfaces, including other Lists. | 1074 # TODO: Include all implemented interfaces, including other Lists. |
| 1061 implements = [self._html_interface_name] | 1075 implements = [self._html_interface_name] |
| 1062 element_type = MaybeTypedArrayElementType(self._interface) | 1076 element_type = MaybeTypedArrayElementType(self._interface) |
| 1063 if element_type: | 1077 if element_type: |
| 1064 implements.append('List<%s>' % self._shared.DartType(element_type)) | 1078 implements.append('List<%s>' % self._shared.DartType(element_type)) |
| 1065 implements.append('JavaScriptIndexingBehavior') | 1079 implements.append('JavaScriptIndexingBehavior') |
| 1066 | 1080 |
| 1081 template_file = 'impl_%s.darttemplate' % self._html_interface_name |
| 1082 template = (self._system._templates.TryLoad(template_file) or |
| 1083 self._system._templates.Load('frog_impl.darttemplate')) |
| 1067 self._members_emitter = self._dart_code.Emit( | 1084 self._members_emitter = self._dart_code.Emit( |
| 1068 self._template, | 1085 template, |
| 1069 #class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { | 1086 #class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { |
| 1070 #$!MEMBERS | 1087 #$!MEMBERS |
| 1071 #} | 1088 #} |
| 1072 CLASSNAME=self._class_name, | 1089 CLASSNAME=self._class_name, |
| 1073 EXTENDS=extends, | 1090 EXTENDS=extends, |
| 1074 IMPLEMENTS=' implements ' + ', '.join(implements), | 1091 IMPLEMENTS=' implements ' + ', '.join(implements), |
| 1075 NATIVESPEC=' native "' + native_spec + '"') | 1092 NATIVESPEC=' native "' + native_spec + '"') |
| 1076 if self._members_emitter == None: | 1093 if self._members_emitter == None: |
| 1077 raise Exception("Class %s doesn't use the $!MEMBERS variable" % | 1094 raise Exception("Class %s doesn't use the $!MEMBERS variable" % |
| 1078 self._class_name) | 1095 self._class_name) |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1343 # ------------------------------------------------------------------------------ | 1360 # ------------------------------------------------------------------------------ |
| 1344 | 1361 |
| 1345 class HtmlFrogSystem(HtmlSystem): | 1362 class HtmlFrogSystem(HtmlSystem): |
| 1346 | 1363 |
| 1347 def __init__(self, templates, database, emitters, output_dir): | 1364 def __init__(self, templates, database, emitters, output_dir): |
| 1348 super(HtmlFrogSystem, self).__init__( | 1365 super(HtmlFrogSystem, self).__init__( |
| 1349 templates, database, emitters, output_dir) | 1366 templates, database, emitters, output_dir) |
| 1350 self._dart_frog_file_paths = [] | 1367 self._dart_frog_file_paths = [] |
| 1351 self._factory_provider_emitters = {} | 1368 self._factory_provider_emitters = {} |
| 1352 | 1369 |
| 1353 def ProcessInterface(self, interface): | 1370 def ImplementationGenerator(self, interface): |
| 1354 """.""" | 1371 return HtmlFrogClassGenerator(self, interface) |
| 1355 if interface.id in _merged_html_interfaces: | |
| 1356 return None | |
| 1357 | |
| 1358 if IsPureInterface(interface.id): | |
| 1359 return | |
| 1360 | |
| 1361 html_interface_name = self._shared._HTMLInterfaceName(interface.id) | |
| 1362 template_file = 'impl_%s.darttemplate' % html_interface_name | |
| 1363 template = self._templates.TryLoad(template_file) | |
| 1364 if not template: | |
| 1365 template = self._templates.Load('frog_impl.darttemplate') | |
| 1366 | |
| 1367 dart_code = self._ImplFileEmitter(html_interface_name) | |
| 1368 generator = HtmlFrogClassGenerator(self, interface, template, | |
| 1369 dart_code, self._shared) | |
| 1370 generator.Generate() | |
| 1371 | 1372 |
| 1372 def GenerateLibraries(self, interface_files): | 1373 def GenerateLibraries(self, interface_files): |
| 1373 self._GenerateLibFile( | 1374 self._GenerateLibFile( |
| 1374 'html_frog.darttemplate', | 1375 'html_frog.darttemplate', |
| 1375 os.path.join(self._output_dir, 'html_frog.dart'), | 1376 os.path.join(self._output_dir, 'html_frog.dart'), |
| 1376 interface_files + self._dart_frog_file_paths) | 1377 interface_files + self._dart_frog_file_paths) |
| 1377 | 1378 |
| 1378 def Finish(self): | 1379 def Finish(self): |
| 1379 pass | 1380 pass |
| 1380 | 1381 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 1409 Collect(database.GetInterface(parent.type.id), | 1410 Collect(database.GetInterface(parent.type.id), |
| 1410 seen, collected) | 1411 seen, collected) |
| 1411 | 1412 |
| 1412 inheritance_closure = {} | 1413 inheritance_closure = {} |
| 1413 for interface in database.GetInterfaces(): | 1414 for interface in database.GetInterfaces(): |
| 1414 seen = set() | 1415 seen = set() |
| 1415 collected = [] | 1416 collected = [] |
| 1416 Collect(interface, seen, collected) | 1417 Collect(interface, seen, collected) |
| 1417 inheritance_closure[interface.id] = collected | 1418 inheritance_closure[interface.id] = collected |
| 1418 return inheritance_closure | 1419 return inheritance_closure |
| OLD | NEW |