Chromium Code Reviews| Index: runtime/lib/string.dart |
| diff --git a/runtime/lib/string.dart b/runtime/lib/string.dart |
| index 75f38ec3742912bc8405472298f94790cb5f7a83..7def5a571c4e2bece187dc58dd8678f16a7e496b 100644 |
| --- a/runtime/lib/string.dart |
| +++ b/runtime/lib/string.dart |
| @@ -414,6 +414,43 @@ class FourByteString extends StringBase implements String { |
| } |
| } |
| + |
| +class ExternalOneByteString extends StringBase implements String { |
| + // Checks for one-byte whitespaces only. |
| + // TODO(srdjan): Investigate if 0x85 (NEL) and 0xA0 (NBSP) are valid |
| + // whitespaces for one byte strings. |
| + bool _isWhitespace(int codePoint) { |
|
Ivan Posva
2011/11/18 19:36:44
Shouldn't this be factored out into a private stat
cshapiro
2011/11/19 01:08:29
Yes. My intention was to replace all of these met
|
| + return |
| + (codePoint === 32) || // Space. |
| + ((9 <= codePoint) && (codePoint <= 13)); // CR, LF, TAB, etc. |
| + } |
| +} |
| + |
| + |
| +class ExternalTwoByteString extends StringBase implements String { |
| + // Checks for one-byte whitespaces only. |
| + // TODO(srdjan): Investigate if 0x85 (NEL) and 0xA0 (NBSP) are valid |
| + // whitespaces. Add checking for multi-byte whitespace codepoints. |
| + bool _isWhitespace(int codePoint) { |
| + return |
| + (codePoint === 32) || // Space. |
| + ((9 <= codePoint) && (codePoint <= 13)); // CR, LF, TAB, etc. |
| + } |
| +} |
| + |
| + |
| +class ExternalFourByteString extends StringBase implements String { |
| + // Checks for one-byte whitespaces only. |
| + // TODO(srdjan): Investigate if 0x85 (NEL) and 0xA0 (NBSP) are valid |
| + // whitespaces. Add checking for multi-byte whitespace codepoints. |
| + bool _isWhitespace(int codePoint) { |
| + return |
| + (codePoint === 32) || // Space. |
| + ((9 <= codePoint) && (codePoint <= 13)); // CR, LF, TAB, etc. |
| + } |
| +} |
| + |
| + |
| class _StringMatch implements Match { |
| const _StringMatch(int this._start, |
| String this.str, |