| 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.test_support; | 8 library engine.test_support; |
| 9 | 9 |
| 10 import 'dart:collection'; | 10 import 'dart:collection'; |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 return writer.toString(); | 431 return writer.toString(); |
| 432 } | 432 } |
| 433 | 433 |
| 434 /** | 434 /** |
| 435 * @return the [AstNode] with requested type at offset of the "prefix". | 435 * @return the [AstNode] with requested type at offset of the "prefix". |
| 436 */ | 436 */ |
| 437 static AstNode findNode(AstNode root, String code, String prefix, | 437 static AstNode findNode(AstNode root, String code, String prefix, |
| 438 Predicate<AstNode> predicate) { | 438 Predicate<AstNode> predicate) { |
| 439 int offset = code.indexOf(prefix); | 439 int offset = code.indexOf(prefix); |
| 440 if (offset == -1) { | 440 if (offset == -1) { |
| 441 throw new IllegalArgumentException("Not found '${prefix}'."); | 441 throw new IllegalArgumentException("Not found '$prefix'."); |
| 442 } | 442 } |
| 443 AstNode node = new NodeLocator.con1(offset).searchWithin(root); | 443 AstNode node = new NodeLocator.con1(offset).searchWithin(root); |
| 444 return node.getAncestor(predicate); | 444 return node.getAncestor(predicate); |
| 445 } | 445 } |
| 446 | 446 |
| 447 /** | 447 /** |
| 448 * Calculate the offset where the given strings differ. | 448 * Calculate the offset where the given strings differ. |
| 449 * | 449 * |
| 450 * @param str1 the first String to compare | 450 * @param str1 the first String to compare |
| 451 * @param str2 the second String to compare | 451 * @param str2 the second String to compare |
| (...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1005 void getContentsToReceiver(Source_ContentReceiver receiver) { | 1005 void getContentsToReceiver(Source_ContentReceiver receiver) { |
| 1006 throw new UnsupportedOperationException(); | 1006 throw new UnsupportedOperationException(); |
| 1007 } | 1007 } |
| 1008 Source resolve(String uri) { | 1008 Source resolve(String uri) { |
| 1009 throw new UnsupportedOperationException(); | 1009 throw new UnsupportedOperationException(); |
| 1010 } | 1010 } |
| 1011 Uri resolveRelativeUri(Uri uri) { | 1011 Uri resolveRelativeUri(Uri uri) { |
| 1012 return new Uri(scheme: 'file', path: _name).resolveUri(uri); | 1012 return new Uri(scheme: 'file', path: _name).resolveUri(uri); |
| 1013 } | 1013 } |
| 1014 } | 1014 } |
| OLD | NEW |