Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 29 matching lines...) Expand all Loading... | |
| 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 isEmpty() => length == 0; |
| 50 bool isPrivate() => !isEmpty() && bytes[offset] === $_; | |
| 51 | |
| 52 String get stringValue() => null; | |
|
kasperl
2012/04/16 13:10:46
This seems broken. Why is the string value null?
floitsch
2012/04/16 13:57:57
Peter asked me to return null.
ahe
2012/04/16 15:02:28
Which is the correct thing to do. This method only
| |
| 50 } | 53 } |
| 51 | 54 |
| 52 /** | 55 /** |
| 53 * A string that consists purely of 7bit ASCII characters. | 56 * A string that consists purely of 7bit ASCII characters. |
| 54 */ | 57 */ |
| 55 class AsciiString extends ByteString { | 58 class AsciiString extends ByteString { |
| 56 final String charset = "ASCII"; | 59 final String charset = "ASCII"; |
| 57 | 60 |
| 58 AsciiString(List<int> bytes, int offset, int length) | 61 AsciiString(List<int> bytes, int offset, int length) |
| 59 : super(bytes, offset, length); | 62 : super(bytes, offset, length); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 132 * A ByteString-valued token. | 135 * A ByteString-valued token. |
| 133 */ | 136 */ |
| 134 class ByteStringToken extends Token { | 137 class ByteStringToken extends Token { |
| 135 final ByteString value; | 138 final ByteString value; |
| 136 | 139 |
| 137 ByteStringToken(PrecedenceInfo info, ByteString this.value, int charOffset) | 140 ByteStringToken(PrecedenceInfo info, ByteString this.value, int charOffset) |
| 138 : super(info, charOffset); | 141 : super(info, charOffset); |
| 139 | 142 |
| 140 String toString() => value.toString(); | 143 String toString() => value.toString(); |
| 141 } | 144 } |
| OLD | NEW |