| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 */ | 63 */ |
| 64 CommentToken comments; | 64 CommentToken comments; |
| 65 | 65 |
| 66 /** | 66 /** |
| 67 * A pointer to the last scanned comment token or `null` if none. | 67 * A pointer to the last scanned comment token or `null` if none. |
| 68 */ | 68 */ |
| 69 Token commentsTail; | 69 Token commentsTail; |
| 70 | 70 |
| 71 final List<int> lineStarts; | 71 final List<int> lineStarts; |
| 72 | 72 |
| 73 AbstractScanner(this.includeComments, {int numberOfBytesHint}) | 73 AbstractScanner(this.includeComments, this.scanGenericMethodComments, |
| 74 {int numberOfBytesHint}) |
| 74 : lineStarts = new LineStarts(numberOfBytesHint) { | 75 : lineStarts = new LineStarts(numberOfBytesHint) { |
| 75 this.tail = this.tokens; | 76 this.tail = this.tokens; |
| 76 } | 77 } |
| 77 | 78 |
| 78 /** | 79 /** |
| 79 * Advances and returns the next character. | 80 * Advances and returns the next character. |
| 80 * | 81 * |
| 81 * If the next character is non-ASCII, then the returned value depends on the | 82 * If the next character is non-ASCII, then the returned value depends on the |
| 82 * scanner implementation. The [Utf8BytesScanner] returns a UTF-8 byte, while | 83 * scanner implementation. The [Utf8BytesScanner] returns a UTF-8 byte, while |
| 83 * the [StringScanner] returns a UTF-16 code unit. | 84 * the [StringScanner] returns a UTF-16 code unit. |
| (...skipping 1204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1288 switchToUint32(newLength); | 1289 switchToUint32(newLength); |
| 1289 } | 1290 } |
| 1290 } | 1291 } |
| 1291 | 1292 |
| 1292 void switchToUint32(int newLength) { | 1293 void switchToUint32(int newLength) { |
| 1293 final newArray = new Uint32List(newLength); | 1294 final newArray = new Uint32List(newLength); |
| 1294 newArray.setRange(0, arrayLength, array); | 1295 newArray.setRange(0, arrayLength, array); |
| 1295 array = newArray; | 1296 array = newArray; |
| 1296 } | 1297 } |
| 1297 } | 1298 } |
| OLD | NEW |