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

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

Issue 348673002: New analyzer snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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
« no previous file with comments | « pkg/analyzer/lib/src/generated/source.dart ('k') | pkg/analyzer/pubspec.yaml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 * relative to 363 * relative to
364 */ 364 */
365 PackageUriResolver(this._packagesDirectories) { 365 PackageUriResolver(this._packagesDirectories) {
366 if (_packagesDirectories.length < 1) { 366 if (_packagesDirectories.length < 1) {
367 throw new IllegalArgumentException("At least one package directory must be provided"); 367 throw new IllegalArgumentException("At least one package directory must be provided");
368 } 368 }
369 } 369 }
370 370
371 @override 371 @override
372 Source fromEncoding(UriKind kind, Uri uri) { 372 Source fromEncoding(UriKind kind, Uri uri) {
373 if (kind == UriKind.PACKAGE_SELF_URI || kind == UriKind.PACKAGE_URI) { 373 if (kind == UriKind.PACKAGE_URI) {
374 return new FileBasedSource.con2(new JavaFile.fromUri(uri), kind); 374 return new FileBasedSource.con2(new JavaFile.fromUri(uri), kind);
375 } 375 }
376 return null; 376 return null;
377 } 377 }
378 378
379 @override 379 @override
380 Source resolveAbsolute(Uri uri) { 380 Source resolveAbsolute(Uri uri) {
381 if (!isPackageUri(uri)) { 381 if (!isPackageUri(uri)) {
382 return null; 382 return null;
383 } 383 }
(...skipping 16 matching lines...) Expand all
400 return null; 400 return null;
401 } else { 401 } else {
402 // <pkgName>/<relPath> 402 // <pkgName>/<relPath>
403 pkgName = path.substring(0, index); 403 pkgName = path.substring(0, index);
404 relPath = path.substring(index + 1); 404 relPath = path.substring(index + 1);
405 } 405 }
406 for (JavaFile packagesDirectory in _packagesDirectories) { 406 for (JavaFile packagesDirectory in _packagesDirectories) {
407 JavaFile resolvedFile = new JavaFile.relative(packagesDirectory, path); 407 JavaFile resolvedFile = new JavaFile.relative(packagesDirectory, path);
408 if (resolvedFile.exists()) { 408 if (resolvedFile.exists()) {
409 JavaFile canonicalFile = getCanonicalFile(packagesDirectory, pkgName, re lPath); 409 JavaFile canonicalFile = getCanonicalFile(packagesDirectory, pkgName, re lPath);
410 UriKind uriKind = _isSelfReference(packagesDirectory, canonicalFile) ? U riKind.PACKAGE_SELF_URI : UriKind.PACKAGE_URI; 410 UriKind uriKind = _isSelfReference(packagesDirectory, canonicalFile) ? U riKind.FILE_URI : UriKind.PACKAGE_URI;
411 return new FileBasedSource.con2(canonicalFile, uriKind); 411 return new FileBasedSource.con2(canonicalFile, uriKind);
412 } 412 }
413 } 413 }
414 return new FileBasedSource.con2(getCanonicalFile(_packagesDirectories[0], pk gName, relPath), UriKind.PACKAGE_URI); 414 return new FileBasedSource.con2(getCanonicalFile(_packagesDirectories[0], pk gName, relPath), UriKind.PACKAGE_URI);
415 } 415 }
416 416
417 @override 417 @override
418 Uri restoreAbsolute(Source source) { 418 Uri restoreAbsolute(Source source) {
419 if (source is FileBasedSource) { 419 if (source is FileBasedSource) {
420 String sourcePath = source.file.getPath(); 420 String sourcePath = source.file.getPath();
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 for (JavaFile dir in _relativeDirectories) { 526 for (JavaFile dir in _relativeDirectories) {
527 JavaFile file = new JavaFile.relative(dir, filePath); 527 JavaFile file = new JavaFile.relative(dir, filePath);
528 if (file.exists()) { 528 if (file.exists()) {
529 return new FileBasedSource.con2(file, UriKind.FILE_URI); 529 return new FileBasedSource.con2(file, UriKind.FILE_URI);
530 } 530 }
531 } 531 }
532 } 532 }
533 return null; 533 return null;
534 } 534 }
535 } 535 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/source.dart ('k') | pkg/analyzer/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698