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

Side by Side Diff: third_party/pkg/angular/lib/tools/source_crawler_impl.dart

Issue 257423008: Update all Angular libs (run update_all.sh). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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 library angular.source_crawler_impl; 1 library angular.source_crawler_impl;
2 2
3 import 'dart:io'; 3 import 'dart:io';
4 import 'package:analyzer/analyzer.dart'; 4 import 'package:analyzer/analyzer.dart';
5 import 'package:angular/tools/source_crawler.dart'; 5 import 'package:angular/tools/source_crawler.dart';
6 6
7 const String PACKAGE_PREFIX = 'package:'; 7 const String PACKAGE_PREFIX = 'package:';
8 8
9 /** 9 /**
10 * Dart source file crawler. As it crawls Dart source, it calls 10 * Dart source file crawler. As it crawls Dart source, it calls
(...skipping 27 matching lines...) Expand all
38 CompilationUnit cu = parseDartFile(currentFile); 38 CompilationUnit cu = parseDartFile(currentFile);
39 processImports(cu, currentDir, currentFile, visited, toVisit); 39 processImports(cu, currentDir, currentFile, visited, toVisit);
40 visitor(cu); 40 visitor(cu);
41 } 41 }
42 } 42 }
43 43
44 void processImports(CompilationUnit cu, String currentDir, 44 void processImports(CompilationUnit cu, String currentDir,
45 String currentFile, List<String> visited, 45 String currentFile, List<String> visited,
46 List<String> toVisit) { 46 List<String> toVisit) {
47 cu.directives.forEach((Directive directive) { 47 cu.directives.forEach((Directive directive) {
48 if (directive is ImportDirective || directive is PartDirective) { 48 if (directive is ImportDirective ||
49 directive is PartDirective ||
50 directive is ExportDirective) {
49 UriBasedDirective import = directive; 51 UriBasedDirective import = directive;
50 String canonicalFile = canonicalizeImportPath( 52 String canonicalFile = canonicalizeImportPath(
51 currentDir, currentFile, import.uri.stringValue); 53 currentDir, currentFile, import.uri.stringValue);
52 if (canonicalFile == null) return; 54 if (canonicalFile == null) return;
53 if (!visited.contains(canonicalFile) && 55 if (!visited.contains(canonicalFile) &&
54 !toVisit.contains(canonicalFile)) { 56 !toVisit.contains(canonicalFile)) {
55 toVisit.add(canonicalFile); 57 toVisit.add(canonicalFile);
56 } 58 }
57 } 59 }
58 }); 60 });
(...skipping 30 matching lines...) Expand all
89 } 91 }
90 92
91 String _packageUriResolver(String uri, String packageRoot) { 93 String _packageUriResolver(String uri, String packageRoot) {
92 var packagePath = uri.substring(PACKAGE_PREFIX.length); 94 var packagePath = uri.substring(PACKAGE_PREFIX.length);
93 if (!packageRoot.endsWith('/')) { 95 if (!packageRoot.endsWith('/')) {
94 packageRoot = packageRoot + '/'; 96 packageRoot = packageRoot + '/';
95 } 97 }
96 return packageRoot + packagePath; 98 return packageRoot + packagePath;
97 } 99 }
98 } 100 }
OLDNEW
« no previous file with comments | « third_party/pkg/angular/lib/tools/selector.dart ('k') | third_party/pkg/angular/lib/tools/source_metadata_extractor.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698