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

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

Issue 11273041: Make first and last getters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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) 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 ElementAst { 5 class ElementAst {
6 final Node ast; 6 final Node ast;
7 final TreeElements treeElements; 7 final TreeElements treeElements;
8 8
9 ElementAst(this.ast, this.treeElements); 9 ElementAst(this.ast, this.treeElements);
10 10
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 // TODO(smok): Figure out if there is a better way to fill local 230 // TODO(smok): Figure out if there is a better way to fill local
231 // members. 231 // members.
232 element.parseNode(compiler); 232 element.parseNode(compiler);
233 for (final member in classElement.localMembers) { 233 for (final member in classElement.localMembers) {
234 final name = member.name.slowToString(); 234 final name = member.name.slowToString();
235 // Skip operator names. 235 // Skip operator names.
236 if (name.startsWith(r'operator$')) continue; 236 if (name.startsWith(r'operator$')) continue;
237 // Fetch name of named constructors and factories if any, 237 // Fetch name of named constructors and factories if any,
238 // otherwise store regular name. 238 // otherwise store regular name.
239 // TODO(antonm): better way to analyze the name. 239 // TODO(antonm): better way to analyze the name.
240 fixedMemberNames.add(name.split(r'$').last()); 240 fixedMemberNames.add(name.split(r'$').last);
241 } 241 }
242 } 242 }
243 // Even class names are added due to a delicate problem we have: 243 // Even class names are added due to a delicate problem we have:
244 // if one imports dart:core with a prefix, we cannot tell prefix.name 244 // if one imports dart:core with a prefix, we cannot tell prefix.name
245 // from dynamic invocation (alas!). So we'd better err on preserving 245 // from dynamic invocation (alas!). So we'd better err on preserving
246 // those names. 246 // those names.
247 fixedMemberNames.add(element.name.slowToString()); 247 fixedMemberNames.add(element.name.slowToString());
248 }); 248 });
249 } 249 }
250 // TODO(antonm): TypeError.srcType and TypeError.dstType are defined in 250 // TODO(antonm): TypeError.srcType and TypeError.dstType are defined in
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 } 536 }
537 537
538 compareElements(e0, e1) { 538 compareElements(e0, e1) {
539 int result = compareBy((e) => e.getLibrary().uri.toString())(e0, e1); 539 int result = compareBy((e) => e.getLibrary().uri.toString())(e0, e1);
540 if (result != 0) return result; 540 if (result != 0) return result;
541 return compareBy((e) => e.position().charOffset)(e0, e1); 541 return compareBy((e) => e.position().charOffset)(e0, e1);
542 } 542 }
543 543
544 List<Element> sortElements(Collection<Element> elements) => 544 List<Element> sortElements(Collection<Element> elements) =>
545 sorted(elements, compareElements); 545 sorted(elements, compareElements);
OLDNEW
« no previous file with comments | « no previous file | lib/compiler/implementation/js/printer.dart » ('j') | tests/co19/co19-compiler.status » ('J')

Powered by Google App Engine
This is Rietveld 408576698