| 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 879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |