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

Side by Side Diff: lib/compiler/implementation/dart_backend/backend.dart

Issue 10837360: More generic input type. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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 | « no previous file | no next file » | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 class DartBackend extends Backend { 5 class DartBackend extends Backend {
6 final List<CompilerTask> tasks; 6 final List<CompilerTask> tasks;
7 7
8 Map<Element, TreeElements> get resolvedElements() => 8 Map<Element, TreeElements> get resolvedElements() =>
9 compiler.enqueuer.resolution.resolvedElements; 9 compiler.enqueuer.resolution.resolvedElements;
10 10
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 176
177 void collect() { 177 void collect() {
178 compiler.withCurrentElement(rootElement, () { 178 compiler.withCurrentElement(rootElement, () {
179 rootElement.parseNode(compiler).accept(this); 179 rootElement.parseNode(compiler).accept(this);
180 }); 180 });
181 } 181 }
182 } 182 }
183 183
184 compareBy(f) => (x, y) => f(x).compareTo(f(y)); 184 compareBy(f) => (x, y) => f(x).compareTo(f(y));
185 185
186 List sorted(List l, comparison) { 186 List sorted(Iterable l, comparison) {
187 final result = new List.from(l); 187 final result = new List.from(l);
188 result.sort(comparison); 188 result.sort(comparison);
189 return result; 189 return result;
190 } 190 }
191 191
192 List<Element> sortElements(Collection<Element> elements) { 192 List<Element> sortElements(Collection<Element> elements) {
193 compareElements(e0, e1) { 193 compareElements(e0, e1) {
194 int result = compareBy((e) => e.getLibrary().uri.toString())(e0, e1); 194 int result = compareBy((e) => e.getLibrary().uri.toString())(e0, e1);
195 if (result != 0) return result; 195 if (result != 0) return result;
196 return compareBy((e) => e.position().charOffset)(e0, e1); 196 return compareBy((e) => e.position().charOffset)(e0, e1);
197 } 197 }
198 198
199 return sorted(elements, compareElements); 199 return sorted(elements, compareElements);
200 } 200 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698