| 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 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 860 if (!includeComments) return; | 860 if (!includeComments) return; |
| 861 Token newComment = createDartDocToken(type, start, asciiOnly); | 861 Token newComment = createDartDocToken(type, start, asciiOnly); |
| 862 _appendToCommentStream(newComment); | 862 _appendToCommentStream(newComment); |
| 863 } | 863 } |
| 864 | 864 |
| 865 /** | 865 /** |
| 866 * Append the given token to the [tail] of the current stream of tokens. | 866 * Append the given token to the [tail] of the current stream of tokens. |
| 867 */ | 867 */ |
| 868 void appendToken(Token token) { | 868 void appendToken(Token token) { |
| 869 tail.next = token; | 869 tail.next = token; |
| 870 tail.next.previousToken = tail; | 870 tail.next.previous = tail; |
| 871 tail = tail.next; | 871 tail = tail.next; |
| 872 if (comments != null) { | 872 if (comments != null) { |
| 873 for (CommentToken c = comments; c != null; c = c.next) { | 873 for (CommentToken c = comments; c != null; c = c.next) { |
| 874 c.parent = tail; | 874 c.parent = tail; |
| 875 } | 875 } |
| 876 tail.precedingCommentTokens = comments; | 876 tail.precedingComments = comments; |
| 877 comments = null; | 877 comments = null; |
| 878 commentsTail = null; | 878 commentsTail = null; |
| 879 } | 879 } |
| 880 } | 880 } |
| 881 | 881 |
| 882 void _appendToCommentStream(Token newComment) { | 882 void _appendToCommentStream(Token newComment) { |
| 883 if (comments == null) { | 883 if (comments == null) { |
| 884 comments = newComment; | 884 comments = newComment; |
| 885 commentsTail = comments; | 885 commentsTail = comments; |
| 886 } else { | 886 } else { |
| 887 commentsTail.next = newComment; | 887 commentsTail.next = newComment; |
| 888 commentsTail.next.previousToken = commentsTail; | 888 commentsTail.next.previous = commentsTail; |
| 889 commentsTail = commentsTail.next; | 889 commentsTail = commentsTail.next; |
| 890 } | 890 } |
| 891 } | 891 } |
| 892 | 892 |
| 893 int tokenizeRawStringKeywordOrIdentifier(int next) { | 893 int tokenizeRawStringKeywordOrIdentifier(int next) { |
| 894 // [next] is $r. | 894 // [next] is $r. |
| 895 int nextnext = peek(); | 895 int nextnext = peek(); |
| 896 if (identical(nextnext, $DQ) || identical(nextnext, $SQ)) { | 896 if (identical(nextnext, $DQ) || identical(nextnext, $SQ)) { |
| 897 int start = scanOffset; | 897 int start = scanOffset; |
| 898 next = advance(); | 898 next = advance(); |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1289 switchToUint32(newLength); | 1289 switchToUint32(newLength); |
| 1290 } | 1290 } |
| 1291 } | 1291 } |
| 1292 | 1292 |
| 1293 void switchToUint32(int newLength) { | 1293 void switchToUint32(int newLength) { |
| 1294 final newArray = new Uint32List(newLength); | 1294 final newArray = new Uint32List(newLength); |
| 1295 newArray.setRange(0, arrayLength, array); | 1295 newArray.setRange(0, arrayLength, array); |
| 1296 array = newArray; | 1296 array = newArray; |
| 1297 } | 1297 } |
| 1298 } | 1298 } |
| OLD | NEW |