| OLD | NEW |
| 1 # Copyright 2013 the V8 project authors. All rights reserved. | 1 # Copyright 2013 the V8 project authors. All rights reserved. |
| 2 # Redistribution and use in source and binary forms, with or without | 2 # Redistribution and use in source and binary forms, with or without |
| 3 # modification, are permitted provided that the following conditions are | 3 # modification, are permitted provided that the following conditions are |
| 4 # met: | 4 # met: |
| 5 # | 5 # |
| 6 # * Redistributions of source code must retain the above copyright | 6 # * Redistributions of source code must retain the above copyright |
| 7 # notice, this list of conditions and the following disclaimer. | 7 # notice, this list of conditions and the following disclaimer. |
| 8 # * Redistributions in binary form must reproduce the above | 8 # * Redistributions in binary form must reproduce the above |
| 9 # copyright notice, this list of conditions and the following | 9 # copyright notice, this list of conditions and the following |
| 10 # disclaimer in the documentation and/or other materials provided | 10 # disclaimer in the documentation and/or other materials provided |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 return chain(*map(lambda x : x.__flatten(), keys)) | 396 return chain(*map(lambda x : x.__flatten(), keys)) |
| 397 | 397 |
| 398 @staticmethod | 398 @staticmethod |
| 399 def __disjoint_components_from_keys(encoding, keys, merge_ranges = False): | 399 def __disjoint_components_from_keys(encoding, keys, merge_ranges = False): |
| 400 return TransitionKey.__disjoint_components( | 400 return TransitionKey.__disjoint_components( |
| 401 encoding, TransitionKey.__flatten_keys(keys), merge_ranges) | 401 encoding, TransitionKey.__flatten_keys(keys), merge_ranges) |
| 402 | 402 |
| 403 @staticmethod | 403 @staticmethod |
| 404 def __disjoint_components(encoding, components, merge_ranges): | 404 def __disjoint_components(encoding, components, merge_ranges): |
| 405 range_map = {} | 405 range_map = {} |
| 406 other_keys = set([]) | 406 other_keys = set() |
| 407 for x in components: | 407 for x in components: |
| 408 if x.name() != 'NUMERIC_RANGE_KEY': | 408 if x.name() != 'NUMERIC_RANGE_KEY': |
| 409 other_keys.add(x) | 409 other_keys.add(x) |
| 410 continue | 410 continue |
| 411 (start, end) = x.args() | 411 (start, end) = x.args() |
| 412 if not start in range_map: | 412 if not start in range_map: |
| 413 range_map[start] = [] | 413 range_map[start] = [] |
| 414 range_map[start].append(end) | 414 range_map[start].append(end) |
| 415 ranges = TransitionKey.__disjoint_keys(encoding, range_map) | 415 ranges = TransitionKey.__disjoint_keys(encoding, range_map) |
| 416 if merge_ranges: | 416 if merge_ranges: |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 yield key(last[1] + 1, r[0] - 1) | 474 yield key(last[1] + 1, r[0] - 1) |
| 475 last = r | 475 last = r |
| 476 upper_bound = encoding.primary_range()[1] | 476 upper_bound = encoding.primary_range()[1] |
| 477 if last == None: | 477 if last == None: |
| 478 r = encoding.primary_range() | 478 r = encoding.primary_range() |
| 479 yield key(r[0], r[1]) | 479 yield key(r[0], r[1]) |
| 480 elif last[1] < upper_bound: | 480 elif last[1] < upper_bound: |
| 481 yield key(last[1] + 1, upper_bound) | 481 yield key(last[1] + 1, upper_bound) |
| 482 for c in sorted(classes, TransitionKey.__component_compare): | 482 for c in sorted(classes, TransitionKey.__component_compare): |
| 483 yield c | 483 yield c |
| OLD | NEW |