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

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: 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
« no previous file with comments | « lib/compiler/implementation/ssa/builder.dart ('k') | lib/compiler/implementation/tree/dartstring.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/string_validator.dart
diff --git a/lib/compiler/implementation/string_validator.dart b/lib/compiler/implementation/string_validator.dart
index 2deed37691a843b7ce39531ee69bb2b9f6acb799..a5f15e218067e6b85a39ba45c28ced379726c840 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() && source.next() == quoteChar && source.hasNext()) {
+ if (source.hasNext && source.next() == quoteChar && source.hasNext) {
int code = source.next();
assert(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 (code == $CR) {
quoteLength += 1;
- if (source.hasNext() && source.next() == $LF) {
+ if (source.hasNext && source.next() == $LF) {
quoteLength += 1;
}
} else if (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 (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 (code == $x) {
for (int i = 0; i < 2; i++) {
- if (!iter.hasNext()) {
+ if (!iter.hasNext) {
stringParseError("Incomplete escape sequence", token, index);
return null;
}
« no previous file with comments | « lib/compiler/implementation/ssa/builder.dart ('k') | lib/compiler/implementation/tree/dartstring.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698