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

Side by Side Diff: lib/compiler/implementation/scanner/byte_strings.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 unified diff | Download patch | Annotate | Revision Log
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 /** 5 /**
6 * An abstract string representation. 6 * An abstract string representation.
7 */ 7 */
8 class ByteString implements SourceString { 8 class ByteString implements SourceString {
9 final List<int> bytes; 9 final List<int> bytes;
10 final int offset; 10 final int offset;
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 82
83 83
84 class AsciiStringIterator implements Iterator<int> { 84 class AsciiStringIterator implements Iterator<int> {
85 final List<int> bytes; 85 final List<int> bytes;
86 int offset; 86 int offset;
87 final int end; 87 final int end;
88 AsciiStringIterator(List<int> bytes) 88 AsciiStringIterator(List<int> bytes)
89 : this.bytes = bytes, offset = 0, end = bytes.length; 89 : this.bytes = bytes, offset = 0, end = bytes.length;
90 AsciiStringIterator.range(List<int> bytes, int from, int length) 90 AsciiStringIterator.range(List<int> bytes, int from, int length)
91 : this.bytes = bytes, offset = from, end = from + length; 91 : this.bytes = bytes, offset = from, end = from + length;
92 bool hasNext() => offset < end; 92 bool get hasNext => offset < end;
93 int next() => bytes[offset++]; 93 int next() => bytes[offset++];
94 } 94 }
95 95
96 96
97 /** 97 /**
98 * A string that consists of characters that can be encoded as UTF-8. 98 * A string that consists of characters that can be encoded as UTF-8.
99 */ 99 */
100 class Utf8String extends ByteString { 100 class Utf8String extends ByteString {
101 final String charset = "UTF8"; 101 final String charset = "UTF8";
102 102
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 * A ByteString-valued token. 135 * A ByteString-valued token.
136 */ 136 */
137 class ByteStringToken extends Token { 137 class ByteStringToken extends Token {
138 final ByteString value; 138 final ByteString value;
139 139
140 ByteStringToken(PrecedenceInfo info, ByteString this.value, int charOffset) 140 ByteStringToken(PrecedenceInfo info, ByteString this.value, int charOffset)
141 : super(info, charOffset); 141 : super(info, charOffset);
142 142
143 String toString() => value.toString(); 143 String toString() => value.toString();
144 } 144 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/resolution/members.dart ('k') | lib/compiler/implementation/scanner/token.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698