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

Unified Diff: lib/compiler/implementation/string_validator.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: 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/string_validator.dart
diff --git a/lib/compiler/implementation/string_validator.dart b/lib/compiler/implementation/string_validator.dart
index 2951f568f32714caa873d66d6bdad8897d202920..076b2b18a7faae85f67a9f6c791d86d6e64041f6 100644
--- a/lib/compiler/implementation/string_validator.dart
+++ b/lib/compiler/implementation/string_validator.dart
@@ -58,16 +58,16 @@ class StringValidator {
// If it only have two, the string must be an empty string literal,
// and end after the second quote.
bool multiline = false;
- if (source.hasNext() && identical(source.next(), quoteChar) && source.hasNext()) {
+ if (source.hasNext && identical(source.next(), quoteChar) && source.hasNext) {
Mads Ager (google) 2012/10/22 08:12:06 Not your code, but could you reformat to keep with
floitsch 2012/10/24 13:02:47 https://codereview.chromium.org/11233035/
int code = source.next();
assert(identical(code, quoteChar)); // If not, there is a bug in the parser.
quoteLength = 3;
// Check if a multiline string starts with a newline (CR, LF or CR+LF).
- if (source.hasNext()) {
+ if (source.hasNext) {
code = source.next();
if (identical(code, $CR)) {
quoteLength += 1;
- if (source.hasNext() && identical(source.next(), $LF)) {
+ if (source.hasNext && identical(source.next(), $LF)) {
quoteLength += 1;
}
} else if (identical(code, $LF)) {
@@ -96,13 +96,13 @@ class StringValidator {
int length = 0;
int index = startOffset;
bool containsEscape = false;
- for(Iterator<int> iter = string.iterator(); iter.hasNext(); length++) {
+ for(Iterator<int> iter = string.iterator(); iter.hasNext; length++) {
index++;
int code = iter.next();
if (identical(code, $BACKSLASH)) {
if (quoting.raw) continue;
containsEscape = true;
- if (!iter.hasNext()) {
+ if (!iter.hasNext) {
stringParseError("Incomplete escape sequence",token, index);
return null;
}
@@ -110,7 +110,7 @@ class StringValidator {
code = iter.next();
if (identical(code, $x)) {
for (int i = 0; i < 2; i++) {
- if (!iter.hasNext()) {
+ if (!iter.hasNext) {
stringParseError("Incomplete escape sequence", token, index);
return null;
}

Powered by Google App Engine
This is Rietveld 408576698