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

Side by Side Diff: frog/leg/util/link_implementation.dart

Issue 8515024: Require legacy form of type parameters in factories and report errors if a factory class does not... (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 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
« no previous file with comments | « no previous file | runtime/vm/parser.h » ('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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 LinkFactory { 5 class LinkFactory {
6 factory Link(head, [Link tail]) { 6 factory Link(head, [Link tail]) {
7 return new LinkEntry(head, (tail === null) ? const LinkTail() : tail); 7 return new LinkEntry(head, (tail === null) ? const LinkTail() : tail);
8 } 8 }
9 9
10 factory Link.fromList(List list) { 10 factory Link.fromList(List list) {
(...skipping 16 matching lines...) Expand all
27 } 27 }
28 28
29 class AbstractLink<T> implements Link<T> { 29 class AbstractLink<T> implements Link<T> {
30 T get head() { throw "bug"; } // TODO(ahe): Work around VM bug. 30 T get head() { throw "bug"; } // TODO(ahe): Work around VM bug.
31 T get tail() { throw "bug"; } // TODO(ahe): Work around VM bug. 31 T get tail() { throw "bug"; } // TODO(ahe): Work around VM bug.
32 abstract List<T> toList(); // TODO(ahe): Work around Frog bug #318. 32 abstract List<T> toList(); // TODO(ahe): Work around Frog bug #318.
33 abstract bool isEmpty(); // TODO(ahe): Work around Frog bug #318. 33 abstract bool isEmpty(); // TODO(ahe): Work around Frog bug #318.
34 34
35 const AbstractLink(); 35 const AbstractLink();
36 36
37 Link<T> prepend(T element) { 37 Link prepend(T element) {
38 return new Link<T>(element, this); 38 return new Link(element, this);
39 } 39 }
40 40
41 Iterator<T> iterator() => toList().iterator(); 41 Iterator<T> iterator() => toList().iterator();
42 42
43 void printOn(StringBuffer buffer, [separatedBy]) { 43 void printOn(StringBuffer buffer, [separatedBy]) {
44 if (isEmpty()) return; 44 if (isEmpty()) return;
45 // TODO(ngeofray): Work around Frog bug 45 // TODO(ngeofray): Work around Frog bug
46 buffer.add(head === null ? 'null' : head); 46 buffer.add(head === null ? 'null' : head);
47 if (separatedBy === null) separatedBy = ''; 47 if (separatedBy === null) separatedBy = '';
48 for (Link link = tail; !link.isEmpty(); link = link.tail) { 48 for (Link link = tail; !link.isEmpty(); link = link.tail) {
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 void addLast(T t) { 115 void addLast(T t) {
116 LinkEntry<T> entry = new LinkEntry<T>(t, null); 116 LinkEntry<T> entry = new LinkEntry<T>(t, null);
117 if (head === null) { 117 if (head === null) {
118 head = entry; 118 head = entry;
119 } else { 119 } else {
120 lastLink.realTail = entry; 120 lastLink.realTail = entry;
121 } 121 }
122 lastLink = entry; 122 lastLink = entry;
123 } 123 }
124 } 124 }
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698