| 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 |
| 11 import '../scanner.dart' | 11 import '../scanner.dart' |
| 12 show ErrorToken, Scanner, buildUnexpectedCharacterToken; | 12 show ErrorToken, Scanner, buildUnexpectedCharacterToken; |
| 13 | 13 |
| 14 import 'error_token.dart' show UnterminatedToken; | 14 import 'error_token.dart' show UnterminatedToken; |
| 15 | 15 |
| 16 import 'keyword.dart' show KeywordState, Keyword; | 16 import 'keyword.dart' show KeywordState, Keyword; |
| 17 | 17 |
| 18 import 'precedence.dart'; | 18 import 'precedence.dart'; |
| 19 | 19 |
| 20 import 'token.dart' show BeginGroupToken, CommentToken, SymbolToken, Token; | 20 import 'token.dart' show BeginGroupToken, CommentToken, SymbolToken, Token; |
| 21 | 21 |
| 22 import 'token_constants.dart'; | 22 import 'token_constants.dart'; |
| 23 | 23 |
| 24 import 'characters.dart'; | 24 import 'characters.dart'; |
| 25 | 25 |
| 26 /** |
| 27 * A constant flag indicating that fasta does not yet support generic method |
| 28 * comments. This constant will be removed once support has been added. |
| 29 * Any code that needs to be removed once support has been added |
| 30 * should reference this flag. |
| 31 */ |
| 32 const bool fastaSupportsGenericMethodComments = false; |
| 33 |
| 26 abstract class AbstractScanner implements Scanner { | 34 abstract class AbstractScanner implements Scanner { |
| 27 final bool includeComments; | 35 final bool includeComments; |
| 28 | 36 |
| 29 /** | 37 /** |
| 30 * The string offset for the next token that will be created. | 38 * The string offset for the next token that will be created. |
| 31 * | 39 * |
| 32 * Note that in the [Utf8BytesScanner], [stringOffset] and [scanOffset] values | 40 * Note that in the [Utf8BytesScanner], [stringOffset] and [scanOffset] values |
| 33 * are different. One string character can be encoded using multiple UTF-8 | 41 * are different. One string character can be encoded using multiple UTF-8 |
| 34 * bytes. | 42 * bytes. |
| 35 */ | 43 */ |
| (...skipping 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1197 switchToUint32(newLength); | 1205 switchToUint32(newLength); |
| 1198 } | 1206 } |
| 1199 } | 1207 } |
| 1200 | 1208 |
| 1201 void switchToUint32(int newLength) { | 1209 void switchToUint32(int newLength) { |
| 1202 final newArray = new Uint32List(newLength); | 1210 final newArray = new Uint32List(newLength); |
| 1203 newArray.setRange(0, arrayLength, array); | 1211 newArray.setRange(0, arrayLength, array); |
| 1204 array = newArray; | 1212 array = newArray; |
| 1205 } | 1213 } |
| 1206 } | 1214 } |
| OLD | NEW |