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

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

Issue 2973073003: fix fasta scanner comment processing (Closed)
Patch Set: Created 3 years, 5 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 | no next file » | 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 879 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 void appendToken(Token token) { 890 void appendToken(Token token) {
891 tail.next = token; 891 tail.next = token;
892 tail.next.previous = tail; 892 tail.next.previous = tail;
893 tail = tail.next; 893 tail = tail.next;
894 if (comments != null && comments == token.precedingComments) { 894 if (comments != null && comments == token.precedingComments) {
895 comments = null; 895 comments = null;
896 commentsTail = null; 896 commentsTail = null;
897 } else { 897 } else {
898 // It is the responsibility of the caller to construct the token 898 // It is the responsibility of the caller to construct the token
899 // being appended with preceeding comments if any 899 // being appended with preceeding comments if any
900 assert(comments == null || token.isSynthetic); 900 assert(comments == null || token.isSynthetic || token is ErrorToken);
901 } 901 }
902 } 902 }
903 903
904 void _appendToCommentStream(Token newComment) { 904 void _appendToCommentStream(Token newComment) {
905 if (comments == null) { 905 if (comments == null) {
906 comments = newComment; 906 comments = newComment;
907 commentsTail = comments; 907 commentsTail = comments;
908 } else { 908 } else {
909 commentsTail.next = newComment; 909 commentsTail.next = newComment;
910 commentsTail.next.previous = commentsTail; 910 commentsTail.next.previous = commentsTail;
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
1315 switchToUint32(newLength); 1315 switchToUint32(newLength);
1316 } 1316 }
1317 } 1317 }
1318 1318
1319 void switchToUint32(int newLength) { 1319 void switchToUint32(int newLength) {
1320 final newArray = new Uint32List(newLength); 1320 final newArray = new Uint32List(newLength);
1321 newArray.setRange(0, arrayLength, array); 1321 newArray.setRange(0, arrayLength, array);
1322 array = newArray; 1322 array = newArray;
1323 } 1323 }
1324 } 1324 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698