| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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.array_based_scanner; | 5 library fasta.scanner.array_based_scanner; |
| 6 | 6 |
| 7 import 'error_token.dart' show | 7 import 'error_token.dart' show |
| 8 ErrorToken; | 8 ErrorToken; |
| 9 | 9 |
| 10 import 'keyword.dart' show | 10 import 'keyword.dart' show |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 import 'abstract_scanner.dart' show | 33 import 'abstract_scanner.dart' show |
| 34 AbstractScanner; | 34 AbstractScanner; |
| 35 | 35 |
| 36 import 'package:front_end/src/fasta/util/link.dart' show | 36 import 'package:front_end/src/fasta/util/link.dart' show |
| 37 Link; | 37 Link; |
| 38 | 38 |
| 39 abstract class ArrayBasedScanner extends AbstractScanner { | 39 abstract class ArrayBasedScanner extends AbstractScanner { |
| 40 bool hasErrors = false; | 40 bool hasErrors = false; |
| 41 | 41 |
| 42 ArrayBasedScanner(bool includeComments) | 42 ArrayBasedScanner(bool includeComments, {int numberOfBytesHint}) |
| 43 : super(includeComments); | 43 : super(includeComments, numberOfBytesHint: numberOfBytesHint); |
| 44 | 44 |
| 45 /** | 45 /** |
| 46 * The stack of open groups, e.g [: { ... ( .. :] | 46 * The stack of open groups, e.g [: { ... ( .. :] |
| 47 * Each BeginGroupToken has a pointer to the token where the group | 47 * Each BeginGroupToken has a pointer to the token where the group |
| 48 * ends. This field is set when scanning the end group token. | 48 * ends. This field is set when scanning the end group token. |
| 49 */ | 49 */ |
| 50 Link<BeginGroupToken> groupingStack = const Link<BeginGroupToken>(); | 50 Link<BeginGroupToken> groupingStack = const Link<BeginGroupToken>(); |
| 51 | 51 |
| 52 /** | 52 /** |
| 53 * Appends a fixed token whose kind and content is determined by [info]. | 53 * Appends a fixed token whose kind and content is determined by [info]. |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 * something which cannot possibly be part of a type parameter/argument | 244 * something which cannot possibly be part of a type parameter/argument |
| 245 * list, like the '=' in the above example. | 245 * list, like the '=' in the above example. |
| 246 */ | 246 */ |
| 247 void discardOpenLt() { | 247 void discardOpenLt() { |
| 248 while (!groupingStack.isEmpty && | 248 while (!groupingStack.isEmpty && |
| 249 identical(groupingStack.head.kind, LT_TOKEN)) { | 249 identical(groupingStack.head.kind, LT_TOKEN)) { |
| 250 groupingStack = groupingStack.tail; | 250 groupingStack = groupingStack.tail; |
| 251 } | 251 } |
| 252 } | 252 } |
| 253 } | 253 } |
| OLD | NEW |