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

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

Issue 2796723002: Add CommentToken.parent and implement CommentToken.remove(). (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/scanner/token.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 847 matching lines...) Expand 10 before | Expand all | Expand 10 after
858 } 858 }
859 859
860 /** 860 /**
861 * Append the given token to the [tail] of the current stream of tokens. 861 * Append the given token to the [tail] of the current stream of tokens.
862 */ 862 */
863 void appendToken(Token token) { 863 void appendToken(Token token) {
864 tail.next = token; 864 tail.next = token;
865 tail.next.previousToken = tail; 865 tail.next.previousToken = tail;
866 tail = tail.next; 866 tail = tail.next;
867 if (comments != null) { 867 if (comments != null) {
868 for (CommentToken c = comments; c != null; c = c.next) {
869 c.parent = tail;
870 }
868 tail.precedingCommentTokens = comments; 871 tail.precedingCommentTokens = comments;
869 comments = null; 872 comments = null;
870 commentsTail = null; 873 commentsTail = null;
871 } 874 }
872 } 875 }
873 876
874 void _appendToCommentStream(Token newComment) { 877 void _appendToCommentStream(Token newComment) {
875 if (comments == null) { 878 if (comments == null) {
876 comments = newComment; 879 comments = newComment;
877 commentsTail = comments; 880 commentsTail = comments;
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
1281 switchToUint32(newLength); 1284 switchToUint32(newLength);
1282 } 1285 }
1283 } 1286 }
1284 1287
1285 void switchToUint32(int newLength) { 1288 void switchToUint32(int newLength) {
1286 final newArray = new Uint32List(newLength); 1289 final newArray = new Uint32List(newLength);
1287 newArray.setRange(0, arrayLength, array); 1290 newArray.setRange(0, arrayLength, array);
1288 array = newArray; 1291 array = newArray;
1289 } 1292 }
1290 } 1293 }
OLDNEW
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/scanner/token.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698