| 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 * Scanner that reads from a String and creates tokens that points to | 6 * Scanner that reads from a String and creates tokens that points to |
| 7 * substrings. | 7 * substrings. |
| 8 */ | 8 */ |
| 9 class StringScanner extends ArrayBasedScanner<SourceString> { | 9 class StringScanner extends ArrayBasedScanner<SourceString> { |
| 10 final String string; | 10 final String string; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 | 62 |
| 63 SourceString copyWithoutQuotes(int initial, int terminal) { | 63 SourceString copyWithoutQuotes(int initial, int terminal) { |
| 64 assert(0 <= initial); | 64 assert(0 <= initial); |
| 65 assert(0 <= terminal); | 65 assert(0 <= terminal); |
| 66 assert(initial + terminal <= internalString.length); | 66 assert(initial + terminal <= internalString.length); |
| 67 return new SubstringWrapper(internalString, | 67 return new SubstringWrapper(internalString, |
| 68 begin + initial, end - terminal); | 68 begin + initial, end - terminal); |
| 69 } | 69 } |
| 70 | 70 |
| 71 bool isEmpty() => begin == end; | 71 bool isEmpty() => begin == end; |
| 72 |
| 73 bool isPrivate() => !isEmpty() && internalString.charCodeAt(begin) === $_; |
| 72 } | 74 } |
| OLD | NEW |