Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(271)

Side by Side Diff: pkg/front_end/lib/src/fasta/scanner/abstract_scanner.dart

Issue 2731863002: move comment tokens into preceedingComments field (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_INFO, -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 /**
53 * A pointer to the stream of comment tokens created by this scanner
54 * before they are assigned to the [Token] precedingComments field
55 * of a non-comment token. A value of `null` indicates no comment tokens.
56 */
57 Token comments;
58
59 /**
60 * A pointer to the last scanned comment token or `null` if none.
61 */
62 Token commentsTail;
63
52 final List<int> lineStarts; 64 final List<int> lineStarts;
53 65
54 AbstractScanner(this.includeComments, {int numberOfBytesHint}) 66 AbstractScanner(this.includeComments, {int numberOfBytesHint})
55 : lineStarts = new LineStarts(numberOfBytesHint) { 67 : lineStarts = new LineStarts(numberOfBytesHint) {
56 this.tail = this.tokens; 68 this.tail = this.tokens;
57 } 69 }
58 70
59 /** 71 /**
60 * Advances and returns the next character. 72 * Advances and returns the next character.
61 * 73 *
(...skipping 1177 matching lines...) Expand 10 before | Expand all | Expand 10 after
1239 switchToUint32(newLength); 1251 switchToUint32(newLength);
1240 } 1252 }
1241 } 1253 }
1242 1254
1243 void switchToUint32(int newLength) { 1255 void switchToUint32(int newLength) {
1244 final newArray = new Uint32List(newLength); 1256 final newArray = new Uint32List(newLength);
1245 newArray.setRange(0, arrayLength, array); 1257 newArray.setRange(0, arrayLength, array);
1246 array = newArray; 1258 array = newArray;
1247 } 1259 }
1248 } 1260 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698