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

Unified Diff: frog/leg/scanner/byte_strings.dart

Issue 9204006: Make SourceString Iterable<int>. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 11 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 | « no previous file | frog/leg/scanner/string_scanner.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/leg/scanner/byte_strings.dart
diff --git a/frog/leg/scanner/byte_strings.dart b/frog/leg/scanner/byte_strings.dart
index 194a7f83575bff2a3c7407b4509439b6ebaca50f..4d9f068b199f71815d632fbd4166c8a0cf05819d 100644
--- a/frog/leg/scanner/byte_strings.dart
+++ b/frog/leg/scanner/byte_strings.dart
@@ -15,12 +15,15 @@ class ByteString implements SourceString {
abstract String get charset();
- String toString() => new Utf8Decoder(bytes, offset, length).toString();
+ String toString() => new String.fromCharCodes(
+ new Utf8Decoder(bytes, offset, length).decodeRest());
bool operator ==(other) {
throw "should be overridden in subclass";
}
+ Iterator<int> iterator() => new Utf8Decoder(bytes, offset, length);
+
int hashCode() {
if (_hashCode === null) {
_hashCode = computeHashCode();
« no previous file with comments | « no previous file | frog/leg/scanner/string_scanner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698