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

Side by Side Diff: lib/compiler/implementation/scanner/byte_strings.dart

Issue 11238035: Make isEmpty a getter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status file with co19 issue number. 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 28 matching lines...) Expand all
39 for (int i = offset; i < end; i++) { 39 for (int i = offset; i < end; i++) {
40 code += 19 * code + bytes[i]; 40 code += 19 * code + bytes[i];
41 } 41 }
42 return code; 42 return code;
43 } 43 }
44 44
45 printOn(StringBuffer sb) { 45 printOn(StringBuffer sb) {
46 sb.add(slowToString()); 46 sb.add(slowToString());
47 } 47 }
48 48
49 bool isEmpty() => length == 0; 49 bool get isEmpty => length == 0;
50 bool isPrivate() => !isEmpty() && identical(bytes[offset], $_); 50 bool isPrivate() => !isEmpty && identical(bytes[offset], $_);
51 51
52 String get stringValue => null; 52 String get stringValue => null;
53 } 53 }
54 54
55 /** 55 /**
56 * A string that consists purely of 7bit ASCII characters. 56 * A string that consists purely of 7bit ASCII characters.
57 */ 57 */
58 class AsciiString extends ByteString { 58 class AsciiString extends ByteString {
59 final String charset = "ASCII"; 59 final String charset = "ASCII";
60 60
(...skipping 74 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

Powered by Google App Engine
This is Rietveld 408576698