@@ -124,8 +124,12 @@ def add(self, symbol):
124
124
self .size += symbol .size
125
125
126
126
def list_symbols (self ):
127
+ sorted_symbols = []
127
128
for symbol in self .symbols :
128
- print (" " + symbol .name + " " + str (symbol .size ))
129
+ sorted_symbols .append ((symbol .name , symbol .size ))
130
+ sorted_symbols .sort (key = lambda entry : entry [1 ], reverse = True )
131
+ for symbol in sorted_symbols :
132
+ print ("%9d %s" % (symbol [1 ], symbol [0 ]))
129
133
130
134
131
135
class Categories (object ):
@@ -229,7 +233,7 @@ def __init__(self):
229
233
self .categories = {}
230
234
self .specializations = {}
231
235
self .specialization_matcher = re .compile (
232
- r'.*generic specialization <(?P<spec_list>[^>] *)>.* of' +
236
+ r'.*generic specialization <(?P<spec_list>. *)> of' +
233
237
r' (static )?(\(extension in Swift\):)?(?P<module_name>[^.]*)\.' +
234
238
r'(?:(?P<first_type>[^.^(^<]*)\.){0,1}' +
235
239
r'(?:(?P<last_type>[^.^(^<]*)\.)*(?P<function_name>[^(^<]*)'
@@ -255,7 +259,7 @@ def __init__(self):
255
259
self .array_type_matcher = re .compile (r'Array' )
256
260
self .dictionary = re .compile (r'Array' )
257
261
self .single_specialized_types_matcher = re .compile (
258
- r'(?P<module_name>[^,^.]*)\.(?P<type_name>[^,^.]*)$'
262
+ r'(?P<module_name>[^,^.]*)\.([^,^.]*\.)*( ?P<type_name>[^,^.]*)$'
259
263
)
260
264
self .is_class_type_dict = {}
261
265
self .stdlib_and_other_type_matcher = re .compile (
0 commit comments