Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(460)

Side by Side Diff: pkg/analyzer/lib/src/generated/source_io.dart

Issue 351283003: Move Tokenfactory, AstFactory and ElementFactory from tests to the testing/ Folder. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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.io; 8 library engine.source.io;
9 9
10 import 'source.dart'; 10 import 'source.dart';
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 @override 276 @override
277 bool isLocal(Source source) => source.uriKind != UriKind.DART_URI; 277 bool isLocal(Source source) => source.uriKind != UriKind.DART_URI;
278 } 278 }
279 279
280 class LocalSourcePredicate_TRUE implements LocalSourcePredicate { 280 class LocalSourcePredicate_TRUE implements LocalSourcePredicate {
281 @override 281 @override
282 bool isLocal(Source source) => true; 282 bool isLocal(Source source) => true;
283 } 283 }
284 284
285 /** 285 /**
286 * An implementation of an non-existing [Source].
287 */
288 class NonExistingSource implements Source {
289 final String _name;
290
291 final UriKind uriKind;
292
293 NonExistingSource(this._name, this.uriKind);
294
295 @override
296 bool exists() => false;
297
298 @override
299 TimestampedData<String> get contents {
300 throw new UnsupportedOperationException("${_name}does not exist.");
301 }
302
303 @override
304 String get encoding {
305 throw new UnsupportedOperationException("${_name}does not exist.");
306 }
307
308 @override
309 String get fullName => _name;
310
311 @override
312 int get modificationStamp => 0;
313
314 @override
315 String get shortName => _name;
316
317 @override
318 bool get isInSystemLibrary => false;
319
320 @override
321 Source resolveRelative(Uri relativeUri) {
322 throw new UnsupportedOperationException("${_name}does not exist.");
323 }
324 }
325
326 /**
327 * Instances of the class `PackageUriResolver` resolve `package` URI's in the co ntext of 286 * Instances of the class `PackageUriResolver` resolve `package` URI's in the co ntext of
328 * an application. 287 * an application.
329 * 288 *
330 * For the purposes of sharing analysis, the path to each package under the "pac kages" directory 289 * For the purposes of sharing analysis, the path to each package under the "pac kages" directory
331 * should be canonicalized, but to preserve relative links within a package, the remainder of the 290 * should be canonicalized, but to preserve relative links within a package, the remainder of the
332 * path from the package directory to the leaf should not. 291 * path from the package directory to the leaf should not.
333 */ 292 */
334 class PackageUriResolver extends UriResolver { 293 class PackageUriResolver extends UriResolver {
335 /** 294 /**
336 * The package directories that `package` URI's are assumed to be relative to. 295 * The package directories that `package` URI's are assumed to be relative to.
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 for (JavaFile dir in _relativeDirectories) { 485 for (JavaFile dir in _relativeDirectories) {
527 JavaFile file = new JavaFile.relative(dir, filePath); 486 JavaFile file = new JavaFile.relative(dir, filePath);
528 if (file.exists()) { 487 if (file.exists()) {
529 return new FileBasedSource.con2(file, UriKind.FILE_URI); 488 return new FileBasedSource.con2(file, UriKind.FILE_URI);
530 } 489 }
531 } 490 }
532 } 491 }
533 return null; 492 return null;
534 } 493 }
535 } 494 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/source.dart ('k') | pkg/analyzer/lib/src/generated/testing/ast_factory.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698