OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 import 'package:front_end/src/base/errors.dart'; | 5 import 'package:front_end/src/base/errors.dart'; |
6 import 'package:front_end/src/fasta/fasta_codes.dart'; | 6 import 'package:front_end/src/fasta/fasta_codes.dart'; |
7 import 'package:front_end/src/fasta/scanner/error_token.dart'; | 7 import 'package:front_end/src/fasta/scanner/error_token.dart'; |
8 import 'package:front_end/src/fasta/scanner/token.dart'; | 8 import 'package:front_end/src/scanner/token.dart' show Token; |
9 import 'package:front_end/src/fasta/scanner/token_constants.dart'; | 9 import 'package:front_end/src/fasta/scanner/token_constants.dart'; |
10 | 10 |
11 /** | 11 /** |
12 * The error codes used for errors detected by the scanner. | 12 * The error codes used for errors detected by the scanner. |
13 */ | 13 */ |
14 class ScannerErrorCode extends ErrorCode { | 14 class ScannerErrorCode extends ErrorCode { |
15 /** | 15 /** |
16 * Parameters: | 16 * Parameters: |
17 * 0: the illegal character | 17 * 0: the illegal character |
18 */ | 18 */ |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 token = token.next; | 137 token = token.next; |
138 // If we've found an EOF token, its charOffset indicates where the end of | 138 // If we've found an EOF token, its charOffset indicates where the end of |
139 // the input is. | 139 // the input is. |
140 if (token.isEof) return token.charOffset == charOffset; | 140 if (token.isEof) return token.charOffset == charOffset; |
141 // If we've found a non-error token, then we know there is additional input | 141 // If we've found a non-error token, then we know there is additional input |
142 // text after [charOffset]. | 142 // text after [charOffset]. |
143 if (token.type.kind != BAD_INPUT_TOKEN) return false; | 143 if (token.type.kind != BAD_INPUT_TOKEN) return false; |
144 // Otherwise keep looking. | 144 // Otherwise keep looking. |
145 } | 145 } |
146 } | 146 } |
OLD | NEW |