| 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 part of scanner; |
| 6 |
| 5 /** | 7 /** |
| 6 * Scanner that reads from a String and creates tokens that points to | 8 * Scanner that reads from a String and creates tokens that points to |
| 7 * substrings. | 9 * substrings. |
| 8 */ | 10 */ |
| 9 class StringScanner extends ArrayBasedScanner<SourceString> { | 11 class StringScanner extends ArrayBasedScanner<SourceString> { |
| 10 final String string; | 12 final String string; |
| 11 | 13 |
| 12 StringScanner(String this.string, {bool includeComments: false}) | 14 StringScanner(String this.string, {bool includeComments: false}) |
| 13 : super(includeComments); | 15 : super(includeComments); |
| 14 | 16 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 assert(0 <= terminal); | 68 assert(0 <= terminal); |
| 67 assert(initial + terminal <= internalString.length); | 69 assert(initial + terminal <= internalString.length); |
| 68 return new SubstringWrapper(internalString, | 70 return new SubstringWrapper(internalString, |
| 69 begin + initial, end - terminal); | 71 begin + initial, end - terminal); |
| 70 } | 72 } |
| 71 | 73 |
| 72 bool get isEmpty => begin == end; | 74 bool get isEmpty => begin == end; |
| 73 | 75 |
| 74 bool isPrivate() => !isEmpty && identical(internalString.charCodeAt(begin), $_
); | 76 bool isPrivate() => !isEmpty && identical(internalString.charCodeAt(begin), $_
); |
| 75 } | 77 } |
| OLD | NEW |