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

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

Issue 1715003002: Different approach to fixing file to URI mapping. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/sdk_io.dart » ('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 library analyzer.src.generated.sdk; 5 library analyzer.src.generated.sdk;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/visitor.dart'; 10 import 'package:analyzer/dart/ast/visitor.dart';
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 } 135 }
136 136
137 /** 137 /**
138 * A map from Dart library URI's to the [SdkLibraryImpl] representing that 138 * A map from Dart library URI's to the [SdkLibraryImpl] representing that
139 * library. 139 * library.
140 */ 140 */
141 class LibraryMap { 141 class LibraryMap {
142 /** 142 /**
143 * A table mapping Dart library URI's to the library. 143 * A table mapping Dart library URI's to the library.
144 */ 144 */
145 HashMap<String, SdkLibraryImpl> _libraryMap = 145 LinkedHashMap<String, SdkLibraryImpl> _libraryMap =
146 new HashMap<String, SdkLibraryImpl>(); 146 new LinkedHashMap<String, SdkLibraryImpl>();
147 147
148 /** 148 /**
149 * Return a list containing all of the sdk libraries in this mapping. 149 * Return a list containing all of the sdk libraries in this mapping.
150 */ 150 */
151 List<SdkLibrary> get sdkLibraries => new List.from(_libraryMap.values); 151 List<SdkLibrary> get sdkLibraries => new List.from(_libraryMap.values);
152 152
153 /** 153 /**
154 * Return a list containing the library URI's for which a mapping is available . 154 * Return a list containing the library URI's for which a mapping is available .
155 */ 155 */
156 List<String> get uris => new List.from(_libraryMap.keys.toSet()); 156 List<String> get uris => _libraryMap.keys.toList();
157 157
158 /** 158 /**
159 * Return the library with the given 'dart:' [uri], or `null` if the URI does 159 * Return the library with the given 'dart:' [uri], or `null` if the URI does
160 * not map to a library. 160 * not map to a library.
161 */ 161 */
162 SdkLibrary getLibrary(String uri) => _libraryMap[uri]; 162 SdkLibrary getLibrary(String uri) => _libraryMap[uri];
163 163
164 /** 164 /**
165 * Set the library with the given 'dart:' [uri] to the given [library]. 165 * Set the library with the given 'dart:' [uri] to the given [library].
166 */ 166 */
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 _platforms |= DART2JS_PLATFORM; 445 _platforms |= DART2JS_PLATFORM;
446 } 446 }
447 447
448 /** 448 /**
449 * Record that this library can be run on the VM. 449 * Record that this library can be run on the VM.
450 */ 450 */
451 void setVmLibrary() { 451 void setVmLibrary() {
452 _platforms |= VM_PLATFORM; 452 _platforms |= VM_PLATFORM;
453 } 453 }
454 } 454 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/sdk_io.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698