| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // This code was auto-generated, is not intended to be edited, and is subject to | 5 // This code was auto-generated, is not intended to be edited, and is subject to |
| 6 // significant change. Please see the README file for more information. | 6 // significant change. Please see the README file for more information. |
| 7 | 7 |
| 8 library engine.source; | 8 library engine.source; |
| 9 | 9 |
| 10 import 'java_core.dart'; | 10 import 'java_core.dart'; |
| (...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 604 /** | 604 /** |
| 605 * @return the instance of [SourceRange] with end moved on "delta". | 605 * @return the instance of [SourceRange] with end moved on "delta". |
| 606 */ | 606 */ |
| 607 SourceRange getMoveEnd(int delta) => new SourceRange(offset, length + delta); | 607 SourceRange getMoveEnd(int delta) => new SourceRange(offset, length + delta); |
| 608 | 608 |
| 609 /** | 609 /** |
| 610 * @return the expanded translated of [SourceRange], with moved start and the
same length. | 610 * @return the expanded translated of [SourceRange], with moved start and the
same length. |
| 611 */ | 611 */ |
| 612 SourceRange getTranslated(int delta) => new SourceRange(offset + delta, length
); | 612 SourceRange getTranslated(int delta) => new SourceRange(offset + delta, length
); |
| 613 | 613 |
| 614 /** |
| 615 * @return the minimal [SourceRange] that cover this and the given [SourceRang
e]s. |
| 616 */ |
| 617 SourceRange getUnion(SourceRange other) { |
| 618 int newOffset = Math.min(offset, other.offset); |
| 619 int newEnd = Math.max(offset + length, other.offset + other.length); |
| 620 return new SourceRange(newOffset, newEnd - newOffset); |
| 621 } |
| 622 |
| 614 @override | 623 @override |
| 615 int get hashCode => 31 * offset + length; | 624 int get hashCode => 31 * offset + length; |
| 616 | 625 |
| 617 /** | 626 /** |
| 618 * @return `true` if this [SourceRange] intersects with given. | 627 * @return `true` if this [SourceRange] intersects with given. |
| 619 */ | 628 */ |
| 620 bool intersects(SourceRange other) { | 629 bool intersects(SourceRange other) { |
| 621 if (other == null) { | 630 if (other == null) { |
| 622 return false; | 631 return false; |
| 623 } | 632 } |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 857 int oldStamp = javaMapPut(_stampMap, source, newStamp); | 866 int oldStamp = javaMapPut(_stampMap, source, newStamp); |
| 858 // Occasionally, if this method is called in rapid succession, the timesta
mps are equal. | 867 // Occasionally, if this method is called in rapid succession, the timesta
mps are equal. |
| 859 // Guard against this by artificially incrementing the new timestamp | 868 // Guard against this by artificially incrementing the new timestamp |
| 860 if (newStamp == oldStamp) { | 869 if (newStamp == oldStamp) { |
| 861 _stampMap[source] = newStamp + 1; | 870 _stampMap[source] = newStamp + 1; |
| 862 } | 871 } |
| 863 return javaMapPut(_contentMap, source, contents); | 872 return javaMapPut(_contentMap, source, contents); |
| 864 } | 873 } |
| 865 } | 874 } |
| 866 } | 875 } |
| OLD | NEW |