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

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: merge 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 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after
1232 switchToUint32(newLength); 1244 switchToUint32(newLength);
1233 } 1245 }
1234 } 1246 }
1235 1247
1236 void switchToUint32(int newLength) { 1248 void switchToUint32(int newLength) {
1237 final newArray = new Uint32List(newLength); 1249 final newArray = new Uint32List(newLength);
1238 newArray.setRange(0, arrayLength, array); 1250 newArray.setRange(0, arrayLength, array);
1239 array = newArray; 1251 array = newArray;
1240 } 1252 }
1241 } 1253 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/analyzer/token_utils.dart ('k') | pkg/front_end/lib/src/fasta/scanner/array_based_scanner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698