Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 library fasta.scanner.abstract_scanner; | 5 library fasta.scanner.abstract_scanner; |
| 6 | 6 |
| 7 import 'dart:collection' show ListMixin; | 7 import 'dart:collection' show ListMixin; |
| 8 | 8 |
| 9 import 'dart:typed_data' show Uint16List, Uint32List; | 9 import 'dart:typed_data' show Uint16List, Uint32List; |
| 10 | 10 |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 127 * Returns the current string offset. | 127 * Returns the current string offset. |
| 128 * | 128 * |
| 129 * In the [StringScanner] this is identical to the [scanOffset]. In the | 129 * In the [StringScanner] this is identical to the [scanOffset]. In the |
| 130 * [Utf8BytesScanner] it is computed based on encountered UTF-8 characters. | 130 * [Utf8BytesScanner] it is computed based on encountered UTF-8 characters. |
| 131 */ | 131 */ |
| 132 int get stringOffset; | 132 int get stringOffset; |
| 133 | 133 |
| 134 /** | 134 /** |
| 135 * Returns the first token scanned by this [Scanner]. | 135 * Returns the first token scanned by this [Scanner]. |
| 136 */ | 136 */ |
| 137 Token firstToken(); | 137 Token firstToken() => tokens.next; |
| 138 | 138 |
| 139 /** | 139 /** |
| 140 * Returns the last token scanned by this [Scanner]. | 140 * Returns the last token scanned by this [Scanner]. |
| 141 */ | 141 */ |
| 142 Token previousToken(); | 142 Token previousToken() => tail; |
|
ahe
2017/03/14 14:09:27
I think we can delete this method.
danrubel
2017/03/14 16:55:15
Done.
| |
| 143 | 143 |
| 144 /** | 144 /** |
| 145 * Notifies that a new token starts at current offset. | 145 * Notifies that a new token starts at current offset. |
| 146 */ | 146 */ |
| 147 void beginToken() { | 147 void beginToken() { |
| 148 tokenStart = stringOffset; | 148 tokenStart = stringOffset; |
| 149 } | 149 } |
| 150 | 150 |
| 151 /** | 151 /** |
| 152 * Appends a substring from the scan offset [:start:] to the current | 152 * Appends a substring from the scan offset [:start:] to the current |
| (...skipping 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1241 switchToUint32(newLength); | 1241 switchToUint32(newLength); |
| 1242 } | 1242 } |
| 1243 } | 1243 } |
| 1244 | 1244 |
| 1245 void switchToUint32(int newLength) { | 1245 void switchToUint32(int newLength) { |
| 1246 final newArray = new Uint32List(newLength); | 1246 final newArray = new Uint32List(newLength); |
| 1247 newArray.setRange(0, arrayLength, array); | 1247 newArray.setRange(0, arrayLength, array); |
| 1248 array = newArray; | 1248 array = newArray; |
| 1249 } | 1249 } |
| 1250 } | 1250 } |
| OLD | NEW |