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 24 matching lines...) Expand all Loading... |
35 */ | 35 */ |
36 int tokenStart = -1; | 36 int tokenStart = -1; |
37 | 37 |
38 /** | 38 /** |
39 * A pointer to the token stream created by this scanner. The first token | 39 * A pointer to the token stream created by this scanner. The first token |
40 * is a special token and not part of the source file. This is an | 40 * is a special token and not part of the source file. This is an |
41 * implementation detail to avoids special cases in the scanner. This token | 41 * implementation detail to avoids special cases in the scanner. This token |
42 * is not exposed to clients of the scanner, which are expected to invoke | 42 * is not exposed to clients of the scanner, which are expected to invoke |
43 * [firstToken] to access the token stream. | 43 * [firstToken] to access the token stream. |
44 */ | 44 */ |
45 final Token tokens = new SymbolToken(EOF_INFO, -1); | 45 final Token tokens = new SymbolToken.eof(-1); |
46 | 46 |
47 /** | 47 /** |
48 * A pointer to the last scanned token. | 48 * A pointer to the last scanned token. |
49 */ | 49 */ |
50 Token tail; | 50 Token tail; |
51 | 51 |
52 /** | 52 /** |
53 * A pointer to the stream of comment tokens created by this scanner | 53 * A pointer to the stream of comment tokens created by this scanner |
54 * before they are assigned to the [Token] precedingComments field | 54 * before they are assigned to the [Token] precedingComments field |
55 * of a non-comment token. A value of `null` indicates no comment tokens. | 55 * of a non-comment token. A value of `null` indicates no comment tokens. |
(...skipping 1192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1248 switchToUint32(newLength); | 1248 switchToUint32(newLength); |
1249 } | 1249 } |
1250 } | 1250 } |
1251 | 1251 |
1252 void switchToUint32(int newLength) { | 1252 void switchToUint32(int newLength) { |
1253 final newArray = new Uint32List(newLength); | 1253 final newArray = new Uint32List(newLength); |
1254 newArray.setRange(0, arrayLength, array); | 1254 newArray.setRange(0, arrayLength, array); |
1255 array = newArray; | 1255 array = newArray; |
1256 } | 1256 } |
1257 } | 1257 } |
OLD | NEW |