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

Unified Diff: lib/compiler/implementation/tree/dartstring.dart

Issue 11230011: Make hasNext a getter instead of a method. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove unused variable. Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: lib/compiler/implementation/tree/dartstring.dart
diff --git a/lib/compiler/implementation/tree/dartstring.dart b/lib/compiler/implementation/tree/dartstring.dart
index 0d7f70c3077b42b39976066729d05457f88c754d..468046c714b3a3edd053feef43d327e7994323aa 100644
--- a/lib/compiler/implementation/tree/dartstring.dart
+++ b/lib/compiler/implementation/tree/dartstring.dart
@@ -35,7 +35,7 @@ abstract class DartString implements Iterable<int> {
if (length != otherString.length) return false;
Iterator it1 = iterator();
Iterator it2 = otherString.iterator();
- while (it1.hasNext()) {
+ while (it1.hasNext) {
if (it1.next() != it2.next()) return false;
}
return true;
@@ -96,7 +96,7 @@ class EscapedSourceDartString extends SourceBasedDartString {
if (toStringCache != null) return toStringCache;
StringBuffer buffer = new StringBuffer();
StringEscapeIterator it = new StringEscapeIterator(source);
- while (it.hasNext()) {
+ while (it.hasNext) {
buffer.addCharCode(it.next());
}
toStringCache = buffer.toString();
@@ -134,18 +134,18 @@ class ConsDartStringIterator implements Iterator<int> {
ConsDartStringIterator(ConsDartString cons)
: current = cons.left.iterator(),
right = cons.right {
- hasNextLookAhead = current.hasNext();
+ hasNextLookAhead = current.hasNext;
if (!hasNextLookAhead) {
nextPart();
}
}
- bool hasNext() {
+ bool get hasNext {
return hasNextLookAhead;
}
int next() {
assert(hasNextLookAhead);
int result = current.next();
- hasNextLookAhead = current.hasNext();
+ hasNextLookAhead = current.hasNext;
if (!hasNextLookAhead) {
nextPart();
}
@@ -155,7 +155,7 @@ class ConsDartStringIterator implements Iterator<int> {
if (right != null) {
current = right.iterator();
right = null;
- hasNextLookAhead = current.hasNext();
+ hasNextLookAhead = current.hasNext;
}
}
}
@@ -166,7 +166,7 @@ class ConsDartStringIterator implements Iterator<int> {
class StringEscapeIterator implements Iterator<int>{
final Iterator<int> source;
StringEscapeIterator(SourceString source) : this.source = source.iterator();
- bool hasNext() => source.hasNext();
+ bool get hasNext => source.hasNext;
int next() {
int code = source.next();
if (!identical(code, $BACKSLASH)) {
« no previous file with comments | « lib/compiler/implementation/string_validator.dart ('k') | lib/compiler/implementation/types/concrete_types_inferrer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698